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

2 ビュー (過去 30 日間)
How to plot grey level variation along horizontal cross-section of any image according to position of the mouse?

採用された回答

Dishant Arora
Dishant Arora 2014 年 12 月 5 日
I = imread('cameraman.tif');
[row , column] = size(I);
imshow(I)
[x , ~] = ginput(1);
plot(1:column , I(x , :))

その他の回答 (1 件)

Image Analyst
Image Analyst 2014 年 12 月 5 日
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.

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by