LaneMarking points from image space to 3d world space


I’ve followed Fabian Weise’s recommendation on for transforming each pixel from image space to world space without using lanegraph.

However, I wanted to clarify 2 things:

  • I see that there is some scaling being done with:

    float32_t t = m_transformationSensor2Rig.array[14] / rayInRig[2];

Is this fixing the height at the ground, and then calculating the depth and the lateral distance for each point on the lane?

  • Is this measurement calculated with respect to the center of the rig, which is at the rear wheel axle center, attached to the ground ?



Hi Göksan,

Thanks for your interest in the transformation, so let me help you out:

  1. I am not scaling due to the purpose of fixing the height since this is coming with the calibration of the camera anyways.
float32_t t = m_transformationSensor2Rig.array[14] / rayInRig[2];

This describes standard ray tracing by solving the equation z_camera = t * z_ray by assuming the camera is lifted by z_camera and the vector to ground is t long.

I then solve the equation to t which results in: t = - z_camera / z_ray

  1. The measurement is calculated with respect to the rig center since the transformation matrix holds true for that by having it calculated before.

Hope that helps.

Best regards,

thanks for the clarification Fabian.

I have brought up scaling, because when we are going from 2d pixel space to 3d world space via ray projection, I thought we need to fix one of the dimensions first to get the other 2. And given that both origin of the rig and the lane markings are on the same ground plane, then we can assume the height (which makes z=0 (outwards from the ground plane)) is fixed at 0, and get the X and Y coordinates.

Is this the wrong way to think about it ?

THanks and regards


For sure, you are always welcome.

No, you’re totally right and as you said the triviality of solving to 0 lies in the rig origin and lane markings being on the same plane.

Best regards,