How to find the exact index(row, col) of a maximum value in a matrix?

I want to find the maximum value in an image, I tried to find its index and I found it after converting the image matrix into a vector. How can I find this value in a matrix? and then plot it over an image?

 採用された回答

KSSV
KSSV 2020 年 8 月 1 日

0 投票

Let I be your image.
[m,n,p] = size(I) ;
x = 1:n ;
y = 1:m ;
[X,Y] = meshgrid(x,y) ;
[val,idx] = max(I(:)) ;
imshow(I)
hold on
plot(X(idx),Y(idx),'*r')

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

タグ

質問済み:

2020 年 8 月 1 日

回答済み:

2020 年 8 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by