From ddefa9dd59b6ba75fcfb21612060eea1e26a5270 Mon Sep 17 00:00:00 2001
From: Eino-Ville Talvala (0.03, 0, 0)
.
To transform a pixel coordinates between two cameras facing the same direction, first - * the source camera ACAMERA_LENS_RADIAL_DISTORTION must be corrected for. Then the source + * the source camera ACAMERA_LENS_DISTORTION must be corrected for. Then the source * camera ACAMERA_LENS_INTRINSIC_CALIBRATION needs to be applied, followed by the * ACAMERA_LENS_POSE_ROTATION of the source camera, the translation of the source camera * relative to the destination camera, the ACAMERA_LENS_POSE_ROTATION of the destination @@ -2268,10 +2268,10 @@ typedef enum acamera_metadata_tag { *
When ACAMERA_LENS_POSE_REFERENCE is GYROSCOPE, then this position is relative to * the center of the primary gyroscope on the device.
* + * @see ACAMERA_LENS_DISTORTION * @see ACAMERA_LENS_INTRINSIC_CALIBRATION * @see ACAMERA_LENS_POSE_REFERENCE * @see ACAMERA_LENS_POSE_ROTATION - * @see ACAMERA_LENS_RADIAL_DISTORTION */ ACAMERA_LENS_POSE_TRANSLATION = // float[3] ACAMERA_LENS_START + 7, @@ -2381,7 +2381,7 @@ typedef enum acamera_metadata_tag { * where(0,0)
is the top-left of the
* preCorrectionActiveArraySize rectangle. Once the pose and
* intrinsic calibration transforms have been applied to a
- * world point, then the ACAMERA_LENS_RADIAL_DISTORTION
+ * world point, then the ACAMERA_LENS_DISTORTION
* transform needs to be applied, and the result adjusted to
* be in the ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE coordinate
* system (where (0, 0)
is the top-left of the
@@ -2389,19 +2389,42 @@ typedef enum acamera_metadata_tag {
* coordinate of the world point for processed (non-RAW)
* output buffers.
*
+ * @see ACAMERA_LENS_DISTORTION
* @see ACAMERA_LENS_POSE_ROTATION
* @see ACAMERA_LENS_POSE_TRANSLATION
- * @see ACAMERA_LENS_RADIAL_DISTORTION
* @see ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE
* @see ACAMERA_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
*/
ACAMERA_LENS_INTRINSIC_CALIBRATION = // float[5]
ACAMERA_LENS_START + 10,
+ ACAMERA_LENS_RADIAL_DISTORTION = // Deprecated! DO NOT USE
+ ACAMERA_LENS_START + 11,
+ /**
+ * The origin for ACAMERA_LENS_POSE_TRANSLATION.
+ * + * @see ACAMERA_LENS_POSE_TRANSLATION + * + *Type: byte (acamera_metadata_enum_android_lens_pose_reference_t)
+ * + *This tag may appear in: + *
Different calibration methods and use cases can produce better or worse results + * depending on the selected coordinate origin.
+ */ + ACAMERA_LENS_POSE_REFERENCE = // byte (acamera_metadata_enum_android_lens_pose_reference_t) + ACAMERA_LENS_START + 12, /** *The correction coefficients to correct for this camera device's * radial and tangential lens distortion.
+ *Replaces the deprecated ACAMERA_LENS_RADIAL_DISTORTION field, which was + * inconsistently defined.
+ * + * @see ACAMERA_LENS_RADIAL_DISTORTION * - *Type: float[6]
+ *Type: float[5]
* *This tag may appear in: *
Four radial distortion coefficients Three radial distortion coefficients Here, The pixel coordinates are defined in a normalized
- * coordinate system related to the
- * ACAMERA_LENS_INTRINSIC_CALIBRATION calibration fields.
- * Both The pixel coordinates are defined in a coordinate system
+ * related to the ACAMERA_LENS_INTRINSIC_CALIBRATION
+ * calibration fields; see that entry for details of the mapping stages.
+ * Both Finally, [kappa_0, kappa_1, kappa_2,
+ *
[kappa_1, kappa_2,
* kappa_3]
and two tangential distortion coefficients
* [kappa_4, kappa_5]
that can be used to correct the
* lens's geometric distortion with the mapping equations: x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
+ *
* x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
* kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
- * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
+ * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
* kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
*
[x_c, y_c]
are the coordinates to sample in the
@@ -2423,40 +2446,21 @@ typedef enum acamera_metadata_tag {
* corrected image at the coordinate [x_i, y_i]
:
- * correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
*
[x_i, y_i]
and [x_c, y_c]
have (0,0)
at the
- * lens optical center [c_x, c_y]
. The maximum magnitudes
- * of both x and y coordinates are normalized to be 1 at the
- * edge further from the optical center, so the range
- * for both dimensions is -1 <= x <= 1
.[x_i, y_i]
and [x_c, y_c]
+ * have (0,0)
at the lens optical center [c_x, c_y]
, and
+ * the range of the coordinates depends on the focal length
+ * terms of the intrinsic calibration.r
represents the radial distance from the
- * optical center, r^2 = x_i^2 + y_i^2
, and its magnitude
- * is therefore no larger than |r| <= sqrt(2)
.r^2 = x_i^2 + y_i^2
.
The distortion model used is the Brown-Conrady model.
* * @see ACAMERA_LENS_INTRINSIC_CALIBRATION */ - ACAMERA_LENS_RADIAL_DISTORTION = // float[6] - ACAMERA_LENS_START + 11, - /** - *The origin for ACAMERA_LENS_POSE_TRANSLATION.
- * - * @see ACAMERA_LENS_POSE_TRANSLATION - * - *Type: byte (acamera_metadata_enum_android_lens_pose_reference_t)
- * - *This tag may appear in: - *
Different calibration methods and use cases can produce better or worse results - * depending on the selected coordinate origin.
- */ - ACAMERA_LENS_POSE_REFERENCE = // byte (acamera_metadata_enum_android_lens_pose_reference_t) - ACAMERA_LENS_START + 12, + ACAMERA_LENS_DISTORTION = // float[5] + ACAMERA_LENS_START + 13, ACAMERA_LENS_END, /** @@ -4211,7 +4215,7 @@ typedef enum acamera_metadata_tag { * ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE. *The currently supported fields that correct for geometric distortion are:
*If all of the geometric distortion fields are no-ops, this rectangle will be the same * as the post-distortion-corrected rectangle given in @@ -4223,7 +4227,7 @@ typedef enum acamera_metadata_tag { * full array may include black calibration pixels or other inactive regions.
*The data representation is int[4]
, which maps to (left, top, width, height)
.