OpenCV :: adaptiveThreshold()
2015-08-10 11:29
363 查看
Applies an adaptive threshold to an array. void adaptiveThreshold(InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) Parameters: src – Source 8-bit single-channel image. dst – Destination image of the same size and the same type as src maxValue – Non-zero value assigned to the pixels for which the condition is satisfied. See the details below adaptiveMethod – Adaptive thresholding algorithm to use, ADAPTIVE_THRESH_MEAN_C or ADAPTIVE_THRESH_GAUSSIAN_C, See the details below. thresholdType – Thresholding type that must be either THRESH_BINARY or THRESH_BINARY_INV blockSize – Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on C – Constant subtracted from the mean or weighted mean (see the details below). Normally, it is positive but may be zero or negative as well The function transforms a grayscale image to a binary image according to the formulae:
where T(x,y)is a threshold calculated individually for each pixel For the method ADAPTIVE_THRESH_MEAN_C , the threshold value T(x,y) is a mean of the \texttt{blockSize} \times \texttt{blockSize} neighborhood of (x, y) minus C . ADAPTIVE_THRESH_MEAN_C: 计算(x,y)为中心的方块内的均值 - C = (x,y)的值 For the method ADAPTIVE_THRESH_GAUSSIAN_C , the threshold value T(x, y) is a weighted sum (cross-correlation with a Gaussian window) of the \texttt{blockSize} \times \texttt{blockSize} neighborhood of (x, y) minus C . The default sigma (standard deviation) is used for the specified blockSize . See getGaussianKernel() . ADAPTIVE_THRESH_GAUSSIAN_C:计算(x,y)为中心的高斯块(方块不同位置权重不一样)内的均值 - C = (x, y)的值
相关文章推荐
- python中使用OpenCV进行人脸检测的例子
- opencv 做人脸识别 opencv 人脸匹配分析
- 使用opencv拉伸图像扩大分辨率示例
- OpenCV 2.4.3 C++ 平滑处理分析
- 利用Python和OpenCV库将URL转换为OpenCV格式的方法
- python结合opencv实现人脸检测与跟踪
- 在树莓派2或树莓派B+上安装Python和OpenCV的教程
- OpenCV配置,从来没有这么简单!
- ubuntu下opencv和qt的安装配置
- OpenCV学习笔记(二十五)——OpenCV图形界面设计Qt+VS2008
- 分享一些OpenCV实现立体视觉的经验
- 关于OpenCv图像变换与基本图形检测
- "应用程序正常初始化失败"-0xc0150002 解决办法
- OpenCV->HSV色彩空间
- opencv 内存泄露
- OpenCV函数cvFindContours
- OpenCV 2.3.1图像文件的读入和显示
- opencv2 矩阵方式 resize图像缩放代码
- OpenCV 灰度直方图
- 彩色图转为灰度图