[rows, cols] = size(orient);len = 0.8*spacing;s_orient = orient(spacing:spacing:rows-spacing, spacing:spacing:cols-spacing);xoff = len/2*cos(s_orient);yoff = len/2*sin(s_orient); [x,y] = meshgrid(spacing:spacing:cols-spacing, ...spacing:spacing:rows-spacing);x = x-xoff;y = y-yoff;u = xoff*2;v = yoff*2;figure, imshow(I), hold on; quiver(x,y,u,v,0,'.','linewidth',1,'color','r'); hold off;
i want to plot the quiver only in non-zero positions of "orient"…
Best Answer