Effacer les filtres
Effacer les filtres

I'm new to MATLAB and I want to consider a 4x4 pixel block with it's intensities from a whole picture which is a grey scale image. How do I do it?

2 vues (au cours des 30 derniers jours)
a = imread('Spiderman.png');
y = rgb2gray(a);
for i = 186:1:189
for j = 165:1:168
pixel_values = y(i,j);
end
end
I wrote this code. I think I made a mistake because it's not working. I hope you can help me with it. Thank you.

Réponse acceptée

David Hill
David Hill le 26 Juil 2022
a = imread('Spiderman.png');
y = rgb2gray(a);
pixel_values=y(186:189,165:168);
  1 commentaire
Vaibav Reddy
Vaibav Reddy le 26 Juil 2022
Thanks a lot Mr.Hill. And I used the 'disp' command to display the intensity values on my command window.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by