Adapt my circlular hough transform code for unknown radius
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!