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

pointcloud quesetions about realsenseD415 #10013

Closed
piaorou-tech opened this issue Nov 30, 2021 · 3 comments
Closed

pointcloud quesetions about realsenseD415 #10013

piaorou-tech opened this issue Nov 30, 2021 · 3 comments

Comments

@piaorou-tech
Copy link

piaorou-tech commented Nov 30, 2021

Required Info
Camera Model D415
Firmware Version 05.12.15.50
Operating System & Version Win10
Kernel Version (Linux Only)
Platform PC
SDK Version
Language python
Segment

Issue Description

Hello,I have read many similar questions before, but I still have two questions about pointclouds with D415 as below.

1.I used the code of the official scripts named opencv_pointcloud_viewer.py to display the pointclouds of camera.The first question is about the size of variance "out".I set h=480, w=640 and which are the same as the raw color and depth pictures' size. Then I found the 3D picture's center is not along the camera color center. It's on the top left of the center like the picture below.
image

But when I changed h=960,w=1240 or the number similar large, I found the 3D picture's center is on the correct place like below.
image

Would you plesase tell me why and how to deal with it? Because I want to make the window smaller and seems normal.
2.I made some processing on the color_image,such as face recognition. I just wanted to save the pointclouds like face ROI but not the whole picture with 640*480 size. But I found rs.frame type cannot cut cannot crop an area individually. Would you please tell me how to change the picture type(I mean the face region) of np.array into rs.frame to generate pointclouds or how to just get the ROI from rs.frame type?

Looking forward to your reply!Thank you!

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 30, 2021

Hi @piaorou-tech What results do you get if you leave the opencv_pointcloud_viewer.py script mostly in its original state without altering h,w and instead define specific resolution sizes for depth and color on lines 82 and 83.

config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30)

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/opencv_pointcloud_viewer.py#L82-L83

In regard to your second question: I would recommend avoiding trying to convert a numpy array into rs2::frame, as other RealSense users have explored how to do so but not arrived at a clear solution yet to the best of my knowledge. This subject is discussed in #5784

#2769 (comment) has a suggestion for scripting for using a ROI with a Python pointcloud that looks as though it would be compatible with the code of opencv_pointcloud_viewer.py

@MartyG-RealSense
Copy link
Collaborator

Hi @piaorou-tech Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants