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

Focal length calibration #10286

Closed
shphilippe opened this issue Mar 3, 2022 · 5 comments
Closed

Focal length calibration #10286

shphilippe opened this issue Mar 3, 2022 · 5 comments

Comments

@shphilippe
Copy link

Required Info
Camera Model D410
Firmware Version 5.12.07.150
Operating System & Version Ubuntu 18.04.5
Kernel Version (Linux Only) 4.15.0-122-generic
Platform PC Lenovo Thinkpad T480
SDK Version 2.50.0-0~realsense0.6128
Language Python
Segment Robot

Issue Description

In the last Realsense SDK release not, the following note seems very interesting for my usecase:
"As part of the Self-Calibration refactoring, Focal-Length calibration and Tare Target-based distance calculation were introduced, that require a printed target to be provided (Target_for_print)."

When I read the self calibration white paper, nothing is describing the focal-length calibration and nothing is describing the calibration target linked in the release note.

Is any additional information available ? What should be the exact size of the calibration target when printed ? what is the optimal distance when performing the calibration ? is there any more info on what exactly this is calibrating: fx,fy independently or both with the same ratio ? Should we/can we do this calibration in combinaison of other calibration such as the On chip extrinsic calibration or the dynamic calibration ? What is the difference between the tare calibration and the focal length calibration: I suspect one is just adding an offset to the distance, the other is changing the real focal length ? How much is the typical change in the focal length ? (0.1-0.2%, 1-2% etc ...)

Thanks !

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 3, 2022

Hi @shphilippe There is further information in the API Changes notes about the focal length calibration that has been introduced in SDK version 2.50.0.

https://github.com/IntelRealSense/librealsense/wiki/API-Changes#version-2500

A recent question and answer from a Tare expert on the RealSense team at #10213 (comment) may also be helpful.

I will attempt to cover some of your questions that the Q&A above may not address.

The page dimensions of the print target PDF document for focial length calibration in the 2.50.0 release notes is 11 x 8.5", according to my PDF reader tool (note that it is displayed in side-on landscape orientation rather than 8.5x11" US Letter)

image

As you are using a D410 Depth Module Kit without an RGB sensor then you would not benefit from the RGB calibration that the Dynamic Calibration tool provides. Using On-Chip, Tare and Focal Length calibration and not using Dynamic Calibration is therefore likely to be the most appropriate approach for you.

In regard to your questions "what exactly this is calibrating" and "what is the difference between the tare calibration and the focal length calibration", I do not currently have information available about those queries.

@shphilippe
Copy link
Author

Based on the source code (common/on-chip-calib.cpp:934), the default target size is: width: 175.0mm; height: 100.0mm.
But according to realsense-viewer, it's 138mm by 82mm. Which one is better ? can I print a bigger calibration target in order to have a more precise calibration ? Why the region of interest is so small ?
What is the best distance to have the most bias-free calibration ?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 4, 2022

I have not got a D410 to test with. I tested the focal length calibration option in the Viewer with a D415, D435i and D455 though and in all three cases the default target measurements were width 175 mm and height 100 mm.

image

My experience of cases where a custom calibration target image size has been used suggests that it can worsen accuracy and it is best to use the officially provided target images.

My interpretation of the advice by Intel's Tare expert in #10213 (comment) is that a 20% sized ROI is the one that provides the most consistency and can be used for all camera distances from the target, but you can multiply the ROI size for every 0.5 meters that the camera is from the target - for example, use 20% ROI at 0.5 m but if the camera is 1.5 m away then you can multiply the 20% ROI size by 3 (because 0.5 m x 3 = 1.5 m).

In regard to the best distance: whilst I do not have a precise value to suggest, in general the noise (and thus the depth measuring error) on the image will increase over distance as the camera becomes further away from the observed surface. The D415 model has around 2x less noise over distance than the D435 / D435i model, and so that D415 error level should apply to the D410 too.

The chart for RMS Error (error over distance) below shows D415 error over distance as the lower green line compared to the upper orange line for D435 / D435i that has higher error over distance.

image

@shphilippe
Copy link
Author

thank you for this detailed answer. The difference in realsense viewer is probably caused by me playing with the parameter and realsense viewer remembering the last value.

@MartyG-RealSense
Copy link
Collaborator

You are very welcome, @shphilippe - thanks for the update!

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