OpenCv (正式篇) 5----Highgui板块 /* 不断更新 */
来源:互联网 发布:剑网3脸型数据导入 编辑:程序博客网 时间:2024/05/16 01:36
- Imread()
- Imwrite()
- Imshow()
- nameWindow()
- createTrackbar()
- setMouseCallback()
Imread():
转到定义查看:
CV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR );//////! Imread flagsenum ImreadModes { IMREAD_UNCHANGED = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). IMREAD_GRAYSCALE = 0, //!< If set, always convert image to the single channel grayscale image. IMREAD_COLOR = 1, //!< If set, always convert image to the 3 channel BGR color image. IMREAD_ANYDEPTH = 2, //!< If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit. IMREAD_ANYCOLOR = 4, //!< If set, the image is read in any possible color format. IMREAD_LOAD_GDAL = 8 //!< If set, use the gdal driver for loading the image. };
imread( const String& filename, int flags = IMREAD_COLOR );
第一个参数:String filename。
第二个参数:flag
IMREAD_UNCHANGED = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped).(原始图片) IMREAD_GRAYSCALE = 0, //!< If set, always convert image to the single channel grayscale image.(灰度图) IMREAD_COLOR = 1, //!< If set, always convert image to the 3 channel BGR color image.(彩色图) IMREAD_ANYDEPTH = 2, //!< If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit. IMREAD_ANYCOLOR = 4, //!< If set, the image is read in any possible color format.(IMREAD_ANYDEPTH| IMREAD_ANYCOLOR 最真实图片) IMREAD_LOAD_GDAL = 8 //!< If set, use the gdal driver for loading the image.
Imwrite():
转到定义查看:
imwrite( const String& filename, InputArray img, const std::vector<int>& params = std::vector<int>());第一个参数:filename---String第二个参数: Mat第三个参数:不了解 待解决(因为有默认值,所以一般不填写)Imshow()转到定义查看:
void imshow(const String& winname, InputArray mat);
这个最好明白:第一个参数: String filename第二个参数: inputArray matnamedWindow()转到定义:
void namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE); // Flags for namedWindowenum { 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 };
第一个参数:窗口名称:String name;第二个参数:缺省值已经很好用了。自动调节。 createTrackbar()setMouseCallback()转到定义:void setMouseCallback(const String& window_name, MouseCallback onMouse, void* userdata = 0/*缺省值*/);
#include "opencv2/highgui.hpp"; #include <iostream>; using namespace std; using namespace cv; void onChange(int event, int x, int y, int flags, void* userdata){ cout<<"test"<<endl; }; void main(){namedWindow("test");/*Mat image=imread("D:\\Picture\\Temp.jpg",-1);imshow("test",image);*/setMouseCallback("test",onChange);waitKey(0);}
“`
各种有趣函数。。。从图像处理开始
0 0
- OpenCv (正式篇) 5----Highgui板块 /* 不断更新 */
- OpenCv 4----(正式篇)opencv的简介 /* 不断更新 */
- OpenCV 之 HighGUI 参考手册
- highgui基础 OpenCV trackbar
- opencv 3.0 绘图 highgui
- OpenCV学习HighGUI
- opencv:简单的HighGui
- 导入opencv.highgui.Highgui会报错
- opencv之highgui中createTrackbar
- 【学习OpenCV】——highgui
- 【OpenCV归纳】4 关于HighGUI
- opencv学习笔记2:HighGUI
- Opencv HighGUI函数_窗口
- 【opencv学习之十一】opencv: HighGUI参考手册
- HighGUI
- 用opencv的highgui要小心
- OpenCV--HighGUI视频读写和显示
- opencv c++函数 highgui模块 3
- dispatch_async_f 详解
- Mixin编写和使用
- sqoop安装
- Linux TCP最大连接数
- React双向绑定Mixin
- OpenCv (正式篇) 5----Highgui板块 /* 不断更新 */
- hadoop环境搭建笔记
- sql order by,desc和limit使用(mysql)
- biee echarts饼图数据引入
- 文章标题
- 棋牌游戏服务器开发心得
- 软件工程学
- 不同表单元素的使用
- Android实战技巧:ViewStub的应用(性能优化)