Skip to content
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

Use height to calculate kitti centroid #167

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions labelCloud/io/labels/kitti.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,23 @@ def export_labels(self, bboxes: List[BBox], pcd_path: Path) -> None:
for bbox in bboxes:
obj_type = bbox.get_classname()
centroid = bbox.get_center()
dimensions = bbox.get_dimensions()
length, width, height = bbox.get_dimensions()

# invert sequence to height, width, length
dimensions = dimensions[2], dimensions[1], dimensions[0]
dimensions = height, width, length

if self.transformed:
try:
self._get_transforms(pcd_path)
except CalibrationFileNotFound as exc:
except CalibrationFileNotFound:
logging.exception("Calibration file not found")
logging.warning("Skipping writing of labels for this point cloud")
return

centroid = (
centroid[0],
centroid[1],
centroid[2] - dimensions[2] / 2,
centroid[2] - height / 2,
) # centroid in KITTI located on bottom face of bbox
xyz1 = np.insert(np.asarray(centroid), 3, values=[1])
xyz1 = self.T_v2c @ xyz1
Expand Down
Loading