How to find the exact index(row, col) of a maximum value in a matrix?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhamed Sewidan
am 1 Aug. 2020
Beantwortet: KSSV
am 1 Aug. 2020
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?
0 Kommentare
Akzeptierte Antwort
KSSV
am 1 Aug. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!