Hi, I am new to openCv C++, I am doing my final year project on "Content Based Image Retrieval" using Opencv 2.4.3 visual studio C++,.. I need to display input query image in separate window, and Similar images(multiple images)in another window.Pls any one help me......
here source code ..... I'm giving src input image and loading multiple images simultaniously and finding similarity distance b/w source and multiple destination images using some equation.... based on similarity distance is this possible to display similar images(many) in single window in ascending order??.. I'm not using GUI, I'm working on visual studio c++ console applications.....
int main()
{
IplImage* srcimg;
IplImage* desimg;
srcimg = cvLoadImage("E:\\projectstuff\\imgDB\\flowers\\F3.jpg",1);//src image
//File finding objects
struct _finddata_t c_file;
long hFile;
char imageDirectory[] = "E:\\projectstuff\\imgDB\\flowers";
char imageFileType[] = jpg;
char fullImagePath[1000];
char buffer[1000];
sprintf(buffer,"%s\\*.%s", imageDirectory, imageFileType);
hFile = _findfirst( buffer, &c_file );
/*Check to make sure that there are files in directory*/
if( hFile == -1L )
printf( "No %s files in current directory!\n", imageFileType );
else
{
// List all files in directory
printf( "Listing of files:\n" );
// Loop through all images of imageFileType
do
{
-------------
// Load image
desimg = cvLoadImage(fullImagePath);
if(srcimg == 0 && desimg == 0)
{
// cout<<"Error!!"<<endl;
return -1;
}
//----------------similarity distance ----
printf("\nSimilarity distance between two images = %.f",SimilarityDistance);
cvNamedWindow("User Input",1);
cvNamedWindow("Destn",1);
cvShowImage("User Input",srcimg);
cvShowImage("Destn Input",desimg);
} while( _findnext( hFile, &c_file ) == 0 );
// Close file finder object
_findclose( hFile );
}
waitKey(0);
cvReleaseImage(&srcimg);
cvReleaseImage(&desimg);
return 0;
}
Thanking You