Today, according to the online tutorial to try the most basic picture display.
First of all, I would like to say the compile-time problem, at the beginning of the compilation will appear unrecognized Cvreleaseimage, because there is no corresponding core library files in the configuration.
Add in to solve the problem.
Another problem is that after compiling the program, you are prompted to deny access, which looks like the League of Legends. Seems to be lol shut down what debugging function, in short, restart the computer just fine.
Finally put the corresponding code:
#include <iostream>//#include <opencv/cv.h>//#include <opencv/cxcore.h>#include <opencv2/highgui/highgui.hpp>//Show PicturesintMain () {Iplimage* src = cvloadimage ("d:\\1.jpg"); Cvnamedwindow (" Picture"); Cvshowimage (" Picture", SRC); Cvwaitkey (0); Cvreleaseimage (&src); Cvdestroywindow (" Picture"); return 0;}
Now I still do not understand the principle of the inclusion of the library, the beginning of the video to do when the include <opencv/cv.h> written in the inside, now note found that there is no problem ah. With more exposure to OPENCV, you may be able to understand this slowly.
"OpenCV Exercise" simply displays the code for the picture