Presentation is loading. Please wait.

Presentation is loading. Please wait.

By Dr. Rajeev Srivastava Image Segmentation By Dr. Rajeev Srivastava Image Segmentation.

Similar presentations


Presentation on theme: "By Dr. Rajeev Srivastava Image Segmentation By Dr. Rajeev Srivastava Image Segmentation."— Presentation transcript:

1

2 By Dr. Rajeev Srivastava Image Segmentation By Dr. Rajeev Srivastava Image Segmentation

3 Problem Original image often has inconsistencies due to light and noise. Ideal image is composed of the fewest possible distinct intensities.

4 Solution  Segment original image. 1.Represent arrange of intensities with one intensity. 2.Allows User or machine to more easily determine which pixels belongs to which object.

5 Approaches To Segmentation  Discontinuity 1.Partition image based on abrupt changes in intensities. 2.Aims to fine edges.  Similarity 1.Partition image based on group of pixels which fall into same intensity range.

6 Image Segmentation  Subdivide an image into its constituent regions or objects.  Process stop when the objects of interest have been isolated.  Accuracy. 1.determine the eventual success or failure of computerized analysis procedure.  Based on one of the two properties of intensity values. discontinuity (edge-based) and similarity (region-based) 1.Gray level discontinuities (abrupt changes): point, line and edges 2.Assemble edges into region boundary (edge linking) 3.Similarity (according to a set of criteria): region growing, splitting and merging.

7 Image Segmentation  Usually image segmentation is an initial and vital step in a series of processes aimed at overall image understanding  Applications of image segmentation includes: Identifying objects in a scene for object-based measurements such as size and shape. Identifying objects in a moving scene for object-based video compression (MPEG4). Identifying objects which are at different distances from a sensor using depth measurements from a laser range finder enabling path planning for a mobile robot.

8 Types Of Image Segmentation  Thresholding Method.  Region Based.  Watershed Techniques.  K-Means Clustering.  Templates Matching.  Wavelet Based Segmentation Technique.  Contour Based Method.

9 Thresholding

10 Thresholding  Thresholding is usually the first step in any segmentation approach.  In this section we discus technique for partionining images directly into region based on intensity values/properties of these values.  One way to extract the object from background is to select threshold T.  Any point (x,y) in the image at which f(x,y) >T is called object point otherwise it will be called background.

11 Thresholding  A parameter θ called the brightness threshold is chosen and applied to an image A[x,y].  The result is a binary image, but that alone is not yet segmentation.  Result must further be worked out by joining pixels together into one or more regions or areas.

12 Thresholding  Similarity approach. Pick a threshold T. 1.Pixels above threshold get new intensity A. 2.Pixels above threshold get new intensity B.

13 Thresholding Histogram  Analyze Histogram.  Peak and Valley method. 1.Find two most prominent peak in histogram. 2.Find deepest valley in histogram. 3.Use grey value of deepest valley.

14 Thresholding Techniques  Thresholding is one of the most important approaches to image segmentation.  In this method, pixels that are alike in gray scale(or in some other feature) are grouped together.  Often a image histogram is used to determine the best setting for the threshold(s).  Some images (such as scanned text) will tend to be bimodal, and a single threshold is suitable.

15 Thresholding Techniques  Other images may have multiple modes and multiple thresholds may be helpful.  In general multilevel thresholding is less reliable than single level thresholding.  Mostly because it is very difficult to determine thresholds that adequately separate objects of interest.

16 Thresholding Techniques  Thresholding is of basically three types: Local Thresholding Threshold (T) depends only on f(x,y), i.e. only on grey level values. Adaptive Thresholding Threshold depends on both f(x,y) and p(x,y). Global Thresholding Threshold depends on the spatial coordinates x and y it is also called dynamic threshold.

17 Local thresholding  Local threshold is to statistically examine the intensity values of the local neighbor of each pixel.  The statistic which is most appropriate depends largely on the input image.  Simple and fast functions include the mean of the local intensity distribution.  The median value, or the mean of the minimum and maximum values.

18 Adaptive thresholding  Adaptive thresholding changes the threshold dynamically over the image.  This more sophisticated version of thresholding can accommodate changing light conditions in the image, e.g. those occurring as a result of a strong illumination gradient or shadows.  Adaptive thresholding typically takes a gray scale or color image as input and, in the simplest implementation, outputs a binary image representing the segmentation.

19 Adaptive thresholding  For each pixel in the image, a threshold has to be calculated.  If the pixel value is below the threshold it is set to the background value, otherwise it assumes the foreground value.  There are two main approaches to finding the threshold: (i) Chow and Kaneko approach. (ii)Local Thresholding.

20 Adaptive Thresholding  Chow and Kaneko: Chow and Kaneko divide an image into an array of overlapping. Sub images and then find the optimum threshold for each sub image by investigating its histogram. The threshold for each single pixel is found by interpolating the results of the sub- images.

21 Adaptive thresholding  Local Thresholding : An alternative approach to finding the local threshold is to statistically examine the intensity values of the local neighbor of each pixel. The statistic which is most appropriate depends largely on the input image. Simple and fast functions include the mean of the local intensity distribution, the median value, or the mean of the minimum and maximum values.

22 Global Thresholding Based on the histogram of an image. Partition the image histogram using a single global threshold. The success of this technique very strongly depends on how well the histogram can be partitioned.

23 Global Thresholding  The basic global threshold, T, is calculated as follows: 1.Select an initial estimate for T (typically the average grey level in the image). 2.Segment the image using T to produce two groups of pixels:G 1 consisting of pixels with grey levels >T and G 2 consisting pixels with grey levels ≤ T. 3.Compute the average grey levels of pixels in G 1 to give μ 1 and G 2 to give μ 2. 4. Compute a new threshold value: 5. Repeat steps 2 – 4 until the difference in T in successive iterations is less than a predefined limit T ∞  This algorithm works very well for finding thresholds when the histogram is suitable

24 Region Based Segmentation  Region based segmentation is done for breaking a big image in to simpler and smaller region of common identities.  Region based segmentation is totally based on common identities in whole regions like same gray level.  We discuss segmentation techniques that are based on: 1.Finding region directly.

25 Region Based Segmentation

26

27 Region Growing  Selecting a seed point and start integrating until a small region of same pattern.  More than one seed point can be there in natural problem, then treat them all simultaneously.  Some times cluster can be formed, pixel nearest to centroid will be treated as seed point.  Descriptors can mislead results if connectivity is not used.

28 Region Growing  Another problem is formulation of stopping rule.  Region growing should stop when no more pixel satisfy the condition but sometimes it keep adopting other pixels on basis of size and avg. grey level matching of region to their grey level.  For example: Region growing is successfully used in weld failure.

29 Region Growing

30  Histogram of welding.

31 REGION SPLITTING & MERGING  Alternative method of segmentation.  Subdivides an image into arbitrary disjoined region.  Arbitrary regions can be split and merged in order to satisfy the condition.  Image is assumed to be homogeneous.  If its not it will be divided into 4 parts.

32 REGION SPLITTING & MERGING  Splitting process will stop when whole image will break down in small homogeneous region.  If the original image is square N x N, having dimensions that are powers of 2(N = 2n).  All regions produced but the splitting algorithm are squares having dimensions M x M, where M is a power of 2 as well (M=2m,M<= n).  Splitting technique is betterly explained in a so called quard tree method.

33 REGION SPLITTING & MERGING Partitioned Image. Corresponding Quardtree.

34 REGION SPLITTING &MERGING  Splitting and Merging has an algorithm that done splitting and merging simultaneously: 1.(P(R)=False);If R is nonhomogeneous then split it into 4 sub region. 2.(P(RiURj)=TRUE),Ri&Rj two adjacent regions as they are homogeneous they will be merged. 3. It keeps moving on till no splitting and merging possible.

35 REGION SPLITTING &MERGING  Splitting and merging is more effective then only splitting algorithms.  Application is in 3-D images and Magnetic Resonance Imaging(MRI).  An example of region splitting and merging is shown to next.

36 REGION SPLITTING &MERGING

37 Watershed Technique Introduction:  It produces more stable segmentation and continuous segmentation boundaries.  Provides a simple framework for incorporating knowledge based constraints.

38 BASIC CONCEPTS  Image is visualized in 3-D. 1. Two spatial coordinates 2.Grey levels.  A grey image as a topological image

39 BASIC CONCEPTS  Topographical interpretation. 1.Points belonging to regional minimum. 2.Catchment basins/Watershed. 3.Divide Lines/Watershed Lines.  Main aim is to find out watershed lines.  Punch the regional minimum and flood the entire topography at uniform rate from below.

40 BASIC CONCEPTS  Dam is built to prevent the rising water of different catchment basin to merge on.  E ventually only the tops of the dams are visible above the water line.  Dam boundaries corresponds to the divide lines of the watershed.

41 Different Flood Levels

42  Topographical view shows that the height of the mountains was proportional to the grey scale value of the original image.  Water level is rising in consecutive images shown in the previous slide.  To prevent water to spill out of the structure, entire topography has to be enclosed by dams of height greater than mountains.  Heights of mountain will be shown as highest possible grey level value in the image.

43 Dam Construction

44  C[n] be the union of these sets.

45 Dam Construction  q denotes connected component formed in fig b. by dilation from flooding stage (n-1) to stage n.  Dilation of the connected components by the structuring elements in fig3. is subjected to 2 conditions: 1.Dilation has to be constrained to q. 2.Center of the structuring elements can be located only at the points of q during dilation.

46 Dam Construction  Dilation cannot be performed on the set of points that may cause the sets being dilated to merge.  (a) satisfy by every point during dilation. (b) did not apply to any point during dilation process in the first figure.  In fig2. several points fail the condition 1 while meeting condition 2 resulting in broken perimeter shown in the figure.

47 Dam Construction  In fig4. 1-pixel cross-hatched path shows the desired separating dam at the n th stage of flooding.  Construction of dam at this level of flooding is completed by setting all the points in the path just determined to the value greater than maximum gray-level value in the image.

48 Watershed Segmentation Algorithm

49

50

51  (a) occurs when a new minima is encountered, in this case q is added to set C[n-1] to form C[n]. (b) occurs when q lies within a catchment basin of some regional minima, in that case. (c) occurs when ridge between two catchment basins is hit and further flooding will cause the waters from two basins will merge, so a dam must be built within q.

52 Gradient Of Image  Image characterized by small variation in gray levels have small gradient values, so watershed segmentation is applied on the gradient of image rather than the actual image.  The regional minima of catchment basins correlate nicely with the small value of the gradients corresponding to the objects of interest.

53 Application On Images

54 Over Segmentation

55 K-Means Clustering

56 INTRODUCTION  A clustering algorithm.  Approximation to an NP- hard combinatorial optimization problem.  It is unsupervised.  K stands for no. of clusters, it is a user input to algorithm.  From a set o data or observations, K-means to classify them into k clusters.  The algorithm is iterative in nature.

57 Details

58 contd.….

59 Clustering  An example of K-means clustering is given there: An image(I) Three cluster image (J)on gray values of I

60 Algorithm

61 Summary  K-means converges, but finds local minima of the cost function.  Works only for numerical observation.  Fine tuning is required when working on image segmentation, because there is no imposed spatial coherency in K-means algorithm.  It works as a starting point for sophisticated image segmentation algorithm.

62 TEMPLATE MATCHING

63 INTRODUCTION  It is used for classifying objects.  TM techniques compare portions of images against one another.  Sample image is used for recognizing the similar objects in source image.  If standard deviation of the template image compared to the source image is small enough, template matching may be used.  Templates are most often used to identify printed characters, no. and others simple objects.

64 AGENDA:  Template matching Consists three main factors: 1.Definition And Method. 2.Bi-level Image. 3.Gray Level Image.

65 Method x,y Template Image Input Image I(x,y)O(x,y) Output Image x,y Correlation

66 Method  The matching process move the template image in all possible position in a larger source image & computes a numerical index that indicates how well the template matches the image in that position.  Match is done on a pixel–by –pixel basis.

67 CORRELATION  It is a measure of the degree to which two variables agree, not necessary in actual value but in general behavior.  The two variables are corresponding pixel values in two images, template and source.

68 Bi-Level Image TM  Template is a small image, usually a bi-level image.  Find template in source image with a yes/no option. Template Source

69 Grey Level Image TM  When using TM technique on grey –level image it is unreasonable to expect a perfect match of the grey levels.  Instead of yes/no match at each pixel, the difference in level should be used. Template Source

70 Correlation Formula

71 Correlation Is Computation Intensive  TM image size: 53 x 48.  Source image size: 177 x 236.  Assumption: Template image is inside the source image.  Correlation (search) matrix size: 124 x 188 (177-53 x 236-48).  Computation count: 124 x 188 x 53 x 48=59,305,728.

72 Machine Vision Example  Load printed circuit board in machine.  Teach template image(select & store).  Load printed circuit board.  Capture a source image and find template.

73 Contd….

74 Contd…. ASSUMTIONS & LIMITATIONS:  Template is entirely located in source image.  Partial template matching was not performed.  Rotation and scaling will cause poor matches.

75 Operational Images Correlation Map With Peak Source Image, Found rectangle, & Correlation Map

76 Contd…. Correlation Map with Peak Source Image & Found Rectangle

77 Contd…. Correlation Map With Peak Source Image & Found Rectangle

78 Contd…. Correlation Map With Peak Source Image

79 Contd…. Threshold set to 0.800 Threshold set to 0.200

80 Contour Based Method

81 Introduction:  Active contour models are also known as deformable model, dynamic contours, or Snakes.  Snake term is used to refer active contour model.  Segmentation of real images, such as medical images, is very complicated as they consists noise & artifacts.

82 Why………?  Performance of active contour models is effective in real images.  This approach is immune to noise, boundaries, and gap present in the image.  These are also effective in 3D & dynamic data.

83 Working  Snake is the concept of computations of minimal energy paths.  Snake follows region growing process.  Initially contour is placed like a seed pixel inside region of interest.  Contour consists of small curves like elastic band, grows or shrink to fit in region of interest.

84 Computational Algorithm

85 Energy  Contour is moved by forces or energy functions.  Force of energy function are derived from the image itself.  Snakes is of two types: 1.Internal energy. 2.External energy.

86 Internal Energy  Internal energy depends on intrinsic properties like boundary length or curvature.  Minimization of these factors leads to shrinkage of contour.

87 External Energy…..  External energy is derived from the image structures and it determines the relationship between the snake and image.  External energy depends on factors such as image structure and user supplied constraints.  These constraints also controls the external force.

88 Problem With Snake

89 External Energy…..

90 Advantages  The main advantages of snake is that, very often, they provide closed coherent areas.

91 Thanks For Joining 0n Image segmentation


Download ppt "By Dr. Rajeev Srivastava Image Segmentation By Dr. Rajeev Srivastava Image Segmentation."

Similar presentations


Ads by Google