Você está na página 1de 18

Roadmap

Introduction to circle and line detection

Circle/ellipse detection

Least-Square fitting based detector

Line detection

How do we define circles or lines?


Model-based vs. learning-based (data-driven)
For circles and lines, mathematical models exist

Hough transform-based detector

MATLAB demos
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2011

Beyond Edge Detection

Edges are among the earliest primitives that


have been studied in computer vision, but
their definition remains fuzzy
There are many other primitives that can be
more rigorously defined or at least
conceptually easier to define

Corner, line, circle, ellipse, square, triangle,

The ultimate vision tasks involve the


detection of general objects

Face, pedestrian, vehicle, mouth, eyes, door


EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003

Two Paradigms

Model-based approaches

Build an explicit model to characterize the objects we want


to detect
Suitable for the class of simple objects for which good
models are relatively easy to find
Examples: corner/line/circle detection

Data-driven (machine learning) approaches

Provide a training set (e.g., manually detected results) and


detector works like a black box
Suitable for the class of complex objects for which good
models are NOT easy to find
Examples: neural network, support vector machine

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

Roadmap

Introduction to object detection

Circle/ellipse detection

Hough transform-based detector

Corner detection

Least-Square fitting based detector

Line detection

What kind of object do we want to detect?

Harris corner detector

Face/pedestrian/vehicle detection*
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003

Edge Detection in Iris Image

>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

MATLAB function: P = POLYFIT(X,Y,N)


Polynomial of degree N
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003

Analytical vs. Numerical Solutions


f ( x) x 2 3 x 2
Analytical
Numerical

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:

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

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

MATLAB function: circle_detect.m

MATLAB function: fitellipse.m

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

Image Examples

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

Roadmap

Introduction to object detection

Circle/ellipse detection

Hough transform-based detector

Corner detection

Least-Square fitting based detector

Line detection

What kind of object do we want to detect?

Harris corner detector

Face/pedestrian/vehicle detection*
EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003

10

Basic Idea Behind

Question: Can we find a transform that maps a line to a point?


EE465: Introduction to Digital Image
Processing Copyright Xin Li'2003

11

Radon/Hough Transform: Mathematics*


min

min

max

(x1y1)

Two of an infinite number


of lines through point (x1,y1)

max

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

Sample of
two lines

- Space

12

Generalizations of Hough Transform


(from 2D to N-D)
Analytic Form

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

EE6358 - Computer Vision

13

Radon/Hough Transform: Image


Examples

Conclusion: Line detection can be implemented by point (peak)


detection in the Radom/Hough transform domain

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

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

Line Detection from Real-world Images

Gray Scale Image

Edge Image (Canny)

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

16

Peak Finding

EE465: Introduction to Digital Image


Processing Copyright Xin Li'2003

17

(From Jains Fig.10.1)

Application in Computer Tomography*

Você também pode gostar