Scan image row-wise and store index of minimum grey values.

조회 수: 6 (최근 30일)
SATISH SONWANE
SATISH SONWANE 2022년 11월 14일
댓글: SATISH SONWANE 2022년 11월 14일
Hi, I want to scan an image row-wise and store the index value of the concerned pixels (Ones with lowest grey values) in a matrix (note:There can be more than one pixel with such values). Currently I can scan a row at a time and it returns index of the first pixel which has lowest intensity value. Image size is 478 by 680. AND I am getting wrong index values.
I = imread('5.bmp');
I = im2gray(I);
imshow (I);
i=1:1:478;
[min_intensity,idx]= min(I(i,:));
idx = idx;

채택된 답변

Matt J
Matt J 2022년 11월 14일
편집: Matt J 2022년 11월 14일
I = imread('5.bmp');
I = im2gray(I);
min_intensity= min(I,[],2);
[row,col]=find(I==min_intensity); %indices of minimum

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by