I am extracting local orientation field of a grayscale fingerprint image using Rao's algorithm. I need urgent help to the correction of this error message that appears each time I run the code.
The error message is:
Index exceeds matrix dimensions.
Error in fp_local_orientation (line 21)
m.i.j=image(ii+3), jj+3)); % create sub image (such regions) of size...
function img_orient = fp_local_orientation(image)% image is passed to this function as argument
image(:,209:210)=255;
rows_image=size(image,1);
cols_image=size(image,2);
a=[];for i =1:4:rows_image % step in 5 down the image rows
b=[];for j=1:4:cols_image % step in 32 over the image columns
m.i.j=image(i:(i+3), j:(j+3));% create sub images (sub regions) of size...
Gx= edge(m.i.j,'sobel',0.1112,'horizontal');
Gy = edge(m.i.j,'sobel',0.0677,'vertical');
angleT =0.5*atan((2*Gx.*Gy)./((Gx.^2)-(Gy.^2)));
angleT = angleT + pi/2;
b=[b angleT];
end
a=[a; b];
end
img_orient=a;
I had never seen such a ternary operation with the matrix operator "." especially getting the result of another operation, as well did not see any mention to a previous charge of value in the variable "m" at the code above.