diff --git a/camera/ndk/include/camera/NdkCameraMetadataTags.h b/camera/ndk/include/camera/NdkCameraMetadataTags.h index 940ac5fdf4..346761c174 100644 --- a/camera/ndk/include/camera/NdkCameraMetadataTags.h +++ b/camera/ndk/include/camera/NdkCameraMetadataTags.h @@ -2257,7 +2257,7 @@ typedef enum acamera_metadata_tag { * from the main sensor along the +X axis (to the right from the user's perspective) will * report (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 @@ -2269,10 +2269,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, @@ -2382,7 +2382,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 @@ -2390,19 +2390,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 [kappa_0, kappa_1, kappa_2, + *

Three radial distortion coefficients [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 )
      * 
*

Here, [x_c, y_c] are the coordinates to sample in the @@ -2424,40 +2447,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)
      * 
- *

The pixel coordinates are defined in a normalized - * coordinate system related to the - * ACAMERA_LENS_INTRINSIC_CALIBRATION calibration fields. - * Both [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.

+ *

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 [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.

*

Finally, 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).

+ * optical center, 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: - *

    - *
  • ACameraMetadata from ACameraManager_getCameraCharacteristics
  • - *

- * - *

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, /** @@ -4212,7 +4216,7 @@ typedef enum acamera_metadata_tag { * ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE.

*

The currently supported fields that correct for geometric distortion are:

*
    - *
  1. ACAMERA_LENS_RADIAL_DISTORTION.
  2. + *
  3. ACAMERA_LENS_DISTORTION.
  4. *
*

If all of the geometric distortion fields are no-ops, this rectangle will be the same * as the post-distortion-corrected rectangle given in @@ -4224,7 +4228,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).

* - * @see ACAMERA_LENS_RADIAL_DISTORTION + * @see ACAMERA_LENS_DISTORTION * @see ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE * @see ACAMERA_SENSOR_INFO_PIXEL_ARRAY_SIZE * @see ACAMERA_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE @@ -6941,7 +6945,7 @@ typedef enum acamera_metadata_enum_acamera_request_available_capabilities { *
  • ACAMERA_LENS_POSE_TRANSLATION
  • *
  • ACAMERA_LENS_POSE_ROTATION
  • *
  • ACAMERA_LENS_INTRINSIC_CALIBRATION
  • - *
  • ACAMERA_LENS_RADIAL_DISTORTION
  • + *
  • ACAMERA_LENS_DISTORTION
  • * * *
  • The ACAMERA_DEPTH_DEPTH_IS_EXCLUSIVE entry is listed by this device.
  • @@ -6959,12 +6963,12 @@ typedef enum acamera_metadata_enum_acamera_request_available_capabilities { * rate, including depth stall time.

    * * @see ACAMERA_DEPTH_DEPTH_IS_EXCLUSIVE + * @see ACAMERA_LENS_DISTORTION * @see ACAMERA_LENS_FACING * @see ACAMERA_LENS_INTRINSIC_CALIBRATION * @see ACAMERA_LENS_POSE_REFERENCE * @see ACAMERA_LENS_POSE_ROTATION * @see ACAMERA_LENS_POSE_TRANSLATION - * @see ACAMERA_LENS_RADIAL_DISTORTION */ ACAMERA_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8, @@ -6994,7 +6998,7 @@ typedef enum acamera_metadata_enum_acamera_request_available_capabilities { *
  • ACAMERA_LENS_POSE_ROTATION
  • *
  • ACAMERA_LENS_POSE_TRANSLATION
  • *
  • ACAMERA_LENS_INTRINSIC_CALIBRATION
  • - *
  • ACAMERA_LENS_RADIAL_DISTORTION
  • + *
  • ACAMERA_LENS_DISTORTION
  • * * *
  • The SENSOR_INFO_TIMESTAMP_SOURCE of the logical device and physical devices must be @@ -7020,11 +7024,11 @@ typedef enum acamera_metadata_enum_acamera_request_available_capabilities { * not slow down the frame rate of the capture, as long as the minimum frame duration * of the physical and logical streams are the same.

    * + * @see ACAMERA_LENS_DISTORTION * @see ACAMERA_LENS_INTRINSIC_CALIBRATION * @see ACAMERA_LENS_POSE_REFERENCE * @see ACAMERA_LENS_POSE_ROTATION * @see ACAMERA_LENS_POSE_TRANSLATION - * @see ACAMERA_LENS_RADIAL_DISTORTION * @see ACAMERA_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE */ ACAMERA_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11,