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_get_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
- Open sensor with previously calculated intrinsics.
Note that various sensors support different video streams (depth, color, ir). The calibration module performs an intrinsic calibration of one of them. Since release 2.0 by default the alignment of depth and color streams is set to true. This means, that when you want to calibrate the depth, you should actually calibrate color as all depth values will be mapped internally to this video-stream.
The example below illustrates calibrating a real-world sensor
puts("Now running in commercial mode");
} else {
puts("Failed to authenticate.");
}
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 = true];
optional bool zero_radial_k1k2 = 7 [default = true];
optional bool zero_radial_k3 = 8 [default = true];
}
The calibration options are applied when the first image is added (reme_calibrator_add_image).
- 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 int32 width = 1 [default = 640];
optional int32 height = 2 [default = 480];
optional double fx = 3 [default = 571.26];
optional double fy = 4 [default = 571.26];
optional double cx = 5 [default = 320];
optional double cy = 6 [default = 240];
optional double k1 = 7 [default = 0];
optional double k2 = 8 [default = 0];
optional double k3 = 9 [default = 0];
optional double p1 = 10 [default = 0];
optional double p2 = 11 [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.