Upload
amma
View
57
Download
0
Embed Size (px)
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
Citation preview
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
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)
Alper Yilmaz, Fall 2004 UCF
Marr-Hildreth Edge Detector
Image 2g(x)Find
zero-crossings
gI 2 computeslope
Threshold
Alper Yilmaz, Fall 2004 UCF
Canny Edge Detector
Image
gx(x,y) Gradientmagnitude
gy(x,y) Gradientdirection
Non-maximumsuppression
Hysteresis thresholding
Alper Yilmaz, Fall 2004 UCF
Region Segmentation
Marr Hildreth Edge DetectorCanny Edge Detector
Alper Yilmaz, Fall 2004 UCF
Applications of Segmentation
Object recognition MPEG-4 video compression
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
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
Alper Yilmaz, Fall 2004 UCF
Clustering
Alper Yilmaz, Fall 2004 UCF
Segmentation-Clustering
R3
R1 R2
R5
R4
R6
Alper Yilmaz, Fall 2004 UCF
Region Segmentation
Alper Yilmaz, Fall 2004 UCF
Layer Representation
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 ,
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.
Alper Yilmaz, Fall 2004 UCF
Simple Segmentation
Otherwise
if
0
),(1),(
TyxIyxB
Otherwise
if
0
),(1),( 21 TyxIT
yxB
Otherwise
if
0
),(1),(
ZyxIyxB
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
Alper Yilmaz, Fall 2004 UCF
Segmentation Using HistogramSimple Case
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
Alper Yilmaz, Fall 2004 UCF
Realistic Histograms
Not realistic
Real (noise)
Alper Yilmaz, Fall 2004 UCF
Realistic Histograms
Smooth out noise– Convolve hist. by averaging or 1D Gaussian filter
peak
peak
peak
valley
valley
valley
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.
Alper Yilmaz, Fall 2004 UCF
Good PeaksPeakiness Test
).(
1.2
)(1
PW
N
P
VVPeakiness ba
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 …
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
Alper Yilmaz, Fall 2004 UCF
Recursive Connected Component Algorithm
Alper Yilmaz, Fall 2004 UCF
Sequential Connected Component Algorithm
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
Alper Yilmaz, Fall 2004 UCF
ExampleDetecting Finger Tips (marked white)
Alper Yilmaz, Fall 2004 UCF
ExampleSegmenting a bottle image
93 peaks
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
Alper Yilmaz, Fall 2004 UCF
ExampleSegmenting a bottle image
(0,40) (40, 116) (116,243) (243,255)
Alper Yilmaz, Fall 2004 UCF
Suggested Reading
Chapter 3, Mubarak Shah, “Fundamentals of Computer Vision”