Download presentation
Presentation is loading. Please wait.
Published byDerick George Modified over 7 years ago
1
Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 5
2
1. (a) Perform morphological dilation of the image A with the structuring element B.
Dilation is:
3
(b) Perform morphological erosion of the image A with the structuring element B.
Erosion is: (Demo)
4
Opening is erosion followed by dilation:
Note that when there is zero in the origin of the structuring element, the eroded image may contain 1-pixels that did not appear in the input image! Erosion: For a pixel in matrix A, if some neighbors, according to B, are all 1-pixel, that center pixel will be set to 1 in the resulting image if it is 0-pixel originally.
5
Opening is erosion followed by dilation:
Now, note that in dilation, 1-pixels may disappear if there is zero in the origin of structuring element. Dilation: For each 1-pixel in matrix A , their neighbors, according to B, will be set to 1; in addition, the center pixel will be set the same value as the origin value of B. (Demo)
6
Let us do gradient based edge detection using sobel masks:
We process only such pixels that have all the needed neighbors.
7
Now, we have the x and y components of the gradient vectors.
8
Round to 8 directions, and get the following gradient orientations:
To perform non-maximum suppression, go through each pixel and look towards gradient orientation and the opposite direction. If the gradient magnitude at either of these pixels is higher than in this pixel, set this pixel to zero.
9
Finally, let’s do global thresholding (value=40) to get the binary edge image.
This results in the following binary edge image: (Demo)
10
First, find functions representing the probability density functions.
Knowing that the area under a PDF (probability density function) must equal to 1, the functions can be deduced from the figure.
11
For p1(z), using area of triangle,
(3, 1) h1 (1, 0) For p1(z), using area of triangle, p1(z) goes through points (1, 0) and (3, 1) when z is in [1, 3] and zero at other points. From this, we get:
12
For p2(z), from area of rectangle:
And from this:
13
The optimal threshold T can be computed from equation (10
The optimal threshold T can be computed from equation ( ) in Page 605: Given that P2 = 2P1, and assuming T is in [1, 3]:
14
Split into four disjoint quadrants the regions Ri for which P(Ri) =FALSE;
Merge adjacent regions Ri and Rj for which P(Rj∪ Rk) = TRUE; Stop when there are no more possible splits or merges. R11 R1 R12 R2 merge R13 R14 R3 R4
15
merge R324
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.