Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To measure the length of an object #10479

Closed
HyeYumKim opened this issue May 9, 2022 · 7 comments
Closed

To measure the length of an object #10479

HyeYumKim opened this issue May 9, 2022 · 7 comments

Comments

@HyeYumKim
Copy link

HyeYumKim commented May 9, 2022

Required Info
Camera Model D455
Operating System & Version Win 10
Platform PC
Language C/C#/labview/nodejs/opencv/pcl/python/unity

Hello.
I want to measure the volume of an object using the depth sensor of the realsense camera.
I've seen a lot of examples that are provided in sdk.
What I've looked at is box_dimensioner_multicam in Python and rs-measure in c++.
I have a question here, unlike Python code calibration with chessboard, c++ code could measure the length without chessboard calibration. How do you know that's possible?
Also, is the method of obtaining the depth value a stereo method or a TOF method?
Thank you always.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 9, 2022

Hi @HyeYumKim Are you referring to the RealSense SDK's rs-measure example that measures between two points, please?

It is possible to use box_dimensioner_multicam.py with a single camera without the chessboard by editing its source code, as you tested in your past case at #9951

The purpose of the chessboard is to enable the positions of multiple cameras to be calibrated relative to one another.

rs-measure is a single camera application though and so does not require a chessboard, and neither does the similar built-in tool in the RealSense Viewer's 3D point cloud mode which enables the selection of coordinates on a point cloud generated by a single particular camera.

A RealSense user created a Python conversion of rs-measure at https://github.com/soarwing52/RealsensePython/blob/master/separate%20functions/measure_new.py

RealSense 400 Series cameras such as D455 use stereo depth. The L515 lidar camera's method of obtaining depth is similar to Time of Flight (ToF).

@HyeYumKim
Copy link
Author

HyeYumKim commented May 9, 2022

Then, in the example of rs-measure, is it possible to measure the length without using algorithms such as rigid transformation when using a single camera?

@MartyG-RealSense
Copy link
Collaborator

rs-measure only measures between two points, whilst the Viewer version of the tool allows selection of more than 2 points for calculating volumetric measurements.

The script notes say that the program is deprotecting 2D pixels to 3D points and then measuring the Euclidean distance between two points, as shown in the highlighted code at the link below.

https://github.com/IntelRealSense/librealsense/blob/master/examples/measure/rs-measure.cpp#L286-#L295

@HyeYumKim
Copy link
Author

HyeYumKim commented May 10, 2022

If so, does volume measurement run by one camera in Python code run by the same algorithm as c++ code?

@MartyG-RealSense
Copy link
Collaborator

Volume measurement is usually not performed by a built-in camera algorithm or by a RealSense SDK instruction, but instead by maths written by the RealSense user in their script. So in that case, there are likely to be differences in the approaches taken in C++ and in Python to achieve that measurement.

@MartyG-RealSense
Copy link
Collaborator

Hi @HyeYumKim Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants