How to get mode values of RGB to represent one image

3 visualizaciones (últimos 30 días)
Sippapas Mongkoldao
Sippapas Mongkoldao el 27 de Feb. de 2021
Comentada: DGM el 6 de Nov. de 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 :)

Respuesta aceptada

Image Analyst
Image Analyst el 27 de Feb. de 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.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by