【学习OpenCV】——highgui
2014-09-02 12:26
274 查看
官方文档说明:点击打开链接
C++的接口,基于opencv 2.4.9
int createTrackbar(const
string& trackbarname, const string& winname,
int* value, int count,
TrackbarCallback onChange=0, void* userdata=0)
获得进度值:
int getTrackbarPos(const
string& trackbarname, const string& winname)
设置进度值:
void setTrackbarPos(const string& trackbarname,
const string& winname, int pos)
示例:点击打开链接
InputArray mat)
函数支持3种输入数据,所以要适当处理
If the image is 8-bit unsigned, it is displayed as is.
If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the value range [0,255*256] is mapped to [0,255].
If the image is 32-bit floating-point, the pixel values are multiplied by 255. That is, the value range [0,1] is mapped to [0,255].
If window was created with OpenGL support, imshow also
support ogl::Buffer , ogl::Texture2D and gpu::GpuMat as
input.
void namedWindow(const
string& winname, int flags=WINDOW_AUTOSIZE )
销毁窗口:
void destroyWindow(const
string& winname)
销毁所有窗口:
void destroyAllWindows()
调整窗口大小:
void resizeWindow(const
string& winname, int width,
int height)
刷新窗口:
void updateWindow(const
string& winname)
void setMouseCallback(const
string& winname, MouseCallback onMouse,
void* userdata=0 )
空格键:
int waitKey(int delay=0)
C++的接口,基于opencv 2.4.9
进度条
创建进度条:int createTrackbar(const
string& trackbarname, const string& winname,
int* value, int count,
TrackbarCallback onChange=0, void* userdata=0)
namedWindow("source", CV_WINDOW_NORMAL); //创建窗口 int sliderval = 10; //进度条的初始位置为10 createTrackbar("wrap","source",&sliderval,100); //最大位置100
获得进度值:
int getTrackbarPos(const
string& trackbarname, const string& winname)
设置进度值:
void setTrackbarPos(const string& trackbarname,
const string& winname, int pos)
示例:点击打开链接
图像显示
void imshow(const string& winname,InputArray mat)
函数支持3种输入数据,所以要适当处理
If the image is 8-bit unsigned, it is displayed as is.
If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the value range [0,255*256] is mapped to [0,255].
If the image is 32-bit floating-point, the pixel values are multiplied by 255. That is, the value range [0,1] is mapped to [0,255].
If window was created with OpenGL support, imshow also
support ogl::Buffer , ogl::Texture2D and gpu::GpuMat as
input.
窗口
创建窗口:void namedWindow(const
string& winname, int flags=WINDOW_AUTOSIZE )
Parameters: | name – Name of the window in the window caption that may be used as a window identifier. flags – Flags of the window. The supported flags are: WINDOW_NORMAL If this is set, the user can resize the window (no constraint). WINDOW_AUTOSIZE If this is set, the window size is automatically adjusted to fit the displayed image (see imshow() ), and you cannot change the window size manually. WINDOW_OPENGL If this is set, the window will be created with OpenGL support. |
---|
void destroyWindow(const
string& winname)
销毁所有窗口:
void destroyAllWindows()
调整窗口大小:
void resizeWindow(const
string& winname, int width,
int height)
刷新窗口:
void updateWindow(const
string& winname)
动作
鼠标void setMouseCallback(const
string& winname, MouseCallback onMouse,
void* userdata=0 )
空格键:
int waitKey(int delay=0)
Parameters: | delay – Delay in milliseconds. 0 is the special value that means “forever” |
---|
相关文章推荐
- 四、openCV学习笔记(High-level GUI and Media I/O)
- OpenCV3学习笔记-HighGUI初步
- OpenCV学习笔记18 OpenCV高级GUI和多媒体模块 HIGHGUI MODULE (二)
- OpenCV学习笔记17 OpenCV高级GUI和多媒体模块 HIGHGUI MODULE (一)
- OpenCV学习——Highgui演示-简单绘制矩形
- 【opencv学习笔记四】opencv3.4.0图形用户接口highgui函数解析
- 【Ubuntu+OpenCV】HighGUI之trackbar(滑动条)的创建--学习笔记【2】
- OpenCV学习笔记(三十)——解开VideoInput面纱highgui
- OpenCV学习笔记(十)——图形交互和媒体接口HighGUI
- opencv学习笔记2:HighGUI
- OpenCV学习笔记---HighGUI的初步
- OpenCv学习笔记(八)---细说HighGUI(图像用户界面)之滑动条createTrackbar()详解
- OpenCV学习笔记:opencv_highgui模块
- OpenCv基础学习笔记之一[highgui_c.h]
- 学习OpenCV——去除imshow的内部细小边框(修改highgui)
- 【opencv学习之十一】opencv: HighGUI参考手册
- OpenCV学习笔记08--细说HighGUI
- OpenCV学习笔记19 OpenCV高级GUI和多媒体模块 HIGHGUI MODULE (三)
- 【Ubuntu+OpenCV】HighGUI之trackbar充当开关按钮--学习笔记【3】
- opencv学习HighGUI图形用户界面初步【1】