// rgbsplit. CPP: defines the entry point for the console application. /// * ============================================ ==================================================== Name: open the image time in the folder: 2013.08 Description: sets num to control the number of opened images, to be regular =============================================================== */# include "stdafx. H "# include" CV. H "# include" highgui. H "char filename [100]; // defines a Global Array variable and stores the image name char windowname [100]; // defines a Global Array variable, save the window name iplimage * pscr; // a global image pointer at the top, pointing to the loop each time the image is loaded unsigned char * ReadImage (INT num ); // int main (INT argc, char * argv []) {ReadImage (5); // call the function return 0 ;} unsigned char * ReadImage (INT num) {for (INT I = 1; I <= num; I ++) // read the folder like {sprintf (filename ,". /test/mongod.jpg ", I); // read the photos in test to sprintf (windowname," window;d.jpg ", I) in filename ); // name the window pscr = cvloadimage (filename, 1); cvnamedwindow (windowname, cv_window_autosize); cvshowimage (windowname, pscr);} cvwaitkey (0 ); // destroy window and release memory cvreleaseimage (& pscr); cvdestroyallwindows (); Return 0 ;}
This Code sets the number of read images.