From 5889fd4ca1fe4603a98c377aa627cbb1a490dba2 Mon Sep 17 00:00:00 2001 From: Emil Martinec Date: Sun, 24 Oct 2010 12:30:05 -0500 Subject: [PATCH] Patch to fix highlight speckling when using line denoise + AMaZE. --- rtengine/cfa_linedn_RT.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rtengine/cfa_linedn_RT.cc b/rtengine/cfa_linedn_RT.cc index 0c38f01a3..982e68324 100644 --- a/rtengine/cfa_linedn_RT.cc +++ b/rtengine/cfa_linedn_RT.cc @@ -64,7 +64,9 @@ void RawImageSource::CLASS cfa_linedn(float noise) int ex, ey; int verbose=1; - float eps=1e-10; //tolerance to avoid dividing by zero + const float clip_pt = 0.8*ri->defgain; + + float eps=1e-5; //tolerance to avoid dividing by zero float gauss[5] = {0.20416368871516755, 0.18017382291138087, 0.1238315368057753, 0.0662822452863612, 0.02763055063889883}; float rolloff[8] = {0, 0.135335, 0.249352, 0.411112, 0.606531, 0.800737, 0.945959, 1}; //gaussian with sigma=3 @@ -189,7 +191,8 @@ void RawImageSource::CLASS cfa_linedn(float noise) for (rr=16; rr < numrows-16; rr++) { row = rr + top; for (col=16+left, indx=rr*TS+16; indx < rr*TS+numcols-16; indx++, col++) { - ri->data[row][col] = CLIP((int)(cfadn[indx]+ 0.5)); + if (ri->data[row][col]data[row][col] = CLIP((int)(cfadn[indx]+ 0.5)); } } if(plistener) plistener->setProgress(fabs((float)top/height));