Skip to content

Commit

Permalink
Fix a bug: structured3d extrinsic error!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoyiZhu committed Mar 28, 2024
1 parent 0c5af29 commit 1093eb6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,22 @@ def parse_scene(
if parse_rgbd or plugin_rgbd:
depth = depth[:, :, 0]
extrinsic = np.eye(4)
extrinsic[:3, :3] = np.linalg.inv(
np.array([[0, 0, 1], [0, -1, 0], [1, 0, 0]]) @ cam_r
)
extrinsic[:3, :3] = cam_r
extrinsic[:3, 3] = cam_t
extrinsic = np.array(
[[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]
) @ np.linalg.inv(
np.array(
[
[0, 0, 1, 0],
[0, -1, 0, 0],
[1, 0, 0, 0],
[0, 0, 0, 1],
]
)
@ np.linalg.inv(extrinsic)
)

semantic_map = (
np.ones_like(depth, dtype=np.int64) * ignore_index
)
Expand Down
8 changes: 0 additions & 8 deletions ponder/datasets/structure3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ def get_data(self, idx):
if (rgbd_dicts[i]["depth_mask"]).mean() < 0.25:
return self.get_data(idx)

for d in rgbd_dicts:
d["extrinsic"] = np.array(
[[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]
) @ np.linalg.inv(
np.array([[0, 0, 1, 0], [0, -1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1]])
@ np.linalg.inv(d["extrinsic"])
)

data_dict = dict(
coord=coord,
normal=normal,
Expand Down

0 comments on commit 1093eb6

Please sign in to comment.