How do I get pixel intensity values of images stored in an array ?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to get pixel intensity values of images stored in an array but I'm confused about how do it as i dont understand to index 3 dim variable, where testimgs is the image array.
Here is the code of the following:
adj = zeros(size(testimgs));
intensity_value = adj(698,72,i);
0 commentaires
Réponses (1)
DGM
le 8 Déc 2022
That would be correct, assuming that i is a real-valued integer between 1 and size(adj,3). The output will be the value at the 698th row, 72nd column, and ith page.
Of course, adj is currently all zero. Do you have a particular image that you're trying to inspect? Perhaps a volumetric image?
If you're trying to retrieve the full 3-color tuple for a pixel in an RGB image, you can do that all at once.
inpict = imread('peppers.png');
% what is the value at 100,100,1?
thispixel = inpict(100,100,1)
% what is the value at 100,100,3?
thispixel = inpict(100,100,3)
% or you could get the whole tuple at once
thispixel = reshape(inpict(100,100,:),1,[])
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!