Pure Ruby colored blob detection(jeffkreeftmeijer.com)
jeffkreeftmeijer.com
Pure Ruby colored blob detection
http://jeffkreeftmeijer.com/2011/pure-ruby-colored-blob-detection/
6 comments
The article started nice, but it was a bit of a disappointment to see he just picked the biggest blob and that's it. Would have loved something more relevant to detecting the shape.
The point of the article was to detect the biggest red blob, find out where it is positioned and how big it is.
Shape detection is an interesting subject too, maybe I'll write about that in the future. :)
Shape detection is an interesting subject too, maybe I'll write about that in the future. :)
for those interested in just the code, gist here https://gist.github.com/913400
I'd like to see more follow up posts on this subject. Computer vision is incredibly interesting and it would be cool to see you elaborate in future posts on more complex algorithms/approaches.
I don't really understand how ( red - green + blue ) determines the pixel's redness.
Actually, I think it's (red - (green + blue)). Equal parts red, green, blue, e.g. FFFFFF or 555555 is just gray. With this formula, that would be zero -- so no red.
With his formula, he's getting any pixel that has 100 out of 255 increments greater than the green and blue channels combined.
With his formula, he's getting any pixel that has 100 out of 255 increments greater than the green and blue channels combined.
Bassie!