-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Is there a way to remove points too far away when I save a .plt file? #9036
Comments
Hi @JimXu1989 You could use a threshold filter post-processing filter in Python to set a maximum depth distance so that the far-off points are excluded from the point cloud before it is imported to ply. An example of such a script is in the link below. Alternatively, you could import the ply file into the free MeshLab software tool and edit the data there. |
Hi, aligned_frames = align.process(frames) Invoked with: <pyrealsense2.pyrealsense2.align object at 0x7f8583f3c8b0>, <pyrealsense2.frameset Z16 BGR8 #7> And the filtered frame don not have the attribute 'get_depth_frame' Traceback (most recent call last): |
It is difficult to debug without seeing the whole script. Would it be possible to post your full script in the comments please? For example, if the align code in your script is based upon align-depth2color.py, have you set up align_to in your script? |
Hi @JimXu1989 Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Hi, I met the same question, I want to filter the background on the pointcloud, here are my codes: DEBUG = False Start streamingprofile = pipeline.start(config) Wait for a coherent pair of frames: depth and colorSkip the first 300 frames to set the auto exposure timefor x in range(100): frames = pipeline.wait_for_frames() Align the depth frame to color framealigned_frames = align.process(frames) Get aligned framesaligned_depth_frame = aligned_frames.get_depth_frame() And I got this error: |
Hi @jianjuan You are performing alignment after post-processing (the threshold filter) which is Intel's recommendation, so that part looks fine. In your frame skip routine, I believe that the line pipeline.wait_for_frames() could be deleted because the frames = pipeline.wait_for_frames() line will handle it correctly. If you are only setting a maximum depth rendering distance and do not need to define a minimum distance too then the clipping distance method demonstrated in the SDK's align-depth2color Python alignment sample program may be able to perform this function instead of a threshold filter. |
Thanks for your reply! However, my command is to clip distance from minimum distance to maximum distance, you see, in my applications, close objects are obstruct for my interested object. And I see that "realsense_viewer" can do threshold filter to obtain my ideal pointcloud, so is there a chance to do so in my code? Or, after |
The threshold filter can be accessed in Python. #8170 (comment) has an example of a script for doing so that you can compare to your own code. You will need to add a reference to min_distance to the script to define the desired minimum distance of the threshold filter, like in #3002 (comment) |
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
I use the following code to save a .ply file, while, there are so many far away points which I do not need
pc.map_to(color_frame)
points = pc.calculate(aligned_depth_frame)
points.export_to_ply('./ply_files/'+ str(filelen) + ".ply", color_frame)
As the pic shows:
Is there any way to clip the 3d points?
The text was updated successfully, but these errors were encountered: