cs262 computer vision image regions
play

CS262: Computer Vision Image Regions John Magee Slides courtesy of - PowerPoint PPT Presentation

CS262: Computer Vision Image Regions John Magee Slides courtesy of Diane H. Theriault Question of the Day How do you identify and compute properties of objects found in images? Post-processing Basic segmentations can be messy. How can


  1. CS262: Computer Vision Image Regions John Magee Slides courtesy of Diane H. Theriault

  2. Question of the Day • How do you identify and compute properties of objects found in images?

  3. Post-processing • Basic segmentations can be messy. How can you clean them up?

  4. Morphological Operators: Erosion image result “structuring Any pixel where the whole element” structuring element doesn’t fit in the foreground is removed

  5. Morphological Operators image result “structuring Put structuring element on every element” pixel and turn on all pixels the structuring element touches

  6. Identifying Image Regions • Image as a Graph • Definition of Connectivity 4 Connected 8 Connected

  7. Depth First Traversal / Flood Fill: Recursive Depth-first Traversal(self) • – If self marked, stop – Else • Mark self • For each neighbor – Depth-first traversal(neighbor) • What do you know about the architecture of computer memory that might cause a problem here with a very large image region? • [A real “Google Interview” question!

  8. Depth First Traversal / Flood Fill: Iterative • Solution: Use a stack data structure instead of the program stack Depth-first Traversal(self) • – Stack.push(self) – While(!stack.empty()) • node = stack.pop() • For each neighbor – If not marked » Mark neighbor » Stack.push(neighbor)

  9. Removing Small Image Regions • For each image region, count number of pixels • For any regions smaller than some threshold, flood fill the region with a zero

  10. Holes • A hole is any non-foreground that you can’t reach from the “background” e.g. the edge of the image

  11. Defining Holes • If Black is background and white is foreground, are the pink squares background or a hole? • Foreground: 8 connected • Background 4: connected

  12. Boundary Following • Find any pixel in an object (e.g. by scanning through image) then put your “right hand” on the object and walk around till you get back to your start point

  13. Boundary Following • How do you keep your “right hand” on the wall? Check all neighboring pixels, always going clockwise (or counter- clockwise. Consistency is key)

  14. Where is the boundary? • The pixels themselves, or between the pixels?

  15. Where are the boundaries?

  16. Where are the boundaries? • One convention: Have boundaries between background and foreground go clockwise and boundaries between objects and holes go counter-clockwise • Keep a tree of the relationships between objects, holes, and objects in the holes

  17. Where are the Boundaries? • One convention: Have boundaries between background and foreground go clockwise and boundaries between objects and holes go counter-clockwise • Keep a tree of the relationships between objects, holes, and objects in the holes

  18. Properties of Image Regions • “ Location ” • Distance between image regions? – Set of Pixels – Boundary – Centroid (center) – Bounding Box – Bounding Ellipse – Convex Hull Shapiro & Stockman, Chapter 3. Szeliski 3.3.4

  19. Properties of Image Regions • “Shape” – Area – Perimeter – Orientation – Compactness – Circularity – Image Moments

  20. Properties of Image Regions • “Appearance” – Mean brightness – Mean color – Brightness or Color histogram – Other measures of appearance

  21. Simple region properties can get you pretty far!

Recommend


More recommend