-
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
How to create color point cloud from disparity #12901
Comments
Hi @Toaster0617 You could convert the RealSense 16-bit uint16_t 'pixel depth value' (which ranges from 0 to 65535) to OpenCV's range of 0-255 by converting the depth value to the OpenCV format CV_16UC1. The #8572 case that you quoted has an example of such a conversion in one of its scripts, at #8572 (comment)
If disparity values are not vital to your project then an alternative approach for obtaining a colorized point cloud with OpenCV code could be the librealsense SDK's opencv_pointcloud_viewer.py pyrealsense2 example program. |
@MartyG-RealSense Thanks for your help! Does this mean that I only need to convert my data format to 16-bit and scale it to 0-255? |
My understanding is that after RealSense data is converted from 16-bit uint16_t to an OpenCV format such as CV_16UC1 then its scale is automatically adjusted without you having to rescale the depth values yourself. |
@MartyG-RealSense Thanks for your response! I can solve my problem now! |
Case closed due to solution achieved and no further comments received. |
Hi. I'm quite new to using pyrealsense2 library. I having trouble in convert disparity to color point cloud using opencv function (eg. reprojectImageTo3D function).
I've already get my disparity value by using method in #8572 but my disparity value lies between 0 to 65535. So did I need to scale or convert my result so that it can be used for generate color point cloud by using opencv?
Here is the image I get
The text was updated successfully, but these errors were encountered: