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

Crop the points inside a box and save as as a separate point cloud #129

Merged
merged 10 commits into from Feb 2, 2023

Conversation

chingyulin
Copy link
Collaborator

@chingyulin chingyulin commented Dec 29, 2022

This PR implements a functionality to crop the point cloud inside a box and save as a separate bounding box. It reuses the menu of the boxes. A feature request here: #27

image

image

image

@ch-sa
Copy link
Owner

ch-sa commented Jan 29, 2023

Hey,

cool feature. Only just saw it now!

labelCloud/view/gui.py Outdated Show resolved Hide resolved
labelCloud/view/viewer.py Outdated Show resolved Hide resolved
@ch-sa ch-sa added the feature New feature or request label Jan 29, 2023
@chingyulin chingyulin requested a review from ch-sa January 30, 2023 19:55
Copy link
Owner

@ch-sa ch-sa left a comment

Choose a reason for hiding this comment

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

LGTM

Please consider the new comments :)


def crop_pointcloud_inside_active_bbox(self) -> None:
box = self.bbox_controller.get_active_bbox()
assert box is not None
Copy link
Owner

Choose a reason for hiding this comment

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

I am a bit sceptical about using assert outside tests.

Could this here ever be the case? Cause you only trigger this function, with a right click on an existing bounding box, or?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The assertion is for mypy. You are right that this will never be the case as we only trigger it when we know there is an active box. Alternatively we can also return when box is None, but it is also redundant.

labelCloud/control/controller.py Outdated Show resolved Hide resolved
labelCloud/model/point_cloud.py Outdated Show resolved Hide resolved
extensions = BasePointCloudHandler.get_supported_extensions()
make_filter = " ".join(["*" + extension for extension in extensions])
file_filter = f"Point Cloud File ({make_filter})"
file_name, _ = QFileDialog.getSaveFileName(
Copy link
Owner

Choose a reason for hiding this comment

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

Nice with the selectable extensions 👍

labelCloud/view/gui.py Outdated Show resolved Hide resolved
@@ -9,7 +9,7 @@ pytest~=7.1.2
pytest-qt~=4.1.0

# Development
black~=22.3.0
black~=23.1.0
Copy link
Collaborator Author

@chingyulin chingyulin Feb 2, 2023

Choose a reason for hiding this comment

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

@ch-sa FYI black released a new major version yesterday and that is used in the Github Action. Update black in requirements.txt to align with Github Action.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

Good to know 👍

@chingyulin chingyulin merged commit 1cbac09 into master Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants