# Camera coordinates to real world plane coordinates

Hi everyone!

I searched the Internet to find a solution to my specific problem but couldn't find any usable solutions. The problem is: I'm tracking vehicles in a video, and I need to transform the tracked coordinates in a real world plane coordinate system. I just need the (X,Y) coordinate and no height (Z). Via GPS i was able to get some (X,Y) distances from my camera location (0,0) to points in the image:

Pixel coordinate -> world coordinate (in m)
(691, 1045)->(32,27)

(1114, 652)->(234,57)

(427, 680)->(109,83)

(665, 656)->(157,88)

Now my question is: Is it possible to obtain two equations f(x)->X and g(y)->Y where x,y are pixel coordinates and X,Y are real world plane coordinates? And if yes, how?

edit retag close merge delete

Sort by ยป oldest newest most voted

To convert the pixel cordinate to world cordinate (X,Y), you need to have a homography matrix (2d-2d) which can be multiplied with pixel cordinates (in homogenous ) to give world cordinates.

Have a look at the findHomography function in opencv. It helps to find the transformation from one plane to other but only the 2D co ordinates can be found.

more

Thank you for your reply! I wonder if this is somehow usable? And any idea how it works? https://github.com/zhengthomastang/Ca...

( 2019-10-24 00:44:42 -0600 )edit

I haven't used it, but I believe it is simply based on findHomography function : you can read this : https://docs.opencv.org/2.4/modules/c... and https://docs.opencv.org/master/d4/d94.... the link you shared also has an ability to manually click the points and import 3d points to find the homography between two.

( 2019-10-28 12:03:19 -0600 )edit

Official site

GitHub

Wiki

Documentation