Архитектура Аудит Военная наука Иностранные языки Медицина Металлургия Метрология
Образование Политология Производство Психология Стандартизация Технологии


Neighborhood Operations on Binary Images



Binary Convolution

In our survey of digital image processing, operators relating pixels in a small neighborhood emerged as a versatile and powerful tool for scalar and vector images (Chapter 4). The result of such an operation in binary images can only be a zero or a one. Consequently, neighborhood opera- tors for binary images will work on the shape of object, adding pixels to an object or deleting pixels from an object. In Sections 4.2 and 4.4 we discussed the two basic operations for combining neighboring pixels of gray value images: convolution (“weighting and summing up”) and rank value fi ltering (“sorting and selecting”). With binary images, we do not have much choice as to which kind of operations to perform. We can combine pixels only with the logical operations of Boolean algebra. We might introduce a binary convolution by replacing the multiplication of the image and mask pixels with an and operation and the summation by an or operation:


R

gm'  n = 


R

 mm', n' ∧ gm+m', n+n'.                             (18.1)


m'=− R n'=− R

+  ×   +
∧   ∨
The and denote the logical and and or operations, respectively. The binary image G is convolved with a symmetric 2R 1 2R 1 mask M. Note that in contrast to convolution operations, the mask is not mirrored at the origin (see Section 4.2.5).

What does this operation achieve? Let us assume that all the coef- fi cients of the mask are set to ‘one’. If one or more object pixels, i. e.,

481

B. Jä hne, Digital Image Processing                                                                                                       Copyright © 2002 by Springer-Verlag

ISBN 3–540–67754–2                                                                                                    All rights of reproduction in any form reserved.


482                                                                                                        18 Morphology

 





A                                           b                                           c

×
Figure 18.1: b Dilation and c erosion of a binary object in a with a 3 3 mask. The removed (erosion) and added (dilation) pixels are shown in a lighter color.

 

‘ones’, are within the mask, the result of the operation will be one, oth- erwise it is zero (Fig. 18.1a, b). Hence, the object will be dilated. Small holes or cracks will be fi lled and the contour line will become smoother, as shown in Fig. 18.2b. The operator defi ned by Eq. (18.1) is known as the dilation operator.

Interestingly, we can end up with the same eff ect if we apply rank- value fi lter (see Section 4.4) to binary images. Let us take the maximum operator. The maximum will then be one if one or more ‘ones’ are within the mask, just as with the binary convolution operation in Eq. (18.1).

The minimum operator has the opposite eff ect. Now the result is only one if the mask is completely within the object (Fig. 18.1c). In this way the object is eroded. Objects smaller than the mask disappear completely and objects connected only by a small bridge will become disconnected. The erosion of an object can also be performed using binary convolution with logical and operations:


 

R

gm'  n = 


 

R

 mm', n' ∧ gm+m', n+n'                                              (18.2)


m'=− R n'=− R

For higher-dimensional images, Eqs. (18.1) and (18.2) just need to be appended by another loop for each coordinate. In 3-Dspace, the dilation operator is, for instance,


 

R         R

gl'mn =      


 

R

 ml'm'n' ∧ gl+l', m+m', n+n'.                         (18.3)


l'=− R m'=− R n'=− R

By transferring the concepts of neighborhood operations for gray value images to binary images we have gained an important tool to op- erate on the form of objects. We have already seen in Fig. 18.1 that these operations can be used to fi ll small holes and cracks or to eliminate small objects.


18.3 General Properties                                                                 483

 

The size of the mask governs the eff ect of the operators, therefore the mask is often called the structure element. For example, an erosion operation works like a net that has holes in the shape of the mask. All objects that fi t through the hole will slip through and disappear from the image. An object remains only if at least at one point the mask is completely covered by object pixels. Otherwise it disappears.

An operator that works on the form of objects is called a morphologi- cal operator. The name originates from the research area of morphology which describes the form of objects in biology and geosciences.

 








Operations on Sets

We used a rather unconventional way to introduce morphological oper- ations. Normally, these operations are defi ned as operations on sets of pixels. We regard G as the set of all the pixels of the matrix that are not zero. M is the set of the non-zero mask pixels. With M p we denote the mask shifted with its reference point (generally but not necessarily its center) to the pixel p. Erosion is then defi ned as

G M = {p: M p G }                             (18.4)

 


and dilation as


 

G M = {p: M p G ≠ ∅ }.                                    (18.5)


These defi nitions are equivalent to Eqs. (18.1) and (18.2), respectively. We can now express the erosion of the set of pixels G by the set of pixels M as the set of all the pixels p for which M p is completely contained in

G. In contrast, the dilation of G by M is the set of all the pixels for which the intersection between G and M p is not an empty set. As the set- theoretical approach leads to more compact and illustrative formulas, we will use it from now on.

Equations Eqs. (18.1) and (18.2) still remain important for the im- plementation of morphological operations with logical operations. The erosion and dilation operators can be regarded as elementary morpho- logical operators from which other more complex operators can be built. Their properties are studied in detail in the next section.

 




General Properties

Morphological operators share most but not all of the properties we have discussed for linear convolution operators in Section 4.2. The properties discussed below are not restricted to 2-Dimages but are generally valid for N-dimensional image data.


484                                                                                                        18 Morphology

 


Shift Invariance

M
S
Shift invariance results directly from the defi nition of the erosion and di- lation operator as convolutions with binary data in Eqs. (18.1) and (18.2). Using the shift operator as defi ned in Eq. (4.17) and the operator nota- tion, we can write the shift invariance of any morphological operator

as

M (mnS G ) = mnS (M G ).                                        (18.6)


Поделиться:



Последнее изменение этой страницы: 2019-05-04; Просмотров: 205; Нарушение авторского права страницы


lektsia.com 2007 - 2024 год. Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав! (0.017 с.)
Главная | Случайная страница | Обратная связь