Image Processing Reference
In-Depth Information
%Gradient Corner Detector
%op=T tangent direction
%op=TI tangent inverse
%op=N normal direction
%op=NI normal inverse
function outputimage = GradCorner(inputimage,op)
[rows,columns]=size(inputimage); %Image size
outputimage=zeros(rows,columns); %Result image
[Mx,My]=Gradient(inputimage);
%Gradient images
[M,A]=Edges(inputimage);
%Edge Suppression
M=MaxSupr(M,A);
[Mxx,Mxy]=Gradient(Mx);
%Derivatives of the gradient image
[Myx,Myy]=Gradient(My);
%compute curvature
for x=l:columns
for y=l:rows
if(M(y,x)~=0)
My2=My(y,x)^2; Mx2=Mx(y,x)^2; MxMy=Mx(y,x)*My(y,x);
if((Mx2+My2)~=0)
if(op== Tl )
outputimage(y,x)=(1/(Mx2+My2)^1.5)*(My2*Mxx(y,x)-
MxMy*Myx(y,x)-Mx2*Myy(y,x)+MxMy*Mxy(y,x));
elseif (op== N )
outputimage(y,x)=(1/(Mx2+My2)^1.5)*(Mx2*Myx(y,x)-
MxMy*Mxx(y,x)-MxMy*Myy(y,x)+My2*Mxy(y,x));
elseif (op=='NI')
outputimage(y,x)=(1/(Mx2+My2)^1.5)*(-Mx2*Myx(y,x)
+MxMy*Mxx(y,x)-MxMy*Myy(y,x)+My2*Mxy(y,x));
else % tangential as default
outputimage(y,x)=(1/(Mx2+My2)^1.5)*(My2*Mxx(y,x)-
MxMy*Myx(y,x)+Mx2*Myy(y,x)-MxMy*Mxy(y,x));
end
end
end
end
end
Code 4.18
Curvature by measuring changes in intensity
an image is not a totally reliable way of determining curvature, and hence corner information.
This is in part due to the higher order of the differentiation process. (Also, scale has not
been included within the analysis.)
4.6.4
Autocorrelation as a measure of curvature
In the previous section, we measured curvature as the derivative of the function ϕ ( x , y )
along a particular direction. Alternatively, a measure of curvature can be obtained by
Search WWH ::




Custom Search