Morphological Image Processing Chapter 9 CSC 446 Lecturer

  • Slides: 29
Download presentation
Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben

Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben

Outline: Ø Ø Ø Ø Introduction. Some basic Concepts from Set theory Logic operations

Outline: Ø Ø Ø Ø Introduction. Some basic Concepts from Set theory Logic operations involving Binary Images. Dilation and Erosion Open and Close Processing gray scale images. The Hit-and-Miss transformation

Introduction v. The word morphology commonly denotes a branch of biology that deals with

Introduction v. The word morphology commonly denotes a branch of biology that deals with the form and structure of animals and plants. v. Mathematical morphology is a tool that extract image components that are useful in the representation and discription of region shape such as: v. Boundaries v. Skeletons v. Convex hull. v. Sets in mathematical morphology represent objects in an image.

Some basic Concepts from Set theory �

Some basic Concepts from Set theory �

Some basic Concepts from Set theory. . (cont. ) �

Some basic Concepts from Set theory. . (cont. ) �

Some basic Concepts from Set theory. . (cont. ) �

Some basic Concepts from Set theory. . (cont. ) �

Logic Operation Involving Binary Images. v. Mostly used images are the binary images. v.

Logic Operation Involving Binary Images. v. Mostly used images are the binary images. v. The principle logic operations used in image processing are AND, OR and NOT v Logic operations are operated on a pixel by pixel basis between 2 images , but, (NOT) operation use one image.

Logic Operation Involving Binary Images. v. More operations: v. XOR: when only 1 in

Logic Operation Involving Binary Images. v. More operations: v. XOR: when only 1 in a pixel or the other pixel is 1 but not both. v. NOT-AND: select the black pixel that simultaneously are in B but not in A. v. NOTE: v. Intersection ==AND v. Union ==OR v. Complement ==NOT

Logic Operation Involving Binary Images.

Logic Operation Involving Binary Images.

Logic Operation Involving Binary Images. Note: -In binary images white will represent the foreground

Logic Operation Involving Binary Images. Note: -In binary images white will represent the foreground (1) while black is the background (0). -The set of coordinate to the image is simply the set of 2 D Euclidean coordinates of al the foreground pixels in the image as the origin normally takes in one of the corners.

Logic Operation Involving Binary Images.

Logic Operation Involving Binary Images.

Dilation and Erosion �

Dilation and Erosion �

Dilation and Erosion v. Dilation advantage in bridges gaps in an image.

Dilation and Erosion v. Dilation advantage in bridges gaps in an image.

Dilation Algorithm: v. Consider each of the background pixels in the input image as

Dilation Algorithm: v. Consider each of the background pixels in the input image as input. v. For each background pixel we put the structure element on top of the image so that the origin of the structure element coincides with the input image. v. If at least one pixel in the structure element coincides with the foreground pixel in the image underneath then the input pixel is set to the foreground , otherwise leave it as it background value.

Dilation and Erosion Dilation example 1 1 1 1 1

Dilation and Erosion Dilation example 1 1 1 1 1

Dilation and Erosion �

Dilation and Erosion �

Dilation and Erosion v Erosion advantage in eliminating irrelevant details in term of size

Dilation and Erosion v Erosion advantage in eliminating irrelevant details in term of size in an image. v Note: if the structure element is larger than the object then the object will be eliminated

Erosion algorithm: v. Consider each of the foreground pixels in the input image as

Erosion algorithm: v. Consider each of the foreground pixels in the input image as input. v. For each foreground pixel we put the structure element on top of the image so that the origin of the structure element coincides with the input image. v. If for every pixel in the structure element the corresponding pixel in image underneath is a foreground pixel then the input pixel is left as foreground , otherwise set it to background value.

Dilation and Erosion

Dilation and Erosion

Opening and Closing v. Now we know that Erosion shrinks an object while Dilation

Opening and Closing v. Now we know that Erosion shrinks an object while Dilation expands it. v. By combining these operations we get Open or Close operation. v. Open: Erosion then Dilation v. Close: Dilation then Erosion. v. Opening and closing smothes the contour of an object but: v. Opening: breaks narrow lines and eliminates thin protrusions( do thickening) v. Closing: focus on thin protrusions so it eliminates small holes and fill gaps.

Opening and Closing � Op en Cl os e

Opening and Closing � Op en Cl os e

Opening and Closing v. Perform open transformation on image 1 and closing on image

Opening and Closing v. Perform open transformation on image 1 and closing on image 2 where B is 1? Open by 1 Close by 1

Processing gray scale images �

Processing gray scale images �

Processing gray scale images 0 0 0 0 1 1 0 0 3 5

Processing gray scale images 0 0 0 0 1 1 0 0 3 5 5 3 0 0 1 1 0 0 5 9 9 5 0 0 3 5 5 3 0 0 0 0 0 The structuring element Initial image 1 1 1 1 -1 -1 1 1 4 6 6 6 4 1 -1 -1 2 4 2 -1 -1 -1 1 1 6 1 0 1 0 6 1 -1 -1 2 4 2 -1 -1 -1 1 0 1 0 6 1 1 Dilation 1 4 6 results 6 6 4 1 1 1 6 -1 -1 -1 -1 Erosion results

The Hit-and-Miss transform v. The hit-and-miss transform is a general binary morphological operation that

The Hit-and-Miss transform v. The hit-and-miss transform is a general binary morphological operation that can be used to look for particular patterns of foreground and background pixels in an image. A⊛B v. It is actually the basic operation of binary morphology since almost all the other binary morphology operators can be derived from it. v. As with other binary morphology operators it takes as input a binary image

The Hit-and-Miss transform v. The structure element contain both 1 and 0 v. The

The Hit-and-Miss transform v. The structure element contain both 1 and 0 v. The operation is done as: translating the structure image over all points in the image then by comparing the structure element 1’s and 0’s with image if they match then set the underlying pixel to X 1 X foreground otherwise set as background. 0 1 1 v. Example of structure element 0 0 X

The Hit-and-Miss transform v. Ex: assume the origin is at the center of 3

The Hit-and-Miss transform v. Ex: assume the origin is at the center of 3 X 3 structure element. In order to find all corners in an image we need to run hit and miss four times with four different structure element. X 1 X 0 0 X X 0 0 0 1 1 1 1 0 0 0 X x 0 0 x 1 X v. After obtaining the locations of corners we then simply OR all these images together to get the final result.

The Hit-and-Miss transform 0 0 0 0 0 0 0 0 0 0 0

The Hit-and-Miss transform 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 X 0 1 1 x 1 X Exercise: do the rest and find the result. .

Exercise : Ø How can the hit and miss transform be used to perform

Exercise : Ø How can the hit and miss transform be used to perform erosion? Ø How can the hit and miss transform be used with the not operation to perform dilation? Ø What is the smallest number of different structuring elements that you would need to use to locate all foreground points in an image where they have at least one neighbor using the hit and miss transform? What do they look like?