listing and counting all colors in an image
1 次查看(过去 30 天)
显示 更早的评论
Hello all:
I am a matlab user, but no great experience with image analysis. Could anyone be kind to shed light on my current problem:
I have small icon sized images, on which I want to run a simple code to list and count pixels of all the colors present.
Ideal output will be a n-by-2 array, the first column can be the color code, and the second could be the number of pixels with that color, as found in the image. Sum of column two thereby be the total pixels in the image.
Apologies for sounding like I am dumping my problem on the forum. Any initiaition (or full code, smile) will be much appreciated.
Thanks in deed and regards.
0 个评论
回答(1 个)
Image Analyst
2016-6-17
See attached code.
2 个评论
Image Analyst
2016-6-26
Not really sure. Maybe check the CBIR literature on how they compare colors. A guess would be to make the histograms with not too many bins, like 16 or so. Then compare the percentage in each bin for the different images. Of course it will take more than 1 number to accurately describe how the colors differ in the two images.
You haven't said what you want to do though, and that lack of context makes it hard to guess. All you've done is to ask how to do some small steps in your algorithm but I don't know what the overall goal is, and if the small steps you have asked for are indeed the best approach to achieve the overall goal.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!