opencv 常用图片操作函数备忘
来源:互联网 发布:腾讯股票分红 知乎 编辑:程序博客网 时间:2024/06/05 13:26
图像翻转函数flip
Flips a 2D array around vertical, horizontal, or both axes.
- C++: void flip(InputArraysrc, OutputArraydst, int flipCode)
C: void cvFlip(const CvArr*src, CvArr*dst=NULL, intflip_mode=0)
Parameters:
- src - input array
- dst - output array of the same size and type as src.
- flipCode - a flag to specify how to flip the array; 0 means flipping around the x-axis and positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes (see the discussion below for the formulas).
The function flip flips the array in one of three different ways (row and column indices are 0-based):
The example scenarios of using the function are the following:
- Vertical flipping of the image (flipCode==0) to switch between top-left and bottom-left image origin. This is a typical operation in video processing on Microsoft Windows* OS.
- Horizontal flipping of the image with the subsequent horizontal shift and absolute difference calculation to check for a vertical-axis symmetry (flipCode>0).
- Simultaneous horizontal and vertical flipping of the image with the subsequent shift and absolute difference calculation to check for a central symmetry (flipCode<0).
- Reversing the order of point arrays (flipCode>0 orflipCode==0).
灰度直方图均衡化
equalizeHist
Equalizes the histogram of a grayscale image.
- C++: void equalizeHist(InputArray src, OutputArray dst)
- Python: cv2.equalizeHist(src[, dst]) → dst
- C: void cvEqualizeHist(const CvArr* src, CvArr* dst)
Parameters: - src – Source 8-bit single channel image.
- dst – Destination image of the same size and type as src .
The function equalizes the histogram of the input image using the following algorithm:
Calculate the histogram for src .
Normalize the histogram so that the sum of histogram bins is 255.
Compute the integral of the histogram:
Transform the image using as a look-up table:
The algorithm normalizes the brightness and increases the contrast of the image.
颜色空间变换cvtColor
Converts an image from one color space to another.
- C++: void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0 )
- Python: cv2.cvtColor(src, code[, dst[, dstCn]]) → dst
- C: void cvCvtColor(const CvArr* src, CvArr* dst, int code)
- Python: cv.CvtColor(src, dst, code) → None
Parameters: - src – Source image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision floating-point.
- dst – Destination image of the same size and depth as src .
- code – Color space conversion code. See the description below.
- dstCn – Number of channels in the destination image. If the parameter is 0, the number of the channels is derived automatically from src and code .
- opencv 常用图片操作函数备忘
- Opencv--常用操作函数讲解
- opencv 图像操作,常用 OpenCV 内置函数
- opencv 函数备忘
- OpenCV中常用的矩阵操作函数
- opencv常用图像(矩阵)操作函数
- opencv常用图像(矩阵)操作函数
- matlab常用操作备忘
- 备忘,git常用操作
- 常用git操作备忘
- GIT常用操作备忘
- grep常用备忘操作
- 数据库常用函数备忘
- C++常用函数备忘
- Opencv(Python) 教程-常用opencv 图像/视频操作函数
- GVIM常用快捷操作备忘
- PADS非常用操作备忘
- NC 数据库操作常用备忘
- WPF里的DependencyProperty(1)
- spring 调用 membase client
- 改变ABPeoplePickerNavigationController的UINavigationBar 颜色
- QueryAgent打开Query对话框
- 通讯协议的开发
- opencv 常用图片操作函数备忘
- 【宽搜】【A星】八数码难题 WikiOI 1225 Astar
- XMemcached 资料
- android中自定义loading的实现
- hdu 3401 Trade 单调队列+dp
- 解释器模的运用
- 公用方法:得到汉字的首字母(大写) 方案3
- mysql 语句备忘
- 重启nginx后丢失nginx.pid,如何重新启动nginx