Adapt my circlular hough transform code for unknown radius

1 Ansicht (letzte 30 Tage)
Lanceric Tse
Lanceric Tse am 27 Jul. 2018
Hi I am currently working on a project for iris recognition. I need to use hough transform to find the outer boundry of an iris. I have a working set of code to find circles with a known radius but I don't know how I can adapt it for unknown radii
function HTC (edge, r) %edge being the input image
[rows, columns]=size(edge);
acc=zeros(rows, columns);
for x=1:rows
for y=1:columns
if(edge(x,y)==1)
for ang=0:360
t=(ang*pi)/180;
x0=round(x-r*cos(t));
y0=round(y-r*sin(t));
if(x0<rows & x0>0 & y0<columns & y0>0)
acc(x0,y0) =acc(x0,y0)+1;
end
end
end
end
end
imtool(acc,[])

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by