pixelshift: option to smooth transitions between regions with and without motion

This commit is contained in:
heckflosse
2017-01-19 18:46:41 +01:00
parent e231d6c06d
commit 8d40dbdc0b
10 changed files with 69 additions and 30 deletions

View File

@@ -906,6 +906,7 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
const float threshold = bayerParams.pixelShiftSum;
const bool experimental0 = bayerParams.pixelShiftExp0;
const bool holeFill = bayerParams.pixelShiftHoleFill;
const bool smoothTransitions = blurMap && bayerParams.pixelShiftSmooth;
static const float nReadK3II[] = { 3.4f, // ISO 100
3.1f, // ISO 125
@@ -1650,7 +1651,7 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
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 {
if(blurMap && experimental0) {
if(smoothTransitions) {
red[i + offsY][j + offsX] = intp(psMask[i][j], red[i + offsY][j + offsX], psRed[i][j] );
green[i + offsY][j + offsX] = intp(psMask[i][j],green[i + offsY][j + offsX],(psG1[i][j] + psG2[i][j]) / 2.f);
blue[i + offsY][j + offsX] = intp(psMask[i][j],blue[i + offsY][j + offsX], psBlue[i][j]);