-
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
D415 pointcloud mismatch between RealSense viewer export function and Python 3.7 export function #6718
Comments
There have been past cases of depth to color point cloud misalignment with Python that were fine when done in the RealSense Viewer. I have linked below to a case from my research of your question that seems to be the most useful of those that I found. The advice given for tackling this included:
https://downloadcenter.intel.com/download/29618/Intel-RealSense-D400-Series-Dynamic-Calibration-Tool |
@MartyG-RealSense Thank you for your quick response. Both advices were already implemented and tested but they did not result into a better alignment. Do you have any other suggestions that might solve this problem? |
How are you viewing the exported Python ply, please? If the Depth Units scale of the program that created the ply and the program that imports the ply for viewing are not the same then the ply may be distorted or mis-scaled when viewed in the program that it is imported into. |
@MartyG-RealSense I'm using CloudCompare v2.11.0 to view both pointclouds which allow easy assesment. I'm also able to import them into Python using the open3d package but this results in the same misalignment. |
Have you tried removing post-processing filters from your Python script one at a time to test whether a particular one (such as Decimation particularly) may be affecting the alignment? |
I also tried running the code without the line pc.map_to(pc_color) but this has no effect on the exported pointclouds. On top of that, replacing this line with pc.map_to(pc_depth) has no effect either. |
The Occlusion on the Viewer image looks very misaligned. The black outline around an object that Occlusion produces should be relatively equal all round, but yours is shifted off to one side. I note that at the top of the Viewer, you have Occlusion Removal set to 'Off'. Could you try setting it to 'On' please? |
I tried your suggestion but it did not change anything on the appearance of the object. So what I also tried just yet is to align the color stream to the depth frame, instead of depth to color. On top of that I changed pc.map_to(pc_color) to pc.map_to(pc_depth). These two alterations seem to resolve the bug I got: So it seems be better to align the color stream to the depth stream, which is not often seen in examples. |
That certainly does seem to be unusual. Does this method provide you with an acceptable solution, please? |
I found this suggestion here: #4315 . For now it seems to be an acceptable solution. Thank you for your suggestions! |
The issue is further explained in the linked thread. Specifically, this comment explains the shift in depth coordinates in x and y direction:
So in case depth accuracy is prioritized (which is most likely the case in the 3D viewer) the color image should be mapped to the depth image. |
@Desmenga Thanks so much for highlighting that link! |
Case closed due to no further comments received. |
Pointcloud mismatch between RealSense export and Python export
Currently, I'm working on the deprojection of 2D coordinates to 3D coordinates. I have recordings made with the RealSense D415 camera. In Python 3.7, I'm aligning the captured depth frames to the captured color images using pc.map_to. Subsequently, I'm creating a 3D pointcloud using pc.calculate which will be exported to a .ply file using the .export_to_ply function. To asses the accuracy of this operation, the exported pointcloud is compared with the pointcloud generated with the 3D export function which is implemented in the RealSense Viewer. However, there seems to be a displacement between these two pointclouds which is not as expected.
The image below shows a test recording of a cup, placed on a chair. The blue pointcloud is the one exported directly from the RealSense Viewer, while the other pointcloud (with color information) is exported after alignement in Python. The displacement seems most present in the x- and y-direction. The displacement in the z-(or depth) direction is minimal.
The python code to generate and export the pointcloud is shown below:
The text was updated successfully, but these errors were encountered: