话说程序猿们在开始一门语言前都喜欢写这么一句话:“Hello,world!”,但关于Lena其实我也不知道是哪家的女人,MATLAB和OpenCV好像都碰过,O(∩_∩)O哈哈~
新建一个空的win32控制台应用程序,具体就不啰嗦实现了,进入今日主题:
- Mat对象使用;
- 读入一张图片 imread( const String& filename, int flags = IMREAD_COLOR );
- 创建一个窗体 namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE);
- 显示窗体 imshow(const String& winname, InputArray mat);
- 统计时间 getTickCount();
- 初始化Mat对象 zeros(Size size, int type);
- 获取图像指针 ptr<uchar>();
- 确保RGB值得到的范围在0~255之间 saturate_cast<uchar>();
- 定义一个掩膜 Mat kernel = (Mat_<char>(3, 3) << 0, -1, 0, -1, 5, -1, 0, -1, 0);
- OpenCV API 矩阵掩膜处理 filter2D( InputArray src, OutputArray dst, int ddepth,InputArray kernel, Point anchor = Poin