regarding the error in quiver

2 views (last 30 days)
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
Walter Roberson
Walter Roberson on 6 Jan 2014
What error message are you encountering?
Ranjani Rathinavel
Ranjani Rathinavel on 6 Jan 2014
Warning: Contour not rendered for constant ZData > In contour>parseargs at 189 In contour at 64 In gradient at 26 ??? Error using ==> quiver at 47 The size of X must match the size of U or the number of columns of U.
Error in ==> gradient at 28 quiver(m,n,delx,dely);
this is the error which i get

Sign in to comment.

Accepted Answer

Walter Roberson
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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!