cap 5415 computer vision fall 2004

32
Alper Yilmaz, Fall 2004 U CF CAP 5415 Computer Vision Fall 2004 Dr. Alper Yilmaz Univ. of Central Florida www.cs.ucf.edu/courses/cap5415/ fall2004 Office: CSB 250

Upload: amma

Post on 06-Jan-2016

52 views

Category:

Documents


0 download

DESCRIPTION

CAP 5415 Computer Vision Fall 2004. Dr. Alper Yilmaz Univ. of Central Florida www.cs.ucf.edu/courses/cap5415/fall2004 Office: CSB 250. Recap (Edge Detection). Marr-Hildreth and Canny edge detectors Gaussian smoothing Compute derivatives In x and y directions Find gradient magnitude - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

CAP 5415 Computer VisionFall 2004

Dr. Alper YilmazUniv. of Central Floridawww.cs.ucf.edu/courses/cap5415/fall2004

Office: CSB 250

Page 2: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Marr-Hildreth and Canny edge detectors– Gaussian smoothing– Compute derivatives

In x and y directions

– Find gradient magnitude– Threshold gradient magnitude

Difference between Marr-Hildreth and Canny– Marr-Hildreth use 2nd order derivative– Marr-Hildreth thresholds slope of zero-crossings

Recap (Edge Detection)

Page 3: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Marr-Hildreth Edge Detector

Image 2g(x)Find

zero-crossings

gI 2 computeslope

Threshold

Page 4: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Canny Edge Detector

Image

gx(x,y) Gradientmagnitude

gy(x,y) Gradientdirection

Non-maximumsuppression

Hysteresis thresholding

Page 5: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Region Segmentation

Marr Hildreth Edge DetectorCanny Edge Detector

Page 6: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Applications of Segmentation

Object recognition MPEG-4 video compression

Page 7: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Object Recognition Using Region Properties

Training– For all training samples of each model object

Segment the image Compute region properties (features)

Recognition– Given an image of unknown object,

Segment the image Compute its feature vector Compare with the training set

Page 8: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

MPEG4 CompressionObject Based Compression

Advantages of OBC– High compression ratio– Allows insertion deletion

of objects How does it work?

– Find objects (Object Segmentation)– Code objects and their locations– Build mosaics of globally static objects– Render scene at receiver

Page 9: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Clustering

Page 10: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Segmentation-Clustering

R3

R1 R2

R5

R4

R6

Page 11: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Region Segmentation

Page 12: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Layer Representation

Page 13: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Segmentation

Find set of regions R1, R2, ….,Rn such that

All pixels in region i satisfy some similarity constraint

IRi

n

i

1

ji RRji ,

Page 14: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Similarity Constraints

All pixels in any sub-image musts have the same gray levels.

All pixels in any sub-image must not differ more than some threshold

All pixels in any sub-image may not differ more than some threshold from the mean of the gray of the region

The standard deviation of gray levels in any sub-image must be small.

Page 15: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Simple Segmentation

Otherwise

if

0

),(1),(

TyxIyxB

Otherwise

if

0

),(1),( 21 TyxIT

yxB

Otherwise

if

0

),(1),(

ZyxIyxB

Page 16: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Image Histogram

Histogram graphs the number of pixels with a particular gray level as a function of the image of gray levels.

graylevel

num

ber

of p

ixel

s

Page 17: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Segmentation Using HistogramSimple Case

Page 18: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Segmentation Using HistogramSimple Case

Otherwise0

),(0if 1),( 1

1

TyxfyxB

Otherwise0

),( if 1),( 21

2

TyxfTyxB

Otherwise0

),( if 1),( 32

3

TyxfTyxB

Page 19: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Realistic Histograms

Not realistic

Real (noise)

Page 20: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Realistic Histograms

Smooth out noise– Convolve hist. by averaging or 1D Gaussian filter

peak

peak

peak

valley

valley

valley

Page 21: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Segmentation Using HistogramReal image histograms

1. Compute the histogram of a given image.

2. Smooth the histogram by averaging peaks and valleys in the histogram.

3. Detect good peaks by applying thresholds at the valleys.

4. Segment the image into several binary images using thresholds at the valleys.

5. Apply connected component algorithm to each binary image find connected regions.

Page 22: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Good PeaksPeakiness Test

).(

1.2

)(1

PW

N

P

VVPeakiness ba

Page 23: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Segmentation Using Histograms

Select the valleys as thresholds– Apply threshold to histogram– Label the pixels within the range of a threshold

with same label, i.e., a, b, c … or 1, 2, 3 …

Page 24: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Connected Components

Disjoint segments with same labels need to be split

01010

01100

00000

11011

01000

000

000

00000

0

0000

cd

cc

aabb

a

may be added to segment c

Page 25: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Recursive Connected Component Algorithm

Page 26: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Sequential Connected Component Algorithm

Page 27: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Sequential Connected Component Algorithm

01110

01100

00000

11011

01000

00

000

00000

0

0000

ccd

cc

aabb

a

d=c

Equivalence class

Page 28: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

ExampleDetecting Finger Tips (marked white)

Page 29: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

ExampleSegmenting a bottle image

93 peaks

Page 30: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

ExampleSegmenting a bottle image

Smoothed histogram (averaging using mask Of size 5)54 peaks (once)After peakiness 18

Smoothed histogram21 peaks (twice)After peakiness 7

Smoothed histogram11 peaks (three times)After peakiness 4

Page 31: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

ExampleSegmenting a bottle image

(0,40) (40, 116) (116,243) (243,255)

Page 32: CAP 5415 Computer Vision Fall 2004

Alper Yilmaz, Fall 2004 UCF

Suggested Reading

Chapter 3, Mubarak Shah, “Fundamentals of Computer Vision”