Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SKim60
Novice
2,263 Views

depth data from Realsense camera

Hi all.

Today, I tried getting depth data from RealSense depth image for estimating error range.

I refer to this sample code https://software.intel.com/en-us/articles/using-librealsense-and-opencv-to-stream-rgb-and-depth-data RealSense - Using LibRealSense and OpenCV to stream RGB and Depth Data | Intel® Software

and added below code for save pixel data

cv::FileStorage fs("data_capture.xml", cv::FileStorage::WRITE);

fs << "depth" << ir ;

finally got .xml file

number of data is matched with number of pixels.

but I printed contour graph using MATLAB but it got this one different from real scene

So I searched and found out this documentation and RSDataCollector.git

https://software.intel.com/en-us/articles/realsense-depth-data RealSense - Getting started with the Depth Data provided by Intel® RealSense™ Technology | Intel® Software

https://github.com/IntelRealSense/rssdk-capture-xdm/blob/master/RSDataCollector.cpp rssdk-capture-xdm/RSDataCollector.cpp at master · IntelRealSense/rssdk-capture-xdm · GitHub

I think it can get depth value. however this script includes pxcsensemanager.h

It's not included librealsense.

I'm not sure how can I get depth value from each pixel

please give me your help

Tags (1)
0 Kudos
7 Replies
idata
Community Manager
117 Views

Hello greiny,

 

 

From what I read, I think your case is more suited for the RealSense community than for the Aero community.

 

 

Do you have any questions related to Aero? If you don't, please tell me so I can move this case to the corresponding community.

 

 

Regards,

 

Andres V.
SKim60
Novice
117 Views

Thanks Andres

but you don't need to do that. I will do with additional points

I want to clarify if realsense sdk can be applied in Intel Aero board to use PXCImage function

Regards

Greiny

idata
Community Manager
117 Views

Hello Greiny,

Could you please explain a bit further what you are trying to accomplish?

What I infer from the previous post is the following (please correct me if I'm wrong): you capture images with a RealSense camera which is mounted on an Aero drone, you capture and store that data using the RealSense SDK, finally, you take that data and print it in MATLAB.

If the last question is if the PXCImage function can be used in the RealSense SDK, then the answer is yes, it can. Check all the available functions of the latest SDK here: https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/index_k... https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/index_k.... Notice that the PXCImage is called Image in the last SDK, (https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/pxcimag... https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/pxcimag...).

Please keep in mind that any interaction with MATLAB is out of the scope of this technical support team.

Regards,

 

Andres V.
SKim60
Novice
117 Views

Hi Andres

Actually I mean, I didn't use Realsense SDK and only use realsense and opencv library and its function.

and My query was Realsense SDK is available on Aero board

I know that SDK is usually appiled in Windows of PC or Android application

So I'm trying to get depth value of each pixel without SDK

idata
Community Manager
117 Views

Hello greiny,

Thank you for further explaining your inquiry.

To answer your question, the RealSense SDK is not available for the Aero board, as you mentioned, the SDK is currently just available for Windows (8.1 and 10).

I understand that you want to get the depth value of each pixel without using the SDK (and that is why use are using the sample code from https://software.intel.com/en-us/articles/using-librealsense-and-opencv-to-stream-rgb-and-depth-data https://software.intel.com/en-us/articles/using-librealsense-and-opencv-to-stream-rgb-and-depth-data). What I don't understand is why you are experiencing an issue with said code, are you sure the issue is related to the contouring graph from MATLAB?

You may want to give this two examples a try:

 

https://github.com/IntelRealSense/librealsense/blob/f482fc3a9bb13d3ea09a567294131073877087ee/example... https://github.com/IntelRealSense/librealsense/blob/f482fc3a9bb13d3ea09a567294131073877087ee/example...

 

https://software.intel.com/en-us/articles/intel-aero-realsense-streaming-rgb-depth-data%23_Toc467619... https://software.intel.com/en-us/articles/intel-aero-realsense-streaming-rgb-depth-data# _Toc467619812.

I'll be waiting for your response.

Regards,

 

Andres V.
SKim60
Novice
117 Views

Hi Andres.

What I don't understand is why you are experiencing an issue with said code, are you sure the issue is related to the contouring graph from MATLAB?

- No I just wanted to verify my code for depth value. I thought that If I make contouring graph using data, I can get the same image with capture on Aero board however It was different. MATLAB was for simple test.

I tried both examples before. they worked well the first one's result here

I got pixel data consists of 0~255, 8bit unsigned integer format. how can I convert this to image and distance value?

Thank you

Greiny.

idata
Community Manager
117 Views

Hello greiny,

 

 

Thanks for the clarification regarding your MATLAB code.

 

 

I saw that you are receiving assistance from MartyG in the RealSense community (https://communities.intel.com/thread/113395 https://communities.intel.com/thread/113395), I recommend you to follow his suggestion.

 

 

You can share the picture that you posted here so he can get a deeper understanding of what you are trying to accomplish.

 

 

I also recommend you to continue sharing your updates in the RealSense community since the inquiry is more suited for that forum.

 

 

Have a nice day.

 

 

Regards,

 

Andres V.
Reply