Splatt! - a DIY target shooter training system

A place to discuss non-discipline specific items, such as mental training, ammo needs, and issues regarding ISSF, USAS, and NRA

If you wish to make a donation to this forum's operation , it would be greatly appreciated.
https://www.paypal.com/paypalme/targettalk?yours=true

Moderators: pilkguns, m1963, David Levene, Spencer, Richard H

Post Reply
iainfm
Posts: 7
Joined: Fri Jul 12, 2024 2:50 pm
Location: Dumbarton, Scotland
Contact:

Splatt! - a DIY target shooter training system

Post by iainfm »

Hi all,

I've just joined this forum. I wanted to tell more people about the DIY target shooter training system I've been working on. I've been posting about it on the Stirton forum for about a year, and after a bit of a lull I've picked up the project again and knocked it into a semi-usable state...as a proof-of-concept anyway.

The gist of it is that it uses a cheap webcam and a light source to track where the rifle is pointing. The webcam can either be attached to the rifle looking at a fixed-position light source, or the webcam can be static with the light source (eg a laser) attached to the rifle. Ideally the webcam has a filter on it so only the light source of interest is picked up. In my prototyping I've chosen an infra-red LED as the point source, an IR-sensitive webcam (which most are) with a filter over it so only the IR light is seen by the webcam.
Splatt Prototype.jpg
A calibration routine is performed when commencing firing - this can be based on the average of a number of shots taken for dry-firing practice, or it can be manually adjusted to match where the shots land in live-firing.

Once calibration is complete the program enters training mode. The shooter's movement is scaled up to represent where shots would land at the 'real' distance, and scores awarded based on this.
composite.png
It's all extremely non-user-friendly at the moment, I'm afraid. It's written in Python, and requires various modules to be installed for it to work. Configuration is all done by a text file, and control is via the keyboard - no nice user interface...yet. Having said that, anyone with a moderate amount of computer skills should be able to get it up and running.

My next step is to start using what I've created so far to see what improvements can be made so that it can be used as-is either by the shooter or a coach. If it works well I'd like to add a better interface and make it much simpler to install.

I'd love to add a GUI and make it easily installable. It might just about be possible to get it working as a web page in any modern browser - I've just started some early investigations into this.

The project is open-source and available on Github here, where there is some additional documentation and instructions. I'm more than happy for anyone to help contribute or assist with the project - although I work in IT, I'm not a programmer by trade; I'm just an enthusiastic dabbler whose daft ideas get the better of him sometimes! But, I'm sure with a bit of work it could be a really useful and (mostly) free tool.

I am, of course, aware that commercial solutions for this exist, and I've been sorely tempted to buy one...but I can't really justify the cost. My project has been developed from scratch, and mostly for my own amusement and learning.

Best wishes,
Iain
Skellocks
Posts: 15
Joined: Sun Sep 11, 2022 7:50 pm
Location: USA & Ireland...

Re: Splatt! - a DIY target shooter training system

Post by Skellocks »

Fun stuff...That took a great deal of work, I am sure!
iainfm
Posts: 7
Joined: Fri Jul 12, 2024 2:50 pm
Location: Dumbarton, Scotland
Contact:

Re: Splatt! - a DIY target shooter training system

Post by iainfm »

Thanks, yes...but not as much as I'd expected to be honest. It's still very much a work in progress though!

After trying it semi-successfully last weekend, I've come to the conclusion that a standard webcam has too wide a field of view to be accurate enough for this purpose. So, I've bought a telephoto lens for it (the type that's sold to clip on to smart phones). I just need to attach one to the other and give it another go :)
iainfm
Posts: 7
Joined: Fri Jul 12, 2024 2:50 pm
Location: Dumbarton, Scotland
Contact:

Re: Splatt! - a DIY target shooter training system

Post by iainfm »

I've got this more-or-less working. I bodged a smartphone telephoto lens to the webcam to 'see' the IR LED better and reduce its field of vision (picture attached).

It needs securing better as it tends to move around a bit, but that's a job for another day.

Also fixed the auto-calibration and scaling, so that seems to be ok now.

Here's a video of it in use: https://youtu.be/bKiEL_oL67U

Also attached is the composite output from that session:
Attachments
PXL_20240728_131524478.jpg
composite.png-20240728-150929.png
iainfm
Posts: 7
Joined: Fri Jul 12, 2024 2:50 pm
Location: Dumbarton, Scotland
Contact:

Re: Splatt! - a DIY target shooter training system

Post by iainfm »

Added an average-shot-location indicator, along with a windage/elevation offset output thingy.
composite-20240807-212722.png
jhill1440
Posts: 2
Joined: Fri Aug 02, 2024 10:01 am

Re: Splatt! - a DIY target shooter training system

Post by jhill1440 »

Great work on this so far. I have downloaded it and trying to get it to work on a mac but thought that this would be great to have run on a raspberry pi. Making a conda environment for all the python modules was easy on the mac and would be easy on a pi but not sure how a webcam will play nicely with a pi. Logitec webcams have kernel support so I am hoping that will make it easier.

In your current set up you have the camera on the gun but would it be lighter to have the IR/LED on the gun. No wires coming off of it and really light weight. Have you tried reversing your set up? Is there any sensitivity difference?

Thanks for all the work on this. Time to play around and see what more it can do
TAMU '02
IZH-46M
iainfm
Posts: 7
Joined: Fri Jul 12, 2024 2:50 pm
Location: Dumbarton, Scotland
Contact:

Re: Splatt! - a DIY target shooter training system

Post by iainfm »

jhill1440 wrote: Wed Aug 14, 2024 12:39 pm Great work on this so far. I have downloaded it and trying to get it to work on a mac but thought that this would be great to have run on a raspberry pi. Making a conda environment for all the python modules was easy on the mac and would be easy on a pi but not sure how a webcam will play nicely with a pi. Logitec webcams have kernel support so I am hoping that will make it easier.

In your current set up you have the camera on the gun but would it be lighter to have the IR/LED on the gun. No wires coming off of it and really light weight. Have you tried reversing your set up? Is there any sensitivity difference?

Thanks for all the work on this. Time to play around and see what more it can do
Hi,

Thanks for giving it a go! I must admit I didn't have a lot of success setting up a raspberry pi to run it; I think I struggled to find (or install) one of the libraries...although I can't remember which one.

Your idea of having the LED on the rifle isn't one I'd thought of to be honest! I did thing about the possibility of using a bore sighter laser, and bought one off ebay recently, but I've not tried it yet. I think it might be a bit too bright with too large a spot though...

The code currently has a y-axis inversion setting, but not an x-axis one, which I think would be required for the LED-on-rifle configuration. I'll put in an option for that next time I'm meddling with it :)
iainfm
Posts: 7
Joined: Fri Jul 12, 2024 2:50 pm
Location: Dumbarton, Scotland
Contact:

Re: Splatt! - a DIY target shooter training system

Post by iainfm »

I have meddled!

There is now an option in the config file to select which axis to flip - captured_image_flip_mode. It requires captured_image_flip_needed to be True for it to have any effect. As per the Python OpenCV docs, a value of zero will flip around the x-axis, any positive number will flip around the y-axis and any negative value will flip around both axes.

While running, pressing 'G' (simply because it's next to 'F') will cycle through the three flip options. ('F' toggles flip on and off).

I think this should cover all mounting possibilities now!
Post Reply