















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A recap of a lecture by dr. Alper yilmaz at the university of central florida (ucf) in fall 2005. The lecture covered various image processing techniques, including histogram segmentation, region properties, and pyramid representation. Matlab code snippets for histogram segmentation and plots of derivative, histogram, and peakiness. It also includes a summary of the concepts covered in the lecture.
Typology: Study notes
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















Alper Yilmaz, Fall 2005 UCF
www.cs.ucf.edu/courses/cap5415/fall Office: CSB 250
Alper Yilmaz, Fall 2005 UCF
%smooth for i=1: hst=conv2(hst,gauss,'same'); end %compute derivative dr1=conv2(hst,dr,'same'); %find peaks and valleys pw =dr1(1:254).*dr1(2:255); peaks_valleys(find(pw<0))=1; control=find(peaks_valleys==1); for i=1:size(control,2) if (dr1(control(i)-2)>0) valleys(control(i))=1; end if (dr1(control(i)-2)<0) peaks(control(i))=1; end end peaklocs=find(peaks==1); valleylocs=find(valleys==1);
current_valley=1; for i=1:size(peaklocs,2) Va = hst(valleylocs(current_valley)); Vb = hst(valleylocs(current_valley+1)); P = hst(peaklocs(i)); Wvalleylocs(current_valley); = valleylocs(current_valley+1)- N = 0 ; forj=valleylocs(current_valley):valleylocs (current_valley+1) N = N + hst(j); end val1 = 1-((Va+Vb)/(2P)); val2 = 1-(N/(WP)); if (val1>0 && val1>0) peakiness(peaklocs(i)) = val1*val2; end; current_valley = current_valley +1; end
Alper Yilmaz, Fall 2005 UCF
Derivative
Histogram
Peaks
Valleys
Peakiness
-500 0 50 100 150 200 250 300
0
500
(^00 50 100 150 200 250 )
1000
2000
(^00 50 100 150 200 250 )
1
(^00 50 100 150 200 250 )
1
(^00 50 100 150 200 250 )
Alper Yilmaz, Fall 2005 UCF
Recap
Region Properties
∑∑ = =
=
m x
n y
A Bxy 0 0
(, )
A
yBx y y A
xBxy x
m x
n y
m x
n
= ∑∑=^0 y =^0 =^ ∑∑=^0 =^0
(,) (,)
A
C^ Perimeter 4 π
Alper Yilmaz, Fall 2005 UCF
Recap
Region Orientation
(x,y)
y 0
r
s θ
x 1
y 1
x 0
θ
θ
0 1
0 1
( ) ( ρ θ) θ
ρ θ θ
0
0
Alper Yilmaz, Fall 2005 UCF
Recap
Region Orientation
(x,y)
y 0
r
x x 0
y
2 0
2 0 r^2 =( x − x ) +( y − y )
( ) ( ρ θ) θ
ρ θ θ
0
0
( ) ( ) 2 2 2 r = x +ρ sinθ− s cosθ + y −ρcosθ− s sin θ
r^2 = x^2 + y^2 +ρ 2 + s^2 − 2 s ( x cosθ+ y sinθ) + 2 ρ( x sinθ− y cosθ)
Substitute x 0 and y (^0)
Alper Yilmaz, Fall 2005 UCF
Recap
Region Orientation
r^2 2 s 2 ( x cosθ y sinθ) s
= − + ∂
∂
s = x cos θ + y sinθ
Substitute s back to r
r^2 = x^2 + y^2 +ρ 2 + s^2 − 2 s ( x cosθ+ y sinθ) + 2 ρ( x sinθ− y cosθ)
Alper Yilmaz, Fall 2005 UCF
Recap
Region Orientation
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (^2) ( )^2
2 2 2
2 2 2 2 2 2
2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2
sin cos
sin cos 2 sin cos
sin cos 2 sin cos 2 sin cos
1 cos 1 sin 2 sin cos 2 sin cos
cos 2 sin cos sin 2 sin cos
cos sin 2 sin cos
r x y
r x y x y
r x y xy x y
r x y xy x y
r x y x xy y x y
r x y x y x y
r^2 = x^2 + y^2 +ρ 2 + s^2 − 2 s ( x cosθ+ y sinθ) + 2 ρ( x sinθ− y cosθ)
Alper Yilmaz, Fall 2005 UCF
E 1 (^) = a sin 2 θ − b sinθcosθ+ c cos^2 θ
θ sin 2 θ
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
gray level x
gray level x
gray level x
y
gray level x
y
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
z Search for correspondence
z Edge tracking
z Control of detail and computational cost in matching
Alper Yilmaz, Fall 2005 UCF
() ˆ( ) ( 2 )
2
2
g i wmg 1 i m m
l =^ ∑ l + =−
ˆ( 0 ) ( 4 ) ˆ( 1 ) ( 4 1 ) ˆ( 2 ) ( 4 2 )
( 2 ) ˆ( 2 ) ( 4 2 ) ˆ( 1 ) ˆ( 4 1 )
1 1 1
1 1
= − − + − − +
− − −
− −
l l l
l l l
w g w g w g
g w g w g w
ˆ( 0 ) ( 4 ) ˆ( 1 ) ( 5 ) ˆ( 2 ) ( 6 )
( 2 ) ˆ( 2 ) ( 2 ) ˆ( 1 ) ˆ( 3 )
1 1 1
1 1
− − −
− −
= − + − +
l l l
l l l
w g w g w g
g w g w g w
g 0 IMAGE
gl = REDUCE [ gl − 1 ]
Alper Yilmaz, Fall 2005 UCF
[ w ( (^) − 2 ) , (^) w (− 1 ), (^) w ( ) 0 , (^) w ( ) 1 , (^) w ( ) 2 ]
w ( ) i = w (− i ) ⇒[ c , b , a , b , c ]
a + 2 b + 2 c = 1
Alper Yilmaz, Fall 2005 UCF
Reduce 1D
Convolution Kernel w
z All nodes at a given level must contribute the same total weight to the nodes at the next higher level
a + 2 c = 2 b
b (^) b
c c
a
Alper Yilmaz, Fall 2005 UCF
c b a b c
Gaussian
Alper Yilmaz, Fall 2005 UCF
I ( x , y ) = I ( x , y ) * G ( x , y )
)
I ( x , y ) = I ( x , y ) * G ( ) x * G ( y )
)
G ( ) x G ( y ) transpose
=
Alper Yilmaz, Fall 2005 UCF
z Apply 1D mask to alternate pixels along each row of image.
z Apply 1D mask to alternate pixels along each column of resulting image from previous step.
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
m
ln ln
) 2
3 2 ) ˆ( 2 ) ( 2
3 1 ) ˆ( 1 ) ( 2
3 ˆ( 0 ) (
) 2
3 1 ) ˆ( 1 ) ( 2
3 2 ( 3 ) ˆ( 2 ) (
, 1 , 1 , 1
, , 1 , 1
−
− = −
− − −
− −
ln ln l n
ln ln ln
w g w g w g
g w g w g
gl , n ( 3 )= w ˆ(− 1 ) gl , n − 1 ( 1 )+ w ˆ( 1 ) gl , n − 1 ( 2 )
Alper Yilmaz, Fall 2005 UCF
Alper Yilmaz, Fall 2005 UCF
g (^) k , gk − 1 , gk − 2 ,K g 2 , g 1
( )
( )
( )
1 1
2 2 3
1 1 2
1
L g
L g EXPANDg
L g EXPANDg
L g EXPANDg
k k k
k k k
k k k
=
= −
= −
= −
− − −
− − −
−
M
Alper Yilmaz, Fall 2005 UCF