How to get mode values of RGB to represent one image
2 次查看(过去 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 :)
1 个评论
DGM
2022-11-6
For people trying to actually find the most common or dominant color, see this thread:
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!