From d089ee6902fe06695c119368e05339f6ea2ad402 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Thu, 2 Jun 2016 14:15:56 -0700 Subject: [PATCH] Camera: Update lensShadingMap documentation and visibility Revert added language about shading map being the full flat-field correction; it's actually the same correction as applied to camera device-processed data. Remove the Java lens shading map key from the NDK, since it's a duplicate of the underlying native key already in NDK. Also fix a few other wording issues in the lens shading documentation. Bug: 18175853 Change-Id: I227707671914eb17b0a0dd14655ea732aae2a6b7 --- camera/docs/docs.html | 54 +++++++++++++++---------- camera/docs/metadata_properties.xml | 59 ++++++++++++++++++---------- camera/docs/ndk_metadata_properties.xml | 59 ++++++++++++++++++---------- camera/include/system/camera_metadata_tags.h | 2 +- 4 files changed, 110 insertions(+), 64 deletions(-) diff --git a/camera/docs/docs.html b/camera/docs/docs.html index 7bb61813..bacc566b 100644 --- a/camera/docs/docs.html +++ b/camera/docs/docs.html @@ -23507,7 +23507,7 @@ generation

byte - [public as lensShadingMap] + [java_public as lensShadingMap] [full] @@ -23539,10 +23539,21 @@ Bayer color channel.

-

The least shaded section of the image should have a gain factor -of 1; all other sections should have gains above 1.

+

The map provided here is the same map that is used by the camera device to +correct both color shading and vignetting for output non-RAW images.

+

When there is no lens shading correction applied to RAW +output images (android.sensor.info.lensShadingApplied == +false), this map is the complete lens shading correction +map; when there is some lens shading correction applied to +the RAW output image (android.sensor.info.lensShadingApplied== true), this map reports the remaining lens shading +correction map that needs to be applied to get shading +corrected images that match the camera device's output for +non-RAW formats.

+

For a complete shading correction map, the least shaded +section of the image will have a gain factor of 1; all +other sections will have gains above 1.

When android.colorCorrection.mode = TRANSFORM_MATRIX, the map -must take into account the colorCorrection settings.

+will take into account the colorCorrection settings.

The shading map is for the entire active pixel array, and is not affected by the crop region specified in the request. Each shading map entry is the value of the shading compensation map over a specific @@ -23554,8 +23565,8 @@ The map is assumed to be bilinearly interpolated between the sample points.The channel order is [R, Geven, Godd, B], where Geven is the green channel for the even rows of a Bayer pattern, and Godd is the odd rows. The shading map is stored in a fully interleaved format.

-

The shading map should have on the order of 30-40 rows and columns, -and must be smaller than 64x64.

+

The shading map will generally have on the order of 30-40 rows and columns, +and will be smaller than 64x64.

As an example, given a very small map defined as:

width,height = [ 4, 3 ]
 values =
@@ -23628,20 +23639,21 @@ for each Bayer color channel of RAW image data.

-

The lens shading correction is defined as a full shading correction that -corrects both color shading for the output non-RAW images. After the -shading map is applied, the output non-RAW images will be flat-field images -for flat scenes under uniform illumination.

-

When there is no lens shading correction applied to RAW output images -(android.sensor.info.lensShadingApplied == false), this map is a full lens -shading correction map; when there is some lens shading correction applied -to the RAW output image (android.sensor.info.lensShadingApplied == true), -this map reports the remaining lens shading correction map that needs to be -applied to get fully shading corrected images.

-

For a full shading correction map, the least shaded section of the image -should have a gain factor of 1; all other sections should have gains above 1.

+

The map provided here is the same map that is used by the camera device to +correct both color shading and vignetting for output non-RAW images.

+

When there is no lens shading correction applied to RAW +output images (android.sensor.info.lensShadingApplied == +false), this map is the complete lens shading correction +map; when there is some lens shading correction applied to +the RAW output image (android.sensor.info.lensShadingApplied== true), this map reports the remaining lens shading +correction map that needs to be applied to get shading +corrected images that match the camera device's output for +non-RAW formats.

+

For a complete shading correction map, the least shaded +section of the image will have a gain factor of 1; all +other sections will have gains above 1.

When android.colorCorrection.mode = TRANSFORM_MATRIX, the map -must take into account the colorCorrection settings.

+will take into account the colorCorrection settings.

The shading map is for the entire active pixel array, and is not affected by the crop region specified in the request. Each shading map entry is the value of the shading compensation map over a specific @@ -23654,8 +23666,8 @@ The map is assumed to be bilinearly interpolated between the sample points. and Godd is the odd rows. The shading map is stored in a fully interleaved format, and its size is provided in the camera static metadata by android.lens.info.shadingMapSize.

-

The shading map should have on the order of 30-40 rows and columns, -and must be smaller than 64x64.

+

The shading map will generally have on the order of 30-40 rows and columns, +and will be smaller than 64x64.

As an example, given a very small map defined as:

android.lens.info.shadingMapSize = [ 4, 3 ]
 android.statistics.lensShadingMap =
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 8071bec1..e7f4a5ba 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -7618,17 +7618,32 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
         
         
-        
           The shading map is a low-resolution floating-point map
           that lists the coefficients used to correct for vignetting, for each
           Bayer color channel.
           Each gain factor is >= 1
-          
The least shaded section of the image should have a gain factor - of 1; all other sections should have gains above 1. +
+ The map provided here is the same map that is used by the camera device to + correct both color shading and vignetting for output non-RAW images. + + When there is no lens shading correction applied to RAW + output images (android.sensor.info.lensShadingApplied `==` + false), this map is the complete lens shading correction + map; when there is some lens shading correction applied to + the RAW output image (android.sensor.info.lensShadingApplied + `==` true), this map reports the remaining lens shading + correction map that needs to be applied to get shading + corrected images that match the camera device's output for + non-RAW formats. + + For a complete shading correction map, the least shaded + section of the image will have a gain factor of 1; all + other sections will have gains above 1. When android.colorCorrection.mode = TRANSFORM_MATRIX, the map - must take into account the colorCorrection settings. + will take into account the colorCorrection settings. The shading map is for the entire active pixel array, and is not affected by the crop region specified in the request. Each shading map @@ -7643,8 +7658,8 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata channel for the even rows of a Bayer pattern, and Godd is the odd rows. The shading map is stored in a fully interleaved format. - The shading map should have on the order of 30-40 rows and columns, - and must be smaller than 64x64. + The shading map will generally have on the order of 30-40 rows and columns, + and will be smaller than 64x64. As an example, given a very small map defined as: @@ -7684,23 +7699,25 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata for each Bayer color channel of RAW image data. Each gain factor is >= 1
- The lens shading correction is defined as a full shading correction that - corrects both color shading for the output non-RAW images. After the - shading map is applied, the output non-RAW images will be flat-field images - for flat scenes under uniform illumination. + The map provided here is the same map that is used by the camera device to + correct both color shading and vignetting for output non-RAW images. - When there is no lens shading correction applied to RAW output images - (android.sensor.info.lensShadingApplied `==` false), this map is a full lens - shading correction map; when there is some lens shading correction applied - to the RAW output image (android.sensor.info.lensShadingApplied `==` true), - this map reports the remaining lens shading correction map that needs to be - applied to get fully shading corrected images. + When there is no lens shading correction applied to RAW + output images (android.sensor.info.lensShadingApplied `==` + false), this map is the complete lens shading correction + map; when there is some lens shading correction applied to + the RAW output image (android.sensor.info.lensShadingApplied + `==` true), this map reports the remaining lens shading + correction map that needs to be applied to get shading + corrected images that match the camera device's output for + non-RAW formats. - For a full shading correction map, the least shaded section of the image - should have a gain factor of 1; all other sections should have gains above 1. + For a complete shading correction map, the least shaded + section of the image will have a gain factor of 1; all + other sections will have gains above 1. When android.colorCorrection.mode = TRANSFORM_MATRIX, the map - must take into account the colorCorrection settings. + will take into account the colorCorrection settings. The shading map is for the entire active pixel array, and is not affected by the crop region specified in the request. Each shading map @@ -7716,8 +7733,8 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata The shading map is stored in a fully interleaved format, and its size is provided in the camera static metadata by android.lens.info.shadingMapSize. - The shading map should have on the order of 30-40 rows and columns, - and must be smaller than 64x64. + The shading map will generally have on the order of 30-40 rows and columns, + and will be smaller than 64x64. As an example, given a very small map defined as: diff --git a/camera/docs/ndk_metadata_properties.xml b/camera/docs/ndk_metadata_properties.xml index c56732e8..a424c3de 100644 --- a/camera/docs/ndk_metadata_properties.xml +++ b/camera/docs/ndk_metadata_properties.xml @@ -7628,17 +7628,32 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata - The shading map is a low-resolution floating-point map that lists the coefficients used to correct for vignetting, for each Bayer color channel. Each gain factor is >= 1 -
The least shaded section of the image should have a gain factor - of 1; all other sections should have gains above 1. +
+ The map provided here is the same map that is used by the camera device to + correct both color shading and vignetting for output non-RAW images. + + When there is no lens shading correction applied to RAW + output images (android.sensor.info.lensShadingApplied `==` + false), this map is the complete lens shading correction + map; when there is some lens shading correction applied to + the RAW output image (android.sensor.info.lensShadingApplied + `==` true), this map reports the remaining lens shading + correction map that needs to be applied to get shading + corrected images that match the camera device's output for + non-RAW formats. + + For a complete shading correction map, the least shaded + section of the image will have a gain factor of 1; all + other sections will have gains above 1. When android.colorCorrection.mode = TRANSFORM_MATRIX, the map - must take into account the colorCorrection settings. + will take into account the colorCorrection settings. The shading map is for the entire active pixel array, and is not affected by the crop region specified in the request. Each shading map @@ -7653,8 +7668,8 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata channel for the even rows of a Bayer pattern, and Godd is the odd rows. The shading map is stored in a fully interleaved format. - The shading map should have on the order of 30-40 rows and columns, - and must be smaller than 64x64. + The shading map will generally have on the order of 30-40 rows and columns, + and will be smaller than 64x64. As an example, given a very small map defined as: @@ -7694,23 +7709,25 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata for each Bayer color channel of RAW image data. Each gain factor is >= 1
- The lens shading correction is defined as a full shading correction that - corrects both color shading for the output non-RAW images. After the - shading map is applied, the output non-RAW images will be flat-field images - for flat scenes under uniform illumination. + The map provided here is the same map that is used by the camera device to + correct both color shading and vignetting for output non-RAW images. - When there is no lens shading correction applied to RAW output images - (android.sensor.info.lensShadingApplied `==` false), this map is a full lens - shading correction map; when there is some lens shading correction applied - to the RAW output image (android.sensor.info.lensShadingApplied `==` true), - this map reports the remaining lens shading correction map that needs to be - applied to get fully shading corrected images. + When there is no lens shading correction applied to RAW + output images (android.sensor.info.lensShadingApplied `==` + false), this map is the complete lens shading correction + map; when there is some lens shading correction applied to + the RAW output image (android.sensor.info.lensShadingApplied + `==` true), this map reports the remaining lens shading + correction map that needs to be applied to get shading + corrected images that match the camera device's output for + non-RAW formats. - For a full shading correction map, the least shaded section of the image - should have a gain factor of 1; all other sections should have gains above 1. + For a complete shading correction map, the least shaded + section of the image will have a gain factor of 1; all + other sections will have gains above 1. When android.colorCorrection.mode = TRANSFORM_MATRIX, the map - must take into account the colorCorrection settings. + will take into account the colorCorrection settings. The shading map is for the entire active pixel array, and is not affected by the crop region specified in the request. Each shading map @@ -7726,8 +7743,8 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata The shading map is stored in a fully interleaved format, and its size is provided in the camera static metadata by android.lens.info.shadingMapSize. - The shading map should have on the order of 30-40 rows and columns, - and must be smaller than 64x64. + The shading map will generally have on the order of 30-40 rows and columns, + and will be smaller than 64x64. As an example, given a very small map defined as: diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h index 443af403..81dac877 100644 --- a/camera/include/system/camera_metadata_tags.h +++ b/camera/include/system/camera_metadata_tags.h @@ -347,7 +347,7 @@ typedef enum camera_metadata_tag { ANDROID_STATISTICS_FACE_SCORES, // byte[] | ndk_public ANDROID_STATISTICS_HISTOGRAM, // int32[] | system ANDROID_STATISTICS_SHARPNESS_MAP, // int32[] | system - ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP, // byte | public + ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP, // byte | java_public ANDROID_STATISTICS_LENS_SHADING_MAP, // float[] | ndk_public ANDROID_STATISTICS_PREDICTED_COLOR_GAINS, // float[] | hidden ANDROID_STATISTICS_PREDICTED_COLOR_TRANSFORM, // rational[] | hidden -- 2.11.0