My question is regarding classifying the images based on the whichever color is present more in the given image after converting the color image into gray and finding its histogram.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
snehal jaipurkar
le 3 Déc 2016
Modifié(e) : snehal jaipurkar
le 7 Déc 2016
clc;
Image = imread('rose.jpg');
figure
imshow(Image);
I=rgb2gray(Image);
figure
imshow(I)
[count,x] = imhist(I)
index1 = find(x == 67);
index2 = find(x == 100);
numPixels = sum(count(index1:index2))
This code worked well up to finding the sum of number of pixels from one intensity range to other.
Now I am having few images. Some of them have red pixels in large amounts,some have white, some have blue, etc. I have to classify these images as blue, white, red, etc. after finding histogram and counting pixels in certain range. How can I do that?
Or is there any other way to do this classification?
0 commentaires
Réponse acceptée
Image Analyst
le 3 Déc 2016
You just need to set up some rules, like if the mean red count from the histogram is more than the mean blue and green counts. See my File Exchange for color demos. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
9 commentaires
Image Analyst
le 7 Déc 2016
Did you see where I said " it was released way back in 2012 but maybe you have an ancient version of MATLAB." Well, 2010 is 2 years before atan2d was released. You'll have to see how you can build it yourself with atan() or atand(). Search the Mathworks web site for the description of atan2d().
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!