Skip to content

Commit 1093eb6

Browse files
committed
Fix a bug: structured3d extrinsic error!!!
1 parent 0c5af29 commit 1093eb6

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

ponder/datasets/preprocessing/structured3d/preprocess_structured3d.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,22 @@ def parse_scene(
255255
if parse_rgbd or plugin_rgbd:
256256
depth = depth[:, :, 0]
257257
extrinsic = np.eye(4)
258-
extrinsic[:3, :3] = np.linalg.inv(
259-
np.array([[0, 0, 1], [0, -1, 0], [1, 0, 0]]) @ cam_r
260-
)
258+
extrinsic[:3, :3] = cam_r
261259
extrinsic[:3, 3] = cam_t
260+
extrinsic = np.array(
261+
[[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]
262+
) @ np.linalg.inv(
263+
np.array(
264+
[
265+
[0, 0, 1, 0],
266+
[0, -1, 0, 0],
267+
[1, 0, 0, 0],
268+
[0, 0, 0, 1],
269+
]
270+
)
271+
@ np.linalg.inv(extrinsic)
272+
)
273+
262274
semantic_map = (
263275
np.ones_like(depth, dtype=np.int64) * ignore_index
264276
)

ponder/datasets/structure3d.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,6 @@ def get_data(self, idx):
115115
if (rgbd_dicts[i]["depth_mask"]).mean() < 0.25:
116116
return self.get_data(idx)
117117

118-
for d in rgbd_dicts:
119-
d["extrinsic"] = np.array(
120-
[[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]
121-
) @ np.linalg.inv(
122-
np.array([[0, 0, 1, 0], [0, -1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1]])
123-
@ np.linalg.inv(d["extrinsic"])
124-
)
125-
126118
data_dict = dict(
127119
coord=coord,
128120
normal=normal,

0 commit comments

Comments
 (0)