Sunteți pe pagina 1din 3

CBIR Steps are followed for computing the color histogram: (1) Selection of a color space.

(2) Quantization of the color space. (3) Computation of histograms. (4) Derivation of the histogram distance function. (5) Identification of indexing shortcuts.

Thee color histogram is defined by,

where A, B and C represent the three color channels (R, G, B or H, S, V) and N is the number of pixels in the image . Quantization: In order to reduce computation time, a 256x256x256 = 16777216 color image is quantized into a 8 x 8 x 8 = 512 color image in RGB color space. It takes really long time to compute and compare 16777216 bins of a histogram with others. This is a trade-off between performance and time. A RGB color space image should first be transformed to a HSV color space image. In HSV color space, H is quantized to 18 levels and S & V is quantized to 3 levels. The quantized HSV space has 18x3x3 = 162 histogram bins. Once a query image and a retrieval method are chosen by users, the rest of whose process is done automatically. However, the histogram data for all images in database are computed and saved in DB (Database) in advance so that only the image indexes and histogram data can be used to compare the query image with images in DB.

GlobalHisto( image) { //GCH of image is calculated // features stored in a file return histogram of the image given } retreivalImage()

{ hist2=GlobalHisto(req_img); compare(hist[i],hist2); }//end of retreivalImage() compare(hist[i],hist2) { //compare all the histograms in database for the hist2 ,hist[i] is pre calculated histograms of the images in database.hist2 is the histogram of the request*/ //distance formulas for measuring the similarity of color histograms. // Euclidean Distance. d 2 (h , g ) = (h( a ,b , c ) g (a , b , c ))2 Where h,g are 2
A B C

histograms,here its hist[i] ,hist2.There is only comparison between the identical bins in the respective histograms.

min (h( a , b , c ) , g( a , b , c ) )
//calculate the intersection distance d ( h , g ) =
A B C

min (h,g)

where |h| and |g| gives the magnitude of each histogram, which is equal to the number of samples.Colors not present in the user's query image do not contribute to the intersection distance. This reduces the contribution of background colors. //quadratic distance (Cross distance) d ( h , g ) = (h g )t A (h g ) The cross distance formula considers the cross-correlation between histogram bins based on the perceptual similarity of the colors represented by the bins. And the set of all cross-correlation values are represented by a matrix A, which is called a similarity matrix.

//Retreival Effectiveness ; 2metrics for retrieval effectiveness are recall and precision. Recall=P(A|B) P( B A ) =
P( AB ) a = , //Recall signifies the relevant images in P( A ) a+ c

the database that are retrieved in response to a query. Precision=P(A|B) P( AB ) = P( AB ) a = //Precision is the proportion of the P( B) a+ b

retrieved images that are relevant to the query. A be the set of relevant items, let B the set of

retrieved items and a,b,c and d //if retreival effectiveness and distance formulas of 2 color histograms matches,then conversion of matched histograms to images.and displays the images to user

else // no match }// end of compare()

Query image

Choose a retrieval method


RGB HSV

Quantize RGB (8 levels each) Compute the histogram Compare histogram

Convert to HSV

Quantize HSV : (18, 3, 3) levels

Show candidate images Precalculate and save histogram data in advance

DB

S-ar putea să vă placă și