image processing - bilkent universityduygulu/courses/cs554/notes... · binary image processing is a...

81
CS554 Computer Vision © Pinar Duygulu 1 Image Processing CS 554 – Computer Vision Pinar Duygulu Bilkent University

Upload: dangtram

Post on 31-Jan-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

1

Image Processing

CS 554 – Computer VisionPinar Duygulu

Bilkent University

Page 2: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

2

TodayImage Formation

Point and Blob Processing

Binary Image Processing

Readings:– Gonzalez & Woods, Ch. 3

Slides are adapted from Alyosha Efros andShapiro & Stockman

Page 3: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

3

Imaging Process

Page 4: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

4

Image Formation

Page 5: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

5

Sampling and Quantization

Page 6: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

6

Sampling and Quantization

Page 7: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

7

What is an image?We can think of an image as a function, f, from R2 to R:

• f( x, y ) gives the intensity at position ( x, y ) – Realistically, we expect the image only to be defined over a

rectangle, with a finite range:– f: [a,b]x[c,d] [0,1]

A color image is just three functions pasted together. We can write this as a “vector-valued” function:

f(x,y) = [r(x,y) g(x,y) b(x,y)]

Page 8: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

8

Images as functions

Page 9: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

9

What is a digital image?We usually operate on digital (discrete) images:

– Sample the 2D space on a regular grid– Quantize each sample (round to nearest integer)

If our samples are ∆ apart, we can write this as:f[i ,j] = Quantize{ f(i ∆, j ∆) }

The image can now be represented as a matrix of integer values

Page 10: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

10

Point ProcessingAn image processing operation typically defines a new

image g in terms of an existing image f.The simplest kind of range transformations are these

independent of position x,y:g = t(f)

This is called point processing.

Important: every pixel for himself – spatial information completely lost!

Page 11: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

11

Basic Point Processing

Page 12: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

12

Negative

Page 13: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

13

Image Enhancement

Page 14: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

14

Contrast Streching

Page 15: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

15

Image Histograms

Page 16: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

16

Neighborhood Processing (filtering)Q: What happens if I reshuffle all pixels within the

image?

A: It’s histogram won’t change. No point processing will be affected…

Need spatial information to capture this.

Page 17: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

17

Goal: Extract “Blobs”

What are “blobs”?– Regions of an image that are somehow coherent

Why?– Object extraction, object removal, compositing, etc.– …but are “blobs” objects?– No, not in general

Page 18: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

18

Blob’s coherenceSimplest way to define blob coherence is as similarity in brightness or color:

The tools become blobs The house, grass, and sky make different blobs

Page 19: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

19

The meaning of a blobOther interpretations of blobs are possible,

depending on how you define the input image:– Image can be a response of a particular detector

• Color Detector• Face detector• Motion Detector• Edge Detector

gx2+gy2

Page 20: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

20

Why is this useful?

AIBO RoboSoccer(VelosoLab)

Page 21: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

21

Ideal Segmentation

Page 22: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

22

Result of Segmentation

Page 23: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

23

ThresholdingBasic segmentation operation:

mask(x,y) = 1 if im(x,y) > Tmask(x,y) = 0 if im(x,y) < T

T is threshold– User-defined– Or automatic

Same ashistogram partitioning:

Page 24: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

24

As Edge Detection

gx2+gy2 gx2+gy2 > T

Page 25: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

25

Sometimes works well…

What are potentialProblems?

Page 26: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

26

…but more often not

Adaptive thresholding

Page 27: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

27

Region growing

– Start with initial set of pixels K– Add to K any neighbors, if they are within similarity threshold– Repeat until nothing changes

Is this same as global threshold? What can go wrong?

Page 28: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

28

Color-Based Blob SegmentationAutomatic Histogram Partitioning

– Given image with N colors, choose K– Each of the K colors defines a region

• not necessarily contiguous– Performed by computing color histogram, looking for modes

– This is what happens when you downsample image color range, for instance in Photoshop

Page 29: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

29

Finding modes in a histogram

Page 30: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

30

Mean-Shift (Comaniciu & Meer)

Page 31: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

31

Mean-Shift (Comaniciu & Meer)

Page 32: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

32

Issues:Although often useful, all these approaches work

only some of the time, and are considered rather “hacky”.

Can’t even handle our tiger:

Problem is that blobs != objects!

Page 33: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

33

Binary Image Processing

Binary images are handy in many cases (sprite extraction, compositing, etc).

Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology

consists of a set of image analysis operations that are used to produce or process binary images, usually images of 0’s and 1’s.

0 represents the background 1 represents the foreground

000100100010000001111000100000010010001000

Page 34: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

34

Application Areas

Document Analysis

Industrial Inspection

Medical Imaging

Page 35: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

35

Operations

Separate objects from background and from one another

Aggregate pixels for each object

Compute features for each object

Page 36: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

36

Example red blood cell image• Many blood cells are

separate objects• Many touch to each

other – bad!• Salt and pepper noise

from thresholding• How usable is this

data?

• 63 separate objects detected• Single cells have area about 50• Noise spots• Gobs of cells

Page 37: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

37

• More uniform objects• More uniform background• Objects actually separated

More controlled images

• 15 objects detected• Location known• Area known• 3 distinct clusters of 5

values of area; 85, 145, 293

Page 38: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

38

Thresholding

Binary images can be obtained from gray level images by thresholding

Page 39: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

39

Assumptions for thresholding

• Object region of interest has intensity distribution different from background

• Region pixel likely to be identified by intensity alone: – intensity > a – intensity < b – a < intensity < b

• Works OK with flat-shaded scenes or engineered scenes.

• Does not work well with natural scenes.

Page 40: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

40

Use of histograms for threshold selection

• Cherry image with 3 regions

• Background is black• Healthy cherry is

bright• Bruise is medium

dark• Histogram shows two

cherry regions (black background has been removed)

Page 41: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

41

Histogram-directed thresholding

How can we use a histogram to separate animage into 2 (or several) different regions?

Is there a single clear threshold? 2? 3?

Page 42: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

42

Choosing Threshold

Detect peaks and valleys

Two distinct modes Overlapped modes

Page 43: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

43

Choosing threshold

• Find the deepest valley between two modes of bimodal histogram

• Fit two or more Gaussian curves to the histogram• Dynamic thresholding

Page 44: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

44

Cleaning up thresholding results

• Delete object pixels on boundary to better separate parts.

• Fill small holes• Delete tiny objects• (last 2 are “salt-and-

pepper” noise)

Page 45: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

45

Mathematical Morphology

Binary mathematical morphology consists of twobasic operations

dilation and erosion

and several composite relations

closing and opening conditional dilation . . .

Page 46: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

46

Dilation

Dilation expands the connected sets of 1s of a binary image.

It can be used for

1. growing features

2. filling holes and gaps

Page 47: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

47

Erosion

Erosion shrinks the connected sets of 1s of a binary image.

It can be used for

1. shrinking features

2. Removing bridges, branches and small protrusions

Page 48: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

48

Structuring Elements

A structuring element is a shape mask used inthe basic morphological operations.

They can be any shape and size that isdigitally representable, and each has an origin.

boxhexagon disk something

box(length,width) disk(diameter)

Page 49: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

49

Dilation with structuring elements

The arguments to dilation and erosion are

1. a binary image B2. a structuring element S

dilate(B,S) takes binary image B, places the originof structuring element S over each 1-pixel, and ORsthe structuring element S into the output image atthe corresponding position.

0 0 0 00 1 1 00 0 0 0

11 1

0 1 1 00 1 1 10 0 0 0

originBS

dilate

B ⊕ S

Page 50: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

50

Dilation

Page 51: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

51

Dilation

Page 52: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

52

Erosion with structuring elements

erode(B,S) takes a binary image B, places the origin of structuring element S over every pixel position, andORs a binary 1 into that position of the output image only ifevery position of S (with a 1) covers a 1 in B.

0 0 1 1 00 0 1 1 00 0 1 1 01 1 1 1 1

111

0 0 0 0 00 0 1 1 00 0 1 1 00 0 0 0 0

B S

origin

erode

B S

Page 53: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

53

Erosion

Page 54: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

54

Erosion

Original image Eroded image

Page 55: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

55

Erosion

Eroded once Eroded twice

Page 56: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

56

Opening and Closing

• Closing is the compound operation of dilation followed by erosion (with the same structuring element)

• Opening is the compound operation of erosion followed by dilation (with the same structuring element)

Page 57: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

57

Opening and Closing

Page 58: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

58

Example 1

Page 59: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

59

Example 2: try

0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 00 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 00 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 00 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 00 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 00 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 00 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 01 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

0 1 1 1 01 1 1 1 11 1 1 1 11 1 1 1 10 1 1 1 0

B

S

Page 60: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

60

OPENING: The original image eroded twice and dilated twice (opened). Most noise is removed

Opening and Closing

CLOSING: The original image dilated and then eroded. Most holes are filled.

Page 61: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

61

Opening and Closing

Page 62: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

62

Boundary Extraction

Page 63: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

63

Boundary Extraction

Page 64: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

64

Region Filling

Page 65: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

65

Connected Component Labeling

Once you have a binary image, you can identify and then analyze each connected set of pixels.

The connected components operation takes in a binary image and produces a labeled image in which each pixel has the integer label of either the background (0) or a component.

Page 66: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

66

Extraction of Connected Components

Page 67: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

67

Labeling shown as pseudo-color

connectedcomponentsof 1’s fromthresholdedimage

connectedcomponentsof clusterlabels

Page 68: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

68

Connectivity

4-neighborhood 8-neighborhood

Page 69: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

69

Recursive labeling

Page 70: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

70

First Step : Run Length EncodingSegment each image row into groups of similar

pixels called runs– Runs store a start and end point for each contiguous

row of color

Original image RLE image

Page 71: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

71

Second Step : Merging Regions

Page 72: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

72

Final ResultsRuns are merged into multi-row regionsImage is now described as contiguous regions

instead of just pixels

Page 73: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

CS554 Computer Vision © Pinar Duygulu

73

Blob PropertiesNow that we have nice, clean blobs, what can we do

with them?Compute Statistics:

– Area– Perimeter– Aspect ratio– Center of mass– best-fitting ellipse– Average color– Etc.

All this can be used to classify blobs and decide if they hold the objects we are interested in.

Page 74: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

74

Area an Centroid

Page 75: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

75

Perimeter pixels and length

Page 76: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

76

Circularity or elongation

Page 77: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

77

Circularity as variance of radius

Page 78: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

78

Bounding box

Page 79: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

79

Second moments

These are invariant to object location in the image.

Page 80: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

80

Axis of least inertiaAn axis which we could spin the pixels with least energy inputThe axis about which the pixels have least second moment

Page 81: Image Processing - Bilkent Universityduygulu/Courses/CS554/Notes... · Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists

81

Region Adjacency Graph

A region adjacency graph (RAG) is a graph in whicheach node represents a region of the image and an edgeconnects two nodes if the regions are adjacent.