The image processing (c)

Morphological image processing notes

(P402)
Review 2.6.2 (linear operation and a non-linear operation) and 2.6.4 (set and logic operations, P46,)
in image processing, is generally defined to include the complete works of all square image elements.

  1. Morphological image processing is an image input, the output is processed to extract attributes from these images.
  2. Binary image: each pixel has only two possible gradation levels, either 0 or 255.
  3. Minimum, complement operational definition and gradation value defined as the maximum set operations, communication operations defined for the corresponding pixel of the corresponding pixel of the image is constant between the difference twenty-two each pixel.

Erosion and dilation

corrosion

\ (A \ B Ominus \)
As shown by corrosion A to B, when the yellow area in FIG region c, B is blue A, B run on the A, B of the origin (the center of the black dot b in FIG. ) a visit each element to create a new collection. If B is completely contained A, B of the origin of the constituent element in the new A collection of elements, or does not constitute. FIG eventually formed e. From the results seen in FIG. E, a boundary A is corroded.
"Structuring Element contained in the collection" clear that the elements of A and B elements overlap completely.

Corrosion narrow or refine the object in the binary image, it can be viewed as corrosion morphological filtering operation, which will be smaller than the image details of the structure element from the filtered image. Etching performed a "wire filter" function.

Swell

\ (A \ oplus B \)
expansion can "grow" or "roughening" in the binary image objects, the width and the roughened manner controlled by the structure element used.

Expanded applications:
bridges cracks.

Duality

We can use the same structuring element B Expanded background image A (complement of A), can be obtained and the results of corrosion complement of B to A.

\((A\ominus B)^c = A^c \oplus \hat{B}\)
\((A\oplus B)^c = A^c \ominus \hat{B}\)

Opening operation and closing operation

Open operation

\(A\circ B\)
B对A的开操作就是B对A先腐蚀,然后用B对结果进行膨胀。
一般会平滑物体轮廓,断开较窄的狭颈并消除细的突出物。
几何解释:

B对A的开操作的边界由B中的点建立,当B在A的边界内测滚动时,B所能达到的A的边界的最远点。B对A的开操作是通过拟合到A的B的所有平移的并集得到的。

性质:

  1. \(A\circ B\)是A的子集
  2. 如果C是D的子集,则\(C\circ B\)\(D\circ B\) 的子集
  3. \((A\circ B) \circ B = A \circ B\)

闭操作

\(A\bullet B\)
B对A的闭操作就是B对A先膨胀,然后用B对结果进行腐蚀。
集合运算符实心圆点。
通常会弥合较窄的间断和细长的沟壑,消除小的空洞,填补轮廓线中的断裂。
几何解释:

性质:

  1. A 是 \(A\bullet B\) 的子集
  2. 如果C是D的子集,则 \(C\bullet B\)\(D \bullet B\) 的子集
  3. \((A\bullet B)\bullet B = A \bullet B\)

根据性质3可以看出,算子应用一次之后,一个集合的多次开操作或者闭操作是没有影响的。

练习

原图(来源于网络):
原图

过滤出灰度在180-255之间的后
过滤出灰度在180-255之间的后

以半径为1.5的圆形结构元素进行腐蚀后
以半径为1.5的圆形结构元素进行腐蚀后

再以半径为1.5的圆形结构元素进行膨胀后
再以半径为1.5的圆形结构元素进行膨胀后

dev_open_window(0, 0, 512, 512, 'black', WindowHandle)
read_image(Image, 'bei1')
dev_display(Image)
* 按照灰度过滤
threshold(Image, Region, 180, 255)
* 腐蚀
erosion_circle(Region, RegionErosion, 1.5)
* 膨胀
dilation_circle(RegionErosion, RegionDilation, 1.5)

击中或不击中变换

形态学的击中或不击中变换是形状检测的一个基本工具。
没看懂


为什么 (W-D)对 \(A^c\) 的腐蚀会出现D的原点和E中的一横一竖?A的补集不是不包含D和E吗?

如果B表示由D及其背景组成的集合,则B在A中的匹配表示为 \(A\circledast B\),
\[ A\circledast B = (A\ominus D)\cap [A^c\ominus (W-D)] \]

\(B=(B_{1}, B_{2})\)\(B_{1} = D\)\(B_{2} = (W-D)\),则:
\[ A\circledast B = (A\ominus B_{1}) \cap (A^c\ominus B_{2}) \]

一些基本的形态学算法

边界提取

求集合A的边界,先用B对A进行腐蚀,然后执行A和腐蚀结果的差。

练习

dev_open_window(0, 0, 512, 512, 'black', WindowHandle)
read_image(Image, 'map')
threshold(Image, Region, 0, 254)
erosion_circle(Region, RegionErosion, 1.5)
* 求两个区域的不同
difference(Region, RegionErosion, RegionDifference)

原图(来源网络):

提取边界后:

孔洞填充

基于集合膨胀、求补和交集的算法。
有条件的膨胀,使填补感兴趣的区域。
应用:
消除照片中的反射。
思考:在太阳能板部分断裂缺失的缺陷检测中,是否可以通过空洞填充,获取到期望中的完好的太阳能板,然后与实际情况做比较,找出有问题的部分

未完

这几天的学习小结

  1. 总体进度偏慢,两天左右的时间粗略学习了一个例程和精读了形态学处理的约三分之一章
  2. 章节有一定的关联性,因为没什么基础,很多东西都得前后结合着跳来跳去看
  3. 边学边练的方法感觉还不错,但是因为总体进度较慢,练习量也不太够
  4. 有的问题可能不用太纠结,几何解释比一大段的话更容易理解,一大段话看不明白就先跳过
  5. 需要根据这几天的学习情况规划一下总体计划及可行性

Guess you like

Origin www.cnblogs.com/yutou2016/p/11064482.html