Measure shot distance for basketball and golf?

asked 2016-07-31 18:27:17 -0500

Crashalot gravatar image

Let's say you're using OpenCV to do shot tracking for basketball and golf. For basketball, could you use OpenCV to estimate where on the court a shot was taken and the distance of the shot? For golf, could you measure the distance of a shot?

For the basketball scenario, assume the height of the rim is 10 feet.

edit retag flag offensive close merge delete

Comments

2

With a single camera and without any known reference objects at fixed distances from the camera you can't retrieve depth information of the scene because it's being lost when the image is taken.

What do you mean by "shot tracking"? Video analysis or working with a single picture?

David_86 gravatar imageDavid_86 ( 2016-08-01 06:16:58 -0500 )edit

@David_86 thanks for the comment! So two cameras (similar to human eyes) would let you gauge distance accurately? How do iPhone apps like https://itunes.apple.com/us/app/easym... measure distance? And by shot tracking, assume it's video analysis -- and ideally real-time, but asynchronous is fine as a last resort.

Crashalot gravatar imageCrashalot ( 2016-08-01 16:30:21 -0500 )edit

@Crashalot yes, simulation of human eyes is what you need to retrieve metric information from the scene. I don't know how that app is working, maybe using multiple frames. No matter what kind of strategy you're using, from a single picture information about dimension/depth of objects is lost: think about a coin just in front of the camera and an elephant 50 m away, they'll look almost the same size. With a couple of cameras, knowing the distance between each other, you can triangulate every common point in the images and calculate its depth through the disparity. The accuracy of the measure depends on this: the far you go from the camera, the little will be the disparity leading to a less accurate triangulation (this is extremely simplified, just to get the idea behind).

David_86 gravatar imageDavid_86 ( 2016-08-02 06:16:28 -0500 )edit

@David_86 thanks for your help!

Crashalot gravatar imageCrashalot ( 2016-09-07 23:31:41 -0500 )edit