您的位置:首页 > 运维架构

【opencv 官方教程】翻译3 图像处理 上

2016-12-25 23:24 453 查看

图像处理

Image Processing (imgproc module)
In this section you will learn about the image processing (manipulation) functions inside OpenCV.

 平滑处理

Smoothing Images
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Let's take a look at some basic linear filters!

以分布位置为坐标,按照正态分布的值为权重,重新填充每个像素,以拉近相邻像素之间的值。

g(i,j)=∑k,lf(i+k,j+l)h(k,l)



 蚀刻和扩张

Eroding and Dilating
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Let's change the shape of objects!







蚀刻是将深色部分减少

扩张是把亮色部分减少
cv::erode
cv::dilate

图像缩放

Image Pyramids
Compatibility: > OpenCV 2.0
Author: Ana Huamán
What if I need a bigger/smaller image?
                                                                            

116⎡⎣⎢⎢⎢⎢⎢1464141624164624362464162416414641⎤⎦⎥⎥⎥⎥⎥

Use the OpenCV functions
cv::pyrUp and
cv::pyrDown to downsample or upsample a given image.

通过上面的函数放大或者缩小图片

阈值操作

Basic Thresholding Operations
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.


如同电路中的触发器,

cv::threshold这个功能通过特定阈值,将图像进行二值化操作
Perform basic thresholding operations using OpenCV funct
aa25
ion
cv::threshold

类比于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

Adding borders to your images
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Where we learn how to pad our images!

属于简单的小练手,可以进入官网尝试一下

梯度

Sobel Derivatives
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

拉普拉斯变换

 

Laplace Operator
Compatibility: > OpenCV 2.0
Author: Ana Huamán
Where we learn about the Laplace operator and how to detect edges with it.

上面一部分从一阶导数中获取了图像变化强烈程度的信息,也就是梯度,这一部分获取变化程度的变化程度,即二阶导数(通过拉普拉斯变换)

据描述,这个功能:1具有表现轮廓的能力;2增强了色彩差别不大的部分的轮廓表现效果。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐