Details about lane post processor
I was looking at the code in cc_lane_post_processor.cc and I was trying to figure out if and how apollo projects pixels into 3d world coordinates. I found the CCLanePostProcessor::ProcessWithoutCC function. At around line 571 a variable value is set to the value of the pixel. I don't understand what the value of this variable represents. I thought lane_map is like a binary map, 0 means no lane, 1 means lane, but the variable value takes different values. Can anyone explain the values in lane_map?
Edit: Some more questions. I managed to do what I originally wanted, that is to project lane lines to world coordinates and see them from top down. I just took the code from the function I mentioned above. Now I want to understand how this transformation from camera pixel to world coordinate works. I found that the following 3 lines do the magic. Can anyone explain me what each of them do?
Eigen::Matrix<double, 3, 1> img_point(
x * roi_width / lane_map.cols,
y * roi_height / lane_map.rows + roi_start, 1.0);
Eigen::Matrix<double, 3, 1> xy_p = trans_mat_ * img_point; (trans_mat_ comes from camera extrinsic parameters, i understand this line is where the actual projection is done)
xy_point << xy_p(0) / xy_p(2), xy_p(1) / xy_p(2);
xy_point has the final coordinates
Thank you for the question. CCLanePostProcessor::ProcessWithoutCC is obsolete and already removed from repo. The lane line points in an image were re-projected to a ground plane using 2D homography assuming that the ground plane is planar. Please take a look at the most recent implementation.
I am closing it since there is no further question after last answer.