pixel position and its value

2 ビュー (過去 30 日間)
KaMu
KaMu 2013 年 12 月 10 日
コメント済み: KaMu 2013 年 12 月 11 日
I have a grayscale image,with four double values 0.25, 0.75 1 and 0.
I need to plot the X-axis co-ordination for each pixel and its intensity (0.25, 0.75, 1 but not 0) . How can Access the X and Y pixel position on the image? is there a straight forward method other than using for loops?

採用された回答

Image Analyst
Image Analyst 2013 年 12 月 10 日
I don't know what "X-axis co-ordination" is. Can you explain. What do you want to do? It's not clear. Do you want to plot an intensity profile between one point and another? If so use improfile().
theProfile = improfile([x1, x2], [y1, y2]); % Careful - x is column, not row.
Do you want to find all rows where the intensity is more than 0.75? If so:
[rows, columns] = find(grayImage>0.75);
though this is rarely useful or necessary and it's almost always better to just use the binary image
binaryImage = grayImage?0.75;
  1 件のコメント
KaMu
KaMu 2013 年 12 月 11 日
Yes, I need to plot an intensity profile on a horizontal line Thanks Image Analyst. improfile is what I need!

サインインしてコメントする。

その他の回答 (1 件)

sixwwwwww
sixwwwwww 2013 年 12 月 10 日
編集済み: sixwwwwww 2013 年 12 月 10 日
try this:
[Y, X] = ind2sub(size(b), find(ismember(b, 1)))
here b is your image matrix. It gives you X and Y positions for value 1. you can extend it to other values according to ur need

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by