Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
SATISH SONWANE
SATISH SONWANE le 14 Nov 2022
Commenté : SATISH SONWANE le 14 Nov 2022
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;

Réponse acceptée

Matt J
Matt J le 14 Nov 2022
Modifié(e) : Matt J le 14 Nov 2022
I = imread('5.bmp');
I = im2gray(I);
min_intensity= min(I,[],2);
[row,col]=find(I==min_intensity); %indices of minimum
  1 commentaire
SATISH SONWANE
SATISH SONWANE le 14 Nov 2022
Thank you @Matt J. Solutions are often simpler than they seem.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by