Camconst support for multiple crops (#6473)

Adapted from ART 
Co-authored-by: Alberto Griggio <agriggio@users.noreply.github.com>

* camconst: support for multiple image sizes in raw_crop and masked_areas
* Clean up code after porting raw crop changes
* fixed raw crop for Canon R6 reduced-resolution raws
* Add Canon EOS R5 1.6 crop raw crop & masked areas
This commit is contained in:
Lawrence37
2023-01-01 01:50:11 -08:00
committed by GitHub
parent 9fef79ede4
commit d74524f2c5
4 changed files with 213 additions and 76 deletions

View File

@@ -70,6 +70,14 @@ Examples:
// cropped so the "negative number" way is not totally safe.
"raw_crop": [ 10, 20, 4000, 3000 ],
// multi-aspect support (added 2020-12-03)
// "frame" defines the full dimensions the crop applies to
// (with [0, 0] being the fallback crop if none of the other applies)
"raw_crop" : [
{ "frame" : [4100, 3050], "crop": [10, 20, 4050, 3020] },
{ "frame" : [0, 0], "crop": [10, 20, 4000, 3000] }
]
// Almost same as MaskedAreas DNG tag, used for black level measuring. Here up to two areas can be defined
// by tetrads of numbers:
"masked_areas": [ 51, 2, 3804, 156, 51, 5794, 3804, 5792 ],
@@ -84,6 +92,14 @@ Examples:
// instead, to take care of possible light leaks from the light sensing area to the optically black (masked)
// area or sensor imperfections at the outer borders.
// multi-aspect support (added 2020-12-03)
// "frame" defines the full dimensions the masked areas apply to
// (with [0, 0] being the fallback crop if none of the other applies)
"masked_areas" : [
{ "frame" : [4100, 3050], "areas": [10, 20, 4050, 3020] },
{ "frame" : [0, 0], "areas": [10, 20, 4000, 3000] }
]
// list of indices of the rows with on-sensor PDAF pixels, for cameras that have such features. The indices here form a pattern that is repeated for the whole height of the sensor. The values are relative to the "pdaf_offset" value (see below)
"pdaf_pattern" : [ 0,12,36,54,72,90,114,126,144,162,180,204,216,240,252,270,294,306,324,342,366,384,396,414,432,450,474,492,504,522,540,564,576,594,606,630 ],
// index of the first row of the PDAF pattern in the sensor (0 is the topmost row). Allowed to be negative for convenience (this means that the first repetition of the pattern doesn't start from the first row)
@@ -1216,16 +1232,28 @@ Camera constants:
{ // Quality C
"make_model": "Canon EOS R5",
"dcraw_matrix" : [9766, -2953, -1254, -4276, 12116, 2433, -437, 1336, 5131],
"raw_crop" : [ 128, 96, 8224, 5490 ],
"masked_areas" : [ 94, 20, 5578, 122 ],
"raw_crop" : [
{ "frame" : [ 8352, 5586 ], "crop" : [ 128, 96, 8224, 5490 ] },
{ "frame" : [ 5248, 3510 ], "crop" : [ 128, 96, 5120, 3382 ] }
],
"masked_areas" : [
{ "frame" : [ 8352, 5586 ], "areas": [ 94, 20, 5578, 122 ] },
{ "frame" : [ 5248, 3510 ], "areas": [ 94, 20, 3510, 122 ] }
],
"ranges" : { "white" : 16382 }
},
{ // Quality C
"make_model": "Canon EOS R6",
"dcraw_matrix" : [8293, -1611, -1132, -4759, 12710, 2275, -1013, 2415, 5508],
"raw_crop": [ 72, 38, 5496, 3670 ],
"masked_areas" : [ 40, 10, 5534, 70 ],
"raw_crop": [
{ "frame": [5568, 3708], "crop" : [ 72, 38, 5496, 3670 ] },
{ "frame": [3584, 2386], "crop" : [ 156, 108, 3404, 2270 ] }
],
"masked_areas" : [
{ "frame": [5568, 3708], "areas": [ 40, 10, 5534, 70 ] },
{ "frame": [3584, 2386], "areas": [ 40, 10, 2374, 110 ] }
],
"ranges" : { "white" : 16382 }
},
@@ -1381,7 +1409,11 @@ Camera constants:
{ // Quality C
"make_model": [ "FUJIFILM GFX 100", "FUJIFILM GFX100S" ],
"dcraw_matrix" : [ 16212, -8423, -1583, -4336, 12583, 1937, -195, 726, 6199 ], // taken from ART
"raw_crop": [ 0, 2, 11664, 8734 ]
"raw_crop": [
// multi-aspect crop to account for 16-shot pixel shift images
{ "frame" : [11808, 8754], "crop" : [ 0, 2, 11664, 8734 ] },
{ "frame" : [23616, 17508], "crop" : [ 0, 4, 23328, 17468 ] }
]
},
{ // Quality B