Morphological image processing – Part II

Slides:



Advertisements
Similar presentations
電腦視覺 Computer and Robot Vision I
Advertisements

November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
In form and in feature, face and limb, I grew so like my brother
Table of Contents 9.5 Some Basic Morphological Algorithm
Document Image Processing
Course Syllabus 1.Color 2.Camera models, camera calibration 3.Advanced image pre-processing Line detection Corner detection Maximally stable extremal regions.
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Chapter 9: Morphological Image Processing
Some Basic Morphological Algorithm
Course Syllabus 1.Color 2.Camera models, camera calibration 3.Advanced image pre-processing Line detection Corner detection Maximally stable extremal regions.
DIGITAL IMAGE PROCESSING
Each pixel is 0 or 1, background or foreground Image processing to
Introduction to Morphological Operators
Image Thinning Aria Rajasa Masna – Charles Gunawan – Rama Pandugita – Suluh Legowo –
Morphology.
Computer Graphics & Image Processing Chapter # 9
Morphological Image Processing Md. Rokanujjaman Assistant Professor Dept of Computer Science and Engineering Rajshahi University.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Morphology Structural processing of images Image Processing and Computer Vision: 33 Morphological Transformations Set theoretic methods of extracting.
Chapter 9 Morphological Image Processing. Preview Morphology: denotes a branch of biology that deals with the form and structure of animals and planets.
Morphological Image Processing
2007Theo Schouten1 Morphology Set theory is the mathematical basis for morphology. Sets in Euclidic space E 2 (or rather Z 2 : the set of pairs of integers)
E.G.M. PetrakisBinary Image Processing1 Binary Image Analysis Segmentation produces homogenous regions –each region has uniform gray-level –each region.
Morphological Image Processing The field of mathematical morphology contributes a wide range of operators to image processing, all based around a few simple.
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals.
Morphological Image Processing
Chapter 9.  Mathematical morphology: ◦ A useful tool for extracting image components in the representation of region shape.  Boundaries, skeletons,
Mathematical Morphology in Image Processing Dr.K.V.Pramod Dept. of Computer Applications Cochin University of Sc. & Technology.
September 23, 2014Computer Vision Lecture 5: Binary Image Processing 1 Binary Images Binary images are grayscale images with only two possible levels of.
Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007 Digital Image Processing Chapter 9: Morphological Image Processing.
Digital Image Processing CCS331 Relationships of Pixel 1.
Morphological Image Processing
G52IVG, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
Digital Image Processing CSC331 Morphological image processing 1.
Mathematical Morphology Mathematical morphology (matematická morfologie) –A special image analysis discipline based on morphological transformations of.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Digital Image Processing CSC331 Morphological image processing 1.
CS654: Digital Image Analysis
Mathematical Morphology
References Books: Chapter 11, Image Processing, Analysis, and Machine Vision, Sonka et al Chapter 9, Digital Image Processing, Gonzalez & Woods.
CS654: Digital Image Analysis
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
CDS 301 Fall, 2008 Image Visualization Chap. 9 November 11, 2008 Jie Zhang Copyright ©
1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Morphological Image Processing Robotics. 2/22/2016Introduction to Machine Vision Remember from Lecture 12: GRAY LEVEL THRESHOLDING Objects Set threshold.
 Mathematical morphology is a tool for extracting image components that are useful in the representation and description of region shape, such as boundaries,
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
TOPIC 12 IMAGE SEGMENTATION & MORPHOLOGY. Image segmentation is approached from three different perspectives :. Region detection: each pixel is assigned.
BYST Morp-1 DIP - WS2002: Morphology Digital Image Processing Morphological Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Course 3 Binary Image Binary Images have only two gray levels: “1” and “0”, i.e., black / white. —— save memory —— fast processing —— many features of.
Lecture(s) 3-4. Morphological Image Processing. 3/13/20162 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of.
Chapter 6 Skeleton & Morphological Operation. Image Processing for Pattern Recognition Feature Extraction Acquisition Preprocessing Classification Post.
Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben.
Morphological Image Processing
Gray-level images.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
HIT and MISS.
Introduction to Morphological Operators
Computer Vision Lecture 5: Binary Image Processing
Fitting Curve Models to Edges
Computer Vision Lecture 9: Edge Detection II
CS Digital Image Processing Lecture 5
Morphological Image Processing
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Morphological Filters Applications and Extension Morphological Filters
Presentation transcript:

Morphological image processing – Part II Hit-and-Miss Transform Gray-value morphological processing

Links http://www.mmorph.com/resources.html http://cmm.ensmp.fr/~beucher/wtshed.html http://www.cwi.nl/projects/morphology/ http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Morpholo.html http://www.dai.ed.ac.uk/HIPR2/morops.htm http://www.mathworks.com/access/helpdesk/help/toolbox/images/images.shtml http://www-dsv.cea.fr/thema/shfj/web/demo_extraction/english/cerveau.htm http://cmm.ensmp.fr/~beucher/interpol/interpol.html

Hit-and-Miss Transform Rather than simply probing the inside or the outside of objects in a binary image image , it can be fruitful to probe both at the same time. We can accomplish this using the hit and miss transform. This operation requires a matched pair of structuring elements(B1 , B2), that probe the inside and outside, respectively, of objects in the image. The hit-or-miss operator was defined by Serra as follows. Given an image A and two structuring elements B1 and B2, the set definition and Boolean definition are: where B1 and B2 are bounded, disjoint structuring elements. Two sets are disjoint if B1 (AND) B2 = 0 , the empty set.

Hit-and-Miss Transform The structuring element used in the hit-and-miss is a slight extension to the type that has been introduced for erosion and dilation , in that it can contain both foreground and background pixels , rather than just foreground pixels, i.e. both ones and zeros. Note that the simpler type of structuring element used with erosion and dilation is often depicted containing both ones and zeros as well, but in that case the zeros really stand for `don't care's', and are just used to fill out the structuring element to a convenient shaped kernel, usually a square. In all our illustrations, these `don't care's' are shown as blanks in the kernel in order to avoid confusion. An example of the extended kind of structuring element is shown in Figure 1. As usual we denote foreground pixels using ones, and background pixels using zeros.

Hit-and-Miss Transform The hit-and-miss operation is performed in much the same way as other morphological operators, by translating the origin of the structuring element to all points in the image, and then comparing the structuring element with the underlying image pixels. If the foreground and background pixels in the structuring element exactly match foreground and background pixels in the image, then the pixel underneath the origin of the structuring element is set to the foreground color. If it doesn't match, then that pixel is set to the background color. In an important sense the hit-and-miss operator is the morphological equivalent of template matching, a well-known technique for matching patterns based upon cross-correlation. ere, we have a template B1 for the object and a template B2 for the background.

Hit-and-Miss Transform For instance, the structuring element shown in Figure 1 can be used to find right angle convex corner points in images. Notice that the pixels in the element form the shape of a bottom-left convex corner. We assume that the origin of the element is at the center of the 3×3 element. In order to find all the corners in a binary image we need to run the hit-and-miss transform four times with four different elements representing the four kinds of right angle corners found in binary images. Figure 2 shows the four different elements used in this operation. Figure 2 Four structuring elements used for corner finding in binary images using the hit-and-miss transform. Note that they are really all the same element, but rotated by different amounts.

Hit-and-Miss Transform After obtaining the locations of corners in each orientation, We can then simply OR all these images together to get the final result showing the locations of all right angle convex corners in any orientation. Figure 3 shows the effect of this corner detection on a simple binary image. Figure 3

Hit-and-Miss Transform – Guidelines to Use The hit-and-miss transform is used to look for occurrences of particular binary patterns in fixed orientations. It can be used to look for several patterns (or alternatively, for the same pattern in several orientations as above) simply by running successive transforms using different structuring elements, and then ORing the results together. The operations of erosion, dilation, opening, closing, thinning and thickening can all be derived from the hit-and-miss transform in conjunction with simple set operations.

Hit-and-Miss Transform – Guidelines to Use Figure 4 illustrates some structuring elements that can be used for locating various binary features. Figure 4 Some applications of the hit-and-miss transform. 1 is used to locate isolated points in a binary image. 2 is used to locate the end points on a binary skeleton Note that this structuring element must be used in all its rotations so four hit-and-miss passes are required. 3a and 3b are used to locate the triple points (junctions) on a skeleton. Both structuring elements must be run in all orientations so eight hit-and-miss passes are required.

Hit-and-Miss Transform – Guidelines to Use We illustrate two of these applications on an image skeleton. We start with Skeleton The informal definition of a skeleton is a line representation of an object that is: i) one-pixel thick, ii) through the "middle" of the object, and, iii) preserves the topology of the object. which is the skeleton of

Hit-and-Miss Transform – Guidelines to Use Another way to think about the skeleton is as the loci of centers of bi-tangent circles that fit entirely within the foreground region being considered. Figure illustrates this for a rectangular shape. Figure Skeleton of a rectangle defined in terms of bi-tangent circles.

Summary of the basic operations The results of the application of these basic operations on a test image are illustrated below. In Figure 5 the various structuring elements used in the processing are defined. The value "-" indicates a "don't care". All three structuring elements are symmetric. Figure 5 : Structuring elements B, B1, and B2 that are 3 x 3 The results of processing are shown in Figure where the binary value "1" is shown in black and the value "0" in white. a) Image A b) Dilation with 2B c) Erosion with 2B

Summary of the basic operations d) Opening with 2B e) Closing with 2B f) hit-and-Miss with B1 and B2 The opening operation can separate objects that are connected in a binary image. The closing operation can fill in small holes. Both operations generate a certain amount of smoothing on an object contour given a "smooth" structuring element. The opening smoothes from the inside of the object contour and the closing smoothes from the outside of the object contour. The hit-and-miss example has found the 4-connected contour pixels.

Thinning It can be used for several applications, but is particularly useful for skeletonization. In this mode it is commonly used to tidy up the output of edge detectors by reducing all lines to single pixel thickness. Thinning is normally only applied to binary images, and produces another binary image as output. Skeletonization is a process for reducing foreground regions in a binary image to a skeletal remnant that largely preserves the extent and connectivity of the original region while throwing away most of the original foreground pixel.

Thinning - How It Works Like other morphological operators, the behavior of the thinning operation is determined by a structuring element. The binary structuring elements used for thinning are of the extended type described under the hit-and-miss transform (i.e. they can contain both ones and zeros). The thinning operation is related to the hit-and-miss transform and can be expressed quite simply in terms of it. The thinning of an image I by a structuring element J is: where the subtraction is a logical subtraction defined by .

Thinning Thinning - How It Works The thinning operation is calculated by translating the origin of the structuring element to each possible pixel position in the image, and at each such position comparing it with the underlying image pixels. If the foreground and background pixels in the structuring element exactly match foreground and background pixels in the image, then the image pixel underneath the origin of the structuring element is set to background (zero). Otherwise it is left unchanged. Note that the structuring element must always have a one or a blank at its origin if it is to have any effect.

Thinning-Guidelines for Use One of the most common uses of thinning is to reduce the thresholded output of an edge detector such as the Sobel operator , to lines of a single pixel thickness, while preserving the full length of those lines (i.e. pixels at the extreme ends of lines should not be affected). A simple algorithm for doing this is the following: Consider all pixels on the boundaries of foreground regions (i.e. foreground points that have at least one background neighbor). Delete any such point that has more than one foreground neighbor, as long as doing so does not locally disconnect (i.e. split into two) the region containing that pixel. Iterate until convergence. This procedure erodes away the boundaries of foreground objects as much as possible, but does not affect pixels at the ends of lines.

Thinning-Guidelines for Use This effect can be achieved using morphological thinning by iterating until convergence with the structuring elements shown in Figure , and all their 90° rotations (4×2 = 8 structuring elements in total). In fact what we are doing here is determining the octagonal skeleton of a binary shape --- the set of points that lie at the centers of octagons that fit entirely inside the shape, and which touch the boundary of the shape at at least two points. Note that this skeletonization method is guaranteed to produce a connected skeleton. Figure 6: Structuring elements for skeletonization by morphological thinning.

Thinning-Guidelines for Use At each iteration, the image is first thinned by the left hand structuring element, and then by the right hand one, and then with the remaining six 90° rotations of the two elements. The process is repeated in cyclic fashion until none of the thinning produces any further change. As usual, the origin of the structuring element is at the center. Figure 7 :Example skeletonization by morphological thinning of a simple binary shape, using the above structuring elements. Note that the resulting skeleton is connected.

Thinning-Guidelines for Use Note that skeletons produced by this method often contain undesirable short spurs produced by small irregularities in the boundary of the original object. These spurs can be removed by a process called pruning, which is in fact just another sort of thinning. Figure 8: Some applications of thinning. 1 simply finds the boundary of a binary object, i.e. it deletes any foreground points that don't have at least one neighboring background point. Note that the detected boundary is 4-connected. 2 does the same thing but produces an 8-connected boundary. 3a and 3b are used for pruning. At each thinning iteration, each element must be used in each of its four 90° rotations. Pruning is normally carried out for only a limited number of iterations to remove short spurs, since pruning until convergence will actually remove all pixels except those that form closed loops.

Thinning-Guidelines for Use Note that many implementations of thinning have a particular structuring element `hardwired' into them (usually the skeletonization structuring elements), and so the user does not need to be concerned about selecting one. Thinning is often used in combination with other morphological operators tp extract a simple representation of regions. A common example is the automated recognition of hand-written characters. In this case, morphological operators are used as pre-processing to obtain the shapes of the characters which then can be used for the recognition. We illustrate a simple example using

Thinning-Guidelines for Use .Since we want to work on binary images, we start off by thresholding the image at a value of 180, obtaining A simple way to obtain the skeleton of the character is to thin the image with the structuring elements in the next Figure until convergence. The result is shown in The character is now reduced to a single pixel-wide line. However, the line is broken at some locations, which might cause problems during the recognition process.

Thinning-Guidelines for Use To improve the situation we can first dilate the image to connect the lines before thinning it. Dilating the image twice with a 3×3 square structuring element yields then the result of the thinning is

Thickening Thinning is the dual of thickening, i.e. thickening the foreground is equivalent to thinning the background. If the foreground and background pixels in the structuring element exactly match foreground and background pixels in the image, then the image pixel underneath the origin of the structuring element is set to foreground (one). Applying the 45° convex hull algorithm described above results in

Gray Scale Images For a grayscale image, the intensity value is taken to represent height above a base plane, so that the grayscale image represents a surface in three-dimensional Euclidean space. Figure 9 shows such a surface. Then the set of coordinates associated with this image surface is simply the set of three-dimensional Euclidean coordinates of all the points within this surface and also all points below the surface, down to the base plane. Note that even when we are only considering points with integer coordinates, this is a lot of points, so usually algorithms are employed that do not need to consider all the points.

Rules for Grayscale Dilation and Erosion Dilation The value of the output pixel is the maximum value of all the pixels in the input pixel's 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 pixel's neighborhood. In a binary image, if any of the pixels is set to 0, the output pixel is set to 0.

Gray-value morphological processing The techniques of morphological filtering can be extended to gray-level images. To simplify matters we will restrict our presentation to structuring elements, B, that comprise a finite number of pixels and are convex and bounded. Now, however, the structuring element has gray values associated with every coordinate position as does the image A. * Gray-level dilation, DG(A,B), is given by: Dilation - For a given output coordinate [m,n], the structuring element is summed with a shifted version of the image and the maximum encountered over all shifts within the J x K domain of B is used as the result.This new value is recorded at the origin of the structuring element For a flat structuring element, this is equivalent to the maximum filter.

Gray-level dilation Grayscale dilation with a flat disk shaped structuring element will generally brighten the image. Bright regions surrounded by dark regions grow in size, and dark regions surrounded by bright regions shrink in size. Small dark spots in images will disappear as they are `filled in' to the surrounding intensity value. Small bright spots will become larger spots. The effect is most marked at places in the image where the intensity changes rapidly and regions of fairly uniform intensity will be largely unchanged except at their edges.

Grayscale erosion Gray-level erosion, EG(*), is given by: Where j and k index the pixels of B. If B is a 3 x 3 with its center as the origin, j and k will range form –1 to 1. For a spatial case of a flat structuring element, this calculation has the same effect as the minimum filter .

Grayscale erosion with a flat disk shaped structuring element will generally darken the image. Bright regions surrounded by dark regions shrink in size, and dark regions surrounded by bright regions grow in size. Small bright spots in images will disappear as they are eroded away down to the surrounding intensity value, and small dark spots will become larger spots. The effect is most marked at places in the image where the intensity changes rapidly, and regions of fairly uniform intensity will be left more or less unchanged except at their edges. Figure 11 shows a vertical cross-section through a graylevel image and the effect of erosion using a disk shaped structuring element. Note that the flat disk shaped kernel causes small peaks in the image to disappear and valleys to become wider.

Gray-level opening Opening - Graylevel opening can be used to select and preserve particular intensity patterns while attenuating others. As a simple example we start with Bright features smaller than the structuring element have been greatly reduced in intensity, while larger features have remained more or less unchanged in intensity. Note that the image does have a more matt appearance than before since the opening has eliminated small secularities and texture fluctuations.

gray-level closing Closing - The dark specks in between the bright spots in the hair have been largely filled in to the same color as the bright spots, while the more uniformly colored nose area is largely the same intensity as before. Similarly the gaps between the white whiskers have been filled in.

Morphological filtering of gray-level data. In many situations the seeming complexity of gray level morphological processing is significantly reduced through the use of symmetric structuring elements where b[j,k] = b[-j,-k]. The most common of these is based on the use of B = constant = 0. For this important case and using again the domain [j,k] B, the definitions above reduce to: Dilation - Erosion - Opening - Closing -

The operations defined above can be used to produce morphological algorithms for smoothing, gradient determination and a version of the Laplacian. All are constructed from the primitives for gray-level dilation and gray-level erosion and in all cases the maximum and minimum filters are taken over the domain .

Morphological smoothing This algorithm is based on the observation that a gray-level opening smoothes a gray-value image from above the brightness surface given by the function a[m,n] and the gray-level closing smoothes from below. We use a structuring element B based on eqs. and . Top-hat transform acts as a detector of peaks and ridges of the gray level surface.

Morphological gradient For linear filters the gradient filter yields a vector representation with a magnitude. and direction .The version presented here generates a morphological estimate of the gradient magnitude:

Morphological Laplacian The morphologically-based Laplacian filter is defined by:

Summary of morphological filters a) Dilation b) Erosion c) Smoothing d) Gradient e) Laplacian

Skeletonization/Medial Axis Transform Skeletonization is a process for reducing foreground regions in a binary image to a skeletal remnant that largely preserves the extent and connectivity of the original region while throwing away most of the original foreground pixels. This line is the skeleton. Under this definition it is clear that thinning produces a sort of skeleton. The terms medial axis transform (MAT) and skeletonization are often used interchangeably but we will distinguish between them slightly. The skeleton is simply a binary image showing the simple skeleton. The MAT on the other hand is a graylevel image where each point on the skeleton has an intensity which represents its distance to a boundary in the original object.

Skeleton/MAT - How It Works The skeleton/MAT can be produced in two main ways. The first is to use some kind of morphological thinning that successively erodes away pixels from the boundary (while preserving the end points of line segments) until no more thinning is possible, at which point what is left approximates the skeleton. The alternative method is to first calculate the distance transform of the image. The skeleton then lies along the singularities (i.e. creases or curvature discontinuities) in the distance transform. This latter approach is more suited to calculating the MAT since the MAT is the same as the distance transform but with all points off the skeleton suppressed to zero.

Distance Transform The distance transform is an operator normally only applied to binary images. The result of the transform is a graylevel image that looks similar to the input image, except that the graylevel intensities of points inside foreground regions are changed to show the distance to the closest boundary from each point. The distance transform is sometimes very sensitive to small changes in the object. If, for example, we change the above rectangle to