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

Fix the bug of dataset/demo_dataset.py #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

safsfsvvea
Copy link

dataset/demo_dataset.py, render_cloud function, the original code does't consider the case that P[1].min() <= 0 or P[0].min() <= 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Perhaps these two checks can be combined into a single if (else) statement? Since the second check should also return image, False don't you think?

if P[1].max() >= self.cam_height or P[0].max() >= self.cam_width:
        return image, False

P = P.astype(
if np.any((P[1] < 0) | (P[1] >= image.shape[0]) | (P[0] < 0) | (P[0] >= image.shape[1])):
        print(f"Error: P is out of bounds: P={P}, image.shape={image.shape}")
        print(f"R: {R}, t: {t}, self.point_cloud[obj_id]: {self.point_cloud[obj_id]}")
        print(f"self.cam_K_np: {self.cam_K_np}")

It's been a while since I've worked with this code so I might be missing smth.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if np.any((P[1] < 0) | (P[1] >= image.shape[0]) | (P[0] < 0) | (P[0] >= image.shape[1])):
this if and else can be savely deleted, and then you can just add the change of dataset/demo_dataset.py. If it is necessary, I can submit another pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants