phrack / ShootOFF-legacy

An open source framework to enhance laser dry fire training.
BSD 4-Clause "Original" or "Old" License
30 stars 17 forks source link

Improve shot detection to remove simple false positives. #104

Closed phrack closed 9 years ago

phrack commented 9 years ago

-When detecting the color of the shot the largest value should be at least 10% larger than all of the other color values to be a valid shot. Need to experiment with the %. Early results suggest that with RGB on a true positive if it's R or G the correct value is ~15% larger than the other two. In a false positive the selected value is often <=5% larger than the other two.

-It's often the case that false positives are surrounded by similar colors that couldn't possibly be a shot. Need to detect if the detected "shot" bleeds too far away from the origin in at least two directions, which indicates that it's actually interference and not a shot.

-Could divide the feed into regions and if no shot was detected in a given region (or if the shot was a false positive) move to the next region.

-Could try hough circle transform al a https://github.com/phrack/ShootOFF/wiki/How-Shot-Detection-Works but this may be problematic because the shot is often not a perfect circle due to imperfect trigger pulls.

phrack commented 9 years ago

Did not try hough circle. Detecting by region and RGB value differences makes a large difference. Looking for similar colors close by is a bit too strict.

phrack commented 9 years ago

Commit 5299ae45702afb5fc8de219c7981d4ba36f0a966