diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index c17826623..5352f19c5 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -123,6 +123,7 @@ float* RawImageSource::CA_correct_RT( double cared, double cablue, bool avoidColourshift, + int border_crop, array2D &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; diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 238d14769..ce98bee01 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -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 diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 8d68988e0..4ad57b2c7 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -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); } } @@ -6114,7 +6113,7 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double reff_spect_xx_camera[j][repref] = xxx; reff_spect_yy_camera[j][repref] = yyy; reff_spect_Y_camera[j][repref] = YY; - /* + /* //display spectral datas float xr = reff_spect_xx_camera[j][repref]; float yr = reff_spect_yy_camera[j][repref]; @@ -6127,7 +6126,7 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double printf("Nc=%i repref=%i xxx=%f yyy=%f YY=%f Lr=%f a=%f b=%f\n", j, repref, (double) xxx, (double) yyy, (double) YY, (double) Lr/327.68f, (double) ar/327.68f, (double) br/327.68f); - */ + */ } array2D xc(bfwitc, bfhitc); @@ -7354,7 +7353,7 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double avg_gm = optitc[0].avg_g; avg_bm = optitc[0].avg_b; } - } + } } t8.set(); diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index c39be5080..51b7042f8 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -249,6 +249,7 @@ protected: double cared, double cablue, bool avoidColourshift, + int border, array2D &rawData, double* fitParamsTransfer, bool fitParamsIn, diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index e7e038e52..5ef3a777c 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -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");