pixelshift: skip demosaic when 'Show only motion mask' is enabled

This commit is contained in:
heckflosse 2017-05-30 19:45:17 +02:00
parent 486d51e434
commit e8e01c3af1

View File

@ -316,12 +316,15 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
bayerParams.setPixelShiftDefaults();
bayerParams.pixelShiftEqualBright = pixelShiftEqualBright;
} else if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Off) {
bayerParams.pixelShiftMotion = 0;
bayerParams.pixelShiftAutomatic = false;
bayerParams.pixelShiftShowMotion = false;
}
if((bayerParams.pixelShiftMotion > 0 || bayerParams.pixelShiftAutomatic)) {
const bool showMotion = bayerParams.pixelShiftShowMotion;
const bool showOnlyMask = bayerParams.pixelShiftShowMotionMaskOnly && showMotion;
if(bayerParams.pixelShiftAutomatic) {
if(!showOnlyMask) {
if(bayerParams.pixelShiftMedian) { // We need the amaze demosaiced frames for motion correction
if(bayerParams.pixelShiftLmmse) {
lmmse_interpolate_omp(winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.lmmse_iterations);
@ -341,9 +344,9 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
}
}
#ifdef _OPENMP
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16)
#endif
#endif
for(int i = winy + border; i < winh - border; i++) {
for(int j = winx + border; j < winw - border; j++) {
@ -365,6 +368,7 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
amaze_demosaic_RT(winx, winy, winw, winh, rawData, red, green, blue);
}
}
}
} else if(bayerParams.pixelShiftMotionCorrectionMethod != RAWParams::BayerSensor::Off) {
if(bayerParams.pixelShiftLmmse) {
lmmse_interpolate_omp(winw, winh, rawData, red, green, blue, bayerParams.lmmse_iterations);
@ -373,8 +377,6 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
}
}
const bool showMotion = bayerParams.pixelShiftShowMotion;
const bool showOnlyMask = bayerParams.pixelShiftShowMotionMaskOnly && showMotion;
const bool adaptive = bayerParams.pixelShiftAutomatic;
constexpr float stddevFactorGreen = 25.f;
constexpr float stddevFactorRed = 25.f;