Items with no label
3335 Discussions

I want to extract information(depth, object name) from 'dnn' in real time as text

지최
Beginner
1,555 Views

I use realsense d415 and use 'dnn' code https://github.com/IntelRealSense/librealsense/tree/master/wrappers/opencv/dnn librealsense/wrappers/opencv/dnn at master · IntelRealSense/librealsense · GitHub

The information(depth, object name) is displayed on the screen

But!! I want to save this information in some format such such as text at the same time

To do this, I need to modify 'rs-dnn.cpp' code

How do I fix the code??

0 Kudos
4 Replies
idata
Employee
444 Views

Hello jiin,

 

 

Thank you for your interest in the Intel RealSense Technology.

 

 

In regards to your query, if you look at the details below you can see that the code that outputs the depth information to the label on the screen begins on line 125 ( https://github.com/IntelRealSense/librealsense/blob/master/wrappers/opencv/dnn/rs-dnn.cpp# L125 ) rectangle(color_mat, Rect(Point(center.x, center.y - labelSize.height), Size(labelSize.width, labelSize.height + baseLine)), Scalar(255, 255, 255), CV_FILLED); putText(color_mat, ss.str(), center, FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0,0,0));

 

You can replace this with code to output to a file instead. The depth data is stored in the variable: ss.str()

 

 

Let me know if this proves helpful, or if I can assist you with anything else.

 

 

Best regards,

 

Casandra
지최
Beginner
444 Views

Does that mean I need to modify the code in line 125?

0 Kudos
idata
Employee
444 Views

Hello jiin,

 

 

Yes, you can replace this with code to output to a file instead on line 125. The depth data is stored in the variable: ss.str()

 

 

Please let me know if I can assist with anything else.

 

 

Regards,

 

Casandra
0 Kudos
idata
Employee
444 Views

Hello jiin,

 

 

Was the solution provided helpful, is there anything else I can assist you with?

 

 

Best regards,

 

Casandra
0 Kudos
Reply