dbolkensteyn / BeatTheBotChallenge

Come challenge the bot playing a moto racing phone game, see how it is made, and help to improve it!
3 stars 2 forks source link

Detect the road and obstacles using the "Magic Wand" #14

Open dbolkensteyn opened 9 years ago

dbolkensteyn commented 9 years ago

The Magic Wand tool allows in many paint applications to select areas based on color similarity, rather than based on shape. A few manual tests on database images using Paint.NET show some promising results: It is possible to select the road while excluding obstacle vehicles in just a few operations.

OpenCV provides the "Magic Wand" feature with its floodFill() function: http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#floodfill

The flood filling could be started from random points around the area the moto was detected (where we expect to find road - but we could also hit another vehicle).

Another approach would be to go blob detection, but OpenCV seems to only provide a way to detect circularly-shaped blobs out of the box.