部分 IV
OpenCV 中的图像处理
16 图像平滑
目标
• 学习使用不同的低通滤波器对图像进行模糊
• 使用自定义的滤波器对图像进行卷积(2D 卷积)
2D 卷积
与一维信号一样,我们也可以对 2D 图像实施低通滤波(LPF),高通滤波(HPF)等。LPF 帮助我们去除噪音,模糊图像。HPF 帮助我们找到图像的边缘
OpenCV 提供的函数 cv.filter2D() 可以让我们对一幅图像进行卷积操作。下面我们将对一幅图像使用平均滤波器。下面是一个 5x5 的平均滤波器核:
操作如下:将核放在图像的一个像素 A 上,求与核对应的图像上 25(5x5)个像素的和,在取平均数,用这个平均数替代像素 A 的值。重复以上操作直到将图像的每一个像素值都更新一边。代码如下,运行一下吧。
import cv2
import numpy as np
from matplotlib import pyplot as plt img = cv2.imread('opencv_logo.png') kernel = np.ones((5,5),np.float32)/25
dst = cv2.filter2D(img,-1,kernel) plt.subplot(121),plt.imshow(img),plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(dst),plt.title('Averaging')
plt.xticks([]), plt.yticks([])
plt.show()
结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWQAAADdCAYAAACMqQgpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJztfX2MfdtZ1rN+TC/Xc7hQZUY+1DkNWJ2p0ZI7DQLhtkbQXkhqS0Wi1LQkmBo/IDFoIhCxTcQI0T9UihqNotBWS9OrIuEWIyI/khZ1boIGZogQOkewjec0lns7p5d7f8zyj32es9+zZu199sdae6+99/skO2fmfKy99tp7Petdz3rfdxlrLRQKhULRPx70XQGFQqFQZFBCVigUikSghKxQKBSJQAlZoVAoEoESskKhUCQCJWSFQqFIBErIDWGM+S5jzD8L/d0KZVljzO8NUZZC0RWMMZ82xnxJ3/VIHUb9kDMYY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糊(图像平滑)
使用低通滤波器可以达到图像模糊的目的。这对与去除噪音很有帮助。其实就是去除图像中的高频成分(比如:噪音,边界)。所以边界也会被模糊一点。(当然,也有一些模糊技术不会模糊掉边界)。OpenCV 提供了四种模糊技术。
16.1 平均
这是由一个归一化卷积框完成的。他只是用卷积框覆盖区域所有像素的平均值来代替中心元素。可以使用函数 cv2.blur() 和 cv2.boxFilter() 来完这个任务。可以同看查看文档了解更多卷积框的细节。我们需要设定卷积框的宽和高。下面是一个 3x3 的归一化卷积框:
注意:如果你不想使用归一化卷积框,你应该使用 cv2.boxFilter(),这时要传入参数 normalize=False。
下面与第一部分一样的一个例子:
import cv2
import numpy as np
from matplotlib import pyplot as plt img = cv2.imread('opencv_logo.png') blur = cv2.blur(img,(5,5)) plt.subplot(121),plt.imshow(img),plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(blur),plt.title('Blurred')
plt.xticks([]), plt.yticks([])
plt.show()
结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWQAAADdCAYAAACMqQgpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJztnV+MPMt117/1Y31zM2PHRuwiksBOHuKw4zwQ3bUQRLlBKEFcHiyDhUIEiEQILIGUh4hESEGEGJFIAQuQgjAIJJAIEn+sOCgKsYWJgJ+RzcNeyQpoVwQp3gHFCTMBE3vn3tz7yxYPPd+ZM7XVPV3dVd3V3ecjtXZ3dqa6unr6W6dOnTplrLVQFEVR+udZ3xVQFEVRClSQFUVRMkEFWVEUJRNUkBVFUTJBBVlRFCUTVJAVRVEyQQW5IcaYHzLG/OPY761RljXGfGOMspRpY4z5p8aYv9FzHfT7LFBB3mGM+V5jzC8YY7bGmF8xxnzMGPOesvdba3/MWvvn6pQ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Cnktbmfguy5XbCnQ8nNSAHl9sQTZvZaqe8DOrGpVo3RHxXBXAIAJnJzrLYC3rJ5jsM6UA9bazm+o73stF0k0tZClaLoP6/X1Na6vr/HhD3/4aJkuh9Wf+MQn9j7gU4LMHZTd80hfOMsIsZApOPw/y/JFkfC9Ze4Y2Z5V1+J+1p3IbCLI8rrq4mt3F9bV7VB81P1eZ7F0WlFyQ0YshFrIbS0lWmi3t7eVIgbg6HzueX1WZx0L+ZSPO2TZtVu+FMU6PmH5uTJRd5GC3PRetEkQ1AYVZEU5QV8Pp0/E2tLXtfgIFcsU7ZEb+Tn0FEVRJooKsqIoSiaoICuKomSCCrKiKEomqCAriqJkQmgc8hpAeMyLotRjYa0tT6uVCP1eK4l5L4DPWmtfO/XGIEFWFEVR0qEuC0VRlExQQVYURckEFWRFUZRMUEFWFEXJBBVkRVGUTFBBVhRFyQQVZEVRlExQQVYURckEFWRFUZRM+P8QlFRdW6DAsQAAAABJRU5ErkJggg==" alt="" />
16.2 高斯模糊
现在把卷积核换成高斯核(简单来说,方框不变,将原来每个方框的值是相等的,现在里面的值是符合高斯分布的,方框中心的值最大,其余方框根据距离中心元素的距离递减,构成一个高斯小山包。原来的求平均数现在变成求加权平均数,全就是方框里的值)。实现的函数是 cv2.GaussianBlur()。我们需要指定高斯核的宽和高(必须是奇数)。以及高斯函数沿 X,Y 方向的标准差。如果我们只指定了 X 方向的的标准差,Y 方向也会取相同值。如果两个标准差都是 0,那么函数会根据核函数的大小自己计算。高斯滤波可以有效的从图像中去除高斯噪音。
如果你愿意的话,你也可以使用函数 cv2.getGaussianKernel() 自己构建一个高斯核。
如果要使用高斯模糊的话,上边的代码应该写成:
#0 是指根据窗口大小( 5,5 )来计算高斯函数标准差
blur = cv2.GaussianBlur(img,(5,5),0)
结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWQAAADdCAYAAACMqQgpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0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WJZiWWbMvWn/m5yop9U/aS/pxPHOyXkcDgcs/ydSAqpymUlQ0tGuo8y5djI9bn2Rei0gYHfoK3BcDjM9PQ08/PzOUsWeoNMy2BOPRP0JuPGxgabm5vHzm0PTNGSVSoy0J+zk1y6a8nmEpbcNqew96eGJuVM/aS/t7GxgVKKjY2NrPfCLlnku2JMbmuxYAjZwCAL8hmcbvjrpiKxQlEqokkFPQk4+byf2u8F/CnoGRgYGFQhDCEbGBgY+ASGkA0MDAx8AkPIBgYGBj6BIWQDAwMDn8CpH/JjYNq75hhUOUYty0qdUstDmOfawGM8CbxjWda3sn3QESEbGBgYGHgHI1kYGBgY+ASGkA0MDAx8AkPIBgYGBj6BIWQDAwMDn8AQsoGBgYFPYAjZwMDAwCcwhGxgYGDgExhCNjAwMPAJDCEbGBgY+AT/PxrN6Jc3YZ9KAAAAAElFTkSuQmCC" alt="" />
16.3 中值模糊
顾名思义就是用与卷积框对应像素的中值来替代中心像素的值。这个滤波器经常用来去除椒盐噪声。前面的滤波器都是用计算得到的一个新值来取代中心像素的值,而中值滤波是用中心像素周围(也可以使他本身)的值来取代他。他能有效的去除噪声。卷积核的大小也应该是一个奇数。
在这个例子中,我们给原始图像加上 50% 的噪声然后再使用中值模糊。
代码:
median = cv2.medianBlur(img,5)
# 运行有问题,出不了如下结果,下图为照搬的
结果:
16.4 双边滤波
函数 cv2.bilateralFilter() 能在保持边界清晰的情况下有效的去除噪音。但是这种操作与其他滤波器相比会比较慢。我们已经知道高斯滤波器是求中心点邻近区域像素的高斯加权平均值。这种高斯滤波器只考虑像素之间的空间关系,而不会考虑像素值之间的关系(像素的相似度)。所以这种方法不会考虑一个像素是否位于边界。因此边界也会别模糊掉,而这正不是我们想要。双边滤波在同时使用空间高斯权重和灰度值相似性高斯权重。空间高斯函数确保只有邻近区域的像素对中心点有影响,灰度值相似性高斯函数确保只有与中心像素灰度值相近的才会被用来做模糊运算。所以这种方法会确保边界不会被模糊掉,因为边界处的灰度值变化比较大。
进行双边滤波的代码如下:
#cv2.bilateralFilter(src, d, sigmaColor, sigmaSpace)
#d – Diameter of each pixel neighborhood that is used during filtering.
# If it is non-positive, it is computed from sigmaSpace
#9 邻域直径,两个 75 分别是空间高斯函数标准差,灰度值相似性高斯函数标准差
blur = cv2.bilateralFilter(img,9,75,75)
# 运行有问题,出不了如下结果,下图为照搬的
结果:
看见了把,上图中的纹理被模糊掉了,但是边界还在。
17 形态学转换
目标
• 学习不同的形态学操作,例如腐蚀,膨胀,开运算,闭运算等
• 我们要学习的函数有:cv2.erode(),cv2.dilate(),cv2.morphologyEx()
等
原理
形态学操作是根据图像形状进行的简单操作。一般情况下对二值化图像进行的操作。需要输入两个参数,一个是原始图像,第二个被称为结构化元素或核,它是用来决定操作的性质的。两个基本的形态学操作是腐蚀和膨胀。他们的变体构成了开运算,闭运算,梯度等。我们会以下图为例逐一介绍它们。
17.1 腐蚀
就像土壤侵蚀一样,这个操作会把前景物体的边界腐蚀掉(但是前景仍然是白色)。这是怎么做到的呢?卷积核沿着图像滑动,如果与卷积核对应的原图像的所有像素值都是 1,那么中心元素就保持原来的像素值,否则就变为零。
这会产生什么影响呢?根据卷积核的大小靠近前景的所有像素都会被腐蚀掉(变为 0),所以前景物体会变小,整幅图像的白色区域会减少。这对于去除白噪声很有用,也可以用来断开两个连在一块的物体等。
这里我们有一个例子,使用一个 5x5 的卷积核,其中所有的值都是以。让我们看看他是如何工作的:
import cv2
import numpy as np img = cv2.imread('j.png',0)
kernel = np.ones((5,5),np.uint8)
erosion = cv2.erode(img,kernel,iterations = 1)
结果:
17.2 膨胀
与腐蚀相反,与卷积核对应的原图像的像素值中只要有一个是 1,中心元素的像素值就是 1。所以这个操作会增加图像中的白色区域(前景)。一般在去噪声时先用腐蚀再用膨胀。因为腐蚀在去掉白噪声的同时,也会使前景对象变小。所以我们再对他进行膨胀。这时噪声已经被去除了,不会再回来了,但是前景还在并会增加。膨胀也可以用来连接两个分开的物体。
dilation = cv2.dilate(img,kernel,iterations = 1)
结果:
17.3 开运算
先进性腐蚀再进行膨胀就叫做开运算。就像我们上面介绍的那样,它被用来去除噪声。这里我们用到的函数是 cv2.morphologyEx()。
opening = cv2.morphologyEx(img, cv2.MORPH_OPEN, kernel)
结果:
17.4 闭运算
先膨胀再腐蚀。它经常被用来填充前景物体中的小洞,或者前景物体上的小黑点。
closing = cv2.morphologyEx(img, cv2.MORPH_CLOSE, kernel)
结果:
17.5 形态学梯度
其实就是一幅图像膨胀与腐蚀的差别。
结果看上去就像前景物体的轮廓。
gradient = cv2.morphologyEx(img, cv2.MORPH_GRADIENT, kernel)
结果:
17.6 礼帽
原始图像与进行开运算之后得到的图像的差。下面的例子是用一个 9x9 的核进行礼帽操作的结果。
tophat = cv2.morphologyEx(img, cv2.MORPH_TOPHAT, kernel)
结果:
17.7 黑帽
进行闭运算之后得到的图像与原始图像的差。
tophat = cv2.morphologyEx(img, cv2.MORPH_TOPHAT, kernel)
结果:
17.8 形态学操作之间的关系
我们把以上集中形态学操作之间的关系列出来以供大家参考:
结构化元素
在前面的例子中我们使用 Numpy 构建了结构化元素,它是正方形的。但有时我们需要构建一个椭圆形/圆形的核。为了实现这种要求,提供了 OpenCV函数 cv2.getStructuringElement()。你只需要告诉他你需要的核的形状和大小。
# Rectangular Kernel
>>> cv2.getStructuringElement(cv2.MORPH_RECT,(5,5))
array([[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1]], dtype=uint8)
# Elliptical Kernel
>>> cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(5,5))
array([[0, 0, 1, 0, 0],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[0, 0, 1, 0, 0]], dtype=uint8)
# Cross-shaped Kernel
>>> cv2.getStructuringElement(cv2.MORPH_CROSS,(5,5))
array([[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[1, 1, 1, 1, 1],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0]], dtype=uint8)
18 图像梯度
目标
• 图像梯度,图像边界等
• 使用到的函数有:cv2.Sobel(),cv2.Schar(),cv2.Laplacian() 等
原理
梯度简单来说就是求导。
OpenCV 提供了三种不同的梯度滤波器,或者说高通滤波器:Sobel,Scharr 和 Laplacian。我们会一一介绍他们。
Sobel,Scharr 其实就是求一阶或二阶导数。Scharr 是对 Sobel(使用小的卷积核求解求解梯度角度时)的优化。Laplacian 是求二阶导数。
18.1 Sobel 算子和 Scharr 算子
Sobel 算子是高斯平滑与微分操作的结合体,所以它的抗噪声能力很好。你可以设定求导的方向(xorder 或 yorder)。还可以设定使用的卷积核的大小(ksize)。如果 ksize=-1,会使用 3x3 的 Scharr 滤波器,它的的效果要比 3x3 的 Sobel 滤波器好(而且速度相同,所以在使用 3x3 滤波器时应该尽量使用 Scharr 滤波器)。3x3 的 Scharr 滤波器卷积核如下:
18.2 Laplacian 算子
拉普拉斯算子可以使用二阶导数的形式定义,可假设其离散实现类似于二阶 Sobel 导数,事实上,OpenCV 在计算拉普拉斯算子时直接调用 Sobel 算子。计算公式如下:
拉普拉斯滤波器使用的卷积核:
代码
下面的代码分别使用以上三种滤波器对同一幅图进行操作。使用的卷积核都是 5x5 的。
import cv2
import numpy as np
from matplotlib import pyplot as plt img = cv2.imread('dave.jpg',0) laplacian = cv2.Laplacian(img,cv2.CV_64F)
sobelx = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)
sobely = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=5) plt.subplot(2,2,1),plt.imshow(img,cmap = 'gray')
plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(2,2,2),plt.imshow(laplacian,cmap = 'gray')
plt.title('Laplacian'), plt.xticks([]), plt.yticks([])
plt.subplot(2,2,3),plt.imshow(sobelx,cmap = 'gray')
plt.title('Sobel X'), plt.xticks([]), plt.yticks([])
plt.subplot(2,2,4),plt.imshow(sobely,cmap = 'gray')
plt.title('Sobel Y'), plt.xticks([]), plt.yticks([]) plt.show()
结果:
一个重要的事!
在查看上面这个例子的注释时不知道你有没有注意到:当我们可以通过参数 -1 来设定输出图像的深度(数据类型)与原图像保持一致,但是我们在代码中使用的却是 cv2.CV_64F。这是为什么呢?想象一下一个从黑到白的边界的导数是整数,而一个从白到黑的边界点导数却是负数。如果原图像的深度是np.int8 时,所有的负值都会被截断变成 0,换句话说就是把把边界丢失掉。所以如果这两种边界你都想检测到,最好的的办法就是将输出的数据类型设置的更高,比如 cv2.CV_16S,cv2.CV_64F 等。取绝对值然后再把它转回到 cv2.CV_8U。下面的示例演示了输出图片的深度不同造成的不同效果。
import cv2
import numpy as np
from matplotlib import pyplot as plt img = cv2.imread('box.png',0) # Output dtype = cv2.CV_8U
sobelx8u = cv2.Sobel(img,cv2.CV_8U,1,0,ksize=5) # Output dtype = cv2.CV_64F. Then take its absolute and convert to cv2.CV_8U
sobelx64f = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)
abs_sobel64f = np.absolute(sobelx64f)
sobel_8u = np.uint8(abs_sobel64f) plt.subplot(1,3,1),plt.imshow(img,cmap = 'gray')
plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(1,3,2),plt.imshow(sobelx8u,cmap = 'gray')
plt.title('Sobel CV_8U'), plt.xticks([]), plt.yticks([])
plt.subplot(1,3,3),plt.imshow(sobel_8u,cmap = 'gray')
plt.title('Sobel abs(CV_64F)'), plt.xticks([]), plt.yticks([]) plt.show()
结果: