图像处理
-
Image Processing (imgproc module)
In this section you will learn about the image processing (manipulation) functions inside OpenCV.
平滑处理
-
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Let's take a look at some basic linear filters!
以分布位置为坐标,按照正态分布的值为权重,重新填充每个像素,以拉近相邻像素之间的值。
蚀刻和扩张
-
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Let's change the shape of objects!



蚀刻是将深色部分减少
扩张是把亮色部分减少
图像缩放
-
Compatibility: > OpenCV 2.0
Author: Ana Huamán
What if I need a bigger/smaller image?
116⎡⎣⎢⎢⎢⎢⎢1464141624164624362464162416414641⎤⎦⎥⎥⎥⎥⎥
通过上面的函数放大或者缩小图片
阈值操作
-
Compatibility: > OpenCV 2.0
Author: Ana Huamán
After so much processing, it is time to decide which pixels stay!
-
Thresholding Operations using inRange
Compatibility: > OpenCV 2.0
Author: Rishiraj Surti
Thresholding operations using inRange function.

类比于threshold,inRange函数提供了一个区间不必从极限值开始的阈值界定方法,使程序进行二值化时关注于是否处于区间内。
Perform basic thresholding operations using OpenCV function cv::inRange
自定义线性变换、加边框
-
Making your own linear filters!
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Where we learn to design our own filters by using OpenCV functions
-
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Where we learn how to pad our images!
梯度
-
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Where we learn how to calculate gradients and use them to detect edges!
获取图片轮廓用的
关键步骤
- Use the OpenCV function cv::Sobel to calculate the derivatives from an image.
- Use the OpenCV function cv::Scharr to calculate a more accurate derivative for a kernel of size 3⋅3
拉普拉斯变换
-
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Where we learn about the Laplace operator and how to detect edges with it.
上面一部分从一阶导数中获取了图像变化强烈程度的信息,也就是梯度,这一部分获取变化程度的变化程度,即二阶导数(通过拉普拉斯变换)
据描述,这个功能:1具有表现轮廓的能力;2增强了色彩差别不大的部分的轮廓表现效果。