valeoai / WoodScape

The repository containing tools and information about the WoodScape dataset.
https://woodscape.valeo.com/dataset
595 stars 122 forks source link

The confusion of real-world length calculations #44

Open ganyz opened 2 years ago

ganyz commented 2 years ago

How to calculate the length of the real world corresponding to 1 offset of the x-axis, y-axis, and z-axis in the world coordinate system (world_points) ?:<

And how to calculate the length of the real world corresponding to 1 pixel in the x-axis and y-axis in screen_points ? :<

I'm going crazy :< It puzzles me for a long time. Thank you !

sleepywitti commented 2 years ago

Hello ganyz,

I might misunderstood your question, but there is no easy general transformation between "real world" 3d length units and 2d image units. The transformation can be modeled using a suitable camera model, but even than, the correspondence depends on where you are in the image (e.g. the units at the top of a fisheye image are different than in the center).

Best Christian

ganyz commented 2 years ago

Thank you for your response ~

Now I follow the /scripts/calibration/example.py to calculate the world point.

(line 78 world_point = cylindrical_cam.project_2d_to_3d(cyl_points,norm=np.ones(cyl_points.shape[0]))

I can get the 3D world_point, and x axis value is the depth value. But I find the max value is about 4.75 and min value is about 3.67.

It also puzzles me for a long time >.<

Miracle1991 commented 2 years ago

Thank you for your response ~

Now I follow the /scripts/calibration/example.py to calculate the world point.

(line 78 world_point = cylindrical_cam.project_2d_to_3d(cyl_points,norm=np.ones(cyl_points.shape[0]))

I can get the 3D world_point, and x axis value is the depth value. But I find the max value is about 4.75 and min value is about 3.67.

It also puzzles me for a long time >.<

have you solved this problem? i find the world point is not real.

sleepywitti commented 2 years ago

Hello, as far as I am aware of, the depth value is the norm of the vector. So you should try to match sqrt(x²+y²+z²) with the depth instead of the x axis.

Best Christian