Skip to content

Commit

Permalink
Update camFusion_Student.cpp
Browse files Browse the repository at this point in the history
Fixed a bug in pixel coordinates
  • Loading branch information
SudKul authored Sep 15, 2020
1 parent f643cf4 commit 60fe5c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/camFusion_Student.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ void clusterLidarWithROI(std::vector<BoundingBox> &boundingBoxes, std::vector<Li
// project Lidar point into camera
Y = P_rect_xx * R_rect_xx * RT * X;
cv::Point pt;
pt.x = Y.at<double>(0, 0) / Y.at<double>(0, 2); // pixel coordinates
pt.y = Y.at<double>(1, 0) / Y.at<double>(0, 2);
// pixel coordinates
pt.x = Y.at<double>(0, 0) / Y.at<double>(2, 0);
pt.y = Y.at<double>(1, 0) / Y.at<double>(2, 0);

vector<vector<BoundingBox>::iterator> enclosingBoxes; // pointers to all bounding boxes which enclose the current Lidar point
for (vector<BoundingBox>::iterator it2 = boundingBoxes.begin(); it2 != boundingBoxes.end(); ++it2)
Expand Down

0 comments on commit 60fe5c9

Please sign in to comment.