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

cs262 computer vision image regions
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

CS262: Computer Vision Image Regions

John Magee

Slides courtesy of Diane H. Theriault

slide-2
SLIDE 2

Question of the Day

  • How do you identify and compute properties
  • f objects found in images?
slide-3
SLIDE 3

Post-processing

  • Basic segmentations can be messy. How can

you clean them up?

slide-4
SLIDE 4

Morphological Operators: Erosion

image “structuring element” result Any pixel where the whole structuring element doesn’t fit in the foreground is removed

slide-5
SLIDE 5

Morphological Operators

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

slide-6
SLIDE 6

Identifying Image Regions

  • Image as a Graph
  • Definition of Connectivity

4 Connected 8 Connected

slide-7
SLIDE 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!
slide-8
SLIDE 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)

slide-9
SLIDE 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

slide-10
SLIDE 10

Holes

  • A hole is any non-foreground that you can’t reach from the

“background” e.g. the edge of the image

slide-11
SLIDE 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
slide-12
SLIDE 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

slide-13
SLIDE 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)
slide-14
SLIDE 14

Where is the boundary?

  • The pixels themselves, or between the pixels?
slide-15
SLIDE 15

Where are the boundaries?

slide-16
SLIDE 16

Where are the boundaries?

  • One convention: Have

boundaries between background and foreground go clockwise and boundaries between

  • bjects and holes go

counter-clockwise

  • Keep a tree of the

relationships between

  • bjects, holes, and
  • bjects in the holes
slide-17
SLIDE 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

slide-18
SLIDE 18

Properties of Image Regions

  • “Location”

– Set of Pixels – Boundary – Centroid (center) – Bounding Box – Bounding Ellipse – Convex Hull

  • Distance between

image regions?

Shapiro & Stockman, Chapter 3. Szeliski 3.3.4

slide-19
SLIDE 19

Properties of Image Regions

  • “Shape”

– Area – Perimeter – Orientation – Compactness – Circularity – Image Moments

slide-20
SLIDE 20

Properties of Image Regions

  • “Appearance”

– Mean brightness – Mean color – Brightness or Color histogram – Other measures of appearance

slide-21
SLIDE 21

Simple region properties can get you pretty far!