-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert Cuboid2D to/from KITTI 3D data #1639
Convert Cuboid2D to/from KITTI 3D data #1639
Conversation
Signed-off-by: Ilya Trushkin <[email protected]>
Signed-off-by: Ilya Trushkin <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1639 +/- ##
===========================================
+ Coverage 81.06% 81.23% +0.16%
===========================================
Files 278 281 +3
Lines 32517 32881 +364
Branches 6607 5289 -1318
===========================================
+ Hits 26360 26710 +350
- Misses 4701 4721 +20
+ Partials 1456 1450 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
return np.array([a, b, c, d]) | ||
|
||
@staticmethod | ||
def _get_denorm(Tr_velo_to_cam_homo): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question, what is the meaning of Tr_velo_to_cam_homo
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calibration matrix Tr_velo_to_cam
has a shape of 3 x 4. To project 3D points to the 2D plane, we need to have homogeneous coordinates where each point is represented as a vector with 1 additional dimension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the projection matrix between Velodyne LiDAR to Camera, where LiDAR contains 4 dimensions ([X, Y, Z, 1]) and Camera contains 3 dimensions ([u, v, 1]). velo
stands for Velodyne :)
2---3 | ||
/| /| | ||
5-+-8 | | ||
| 2 + 3 | ||
1-+-4 | | ||
| 5 + 6 | ||
|/ |/ | ||
1---4 | ||
8---7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood the overall structure, is there any reason to change the bottom and top face?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I aligned the order of points with Kitti format which describes top face first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update the documents and explanation of this feature in this pr too?
Signed-off-by: Ilya Trushkin <[email protected]>
@sooahleex, documentation is added in 657bf1b. PR description is extended as well. |
Summary
CVS-151427
New features
Cuboid2D
methods:Cuboid2D.from_3d(dimensions, location, rotation_y, P, Tr_velo_to_cam)
: Creates a Cuboid2D object from KITTI 3D bbox annotation data. MatrixP
(P2
in Kitti format context) is a 3x4 projection matrix in the left color camera coordinate system. MatrixTr_velo_to_cam
is a 3x4 projection matrix between LiDAR and camera coordinate systems.cuboid_2d.to_3d(P_inv)
: Reconstructs approximate KITTI 3D bbox annotation data (dimensions
,location
androtation_y
) from 2D projection coordinates.P_inv
matrix is a pseudo-inverse of camera-to-image projection matrix.How to test
See unit test changes
Checklist
License
Feel free to contact the maintainers if that's a concern.