-
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
[pyrealsense2] 1. Is there a way to export .ply file with both color(from color frame) & vertex normals? 2. can I clamp in x, y direction ? #6194
Comments
There is a Python example program called export_ply_example. It has Mesh creation set to True by default, and sets saving of Normals to True. If you want to set a 'bounding box' for your Python point cloud, this link may be helpful: |
@MartyG-RealSense I think there should be some way to initialize colorizer with color stream so that when using colorizer, the output frame should get colors from color_frame, not depth_frame. 27 # (alternatively, texture can be obtained from color or infrared stream)
|
Are you attempting to align depth to RGB color, please? The link below has an example of a Python user who aligned depth to color and then generated a point cloud. |
@MartyG-RealSense for i in range(30): frames = pipe.wait_for_frames() However, this 1.ply file doesn't have vertex normals in it.
but what I found is
How can I save .ply file with both rgb color & vertex normals at the same time? |
I had a careful look at your code and compared it to similar examples and could not find anything obviously wrong with it. I am admittedly not an advanced-level Python programmer though. I will refer this question to @dorodnic for advice. |
@MartyG-RealSense |
Case closed due to no further comments received. |
Same issue as mentioned of @djflstkddk |
@usarawgi911 Can you start a new issue please by clicking on the New Issue button on the forum's front page and provide a link to this page in your question? Thanks! https://github.com/IntelRealSense/librealsense/issues |
For those who are still trying to solve the issue of saving their pcd in rgb color instead of |
Thanks so much @TheDech for sharing your solution! |
| Camera Model | D435i |
| Firmware Version | (Open RealSense Viewer --> Click info) |
|API version |
| Operating System & Version | Linux (Ubuntu 18.04) |
| Kernel Version (Linux Only) | (e.g. 4.14.13) | |
| Language | /python/ } |
Issue Description
Hi. I'm quite new to using pyrealsense2 library, and having trouble in saving .ply file with both color & vertex normals.
As I see from export_to_ply.py, there is a filter named 'save_to_ply', but with this, I cloud only save pointcloud(.ply) with normals but color. Here is a part of my code.
with this, I could only get colors from depth frame, not colors from color frame.
How can I get color from color_frame when saving .ply files?
There is also another way of saving .ply file using points like below.
However, in this way, I couldn't get vertex normals.
I see that with realsense-viewr, I can get both normals & color from color frame. but I wanna do it with code.
How can I get both vertex normals & color from color_frame in pyrealsense2?
another question. How can I clamp in x, y direction when saving .ply files? I coud do depth clamping with threshold filter like this
thre = rs.threshold_filter(0.1, 1.8)
.
.
.
filtered = thre.process(depth_frame)
However, I also want to clamp in x, y directions also and save the clamped point cloud. Is there any functions related to this ? I could find depth claping in realsense-viewer, but not with x, y directions.
Also, I wanna do it in python code, not realsense viewer.
Thank u for reading.
The text was updated successfully, but these errors were encountered: