Presentation is loading. Please wait.

Presentation is loading. Please wait.

Morphological Image Processing

Similar presentations


Presentation on theme: "Morphological Image Processing"— Presentation transcript:

1 Morphological Image Processing
By Dr. Rajeev Srivastava

2 What is Morphology? Morphology is a broad set of image processing operations that process images based on shapes. Morphological operations apply a structuring element to an input image, creating an output image of the same size. In a morphological operation, the value of each pixel in the output image is based on a comparison of the corresponding pixel in the input image with its neighbors.

3 Definition By choosing the size and shape of the neighborhood, we can construct a morphological operation that is sensitive to specific shapes in the input image.

4 Morphological Processing
They are useful for extracting image components that are useful in representing and describing region shapes

5 The filters can be described using set theoretic notation
The filters can be described using set theoretic notation . A set is a collection of pixels in the context of an image.

6 Morphological Operations
Opening and Closing Dilation and erosion Gradient

7 Operations The most basic morphological operations are dilation and erosion. Dilation adds pixels to the boundaries of objects in an image, while erosion removes pixels on object boundaries. The number of pixels added or removed from the objects in an image depends on the size and shape of the structuring element used to process the image.

8 Set Operations Let A and B be sets. If a is the index of a pixel in A, then we write 𝑎𝜖𝐴 If a is not in A we write 𝑎⊄𝐴 If every element that is in A is also in B then A is a subset of B, written 𝐴⊆𝐵 This is equivalent to the statement 𝑎𝜖𝐴⇒𝑎𝜖𝐵 .

9 In the morphological dilation and erosion operations, the state of any given pixel in the output image is determined by applying a rule to the corresponding pixel and its neighbors in the input image. The rule used to process the pixels defines the operation as a dilation or an erosion.

10 The table lists the rules for both dilation and erosion.
Operation Rule Dilation The value of the output pixel is the maximum value of all the pixels in the input pixels neighborhood. In a binary image, if any of the pixels is set to the value 1, the output pixel is set to 1 Erosion The value of the output pixel is the minimum value of all the pixels in the input pixels neighborhood. In a binary image, if any of the pixels is set to the value 0, the output pixel is set to 0

11 Dilation It can be applied to binary as well as grey-scale images
Effect of this operator on a binary image is , it gradually increases the boundaries of the region, while the small holes in image becomes smaller Assume that A and B are two set of pixels, then the dilation of A by B is denoted by 𝐴⊕𝐵= ⋃ 𝑥𝜖𝐵 𝐴 𝑥

12 It means that A is translated by every point of the set B.
𝐴⊕𝐵={ 𝑥,𝑦 + 𝑢,𝑣 : 𝑥,𝑦 𝜖𝐴,(𝑢,𝑣)𝜖𝐵} Dilation can be considered as a union operation of all the translations of the image A caused by the elements specified in the structuring element B 𝐴⊕𝐵= 𝑛 ∪ 𝑏𝜖𝐵 (𝐴) 𝑏

13 Erosion The objective of erosion is to make an object smaller by removing its outer layer of pixels. 𝐴⊖𝐵={𝑤: 𝐵 𝑤 ⊆𝐴} This operator takes the image and structuring element as inputs and thins the object

14 Algorithms for dilation and erosion
Let the number of pixels in structuring element be k Let the number of pixels of value 1 in the input image be z Let the pixel coordinates beneath the origin of the structuring element be ( 𝑥 0 , 𝑦 0 )

15 For dilation, the output is given by 𝑔 𝑥 0 , 𝑦 0 = 1 𝑓𝑜𝑟 𝑧>0 𝑔 𝑥 0 , 𝑦 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 For erosion, the output is given by 𝑔 𝑥 0 , 𝑦 0 = 1 𝑓𝑜𝑟 𝑧=𝑘 0 𝑓𝑜𝑟 𝑧<𝑘 These algorithms can also be extended to modified dilation and erosion, which involves the use of a threshold m. The threshold is user-controlled, based on the requirement

16 Modified dilation and erosion
The algorithm for dilation can be modified using the threshold value m The mapping functions are given by 𝑔 𝑥 0 , 𝑦 0 = 1 𝑓𝑜𝑟 𝑧≥𝑚 𝑔 𝑥 0 , 𝑦 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 For modified erosion, the mapping function is given by 𝑔 𝑥 0 , 𝑦 0 = 0 𝑓𝑜𝑟 𝑧≤𝑚 𝑔 𝑥 0 , 𝑦 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

17 An another approach to morphological operations is to consider them as binary correlation operations involving logical elements The structuring element is placed on a binary image

18 Properties of dilation and erosion
The dilation and erosion shows the following properties Communicative property Associative property Distributive property Duality property Translation property Decomposition property

19 Combining Dilation and Erosion Opening and Closing
Dilation and erosion are often used in combination to implement image processing operations. The definition of a morphological opening of an image is an erosion followed by a dilation, using the same structuring element for both operations. The related operation, morphological closing of an image, is the reverse: it consists of dilation followed by an erosion with the same structuring element.

20 Opening and Closing Operations
The opening is defined as erosion followed by a dilation operator 𝐴ᵒ𝐵= 𝐴⊖𝐵 ⊕𝐵 The opening operation satisfies the following properties 1) 𝐴ᵒ𝐵 ⊆𝐴 2) 𝐴ᵒ𝐵 ᵒ𝐵=𝐴ᵒ𝐵 This is called idempotent property Opening is useful for smoothing the edges, breaking the narrow joints and thinning the protrusions that are present in the image

21 Closing is a dilation operation followed by an erosion operation
𝐴ᵜ𝐵= 𝐴⊕𝐵 ⊖𝐵

22 Properties of Opening and Closing
They show the following properties Dual transformation Ordering relationship Increasing transformation Transform invariance Idempotence

23 Hit-or-Miss transform
It is a general binary morphological operation that can be used to look for particular patterns of fore-G and background pixels of an image The algorithm is as shown below Translate the centre of the structuring element to all the points of the input image Compare the structuring element with the image pixels

24 If there is a complete match, then
the pixel underneath the structuring element is set to foreground, its called a hit. Else the pixel underneath the structuring element is set to background color, its called a miss

25 Uses of morphological operations
They are immensely useful in a variety of imaging applications which are discussed as… Boundary extraction Noise removal Thinning Thickening Convex hull Skeletonization Medical axis transform and distance transform Region filling Extraction of connected component Pruning

26 Grey-Scale Morphology
Similar to binary morphological operations, the mask moves across the image The pixel-by-pixel process is done and the resultant is produced in the output image. The structuring element can be a square matrix of size 3*3, 5*5, or larger depending upon the application

27 The erosion mask is shown as
𝐵= 𝑋 3 𝑋 2 𝑋 1 𝑋 4 𝑋 𝑋 0 𝑋 5 𝑋 6 𝑋 7

28 Comparison of grey-scale erosion and dilation
Reduces the size of the objects wrt. background Increases the six=ze of the objects Eliminates noise spikes and ragged edges It also eliminates noise spikes and ragged edges Darkens the bright objects Brighten the objects Increases the size of holes and sharpen corners Connects objects, bridge gaps,smoothenes edges, fill holes and creates outline in an image

29 Gradient The morphological gradient highlights sharp transitions in the input image. It depends less on edge directionality than the Sobel operator and is useful for locating faint but large scale structures. The morphological gradient is defined by, 𝑔= 𝑓⊕𝑏 −(𝑓⊖𝑏)

30 Gradient… It is thus the difference between a dilated image and an eroded image. Dilation removes small scale dark features and erosion removes small scale bright features. Dilation brightens the image and erosion darkens it.


Download ppt "Morphological Image Processing"

Similar presentations


Ads by Google