Computing distance between two pixel location using depth information
Hi, perhaps this question has been asked before but I can't find the answer.
I'm trying to compute the distance between two points (pixel coordinates) based on their depth distance from the camera. I found information on how to calculate depth distance of each point (pixel location) and how to compute distance measurement between 2 points in C++, but I'm not familiar with C++. I'd really appreciate if any one can show me how to do this using python functions.
In addition, is there any function in python for me to check the pre-set setting used to capture the videos being process. I used different pre-set settings of depth camera D435i to capture my data (in video form), but I lost track of the pre-set setting of each video. Now that I'm doing processing of the recorded data, I need to figure out the pre-set settings of the videos to compare the results
-
As far as I know there is not an official equivalent of the C++ "Measure" example for measuring between two points with Python. A RealSense community member called Soarwing52 did convert "Measure" to Python though. The most recent version of that code is in the link below.
https://github.com/soarwing52/RealsensePython/blob/master/separate%20functions/measure_new.py
If there were a way to check the current preset, I would guess it would be to check the description value of RS2_OPTION_VISUAL_PRESET like in the example C++ line below.
const char* preset_desc = rs2_get_option_value_description((const rs2_options*)sen, RS2_OPTION_VISUAL_PRESET, pres, &e);
I recommend asking at the RealSense GitHub forum for a Python version of that, by visiting the link below and clicking the New Issue button to post a question.
https://github.com/IntelRealSense/librealsense/issues
Please sign in to leave a comment.
Comments
1 comment