Fix bug in Capture Sharpening

This commit is contained in:
Ingo Weyrich
2019-10-26 12:54:29 +02:00
parent 7f6d29d938
commit 11f8672584

View File

@@ -668,7 +668,7 @@ BENCHFUN
buildClipMaskBayer(rawData, W, H, clipMask, whites); buildClipMaskBayer(rawData, W, H, clipMask, whites);
const unsigned int fc[2] = {FC(0,0), FC(1,0)}; const unsigned int fc[2] = {FC(0,0), FC(1,0)};
if (sharpeningParams.autoRadius) { if (sharpeningParams.autoRadius) {
radius = calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc); radius = std::min(calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc), 1.15f);
} }
} else if (ri->getSensorType() == ST_FUJI_XTRANS) { } else if (ri->getSensorType() == ST_FUJI_XTRANS) {
float whites[6][6]; float whites[6][6];
@@ -696,14 +696,14 @@ BENCHFUN
} }
} }
if (sharpeningParams.autoRadius) { if (sharpeningParams.autoRadius) {
radius = calcRadiusXtrans(rawData, W, H, 1000.f, clipVal, i, j); radius = std::min(calcRadiusXtrans(rawData, W, H, 1000.f, clipVal, i, j), 1.15f);
} }
} else if (ri->get_colors() == 1) { } else if (ri->get_colors() == 1) {
buildClipMaskMono(rawData, W, H, clipMask, (ri->get_white(0) - c_black[0]) * scale_mul[0] * clipLimit); buildClipMaskMono(rawData, W, H, clipMask, (ri->get_white(0) - c_black[0]) * scale_mul[0] * clipLimit);
if (sharpeningParams.autoRadius) { if (sharpeningParams.autoRadius) {
const unsigned int fc[2] = {0, 0}; const unsigned int fc[2] = {0, 0};
radius = calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc); radius = std::min(calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc), 1.15f);
} }
} }