To identify the pixels with the highest intensity (index) value in a figure.

5 ビュー (過去 30 日間)
U B
U B 2021 年 12 月 15 日
コメント済み: U B 2021 年 12 月 15 日
I want to identify the value/values which has the highest intensity value in a figure . To read an image, im using the below code.
a = imread('Fig.png');
a1 = sum(a,3);
figure, t=imagesc(a1),axis square;
Using a data tip, I can see the value of index and corresponding (X,Y). I want those pixels to be identified on that figure itself. How do I do that?

採用された回答

Image Analyst
Image Analyst 2021 年 12 月 15 日
Try this:
a = imread('Fig.png');
a1 = sum(a, 3);
imshow(a1, []);
axis('on', 'image');
impixelinfo; % Show RGB values in status line at bottom left.
% Find max value
maxValue = max(a1(:))
% Find where it occurs and put red crosshairs there in the overlay.
[rows, columns] = find(a1 == maxValue);
for k = 1 : length(rows)
hold on;
plot(columns(k), rows(k), 'r+', 'MarkerSize', 50, 'LineWidth', 2);
end
hold off;

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by