1. Trang chủ
  2. » Công Nghệ Thông Tin

pLecture11 image segmentation

39 318 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 39
Dung lượng 3,82 MB

Nội dung

Xử lý ảnh dành cho người mới bắt đầu học. Một môn học thật hữu ích và đang ngày càng được mở rộng và phát triển.Với demo có sẵn và giải thích rất dễ hiểu.Mong quyển sách này sẽ giúp ích được cho các bạn.

10/10/2015 Computer Vision Lecture 11 - Segmentation Instructor: Ha Dai Duong duonghd@mta.edu.vn 10/10/2015 Introduction • Image segmentation divides an image into regions that are connected and have some similarity within the region and some difference between adjacent regions • The goal is usually to find individual objects in an image • For the most part there are fundamentally two kinds of approaches to segmentation: discontinuity and similarity – Similarity may be due to pixel intensity, color or texture – Differences are sudden changes (discontinuities) in any of these, but especially sudden changes in intensity along a boundary line, which is called an edge 10/10/2015 10/10/2015 Today’s class Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 Today’s class Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 10/10/2015 Detection of discontinuities • There are three kinds of discontinuities of intensity: points, lines and edges • The most common way to look for discontinuities is to scan a small mask over the image The mask determines which kind of discontinuity to look for R  w1 z1  w2 z   w9 z9   wi zi i 1 10/10/2015 Point detection R T where T : a nonnegative threshold 10/10/2015 10/10/2015 Line detection • Only slightly more common than point detection is to find a one pixel wide line in an image • For digital images the only three point straight lines are only horizontal, vertical, or diagonal (+ or –45) 10/10/2015 Example 10/10/2015 10/10/2015 Edge detection 10/10/2015 Edge detection 10/10/2015 10 10/10/2015 Edge detection 10/10/2015 11 Edge detection 10/10/2015 12 10/10/2015 Gradient Operators • First-order derivatives: – The gradient of an image f(x,y) at location (x,y) is defined as the vector: Gx   fx   f      f  G y   y   – The magnitude of this vector: f  mag(f )  Gx2  G y2 – The direction of this vector:   Gx    G  y  ( x, y)  tan 1  10/10/2015 13 Gradient Operators Roberts cross-gradient operators Prewitt operators Sobel operators 10/10/2015 14 10/10/2015 Gradient Operators Prewitt masks for detecting diagonal edges Sobel masks for detecting diagonal edges 10/10/2015 15 Example f  Gx  G y 10/10/2015 16 10/10/2015 Example 10/10/2015 17 Example 10/10/2015 18 10/10/2015 The Laplacian • Second-order derivatives: (The Laplacian) – The Laplacian of an 2D function f(x,y) is defined as 2 f 2 f 2 f   x y – Digital approximations 10/10/2015 19 The Laplacian • Two forms in practice: 10/10/2015 20 10 10/10/2015 Using Edges to Improve Global Thresholding 10/10/2015 49 Using Edges to Improve Global Thresholding 10/10/2015 50 25 10/10/2015 Using Edges to Improve Global Thresholding 10/10/2015 51 Multiple thresholding In the case of K classes, C1 , C2 , , CK , the between-class variance is K  B2   Pk  mk  mG  k 1 where Pk   pi and mk  iCk Pk  ip i iCk The optimum threshold values, k1*, k2 *, , k K 1 * that maximize  B2 ( k1*, k2 *, , kK 1*)  max  B2 ( k1 , k2 , , k K 1 )  k  L 1 10/10/2015 52 26 10/10/2015 Multiple thresholding 10/10/2015 53 Today’s class Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 54 27 10/10/2015 Region-based segmentation • Edges and thresholds sometimes not give good results for segmentation • Region-based segmentation is based on the connectivity of similar pixels in a region – Each region must be uniform – Connectivity of the pixels within the region is very important • There are two main approaches to region-based segmentation: region growing and region splitting 10/10/2015 55 Basic formulation • Let R represent the entire image region • Segmentation is a process that partitions R into subregions, R1,R2,…,Rn, such that n (a)  Ri  R i 1 (b) Ri is a connected region, i  1,2, , n (c) Ri  R j   for all i and j , i  j (d) P ( Ri )  TRUE for i  1,2, , n (e) P( Ri  R j )  FALSE for any adjacent regions Ri and R j where P(Rk): a logical predicate defined over the points in set Rk For example: P(Rk)=TRUE if all pixels in Rk have the same gray evel 10/10/2015 56 28 10/10/2015 Region growing Region growing is a procedure that groups pixels or subregions into larger regions The simplest of these approaches is pixel aggregation, which starts with a set of “seed” points and from these grows regions by appending to each seed points those neighboring pixels that have similar properties (such as gray level, texture, color, shape) Region growing based techniques are better than the edge-based techniques in noisy images where edges are difficult to detect 10/10/2015 57 f ( x, y ) : input image array S ( x, y ): seed array containing 1s (seeds) and 0s Q ( x, y ): predicate Find all connected components in S ( x, y ) and erode each connected components to one pixel; label all such pixels found as All other pixels in S are labeled Form an image fQ such that, at a pair of coordinates (x,y), let f Q ( x, y )  if the Q is satisfied otherwise fQ ( x, y )  Let g be an image formed by appending to each seed point in S all the 1-value points in f Q that are 8-connected to that seed point Label each connencted component in g with a different region label This is the segmented image obtained by region growing 10/10/2015 58 29 10/10/2015 Example 10/10/2015 59 Example 4-connectivity 10/10/2015 60 30 10/10/2015 Example 8-connectivity 10/10/2015 61 Test result 10/10/2015 62 31 10/10/2015 Region splitting and Merging R : entire image Ri :entire image Q: predicate For any region Ri , If Q ( Ri ) = FALSE, we divide the image Ri into quadrants When no further splitting is possible, merge any adjacent regions R j and Rk for which Q ( R j  Rk ) = TRUE Stop when no further merging is possible 10/10/2015 63 Region splitting and Merging 10/10/2015 64 32 10/10/2015 Example of Predicate function TRUE if   a and  m  b Q otherwise  FALSE 10/10/2015 65 Region splitting and Merging 10/10/2015 66 33 10/10/2015 Today’s class Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 67 Three types of points • Points belonging to a regional minimum • Points at which a drop of water would fall to a single minimum (The catchment basin or watershed of that minimum.) • Points at which a drop of water would be equally likely to fall to more than one minimum (The divide lines or watershed lines.) Watershed lines 10/10/2015 The principal objective of segmentation algorithms based on these concepts is to find the watershed lines 68 34 10/10/2015 The ideal of method 10/10/2015 69 The ideal of method 10/10/2015 70 35 10/10/2015 Algorithm  Start with all pixels with the lowest possible value These form the basis for initial watersheds   For each intensity level k:  For each group of pixels of intensity k If adjacent to exactly one existing region, add these pixels to that region Else if adjacent to more than one existing regions, mark as boundary Else start a new region 10/10/2015 71 Example Watershed algorithm is often used on the gradient image instead of the original image 10/10/2015 72 36 10/10/2015 Today’s class Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 73 Difference of image 10/10/2015 74 37 10/10/2015 Difference of image 10/10/2015 75 Background subtraction 10/10/2015 76 38 10/10/2015 Today’s class Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 77 39 [...]... of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 54 27 10/10/2015 Region-based segmentation • Edges and thresholds sometimes do not give good results for segmentation • Region-based segmentation is based on the connectivity of similar pixels in a region – Each... 10/10/2015 32 16 10/10/2015 Example 10/10/2015 33 Today’s class 1 2 3 4 5 6 7 Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 34 17 10/10/2015 Problems • Assumption: the range of intensity levels covered by objects of interest is different from the background... Each region must be uniform – Connectivity of the pixels within the region is very important • There are two main approaches to region-based segmentation: region growing and region splitting 10/10/2015 55 Basic formulation • Let R represent the entire image region • Segmentation is a process that partitions R into subregions, R1,R2,…,Rn, such that n (a)  Ri  R i 1 (b) Ri is a connected region, i  1,2,... the edge-based techniques in noisy images where edges are difficult to detect 10/10/2015 57 f ( x, y ) : input image array S ( x, y ): seed array containing 1s (seeds) and 0s Q ( x, y ): predicate 1 Find all connected components in S ( x, y ) and erode each connected components to one pixel; label all such pixels found as 1 All other pixels in S are labeled 0 2 Form an image fQ such that, at a pair of... 4-connectivity 10/10/2015 60 30 10/10/2015 Example 8-connectivity 10/10/2015 61 Test result 10/10/2015 62 31 10/10/2015 Region splitting and Merging R : entire image Ri :entire image Q: predicate 1 For any region Ri , If Q ( Ri ) = FALSE, we divide the image Ri into quadrants 2 When no further splitting is possible, merge any adjacent regions R j and Rk for which Q ( R j  Rk ) = TRUE 3 Stop when no further... splitting and Merging 10/10/2015 66 33 10/10/2015 Today’s class 1 2 3 4 5 6 7 Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 67 Three types of points • Points belonging to a regional minimum • Points at which a drop of water would fall to a single minimum... coordinates (x,y), let f Q ( x, y )  1 if the Q is satisfied otherwise fQ ( x, y )  0 3 Let g be an image formed by appending to each seed point in S all the 1-value points in f Q that are 8-connected to that seed point 4 Label each connencted component in g with a different region label This is the segmented image obtained by region growing 10/10/2015 58 29 10/10/2015 Example 10/10/2015 59 Example 4-connectivity... smoothing the image with the Gaussian smoothing mask, followed by application of the Laplacian mask 10/10/2015 21 The Laplacian of a Gaussian 10/10/2015 22 11 10/10/2015 Example Sobel gradient Gaussian smooth function 10/10/2015 Laplacian mask 23 Example 10/10/2015 24 12 10/10/2015 Today’s class 1 2 3 4 5 6 7 Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation. .. 23 Example 10/10/2015 24 12 10/10/2015 Today’s class 1 2 3 4 5 6 7 Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 25 Local processing • Two properties of edge points are useful for edge linking: – the strength (or magnitude) of the detected edge points... pixels to that region 2 Else if adjacent to more than one existing regions, mark as boundary 3 Else start a new region 10/10/2015 71 Example Watershed algorithm is often used on the gradient image instead of the original image 10/10/2015 72 36 ... Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 54 27 10/10/2015 Region-based segmentation • Edges and thresholds... gradient image instead of the original image 10/10/2015 72 36 10/10/2015 Today’s class Detection of discontinuities Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation... Edge Linking and Boundary Detection Thresholding Region-based segmentation Segmentation by Morphological Watersheds The use of motion in segmentation Discussion 10/10/2015 25 Local processing • Two

Ngày đăng: 29/03/2016, 13:02

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN

w