Image Processing Reference
In-Depth Information
if(m>-1 & m<1)
for x0=1:columns
y0=round(ym+m*(x0-xm));
if(y0>0 & y0<rows)
acc(y0,x0)=acc(y0,x0)+1;
end
end
else
for y0=1:rows
x0=round(xm+(y0-ym)/m).
if(x0>0 & x0<columns)
acc(y0,x0)=acc(y0,x0)+1
end
end
end %if abs
end %if M
end
x2=x2=incx;y2=y2+incy;
if x2>x1+I
x2=x1+i;
incx=0; incy=1;
y2=y2+incy;
end
if y2>y1+i
y2=y1+i;
incx=-1; incy=0;
x2=x2+incx;
end
if x2<x1-i
x2=x1-i;
incx=0 incy=-1;
y2=y2+incy;
end
end %for k
end %for I
end %if(x1,y1)
end %y1
end %x1
Code 5.9
Implementation of the parameter space reduction for the Hough transform for ellipses
Figure 5.20 shows the accumulators obtained by the implementation of Code 5.9 for the
images in Figure 5.14 (a) and Figure 5.14 (b). The peak represents the location of the
ellipses. In general, there is noise and the accumulator is wide. This is for two main
reasons. First, when the gradient direction is not accurate, then the line of votes does not
pass exactly over the centre of the ellipse. This forces the peak to become wider with less
height. Second, in order to avoid numerical instabilities we need to select points that are
Search WWH ::




Custom Search