Provides intrinsic camera calibration.
More...
|
typedef int | reme_calibrator_t |
| Handle referencing a calibrator.
|
|
reme_error_t | reme_calibrator_create (reme_context_t c, reme_calibrator_t *cb) |
| Create a new calibration object.
|
|
reme_error_t | reme_calibrator_destroy (reme_context_t c, reme_calibrator_t *cb) |
| Destroy a previously created calibrator object.
|
|
reme_error_t | reme_calibrator_bind_options (reme_context_t c, reme_calibrator_t cb, reme_options_t o) |
| Access the calibration options.
|
|
reme_error_t | reme_calibrator_add_image (reme_context_t c, reme_calibrator_t cb, reme_image_t i) |
| Add a new image of the calibration target.
|
|
reme_error_t | reme_calibrator_update_detection_image (reme_context_t c, reme_calibrator_t cb, reme_image_t i) |
| Receives the result image of the last image added.
|
|
reme_error_t | reme_calibrator_calibrate (reme_context_t c, reme_calibrator_t cb, float *reprojection_error=0) |
| Calibrate using the images added before.
|
|
reme_error_t | reme_calibrator_bind_intrinsics (reme_context_t c, reme_calibrator_t cb, reme_options_t o) |
| Access the calibration results.
|
|
Provides intrinsic camera calibration.
This modules provides methods to estimate the intrinsic sensor parameters. The basic workflow to calibrate your sensor and use the estimate values to correct distortion is
- Use estimated Parameters
- Enable
enable_distortion_correction
(reme_context_bind_compile_options) in case you intend to use radial and tangential distortion terms.
- Open sensor with previously calculated intrinsics.
The example below illustrates calibrating a real-world sensor
bool continue_grabbing = true;
{
if (_kbhit()) {
char k = _getch();
switch(k) {
case 's':
{
break;
}
case 'c' :
{
continue_grabbing = false;
break;
}
}
}
}
float accuracy;
printf("Reprojection error: %f pixels \n", accuracy);
} else{
puts("Calibration failed");
}
Handle referencing a calibrator.
Calibration determines a sensors' intrinsic parameters. Besides the focal length and principal point, also the radial and tangential distortion parameters are calculated. For this to work one has to specify a set of images of a known calibration target. Currently the common chessboard target is supported.
Create a new calibration object.
- Parameters
-
c | A valid context object |
cb | A pointer that will receive the handle of the created calibration object |
- Return values
-
- Examples:
- example_reconstructmesdk_calibration.cpp.
Destroy a previously created calibrator object.
- Parameters
-
c | A pointer to a valid context object |
cb | A mutable pointer to a valid calibrator handle to destroy |
- Return values
-
Access the calibration options.
- Associated Protocol Buffers Specification
message calibration_options {
optional int32 inner_count_width = 1 [default = 10];
optional int32 inner_count_height = 2 [default = 7];
optional float length_square_side = 3 [default = 33.876];
optional int32 refine_width = 4 [default = 5];
optional int32 refine_height = 5 [default = 5];
optional bool zero_tangential = 6 [default = false];
optional bool zero_k3 = 7 [default = true];
}
- Parameters
-
c | A valid context object |
cb | A valid calibration object |
o | A valid options binding object |
- Return values
-
Add a new image of the calibration target.
To receive the best results
- Make sure the calibration target covers most of the image.
- Make sure to supply images taken from different angles.
- Supply between 10 - 20 images.
- Parameters
-
c | A valid context object |
cb | A valid calibration object |
i | A valid image object |
- Return values
-
- Examples:
- example_reconstructmesdk_calibration.cpp.
Receives the result image of the last image added.
- Parameters
-
c | A valid context object |
cb | A valid calibration object |
i | A valid image object |
- Return values
-
- Examples:
- example_reconstructmesdk_calibration.cpp.
Calibrate using the images added before.
The result of a successful calibration is are new intrinsic settings. Use
- Parameters
-
c | A valid context object |
cb | A valid calibration object |
reprojection_error | If not null, the reprojection error of the calibration. |
- Return values
-
- Examples:
- example_reconstructmesdk_calibration.cpp.
Access the calibration results.
The results are provided as a new intrincis options set.
- Associated Protocol Buffers Specification
package LibRGBDSensor;
message intrinsics {
optional double fx = 1 [default = 571.26];
optional double fy = 2 [default = 571.26];
optional double cx = 3 [default = 320];
optional double cy = 4 [default = 240];
optional double k1 = 5 [default = 0];
optional double k2 = 6 [default = 0];
optional double k3 = 7 [default = 0];
optional double p1 = 8 [default = 0];
optional double p2 = 9 [default = 0];
}
- Parameters
-
c | A valid context object |
cb | A valid calibration object |
o | A valid options binding object |
- Return values
-
- Examples:
- example_reconstructmesdk_calibration.cpp.