Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: plot gradient vectors over image
Replies: 3   Last Post: Aug 16, 2013 9:48 AM

 Messages: [ Previous | Next ]
 amira ali Posts: 160 Registered: 5/15/11
Re: plot gradient vectors over image
Posted: Aug 15, 2013 1:55 PM

"Josh Meyer" <jmeyer@mathworks.com> wrote in message <kuikuh\$2f7\$1@newscl01ah.mathworks.com>...
> >"amira ali" <amiraali2005@gmail.com> wrote in message
> >news:kui9c3\$7p6\$1@newscl01ah.mathworks.com...
> > how can i plot gradient vectors over image using this function
> >
> > [Gx,Gy] = gradient2( I )
> > % Gx - [hxwxk] x-gradient (horizontal)
> > % Gy - [hxwxk] y-gradient (vertical)
> >
> > thanks

>
>
> At any rate, it sounds like you want the quiver function:
> "quiver(x,y,u,v) plots velocity vectors as arrows with components (u,v) at
> the points (x,y)."
>
>

is this code is correct
g = abs(gx) + abs(gy);
figure;
imshow(g,'InitialMagnification','fit')
hold on;
quiver(abs(gx),abs(gy));

Date Subject Author
8/15/13 amira ali
8/15/13 Josh Meyer
8/15/13 amira ali
8/16/13 Josh Meyer