Alright, let me tell you about my little basketball tracking project, I call it “basketball tot”. Sounds kinda cute, right?

So, I kicked things off wanting to get a better handle on my basketball shooting. I mean, I play a lot, but I wasn’t really tracking my progress, just kinda winging it. I thought, “Hey, why not use some tech to actually see if I’m getting better?”
First, I spent a weekend just trying to figure out what I actually wanted to track. I settled on:
- Shots taken
- Shots made
- Shooting percentage
- Location of the shot (like, inside the arc, three-pointer, etc.)
Seemed simple enough.
Then came the fun part – building something. I decided to go with Python because it’s what I’m most comfortable with. I started sketching out a basic script that would:

- Take input from me (either through the command line or a simple GUI).
- Store the data in a CSV file.
- Give me some basic stats when I asked for it.
The first version was super basic. I’m talking, enter “make” or “miss” after each shot. Ugh, clunky! But it worked. I spent a couple of weeks just using that, and it was already giving me some insights. Like, I realized I was way worse at corner threes than I thought. Ouch.
After that, I thought about how to improve data input. I looked into using my phone’s camera to automatically track shots. I messed around with OpenCV for a while, trying to detect the ball and the hoop. It was a rabbit hole, man. Way more complicated than I expected. I could detect the ball sometimes, but the lighting changes messed everything up. I put that on hold for now.
Instead, I figured out a way to use my smartwatch. I wrote a little app that lets me tap the screen to record a make or miss. Way easier than pulling out my phone every time! I even added different “locations” I could tap on the screen to track where the shot was taken. Still pretty rough, but way better than the initial text input.
Next step was the CSV file. I kept adding columns for things like date, time, and location. Started getting messy. So, I decided to switch over to a SQLite database. Felt much cleaner and more organized. Plus, it made querying the data way easier. I used the `sqlite3` library in Python to handle all the database stuff.
To display the data, I played around with Matplotlib. I made a few graphs showing my shooting percentages over time and broken down by location. It’s pretty cool to actually see my progress (or lack thereof!).

Right now, it’s still a work in progress. My big goals are to:
- Improve the smartwatch app (maybe add GPS for better location tracking).
- Revisit the camera tracking thing – maybe there’s a simpler way to do it.
- Create a web interface to visualize the data, so I can access it from anywhere.
Lessons learned?
Don’t be afraid to start small. Even a super basic tool can be useful. And don’t underestimate the complexity of computer vision. That stuff is hard!
Overall, this “basketball tot” project has been a blast. I’m learning a lot, and it’s actually helping me improve my game. Plus, it’s just fun to build something that I actually use.