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

Cropping a cropped PCD returns empty #5087

Open
3 tasks done
MartinPedersenpp opened this issue May 9, 2022 · 4 comments
Open
3 tasks done

Cropping a cropped PCD returns empty #5087

MartinPedersenpp opened this issue May 9, 2022 · 4 comments
Labels
boundingbox bug Not a build issue, this is likely a bug.

Comments

@MartinPedersenpp
Copy link

MartinPedersenpp commented May 9, 2022

Checklist

Describe the issue

I am trying to extract a cropped part of my point cloud, which is already cropped from a much larger point cloud.
When I perform the second crop using:
crop = point_cloud.crop(bbox)
it returns an empty point cloud, even though the object is clearly inside the bbox.
This might be an error on my end, but I assume it is a bug in some way?

Original cropped point cloud:
first_crop_res

Point cloud with the bbox to be cropped, clearly some points are inside:
second_crop_res

Result of cropping the cropped point cloud, nothing:
third_crop_res

Any help is much appreciated.

Steps to reproduce the bug

Running this on a point cloud returned from another crop:

crop_bounding_box = o3d.geometry.AxisAlignedBoundingBox(min_bound=min_bound_bbox, max_bound=max_bound_bbox)
crop_bounding_box.color = [255,255,0]
o3d.visualization.draw_geometries([point_cloud, crop_bounding_box])
cropped_pcd = point_cloud.crop(crop_bounding_box)
o3d.visualization.draw_geometries([cropped_pcd])

Error message

No response

Expected behavior

The object within the bbox appears in the cropped point cloud

Open3D, Python and System information

- Operating system: Windows 10 64-bit
- Python version: 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)]
- Open3D version: 0.15.1
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip

Additional information

No response

@MartinPedersenpp MartinPedersenpp added the bug Not a build issue, this is likely a bug. label May 9, 2022
@MartinPedersenpp
Copy link
Author

I fixed it, but it might still be a bug.
I switched the min/max bounds of the bbox and this resulted in the cropped point cloud containing the object.
So I guess that if the bounding box is created in inverse it will not give the correct output?
Feel free to close this when you see this.

Best regards
Martin

@marco-paladini
Copy link

should o3d.geometry.AxisAlignedBoundingBox raise exception if min point > max point?

@MartinPedersenpp
Copy link
Author

Either the bounding box or pointcloud.crop should probably return something if min point > max point which could result in the crop not returning anything.
An alternative could be to let crop accept a list of two points and then let it take the min and max for the two points.

@yuecideng
Copy link
Collaborator

We will consider these suggestions in tensor based bounding box. Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
boundingbox bug Not a build issue, this is likely a bug.
Projects
None yet
Development

No branches or pull requests

3 participants