Image Classification: Color Histogram & KNN classifer
Mostra commenti meno recenti
Hello,
I want to classify an image through the use of color histograms and knn classifer. I have a dataset of 100 images for each class (butterfly, dog, cat) in a folder. My understanding of the problem is as follows:
1) read in images to create a color histogram for each (RGB)
2) find the kmeans for RGB for each image
3) cluster the kmeans points separately for each class and find its centroid (so for the butterfly class, each image gives me kmeans value for R, G, B. I plot all the R kmeans values and find the centroid, same with G and B.)
4) Read in test image, create a color histogram, find the kmeans value for RGB, then use the Euclidean distance for each kmeans to find the nearest cluster for R,G,B.
Is this how it is supposed to be done or am I not understanding this correctly?
Risposta accettata
Più risposte (1)
Image Analyst
il 5 Mag 2015
0 voti
There is no way that will correctly classify the animals UNLESS all your cats are the "same" color, all the dogs are the "same" color, and all the butterflies are the same color, and there is little other clutter in the background. If you assumed all your cats were black, and all your butterflies were orange and black monarchs, and you presented an orange/ginger tabby cat, your algorithm might say the cat was a butterfly.
1 Commento
Dennis Tran
il 5 Mag 2015
Modificato: Dennis Tran
il 5 Mag 2015
Categorie
Scopri di più su Nearest Neighbors in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!