Effacer les filtres
Effacer les filtres

How to get mode values of RGB to represent one image

4 vues (au cours des 30 derniers jours)
Sippapas Mongkoldao
Sippapas Mongkoldao le 27 Fév 2021
Commenté : DGM le 6 Nov 2022
Hello
I got the sub-images and I tried to find a proper way to extract RGB from those images and I used mean value for each color ( redChannel = subImk(:,:,1); meanR = mean(redChannel(:));) and it's great for perfect image. Anyway, some images have shadow, grains or some undetermined artifacts that still remaining from segmentation step (attached image) and these effect a lot in getting mean RGB representatives.
Now, I think that getting mode (most frequent R,G,B value in sub-image) might be the better way because the images are quite constant. However, I do not know how to code it in efficient way. Can anyone please help me how to write to find a proper mode in sub-image? and if you have a better idea to get RGB, please say it.
Thanks in advance :)

Réponse acceptée

Image Analyst
Image Analyst le 27 Fév 2021
Explain exactly what "extract RGB from those images" means to you. Because to get the individual color channels (R, G, and B) from the images, you'd use imsplit():
[R, G, B] = imsplit(rgbImage);
I don't see what messing with the means and modes adds. imsplit() will extract the R, G, and B from an RGB image without worrying about (computing) means and modes.

Plus de réponses (0)

Catégories

En savoir plus sur Programming 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