Hi! I'm facing a problem of not being able to predict which cluster contains the image i require in a k-means clustering method. I've enclosed the details of the problem.

2 views (last 30 days)
I'm doing an image segmentation using k-means algorithm to extract just a particular feature from a whole image, for instance a car from the surrounding environment. I've taken three clusters for this. I need to save just the cluster that contains the car, but not able to isolate it since the clusters are generated randomly.
  3 Comments
Meera Girijan
Meera Girijan on 28 Apr 2016
Edited: Meera Girijan on 28 Apr 2016
@jgg Based on the color and its intensities in the image each component gets separated.Image detection is what i wanted, but this also gave me a desired output. In the image attached below you can see the car separated from the surroundings in cluster 1.
Meera Girijan
Meera Girijan on 28 Apr 2016
@jgg if you could suggest some other efficient method for image detection it would be helpful too. I need to model this separated image.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 28 Apr 2016
You cannot use k-means clustering alone to detect the presence or absence of something. k-means clustering is going to find the given number of clusters without having any interpretation of what the clusters mean. If you feed it an image of a banana instead of an image of a car, it is going to find 3 clusters in the image of the banana.
You should therefore be extracting feature descriptions from portions of the image and run clustering on the feature descriptions -- possibly only on two clusters ("matches" and "does not match") You can then given an interpretation to the clustering based upon knowing what the features imply.
  4 Comments
Meera Girijan
Meera Girijan on 30 Apr 2016
Edited: Meera Girijan on 30 Apr 2016
@image analyst Hi!Just wanted to get some more information. Part of my project requires capturing a 2D real time image and extracting a car alone from it without any of the background details. I read up on CBIR and found a lot about image detection. I tried using SURF implementation also. I was getting the interested points, but retrieving the image back seems to be a challenge.The input image for our project will be dynamic and will keep changing every time so I am not able to fix a contour line even if I try to calculate the interested points based on that. I have attached the output i get from kmeans clustering based on colour. The only short coming is that this works only when there's a clear distinguishing color combination . car6 is the actual image and car6sample1 is the output. that is how i want the output to be even when there is no distinct color difference.Could you help me out with this?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!