regarding the error in quiver
2 views (last 30 days)
Show older comments
Ranjani Rathinavel
on 6 Jan 2014
Answered: Walter Roberson
on 6 Jan 2014
i am new to matlab.. i don ve much knowledge abt it.. but i need to submit my code on 8th jan.. so can anyone help me with the following code?.. first i ll explain wat does the code want to display... as i am doin process with fingerprints i need to find the orientation of the fingerprint..... here i think the condition are working but some error is in quiver and contour.... the code which i tried is
[m,n] = size(image);
s = zeros(m,n);
% To calculate x aand y gradient component using 3*3 sobel mask
mask = fspecial('sobel');
% To compute delx
delx = filter2(mask,image);
% To compute dely
mask = transpose(mask);
dely = filter2(mask,image);
% Ridge orientation
for i=(9:17)
for j=(9:17)
A(1:17,1:17)= delx(i-8:i+8,j-8:j+8);
B(1:17,1:17)= dely(i-8:i+8,j-8:j+8);
Gxy = sum(sum(A.*B));
Gxx = sum(sum(A.*A));
Gyy = sum(sum(B.*B));
diff = Gxx-Gyy;
theta = (pi/2 + (atan2(2*Gxy,diff))/2);
end;
j=j+1;
end;
imshow(image);
contour(m,n);
hold on
quiver(m,n,delx,dely);
hold off
2 Comments
Accepted Answer
Walter Roberson
on 6 Jan 2014
You have
contour(m,n);
which is passing in the number of rows and columns of the image into the contour() routine instead of passing the image data.
Likewise you are passing the number of rows and columns in to quiver() instead of passing in the data for which the quiver plot is to be drawn.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!