Escolar Documentos
Profissional Documentos
Cultura Documentos
Circle/ellipse detection
Line detection
MATLAB demos
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2011
Two Paradigms
Model-based approaches
Roadmap
Circle/ellipse detection
Corner detection
Line detection
Face/pedestrian/vehicle detection*
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003
>I=imread(iris.bmp);
>c=edge(I,canny);
>[x,y]=find(c==1);
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003
Line/Polynomial Fitting
y
x
y=ax+b
y=ax2+bx+c
Two roots:
x1 1, x2 2
2
x
2
f ( x) x 2 3 x 2 0 x
g ( x)
3
x 2
xi 1 i
3
2
successive substitution:
Circle/Ellipse Fitting
b
(xo,yo)
(xo,yo)
Min E=(x-xo)2+(y-y0)2-r2
Min E=(x-xo)2/a2+(y-y0)2/b2-1
Image Examples
Roadmap
Circle/ellipse detection
Corner detection
Line detection
Face/pedestrian/vehicle detection*
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003
10
11
min
max
(x1y1)
max
Sample of
two lines
- Space
12
Parameters Equation
Line
xcos+ysin=
Circle
x0 , y 0 ,
(x-xo)2+(y-y0)2=r2
Parabola
x0, y0, ,
(y-y0)2=4(x-xo)
Ellipse
x0, y0, a, b,
(x-xo)2/a2+(y-y0)2/b2=1
13
14
MATLAB Functions
>> [H,theta,rho]=hough(f);
>> figure, imshow(theta,rho,H, [ ], 'notruesize')
>> axis on, axis normal;
>> xlabel('\theta'),ylabel('\rho'),
>> colorbar
>> colormap(jet)
>> [H,theta,rho]=hough(f);
>> figure, imshow(theta,rho,H, [ ], 'notruesize')
>> axis on, axis normal;
>> xlabel('\theta'),ylabel('\rho'),
>> colorbar
>> colormap(jet)
>>[r,c]=houghpeaks(H,5);
>> hold on
>> plot(theta(c), rho(r), 'linestyle', 'none','marker' , ...
's', 'color', 'w')
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003
15
16
Peak Finding
17