Skip to content

Commit 75267c5

Browse files
committed
Use height to calculate kitti centroid
Closes: #163
1 parent dcfe94f commit 75267c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

labelCloud/io/labels/kitti.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,23 @@ def export_labels(self, bboxes: List[BBox], pcd_path: Path) -> None:
144144
for bbox in bboxes:
145145
obj_type = bbox.get_classname()
146146
centroid = bbox.get_center()
147-
dimensions = bbox.get_dimensions()
147+
length, width, height = bbox.get_dimensions()
148148

149149
# invert sequence to height, width, length
150-
dimensions = dimensions[2], dimensions[1], dimensions[0]
150+
dimensions = height, width, length
151151

152152
if self.transformed:
153153
try:
154154
self._get_transforms(pcd_path)
155-
except CalibrationFileNotFound as exc:
155+
except CalibrationFileNotFound:
156156
logging.exception("Calibration file not found")
157157
logging.warning("Skipping writing of labels for this point cloud")
158158
return
159159

160160
centroid = (
161161
centroid[0],
162162
centroid[1],
163-
centroid[2] - dimensions[2] / 2,
163+
centroid[2] - height / 2,
164164
) # centroid in KITTI located on bottom face of bbox
165165
xyz1 = np.insert(np.asarray(centroid), 3, values=[1])
166166
xyz1 = self.T_v2c @ xyz1

0 commit comments

Comments
 (0)