042105_03

  • Uploaded by: Gabriel Humpire
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 042105_03 as PDF for free.

More details

  • Words: 1,072
  • Pages: 25
Opening & Closing Nandish Patel

Mathematical Morphology ƒ Morphological

Operators are tools for extracting image components that are useful in the representation and description of region shape, such as boundaries, skeletons, and the convex hull.

ƒ The operators are

particularly useful for the analysis of binary images and common usages include edge detection, noise removal, image enhancement and image segmentation.

Morphological Operators ƒ There are 2 primitive operations that are used by many of the other morphological algorithms. ƒ Dilation ƒ Erosion

Brief Introduction: Dilation ƒ Dilation is useful in bridging gaps in images and expands an image. ƒ The basic effect of the operator on a binary image is to gradually enlarge the boundaries of regions of foreground pixels (i.e. white pixels, typically). Thus areas of foreground pixels grow in size while holes within those regions become smaller.

Brief Introduction: Dilation ƒ Structuring element B is applied on every

pixel in an Image A. ƒ If at least one pixel in the structuring element coincides with a foreground pixel in the image underneath, then the input pixel is set to the foreground value. If all the corresponding pixels in the image are background however, the input pixel is left at the background value.

Example of Dilation

3x3 Structuring Element of all 1’s was used.

Brief Introduction: Erosion ƒ Erosion is used for eliminating irrelevant

detail (in terms of size) from a binary image and shrinks an image. ƒ The basic effect of the operator on a binary image is to erode away the boundaries of regions of foreground pixels (i.e. white pixels, typically). Thus areas of foreground pixels shrink in size, and holes within those areas become larger.

Brief Introduction: Erosion ƒ Structuring element B is applied on every

pixel in an Image A. ƒ If for every pixel in the structuring element, the corresponding pixel in the image underneath is a foreground pixel, then the input pixel is left as it is. If any of the corresponding pixels in the image are background however, the input pixel is also set to background value.

Example of Erosion

3x3 Structuring Element of all 1’s was used.

Opening & Closing ƒ Opening and Closing are morphological

operators which use the 2 primitive operators, Erosion and Dilation. ƒ Opening smoothes the contour of an object, and breaks narrow isthmuses, and eliminates thin protrusions. ƒ Closing tends to smooth sections of contours but, unlike opening, it fuses narrow breaks and long thin gulfs, eliminates small holes, and fills gaps in the contour.

Opening ƒ Opening is defined as applying Erosion on an Image A with a Structuring Element B and then applying Dilation on the resulting Image with the same Structuring Element B. ƒ The Structuring Element can vary according to the results you want generated.

Still Opening… ƒ The basic effect of an opening is somewhat like erosion in that it tends to remove some of the foreground (bright) pixels from the edges of regions of foreground pixels. However it is less destructive than erosion in general. ƒ The effect of the operator is to preserve foreground regions that have a similar shape to this structuring element, or that can completely contain the structuring element, while eliminating all other regions of foreground pixels.

Effects of Opening Original Image

Eroded Image

Opened Image

Effects of Opening ƒ An important use for Opening is to find patterns in Images. ƒ Depending on the structuring element, Opening can help find patterns in Images like Circles, Squares, Rectangles etc… ƒ The result of Opening depends mostly on the Structuring Element, so it is important to pick a good Structuring Element.

Finding Patterns Original

Opened

A disc shaped Structuring Element with 11 pixels as diameter was used to find the Circles in this Image

Finding Patterns Original

Vertical Lines

Horizontal Lines

Opening with a 3×9 vertically oriented structuring element resulted in Vertical Lines, and Opening with a 9x3 horizontally oriented structuring element resulted in Horizontal Lines.

Salt & Pepper Noise Salt Noise can be reduced using a Opening and a 3x3 square structuring element.

Pepper Noise can not be reduced using Opening. Closing is more suitable for reducing Pepper Noise.

Closing ƒ Closing is similar in some ways to dilation in that it tends to enlarge the boundaries of foreground (bright) regions in an image (and shrink background color holes in such regions), but it is less destructive on the original boundary shape. ƒ The effect of the operator is to preserve background regions that have a similar shape to this structuring element, or that can completely contain the structuring element, while eliminating all other regions of background pixels

Keep Closing… ƒ One of the uses of dilation is to fill in small

background color holes in images, e.g. `pepper' noise. One of the problems with doing this however is that the dilation will also distort all regions of pixels indiscriminately. We can remove some of this effect by Closing. Closing is defined as performing an erosion on the image after the dilation, ƒ Closing can also be used to reduce known patterns in an image by using a structuring element.

Effect of Closing Original Image

Closed Image

Examples of Closing Original Image

Closed Image

Original Image contains small and large holes, With a disc shaped Structuring Element using 22 pixel diameter, the smaller holes can be removed.

Salt & Pepper Noise Salt Noise cannot be reduced by Closing.

Pepper Noise can be reduced by Closing.

Project Progress ƒ Researched Opening and Closing ƒ ƒ ƒ ƒ

as well as Erosion and Dilation in details to get an understanding on the project. Researched the matlab functions imerode() and imdilate(). Made Opening and Closing Functions which use imerode() and imdilate(). Imerode() takes 2 parameters, Image to Erode and the Structuring Element. Imdilate() takes 2 parameters, Image to Dilate and the Structuring Element.

ƒ ƒ ƒ ƒ ƒ ƒ ƒ

function Opening = func(im, filt) im1 = imerode(im,filt); im2 = imdilate(im1,filt); figure; imshow(im); figure; imshow(im2);

ƒ ƒ ƒ ƒ ƒ ƒ ƒ

function Closing = func(im, filt) im1 = imdilate(im,filt); im2 = imerode(im1,filt); figure; imshow(im); figure; imshow(im2);

Conclusion ƒ Opening and Closing are operators similar to Erosion and Dilation. ƒ Opening and Closing are improved versions of Erosion and Dilation because they are less destructive on the images. ƒ The results gathered from Opening and Closing depend on how the Structuring Element has been designed.

Now Closed

Any Questions? OR Comments!?

More Documents from "Gabriel Humpire"

042605_02
May 2020 5
042605_04
May 2020 5
050505_03
May 2020 6
042105_03
May 2020 8
042105_01
May 2020 6