Random header image... Refresh for more!

Bomb Detection

I finally made some headway into detecting the bombs.

It missed one, though…

As I noted, you call cvMatchTemplate to find likely matches within a larger image, then you call cvMinMaxLoc to get the location of the best match.  But only the best match.  What about the other matches?  How do you find them?

Well, the method I used to get the points above is a fairly simple, but fairly dumb way of doing it.  You get the first point from cvMinMaxLoc, then you blot it out  with a filled circle and repeat.  Your initial point, and points around it are now no longer considered matches, so you get the second best match, and so on.  Trouble is, it’s a bit slow.  You’re constantly rescanning the entire image for the best match.  My friend Susan had a suggestion, where you scan strips of the image instead.  Because you know that there can only be one bomb for any given row, you can partition the screen into strips roughly the height of a bomb and know that there’s only one point in each strip that you’ll care about.  I’m going to try that one out and see how it does.

By the way, there are so many false circles in the image above because I’m not throwing away matches below a certain threshold.  Obviously, I’ll have to do that if I want anything useful.  It looks like .2 might be a good cutoff.

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment