Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 21-May-13 3:30am
v2
Comments
Member 10201595 20-Jun-14 17:14pm    
It is loading only first image
Member 10201595 22-Jun-14 11:57am    
do u got solution for this

it is pretty easy. Whether you load a bunch of pictures and draw all or create some controls which display the pictures is up to you.

I would prefer a big static control in which you draw your pics. You need some knowledge about controls and some heavy lifting for pictures.

So here is my favourite graphic article: CxImage[^]
 
Share this answer
 
Comments
sindhu reddy 21-May-13 9:41am    
thanks for reply...
The OpenCV tutorial of DisplayManyImages may help.

http://code.opencv.org/projects/opencv/wiki/DisplayManyImages[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900