khawaib
asked on
Image retrieval via colour histogram
Hi
I am working on a program which retrieves an image based on the query image.
The images are stored and displayed in a frame and their histograms for each image are also obtained (including the query image).
However I have problem with following part of the program. I need to obtain the distances (of histograms) between the query image and each of the other images. and then display the closest image to the query image.
for (int b = 0; b < 3; b++) {
for (int j = 0; j < 256; j++) { // for RGB 256*3
for (int i = 1; i < 11; i++) // number of images 1 to 11
{
D1= histogram[0].getFrequency( b, j) - histogram[i].getFrequency( b, j);
Sum += D1*D1;
if(Sum < Summ){
Sum = Summ;
}
Summ = Sum;
// else{
// Summ = Sum;
// }
}
}
System.out.println(" Distance " + Sum + "");
However 1st of all I don't know how to find the shortest distance
And then how to use the shortest distance to know that which histogram and therefore image it belongs to
and finaly how to use it to retreive that image to display
Thanks for your time
I am working on a program which retrieves an image based on the query image.
The images are stored and displayed in a frame and their histograms for each image are also obtained (including the query image).
However I have problem with following part of the program. I need to obtain the distances (of histograms) between the query image and each of the other images. and then display the closest image to the query image.
for (int b = 0; b < 3; b++) {
for (int j = 0; j < 256; j++) { // for RGB 256*3
for (int i = 1; i < 11; i++) // number of images 1 to 11
{
D1= histogram[0].getFrequency(
Sum += D1*D1;
if(Sum < Summ){
Sum = Summ;
}
Summ = Sum;
// else{
// Summ = Sum;
// }
}
}
System.out.println(" Distance " + Sum + "");
However 1st of all I don't know how to find the shortest distance
And then how to use the shortest distance to know that which histogram and therefore image it belongs to
and finaly how to use it to retreive that image to display
Thanks for your time
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
;-D