Finding depth information from corresponding pixel in color image
Hi All,
I just got my new D435i for a few days and it is fun to play with. Currently I am working on a medical application for object detection. My project requires some hand labeling of landmarks for training CNN and I want to develop a software for such purpose. The labeling involves color images and their corresponding depth information.
Ideally, I want to use mouse to click on the color image to label a landmark and the software will record the image pixel information and corresponding depth information. I played with matlab and now I can read both image and raw depth data recorded using RS viewer. It looks like the depth data covers larger fields of view. what is the easiest way to find the depth information corresponding to a pixel in my color image? I prefer to use matlab. But C++ with SDK2 is also a possibility.
Best regards,
Everett
-
Hi Everett,
Finding the depth of a color pixel would usually involve aligning the depth image to the color image.
If you are using Windows 10, the RealSense SDK has a compatibility 'wrapper' module for MATLAB that can be installed.
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/matlab
If you are able to use the RealSense MATLAB.wrapper, I hope that the discussion in the link below will be helpful in setting up a depth to color alignment with MATLAB.
https://github.com/IntelRealSense/librealsense/issues/4245
-
Hi Sheethal Ng What did you dump the distance data to, please? (e.g a csv file)
-
There was a case in 2019 of a RealSense user who converted an npy file into a ply point cloud file in Open3D and then used MeshLab to visualise the ply.
-
You can apparently read npy files as images with matplotlib or with pillow
https://stackoverflow.com/questions/33480297/viewing-npy-images
Please sign in to leave a comment.
Comments
9 comments