Image points to world points

Please provide the following info (check/uncheck the boxes after clicking “+ Create Topic”):
Software Version

DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
[+] NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version

Target Operating System
[+] Linux

Hardware Platform
[+] NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)

SDK Manager Version

Host Machine Version
[+] native Ubuntu 18.04

I was trying to generate world points from the image points generated from lane detection sample. (Since the world points variable in dwlaneDetector_detectlanes was always giving 0 as output).
I followed below link to generate the world points (without lane graph)
How to transform points from image space to world space?

But When I plotted the world points of the lanes obtained, it is not as expected.(the lateral coordinates varies too much). Please find the world points plot and corresponding image points plots attached.

Can anybody point out where it went wrong?

Dear @nithin.m1,
Could you share reproducible code for DRIVE SW 10.0 as DW sample?

Hi @SivaRamaKrishnaNV ,
main.cpp (34.6 KB)
Please find the attached main file.
I have commented rendering section as I was facing some difficulties in visualization. (I did visualizations above in MATLAB).
I have just added the code snippet for world point generation. Also pointed the rig file in sample lane detection as required.

Hi @nithin.m1 ,

What did you mean the lateral coordinates vary too much? This was not plotted with calculated rayInRig[0], rayInRig[1], rayInRig[2], right?

Hi @VickNV,

I have calculated the xGround (long) and yGround (lat) points as shown in image and plotted these values.

As you can see from plots the lateral coordinates of points on same lane line changes considerably . For example yellow line changes y from 1 to around 13, but as from image we can see its a straight road and heading almost parallel to road. In such cases our y values should be almost constant right? please correct me if I am wrong.

Hi @VickNV / @SivaRamaKrishnaNV,

Is there any update on this?
still not able to resolve this issue.

Thanks in adavance.

Please also share how you visualize the result in MATLAB. It will be easier for us to check it with the internal team. Thanks.

Hi @VickNV,

I just saved the ground points generated for each lane line in a frame and plotted between xGround and yGround. Currently as a trial I printed points to console in debug mode and copied from there to create .mat files and plotted in matlab.
Kindly let me know if any other details required.

Hi @VickNV ,

At last figured out what was going wrong with me. I should have checked the documentation and rig file little more carefully. Resized images are used in lane detection sample . I should multiply the image points with the image rescale factor before finding world points. Now am getting the lane lines almost parallel and values seems to be correct. Thanks for the support.

Thanks for sharing back and sorry for missing your topic.

Could you also share your fixed main.cpp? Thanks.

Hi @VickNV,

There is a simple 2 line change in main.cpp


as the size of image used for lane net detection is half of the original image size.