Search code examples
opencvimage-processing3dtriangulationstereo-3d

3D Triangulation similar to Hawkeye


Forgive me if this question has been asked before, but I'd like to know where to start to achieve stereo vision to convert 2D coordinates into 3D coordinates. I'm trying to track balls like Hawkeye in 3D. I have two high speed cameras and I'm able to detect the ball in each camera. I understand that I need to calibrate the cameras, synchronize them and run some algorithm to remove lens distortion etc. However, I don't know what the next step is to convert the 2D coordinates to world 3D coordinates.

Does anybody know how to perform triangulation who can assist me with this? Also the cameras will not be parallel to each other, but at different angles, so somehow, I need to know the location of each camera in terms of their 3D coordinates.

Any help with this would be gratefully received.

Many thanks


Solution

  • To convert 2D into 3D for two calibrated cameras you would use these formulas: z = focal*baseline/disparity x = z*u/focal y = z*v/focal

    where focal - the focal length of you camera in pixels u = column-Cx, Cx~image_width/2 but calibration will give you more precise value v = -row+Cy, Cy~image_height/2 Baseline - horizontal distance between cameras disparity - difference in horizontal position of the ball in two images

    Strictly speaking you need to do rectification only for working with dense stereo. For sparse stereo you only need calibration.