How to get mode values of RGB to represent one image

3 次查看(过去 30 天)
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 :)

采纳的回答

Image Analyst
Image Analyst 2021-2-27
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by