announcements
play

Announcements Homework 1 is due Apr 24, 11:59 PM Homework 2 will - PDF document

Announcements Homework 1 is due Apr 24, 11:59 PM Homework 2 will be assigned this week Reading: Binary Image Processing Chapter 3 Image processing Introduction to Computer Vision CSE 152 Lecture 8 CSE 152, Spring 2015


  1. Announcements • Homework 1 is due Apr 24, 11:59 PM • Homework 2 will be assigned this week • Reading: Binary Image Processing – Chapter 3 Image processing Introduction to Computer Vision CSE 152 Lecture 8 CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Binary System Summary Histogram-based Segmentation 1. Acquire images and binarize (tresholding, color Ex: bright object on dark background: labels, etc.). 2. Possibly clean up image using morphological Histogram operators. • Select threshold Number of pixels 3. Determine regions (blobs) using connected • Create binary image: component exploration I(x,y) < T  O(x,y) = 0 4. Compute position, area, and orientation of each I(x,y)  T  O(x,y) = 1 blob using moments 5. Compute features that are rotation, scale, and translation invariant using Moments (e.g., Gray value T Eigenvalues of normalized moments). [ From Octavia Camps] CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision How do we select a Threshold? P-Tile Method • If the size of the object is approx. known, pick T • Manually determine threshold experimentally. such that the area under the histogram corresponds – Good when lighting is stable and high contrast. to the size of the object: • Automatic thresholding – P-tile method – Mode method – Peakiness detection T [ From Octavia Camps] CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision 1

  2. Mode Method Example: Image with 3 regions • Model intensity in each region R i as Ideal histogram: “constant” + N(0,  i ): • Approximate histogram as being comprised of multiple Gaussian modes. • How many modes?  1  2  3 • Where are they centered, width If above image is • Altenatively,the valleys noisy, histogram are good places for looks like thresholding to separate regions.  1  2  3 [ From Octavia Camps] [ From Octavia Camps] CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Finding the peaks and valleys “Peakiness” Detection Algorithm • It is a not trivial problem: • Find the two HIGHEST LOCAL MAXIMA that MINIMUM DISTANCE APART : g i and g j • Find lowest point between them: g k • Measure “peakiness”: – min(H(g i ),H(g j ))/H(g k ) • Find (g i ,g j ,g k ) with highest peakiness g j g i g k [ From Octavia Camps] [ From Octavia Camps] CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision What is a region? • “Maximal connected set of points in the image with same brightness value” (e.g., 1) Regions • Two points are connected if there exists a continuous path joining them. • Regions can be simply connected (For every pair of points in the region, all smooth paths can be smoothly and continuously deformed into each other). Otherwise, region is multiply connected (holes) CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision 2

  3. Connected Regions Connected Regions 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 • What are the connected regions in this binary image? • What the connected regions in this binary image? • Which regions are contained within which region? • Which regions are contained within which region? CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Four & Eight Connectedness Jordan Curve Theorem • “Every closed curve in R 2 divides the plane into two region, the ‘outside’ and ‘inside’ of the curve.” Four Connected Eight Connected Almost obvious CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision To achieve consistency with respect to Problem of 4/8 Connectedness Jordan Curve Theorem 1. Treat background as 4-connected and • 8 Connected: foreground as 8-connected. – 1’s form a closed curve, 2. Use 6-connectedness but background only 1 1 1 forms one region. 1 1 1 1 • 4 Connected – Background has two 1 1 1 regions, but ones form four “open” curves (no closed curve) CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision 3

  4. Recursive Labeling Recursive Labeling Connected Component Exploration Connected Component Exploration Procedure Label (Pixel) BEGIN Mark(Pixel) <- Marker; FOR neighbor in Neighbors(Pixel) DO IF Image (neighbor) = 1 AND Mark(neighbor)=NIL THEN Label(neighbor)   END BEGIN Main Marker <- 0; FOR Pixel in Image DO IF Image(Pixel) = 1 AND Mark(Pixel)=NIL THEN BEGIN Globals: Marker <- Marker + 1; Marker: integer Label(Pixel); Mark: Matrix same size as Image, END; initialized to NIL END CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Some notes Properties extracted from binary image • Once labeled, you know how many regions • A tree showing containment of regions (the value of Marker) • Properties of a region • From Mark matrix, you can identify all 1. Genus – number of holes pixels that are part of each region (and 2. Centroid compute area) 3. Area • How deep does stack go? 4. Perimeter 5. Moments (e.g., measure of elongation) • Iterative algorithms 6. Number of “extrema” (indentations, bulges) • Parallel algorithms 7. Skeleton CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Moments Moments: Area B(x,y) The region S is defined as: 1 0 1 0 B Given a pair of non-negative integers (j,k) the discrete (j,k) th moment of S is defined as: Example: Area of S • Fast way to implement n m  computation over n by m  j k ( , ) M B x y x y jk image or window   x 1 y 1 • One object CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision 4

  5. Moments: Centroid Shape recognition by Moments 1 1 1 ? 0 0 0 = Example: Recognition could be done by comparing moments However, moments M jk are not invariant under: •Translation •Scaling •Rotation Center of gravity (centroid, mean) of S •Skewing CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Central Moments Central Moments 1 1 0 0 Translation by T = (a,b) : Given a pair of non-negative integers (j,k) the central (j,k) th moment of S is given by: 1 0 Or the central moments can be computed from precomputed regular moments     i j Translation INVARIANT i j  jk    (  x ) ( i  m ) (  y ) ( j  n ) M mn         m  1 n  1 m n CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Normalized Moments Normalized Moments 1 1 0 0 Scaling by (a,c) and translating by T = (b,d) : 1 Given a pair of non-negative integers (j,k) the normalized 0 (j,k) th moment of S is given by: Scaling and translation INVARIANT CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision 5

  6. Region orientation from Second Moment Binarization using Color Matrix • Object’s in robocup are distinguished by color. • How do you binarize the image so that pixels where ball is located are labeled with 1, and other locations 1. Compute second centralized moment matrix     are 0? • Symmetric, positive definite matrix 20 11   • Positive Eigenvalues     • Orthogonal Eigenvectors 11 02 • Let C b =(r g b) T be the color of the ball. 1. Compute Eigenvectors of Moment Matrix to obtain orientation 2. Eigenvalues are independent of orientation and translation CSE 152, Spring 2015 Introduction to Computer Vision CSE 152, Spring 2015 Introduction to Computer Vision Binarization using Color • Let c(u,v) be the color of pixel (u,v) • Simple method 2       if || c ( u , v )  c b || b ( u , v )  1    0 otherwise • Better alternative (why?) – Convert c (u,v) to HSV space H(u,v), S(u,v) V(u,v) – Convert c b to HSV – Check that HS distance is less than threshold  and brightness (V) is greater than a treshold V>  CSE 152, Spring 2015 Introduction to Computer Vision 6

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend