While using Libor Masek Iris Recognition Code, I'm getting a particular error in segmentris.m while executing?

function [row, col, r] = findcircle(image,lradius,uradius,scaling, sigma, hithres, lowthres, vert, horz)
lradsc = round(lradius*scaling);
uradsc = round(uradius*scaling);
rd = round(uradius*scaling - lradius*scaling);
% generate the edge image
[I2, or] = canny(image, sigma, scaling, vert, horz);
I3 = adjgamma(I2, 1.9);
I4 = nonmaxsup(I3, or, 1.5);
edgeimage = hysthresh(I4, hithres, lowthres);
% perform the circular Hough transform
h = houghcircle(edgeimage, lradsc, uradsc);
maxtotal = 0;
% find the maximum in the Hough space, and hence
% the parameters of the circle
for i=1:rd
layer = h(:,:,i);
[maxlayer] = max(max(layer));
if maxlayer > maxtotal
maxtotal = maxlayer;
r = int32((lradsc+i) / scaling);
[row,col] = ( find(layer == maxlayer) );
row = int32(row(1) / scaling); % returns only first max value
col = int32(col(1) / scaling);
end
end

回答(1 个)

The rd you calculate does not necessarily come out as at least 1. When it does not, then
for i=1:rd
will not execute at all, and row and col and r will not get assigned to.
(It looks to me as if houghcircle() is from some File Exchange contribution.)
It is also possible that no circles are being detected in the input image.

类别

在 帮助中心 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by