MATLAB Answers

msahar
0

How to plot grey level variation along horizontal cross-section of any image according to position of the mouse?

Asked by msahar
on 5 Dec 2014
Latest activity Answered by Image Analyst
on 5 Dec 2014
How to plot grey level variation along horizontal cross-section of any image according to position of the mouse?

  0 Comments

Sign in to comment.

2 Answers

Answer by Dishant Arora on 5 Dec 2014
 Accepted Answer

I = imread('cameraman.tif');
[row , column] = size(I);
imshow(I)
[x , ~] = ginput(1);
plot(1:column , I(x , :))

Answer by Image Analyst
on 5 Dec 2014

There is a function specifically built for that. It's called improfile(). It can handle profiles at any angle, though if you know that you want exactly a perfect row or column, the code Dishant gave is the way to go.

  0 Comments

Sign in to comment.