Professional Documents
Culture Documents
RETRIEVAL
Query by example
Using a test image
QBIC
VIRAGE
EXCALIBUR
Algorithm Color Histogram
Matching : Basics
The histogram of a digital image with gray levels in the
range 0…L-1 is given by a discrete function
Hist (rk) = nk
Where,
rk is the kth gray level
k=0 …L-1,
L is the number of intensity levels.
nk = number of pixels at gray level rk.
Algorithm Color Histogram
Matching : Feature
Extraction
For height of bitmap to 0
For 0 to width of bitmap
Read pixel
if pixel value=ith gray level
increment (histogram at ith gray level)
else
continue
Algorithm Color Histogram
Matching : Feature Matching
255
where,
j denotes the various gray levels
hist_query is the histogram of query image,
hist_database is histogram of the database image.
histdist is error difference or distance metric.
The nearest matching database images with the
query image has the least distance metric. The exact
match is the one with the zero distance metric.
Algorithm Bit Plane
Histogram Matching : Basics
Image is composed of eight one bit planes,
bit plane 0 for the Least Significant Bit
.
.
bit plane 7 for Most Significant Bit.
Visually significant information is contributed by
higher order bits and least significant bits
contribute less.
When total number of pixels over the entire
image is counted in which a particular ith bit is
set to 1, it gives the ith bit plane Histogram
Algorithm Bit Plane
Histogram Matching :
Feature Extraction
Pixel
yes
7 bit
th
7th bit hist
set
no
yes
6th
6th bit hist
bit
set
no
yes
0th 0th bit hist
bit
set
Algorithm Bit Plane
Histogram Matching :
Feature Extraction
For height of bitmap to 0
For 0 to width of bitmap
Read pixel
if pixel value at ith bit plane is 1
increment (histogram [ith bit plane])
else
continue
Algorithm Bit Plane
Histogram Matching :
Feature Matching
Bit plane histogram is computed for the query image
Distance between histograms of database images
and query image is as shown:
………..
Sub Region 1
Algorithm Spatial Histogram
Matching : Defining Regions
class Point Region()
{ int x,y; {
Point() tl.x=0;tl.y=0;
{x=0;y=0;}} tr.x=0;tr.y=0;
bl.x=0;bl.y=0;
class Region br.x=0;br.y=0;
{ Point tl=new Point();
Point tr=new Point(); }
Point bl=new Point();
Point br=new Point(); };
Algorithm Spatial Histogram
Matching : Defining Regions
public void defineRegion() r2.bl.x=w1*2;r2.bl.y=h1*6;
{ int w1=iw/8; r2.br.x=w1*6;r2.br.y=h1*6;
int h1=ih/8; //Region 3
//Region 1 r3.tl.x=w1*1;r3.tl.y=h1*1;
r1.tl.x=w1*3;r1.tl.y=h1*3; r3.tr.x=w1*7;r3.tr.y=h1*1;
r1.tr.x=w1*5;r1.tr.y=h1*3; r3.bl.x=w1*1;r3.bl.y=h1*7;
r1.bl.x=w1*3;r1.bl.y=h1*5; r3.br.x=w1*7;r3.br.y=h1*7;
r1.br.x=w1*5;r1.br.y=h1*5; //Region 4
//Region 2 r4.tl.x=0;r4.tl.y=0;
r2.tl.x=w1*2;r2.tl.y=h1*2; r4.tr.x=iw;r4.tr.y=0;
r2.tr.x=w1*6;r2.tr.y=h1*2; r4.bl.x=0;r4.bl.y=ih;
r4.br.x=iw;r4.br.y=ih; }
Algorithm Spatial Histogram
Matching : Finding Region of
Pixel(x,y)
String region="";
if((x>=r1.tl.x&&x<=r1.tr.x)&&(y>=r1.tl.y&&y<=r1.bl.y))
region="Region1";
Algorithm Spatial Histogram
Matching : Finding Region of
Pixel(x,y)
else if((x>=r3.tl.x&&x<=r3.tr.x)&&(y>=r3.tl.y&&y<=r3.bl.y))
{
region="Region3";
}
else
{
region="Region4";
}
return region;
}
Algorithm Spatial Histogram
Matching : How it Works
[9]. Flickner, M et al “Query by image and video content: the QBIC system” IEEE Computer
28(9), 23-92