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??
連結已複製
4 回應
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
