Merge pull request #6778 from Lawrence37/eos-7d-markii-raw-crop
Improved raw crop for Canon EOS 7D Mark II
This commit is contained in:
@@ -123,6 +123,7 @@ float* RawImageSource::CA_correct_RT(
|
||||
double cared,
|
||||
double cablue,
|
||||
bool avoidColourshift,
|
||||
int border_crop,
|
||||
array2D<float> &rawData,
|
||||
double* fitParamsTransfer,
|
||||
bool fitParamsIn,
|
||||
@@ -145,7 +146,7 @@ float* RawImageSource::CA_correct_RT(
|
||||
const unsigned int cfa[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}};
|
||||
constexpr int ts = 128;
|
||||
constexpr int tsh = ts / 2;
|
||||
constexpr int cb = 2; // 2 pixels border will be excluded from correction
|
||||
const int cb = border_crop;
|
||||
|
||||
//shifts to location of vertical and diagonal neighbours
|
||||
constexpr int v1 = ts, v2 = 2 * ts, v3 = 3 * ts, v4 = 4 * ts; //, p1=-ts+1, p2=-2*ts+2, p3=-3*ts+3, m1=ts+1, m2=2*ts+2, m3=3*ts+3;
|
||||
|
||||
@@ -647,6 +647,7 @@ Camera constants:
|
||||
"make_model": "Canon EOS 7D Mark II",
|
||||
"dcraw_matrix": [ 7268,-1082,-969,-4186,11839,2663,-825,2029,5839 ], // dng_v8.7 d65
|
||||
//"dcraw_matrix": [ 6285,-147,-821,-4080,11695,2714,-1045,2459,5497 ], // DXO D50
|
||||
"raw_crop": [ 72, 38, 5496, 3669 ],
|
||||
"ranges": {
|
||||
"white": [
|
||||
{ "iso": [ 100, 125 ], "levels": 13500 }, // typical 13583 - LENR 13550
|
||||
|
||||
@@ -1697,15 +1697,14 @@ void RawImageSource::preprocess(const RAWParams &raw, const LensProfParams &lens
|
||||
|
||||
if (numFrames == 4) {
|
||||
double fitParams[64];
|
||||
float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false, options.chunkSizeCA, options.measure);
|
||||
|
||||
float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, raw.bayersensor.border, *rawDataFrames[0], fitParams, false, true, nullptr, false, options.chunkSizeCA, options.measure);
|
||||
for (int i = 1; i < 3; ++i) {
|
||||
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false, options.chunkSizeCA, options.measure);
|
||||
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, raw.bayersensor.border, *rawDataFrames[i], fitParams, true, false, buffer, false, options.chunkSizeCA, options.measure);
|
||||
}
|
||||
|
||||
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true, options.chunkSizeCA, options.measure);
|
||||
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, raw.bayersensor.border, *rawDataFrames[3], fitParams, true, false, buffer, true, options.chunkSizeCA, options.measure);
|
||||
} else {
|
||||
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true, options.chunkSizeCA, options.measure);
|
||||
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, raw.bayersensor.border, rawData, nullptr, false, false, nullptr, true, options.chunkSizeCA, options.measure);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -249,6 +249,7 @@ protected:
|
||||
double cared,
|
||||
double cablue,
|
||||
bool avoidColourshift,
|
||||
int border,
|
||||
array2D<float> &rawData,
|
||||
double* fitParamsTransfer,
|
||||
bool fitParamsIn,
|
||||
|
||||
@@ -36,7 +36,7 @@ BayerProcess::BayerProcess () :
|
||||
{
|
||||
|
||||
auto m = ProcEventMapper::getInstance();
|
||||
EvDemosaicBorder = m->newEvent(DEMOSAIC, "HISTORY_MSG_RAW_BORDER");
|
||||
EvDemosaicBorder = m->newEvent(DARKFRAME, "HISTORY_MSG_RAW_BORDER");
|
||||
EvDemosaicContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_CONTRAST");
|
||||
EvDemosaicAutoContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST");
|
||||
EvDemosaicPixelshiftDemosaicMethod = m->newEvent(DEMOSAIC, "HISTORY_MSG_PIXELSHIFT_DEMOSAIC");
|
||||
|
||||
Reference in New Issue
Block a user