//flags取值enum{/* 8bit, color or not */
CV_LOAD_IMAGE_UNCHANGED =-1,/* 8bit, gray */
CV_LOAD_IMAGE_GRAYSCALE =0,/* ?, color */
CV_LOAD_IMAGE_COLOR =1,/* any depth, ? */
CV_LOAD_IMAGE_ANYDEPTH =2,/* ?, any color */
CV_LOAD_IMAGE_ANYCOLOR =4,/* ?, no rotate */
CV_LOAD_IMAGE_IGNORE_ORIENTATION =128};
图片展示
Mat imshow(const string& winname, InputArray mat);
参数
含义
winname
窗口名称
mat
需要显示的图像
typedefconst _InputArray& InputArray;
窗口设定
voidnameWindow(const string& winname,int flags=WINDOW_AUTOSIZE);//第一个参数,窗口标识名字//第二个参数,窗口标识//如果已经具有相同名称的窗口已经存在,则函数不做任何事//第三个参数的可取值的介绍,来自源文件enum WindowFlags {
WINDOW_NORMAL =0x00000000,//!< the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size.
WINDOW_AUTOSIZE =0x00000001,//!< the user cannot resize the window, the size is constrainted by the image displayed.
WINDOW_OPENGL =0x00001000,//!< window with opengl support.
WINDOW_FULLSCREEN =1,//!< change the window to fullscreen.
WINDOW_FREERATIO =0x00000100,//!< the image expends as much as it can (no ratio constraint).
WINDOW_KEEPRATIO =0x00000000,//!< the ratio of the image is respected.
WINDOW_GUI_EXPANDED=0x00000000,//!< status bar and tool bar
WINDOW_GUI_NORMAL =0x00000010,//!< old fashious way};//