IT472 Digital Image Processing Asim Banerjee Faculty Block #1, Room No. 1109 Extn. # 554
IT523 - Digital Image Processing Image Segmentation IT523 - Digital Image Processing
The Digital Image Processing System Recognition and Interpretation Outside world O/P Preprocessing Knowledge Base Segmentation Representation and Description Image Acquisition The Digital Image Processing System The DIP system takes inputs from the outside world and produces desirable (application dependent) outputs. IT523 - Digital Image Processing
IT523 - Digital Image Processing Segmentation It partitions an input image into its constituent parts or objects represented by pixels which are homogeneous with respect to some criterion. Different groups/regions must not intersect each other and adjacent groups/regions must be heterogeneous. NOTE: Autonomous segmentation is one of the most difficult tasks in digital image processing. Good segmentation ensures ease in achieving successful solution to an imaging problem. Bad segmentation guarantee eventual failure to an imaging problem. IT523 - Digital Image Processing
IT523 - Digital Image Processing Segmentation - Types Image segmentation can be broadly classified into two types: Local segmentation – segmenting sub-images which are small windows on the whole image. Global segmentation – segmenting the whole image. IT523 - Digital Image Processing
Segmentation - Approaches Image segmentation problem can be approached from the following perspectives Region approach Region growing Region splitting Region splitting and merging Clustering approach Hierarchical clustering Partitional clustering K-means clustering Fuzzy clustering Image intensity based approach Thresholding approach Global thresholding Adaptive thresholding Edge detection and edge-based segmentation. IT523 - Digital Image Processing
IT523 - Digital Image Processing Any Questions? IT523 - Digital Image Processing
IT523 - Digital Image Processing Edge Detection IT523 - Digital Image Processing
IT523 - Digital Image Processing What Is An Edge? While there has been a lot of debate on the definition of the edge, for practical purpose we would be defining it as the discontinuity in the intensity values as one moves in a particular direction within an image. Thus edges in an image have A magnitude (strength of the edge). A direction (orientation of the edge). IT523 - Digital Image Processing
IT523 - Digital Image Processing Why Edge Detection? Convert a 2D image into a set of curves Extracts salient features of the scene More compact than pixels IT523 - Digital Image Processing
IT523 - Digital Image Processing Origin Of Edges Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity IT523 - Digital Image Processing
IT523 - Digital Image Processing Edge Detection How can you tell that a pixel is on an edge? IT523 - Digital Image Processing
IT523 - Digital Image Processing Intensity Profiles IT523 - Digital Image Processing
Profiles Of Image Intensity Edges IT523 - Digital Image Processing
IT523 - Digital Image Processing Edge - Types IT523 - Digital Image Processing
Edge – Derivatives of Intensity Profiles IT523 - Digital Image Processing
IT523 - Digital Image Processing Gradient Operators IT523 - Digital Image Processing
IT523 - Digital Image Processing Gradient Operators IT523 - Digital Image Processing
IT523 - Digital Image Processing Gradient Operators IT523 - Digital Image Processing
Gradient Operators - Application IT523 - Digital Image Processing
Gradient Operators - Application b c d e f g Original image Sobel gradient Spatial Gaussian smoothing function Laplacian mask LoG Thresholded LoG Zero crossings. IT523 - Digital Image Processing
IT523 - Digital Image Processing Edge Detection Steps There are two basic steps of edge detection Detection of short linear edge segments (edgels) Aggregation of edgels into extended edges (maybe parametric description) IT523 - Digital Image Processing
IT523 - Digital Image Processing Any Questions? IT523 - Digital Image Processing
Edgel Detection Methods Difference operators Parametric-model matchers IT523 - Digital Image Processing
Edge is Where Change Occurs Change is measured by derivative in 1D Biggest change, derivative has maximum magnitude Or 2nd derivative is zero. IT523 - Digital Image Processing
IT523 - Digital Image Processing Image Gradient (1/2) The gradient of an image: The gradient points in the direction of most rapid change in intensity The gradient direction is given by: how does this relate to the direction of the edge? IT523 - Digital Image Processing
IT523 - Digital Image Processing Image Gradient (2/2) The edge strength is given by the gradient magnitude IT523 - Digital Image Processing
IT523 - Digital Image Processing The Discrete Gradient How can we differentiate a digital image f[x,y]? Option 1: reconstruct a continuous image, then take gradient Option 2: take discrete derivative (finite difference) How would you implement this as a cross-correlation? IT523 - Digital Image Processing
IT523 - Digital Image Processing The Sobel Operator (1/2) Better approximations of the derivatives exist The Sobel operators below are very commonly used -1 1 -2 2 1 2 -1 -2 IT523 - Digital Image Processing
IT523 - Digital Image Processing The Sobel Operator (2/2) The standard definition of the Sobel operator omits the 1/8 term Doesn’t make a difference for edge detection However, the 1/8 term is needed to get the right gradient value, IT523 - Digital Image Processing
IT523 - Digital Image Processing Gradient Operators (a) Roberts’ cross operator (b) 3x3 Prewitt operator (c) Sobel operator (d) 4x4 Prewitt operator IT523 - Digital Image Processing
IT523 - Digital Image Processing Any Questions? IT523 - Digital Image Processing
IT523 - Digital Image Processing Effects Of Noise (1/2) Consider a single row or column of the image Plotting intensity as a function of position gives a signal Where is the edge? IT523 - Digital Image Processing
IT523 - Digital Image Processing Effects Of Noise (2/2) (a) (b) (c) Original image and its edge output Noise added (zero mean and σ = 0.03) and edge output Noise added (zero mean and σ = 0.09) and edge output IT523 - Digital Image Processing
Solution: Smooth First Where is the edge? Look for peaks in IT523 - Digital Image Processing
Derivative Theorem Of Convolution This saves us one operation: IT523 - Digital Image Processing
Laplacian of Gaussian (LoG) Consider Laplacian of Gaussian operator Where is the edge? Zero-crossings of bottom graph IT523 - Digital Image Processing
2D edge detection filters Laplacian of Gaussian Gaussian derivative of Gaussian is the Laplacian operator: IT523 - Digital Image Processing
Optimal Edge Detection: Canny (1/2) Assume: Linear filtering Additive Gaussian noise Edge detector should have: Good Detection. Filter responds to edge, not noise. Good Localization: detected edge near true edge. Single Response: one per edge. IT523 - Digital Image Processing
Optimal Edge Detection: Canny (2/2) Optimal Detector is approximately Derivative of Gaussian. Detection/Localization trade-off More smoothing improves detection And hurts localization. This is what you might guess from above (detect change) + (remove noise) IT523 - Digital Image Processing
Edge Detection Tutorials An interesting tutorial on edge detection is available at http://www.pages.drexel.edu/~weg22/edge.html An interesting tutorial on Canny edge detector is available at http://www.pages.drexel.edu/~weg22/can_tut.html IT523 - Digital Image Processing
The Canny edge detector (1/4) original image (Lena) IT523 - Digital Image Processing
The Canny edge detector (2/4) norm of the gradient IT523 - Digital Image Processing
The Canny edge detector (3/4) thresholding IT523 - Digital Image Processing
The Canny edge detector (4/4) thinning (non-maximum suppression) IT523 - Digital Image Processing
Non-maximum suppression Check if pixel is local maximum along gradient direction requires checking interpolated pixels p and r IT523 - Digital Image Processing
IT523 - Digital Image Processing Predicting the next edge point Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s). (Forsyth & Ponce) IT523 - Digital Image Processing
IT523 - Digital Image Processing Hysteresis Check that maximum value of gradient value is sufficiently large drop-outs? use hysteresis use a high threshold to start edge curves and a low threshold to continue them. IT523 - Digital Image Processing
Effect of (Gaussian kernel size) Canny with original The choice of depends on desired behavior large detects large scale edges small detects fine features IT523 - Digital Image Processing
Scale Smoothing Eliminates noise edges. Makes edges smoother. Source (Forsyth & Ponce) Smoothing Eliminates noise edges. Makes edges smoother. Removes fine detail. Figures show gradient magnitude of zebra at two different scales IT523 - Digital Image Processing
IT523 - Digital Image Processing Scale Space (1/5) IT523 - Digital Image Processing
IT523 - Digital Image Processing Scale Space (2/5) fine scale high threshold IT523 - Digital Image Processing
IT523 - Digital Image Processing Scale Space (3/5) coarse scale, high threshold IT523 - Digital Image Processing
IT523 - Digital Image Processing Scale Space (4/5) coarse scale low threshold IT523 - Digital Image Processing
IT523 - Digital Image Processing Scale Space (5/5) larger Gaussian filtered signal first derivative peaks Properties of scale space (with Gaussian smoothing) edge position may shift with increasing scale () two edges may merge with increasing scale an edge may not split into two with increasing scale IT523 - Digital Image Processing
Gaussian - Image filter Laplacian of Gaussian Gaussian delta function IT523 - Digital Image Processing
IT523 - Digital Image Processing Any Questions? IT523 - Digital Image Processing
That’s all for now. We shall continue in the next class. IT523 - Digital Image Processing