I'm trying to build a machine learning classifier that can detect which object is in an image. I have a labled training set of images and am currently in the image processing phase. Each of these images has one of the objects. However, almost all images have these objects embedded in a very common background color amongst all images.
These are not the images i'm training on but they give the general idea:
The background red is more or less uninformative of what object is in the picture. In order to reduce the dimensionality of my problem, I'd really like to apply an algorithm that somehow extracts the object from the common background. My idea after that was then to resize the resulting images all to some common dimension. Then i was going to try to do some deep learning. Does anyone know any algorithms in computer processing that can do this?
Asked By : mt88
Answered By : D.W.
Try using clustering on the histogram of pixel color values. I would suggest using $K$-means using $K=2$ as a starting point, but you could use any clustering algorithm.
You might want to convert to HSV color space, build a histogram of the hues, and apply clustering on those values. You could also try other color space models, like CIELAB, but HSV is probably good enough for your purposes. Working in HSV space tends to yield techniques that are more robust to variation in lighting/illumination.
In your examples, the majority class (the cluster containing the majority of pixel values) is the background. You could use heuristics, such as that the cluster that contains the majority of pixels along the boundary of the image is more likely to be the background.
The watershed algorithm or other methods of image segmentation could be an alternative approach that might work well.
If your images are as clean as shown in the example, almost anything should work well.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/49542
0 comments:
Post a Comment
Let us know your responses and feedback