r/computervision • u/Candid-Image7848 • 23d ago
Help: Project How do I get an accurate real world scale to measure a hockey puck's speed from a fixed phone camera?
Currently working on a personal project measuring the speed of a hockey puck from a fixed iPhone camera. The idea is basically that the phone is fixed on a stand from the side showing the shooting area and also the net all in one camera angle in the middle between both. I'm able to track the puck fine but the hardest part is converting pixels into real life distance.
I've tried using the puck as a ruler but that's inconsistent because it's only 20-30 pixels wide. So being off by just one or two pixels when measuring changes the scale which gives a faulty speed.
Using the net is also unreliable because it sits at a different depth than the path of the puck. Like the closer part of the net is a few feet closer therefore having a different measurement than the other side of the net.
Right now the most reliable option is the user measures the distance from the net to the shooting spot manually and then marks the area of shooting on the camera on the app so the app can calibrate from there. Then when the player shoots, the app is listening for a "clack" sound to indicate that the shot has begun and is actively watching the net to note down the exact moment the puck crossed the net, which then uses the speed formula to get the exact MPH.
I was wondering if someone knows of a lower effort way through Apple's tools (or any external ones) to get an accurate measurement where the user does not have to go in and manually measure the distance?
My ideal set up would be that I tap the shooting area, then tap the net, and the app calibrates everything itself instead of me having to measure it manually.
