Jump to content

User:Highlandsgaucho

From Wikipedia, the free encyclopedia

Boolean Convolution

[edit]

In digital image processing, boolean convolution refers to the formulation of the basic operations of binary morphology (dilation and erosion) as a form of convolution over boolean images[1]: 76–77 .

Background

[edit]

Representation

[edit]

A digital image is represented as a bi-dimensional matrix , where . Intuitively, stands for row and stands for column. Alternatively, the following indexing notation may be used to avoid subscripts: . This notation will be adopted for the remaining of the article to ease readability.

In particular, a boolean image is a binary image whose values are interpreted in the boolean domain and manipulated with boolean algebra operations, such as NOT (), AND () and OR ().

Convolution

[edit]

In digital image processing, convolution[2][1]: 49–54  is a local operation between an image and a smaller array. It is formally stated:

Basically, the operation consists of sliding a window , known as the convolution kernel, across the image . For each position of the window, a pixel in the new image is calculated as the weighted sum of the original pixels lying inside the window. The convolution kernel, thus, provides the weights. More formally:

where is of size . The resulting image may be smaller depending on whether the window is slid always completely inside the original image or not. If partial overlapping is allowed, then pixel values must be assigned to the area outside the original image - typically, all 0s or all 1s.

Method

[edit]

In binary morphology, the basic operations are formulated in terms of a binary image and a structuring element. The latter acts as a convolution kernel with the difference that the origin of pixel coordinates is defined in its centre. Most importantly, the shape of the structuring element determines the effect achieved on the original image. Typically, structuring elements are used to define pixel connectivity. The type of connectivity is denoted -connectivity, where is the size of the neighborhood of connected pixels. The notation is also used to denote a -connected neighborhood.

Examples of common structuring elements.
4-connectivity
4-connectivity
8-connectivity
8-connectivity

Binary dilation

[edit]

The dilation[3] of a binary image by a structuring element consists of iteratively placing centered on each background pixel of and converting it into a foreground pixel if it is connected to any foreground pixel of according to the connectivity defined by . This results in the expansion of the original image where any overlapping (intersection) exists between the structuring element and the image's foreground.

Formally, the dilation of by can be denoted . Each pixel of the dilated image can be calculated by a convolution expressed in terms of boolean operators[1]: 74  as follows:

where we have considered the infinite extension of the structuring element with background pixels. This enables us to show that the operation is commutative, as permitted by the boolean operators AND and OR.

The following figure shows the dilation of a binary image by a 3 x 3 neighborhood (). As it can be seen, this results in an expanded foreground object and in its holes being filled in.

Binary dilation example.
Binary image with holes
Original
Binary image dilation
Dilated

Binary erosion

[edit]

The erosion[4] of a binary image by a structuring element consists of iteratively placing centered on each foreground pixel of and converting it into a background pixel if it is connected to any background pixel of according to the connectivity defined by . This results in the shrinkage of the original image where any overlapping (intersection) exists between the structuring element and the image's background.

Formally, the erosion of by can be denoted . By applying De Morgan's laws, it is possible to calculate each pixel of the eroded image by the following reciprocal convolution[1]: 75 :

The following figure shows the erosion of a noisy binary image by a 3 x 3 neighborhood (). As it can be seen, the square object shrank and the noise was completely removed.

Binary erosion example.
Noisy binary image
Original
Binary image erosion
Eroded

Application

[edit]

As it was shown in the examples, dilation is a useful tool for stuffing holes in foreground objects, whereas erosion is a useful technique for removing salty background noise. However, the most powerful applications result from the compound operations of opening (dilation after erosion) and closing (erosion after dilation).

Other combinations are also possible. For instance, dilation may be used as a form of edge detector by following its application with the subtraction of the original image. The effect is achieved by the "highlighting" provided by the pixels in the expanded region. A structuring element was used in the following example of such technique.

Use of dilation for edge detection.
Binary image for edge detection
Original
Edges of binary image
Edge detection

A similar effect is also possible by means of erosion and later subtraction from the original image. In this case, the boundary pixels are those in the original image that were lost in the erosion. A structuring element was used in the following example of such technique.

Use of erosion for edge detection.
Binary board
Original
Binary board edges
Edge detection

Alternatively, erosion may be used for isolating objects for later counting them with a component labelling technique[5]: 161–167 . This is illustrated in the following figure, where rectangular shapes were disconnected from each other by using a 65x65 structuring element.

Use of erosion for object separation.
Linked squares
Original
Separated squares
Eroded

The same effect can be obtained on coin-shaped objects by separating them by eroding the original image with a disk of 25-pixel radius. It is worth noting that the shapes of the objects were maintained by using this other form of structuring element.

Use of erosion for object separation.
Connected binary coins
Original
Separated binary coins
Eroded

References

[edit]
  1. ^ a b c d Young, Ian T.; Gerbrands, Jan J.; van Vliet, Lucas J., Fundamentals of Image Processing, Delft University of Technology, ISBN 90–75691–01–7 {{citation}}: Check |isbn= value: invalid character (help); External link in |title= (help)
  2. ^ Fisher, R.; Perkins, S.; Walker, A.; Wolfart., E. (2003). "Convolution". Retrieved January 25, 2012.
  3. ^ Fisher, R.; Perkins, S.; Walker, A.; Wolfart., E. (2003). "Dilation". Retrieved January 28, 2012.
  4. ^ Fisher, R.; Perkins, S.; Walker, A.; Wolfart., E. (2003). "Erosion". Retrieved January 28, 2012.
  5. ^ Davies, E. R., Machine Vision: Theory, Algorithms, Practicalities (3rd ed.), MORGAN KAUFMANN, ISBN 0-12-206093-8

Category:Image processing Category:Artificial intelligence