Adapt my circlular hough transform code for unknown radius

1 回表示 (過去 30 日間)
Lanceric Tse
Lanceric Tse 2018 年 7 月 27 日
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,[])

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by