The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
amira ali

Posts: 160
Registered: 5/15/11
Re: plot gradient vectors over image
Posted: Aug 15, 2013 1:55 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Josh Meyer" <> wrote in message <kuikuh$2f7$>...
> >"amira ali" <> wrote in message
> >news:kui9c3$7p6$
> > please
> > 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

> I assume you mean "gradient" and not "gradient2"
> 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)."
> More info here:

is this code is correct
I = imread('img1.jpeg');
[gx,gy] = gradient(double(rgb2gray(I)));
g = abs(gx) + abs(gy);
hold on;

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.