Presentation is loading. Please wait.

Presentation is loading. Please wait.

Machinen Vision and Dig. Image Analysis 1 Prof. Heikki Kälviäinen CT50A6100 Lectures 8&9: Image Segmentation Professor Heikki Kälviäinen Machine Vision.

Similar presentations


Presentation on theme: "Machinen Vision and Dig. Image Analysis 1 Prof. Heikki Kälviäinen CT50A6100 Lectures 8&9: Image Segmentation Professor Heikki Kälviäinen Machine Vision."— Presentation transcript:

1 Machinen Vision and Dig. Image Analysis 1 Prof. Heikki Kälviäinen CT50A6100 Lectures 8&9: Image Segmentation Professor Heikki Kälviäinen Machine Vision and Pattern Recognition Laboratory Department of Information Technology Faculty of Technology Management Lappeenranta University of Technology (LUT) Heikki.Kalviainen@lut.fi http://www.lut.fi/~kalviai http://www.it.lut.fi/ip/research/mvpr/

2 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 2 Content Motivation. Detection of discontinuities. Edge linking and boundary detection. –Local processing. –Global processing: Hough Transform. Thresholding. Region-oriented segmentation. –Region growing. –Region splitting and merging. Motion-based segmentation.

3 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 3 Segmentation: Motivation To extract important details in an image for building a feature vector = feature extraction. Feature selection => feature extraction => feature vector. Challenging question: What details?

4 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 4 Detection of discontinuities Point detection. Line detection. Edge detection. –Basic formulation. –Gradient operators. –Laplace operators. Combined detection.

5 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 5 Point detection Detection of isolated points: a) Apply the mask -1 -1 -1 -1 8 -1 -1 -1 -1 b) Threshold by using abs(R) > T where R is ∑w_i z_i (w_i mask, z_i point at location i)

6 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 6 Line detection Directed filters (lines of one pixel thick): Horizontal +45 ° -1 -1 -1 -1 -1 2 2 2 2-1 2 -1 -1 -1 -1 2 -1 -1 Vertical -45 ° -1 2 -1 2 -1 -1 -1 2 -1-1 2 -1 -1 2 -1-1 -1 2

7 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 7 Edge detection Edge = The boundary between two regions with relatively distinct gray-level properties. First-order derivates (Gradient operators). Second-order derivates (Laplace operators). Approaches with several techniques.

8 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 8 Edge detection: different kind of images

9 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 9 Edge detection: different kind of images (cont.) Images where almost each pixel belongs to edges.

10 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 10 Edge detection: Gradient operators Gradient of f(x,y): G_x ∂f/∂x df == G_y ∂f/∂y Magnitude: mag(df)= ((G_x)^2 + (G_y)^2)^(-1/2) approximation df = abs(G_x) + abs (G_y) Direction: α(x,y) = tan^{-1} (G_y/G_x)

11 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 11 Gradient operators Roberts:1 00 1 0 -11 0 Prewitt: -1 -1 -1-1 0 1 0 0 0-1 0 1 1 1 1-1 0 1 Sobel: -1 -2 -1-1 0 1 0 0 0-2 0 2 1 2 1-1 0 1

12 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 12 Edge detection: 3x3 Prewitt operator Horizontal mask (left top). Vertical mask (left bottom). Sum of the two masks (right middle).

13 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 13 Edge detection: Sobel and Prewitt operators Sobel operatorPrewitt operator

14 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 14 Laplace operators Laplacian of a 2-D function (second derivate operator): d^2 f = ∂^2f/∂x^2 + ∂f^2/∂y^2 3 x 3 mask: d^2 f = 4 z_5 – (z_2 + z_4 + z_6 + z_8) 0 -1 -0 -1 4 -1 0 -1 0

15 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 15 Laplace operators (cont.) Sensitive to noise. Finding the location of edges using its zero-crossing property. Convolve an image with the Laplacian of 2-D Gaussian function of the form h(x,y) = exp(-(x^2+y^2)/2σ^2) where σ is the standard deviation. Let r^2 = x^2 + y^2: d^2 h = (r^2-σ^2)/σ^4 exp(-(r^2)/2σ^2) zero-crossings at r = ±σ

16 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 16 Laplacian of Gaussian: Marr edge detection Convolution with a filter h(r) of ←  =1.5  =5.0 → zero-crossings

17 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 17 Edge detection: comparisons ← Sobel Prewitt → ← Roberts Laplacian of Gaussian →

18 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 18 Edge linking and boundary detection From intensity discontinuities to more general segmentation. –For example, from edge pixels to line segments. Local processing. –Analysis of a small neighborhood: Strength and direction of the gradient of edge pixels. Global processing: –Analysis of the whole image: Global relationships between pixels. –Hough Transform.

19 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 19 Thresholding: Foundation For example, to separate an object (objects) and background. One threshold: –Object point: f(x,y) > T. Two thresholds: –Object class1: T_1 < f(x,y) < T_2. –Object class2: f(x,y) > T_2. –Background: f(x,y) ≤ T_1.

20 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 20 Thresholding: Foundation (cont.) Operation. T = T[x, y, p(x,y), f(x,y)] where f(x,y) is the gray-level point of (x,y) p(x,y) denotes some local property of this point (e.g., the average gray-level of a neighborhood centered on (x,y)) A thresholded image is g(x,y) is defined as g(x,y) = 1 if f(x,y) > T 0 if f(x,y) ≤ T.

21 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 21 Threshold: Role of illumination An image f(x,y) is a product of a reflectance component r(x,y) and an illumination component i(x,y). Original image => suitable histogram to thresholding Original image + illumination changes => unsuitable histogram to thresholding Ready for illumination changes?

22 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 22 Thresholding: Global and optimal How: –Simple global thresholding: just select T manually. –Optimal thresholding: optimally by probability densities (Gaussian) p(z) = exp(-(z-μ)^2 / (2σ^2)) / (√(2πσ)) where μ is the mean value and σ is the standard deviation Mixture probability density of two classes: p(z) = P_1 p_1(z) + P_2 p_2(z) where P_1 and P_2 are the a priori probabilities P_1 + P_2 = 1.

23 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 23 Thresholding: Global and optimal (cont.) The threshold value for which error is minimal P_1 p_1(T) = P_2 p_2(T) By solving the equation we will obtain T T = (μ_1 + μ_2)/2 + σ^2/((μ_1 - μ_2) ln(P_2/P_1) If P_1=P_2 the optimal threshold is the average of the means.

24 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 24 Region-oriented segmentation Region growing. –Bottom-up. –Pixel by pixel. –Pixel aggregation. Region splitting and merging. –Top-down. –Subdivisions of the image. –Split and merge.

25 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 25 Region growing Pixel aggregation: start with a set of seed points and from these grow regions by appending to each seed point those neighboring pixels that have similar properties (such as gray level, texture, color). Which seed points? Similar properties? Should the criterion be constant or change as a function of current pixels.

26 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 26 Region splitting and merging Subdivide an image initially into a set of arbitrary, disjointed regions and then merge and/or split the regions in an attempt to satisfy given conditions. Method using a logical predicate P(R) over the points in set R (similar values or not): 1.Split into four disjointed quadrants any region R_i where P(R_i) = FALSE. 2.Merge any adjacent regions R_j and R_k for which P(R_j U R_K) = TRUE. 3.Stop when no further merging or splitting is possible.

27 Machinen Vision and Dig. Image Analysis Prof. Heikki Kälviäinen CT50A6100 27 Summary Image acquisition => digital image ↓ Preprocessing => better image ↓ Segmentation => features for classification/clustering.


Download ppt "Machinen Vision and Dig. Image Analysis 1 Prof. Heikki Kälviäinen CT50A6100 Lectures 8&9: Image Segmentation Professor Heikki Kälviäinen Machine Vision."

Similar presentations


Ads by Google