1 / 14

Morphological and Other Area Operations

Morphological and Other Area Operations. Introduction Morphology is the science of form and structure It is about regions or shapes, in computer vision Morphology can be used for the following tasks: Smoothing the edges of a region Forcing shapes onto region edges Counting regions

nau
Télécharger la présentation

Morphological and Other Area Operations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Morphological and Other Area Operations • Introduction • Morphology is the science of form and structure • It is about regions or shapes, in computer vision • Morphology can be used for the following tasks: • Smoothing the edges of a region • Forcing shapes onto region edges • Counting regions • Estimating sizes of regions • Morphological operations are easily seen on binary images but they can be extended to work on gray-level images Basic Morphological Operations • Consider the following image 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 • This could be represented as a set of those pixels in 5 x 3 image that have value ‘1’, namely {(0,0), (0,2), (0,4), (1,1), (1,3), (2,0), (2,2), (2,4)} 240-373 Image Processing, Lecture #11

  2. And now it is possible to do set operations on images 1 * 1 * 1 * * * 1 1 A = * 1 * 1 * B = * * * 1 1 1 * 1 * 1 * * * 1 1 Giving 1 * 1 1 1 A union B = * 1 * 1 1 1 * 1 1 1 * * * * 1 A intersection B = * * * 1 * * * * * 1 • The set on unknown pixels (*) can, theoretically, extend infinitely * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 1 * 1 * 1 * * * * * * * * * * * 1 * 1 * * * * * * * * * * * 1 * 1 * 1 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * where the circle around the top left 1 indicates the position of the origin 240-373 Image Processing, Lecture #11

  3. Dilation Technique 1: Dilation (Minkowski addition) USE: Region edge valley filling (for binary image) OPERATION: • A template (made from 1’s and *’s) is created with a known origin • The origin of this template is stepped over every element in the whole of the image • The template is ‘unioned’ where the origin of the template corresponds to a 1 in the image • The resulting template-sized matrix is then unioned with all other template-sized results (using their original position) 240-373 Image Processing, Lecture #11

  4. Dilation Example Image Template Applying the template to the first line gives Application across the whole image gives new row new column • Continually applying this to the images fills out all the holes and makes the image grow, one row and one column at a time 240-373 Image Processing, Lecture #11

  5. Erosion Technique 2: Erosion (Minkowski subtraction) USE: To remove spikes from the edges of regions OPERATION: • A template is created • The template is stepped over the image but it is .not allowed to go outside the image • For every position, if the template is the same as the image window, then the element corresponding to the origin of the template is set to a 1 Image Template Final result is unused row and column 240-373 Image Processing, Lecture #11

  6. Gray-level Erosion and Dilation Technique 3: Gray-level erosion and dilation USE: Flattening spikes and filling valleys on region edges in gray-level images OPERATION: • Let I(x,y) be an image of gray levels and R(x,y) be resulting image after I(x,y) has been dilated/eroded with m x n template T(i,j) 0 <= i <= m-1, 0 <= j <= n-1 • Gray level dilation is defined as • and gray level erosion is NOTES: • For both of the above definitions, I(x,y) = 0 for locations outside of an M x N image • Dilation is precisely the dual of the erosion operation. A dilation can be performed by reflecting the template and negating the original image and then negating the result. 240-373 Image Processing, Lecture #11

  7. Example Consider the following initial image Dilating by the template gives or subtracting 1 throughout 240-373 Image Processing, Lecture #11

  8. Example (cont.’d) Conversely, erode by the same template gives or if 1 is subtracted throughout NOTE: • Dilation gives a larger image, while erosion gives a smaller image • In both cases, the original structure of the image is maintained • If the template is not constant, say the results are as follows: Original Dilate -1 Erode + 1 • D(E(D(I))) = D(I) and E(D(E(I))) = E(I) 240-373 Image Processing, Lecture #11

  9. Opening and Closing Operations • OPENING = dilating after eroding • CLOSING = eroding after dilating Technique 4: Opening and closing operations USE: As a step towards the skeleton, counting, and size-estimating operations below OPERATION: • Let OPEN(I,T) be the opening of image I by some template T • Then using previous terminology and the template T throughout OPEN(I,T) = D(E(I)) This gives Original Opened with Opened with Clearly, this restores the image to its original and avoids the scaling of the result. It introduces the shaping of the template into the original. 240-373 Image Processing, Lecture #11

  10. More interesting is its operation on clear edges Original Opened with Note how the peak (1 1 2 5 5 4) has been smoothed to the shape of the template but that the trough (1 3) has been left alone. 240-373 Image Processing, Lecture #11

  11. Closing is defined as CLOSE(I,T’) = E(D(I)) with E and D using T’ where T’ is the 180o rotation of T Original Closed with Now the trough has been filled but the peak has been left. • Properties of open and close operations • OPEN -> forces the shape of the template on the convex parts of an edge • CLOSE -> forces its shape on the concave parts of an edge • These two operations can be combined to produce a skeleton operation 240-373 Image Processing, Lecture #11

  12. Skeleton Operations Technique 5: Skeleton operations USE: To create a skeleton of a region. This will consist of a set of lines corresponding to complete thinning of the region without losing the essential shape. OPERATION: • Let D1, D2, …, Dnbe structuring templates that are square, with sizes 1x1, 2x2, …, n x n, all of them filled with 1’s. • With image I, using template D1, D2, …, Dn, in turn, evaluate resulti = E(I) - OPEN(E(I)) • Then determine Example: Original Final image using only D1, D2, D3, and D4 • This corresponds to a skeleton of the image, retaining length but reduce thickness 240-373 Image Processing, Lecture #11

  13. Granule sizing and granule counting Technique 6: Granule sizing and granule counting USE: To estimate the number of bright regions in an image. To estimate the size of the regions in an image. OPERATION: • Using templates such as a set of vertical or horizontal 1’s with increasing length to estimate the size of the area • Using vertical or horizontal templates with binary strings having values 2n + 1( I.e. 1, 11, 101, 1001, 10001, etc.) to count the numebr of areas • In both cases, the image is eroded by the structuring templates and a measure of how many elements are now non-zero, or a sum of the power in the system is calculated • The number is plotted against the template structure length to give a covariance curve whose peaks indicate the size and number of granules (areas) in the image. Example: The following image was eroded with the templates as shown below. After each erosion the number of pixels > 0 was counted and the power of the resulting image was summed Original image 240-373 Image Processing, Lecture #11

  14. Length Type of string 11….1 10…01 power count power count 1 63 20 63 20 2 31 11 31 11 3 8 4 8 4 4 1 1 2 2 5 0 0 3 3 6 7 7 7 7 7 8 4 4 9 1 1 10 0 0 Given a slightly altered image which eroded with 10…01 pattern gives length 1 2 3 4 5 6 7 8 9 count 30 21 13 9 10 11 9 5 1 power 87 52 25 14 15 15 12 6 1 240-373 Image Processing, Lecture #11

More Related