raw ca correction: beautified code

This commit is contained in:
heckflosse 2018-09-08 00:52:39 +02:00
parent becfc1a9fd
commit 09796f0694
3 changed files with 152 additions and 144 deletions

View File

@ -1,11 +1,11 @@
////////////////////////////////////////////////////////////////
//
// Chromatic Aberration Auto-correction
// Chromatic Aberration correction on raw bayer cfa data
//
// copyright (c) 2008-2010 Emil Martinec <ejmartin@uchicago.edu>
// copyright (c) for improvements (speedups, iterated correction and avoid colour shift) 2018 Ingo Weyrich <heckflosse67@gmx.de>
//
//
// code dated: November 26, 2010
// code dated: September 8, 2018
//
// CA_correct_RT.cc is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -21,7 +21,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#include "rtengine.h"
#include "rawimagesource.h"
@ -106,8 +105,6 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution)
return true;
}
//end of linear equation solver
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
using namespace std;
@ -118,7 +115,6 @@ float* RawImageSource::CA_correct_RT(
size_t autoIterations,
double cared,
double cablue,
double caautostrength,
bool avoidColourshift,
const array2D<float> &rawData,
double* fitParamsTransfer,
@ -132,18 +128,19 @@ float* RawImageSource::CA_correct_RT(
// multithreaded and vectorized by Ingo Weyrich
constexpr int ts = 128;
constexpr int tsh = ts / 2;
//shifts to location of vertical and diagonal neighbors
//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;
// Test for RGB cfa
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
if (FC(i, j) == 3) {
printf("CA correction supports only RGB Colour filter arrays\n");
std::cout << "CA correction supports only RGB Colour filter arrays" << std::endl;
return buffer;
}
}
}
array2D<float>* oldraw = nullptr;
if (avoidColourshift) {
// copy raw values before ca correction
@ -245,23 +242,24 @@ float* RawImageSource::CA_correct_RT(
//rgb data in a tile
float* rgb[3];
rgb[0] = (float (*)) data;
rgb[1] = (float (*)) (data + sizeof(float) * ts * tsh + 1 * 64);
rgb[2] = (float (*)) (data + sizeof(float) * (ts * ts + ts * tsh) + 2 * 64);
rgb[0] = (float*) data;
rgb[1] = (float*) (data + sizeof(float) * ts * tsh + 1 * 64);
rgb[2] = (float*) (data + sizeof(float) * (ts * ts + ts * tsh) + 2 * 64);
if (autoCA && !fitParamsSet) {
constexpr float caAutostrength = 8.f;
//high pass filter for R/B in vertical direction
float *rbhpfh = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64);
float* rbhpfh = (float*) (data + 2 * sizeof(float) * ts * ts + 3 * 64);
//high pass filter for R/B in horizontal direction
float *rbhpfv = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64);
float* rbhpfv = (float*) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64);
//low pass filter for R/B in horizontal direction
float *rblpfh = (float (*)) (data + 3 * sizeof(float) * ts * ts + 5 * 64);
float* rblpfh = (float*) (data + 3 * sizeof(float) * ts * ts + 5 * 64);
//low pass filter for R/B in vertical direction
float *rblpfv = (float (*)) (data + 3 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 6 * 64);
float* rblpfv = (float*) (data + 3 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 6 * 64);
//low pass filter for colour differences in horizontal direction
float *grblpfh = (float (*)) (data + 4 * sizeof(float) * ts * ts + 7 * 64);
float* grblpfh = (float*) (data + 4 * sizeof(float) * ts * ts + 7 * 64);
//low pass filter for colour differences in vertical direction
float *grblpfv = (float (*)) (data + 4 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 8 * 64);
float* grblpfv = (float*) (data + 4 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 8 * 64);
// Main algorithm: Tile loop calculating correction parameters per tile
//local quadratic fit to shift data within a tile
@ -270,14 +268,16 @@ float* RawImageSource::CA_correct_RT(
float CAshift[2][2];
//per thread data for evaluation of block CA shift variance
float blockavethr[2][2] = {{0, 0}, {0, 0}}, blocksqavethr[2][2] = {{0, 0}, {0, 0}}, blockdenomthr[2][2] = {{0, 0}, {0, 0}};
float blockavethr[2][2] = {};
float blocksqavethr[2][2] = {};
float blockdenomthr[2][2] = {};
#pragma omp for collapse(2) schedule(dynamic) nowait
for (int top = -border ; top < height; top += ts - border2)
for (int top = -border ; top < height; top += ts - border2) {
for (int left = -border; left < width - (W & 1); left += ts - border2) {
memset(bufferThr, 0, buffersize);
const int vblock = ((top + border) / (ts - border2)) + 1;
const int hblock = ((left + border) / (ts - border2)) + 1;
const int vblock = (top + border) / (ts - border2) + 1;
const int hblock = (left + border) / (ts - border2) + 1;
const int bottom = min(top + ts, height + border);
const int right = min(left + ts, width - (W & 1) + border);
const int rr1 = bottom - top;
@ -324,78 +324,83 @@ float* RawImageSource::CA_correct_RT(
}
}
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//fill borders
if (rrmin > 0) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = ccmin; cc < ccmax; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)];
}
}
}
if (rrmax < rr1) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = ccmin; cc < ccmax; cc++) {
int c = FC(rr, cc);
rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][left + cc] / 65535.f;
}
}
}
if (ccmin > 0) {
for (int rr = rrmin; rr < rrmax; rr++)
for (int rr = rrmin; rr < rrmax; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)];
}
}
}
if (ccmax < cc1) {
for (int rr = rrmin; rr < rrmax; rr++)
for (int rr = rrmin; rr < rrmax; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(top + rr)][(width - cc - 2)] / 65535.f;
}
}
}
//also, fill the image corners
if (rrmin > 0 && ccmin > 0) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rawData[border2 - rr][border2 - cc] / 65535.f;
}
}
}
if (rrmax < rr1 && ccmax < cc1) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(width - cc - 2)] / 65535.f;
}
}
}
if (rrmin > 0 && ccmax < cc1) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(border2 - rr)][(width - cc - 2)] / 65535.f;
}
}
}
if (rrmax < rr1 && ccmin > 0) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(border2 - cc)] / 65535.f;
}
}
}
//end of border fill
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//end of initialization
#ifdef __SSE2__
vfloat onev = F2V(1.f);
vfloat epsv = F2V(eps);
@ -449,9 +454,8 @@ float* RawImageSource::CA_correct_RT(
Gtmp[(row * width + col) >> 1] = rgb[1][indx];
}
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#ifdef __SSE2__
vfloat zd25v = F2V(0.25f);
#endif
@ -486,7 +490,6 @@ float* RawImageSource::CA_correct_RT(
STVFU(grblpfv[indx >> 1], zd25v * (glpfvv + (rgbcv + LVFU(rgb[c][(indx + v2) >> 1]) + LVFU(rgb[c][(indx - v2) >> 1]))));
STVFU(grblpfh[indx >> 1], zd25v * (glpfhv + (rgbcv + LVFU(rgb[c][(indx + 2) >> 1]) + LVFU(rgb[c][(indx - 2) >> 1]))));
}
#endif
for (; cc < cc1 - 4; cc += 2, indx += 2) {
rbhpfv[indx >> 1] = fabsf(fabsf((rgb[1][indx] - rgb[c][indx >> 1]) - (rgb[1][indx + v4] - rgb[c][(indx + v4) >> 1])) +
@ -534,7 +537,6 @@ float* RawImageSource::CA_correct_RT(
vfloat coeff11v = ZEROV;
vfloat coeff12v = ZEROV;
for (; cc < cc1 - 14; cc += 8, indx += 8) {
//in linear interpolation, colour differences are a quadratic function of interpolation position;
//solve for the interpolation position that minimizes colour difference variance over the tile
@ -569,7 +571,6 @@ float* RawImageSource::CA_correct_RT(
#endif
for (; cc < cc1 - 8; cc += 2, indx += 2) {
//in linear interpolation, colour differences are a quadratic function of interpolation position;
//solve for the interpolation position that minimizes colour difference variance over the tile
@ -637,14 +638,13 @@ float* RawImageSource::CA_correct_RT(
}
//evaluate the shifts to the location that minimizes CA within the tile
blockshifts[vblock * hblsz + hblock][c][dir] = CAshift[dir][c]; //vert/hor CA shift for R/B
}//vert/hor
}//colour
if (plistener) {
progresscounter++;
if(progresscounter % 8 == 0)
if (progresscounter % 8 == 0) {
#pragma omp critical (cadetectpass1)
{
progress += 4.0 * SQR(ts - border2) / (iterations * height * width);
@ -652,19 +652,20 @@ float* RawImageSource::CA_correct_RT(
plistener->setProgress(progress);
}
}
}
}
}
//end of diagnostic pass
#pragma omp critical (cadetectpass2)
{
for (int dir = 0; dir < 2; dir++)
for (int dir = 0; dir < 2; dir++) {
for (int c = 0; c < 2; c++) {
blockdenom[dir][c] += blockdenomthr[dir][c];
blocksqave[dir][c] += blocksqavethr[dir][c];
blockave[dir][c] += blockavethr[dir][c];
}
}
}
#pragma omp barrier
#pragma omp single
@ -675,13 +676,11 @@ float* RawImageSource::CA_correct_RT(
blockvar[dir][c] = blocksqave[dir][c] / blockdenom[dir][c] - SQR(blockave[dir][c] / blockdenom[dir][c]);
} else {
processpasstwo = false;
printf ("blockdenom vanishes \n");
std::cout << "blockdenom vanishes" << std::endl;
break;
}
}
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//now prepare for CA correction pass
//first, fill border blocks of blockshift array
if (processpasstwo) {
@ -718,7 +717,7 @@ float* RawImageSource::CA_correct_RT(
int numblox[2] = {0, 0};
for (int vblock = 1; vblock < vblsz - 1; vblock++)
for (int vblock = 1; vblock < vblsz - 1; vblock++) {
for (int hblock = 1; hblock < hblsz - 1; hblock++) {
// block 3x3 median of blockshifts for robustness
for (int c = 0; c < 2; c ++) {
@ -739,8 +738,8 @@ float* RawImageSource::CA_correct_RT(
bstemp[dir] = median(p);
}
//now prepare coefficient matrix; use only data points within caautostrength/2 std devs of zero
if (SQR(bstemp[0]) > caautostrength * blockvar[0][c] || SQR(bstemp[1]) > caautostrength * blockvar[1][c]) {
//now prepare coefficient matrix; use only data points within caAutostrength/2 std devs of zero
if (SQR(bstemp[0]) > caAutostrength * blockvar[0][c] || SQR(bstemp[1]) > caAutostrength * blockvar[1][c]) {
continue;
}
@ -768,7 +767,7 @@ float* RawImageSource::CA_correct_RT(
}//dir
}//c
}//blocks
}
numblox[1] = min(numblox[0], numblox[1]);
//if too few data points, restrict the order of the fit to linear
@ -777,24 +776,23 @@ float* RawImageSource::CA_correct_RT(
numpar = 4;
if (numblox[1] < 10) {
printf ("numblox = %d \n", numblox[1]);
std::cout << "numblox = " << numblox[1] << std::endl;
processpasstwo = false;
}
}
if(processpasstwo)
if (processpasstwo) {
//fit parameters to blockshifts
for (int c = 0; c < 2; c++)
for (int c = 0; c < 2; c++) {
for (int dir = 0; dir < 2; dir++) {
if (!LinEqSolve(numpar, polymat[c][dir], shiftmat[c][dir], fitparams[c][dir])) {
printf("CA correction pass failed -- can't solve linear equations for colour %d direction %d...\n", c, dir);
std::cout << "CA correction pass failed -- can't solve linear equations for colour %d direction " << c << std::endl;
processpasstwo = false;
}
}
}
}
}
//fitparams[polyord*i+j] gives the coefficients of (vblock^i hblock^j) in a polynomial fit for i,j<=4
}
//end of initialization for CA correction pass
@ -808,7 +806,7 @@ float* RawImageSource::CA_correct_RT(
float* gshift = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); // there is no overlap in buffer usage => share
#pragma omp for schedule(dynamic) collapse(2) nowait
for (int top = -border; top < height; top += ts - border2)
for (int top = -border; top < height; top += ts - border2) {
for (int left = -border; left < width - (W & 1); left += ts - border2) {
memset(bufferThr, 0, buffersizePassTwo);
float lblockshifts[2][2];
@ -866,19 +864,20 @@ float* RawImageSource::CA_correct_RT(
}
}
}
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//fill borders
if (rrmin > 0) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = ccmin; cc < ccmax; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)];
rgb[1][rr * ts + cc] = rgb[1][(border2 - rr) * ts + cc];
}
}
}
if (rrmax < rr1) {
for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++)
for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) {
for (int cc = ccmin; cc < ccmax; cc++) {
int c = FC(rr, cc);
rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][left + cc]) / 65535.f;
@ -887,18 +886,20 @@ float* RawImageSource::CA_correct_RT(
}
}
}
}
if (ccmin > 0) {
for (int rr = rrmin; rr < rrmax; rr++)
for (int rr = rrmin; rr < rrmax; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)];
rgb[1][rr * ts + cc] = rgb[1][rr * ts + border2 - cc];
}
}
}
if (ccmax < cc1) {
for (int rr = rrmin; rr < rrmax; rr++)
for (int rr = rrmin; rr < rrmax; rr++) {
for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(top + rr)][(width - cc - 2)]) / 65535.f;
@ -907,10 +908,11 @@ float* RawImageSource::CA_correct_RT(
}
}
}
}
//also, fill the image corners
if (rrmin > 0 && ccmin > 0) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = (rawData[border2 - rr][border2 - cc]) / 65535.f;
@ -919,9 +921,10 @@ float* RawImageSource::CA_correct_RT(
}
}
}
}
if (rrmax < rr1 && ccmax < cc1) {
for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++)
for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) {
for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) {
int c = FC(rr, cc);
rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(width - cc - 2)]) / 65535.f;
@ -930,9 +933,10 @@ float* RawImageSource::CA_correct_RT(
}
}
}
}
if (rrmin > 0 && ccmax < cc1) {
for (int rr = 0; rr < border; rr++)
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) {
int c = FC(rr, cc);
rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(border2 - rr)][(width - cc - 2)]) / 65535.f;
@ -941,9 +945,10 @@ float* RawImageSource::CA_correct_RT(
}
}
}
}
if (rrmax < rr1 && ccmin > 0) {
for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++)
for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(border2 - cc)]) / 65535.f;
@ -952,16 +957,15 @@ float* RawImageSource::CA_correct_RT(
}
}
}
}
//end of border fill
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (!autoCA || fitParamsIn) {
#ifdef __SSE2__
const vfloat onev = F2V(1.f);
const vfloat epsv = F2V(eps);
#endif
//manual CA correction; use red/blue slider values to set CA shift parameters
for (int rr = 3; rr < rr1 - 3; rr++) {
int cc = 3 + FC(rr, 1), c = FC(rr,cc), indx = rr * ts + cc;
@ -991,6 +995,7 @@ float* RawImageSource::CA_correct_RT(
}
}
}
if (!autoCA) {
float hfrac = -((float)(hblock - 0.5) / (hblsz - 2) - 0.5);
float vfrac = -((float)(vblock - 0.5) / (vblsz - 2) - 0.5) * height / width;
@ -1035,7 +1040,6 @@ float* RawImageSource::CA_correct_RT(
GRBdir[0][c] = lblockshifts[c>>1][0] > 0 ? 2 : -2;
GRBdir[1][c] = lblockshifts[c>>1][1] > 0 ? 2 : -2;
}
@ -1196,7 +1200,7 @@ float* RawImageSource::CA_correct_RT(
plistener->setProgress(progress);
}
}
}
}
#pragma omp barrier
@ -1217,7 +1221,6 @@ float* RawImageSource::CA_correct_RT(
}
}
// clean up
free(bufferThr);
}
@ -1241,6 +1244,10 @@ float* RawImageSource::CA_correct_RT(
if (avoidColourshift) {
// to avoid or at least reduce the colour shift caused by raw ca correction we compute the per pixel difference factors
// of red and blue channel and apply a gaussian blur on them.
// Then we apply the resulting factors per pixel on the result of raw ca correction
array2D<float> redFactor((W+1)/2, (H+1)/2);
array2D<float> blueFactor((W+1)/2, (H+1)/2);
@ -1263,6 +1270,7 @@ float* RawImageSource::CA_correct_RT(
#pragma omp single
{
if (H % 2) {
// odd height => factors for one one channel are not set in last row => use values of preceding row
const int firstCol = FC(0, 0) & 1;
const int colour = FC(0, firstCol);
const array2D<float>* nonGreen = colour == 0 ? &blueFactor : &redFactor;
@ -1272,6 +1280,7 @@ float* RawImageSource::CA_correct_RT(
}
if (W % 2) {
// odd width => factors for one one channel are not set in last column => use value of preceding column
const int ngRow = 1 - (FC(0, 0) & 1);
const int ngCol = FC(ngRow, 0) & 1;
const int colour = FC(ngRow, ngCol);
@ -1282,11 +1291,11 @@ float* RawImageSource::CA_correct_RT(
}
}
#pragma omp barrier
// blur correction factors
gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0);
gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0);
// apply correction factors to avoid (reduce) colour shift
#pragma omp for
for (int i = 0; i < H; ++i) {
const int firstCol = FC(i, 0) & 1;

View File

@ -2009,13 +2009,13 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
}
if(numFrames == 4) {
double fitParams[64];
float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false);
float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false);
for(int i = 1; i < 3; ++i) {
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false);
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false);
}
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true);
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true);
} else {
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true);
CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true);
}
}

View File

@ -244,7 +244,6 @@ protected:
size_t autoIterations,
double cared,
double cablue,
double caautostrength,
bool avoidColourshift,
const array2D<float> &rawData,
double* fitParamsTransfer,