pixelshift: Added new red/blue stddev adjusters for test
This commit is contained in:
parent
d498e5f5c5
commit
49aa9f0c4e
@ -678,7 +678,7 @@ HISTORY_MSG_443;Output Black Point Compensation
|
||||
HISTORY_MSG_444;Raw Sub-Image
|
||||
HISTORY_MSG_445;EvPixelShiftMotion
|
||||
HISTORY_MSG_446;EvPixelShiftMotionCorrection
|
||||
HISTORY_MSG_447;EvPixelShiftStddevFactor
|
||||
HISTORY_MSG_447;EvPixelShiftStddevFactorGreen
|
||||
HISTORY_MSG_448;EvPixelShiftEperIso
|
||||
HISTORY_MSG_449;EvPixelShiftNreadIso
|
||||
HISTORY_MSG_450;EvPixelShiftPrnu
|
||||
@ -688,6 +688,8 @@ HISTORY_MSG_453;EvPixelShiftAutomatic
|
||||
HISTORY_MSG_454;EvPixelShiftNonGreenHorizontal
|
||||
HISTORY_MSG_455;EvPixelShiftNonGreenVertical
|
||||
HISTORY_MSG_456;EvPixelShiftNonGreenCross
|
||||
HISTORY_MSG_457;EvPixelShiftStddevFactorRed
|
||||
HISTORY_MSG_458;EvPixelShiftStddevFactorBlue
|
||||
HISTORY_NEWSNAPSHOT;Add
|
||||
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
|
||||
HISTORY_SNAPSHOT;Snapshot
|
||||
@ -1676,7 +1678,9 @@ TP_RAW_PIXELSHIFTMOTIONCORRECTION;Pixelshift motion correction
|
||||
TP_RAW_PIXELSHIFTMOTIONCORRECTION_TOOLTIP;1 = 2 pixels\n3 = 3x3 grid\n5 = 5x5 grid
|
||||
TP_RAW_PIXELSHIFTSHOWMOTION;Show motion
|
||||
TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;Show mask only
|
||||
TP_RAW_PIXELSHIFTSTDDEVFACTOR;StdDev factor
|
||||
TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green
|
||||
TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red
|
||||
TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue
|
||||
TP_RAW_PIXELSHIFTEPERISO;e per ISO
|
||||
TP_RAW_PIXELSHIFTNREADISO;nRead
|
||||
TP_RAW_PIXELSHIFTPRNU;PRNU (%)
|
||||
|
@ -36,7 +36,7 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
float colourDiff(float a, float b, bool adaptive, float stddevFactor, float eperIso, float nreadIso, float prnu, bool showMotion)
|
||||
float greenDiff(float a, float b, bool adaptive, float stddevFactor, float eperIso, float nreadIso, float prnu, bool showMotion)
|
||||
{
|
||||
// calculate the difference between two green samples
|
||||
if(adaptive) {
|
||||
@ -64,10 +64,9 @@ float colourDiff(float a, float b, bool adaptive, float stddevFactor, float eper
|
||||
}
|
||||
}
|
||||
|
||||
float nonGreenDiff(float a, float b, bool adaptive, float stddevFactor, float eperIso, float nreadIso, float prnu, bool showMotion)
|
||||
float nonGreenDiff(float a, float b, float stddevFactor, float eperIso, float nreadIso, float prnu, bool showMotion)
|
||||
{
|
||||
// calculate the difference between two nongreen samples
|
||||
if(adaptive) {
|
||||
float gDiff = a - b;
|
||||
gDiff *= eperIso;
|
||||
gDiff *= gDiff;
|
||||
@ -84,24 +83,18 @@ float nonGreenDiff(float a, float b, bool adaptive, float stddevFactor, float ep
|
||||
} else {
|
||||
return 0.f;
|
||||
}
|
||||
} else {
|
||||
float gDiff = std::fabs(a - b);
|
||||
// add a small epsilon to avoid division by zero
|
||||
float maxVal = std::max(a, b) + 0.01f;
|
||||
return gDiff / maxVal;
|
||||
}
|
||||
}
|
||||
|
||||
float nonGreenDiffCross(float a, float b, float c, float d, float centre, float stddevFactor, float eperIso, float nreadIso, float prnu, bool showMotion)
|
||||
float nonGreenDiffCross(float right, float left, float top, float bottom, float centre, float stddevFactor, float eperIso, float nreadIso, float prnu, bool showMotion)
|
||||
{
|
||||
// calculate the difference between two nongreen samples
|
||||
float hDiff = (a + b) / 2.f - centre;
|
||||
float hDiff = (right + left) / 2.f - centre;
|
||||
hDiff *= eperIso;
|
||||
hDiff *= hDiff;
|
||||
float vDiff = (c + d) / 2.f - centre;
|
||||
float vDiff = (top + bottom) / 2.f - centre;
|
||||
vDiff *= eperIso;
|
||||
vDiff *= vDiff;
|
||||
float avg = (a + b + c + d) / 4.f;
|
||||
float avg = (right + left + top + bottom) / 4.f;
|
||||
avg *= eperIso;
|
||||
prnu *= avg;
|
||||
float stddev = stddevFactor * (avg + nreadIso + prnu * prnu);
|
||||
@ -110,7 +103,7 @@ float nonGreenDiffCross(float a, float b, float c, float d, float centre, float
|
||||
if(!showMotion) {
|
||||
return result;
|
||||
} else if(result > 0.f) { // for the motion mask
|
||||
return std::sqrt((result / (stddev + result + 0.01f))); //1.f; //std::fabs(a - b) / (std::max(a, b) + 0.01f);
|
||||
return std::sqrt((result / (stddev + result + 0.01f)));
|
||||
} else {
|
||||
return 0.f;
|
||||
}
|
||||
@ -121,7 +114,7 @@ float nonGreenDiffCross(float a, float b, float c, float d, float centre, float
|
||||
using namespace std;
|
||||
using namespace rtengine;
|
||||
|
||||
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 stddevFactor, float eperIso, float nreadIso, float prnu, const std::string &model, float rawWpCorrection, bool checkNonGreenHorizontal, bool checkNonGreenVertical, bool checkNonGreenCross)
|
||||
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)
|
||||
{
|
||||
|
||||
BENCHFUN
|
||||
@ -227,7 +220,7 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
static const float ePerIsoK70 = 0.5f;
|
||||
|
||||
if (plistener) {
|
||||
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift_simple]));
|
||||
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift]));
|
||||
plistener->setProgress(0.0);
|
||||
}
|
||||
|
||||
@ -282,10 +275,12 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
eperIso = eperIsoModel * (100.f / (rawWpCorrection * idata->getISOSpeed()));
|
||||
float eperIsoGreen = eperIso * scaleGreen;
|
||||
|
||||
printf("Pixelshift parameters : gridSize %d\tadaptive %d\tstdDevFactor %f\telectrons %1.8f\tnread %f\tprnu %1.1f\%\n", gridSize, adaptive, stddevFactor, eperIso, nRead, prnu);
|
||||
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;
|
||||
stddevFactor *= stddevFactor;
|
||||
stddevFactorGreen *= stddevFactorGreen;
|
||||
stddevFactorRed *= stddevFactorRed;
|
||||
stddevFactorBlue *= stddevFactorBlue;
|
||||
|
||||
|
||||
nRead *= nRead;
|
||||
@ -333,12 +328,15 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
float scaleNonGreen2 = 1.f / scale_mul[2];
|
||||
float eperIsoNonGreen0 = eperIso / scale_mul[0];
|
||||
float eperIsoNonGreen2 = eperIso / scale_mul[2];
|
||||
float stddevFactorNonGreen0 = stddevFactorRed;
|
||||
float stddevFactorNonGreen2 = stddevFactorBlue;
|
||||
|
||||
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(scaleNonGreen0, scaleNonGreen2);
|
||||
std::swap(eperIsoNonGreen0, eperIsoNonGreen2);
|
||||
std::swap(stddevFactorNonGreen0, stddevFactorNonGreen2);
|
||||
}
|
||||
|
||||
// offset to keep the code short. It changes its value between 0 and 1 for each iteration of the loop
|
||||
@ -350,39 +348,39 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
if(detectMotion || adaptive) {
|
||||
if(gridSize == 3) {
|
||||
// compute maximum of differences for first two columns of 3x3 grid
|
||||
greenDifMax[0] = max(colourDiff((*rawDataFrames[0 + offset])[i + offset][j - 1], (*rawDataFrames[2 + offset])[i - offset + 1][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset][j - 1], (*rawDataFrames[3 - offset])[i + offset - 1][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 2][j - 1], (*rawDataFrames[3 - offset])[i + offset + 1][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[0] = max(greenDiff((*rawDataFrames[0 + offset])[i + offset][j - 1], (*rawDataFrames[2 + offset])[i - offset + 1][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset][j - 1], (*rawDataFrames[3 - offset])[i + offset - 1][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 2][j - 1], (*rawDataFrames[3 - offset])[i + offset + 1][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
greenDifMax[1] = max(colourDiff((*rawDataFrames[1 - offset])[i - offset + 1][j], (*rawDataFrames[3 - offset])[i + offset][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset - 1][j], (*rawDataFrames[2 + offset])[i - offset][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset + 1][j], (*rawDataFrames[2 + offset])[i - offset + 2][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[1] = max(greenDiff((*rawDataFrames[1 - offset])[i - offset + 1][j], (*rawDataFrames[3 - offset])[i + offset][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset - 1][j], (*rawDataFrames[2 + offset])[i - offset][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset + 1][j], (*rawDataFrames[2 + offset])[i - offset + 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
} else if(gridSize == 5) {
|
||||
// compute maximum of differences for first four columns of 5x5 grid
|
||||
greenDifMax[0] = max(colourDiff((*rawDataFrames[1 - offset])[i - offset - 1][j - 2], (*rawDataFrames[3 - offset])[i + offset - 2][j - 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 1][j - 2], (*rawDataFrames[3 - offset])[i + offset][j - 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 3][j - 2], (*rawDataFrames[3 - offset])[i + offset + 2][j - 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset - 1][j - 2], (*rawDataFrames[2 + offset])[i - offset][j - 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset + 1][j - 2], (*rawDataFrames[2 + offset])[i - offset + 2][j - 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[0] = max(greenDiff((*rawDataFrames[1 - offset])[i - offset - 1][j - 2], (*rawDataFrames[3 - offset])[i + offset - 2][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 1][j - 2], (*rawDataFrames[3 - offset])[i + offset][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 3][j - 2], (*rawDataFrames[3 - offset])[i + offset + 2][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset - 1][j - 2], (*rawDataFrames[2 + offset])[i - offset][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset + 1][j - 2], (*rawDataFrames[2 + offset])[i - offset + 2][j - 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
greenDifMax[1] = max(colourDiff((*rawDataFrames[0 + offset])[i + offset - 2][j - 1], (*rawDataFrames[2 + offset])[i - offset - 1][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset][j - 1], (*rawDataFrames[2 + offset])[i - offset + 1][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset + 2][j - 1], (*rawDataFrames[2 + offset])[i - offset + 3][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset][j - 1], (*rawDataFrames[3 - offset])[i + offset - 1][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 2][j - 1], (*rawDataFrames[3 - offset])[i + offset + 1][j], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[1] = max(greenDiff((*rawDataFrames[0 + offset])[i + offset - 2][j - 1], (*rawDataFrames[2 + offset])[i - offset - 1][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset][j - 1], (*rawDataFrames[2 + offset])[i - offset + 1][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset + 2][j - 1], (*rawDataFrames[2 + offset])[i - offset + 3][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset][j - 1], (*rawDataFrames[3 - offset])[i + offset - 1][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 2][j - 1], (*rawDataFrames[3 - offset])[i + offset + 1][j], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
greenDifMax[2] = max(colourDiff((*rawDataFrames[1 - offset])[i - offset - 1][j], (*rawDataFrames[3 - offset])[i + offset - 2][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 1][j], (*rawDataFrames[3 - offset])[i + offset][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 3][j], (*rawDataFrames[3 - offset])[i + offset + 2][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset - 1][j], (*rawDataFrames[2 + offset])[i - offset][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset + 1][j], (*rawDataFrames[2 + offset])[i - offset + 2][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[2] = max(greenDiff((*rawDataFrames[1 - offset])[i - offset - 1][j], (*rawDataFrames[3 - offset])[i + offset - 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 1][j], (*rawDataFrames[3 - offset])[i + offset][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 3][j], (*rawDataFrames[3 - offset])[i + offset + 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset - 1][j], (*rawDataFrames[2 + offset])[i - offset][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset + 1][j], (*rawDataFrames[2 + offset])[i - offset + 2][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
greenDifMax[3] = max(colourDiff((*rawDataFrames[0 + offset])[i + offset - 2][j + 1], (*rawDataFrames[2 + offset])[i - offset - 1][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset][j + 1], (*rawDataFrames[2 + offset])[i - offset + 1][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset + 2][j + 1], (*rawDataFrames[2 + offset])[i - offset + 3][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset][j + 1], (*rawDataFrames[3 - offset])[i + offset - 1][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 2][j + 1], (*rawDataFrames[3 - offset])[i + offset + 1][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[3] = max(greenDiff((*rawDataFrames[0 + offset])[i + offset - 2][j + 1], (*rawDataFrames[2 + offset])[i - offset - 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset][j + 1], (*rawDataFrames[2 + offset])[i - offset + 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset + 2][j + 1], (*rawDataFrames[2 + offset])[i - offset + 3][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset][j + 1], (*rawDataFrames[3 - offset])[i + offset - 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 2][j + 1], (*rawDataFrames[3 - offset])[i + offset + 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -402,22 +400,22 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
|
||||
if(gridSize < 2) {
|
||||
// compute difference for current pixel and skip next pixel, that's the method from dcrawps
|
||||
gridMax = colourDiff((*rawDataFrames[1 - offset])[i - offset + 1][j], (*rawDataFrames[3 - offset])[i + offset][j + 1], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion);
|
||||
gridMax = greenDiff((*rawDataFrames[1 - offset])[i - offset + 1][j], (*rawDataFrames[3 - offset])[i + offset][j + 1], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion);
|
||||
skipNext = skip && !showMotion ;
|
||||
} else if(gridSize == 3) {
|
||||
// compute maximum of differences for third column of 3x3 grid and save at position lastIndex
|
||||
greenDifMax[lastIndex] = max(colourDiff((*rawDataFrames[0 + offset])[i + offset][j + 1], (*rawDataFrames[2 + offset])[i - offset + 1][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset][j + 1], (*rawDataFrames[3 - offset])[i + offset - 1][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 2][j + 1], (*rawDataFrames[3 - offset])[i + offset + 1][j + 2], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[lastIndex] = max(greenDiff((*rawDataFrames[0 + offset])[i + offset][j + 1], (*rawDataFrames[2 + offset])[i - offset + 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset][j + 1], (*rawDataFrames[3 - offset])[i + offset - 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 2][j + 1], (*rawDataFrames[3 - offset])[i + offset + 1][j + 2], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
gridMax = 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] = max(colourDiff((*rawDataFrames[1 - offset])[i - offset - 1][j + 2], (*rawDataFrames[3 - offset])[i + offset - 2][j + 3], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 1][j + 2], (*rawDataFrames[3 - offset])[i + offset][j + 3], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[1 - offset])[i - offset + 3][j + 2], (*rawDataFrames[3 - offset])[i + offset + 2][j + 3], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset - 1][j + 2], (*rawDataFrames[2 + offset])[i - offset][j + 3], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion),
|
||||
colourDiff((*rawDataFrames[0 + offset])[i + offset + 1][j + 2], (*rawDataFrames[2 + offset])[i - offset + 2][j + 3], adaptive, stddevFactor, eperIsoGreen, nRead, prnu, showMotion)
|
||||
greenDifMax[lastIndex] = max(greenDiff((*rawDataFrames[1 - offset])[i - offset - 1][j + 2], (*rawDataFrames[3 - offset])[i + offset - 2][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 1][j + 2], (*rawDataFrames[3 - offset])[i + offset][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[1 - offset])[i - offset + 3][j + 2], (*rawDataFrames[3 - offset])[i + offset + 2][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset - 1][j + 2], (*rawDataFrames[2 + offset])[i - offset][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion),
|
||||
greenDiff((*rawDataFrames[0 + offset])[i + offset + 1][j + 2], (*rawDataFrames[2 + offset])[i - offset + 2][j + 3], adaptive, stddevFactorGreen, eperIsoGreen, nRead, prnu, showMotion)
|
||||
);
|
||||
gridMax = max(greenDifMax[0], greenDifMax[1], greenDifMax[2], greenDifMax[3], greenDifMax[4]);
|
||||
}
|
||||
@ -456,12 +454,12 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenCross) {
|
||||
float ng1 = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
float ng0 = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) + 1];
|
||||
float ng2 = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) - 1];
|
||||
float ng3 = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i][j + offset];
|
||||
float ng4 = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i + 2][j + offset];
|
||||
float gridMax = nonGreenDiffCross(ng0, ng2, ng3, ng4, ng1, stddevFactor, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
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 gridMax = nonGreenDiffCross(ngRight, ngLeft, ngTop, ngBottom, ngCentre, stddevFactorNonGreen0, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
|
||||
if(gridMax > 0.f) {
|
||||
if(showMotion) {
|
||||
@ -479,12 +477,12 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
continue;
|
||||
}
|
||||
|
||||
ng1 = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1];
|
||||
ng0 = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1) + 2];
|
||||
ng2 = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1)];
|
||||
ng3 = (*rawDataFrames[3 - ((offset << 1) + offset)])[i - 1][j - offset + 1];
|
||||
ng4 = (*rawDataFrames[3 - ((offset << 1) + offset)])[i + 1][j - offset + 1];
|
||||
gridMax = nonGreenDiffCross(ng0, ng2, ng3, ng4, ng1, stddevFactor, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
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];
|
||||
gridMax = nonGreenDiffCross(ngRight, ngLeft, ngTop, ngBottom, ngCentre, stddevFactorNonGreen2, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
|
||||
if(gridMax > 0.f) {
|
||||
if(showMotion) {
|
||||
@ -504,15 +502,15 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenHorizontal) {
|
||||
float ng1 = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
float ng0 = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) + 1];
|
||||
float ng2 = (*rawDataFrames[((offset ^ 1) << 1) + (offset ^ 1)])[i][j + (offset ^ 1) - 1];
|
||||
float diff0 = ng0 - ng1;
|
||||
float diff2 = ng2 - ng1;
|
||||
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 diff2 = ngLeft - ngCentre;
|
||||
|
||||
if(diff0 * diff2 >= 0.f) {
|
||||
float val = (ng0 + ng2) / 2.f;
|
||||
float gridMax = nonGreenDiff(ng1, val, true, stddevFactor, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
if(diffRight * diff2 >= 0.f) {
|
||||
float val = (ngRight + ngLeft) / 2.f;
|
||||
float gridMax = nonGreenDiff(ngCentre, val, stddevFactorNonGreen0, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
|
||||
if(gridMax > 0.f) {
|
||||
if(showMotion) {
|
||||
@ -531,15 +529,15 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
}
|
||||
}
|
||||
|
||||
ng1 = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1];
|
||||
ng0 = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1) + 2];
|
||||
ng2 = (*rawDataFrames[2 - (offset ^ 1)])[i + 1][j - (offset ^ 1)];
|
||||
diff0 = ng0 - ng1;
|
||||
diff2 = ng2 - ng1;
|
||||
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;
|
||||
diff2 = ngLeft - ngCentre;
|
||||
|
||||
if(diff0 * diff2 >= 0.f) {
|
||||
float val = (ng0 + ng2) / 2.f;
|
||||
float gridMax = nonGreenDiff(ng1, val, true, stddevFactor, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
if(diffRight * diff2 >= 0.f) {
|
||||
float val = (ngRight + ngLeft) / 2.f;
|
||||
float gridMax = nonGreenDiff(ngCentre, val, stddevFactorNonGreen2, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
|
||||
if(gridMax > 0.f) {
|
||||
if(showMotion) {
|
||||
@ -560,16 +558,16 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
}
|
||||
|
||||
if(adaptive && checkNonGreenVertical) {
|
||||
float ng1 = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
float ng0 = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i][j + offset];
|
||||
float ng2 = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i + 2][j + offset];
|
||||
float ngCentre = (*rawDataFrames[(offset << 1) + offset])[i][j + offset];
|
||||
float ngTop = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i][j + offset];
|
||||
float ngBottom = (*rawDataFrames[((offset << 1) + offset) ^ 1])[i + 2][j + offset];
|
||||
|
||||
float diff0 = ng0 - ng1;
|
||||
float diff2 = ng2 - ng1;
|
||||
float diffTop = ngTop - ngCentre;
|
||||
float diffBottom = ngBottom - ngCentre;
|
||||
|
||||
if(diff0 * diff2 >= 0.f) {
|
||||
float val = (ng0 + ng2) / 2.f;
|
||||
float gridMax = nonGreenDiff(ng1, val, true, stddevFactor, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
if(diffTop * diffBottom >= 0.f) {
|
||||
float val = (ngTop + ngBottom) / 2.f;
|
||||
float gridMax = nonGreenDiff(ngCentre, val, stddevFactorNonGreen0, eperIsoNonGreen0, nRead, prnu, showMotion);
|
||||
|
||||
if(gridMax > 0.f) {
|
||||
if(showMotion) {
|
||||
@ -588,16 +586,16 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, bool det
|
||||
}
|
||||
}
|
||||
|
||||
ng1 = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1];
|
||||
ng0 = (*rawDataFrames[3 - ((offset << 1) + offset)])[i - 1][j - offset + 1];
|
||||
ng2 = (*rawDataFrames[3 - ((offset << 1) + offset)])[i + 1][j - offset + 1];
|
||||
ngCentre = (*rawDataFrames[2 - offset])[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];
|
||||
|
||||
diff0 = ng0 - ng1;
|
||||
diff2 = ng2 - ng1;
|
||||
diffTop = ngTop - ngCentre;
|
||||
diffBottom = ngBottom - ngCentre;
|
||||
|
||||
if(diff0 * diff2 >= 0.f) {
|
||||
float val = (ng0 + ng2) / 2.f;
|
||||
float gridMax = nonGreenDiff(ng1, val, true, stddevFactor, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
if(diffTop * diffBottom >= 0.f) {
|
||||
float val = (ngTop + ngBottom) / 2.f;
|
||||
float gridMax = nonGreenDiff(ngCentre, val, stddevFactorNonGreen2, eperIsoNonGreen2, nRead, prnu, showMotion);
|
||||
|
||||
if(gridMax > 0.f) {
|
||||
if(showMotion) {
|
||||
|
@ -473,7 +473,7 @@ enum ProcEvent {
|
||||
EvRawImageNum = 443,
|
||||
EvPixelShiftMotion = 444,
|
||||
EvPixelShiftMotionCorrection = 445,
|
||||
EvPixelShiftStddevFactor = 446,
|
||||
EvPixelShiftStddevFactorGreen = 446,
|
||||
EvPixelShiftEperIso = 447,
|
||||
EvPixelShiftNreadIso = 448,
|
||||
EvPixelShiftPrnu = 449,
|
||||
@ -483,6 +483,8 @@ enum ProcEvent {
|
||||
EvPixelShiftNonGreenHorizontal = 453,
|
||||
EvPixelShiftNonGreenVertical = 454,
|
||||
EvPixelShiftNonGreenCross = 455,
|
||||
EvPixelShiftStddevFactorRed = 456,
|
||||
EvPixelShiftStddevFactorBlue = 457,
|
||||
NUMOFEVENTS
|
||||
|
||||
};
|
||||
|
@ -887,7 +887,9 @@ void RAWParams::setDefaults()
|
||||
bayersensor.lmmse_iterations = 2;
|
||||
bayersensor.pixelShiftMotion = 0;
|
||||
bayersensor.pixelShiftMotionCorrection = RAWParams::BayerSensor::Grid1x2;
|
||||
bayersensor.pixelShiftStddevFactor = 3.0;
|
||||
bayersensor.pixelShiftStddevFactorGreen = 3.0;
|
||||
bayersensor.pixelShiftStddevFactorRed = 3.0;
|
||||
bayersensor.pixelShiftStddevFactorBlue = 3.0;
|
||||
bayersensor.pixelShiftEperIso = 0.0;
|
||||
bayersensor.pixelShiftNreadIso = 0.0;
|
||||
bayersensor.pixelShiftPrnu = 1.0;
|
||||
@ -3384,8 +3386,16 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b
|
||||
keyFile.set_integer ("RAW Bayer", "PixelShiftMotionCorrection", raw.bayersensor.pixelShiftMotionCorrection );
|
||||
}
|
||||
|
||||
if (!pedited || pedited->raw.bayersensor.pixelShiftStddevFactor) {
|
||||
keyFile.set_double ("RAW Bayer", "PixelShiftStddevFactor", raw.bayersensor.pixelShiftStddevFactor );
|
||||
if (!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorGreen) {
|
||||
keyFile.set_double ("RAW Bayer", "pixelShiftStddevFactorGreen", raw.bayersensor.pixelShiftStddevFactorGreen );
|
||||
}
|
||||
|
||||
if (!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorRed) {
|
||||
keyFile.set_double ("RAW Bayer", "pixelShiftStddevFactorRed", raw.bayersensor.pixelShiftStddevFactorRed );
|
||||
}
|
||||
|
||||
if (!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorBlue) {
|
||||
keyFile.set_double ("RAW Bayer", "pixelShiftStddevFactorBlue", raw.bayersensor.pixelShiftStddevFactorBlue );
|
||||
}
|
||||
|
||||
if (!pedited || pedited->raw.bayersensor.pixelShiftEperIso) {
|
||||
@ -7498,11 +7508,27 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited)
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key ("RAW Bayer", "PixelShiftStddevFactor")) {
|
||||
raw.bayersensor.pixelShiftStddevFactor = keyFile.get_double("RAW Bayer", "PixelShiftStddevFactor");
|
||||
if (keyFile.has_key ("RAW Bayer", "pixelShiftStddevFactorGreen")) {
|
||||
raw.bayersensor.pixelShiftStddevFactorGreen = keyFile.get_double("RAW Bayer", "pixelShiftStddevFactorGreen");
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactor = true;
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactorGreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key ("RAW Bayer", "pixelShiftStddevFactorRed")) {
|
||||
raw.bayersensor.pixelShiftStddevFactorRed = keyFile.get_double("RAW Bayer", "pixelShiftStddevFactorRed");
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactorRed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_key ("RAW Bayer", "pixelShiftStddevFactorBlue")) {
|
||||
raw.bayersensor.pixelShiftStddevFactorBlue = keyFile.get_double("RAW Bayer", "pixelShiftStddevFactorBlue");
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactorBlue = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8019,7 +8045,9 @@ bool ProcParams::operator== (const ProcParams& other)
|
||||
&& raw.bayersensor.lmmse_iterations == other.raw.bayersensor.lmmse_iterations
|
||||
&& raw.bayersensor.pixelShiftMotion == other.raw.bayersensor.pixelShiftMotion
|
||||
&& raw.bayersensor.pixelShiftMotionCorrection == other.raw.bayersensor.pixelShiftMotionCorrection
|
||||
&& raw.bayersensor.pixelShiftStddevFactor == other.raw.bayersensor.pixelShiftStddevFactor
|
||||
&& raw.bayersensor.pixelShiftStddevFactorGreen == other.raw.bayersensor.pixelShiftStddevFactorGreen
|
||||
&& raw.bayersensor.pixelShiftStddevFactorRed == other.raw.bayersensor.pixelShiftStddevFactorRed
|
||||
&& raw.bayersensor.pixelShiftStddevFactorBlue == other.raw.bayersensor.pixelShiftStddevFactorBlue
|
||||
&& raw.bayersensor.pixelShiftEperIso == other.raw.bayersensor.pixelShiftEperIso
|
||||
&& raw.bayersensor.pixelShiftNreadIso == other.raw.bayersensor.pixelShiftNreadIso
|
||||
&& raw.bayersensor.pixelShiftPrnu == other.raw.bayersensor.pixelShiftPrnu
|
||||
|
@ -1165,7 +1165,7 @@ public:
|
||||
public:
|
||||
//enum eMethod{ eahd,hphd,vng4,dcb,amaze,ahd,IGV_noise,fast,
|
||||
//numMethods }; // This MUST be the last enum
|
||||
enum eMethod { amaze, igv, lmmse, eahd, hphd, vng4, dcb, ahd, fast, mono, none, pixelshift_simple,
|
||||
enum eMethod { amaze, igv, lmmse, eahd, hphd, vng4, dcb, ahd, fast, mono, none, pixelshift,
|
||||
numMethods
|
||||
}; // This MUST be the last enum
|
||||
enum ePSMotionCorrection {
|
||||
@ -1187,7 +1187,9 @@ public:
|
||||
int lmmse_iterations;
|
||||
int pixelShiftMotion;
|
||||
ePSMotionCorrection pixelShiftMotionCorrection;
|
||||
double pixelShiftStddevFactor;
|
||||
double pixelShiftStddevFactorGreen;
|
||||
double pixelShiftStddevFactorRed;
|
||||
double pixelShiftStddevFactorBlue;
|
||||
double pixelShiftEperIso;
|
||||
double pixelShiftNreadIso;
|
||||
double pixelShiftPrnu;
|
||||
|
@ -1966,7 +1966,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
|
||||
plistener->setProgressStr ("CA Auto Correction...");
|
||||
plistener->setProgress (0.0);
|
||||
}
|
||||
if(numFrames == 4 && raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift_simple]) {
|
||||
if(numFrames == 4 && raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift]) {
|
||||
for(int i=0; i<4; ++i) {
|
||||
CA_correct_RT(raw.cared, raw.cablue, 10.0 - raw.caautostrength, *rawDataFrames[i]);
|
||||
}
|
||||
@ -2022,12 +2022,12 @@ void RawImageSource::demosaic(const RAWParams &raw)
|
||||
ahd_demosaic (0, 0, W, H);
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::amaze] ) {
|
||||
amaze_demosaic_RT (0, 0, W, H);
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift_simple] ) {
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift] ) {
|
||||
if(raw.bayersensor.pixelShiftMotion > 0 || raw.bayersensor.pixelShiftAutomatic) {
|
||||
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.pixelShiftStddevFactor, raw.bayersensor.pixelShiftEperIso, raw.bayersensor.pixelShiftNreadIso, raw.bayersensor.pixelShiftPrnu, ri->get_model(), raw.expos, raw.bayersensor.pixelShiftNonGreenHorizontal, raw.bayersensor.pixelShiftNonGreenVertical, raw.bayersensor.pixelShiftNonGreenCross);
|
||||
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 stddevFactor, float eperIso, float nreadIso, float prnu, const std::string &model, float rawWpCorrection, bool checkNonGreenHorizontal, bool checkNonGreenVertical, bool checkNonGreenCross);
|
||||
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);
|
||||
|
||||
|
@ -473,7 +473,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
|
||||
DARKFRAME, // EvRawImageNum
|
||||
DEMOSAIC, // EvPixelShiftMotion
|
||||
DEMOSAIC, // EvPixelShiftMotionCorrection
|
||||
DEMOSAIC, // EvPixelShiftStddevFactor
|
||||
DEMOSAIC, // EvPixelShiftStddevFactorGreen
|
||||
DEMOSAIC, // EvPixelShiftEperIso
|
||||
DEMOSAIC, // EvPixelShiftNreadIso
|
||||
DEMOSAIC, // EvPixelShiftPrnu
|
||||
@ -482,7 +482,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
|
||||
DEMOSAIC, // EvPixelShiftAutomatic
|
||||
DEMOSAIC, // EvPixelShiftNonGreenHorizontal
|
||||
DEMOSAIC, // EvPixelShiftNonGreenVertical
|
||||
DEMOSAIC // EvPixelShiftNonGreenCross
|
||||
DEMOSAIC, // EvPixelShiftNonGreenCross
|
||||
DEMOSAIC, // EvPixelShiftStddevFactorRed
|
||||
DEMOSAIC // EvPixelShiftStddevFactorBlue
|
||||
|
||||
};
|
||||
|
||||
|
@ -124,20 +124,38 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
|
||||
hb2->pack_start(*pixelShiftMotionCorrection);
|
||||
pixelShiftOptions->pack_start(*hb2);
|
||||
|
||||
pixelShiftStddevFactor = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTSTDDEVFACTOR"), 2, 8, 0.1, 3));
|
||||
pixelShiftStddevFactor->setAdjusterListener (this);
|
||||
// pixelShiftStddevFactor->set_tooltip_markup (M("TP_RAW_PIXELSHIFTSTDDEVFACTOR_TOOLTIP"));
|
||||
pixelShiftStddevFactorGreen = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN"), 2, 8, 0.1, 3));
|
||||
pixelShiftStddevFactorGreen->setAdjusterListener (this);
|
||||
|
||||
if (pixelShiftStddevFactor->delay < options.adjusterMaxDelay) {
|
||||
pixelShiftStddevFactor->delay = options.adjusterMaxDelay;
|
||||
if (pixelShiftStddevFactorGreen->delay < options.adjusterMaxDelay) {
|
||||
pixelShiftStddevFactorGreen->delay = options.adjusterMaxDelay;
|
||||
}
|
||||
|
||||
pixelShiftStddevFactor->show();
|
||||
pixelShiftOptions->pack_start(*pixelShiftStddevFactor);
|
||||
pixelShiftStddevFactorGreen->show();
|
||||
pixelShiftOptions->pack_start(*pixelShiftStddevFactorGreen);
|
||||
|
||||
pixelShiftStddevFactorRed = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTSTDDEVFACTORRED"), 1, 8, 0.1, 3));
|
||||
pixelShiftStddevFactorRed->setAdjusterListener (this);
|
||||
|
||||
if (pixelShiftStddevFactorRed->delay < options.adjusterMaxDelay) {
|
||||
pixelShiftStddevFactorRed->delay = options.adjusterMaxDelay;
|
||||
}
|
||||
|
||||
pixelShiftStddevFactorRed->show();
|
||||
pixelShiftOptions->pack_start(*pixelShiftStddevFactorRed);
|
||||
|
||||
pixelShiftStddevFactorBlue = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE"), 1, 8, 0.1, 3));
|
||||
pixelShiftStddevFactorBlue->setAdjusterListener (this);
|
||||
|
||||
if (pixelShiftStddevFactorBlue->delay < options.adjusterMaxDelay) {
|
||||
pixelShiftStddevFactorBlue->delay = options.adjusterMaxDelay;
|
||||
}
|
||||
|
||||
pixelShiftStddevFactorBlue->show();
|
||||
pixelShiftOptions->pack_start(*pixelShiftStddevFactorBlue);
|
||||
|
||||
pixelShiftEperIso = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTEPERISO"), -2.0, 2.0, 0.05, 0.0));
|
||||
pixelShiftEperIso->setAdjusterListener (this);
|
||||
// pixelShiftStddevFactor->set_tooltip_markup (M("TP_RAW_PIXELSHIFTSTDDEVFACTOR_TOOLTIP"));
|
||||
|
||||
if (pixelShiftEperIso->delay < options.adjusterMaxDelay) {
|
||||
pixelShiftEperIso->delay = options.adjusterMaxDelay;
|
||||
@ -148,7 +166,6 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
|
||||
|
||||
pixelShiftNreadIso = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTNREADISO"), -2.0, 2.0, 0.05, 0.0));
|
||||
pixelShiftNreadIso->setAdjusterListener (this);
|
||||
// pixelShiftStddevFactor->set_tooltip_markup (M("TP_RAW_PIXELSHIFTSTDDEVFACTOR_TOOLTIP"));
|
||||
|
||||
if (pixelShiftNreadIso->delay < options.adjusterMaxDelay) {
|
||||
pixelShiftNreadIso->delay = options.adjusterMaxDelay;
|
||||
@ -160,7 +177,6 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
|
||||
|
||||
pixelShiftPrnu = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTPRNU"), 0.3, 2.0, 0.1, 1.0));
|
||||
pixelShiftPrnu->setAdjusterListener (this);
|
||||
// pixelShiftStddevFactor->set_tooltip_markup (M("TP_RAW_PIXELSHIFTSTDDEVFACTOR_TOOLTIP"));
|
||||
|
||||
if (pixelShiftPrnu->delay < options.adjusterMaxDelay) {
|
||||
pixelShiftPrnu->delay = options.adjusterMaxDelay;
|
||||
@ -237,7 +253,9 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
|
||||
//allEnhance->set_inconsistent(!pedited->raw.bayersensor.allEnhance);
|
||||
lmmseIterations->setEditedState ( pedited->raw.bayersensor.lmmseIterations ? Edited : UnEdited);
|
||||
pixelShiftMotion->setEditedState ( pedited->raw.bayersensor.pixelShiftMotion ? Edited : UnEdited);
|
||||
pixelShiftStddevFactor->setEditedState ( pedited->raw.bayersensor.pixelShiftStddevFactor ? Edited : UnEdited);
|
||||
pixelShiftStddevFactorGreen->setEditedState ( pedited->raw.bayersensor.pixelShiftStddevFactorGreen ? Edited : UnEdited);
|
||||
pixelShiftStddevFactorRed->setEditedState ( pedited->raw.bayersensor.pixelShiftStddevFactorRed ? Edited : UnEdited);
|
||||
pixelShiftStddevFactorBlue->setEditedState ( pedited->raw.bayersensor.pixelShiftStddevFactorBlue ? Edited : UnEdited);
|
||||
pixelShiftEperIso->setEditedState ( pedited->raw.bayersensor.pixelShiftEperIso ? Edited : UnEdited);
|
||||
pixelShiftNreadIso->setEditedState ( pedited->raw.bayersensor.pixelShiftNreadIso ? Edited : UnEdited);
|
||||
pixelShiftPrnu->setEditedState ( pedited->raw.bayersensor.pixelShiftPrnu ? Edited : UnEdited);
|
||||
@ -267,7 +285,9 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
|
||||
lmmseIterations->setValue (pp->raw.bayersensor.lmmse_iterations);
|
||||
pixelShiftMotion->setValue (pp->raw.bayersensor.pixelShiftMotion);
|
||||
pixelShiftMotionCorrection->set_active ((int)pp->raw.bayersensor.pixelShiftMotionCorrection);
|
||||
pixelShiftStddevFactor->setValue (pp->raw.bayersensor.pixelShiftStddevFactor);
|
||||
pixelShiftStddevFactorGreen->setValue (pp->raw.bayersensor.pixelShiftStddevFactorGreen);
|
||||
pixelShiftStddevFactorRed->setValue (pp->raw.bayersensor.pixelShiftStddevFactorRed);
|
||||
pixelShiftStddevFactorBlue->setValue (pp->raw.bayersensor.pixelShiftStddevFactorBlue);
|
||||
pixelShiftEperIso->setValue (pp->raw.bayersensor.pixelShiftEperIso);
|
||||
pixelShiftNreadIso->setValue (pp->raw.bayersensor.pixelShiftNreadIso);
|
||||
pixelShiftPrnu->setValue (pp->raw.bayersensor.pixelShiftPrnu);
|
||||
@ -285,7 +305,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
|
||||
} else {
|
||||
lmmseOptions->hide();
|
||||
}
|
||||
if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift_simple] ||
|
||||
if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift] ||
|
||||
method->get_active_row_number() == procparams::RAWParams::BayerSensor::numMethods) {
|
||||
pixelShiftOptions->show();
|
||||
} else {
|
||||
@ -322,7 +342,9 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
|
||||
pp->raw.bayersensor.lmmse_iterations = lmmseIterations->getIntValue();
|
||||
pp->raw.bayersensor.pixelShiftMotion = pixelShiftMotion->getIntValue();
|
||||
pp->raw.bayersensor.pixelShiftMotionCorrection = (RAWParams::BayerSensor::ePSMotionCorrection)pixelShiftMotionCorrection->get_active_row_number();
|
||||
pp->raw.bayersensor.pixelShiftStddevFactor = pixelShiftStddevFactor->getValue();
|
||||
pp->raw.bayersensor.pixelShiftStddevFactorGreen = pixelShiftStddevFactorGreen->getValue();
|
||||
pp->raw.bayersensor.pixelShiftStddevFactorRed = pixelShiftStddevFactorRed->getValue();
|
||||
pp->raw.bayersensor.pixelShiftStddevFactorBlue = pixelShiftStddevFactorBlue->getValue();
|
||||
pp->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getValue();
|
||||
pp->raw.bayersensor.pixelShiftNreadIso = pixelShiftNreadIso->getValue();
|
||||
pp->raw.bayersensor.pixelShiftPrnu = pixelShiftPrnu->getValue();
|
||||
@ -354,7 +376,9 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
|
||||
pedited->raw.bayersensor.lmmseIterations = lmmseIterations->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftMotion = pixelShiftMotion->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftMotionCorrection = pixelShiftMotionCorrection->get_active_text() != M("GENERAL_UNCHANGED");
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactor = pixelShiftStddevFactor->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactorGreen = pixelShiftStddevFactorGreen->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactorRed = pixelShiftStddevFactorRed->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftStddevFactorBlue = pixelShiftStddevFactorBlue->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftNreadIso = pixelShiftNreadIso->getEditedState ();
|
||||
pedited->raw.bayersensor.pixelShiftPrnu = pixelShiftPrnu->getEditedState ();
|
||||
@ -383,7 +407,9 @@ void BayerProcess::setBatchMode(bool batchMode)
|
||||
dcbIterations->showEditedCB ();
|
||||
lmmseIterations->showEditedCB ();
|
||||
pixelShiftMotion->showEditedCB ();
|
||||
pixelShiftStddevFactor->showEditedCB ();
|
||||
pixelShiftStddevFactorGreen->showEditedCB ();
|
||||
pixelShiftStddevFactorRed->showEditedCB ();
|
||||
pixelShiftStddevFactorBlue->showEditedCB ();
|
||||
pixelShiftEperIso->showEditedCB ();
|
||||
pixelShiftNreadIso->showEditedCB ();
|
||||
pixelShiftPrnu->showEditedCB ();
|
||||
@ -394,7 +420,9 @@ void BayerProcess::setDefaults(const rtengine::procparams::ProcParams* defParams
|
||||
dcbIterations->setDefault( defParams->raw.bayersensor.dcb_iterations);
|
||||
lmmseIterations->setDefault( defParams->raw.bayersensor.lmmse_iterations);
|
||||
pixelShiftMotion->setDefault( defParams->raw.bayersensor.pixelShiftMotion);
|
||||
pixelShiftStddevFactor->setDefault( defParams->raw.bayersensor.pixelShiftStddevFactor);
|
||||
pixelShiftStddevFactorGreen->setDefault( defParams->raw.bayersensor.pixelShiftStddevFactorGreen);
|
||||
pixelShiftStddevFactorRed->setDefault( defParams->raw.bayersensor.pixelShiftStddevFactorRed);
|
||||
pixelShiftStddevFactorBlue->setDefault( defParams->raw.bayersensor.pixelShiftStddevFactorBlue);
|
||||
pixelShiftEperIso->setDefault( defParams->raw.bayersensor.pixelShiftEperIso);
|
||||
pixelShiftNreadIso->setDefault( defParams->raw.bayersensor.pixelShiftNreadIso);
|
||||
pixelShiftPrnu->setDefault( defParams->raw.bayersensor.pixelShiftPrnu);
|
||||
@ -404,7 +432,9 @@ void BayerProcess::setDefaults(const rtengine::procparams::ProcParams* defParams
|
||||
dcbIterations->setDefaultEditedState( pedited->raw.bayersensor.dcbIterations ? Edited : UnEdited);
|
||||
lmmseIterations->setDefaultEditedState( pedited->raw.bayersensor.lmmseIterations ? Edited : UnEdited);
|
||||
pixelShiftMotion->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftMotion ? Edited : UnEdited);
|
||||
pixelShiftStddevFactor->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftStddevFactor ? Edited : UnEdited);
|
||||
pixelShiftStddevFactorGreen->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftStddevFactorGreen ? Edited : UnEdited);
|
||||
pixelShiftStddevFactorRed->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftStddevFactorRed ? Edited : UnEdited);
|
||||
pixelShiftStddevFactorBlue->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftStddevFactorBlue ? Edited : UnEdited);
|
||||
pixelShiftEperIso->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftEperIso ? Edited : UnEdited);
|
||||
pixelShiftNreadIso->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftNreadIso ? Edited : UnEdited);
|
||||
pixelShiftPrnu->setDefaultEditedState( pedited->raw.bayersensor.pixelShiftPrnu ? Edited : UnEdited);
|
||||
@ -413,7 +443,9 @@ void BayerProcess::setDefaults(const rtengine::procparams::ProcParams* defParams
|
||||
dcbIterations->setDefaultEditedState( Irrelevant );
|
||||
lmmseIterations->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftMotion->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftStddevFactor->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftStddevFactorGreen->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftStddevFactorRed->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftStddevFactorBlue->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftEperIso->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftNreadIso->setDefaultEditedState( Irrelevant );
|
||||
pixelShiftPrnu->setDefaultEditedState( Irrelevant );
|
||||
@ -432,8 +464,12 @@ void BayerProcess::adjusterChanged (Adjuster* a, double newval)
|
||||
listener->panelChanged (EvDemosaicLMMSEIter, a->getTextValue() );
|
||||
} else if (a == pixelShiftMotion) {
|
||||
listener->panelChanged (EvPixelShiftMotion, a->getTextValue() );
|
||||
} else if (a == pixelShiftStddevFactor) {
|
||||
listener->panelChanged (EvPixelShiftStddevFactor, a->getTextValue() );
|
||||
} else if (a == pixelShiftStddevFactorGreen) {
|
||||
listener->panelChanged (EvPixelShiftStddevFactorGreen, a->getTextValue() );
|
||||
} else if (a == pixelShiftStddevFactorRed) {
|
||||
listener->panelChanged (EvPixelShiftStddevFactorRed, a->getTextValue() );
|
||||
} else if (a == pixelShiftStddevFactorBlue) {
|
||||
listener->panelChanged (EvPixelShiftStddevFactorBlue, a->getTextValue() );
|
||||
} else if (a == pixelShiftEperIso) {
|
||||
listener->panelChanged (EvPixelShiftEperIso, a->getTextValue() );
|
||||
} else if (a == pixelShiftNreadIso) {
|
||||
@ -485,7 +521,7 @@ void BayerProcess::methodChanged ()
|
||||
lmmseOptions->hide();
|
||||
}
|
||||
|
||||
if ( curSelection == procparams::RAWParams::BayerSensor::pixelshift_simple) {
|
||||
if ( curSelection == procparams::RAWParams::BayerSensor::pixelshift) {
|
||||
pixelShiftOptions->show();
|
||||
} else {
|
||||
pixelShiftOptions->hide();
|
||||
@ -594,7 +630,9 @@ void BayerProcess::pixelShiftAutomaticChanged ()
|
||||
pixelShiftEperIso->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNreadIso->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftPrnu->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftStddevFactor->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftStddevFactorGreen->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftStddevFactorRed->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftStddevFactorBlue->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNonGreenHorizontal->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNonGreenVertical->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
pixelShiftNonGreenCross->set_sensitive(pixelShiftAutomatic->get_active ());
|
||||
|
@ -50,7 +50,9 @@ protected:
|
||||
Gtk::CheckButton* pixelShiftNonGreenHorizontal;
|
||||
Gtk::CheckButton* pixelShiftNonGreenVertical;
|
||||
Gtk::CheckButton* pixelShiftNonGreenCross;
|
||||
Adjuster* pixelShiftStddevFactor;
|
||||
Adjuster* pixelShiftStddevFactorGreen;
|
||||
Adjuster* pixelShiftStddevFactorRed;
|
||||
Adjuster* pixelShiftStddevFactorBlue;
|
||||
Adjuster* pixelShiftEperIso;
|
||||
Adjuster* pixelShiftNreadIso;
|
||||
Adjuster* pixelShiftPrnu;
|
||||
|
@ -372,7 +372,9 @@ void ParamsEdited::set (bool v)
|
||||
raw.bayersensor.lmmseIterations = v;
|
||||
raw.bayersensor.pixelShiftMotion = v;
|
||||
raw.bayersensor.pixelShiftMotionCorrection = v;
|
||||
raw.bayersensor.pixelShiftStddevFactor = v;
|
||||
raw.bayersensor.pixelShiftStddevFactorGreen = v;
|
||||
raw.bayersensor.pixelShiftStddevFactorRed = v;
|
||||
raw.bayersensor.pixelShiftStddevFactorBlue = v;
|
||||
raw.bayersensor.pixelShiftEperIso = v;
|
||||
raw.bayersensor.pixelShiftNreadIso = v;
|
||||
raw.bayersensor.pixelShiftPrnu = v;
|
||||
@ -880,7 +882,9 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
raw.bayersensor.lmmseIterations = raw.bayersensor.lmmseIterations && p.raw.bayersensor.lmmse_iterations == other.raw.bayersensor.lmmse_iterations;
|
||||
raw.bayersensor.pixelShiftMotion = raw.bayersensor.pixelShiftMotion && p.raw.bayersensor.pixelShiftMotion == other.raw.bayersensor.pixelShiftMotion;
|
||||
raw.bayersensor.pixelShiftMotionCorrection = raw.bayersensor.pixelShiftMotionCorrection && p.raw.bayersensor.pixelShiftMotionCorrection == other.raw.bayersensor.pixelShiftMotionCorrection;
|
||||
raw.bayersensor.pixelShiftStddevFactor = raw.bayersensor.pixelShiftStddevFactor && p.raw.bayersensor.pixelShiftStddevFactor == other.raw.bayersensor.pixelShiftStddevFactor;
|
||||
raw.bayersensor.pixelShiftStddevFactorGreen = raw.bayersensor.pixelShiftStddevFactorGreen && p.raw.bayersensor.pixelShiftStddevFactorGreen == other.raw.bayersensor.pixelShiftStddevFactorGreen;
|
||||
raw.bayersensor.pixelShiftStddevFactorRed = raw.bayersensor.pixelShiftStddevFactorRed && p.raw.bayersensor.pixelShiftStddevFactorRed == other.raw.bayersensor.pixelShiftStddevFactorRed;
|
||||
raw.bayersensor.pixelShiftStddevFactorBlue = raw.bayersensor.pixelShiftStddevFactorBlue && p.raw.bayersensor.pixelShiftStddevFactorBlue == other.raw.bayersensor.pixelShiftStddevFactorBlue;
|
||||
raw.bayersensor.pixelShiftEperIso = raw.bayersensor.pixelShiftEperIso && p.raw.bayersensor.pixelShiftEperIso == other.raw.bayersensor.pixelShiftEperIso;
|
||||
raw.bayersensor.pixelShiftNreadIso = raw.bayersensor.pixelShiftNreadIso && p.raw.bayersensor.pixelShiftNreadIso == other.raw.bayersensor.pixelShiftNreadIso;
|
||||
raw.bayersensor.pixelShiftPrnu = raw.bayersensor.pixelShiftPrnu && p.raw.bayersensor.pixelShiftPrnu == other.raw.bayersensor.pixelShiftPrnu;
|
||||
@ -2310,8 +2314,16 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
toEdit.raw.bayersensor.pixelShiftMotionCorrection = mods.raw.bayersensor.pixelShiftMotionCorrection;
|
||||
}
|
||||
|
||||
if (raw.bayersensor.pixelShiftStddevFactor) {
|
||||
toEdit.raw.bayersensor.pixelShiftStddevFactor = mods.raw.bayersensor.pixelShiftStddevFactor;
|
||||
if (raw.bayersensor.pixelShiftStddevFactorGreen) {
|
||||
toEdit.raw.bayersensor.pixelShiftStddevFactorGreen = mods.raw.bayersensor.pixelShiftStddevFactorGreen;
|
||||
}
|
||||
|
||||
if (raw.bayersensor.pixelShiftStddevFactorRed) {
|
||||
toEdit.raw.bayersensor.pixelShiftStddevFactorRed = mods.raw.bayersensor.pixelShiftStddevFactorRed;
|
||||
}
|
||||
|
||||
if (raw.bayersensor.pixelShiftStddevFactorBlue) {
|
||||
toEdit.raw.bayersensor.pixelShiftStddevFactorBlue = mods.raw.bayersensor.pixelShiftStddevFactorBlue;
|
||||
}
|
||||
|
||||
if (raw.bayersensor.pixelShiftEperIso) {
|
||||
@ -2861,7 +2873,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
bool RAWParamsEdited::BayerSensor::isUnchanged() const
|
||||
{
|
||||
return method && imageNum && dcbIterations && dcbEnhance && lmmseIterations/*&& allEnhance*/ && greenEq
|
||||
&& pixelShiftMotion && pixelShiftMotionCorrection && pixelShiftStddevFactor && pixelShiftEperIso
|
||||
&& pixelShiftMotion && pixelShiftMotionCorrection && pixelShiftStddevFactorGreen && pixelShiftStddevFactorRed && pixelShiftStddevFactorBlue && pixelShiftEperIso
|
||||
&& pixelShiftNreadIso && pixelShiftPrnu && pixelshiftShowMotion && pixelshiftShowMotionMaskOnly
|
||||
&& pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftNonGreenCross
|
||||
&& linenoise && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen;
|
||||
|
@ -694,7 +694,9 @@ public:
|
||||
bool lmmseIterations;
|
||||
bool pixelShiftMotion;
|
||||
bool pixelShiftMotionCorrection;
|
||||
bool pixelShiftStddevFactor;
|
||||
bool pixelShiftStddevFactorGreen;
|
||||
bool pixelShiftStddevFactorRed;
|
||||
bool pixelShiftStddevFactorBlue;
|
||||
bool pixelShiftEperIso;
|
||||
bool pixelShiftNreadIso;
|
||||
bool pixelShiftPrnu;
|
||||
|
Loading…
x
Reference in New Issue
Block a user