Highgui is a graphical user interface module. Including:
1, input and output;
2, video capture;
3, graphics and video decoding code;
4, graphics interface and interfaces.
Because OPENCV.HPP contains the core, Objdetect, Ingproc, photo, video, featurse2d, calib3d, ML, Highgui, contrib and other modules. General development Lazy
#include <opencv2\opencv.hpp>. However, the file is submitted with a specific module header.
Namespaces will let you write code simple: using namespace CV, then you can Imread (... Otherwise you will have to c::imread every time (...) )。
Mat Class (OPENCV2): This class is very important. Be sure to check the data to figure out its structure and its use. Use class to avoid the duration of C: pointer.
Is the data structure used to hold images and other matrix data. The default size is 0. You can also initialize Dimensions: Cv::mat pic (320,640,cv::scalar (100));
To read a video or image file:
Mat scrimage = Imread ("girl.jpg");
The prototype is: Mat imread (const string & Filename,int Flags=1).
Follow the flags: Check it out, it's useful.
Image display: inshow (const string& Winname,imputarray mat). Inputarray/outputaray can often be used simply as a mat type.
Create window: Namedwindow (const string& winname,int flags=window_autosize). Infrequently used are destroywindows () or destroyallwindows ().
Output image to File: Imwrite ().
OpenCV Learning Highgui Graphical user interface initial "1"