How to find the exact index(row, col) of a maximum value in a matrix?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
KSSV
2020년 8월 1일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!