Ask Your Question
0

Camera coordinates to real world plane coordinates

asked 2019-10-23 04:00:05 -0500

Mirano gravatar image

updated 2019-10-23 04:13:07 -0500

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-10-23 15:30:00 -0500

eyshi gravatar image

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.

edit flag offensive delete link more

Comments

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

Mirano gravatar imageMirano ( 2019-10-24 00:44:42 -0500 )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.

eyshi gravatar imageeyshi ( 2019-10-28 12:03:19 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-10-23 04:00:05 -0500

Seen: 69 times

Last updated: Oct 23 '19