Revert "pixelshift: Simplified code and added 2 checkboxes"
This reverts commit 3870f6d35d0d4098d232edae42412354cf9f2144.
This commit is contained in:
parent
3870f6d35d
commit
bbabe9bca8
@ -690,8 +690,6 @@ HISTORY_MSG_455;EvPixelShiftNonGreenVertical
|
||||
HISTORY_MSG_456;EvPixelShiftNonGreenCross
|
||||
HISTORY_MSG_457;EvPixelShiftStddevFactorRed
|
||||
HISTORY_MSG_458;EvPixelShiftStddevFactorBlue
|
||||
HISTORY_MSG_459;EvPixelShiftNonGreenCross2
|
||||
HISTORY_MSG_460;EvPixelShiftNonGreenAmaze
|
||||
HISTORY_NEWSNAPSHOT;Add
|
||||
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
|
||||
HISTORY_SNAPSHOT;Snapshot
|
||||
@ -1674,8 +1672,6 @@ TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection
|
||||
TP_RAW_PIXELSHIFTNONGREENHORIZONTAL;Check red/blue horizontal
|
||||
TP_RAW_PIXELSHIFTNONGREENVERTICAL;Check red/blue vertical
|
||||
TP_RAW_PIXELSHIFTNONGREENCROSS;Check red/blue cross
|
||||
TP_RAW_PIXELSHIFTNONGREENCROSS2;Check red/blue experimental
|
||||
TP_RAW_PIXELSHIFTNONGREENAMAZE;Check red/blue amaze
|
||||
TP_RAW_PIXELSHIFTMOTION;Pixelshift motion detection
|
||||
TP_RAW_PIXELSHIFTMOTION_TOOLTIP;0 means no motion detection\n1 - 99 means motion will be detected according to this value. Increase value to increase detection rate\n100 means the Amaze demosaiced frame will be used
|
||||
TP_RAW_PIXELSHIFTMOTIONCORRECTION;Green motion correction size
|
||||
|
@ -126,7 +126,7 @@ void paintMotionMask(int index, bool showMotion, float gridMax, bool showOnlyMas
|
||||
|
||||
using namespace std;
|
||||
using namespace rtengine;
|
||||
#ifdef __OLDPS__
|
||||
|
||||
void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool detectMotion, int motion, bool showMotion, bool showOnlyMask, unsigned int frame, RAWParams::BayerSensor::ePSMotionCorrection gridSize_, bool adaptive, float stddevFactorGreen, float stddevFactorRed, float stddevFactorBlue, float eperIso, float nreadIso, float prnu, const std::string &model, float rawWpCorrection, bool checkNonGreenHorizontal, bool checkNonGreenVertical, bool checkNonGreenCross)
|
||||
{
|
||||
|
||||
@ -276,7 +276,6 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
float eperIsoModel;
|
||||
|
||||
int nReadIndex = static_cast<int>(round(log2(idata->getISOSpeed() / 100.f) * 3.f));
|
||||
|
||||
if(model.find("K-3") != string::npos) {
|
||||
nRead = nReadK3II[nReadIndex];
|
||||
eperIsoModel = ePerIsoK3II;
|
||||
@ -348,11 +347,9 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
float eperIsoNonGreen2 = eperIso / scale_mul[2];
|
||||
float stddevFactorNonGreen0 = stddevFactorRed;
|
||||
float stddevFactorNonGreen2 = stddevFactorBlue;
|
||||
bool blueRow = false;
|
||||
|
||||
if (c == 2 || ((c & 1) && FC(i, j + 1) == 2)) {
|
||||
// row with blue pixels => swap destination pointers for non green pixels
|
||||
blueRow = true;
|
||||
std::swap(nonGreenDest0, nonGreenDest1);
|
||||
std::swap(scaleNonGreen0, scaleNonGreen2);
|
||||
std::swap(eperIsoNonGreen0, eperIsoNonGreen2);
|
||||
@ -531,102 +528,29 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
float ngCentre = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
float ngRight = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) + 1];
|
||||
float ngLeft = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) - 1];
|
||||
float diffRight = ngRight - ngCentre;
|
||||
float diffLeft = ngLeft - ngCentre;
|
||||
float diffHorNg0 = -1.f;
|
||||
float ngTop = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i][j + offset];
|
||||
float ngBottom = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i + 2][j + offset];
|
||||
float diff = nonGreenDiffCross(ngRight, ngLeft, ngTop, ngBottom, ngCentre, stddevFactorNonGreen0, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
|
||||
if(diffRight * diffLeft >= 0.f) {
|
||||
float avg = (ngRight + ngLeft) / 2.f;
|
||||
diffHorNg0 = nonGreenDiff(ngCentre, avg, stddevFactorNonGreen0, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
|
||||
// if(diff > 0.f) {
|
||||
// paintMotionMask(j + offsX, showMotion, diff, showOnlyMask, nonGreenDest0, nonGreenDest1, greenDest);
|
||||
// continue;
|
||||
// }
|
||||
if(diff > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, diff, showOnlyMask, nonGreenDest0, nonGreenDest1, greenDest);
|
||||
continue;
|
||||
}
|
||||
|
||||
float diffHorNg1 = -1.f;
|
||||
ngCentre = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1];
|
||||
ngRight = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1) + 2];
|
||||
ngLeft = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1)];
|
||||
diffRight = ngRight - ngCentre;
|
||||
diffLeft = ngLeft - ngCentre;
|
||||
ngTop = (*rawDataFrames[3 - ((offset << 1) + offset)])[i - 1][j - offset + 1];
|
||||
ngBottom = (*rawDataFrames[3 - ((offset << 1) + offset)])[i + 1][j - offset + 1];
|
||||
diff = nonGreenDiffCross(ngRight, ngLeft, ngTop, ngBottom, ngCentre, stddevFactorNonGreen2, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
|
||||
if(diffRight * diffLeft >= 0.f) {
|
||||
float avg = (ngRight + ngLeft) / 2.f;
|
||||
float diffHorNg1 = nonGreenDiff(ngCentre, avg, stddevFactorNonGreen2, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
|
||||
// if(diff > 0.f) {
|
||||
// paintMotionMask(j + offsX, showMotion, diff, showOnlyMask, nonGreenDest1, nonGreenDest0, greenDest);
|
||||
// continue;
|
||||
// }
|
||||
}
|
||||
|
||||
if( diffHorNg0 * diffHorNg1 < 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, 1.f, showOnlyMask, nonGreenDest0, nonGreenDest1, greenDest);
|
||||
if(diff > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, diff, showOnlyMask, nonGreenDest1, nonGreenDest0, greenDest);
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
// bool motion = false;
|
||||
// float ngCentre = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
// float ngRight = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) + 1];
|
||||
// float ngLeft = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) - 1];
|
||||
// float ngTop = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i][j + offset];
|
||||
// float ngBottom = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i + 2][j + offset];
|
||||
// float diff = nonGreenDiffCross(ngRight, ngLeft, ngTop, ngBottom, ngCentre, stddevFactorNonGreen0, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
//
|
||||
// if(diff > 0.f) {
|
||||
// motion = true;
|
||||
// paintMotionMask(j + offsX, showMotion, diff, showOnlyMask, nonGreenDest0, nonGreenDest1, greenDest);
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// ngCentre = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1];
|
||||
// ngRight = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1) + 2];
|
||||
// ngLeft = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1)];
|
||||
// ngTop = (*rawDataFrames[3 - ((offset << 1) + offset)])[i - 1][j - offset + 1];
|
||||
// ngBottom = (*rawDataFrames[3 - ((offset << 1) + offset)])[i + 1][j - offset + 1];
|
||||
// diff = nonGreenDiffCross(ngRight, ngLeft, ngTop, ngBottom, ngCentre, stddevFactorNonGreen2, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
//
|
||||
//// if(diff > 0.f) {
|
||||
// if((diff > 0.f && !motion) || (diff <= 0.f && motion) ) {
|
||||
// paintMotionMask(j + offsX, showMotion, diff, showOnlyMask, nonGreenDest1, nonGreenDest0, greenDest);
|
||||
// continue;
|
||||
// }
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenHorizontal) {
|
||||
// float lg = ((*rawDataFrames[1 - (offset^1)])[i - (offset^1) + 1][j - 1] + (*rawDataFrames[3 - (offset^1)])[i + (offset^1)][j]) / 2.f;
|
||||
// float cg = ((*rawDataFrames[1 - offset])[i - offset + 1][j] + (*rawDataFrames[3 - offset])[i + offset][j + 1]) / 2.f;
|
||||
// float rg = ((*rawDataFrames[1 - (offset^1)])[i - (offset^1) + 1][j + 1] + (*rawDataFrames[3 - (offset^1)])[i + (offset^1)][j + 2]) / 2.f;
|
||||
//
|
||||
// float lr = (*rawDataFrames[((offset^1) << 1) + (offset^1)])[i][j + (offset^1) - 1];
|
||||
// float cr = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
// float rr = (*rawDataFrames[((offset^1) << 1) + (offset^1)])[i][j + (offset^1) + 1];
|
||||
//
|
||||
// float lb = (*rawDataFrames[2 - (offset^1)])[i + 1][j - (offset^1)];
|
||||
// float cb = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1];
|
||||
// float rb = (*rawDataFrames[2 - (offset^1)])[i + 1][j - (offset^1) + 2];
|
||||
//
|
||||
// if(blueRow) {
|
||||
// std::swap(lr, lb);
|
||||
// std::swap(cr, cb);
|
||||
// std::swap(rr, rb);
|
||||
// }
|
||||
//
|
||||
// float lh = Color::rgb2h(lr, lg, lb);
|
||||
// float ch = Color::rgb2h(cr, cg, cb);
|
||||
// float rh = Color::rgb2h(rr, rg, rb);
|
||||
//
|
||||
// float lHueDiff = lh - ch;
|
||||
// float rHueDiff = rh - ch;
|
||||
// if(lHueDiff * rHueDiff > 0.f) {
|
||||
// if(std::fabs(lHueDiff) > 0.5f && std::fabs(rHueDiff) > 0.5f/* && std::fabs(lHueDiff) < 3.f && std::fabs(rHueDiff) < 3.f*/) {
|
||||
// paintMotionMask(j + offsX, showMotion, 1.f, showOnlyMask, nonGreenDest0, nonGreenDest1, greenDest);
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
float ngCentre = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
float ngRight = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) + 1];
|
||||
float ngLeft = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) - 1];
|
||||
@ -713,592 +637,3 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
plistener->setProgress(1.0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool detectMotion, int motion, bool showMotion, bool showOnlyMask, unsigned int frame, RAWParams::BayerSensor::ePSMotionCorrection gridSize_, bool adaptive, float stddevFactorGreen, float stddevFactorRed, float stddevFactorBlue, float eperIso, float nreadIso, float prnu, const std::string &model, float rawWpCorrection, bool checkNonGreenHorizontal, bool checkNonGreenVertical, bool checkNonGreenCross, bool checkNonGreenAmaze, bool checkNonGreenCross2)
|
||||
{
|
||||
|
||||
BENCHFUN
|
||||
|
||||
static const float nReadK3II[] = { 3.4f, // ISO 100
|
||||
3.1f, // ISO 125
|
||||
2.5f, // ISO 160
|
||||
2.5f, // ISO 200
|
||||
2.5f, // ISO 250
|
||||
2.5f, // ISO 320
|
||||
2.3f, // ISO 400
|
||||
2.5f, // ISO 500
|
||||
2.3f, // ISO 640
|
||||
2.3f, // ISO 800
|
||||
2.4f, // ISO 1000
|
||||
2.3f, // ISO 1250
|
||||
1.75f, // ISO 1600
|
||||
1.75f, // ISO 2000
|
||||
1.75f, // ISO 2500
|
||||
1.75f, // ISO 3200
|
||||
1.75f, // ISO 4000
|
||||
1.75f, // ISO 5000
|
||||
1.75f, // ISO 6400
|
||||
1.75f, // ISO 8000
|
||||
1.75f, // ISO 10000
|
||||
1.5f, // ISO 12800
|
||||
1.5f, // ISO 16000
|
||||
1.5f, // ISO 20000
|
||||
1.5f, // ISO 25600
|
||||
1.5f, // ISO 32000
|
||||
1.5f, // ISO 40000
|
||||
1.5f, // ISO 51200
|
||||
1.5f // ISO > 51200 (we get a max ISO value of 65535 from dcraw)
|
||||
};
|
||||
|
||||
static const float ePerIsoK3II = 0.35f;
|
||||
|
||||
static const float nReadK1[] = { 3.45f, // ISO 100
|
||||
3.15f, // ISO 125
|
||||
3.45f, // ISO 160
|
||||
3.0f, // ISO 200
|
||||
3.0f, // ISO 250
|
||||
3.0f, // ISO 320
|
||||
2.7f, // ISO 400
|
||||
2.7f, // ISO 500
|
||||
2.7f, // ISO 640
|
||||
2.5f, // ISO 800
|
||||
2.5f, // ISO 1000
|
||||
2.5f, // ISO 1250
|
||||
2.4f, // ISO 1600
|
||||
2.4f, // ISO 2000
|
||||
2.4f, // ISO 2500
|
||||
2.4f, // ISO 3200
|
||||
2.4f, // ISO 4000
|
||||
2.4f, // ISO 5000
|
||||
2.4f, // ISO 6400
|
||||
2.4f, // ISO 8000
|
||||
2.4f, // ISO 10000
|
||||
2.4f, // ISO 12800
|
||||
2.4f, // ISO 16000
|
||||
2.4f, // ISO 20000
|
||||
2.4f, // ISO 25600
|
||||
2.4f, // ISO 32000
|
||||
2.4f, // ISO 40000
|
||||
2.4f, // ISO 51200
|
||||
2.4f // ISO > 51200 (we get a max ISO value of 65535 from dcraw)
|
||||
};
|
||||
|
||||
static const float ePerIsoK1 = 0.75f;
|
||||
|
||||
static const float nReadK70[] = { 3.0f, // ISO 100
|
||||
3.0f, // ISO 125
|
||||
3.0f, // ISO 160
|
||||
3.0f, // ISO 200
|
||||
3.0f, // ISO 250
|
||||
3.0f, // ISO 320
|
||||
3.0f, // ISO 400
|
||||
3.0f, // ISO 500
|
||||
3.0f, // ISO 640
|
||||
3.0f, // ISO 800
|
||||
3.0f, // ISO 1000
|
||||
3.0f, // ISO 1250
|
||||
3.0f, // ISO 1600
|
||||
3.0f, // ISO 2000
|
||||
3.0f, // ISO 2500
|
||||
3.0f, // ISO 3200
|
||||
3.0f, // ISO 4000
|
||||
3.0f, // ISO 5000
|
||||
3.0f, // ISO 6400
|
||||
3.0f, // ISO 8000
|
||||
3.0f, // ISO 10000
|
||||
3.0f, // ISO 12800
|
||||
3.0f, // ISO 16000
|
||||
3.0f, // ISO 20000
|
||||
3.0f, // ISO 25600
|
||||
3.0f, // ISO 32000
|
||||
3.0f, // ISO 40000
|
||||
3.0f, // ISO 51200
|
||||
3.0f // ISO > 51200 (we get a max ISO value of 65535 from dcraw)
|
||||
};
|
||||
|
||||
static const float ePerIsoK70 = 0.5f;
|
||||
|
||||
if (plistener) {
|
||||
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift]));
|
||||
plistener->setProgress(0.0);
|
||||
}
|
||||
|
||||
|
||||
const bool skip = (gridSize_ == RAWParams::BayerSensor::ePSMotionCorrection::Grid1x2);
|
||||
int gridSize = 1;
|
||||
|
||||
switch (gridSize_) {
|
||||
case RAWParams::BayerSensor::ePSMotionCorrection::Grid1x1:
|
||||
case RAWParams::BayerSensor::ePSMotionCorrection::Grid1x2:
|
||||
gridSize = 1;
|
||||
break;
|
||||
|
||||
case RAWParams::BayerSensor::ePSMotionCorrection::Grid3x3:
|
||||
gridSize = 3;
|
||||
break;
|
||||
|
||||
case RAWParams::BayerSensor::ePSMotionCorrection::Grid5x5:
|
||||
gridSize = 5;
|
||||
break;
|
||||
|
||||
case RAWParams::BayerSensor::ePSMotionCorrection::Grid7x7:
|
||||
gridSize = 7;
|
||||
}
|
||||
|
||||
// Lookup table for non adaptive (slider) mode
|
||||
LUTf log2Lut(32768, LUT_CLIP_BELOW | LUT_CLIP_ABOVE);
|
||||
|
||||
if(detectMotion && !adaptive) {
|
||||
const float lutStrength = 2.f;
|
||||
log2Lut[0] = 0;
|
||||
|
||||
for(int i = 2; i < 65536; i += 2) {
|
||||
log2Lut[i >> 1] = lutStrength * log2(i) / 100.f;
|
||||
}
|
||||
}
|
||||
|
||||
const float scaleGreen = 1.f / scale_mul[1];
|
||||
|
||||
float nRead;
|
||||
float eperIsoModel;
|
||||
|
||||
int nReadIndex = static_cast<int>(round(log2(idata->getISOSpeed() / 100.f) * 3.f));
|
||||
|
||||
if(model.find("K-3") != string::npos) {
|
||||
nRead = nReadK3II[nReadIndex];
|
||||
eperIsoModel = ePerIsoK3II;
|
||||
} else if(model.find("K-1") != string::npos) {
|
||||
nRead = nReadK1[nReadIndex];
|
||||
eperIsoModel = ePerIsoK1;
|
||||
} else {
|
||||
nRead = nReadK70[nReadIndex];
|
||||
eperIsoModel = ePerIsoK70;
|
||||
}
|
||||
|
||||
nRead *= pow(2.f, nreadIso);
|
||||
eperIsoModel *= pow(2.f, eperIso);
|
||||
eperIso = eperIsoModel * (100.f / (rawWpCorrection * idata->getISOSpeed()));
|
||||
|
||||
float eperIsoRed = eperIso / scale_mul[0];
|
||||
float eperIsoGreen = eperIso * scaleGreen;
|
||||
float eperIsoBlue = eperIso / scale_mul[2];
|
||||
|
||||
printf("Pixelshift parameters : gridSize %d\tadaptive %d\tstdDevFactorGreen %f\telectrons %1.8f\tnread %f\tprnu %1.1f%%\n", gridSize, adaptive, stddevFactorGreen, eperIso, nRead, prnu);
|
||||
|
||||
prnu /= 100.f;
|
||||
stddevFactorGreen *= stddevFactorGreen;
|
||||
stddevFactorRed *= stddevFactorRed;
|
||||
stddevFactorBlue *= stddevFactorBlue;
|
||||
|
||||
|
||||
nRead *= nRead;
|
||||
|
||||
// If the values of two corresponding green pixels differ my more then motionThreshold %, the pixel will be treated as a badGreen pixel
|
||||
float motionThreshold = 1.f - (motion / 100.f);
|
||||
// For shades of green motion indicators
|
||||
const float blendFactor = ((adaptive || motion == 0.f) ? 1.f : 1.f / (1.f - motionThreshold));
|
||||
|
||||
unsigned int offsX = 0, offsY = 0;
|
||||
|
||||
// We have to adjust the offsets for the selected subframe we use for areas with motion
|
||||
switch (frame) {
|
||||
case 0:
|
||||
offsX = offsY = 0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
offsX = 0;
|
||||
offsY = 1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
offsX = offsY = 1;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
offsX = 1;
|
||||
offsY = 0;
|
||||
}
|
||||
|
||||
const float thresh = adaptive ? 0.f : motionThreshold;
|
||||
array2D<float> psRed(winw, winh);
|
||||
array2D<float> psG1(winw, winh);
|
||||
array2D<float> psG2(winw, winh);
|
||||
array2D<float> psBlue(winw, winh);
|
||||
|
||||
// fill channels psRed, psG1, psG2 and psBlue
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for schedule(dynamic,16)
|
||||
#endif
|
||||
|
||||
for(int i = winy + 1; i < winh - 1; ++i) {
|
||||
float *greenDest1 = psG1[i];
|
||||
float *greenDest2 = psG2[i];
|
||||
float *nonGreenDest0 = psRed[i];
|
||||
float *nonGreenDest1 = psBlue[i];
|
||||
int j = winx + 1;
|
||||
int c = FC(i, j);
|
||||
|
||||
if (c == 2 || ((c & 1) && FC(i, j + 1) == 2)) {
|
||||
// row with blue pixels => swap destination pointers for non green pixels
|
||||
std::swap(nonGreenDest0, nonGreenDest1);
|
||||
std::swap(greenDest1, greenDest2);
|
||||
}
|
||||
|
||||
// offset to keep the code short. It changes its value between 0 and 1 for each iteration of the loop
|
||||
unsigned int offset = (c & 1);
|
||||
offset ^= 1; // 0 => 1 or 1 => 0
|
||||
|
||||
for(; j < winw - 1; ++j) {
|
||||
offset ^= 1; // 0 => 1 or 1 => 0
|
||||
|
||||
// store the values from the 4 frames into 4 different temporary planes
|
||||
greenDest1[j] = (*rawDataFrames[1 - offset])[i - offset + 1][j];
|
||||
greenDest2[j] = (*rawDataFrames[3 - offset])[i + offset][j + 1];
|
||||
nonGreenDest0[j] = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
nonGreenDest1[j] = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1];
|
||||
}
|
||||
}
|
||||
|
||||
// now that the temporary planes are filled for easy access we do the motion detection
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for schedule(dynamic,16)
|
||||
#endif
|
||||
|
||||
for(int i = winy + border - offsY; i < winh - (border + offsY); ++i) {
|
||||
float *greenDest = green[i + offsY];
|
||||
float *redDest = red[i + offsY];
|
||||
float *blueDest = blue[i + offsY];
|
||||
int j = winx + border - offsX;
|
||||
|
||||
float greenDifMax[gridSize]; // Here we store the maximum differences per Column
|
||||
|
||||
// green channel motion detection checks the grid around the pixel for differences in green channels
|
||||
if(detectMotion || adaptive) {
|
||||
if(gridSize == 3) {
|
||||
// compute maximum of differences for first two columns of 3x3 grid
|
||||
greenDifMax[0] = std::max({greenDiff(psG1[i - 1][j - 1], psG2[i - 1][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j - 1], psG2[ i ][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j - 1], psG2[i + 1][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[1] = std::max({greenDiff(psG1[i - 1][ j ], psG2[i - 1][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][ j ], psG2[ i ][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][ j ], psG2[i + 1][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
} else if(gridSize == 5) {
|
||||
// compute maximum of differences for first four columns of 5x5 grid
|
||||
greenDifMax[0] = std::max({greenDiff(psG1[i - 2][j - 2], psG2[i - 2][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j - 2], psG2[i - 1][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j - 2], psG2[ i ][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j - 2], psG2[i + 1][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j - 2], psG2[i + 2][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[1] = std::max({greenDiff(psG1[i - 2][j - 1], psG2[i - 2][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j - 1], psG2[i - 1][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j - 1], psG2[ i ][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j - 1], psG2[i + 1][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j - 1], psG2[i + 2][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[2] = std::max({greenDiff(psG1[i - 2][ j ], psG2[i - 2][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][ j ], psG2[i - 1][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][ j ], psG2[ i ][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][ j ], psG2[i + 1][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][ j ], psG2[i + 2][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[3] = std::max({greenDiff(psG1[i - 2][j + 1], psG2[i - 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j + 1], psG2[i - 1][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j + 1], psG2[ i ][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j + 1], psG2[i + 1][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j + 1], psG2[i + 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
} else if(gridSize == 7) {
|
||||
// compute maximum of differences for first six columns of 7x7 grid
|
||||
greenDifMax[0] = std::max({greenDiff(psG1[i - 3][j - 3], psG2[i - 3][j - 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 2][j - 3], psG2[i - 2][j - 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j - 3], psG2[i - 1][j - 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j - 3], psG2[ i ][j - 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j - 3], psG2[i + 1][j - 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j - 3], psG2[i + 2][j - 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 3][j - 3], psG2[i + 3][j - 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[1] = std::max({greenDiff(psG1[i - 3][j - 2], psG2[i - 3][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 2][j - 2], psG2[i - 2][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j - 2], psG2[i - 1][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j - 2], psG2[ i ][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j - 2], psG2[i + 1][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j - 2], psG2[i + 2][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 3][j - 2], psG2[i + 3][j - 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[2] = std::max({greenDiff(psG1[i - 3][j - 1], psG2[i - 3][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 2][j - 1], psG2[i - 2][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j - 1], psG2[i - 1][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j - 1], psG2[ i ][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j - 1], psG2[i + 1][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j - 1], psG2[i + 2][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 3][j - 1], psG2[i + 3][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[3] = std::max({greenDiff(psG1[i - 3][ j ], psG2[i - 3][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 2][ j ], psG2[i - 2][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][ j ], psG2[i - 1][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][ j ], psG2[ i ][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][ j ], psG2[i + 1][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][ j ], psG2[i + 2][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 3][ j ], psG2[i + 3][ j ], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[4] = std::max({greenDiff(psG1[i - 3][j + 1], psG2[i - 3][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 2][j + 1], psG2[i - 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j + 1], psG2[i - 1][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j + 1], psG2[ i ][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j + 1], psG2[i + 1][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j + 1], psG2[i + 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 3][j + 1], psG2[i + 3][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
greenDifMax[5] = std::max({greenDiff(psG1[i - 3][j + 2], psG2[i - 3][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 2][j + 2], psG2[i - 2][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j + 2], psG2[i - 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j + 2], psG2[ i ][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j + 2], psG2[i + 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j + 2], psG2[i + 2][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 3][j + 2], psG2[i + 3][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// this is the index for the last column of the grid. Obviously we have to start with gridSize - 1
|
||||
int lastIndex = gridSize - 1;
|
||||
float korr = 0.f;
|
||||
int c = FC(i, j);
|
||||
bool blueRow = false;
|
||||
if (c == 2 || ((c & 1) && FC(i, j + 1) == 2)) {
|
||||
// row with blue pixels => swap destination pointers for non green pixels
|
||||
blueRow = true;
|
||||
}
|
||||
|
||||
// offset to keep the code short. It changes its value between 0 and 1 for each iteration of the loop
|
||||
unsigned int offset = (c & 1);
|
||||
// offset ^= 1; // 0 => 1 or 1 => 0
|
||||
|
||||
for(; j < winw - (border + offsX); ++j) {
|
||||
bool greenFromPs = false;
|
||||
offset ^= 1; // 0 => 1 or 1 => 0
|
||||
|
||||
if(detectMotion || adaptive) {
|
||||
bool skipNext = false;
|
||||
float gridMax;
|
||||
|
||||
if(gridSize < 2) {
|
||||
// compute difference for current pixel and skip next pixel, that's roughly the method from dcrawps
|
||||
gridMax = greenDiff(psG1[i][j], psG2[i][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion);
|
||||
skipNext = skip;
|
||||
} else if(gridSize == 3) {
|
||||
// compute maximum of differences for third column of 3x3 grid and save at position lastIndex
|
||||
greenDifMax[lastIndex] = std::max({greenDiff(psG1[i - 1][j + 1], psG2[i - 1][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j + 1], psG2[ i ][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j + 1], psG2[i + 1][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
// calculate maximum of whole grid by calculating maximum of grid column max values
|
||||
gridMax = std::max({greenDifMax[0], greenDifMax[1], greenDifMax[2]});
|
||||
} else if(gridSize == 5) {
|
||||
// compute maximum of differences for fifth column of 5x5 grid and save at position lastIndex
|
||||
greenDifMax[lastIndex] = std::max({greenDiff(psG1[i - 2][j + 2], psG2[i - 2][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j + 2], psG2[i - 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j + 2], psG2[ i ][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j + 2], psG2[i + 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j + 2], psG2[i + 2][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
});
|
||||
// calculate maximum of whole grid by calculating maximum of grid column max values
|
||||
gridMax = std::max({greenDifMax[0], greenDifMax[1], greenDifMax[2], greenDifMax[3], greenDifMax[4]});
|
||||
} else if(gridSize == 7) {
|
||||
// compute maximum of differences for 7th column of 7x7 grid and save at position lastIndex
|
||||
greenDifMax[lastIndex] = std::max({greenDiff(psG1[i - 3][j + 3], psG2[i - 3][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 2][j + 3], psG2[i - 2][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i - 1][j + 3], psG2[i - 1][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[ i ][j + 3], psG2[ i ][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 1][j + 3], psG2[i + 1][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 2][j + 3], psG2[i + 2][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff(psG1[i + 3][j + 3], psG2[i + 3][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
});
|
||||
// calculate maximum of whole grid by calculating maximum of grid column max values
|
||||
gridMax = std::max({greenDifMax[0], greenDifMax[1], greenDifMax[2], greenDifMax[3], greenDifMax[4], greenDifMax[5], greenDifMax[6]});
|
||||
}
|
||||
|
||||
|
||||
// adjust index for next column
|
||||
lastIndex ++;
|
||||
lastIndex = lastIndex == gridSize ? 0 : lastIndex;
|
||||
|
||||
// increase motion detection dependent on brightness
|
||||
if(!adaptive) {
|
||||
korr = log2Lut[((int)(psG1[i][j] * scaleGreen)) >> 1];
|
||||
}
|
||||
|
||||
if (gridMax > thresh - korr) {
|
||||
if((offset == (frame&1)) && checkNonGreenVertical) {
|
||||
if(frame > 1) {
|
||||
green[i + offsY][j + offsX] = blueRow ? psG1[i][j] : psG2[i][j];
|
||||
} else {
|
||||
green[i + offsY][j + offsX] = blueRow ? psG2[i][j] : psG1[i][j];;
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
// at least one of the tested green pixels of the grid is detected as motion
|
||||
paintMotionMask(j + offsX, showMotion, (gridMax - thresh + korr) * blendFactor, showOnlyMask, greenDest, redDest, blueDest);
|
||||
|
||||
if(skipNext) {
|
||||
// treat the horizontally next pixel also as motion
|
||||
j++;
|
||||
paintMotionMask(j + offsX, showMotion, (gridMax - thresh + korr) * blendFactor, showOnlyMask, greenDest, redDest, blueDest);
|
||||
}
|
||||
|
||||
// do not set the motion pixel values. They have already been set by demosaicer or showMotion
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenCross) {
|
||||
// check red cross
|
||||
float redTop = psRed[i - 1][ j ];
|
||||
float redLeft = psRed[ i ][j - 1];
|
||||
float redCentre = psRed[ i ][ j ];
|
||||
float redRight = psRed[ i ][j + 1];
|
||||
float redBottom = psRed[i + 1][ j ];
|
||||
float redDiff = nonGreenDiffCross(redRight, redLeft, redTop, redBottom, redCentre, stddevFactorRed, eperIsoRed, nRead, prnu, showMotion);
|
||||
|
||||
if(redDiff > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, redDiff, showOnlyMask, redDest, blueDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
|
||||
// check blue cross
|
||||
float blueTop = psBlue[i - 1][ j ];
|
||||
float blueLeft = psBlue[ i ][j - 1];
|
||||
float blueCentre = psBlue[ i ][ j ];
|
||||
float blueRight = psBlue[ i ][j + 1];
|
||||
float blueBottom = psBlue[i + 1][ j ];
|
||||
float blueDiff = nonGreenDiffCross(blueRight, blueLeft, blueTop, blueBottom, blueCentre, stddevFactorBlue, eperIsoBlue, nRead, prnu, showMotion);
|
||||
|
||||
if(blueDiff > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, blueDiff, showOnlyMask, blueDest, redDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenHorizontal) {
|
||||
float redLeft = psRed[ i ][j - 1];
|
||||
float redCentre = psRed[ i ][ j ];
|
||||
float redRight = psRed[ i ][j + 1];
|
||||
|
||||
float redDiffLeft = redLeft - redCentre;
|
||||
float redDiffRight = redRight - redCentre;
|
||||
|
||||
if(redDiffLeft * redDiffRight >= 0.f) {
|
||||
float redAvg = (redRight + redLeft) / 2.f;
|
||||
float redDiffHor = nonGreenDiff(redCentre, redAvg, stddevFactorRed, eperIsoRed, nRead, prnu, showMotion);
|
||||
if(redDiffHor > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, redDiffHor, showOnlyMask, redDest, blueDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
float blueLeft = psBlue[ i ][j - 1];
|
||||
float blueCentre = psBlue[ i ][ j ];
|
||||
float blueRight = psBlue[ i ][j + 1];
|
||||
|
||||
float blueDiffLeft = blueLeft - blueCentre;
|
||||
float blueDiffRight = blueRight - blueCentre;
|
||||
|
||||
if(blueDiffLeft * blueDiffRight >= 0.f) {
|
||||
float blueAvg = (blueRight + blueLeft) / 2.f;
|
||||
float blueDiffHor = nonGreenDiff(blueCentre, blueAvg, stddevFactorBlue, eperIsoBlue, nRead, prnu, showMotion);
|
||||
|
||||
if(blueDiffHor > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, blueDiffHor, showOnlyMask, redDest, blueDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenVertical) {
|
||||
// check red vertically
|
||||
float redTop = psRed[i - 1][ j ];
|
||||
float redCentre = psRed[ i ][ j ];
|
||||
float redBottom = psRed[i + 1][ j ];
|
||||
|
||||
float redDiffTop = redTop - redCentre;
|
||||
float redDiffBottom = redBottom - redCentre;
|
||||
|
||||
if(redDiffTop * redDiffBottom >= 0.f) {
|
||||
float redAvg = (redTop + redBottom) / 2.f;
|
||||
float redDiff = nonGreenDiff(redCentre, redAvg, stddevFactorRed, eperIsoRed, nRead, prnu, showMotion);
|
||||
|
||||
if(redDiff > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, redDiff, showOnlyMask, redDest, blueDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// check blue vertically
|
||||
float blueTop = psBlue[i - 1][ j ];
|
||||
float blueCentre = psBlue[ i ][ j ];
|
||||
float blueBottom = psBlue[i + 1][ j ];
|
||||
|
||||
float blueDiffTop = blueTop - blueCentre;
|
||||
float blueDiffBottom = blueBottom - blueCentre;
|
||||
|
||||
if(blueDiffTop * blueDiffBottom >= 0.f) {
|
||||
float blueAvg = (blueTop + blueBottom) / 2.f;
|
||||
float blueDiff = nonGreenDiff(blueCentre, blueAvg, stddevFactorBlue, eperIsoBlue, nRead, prnu, showMotion);
|
||||
|
||||
if(blueDiff > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, blueDiff, showOnlyMask, blueDest, redDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenAmaze) {
|
||||
// check current pixel against amaze
|
||||
float redCentre = psRed[ i ][ j ];
|
||||
float redAmaze = red[i + offsY][j + offsX];
|
||||
|
||||
float redDiffAmaze = nonGreenDiff(redCentre, redAmaze, stddevFactorRed, eperIsoRed, nRead, prnu, showMotion);
|
||||
if(redDiffAmaze > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, redDiffAmaze, showOnlyMask, redDest, blueDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
|
||||
float blueCentre = psBlue[ i ][ j ];
|
||||
float blueAmaze = blue[i + offsY][j + offsX];
|
||||
|
||||
float blueDiffAmaze = nonGreenDiff(blueCentre, blueAmaze, stddevFactorBlue, eperIsoBlue, nRead, prnu, showMotion);
|
||||
if(blueDiffAmaze > 0.f) {
|
||||
paintMotionMask(j + offsX, showMotion, blueDiffAmaze, showOnlyMask, blueDest, redDest, greenDest);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenCross2) { // for experiments
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(showMotion && showOnlyMask) { // we want only motion mask => paint areas without motion in pure black
|
||||
red[i + offsY][j + offsX] = green[i + offsY][j + offsX] = blue[i + offsY][j + offsX] = 0.f;
|
||||
} else {
|
||||
// no motion detected, replace the a priori demosaiced values by the pixelshift combined values
|
||||
red[i + offsY][j + offsX] = psRed[i][j];
|
||||
green[i + offsY][j + offsX] = (psG1[i][j] + psG2[i][j]) / 2.f;
|
||||
blue[i + offsY][j + offsX] = psBlue[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(plistener) {
|
||||
plistener->setProgress(1.0);
|
||||
}
|
||||
}
|
||||
#endif
|
@ -485,8 +485,6 @@ enum ProcEvent {
|
||||
EvPixelShiftNonGreenCross = 455,
|
||||
EvPixelShiftStddevFactorRed = 456,
|
||||
EvPixelShiftStddevFactorBlue = 457,
|
||||
EvPixelShiftNonGreenCross2 = 458,
|
||||
EvPixelShiftNonGreenAmaze = 459,
|
||||
NUMOFEVENTS
|
||||
|
||||
};
|
||||
|
@ -899,8 +899,6 @@ void RAWParams::setDefaults()
|
||||
bayersensor.pixelShiftNonGreenHorizontal = false;
|
||||
bayersensor.pixelShiftNonGreenVertical = false;
|
||||
bayersensor.pixelShiftNonGreenCross = false;
|
||||
bayersensor.pixelShiftNonGreenCross2 = false;
|
||||
bayersensor.pixelShiftNonGreenAmaze = false;
|
||||
bayersensor.black0 = 0.0;
|
||||
bayersensor.black1 = 0.0;
|
||||
bayersensor.black2 = 0.0;
|
||||
@ -3436,13 +3434,7 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b
|
||||
keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenCross", raw.bayersensor.pixelShiftNonGreenCross );
|
||||
}
|
||||
|
||||
if (!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross2) {
|
||||
keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenCross2", raw.bayersensor.pixelShiftNonGreenCross2 );
|
||||
}
|
||||
|
||||
if (!pedited || pedited->raw.bayersensor.pixelShiftNonGreenAmaze) {
|
||||
keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenAmaze", raw.bayersensor.pixelShiftNonGreenAmaze );
|
||||
}
|
||||
//if (!pedited || pedited->raw.bayersensor.allEnhance) keyFile.set_boolean ("RAW Bayer", "ALLEnhance", raw.bayersensor.all_enhance );
|
||||
|
||||
if (!pedited || pedited->raw.xtranssensor.method) {
|
||||
keyFile.set_string ("RAW X-Trans", "Method", raw.xtranssensor.method );
|
||||
@ -7612,21 +7604,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited)
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key ("RAW Bayer", "pixelShiftNonGreenCross2")) {
|
||||
raw.bayersensor.pixelShiftNonGreenCross2 = keyFile.get_boolean("RAW Bayer", "pixelShiftNonGreenCross2");
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.bayersensor.pixelShiftNonGreenCross2 = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key ("RAW Bayer", "pixelShiftNonGreenAmaze")) {
|
||||
raw.bayersensor.pixelShiftNonGreenAmaze = keyFile.get_boolean("RAW Bayer", "pixelShiftNonGreenAmaze");
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.bayersensor.pixelShiftNonGreenAmaze = true;
|
||||
}
|
||||
}
|
||||
//if (keyFile.has_key ("RAW Bayer", "ALLEnhance")) { raw.bayersensor.all_enhance = keyFile.get_boolean("RAW Bayer", "ALLEnhance"); if (pedited) pedited->raw.bayersensor.allEnhance = true; }
|
||||
}
|
||||
|
||||
// load X-Trans sensors' raw settings
|
||||
@ -8079,9 +8057,8 @@ bool ProcParams::operator== (const ProcParams& other)
|
||||
&& raw.bayersensor.pixelShiftNonGreenHorizontal == other.raw.bayersensor.pixelShiftNonGreenHorizontal
|
||||
&& raw.bayersensor.pixelShiftNonGreenVertical == other.raw.bayersensor.pixelShiftNonGreenVertical
|
||||
&& raw.bayersensor.pixelShiftNonGreenCross == other.raw.bayersensor.pixelShiftNonGreenCross
|
||||
&& raw.bayersensor.pixelShiftNonGreenCross2 == other.raw.bayersensor.pixelShiftNonGreenCross2
|
||||
&& raw.bayersensor.pixelShiftNonGreenAmaze == other.raw.bayersensor.pixelShiftNonGreenAmaze
|
||||
&& raw.bayersensor.dcb_enhance == other.raw.bayersensor.dcb_enhance
|
||||
//&& raw.bayersensor.all_enhance == other.raw.bayersensor.all_enhance
|
||||
&& raw.xtranssensor.method == other.raw.xtranssensor.method
|
||||
&& raw.xtranssensor.ccSteps == other.raw.xtranssensor.ccSteps
|
||||
&& raw.xtranssensor.blackred == other.raw.xtranssensor.blackred
|
||||
|
@ -1218,8 +1218,6 @@ public:
|
||||
bool pixelShiftNonGreenHorizontal;
|
||||
bool pixelShiftNonGreenVertical;
|
||||
bool pixelShiftNonGreenCross;
|
||||
bool pixelShiftNonGreenCross2;
|
||||
bool pixelShiftNonGreenAmaze;
|
||||
bool dcb_enhance;
|
||||
//bool all_enhance;
|
||||
};
|
||||
|
@ -2028,7 +2028,7 @@ void RawImageSource::demosaic(const RAWParams &raw)
|
||||
amaze_demosaic_RT (0, 0, W, H); // for non pixelshift files use amaze if pixelshift is selected. We need it also for motion correction
|
||||
}
|
||||
if(numFrames == 4) {
|
||||
pixelshift(0, 0, W, H, raw.bayersensor.pixelShiftMotion > 0, raw.bayersensor.pixelShiftMotion, raw.bayersensor.pixelshiftShowMotion, raw.bayersensor.pixelshiftShowMotionMaskOnly, currFrame, raw.bayersensor.pixelShiftMotionCorrection, raw.bayersensor.pixelShiftAutomatic, raw.bayersensor.pixelShiftStddevFactorGreen, raw.bayersensor.pixelShiftStddevFactorRed, raw.bayersensor.pixelShiftStddevFactorBlue, raw.bayersensor.pixelShiftEperIso, raw.bayersensor.pixelShiftNreadIso, raw.bayersensor.pixelShiftPrnu, ri->get_model(), raw.expos, raw.bayersensor.pixelShiftNonGreenHorizontal, raw.bayersensor.pixelShiftNonGreenVertical, raw.bayersensor.pixelShiftNonGreenCross, raw.bayersensor.pixelShiftNonGreenAmaze, raw.bayersensor.pixelShiftNonGreenCross2);
|
||||
pixelshift(0, 0, W, H, raw.bayersensor.pixelShiftMotion > 0, raw.bayersensor.pixelShiftMotion, raw.bayersensor.pixelshiftShowMotion, raw.bayersensor.pixelshiftShowMotionMaskOnly, currFrame, raw.bayersensor.pixelShiftMotionCorrection, raw.bayersensor.pixelShiftAutomatic, raw.bayersensor.pixelShiftStddevFactorGreen, raw.bayersensor.pixelShiftStddevFactorRed, raw.bayersensor.pixelShiftStddevFactorBlue, raw.bayersensor.pixelShiftEperIso, raw.bayersensor.pixelShiftNreadIso, raw.bayersensor.pixelShiftPrnu, ri->get_model(), raw.expos, raw.bayersensor.pixelShiftNonGreenHorizontal, raw.bayersensor.pixelShiftNonGreenVertical, raw.bayersensor.pixelShiftNonGreenCross);
|
||||
}
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::dcb] ) {
|
||||
dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance);
|
||||
|
@ -261,7 +261,7 @@ protected:
|
||||
void xtransborder_interpolate (int border);
|
||||
void xtrans_interpolate (const int passes, const bool useCieLab);
|
||||
void fast_xtrans_interpolate ();
|
||||
void pixelshift(int winx, int winy, int winw, int winh, bool detectMotion, int motion, bool showMotion, bool showOnlyMask, unsigned int frame, RAWParams::BayerSensor::ePSMotionCorrection gridSize, bool adaptive, float stddevFactorGreen, float stddevFactorRed, float stddevFactorBlue, float eperIso, float nreadIso, float prnu, const std::string &model, float rawWpCorrection, bool checkNonGreenHorizontal, bool checkNonGreenVertical, bool checkNonGreenCross, bool checkNonGreenAmaze, bool checkNonGreenCross2);
|
||||
void pixelshift(int winx, int winy, int winw, int winh, bool detectMotion, int motion, bool showMotion, bool showOnlyMask, unsigned int frame, RAWParams::BayerSensor::ePSMotionCorrection gridSize, bool adaptive, float stddevFactorGreen, float stddevFactorRed, float stddevFactorBlue, float eperIso, float nreadIso, float prnu, const std::string &model, float rawWpCorrection, bool checkNonGreenHorizontal, bool checkNonGreenVertical, bool checkNonGreenCross);
|
||||
void hflip (Imagefloat* im);
|
||||
void vflip (Imagefloat* im);
|
||||
|
||||
|
@ -484,9 +484,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
|
||||
DEMOSAIC, // EvPixelShiftNonGreenVertical
|
||||
DEMOSAIC, // EvPixelShiftNonGreenCross
|
||||
DEMOSAIC, // EvPixelShiftStddevFactorRed
|
||||
DEMOSAIC, // EvPixelShiftStddevFactorBlue
|
||||
DEMOSAIC, // EvPixelShiftNonGreenCross2
|
||||
DEMOSAIC // EvPixelShiftNonGreenAmaze
|
||||
DEMOSAIC // EvPixelShiftStddevFactorBlue
|
||||
|
||||
};
|
||||
|
||||
|
@ -95,12 +95,6 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
|
||||
pixelShiftNonGreenCross = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_PIXELSHIFTNONGREENCROSS")));
|
||||
pixelShiftOptions->pack_start(*pixelShiftNonGreenCross);
|
||||
|
||||
pixelShiftNonGreenCross2 = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_PIXELSHIFTNONGREENCROSS2")));
|
||||
pixelShiftOptions->pack_start(*pixelShiftNonGreenCross2);
|
||||
|
||||
pixelShiftNonGreenAmaze = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_PIXELSHIFTNONGREENAMAZE")));
|
||||
pixelShiftOptions->pack_start(*pixelShiftNonGreenAmaze);
|
||||
|
||||
pixelShiftNonGreenHorizontal = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_PIXELSHIFTNONGREENHORIZONTAL")));
|
||||
pixelShiftOptions->pack_start(*pixelShiftNonGreenHorizontal);
|
||||
|
||||
@ -223,8 +217,7 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
|
||||
pixelShiftNonGreenHorizontalconn = pixelShiftNonGreenHorizontal->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftNonGreenHorizontalChanged), true);
|
||||
pixelShiftNonGreenVerticalconn = pixelShiftNonGreenVertical->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftNonGreenVerticalChanged), true);
|
||||
pixelShiftNonGreenCrossconn = pixelShiftNonGreenCross->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftNonGreenCrossChanged), true);
|
||||
pixelShiftNonGreenCross2conn = pixelShiftNonGreenCross2->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftNonGreenCross2Changed), true);
|
||||
pixelShiftNonGreenAmazeconn = pixelShiftNonGreenAmaze->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::pixelShiftNonGreenAmazeChanged), true);
|
||||
//allEnhconn = allEnhance->signal_toggled().connect ( sigc::mem_fun(*this, &BayerProcess::allEnhanceChanged), true);
|
||||
}
|
||||
|
||||
|
||||
@ -258,8 +251,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
|
||||
pixelShiftNonGreenHorizontal->set_inconsistent(!pedited->raw.bayersensor.pixelShiftNonGreenHorizontal);
|
||||
pixelShiftNonGreenVertical->set_inconsistent(!pedited->raw.bayersensor.pixelShiftNonGreenVertical);
|
||||
pixelShiftNonGreenCross->set_inconsistent(!pedited->raw.bayersensor.pixelShiftNonGreenCross);
|
||||
pixelShiftNonGreenCross2->set_inconsistent(!pedited->raw.bayersensor.pixelShiftNonGreenCross2);
|
||||
pixelShiftNonGreenAmaze->set_inconsistent(!pedited->raw.bayersensor.pixelShiftNonGreenAmaze);
|
||||
//allEnhance->set_inconsistent(!pedited->raw.bayersensor.allEnhance);
|
||||
lmmseIterations->setEditedState ( pedited->raw.bayersensor.lmmseIterations ? Edited : UnEdited);
|
||||
pixelShiftMotion->setEditedState ( pedited->raw.bayersensor.pixelShiftMotion ? Edited : UnEdited);
|
||||
pixelShiftStddevFactorGreen->setEditedState ( pedited->raw.bayersensor.pixelShiftStddevFactorGreen ? Edited : UnEdited);
|
||||
@ -290,8 +282,6 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
|
||||
pixelShiftNonGreenHorizontal->set_active(pp->raw.bayersensor.pixelShiftNonGreenHorizontal);
|
||||
pixelShiftNonGreenVertical->set_active(pp->raw.bayersensor.pixelShiftNonGreenVertical);
|
||||
pixelShiftNonGreenCross->set_active(pp->raw.bayersensor.pixelShiftNonGreenCross);
|
||||
pixelShiftNonGreenCross2->set_active(pp->raw.bayersensor.pixelShiftNonGreenCross2);
|
||||
pixelShiftNonGreenAmaze->set_active(pp->raw.bayersensor.pixelShiftNonGreenAmaze);
|
||||
ccSteps->setValue (pp->raw.bayersensor.ccSteps);
|
||||
lmmseIterations->setValue (pp->raw.bayersensor.lmmse_iterations);
|
||||
pixelShiftMotion->setValue (pp->raw.bayersensor.pixelShiftMotion);
|
||||
@ -365,8 +355,6 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
|
||||
pp->raw.bayersensor.pixelShiftNonGreenHorizontal = pixelShiftNonGreenHorizontal->get_active();
|
||||
pp->raw.bayersensor.pixelShiftNonGreenVertical = pixelShiftNonGreenVertical->get_active();
|
||||
pp->raw.bayersensor.pixelShiftNonGreenCross = pixelShiftNonGreenCross->get_active();
|
||||
pp->raw.bayersensor.pixelShiftNonGreenCross2 = pixelShiftNonGreenCross2->get_active();
|
||||
pp->raw.bayersensor.pixelShiftNonGreenAmaze = pixelShiftNonGreenAmaze->get_active();
|
||||
|
||||
int currentRow = method->get_active_row_number();
|
||||
if( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) {
|
||||
@ -401,8 +389,6 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
|
||||
pedited->raw.bayersensor.pixelShiftNonGreenHorizontal = !pixelShiftNonGreenHorizontal->get_inconsistent();
|
||||
pedited->raw.bayersensor.pixelShiftNonGreenVertical = !pixelShiftNonGreenVertical->get_inconsistent();
|
||||
pedited->raw.bayersensor.pixelShiftNonGreenCross = !pixelShiftNonGreenCross->get_inconsistent();
|
||||
pedited->raw.bayersensor.pixelShiftNonGreenCross2 = !pixelShiftNonGreenCross2->get_inconsistent();
|
||||
pedited->raw.bayersensor.pixelShiftNonGreenAmaze = !pixelShiftNonGreenAmaze->get_inconsistent();
|
||||
}
|
||||
}
|
||||
|
||||
@ -651,8 +637,6 @@ void BayerProcess::pixelShiftAutomaticChanged ()
|
||||
pixelShiftNonGreenHorizontal->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNonGreenVertical->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNonGreenCross->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNonGreenCross2->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNonGreenAmaze->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged (EvPixelShiftAutomatic, pixelShiftAutomatic->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
@ -720,42 +704,21 @@ void BayerProcess::pixelShiftNonGreenCrossChanged ()
|
||||
}
|
||||
}
|
||||
|
||||
void BayerProcess::pixelShiftNonGreenCross2Changed ()
|
||||
|
||||
/*void BayerProcess::allEnhanceChanged ()
|
||||
{
|
||||
if (batchMode) {
|
||||
if (pixelShiftNonGreenCross2->get_inconsistent()) {
|
||||
pixelShiftNonGreenCross2->set_inconsistent (false);
|
||||
pixelShiftNonGreenCross2conn.block (true);
|
||||
pixelShiftNonGreenCross2->set_active (false);
|
||||
pixelShiftNonGreenCross2conn.block (false);
|
||||
} else if (lastDCBen) {
|
||||
pixelShiftNonGreenCross2->set_inconsistent (true);
|
||||
if (allEnhance->get_inconsistent()) {
|
||||
allEnhance->set_inconsistent (false);
|
||||
allEnhconn.block (true);
|
||||
allEnhance->set_active (false);
|
||||
allEnhconn.block (false);
|
||||
}
|
||||
else if (lastALLen)
|
||||
allEnhance->set_inconsistent (true);
|
||||
|
||||
lastDCBen = pixelShiftNonGreenCross2->get_active ();
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged (EvPixelShiftNonGreenCross2, pixelShiftNonGreenCross2->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
void BayerProcess::pixelShiftNonGreenAmazeChanged ()
|
||||
{
|
||||
if (batchMode) {
|
||||
if (pixelShiftNonGreenAmaze->get_inconsistent()) {
|
||||
pixelShiftNonGreenAmaze->set_inconsistent (false);
|
||||
pixelShiftNonGreenAmazeconn.block (true);
|
||||
pixelShiftNonGreenAmaze->set_active (false);
|
||||
pixelShiftNonGreenAmazeconn.block (false);
|
||||
} else if (lastDCBen) {
|
||||
pixelShiftNonGreenAmaze->set_inconsistent (true);
|
||||
}
|
||||
|
||||
lastDCBen = pixelShiftNonGreenAmaze->get_active ();
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged (EvPixelShiftNonGreenAmaze, pixelShiftNonGreenAmaze->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
lastALLen = allEnhance->get_active ();
|
||||
}
|
||||
if (listener)
|
||||
listener->panelChanged (EvDemosaicALLEnhanced, allEnhance->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED"));
|
||||
}*/
|
||||
|
@ -50,8 +50,6 @@ protected:
|
||||
Gtk::CheckButton* pixelShiftNonGreenHorizontal;
|
||||
Gtk::CheckButton* pixelShiftNonGreenVertical;
|
||||
Gtk::CheckButton* pixelShiftNonGreenCross;
|
||||
Gtk::CheckButton* pixelShiftNonGreenCross2;
|
||||
Gtk::CheckButton* pixelShiftNonGreenAmaze;
|
||||
Adjuster* pixelShiftStddevFactorGreen;
|
||||
Adjuster* pixelShiftStddevFactorRed;
|
||||
Adjuster* pixelShiftStddevFactorBlue;
|
||||
@ -61,10 +59,7 @@ protected:
|
||||
bool lastDCBen;
|
||||
int oldMethod;
|
||||
//bool lastALLen;
|
||||
sigc::connection methodconn, imagenumberconn, psmcconn, dcbEnhconn,
|
||||
pixelShiftShowMotionconn, pixelShiftShowMotionMaskOnlyconn, pixelShiftAutomaticconn,
|
||||
pixelShiftNonGreenHorizontalconn, pixelShiftNonGreenVerticalconn, pixelShiftNonGreenCrossconn,
|
||||
pixelShiftNonGreenCross2conn, pixelShiftNonGreenAmazeconn;
|
||||
sigc::connection methodconn, imagenumberconn, psmcconn, dcbEnhconn, pixelShiftShowMotionconn, pixelShiftShowMotionMaskOnlyconn, pixelShiftAutomaticconn, pixelShiftNonGreenHorizontalconn, pixelShiftNonGreenVerticalconn, pixelShiftNonGreenCrossconn; //,allEnhconn;
|
||||
public:
|
||||
|
||||
BayerProcess ();
|
||||
@ -85,8 +80,7 @@ public:
|
||||
void pixelShiftNonGreenHorizontalChanged();
|
||||
void pixelShiftNonGreenVerticalChanged();
|
||||
void pixelShiftNonGreenCrossChanged();
|
||||
void pixelShiftNonGreenCross2Changed();
|
||||
void pixelShiftNonGreenAmazeChanged();
|
||||
//void allEnhanceChanged();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -384,8 +384,6 @@ void ParamsEdited::set (bool v)
|
||||
raw.bayersensor.pixelShiftNonGreenHorizontal = v;
|
||||
raw.bayersensor.pixelShiftNonGreenVertical = v;
|
||||
raw.bayersensor.pixelShiftNonGreenCross = v;
|
||||
raw.bayersensor.pixelShiftNonGreenCross2 = v;
|
||||
raw.bayersensor.pixelShiftNonGreenAmaze = v;
|
||||
raw.bayersensor.greenEq = v;
|
||||
raw.bayersensor.linenoise = v;
|
||||
raw.xtranssensor.method = v;
|
||||
@ -896,8 +894,6 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
raw.bayersensor.pixelShiftNonGreenHorizontal = raw.bayersensor.pixelShiftNonGreenHorizontal && p.raw.bayersensor.pixelShiftNonGreenHorizontal == other.raw.bayersensor.pixelShiftNonGreenHorizontal;
|
||||
raw.bayersensor.pixelShiftNonGreenVertical = raw.bayersensor.pixelShiftNonGreenVertical && p.raw.bayersensor.pixelShiftNonGreenVertical == other.raw.bayersensor.pixelShiftNonGreenVertical;
|
||||
raw.bayersensor.pixelShiftNonGreenCross = raw.bayersensor.pixelShiftNonGreenCross && p.raw.bayersensor.pixelShiftNonGreenCross == other.raw.bayersensor.pixelShiftNonGreenCross;
|
||||
raw.bayersensor.pixelShiftNonGreenCross2 = raw.bayersensor.pixelShiftNonGreenCross2 && p.raw.bayersensor.pixelShiftNonGreenCross2 == other.raw.bayersensor.pixelShiftNonGreenCross2;
|
||||
raw.bayersensor.pixelShiftNonGreenAmaze = raw.bayersensor.pixelShiftNonGreenAmaze && p.raw.bayersensor.pixelShiftNonGreenAmaze == other.raw.bayersensor.pixelShiftNonGreenAmaze;
|
||||
raw.bayersensor.greenEq = raw.bayersensor.greenEq && p.raw.bayersensor.greenthresh == other.raw.bayersensor.greenthresh;
|
||||
raw.bayersensor.linenoise = raw.bayersensor.linenoise && p.raw.bayersensor.linenoise == other.raw.bayersensor.linenoise;
|
||||
raw.xtranssensor.method = raw.xtranssensor.method && p.raw.xtranssensor.method == other.raw.xtranssensor.method;
|
||||
@ -2366,14 +2362,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
toEdit.raw.bayersensor.pixelShiftNonGreenCross = mods.raw.bayersensor.pixelShiftNonGreenCross;
|
||||
}
|
||||
|
||||
if (raw.bayersensor.pixelShiftNonGreenCross2) {
|
||||
toEdit.raw.bayersensor.pixelShiftNonGreenCross2 = mods.raw.bayersensor.pixelShiftNonGreenCross2;
|
||||
}
|
||||
|
||||
if (raw.bayersensor.pixelShiftNonGreenAmaze) {
|
||||
toEdit.raw.bayersensor.pixelShiftNonGreenAmaze = mods.raw.bayersensor.pixelShiftNonGreenAmaze;
|
||||
}
|
||||
|
||||
//if (raw.bayersensor.allEnhance) toEdit.raw.bayersensor.all_enhance = mods.raw.bayersensor.all_enhance;
|
||||
if (raw.bayersensor.greenEq) {
|
||||
toEdit.raw.bayersensor.greenthresh = dontforceSet && options.baBehav[ADDSET_PREPROCESS_GREENEQUIL] ? toEdit.raw.bayersensor.greenthresh + mods.raw.bayersensor.greenthresh : mods.raw.bayersensor.greenthresh;
|
||||
}
|
||||
@ -2886,7 +2875,7 @@ bool RAWParamsEdited::BayerSensor::isUnchanged() const
|
||||
return method && imageNum && dcbIterations && dcbEnhance && lmmseIterations/*&& allEnhance*/ && greenEq
|
||||
&& pixelShiftMotion && pixelShiftMotionCorrection && pixelShiftStddevFactorGreen && pixelShiftStddevFactorRed && pixelShiftStddevFactorBlue && pixelShiftEperIso
|
||||
&& pixelShiftNreadIso && pixelShiftPrnu && pixelshiftShowMotion && pixelshiftShowMotionMaskOnly
|
||||
&& pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftNonGreenCross && pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze
|
||||
&& pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftNonGreenCross
|
||||
&& linenoise && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen;
|
||||
}
|
||||
|
||||
|
@ -706,8 +706,6 @@ public:
|
||||
bool pixelShiftNonGreenHorizontal;
|
||||
bool pixelShiftNonGreenVertical;
|
||||
bool pixelShiftNonGreenCross;
|
||||
bool pixelShiftNonGreenCross2;
|
||||
bool pixelShiftNonGreenAmaze;
|
||||
|
||||
//bool allEnhance;
|
||||
bool greenEq;
|
||||
|
Loading…
x
Reference in New Issue
Block a user