Added a threshold slider to the impulse denoise tool. At large values it can lead to a bit of cratering, but otherwise it allows some flexibility that is useful as a precursor to the pyramid denoise filter. Small values on the slider are less impulse NR, larger values yield more NR.

This commit is contained in:
Emil Martinec 2010-09-14 00:47:44 -05:00
parent 1820978df4
commit d556f04ddb
10 changed files with 125 additions and 182 deletions

View File

@ -566,10 +566,7 @@ TP_ICM_OUTPUTPROFILE;Output Profile
TP_ICM_SAVEREFERENCE;Save reference image for profiling TP_ICM_SAVEREFERENCE;Save reference image for profiling
TP_ICM_WORKINGPROFILE;Working Profile TP_ICM_WORKINGPROFILE;Working Profile
TP_IMPULSEDENOISE_LABEL;Impulse Noise Reduction TP_IMPULSEDENOISE_LABEL;Impulse Noise Reduction
<<<<<<< local
TP_IMPULSEDENOISE_THRESH;Threshold TP_IMPULSEDENOISE_THRESH;Threshold
=======
>>>>>>> other
TP_LENSGEOM_AUTOCROP;Auto Crop TP_LENSGEOM_AUTOCROP;Auto Crop
TP_LENSGEOM_FILL;Auto Fill TP_LENSGEOM_FILL;Auto Fill
TP_LENSGEOM_LABEL;Lens / Geometry TP_LENSGEOM_LABEL;Lens / Geometry

View File

@ -177,10 +177,7 @@ void Crop::update (int todo, bool internal) {
if (skip==1) { if (skip==1) {
parent->ipf.colordenoise (labnCrop, cbuffer); parent->ipf.colordenoise (labnCrop, cbuffer);
parent->ipf.dirpyrdenoise (labnCrop); parent->ipf.dirpyrdenoise (labnCrop);
<<<<<<< local
parent->ipf.sharpening (labnCrop, (unsigned short**)cbuffer); parent->ipf.sharpening (labnCrop, (unsigned short**)cbuffer);
=======
>>>>>>> other
parent->ipf.waveletEqualizer(labnCrop, false, true); parent->ipf.waveletEqualizer(labnCrop, false, true);
} }
} }

View File

@ -434,11 +434,8 @@ void ImProcFunctions::colorCurve (LabImage* lold, LabImage* lnew) {
if (params->impulseDenoise.enabled && lab->W>=8 && lab->H>=8) if (params->impulseDenoise.enabled && lab->W>=8 && lab->H>=8)
<<<<<<< local
impulse_nr (lab->L, lab->L, lab->W, lab->H, (float)params->impulseDenoise.thresh/20.0 /*1024*/); impulse_nr (lab->L, lab->L, lab->W, lab->H, (float)params->impulseDenoise.thresh/20.0 /*1024*/);
=======
impulse_nr (lab->L, lab->L, lab->W, lab->H, 1024); impulse_nr (lab->L, lab->L, lab->W, lab->H, 1024);
>>>>>>> other
} }
void ImProcFunctions::dirpyrdenoise (LabImage* lab) { void ImProcFunctions::dirpyrdenoise (LabImage* lab) {

View File

@ -1,132 +1,123 @@
/* /*
* This file is part of RawTherapee. * This file is part of RawTherapee.
* *
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com> * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
* *
* RawTherapee is free software: you can redistribute it and/or modify * RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* RawTherapee is distributed in the hope that it will be useful, * RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __PROCEVENT__ #ifndef __PROCEVENT__
#define __PROCEVENT__ #define __PROCEVENT__
#include <rtengine.h> #include <rtengine.h>
<<<<<<< local #define NUMOFEVENTS 91
#define NUMOFEVENTS 91
=======
#define NUMOFEVENTS 90 namespace rtengine {
>>>>>>> other
enum ProcEvent {
namespace rtengine { EvPhotoLoaded=0,
EvProfileLoaded=1,
enum ProcEvent { EvProfileChanged=2,
EvPhotoLoaded=0, EvHistoryBrowsed=3,
EvProfileLoaded=1, EvBrightness=4,
EvProfileChanged=2, EvContrast=5,
EvHistoryBrowsed=3, EvBlack=6,
EvBrightness=4, EvExpComp=7,
EvContrast=5, EvHLCompr=8,
EvBlack=6, EvSHCompr=9,
EvExpComp=7, EvToneCurve=10,
EvHLCompr=8, EvAutoExp=11,
EvSHCompr=9, EvClip=12,
EvToneCurve=10, EvLBrightness=13,
EvAutoExp=11, EvLContrast=14,
EvClip=12, EvLBlack=15,
EvLBrightness=13, EvLHLCompr=16,
EvLContrast=14, EvLSHCompr=17,
EvLBlack=15, EvLCurve=18,
EvLHLCompr=16, EvShrEnabled=19,
EvLSHCompr=17, EvShrRadius=20,
EvLCurve=18, EvShrAmount=21,
EvShrEnabled=19, EvShrThresh=22,
EvShrRadius=20, EvShrEdgeOnly=23,
EvShrAmount=21, EvShrEdgeRadius=24,
EvShrThresh=22, EvShrEdgeTolerance=25,
EvShrEdgeOnly=23, EvShrHaloControl=26,
EvShrEdgeRadius=24, EvShrHaloAmount=27,
EvShrEdgeTolerance=25, EvShrMethod=28,
EvShrHaloControl=26, EvShrDRadius=29,
EvShrHaloAmount=27, EvShrDAmount=30,
EvShrMethod=28, EvShrDDamping=31,
EvShrDRadius=29, EvShrDIterations=32,
EvShrDAmount=30, EvCBAvoidClip=33,
EvShrDDamping=31, EvCBSatLimiter=34,
EvShrDIterations=32, EvCBSatLimit=35,
EvCBAvoidClip=33, EvCBBoost=36,
EvCBSatLimiter=34, EvWBMethod=37,
EvCBSatLimit=35, EvWBTemp=38,
EvCBBoost=36, EvWBGreen=39,
EvWBMethod=37, EvCShiftA=40,
EvWBTemp=38, EvCShiftB=41,
EvWBGreen=39, EvLDNEnabled=42,
EvCShiftA=40, EvLDNRadius=43,
EvCShiftB=41, EvLDNEdgeTolerance=44,
EvLDNEnabled=42, EvCDNEnabled=45,
EvLDNRadius=43, EvCDNRadius=46,
EvLDNEdgeTolerance=44, EvCDNEdgeTolerance=47,
EvCDNEnabled=45, EvCDNEdgeSensitive=48,
EvCDNRadius=46, EvSHEnabled=49,
EvCDNEdgeTolerance=47, EvSHHighlights=50,
EvCDNEdgeSensitive=48, EvSHShadows=51,
EvSHEnabled=49, EvSHHLTonalW=52,
EvSHHighlights=50, EvSHSHTonalW=53,
EvSHShadows=51, EvSHLContrast=54,
EvSHHLTonalW=52, EvSHRadius=55,
EvSHSHTonalW=53, EvCTRotate=56,
EvSHLContrast=54, EvCTHFlip=57,
EvSHRadius=55, EvCTVFlip=58,
EvCTRotate=56, EvROTDegree=59,
EvCTHFlip=57, EvTransAutoFill=60,
EvCTVFlip=58, EvDISTAmount=61,
EvROTDegree=59, EvBookmarkSelected=62,
EvTransAutoFill=60, EvCrop=63,
EvDISTAmount=61, EvCACorr=64,
EvBookmarkSelected=62, EvHREnabled=65,
EvCrop=63, EvHRAmount=66,
EvCACorr=64, EvHRMethod=67,
EvHREnabled=65, EvWProfile=68,
EvHRAmount=66, EvOProfile=69,
EvHRMethod=67, EvIProfile=70,
EvWProfile=68, EvVignetting=71,
EvOProfile=69, EvChMixer=72,
EvIProfile=70, EvResizeScale=73,
EvVignetting=71, EvResizeMethod=74,
EvChMixer=72, EvExif=75,
EvResizeScale=73, EvIPTC=76,
EvResizeMethod=74, EvResizeSpec=77,
EvExif=75, EvResizeWidth=78,
EvIPTC=76, EvResizeHeight=79,
EvResizeSpec=77, EvResizeEnabled=80,
EvResizeWidth=78, EvProfileChangeNotification=81,
EvResizeHeight=79, EvSHHighQuality=82,
EvResizeEnabled=80, EvPerspCorr=83,
EvProfileChangeNotification=81, EvEqualizer=84,
EvSHHighQuality=82, EvEqlEnabled=85,
EvPerspCorr=83, EvIDNEnabled=86,
EvEqualizer=84, EvIDNThresh=87,
EvEqlEnabled=85, EvDPDNEnabled=88,
EvIDNEnabled=86, EvDPDNLuma=89,
<<<<<<< local EvDPDNChroma=90
EvIDNThresh=87, };
EvDPDNEnabled=88, }
EvDPDNLuma=89, #endif
EvDPDNChroma=90
=======
EvDPDNEnabled=87,
EvDPDNLuma=88,
EvDPDNChroma=89
>>>>>>> other
};
}
#endif

View File

@ -96,10 +96,7 @@ void ProcParams::setDefaults () {
colorDenoise.edgetolerance = 2000; colorDenoise.edgetolerance = 2000;
impulseDenoise.enabled = false; impulseDenoise.enabled = false;
<<<<<<< local
impulseDenoise.thresh = 50; impulseDenoise.thresh = 50;
=======
>>>>>>> other
dirpyrDenoise.enabled = false; dirpyrDenoise.enabled = false;
dirpyrDenoise.luma = 10; dirpyrDenoise.luma = 10;
@ -249,12 +246,9 @@ int ProcParams::save (Glib::ustring fname) const {
// save impulseDenoise // save impulseDenoise
keyFile.set_boolean ("Impulse Denoising", "Enabled", impulseDenoise.enabled); keyFile.set_boolean ("Impulse Denoising", "Enabled", impulseDenoise.enabled);
<<<<<<< local
keyFile.set_integer ("Impulse Denoising", "Threshold", impulseDenoise.thresh); keyFile.set_integer ("Impulse Denoising", "Threshold", impulseDenoise.thresh);
=======
>>>>>>> other
// save dirpyrDenoise // save dirpyrDenoise
keyFile.set_boolean ("Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled); keyFile.set_boolean ("Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled);
keyFile.set_integer ("Directional Pyramid Denoising", "Luma", dirpyrDenoise.luma); keyFile.set_integer ("Directional Pyramid Denoising", "Luma", dirpyrDenoise.luma);
@ -470,10 +464,7 @@ if (keyFile.has_group ("Color Shift")) {
// load impulseDenoise // load impulseDenoise
if (keyFile.has_group ("Impulse Denoising")) { if (keyFile.has_group ("Impulse Denoising")) {
if (keyFile.has_key ("Impulse Denoising", "Enabled")) impulseDenoise.enabled = keyFile.get_boolean ("Impulse Denoising", "Enabled"); if (keyFile.has_key ("Impulse Denoising", "Enabled")) impulseDenoise.enabled = keyFile.get_boolean ("Impulse Denoising", "Enabled");
<<<<<<< local
if (keyFile.has_key ("Impulse Denoising", "Threshold")) impulseDenoise.thresh = keyFile.get_integer ("Impulse Denoising", "Threshold"); if (keyFile.has_key ("Impulse Denoising", "Threshold")) impulseDenoise.thresh = keyFile.get_integer ("Impulse Denoising", "Threshold");
=======
>>>>>>> other
} }
// load dirpyrDenoise // load dirpyrDenoise
@ -688,10 +679,7 @@ bool ProcParams::operator== (const ProcParams& other) {
&& colorShift.a == other.colorShift.a && colorShift.a == other.colorShift.a
&& colorShift.b == other.colorShift.b && colorShift.b == other.colorShift.b
&& impulseDenoise.enabled == other.impulseDenoise.enabled && impulseDenoise.enabled == other.impulseDenoise.enabled
<<<<<<< local
&& impulseDenoise.thresh == other.impulseDenoise.thresh && impulseDenoise.thresh == other.impulseDenoise.thresh
=======
>>>>>>> other
&& dirpyrDenoise.enabled == other.dirpyrDenoise.enabled && dirpyrDenoise.enabled == other.dirpyrDenoise.enabled
&& dirpyrDenoise.luma == other.dirpyrDenoise.luma && dirpyrDenoise.luma == other.dirpyrDenoise.luma
&& dirpyrDenoise.chroma == other.dirpyrDenoise.chroma && dirpyrDenoise.chroma == other.dirpyrDenoise.chroma

View File

@ -140,10 +140,8 @@ class ColorDenoiseParams {
public: public:
bool enabled; bool enabled;
<<<<<<< local
int thresh; int thresh;
=======
>>>>>>> other
}; };
/** /**

View File

@ -106,10 +106,7 @@ TRANSFORM, // EvPerspCorr
EQUALIZER, // EvEqualizer EQUALIZER, // EvEqualizer
EQUALIZER, // EvEqlEnabled EQUALIZER, // EvEqlEnabled
IMPULSEDENOISE, // EvIDNEnabled, IMPULSEDENOISE, // EvIDNEnabled,
<<<<<<< local
IMPULSEDENOISE, // EvIDNThresh, IMPULSEDENOISE, // EvIDNThresh,
=======
>>>>>>> other
DIRPYRDENOISE, // EvDPDNEnabled, DIRPYRDENOISE, // EvDPDNEnabled,
DIRPYRDENOISE, // EvDPDNLuma, DIRPYRDENOISE, // EvDPDNLuma,
DIRPYRDENOISE // EvDPDNChroma, DIRPYRDENOISE // EvDPDNChroma,

View File

@ -28,23 +28,12 @@
#define AUTOEXP 31 #define AUTOEXP 31
#define RGBCURVE 15 #define RGBCURVE 15
#define LUMINANCECURVE 6 #define LUMINANCECURVE 6
<<<<<<< local
#define SHARPENING 3//2
#define IMPULSEDENOISE 3//2
#define LUMADENOISE 3//2
=======
#define SHARPENING 2 #define SHARPENING 2
#define IMPULSEDENOISE 2 #define IMPULSEDENOISE 2
#define LUMADENOISE 2 #define LUMADENOISE 2
>>>>>>> other
#define WHITEBALANCE 255 #define WHITEBALANCE 255
<<<<<<< local
#define COLORBOOST 3//1
#define COLORDENOISE 3//1
=======
#define COLORBOOST 1 #define COLORBOOST 1
#define COLORDENOISE 1 #define COLORDENOISE 1
>>>>>>> other
#define DIRPYRDENOISE 3 #define DIRPYRDENOISE 3
#define CROP 16384 #define CROP 16384
#define EXIF 32768 #define EXIF 32768

View File

@ -69,10 +69,7 @@ void ParamsEdited::set (bool v) {
colorDenoise.enabled = v; colorDenoise.enabled = v;
colorDenoise.amount = v; colorDenoise.amount = v;
impulseDenoise.enabled = v; impulseDenoise.enabled = v;
<<<<<<< local
impulseDenoise.thresh = v; impulseDenoise.thresh = v;
=======
>>>>>>> other
dirpyrDenoise.enabled = v; dirpyrDenoise.enabled = v;
dirpyrDenoise.luma = v; dirpyrDenoise.luma = v;
dirpyrDenoise.chroma = v; dirpyrDenoise.chroma = v;
@ -190,10 +187,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
colorDenoise.amount = colorDenoise.amount && p.colorDenoise.amount == other.colorDenoise.amount; colorDenoise.amount = colorDenoise.amount && p.colorDenoise.amount == other.colorDenoise.amount;
impulseDenoise.enabled = impulseDenoise.enabled && p.impulseDenoise.enabled == other.impulseDenoise.enabled; impulseDenoise.enabled = impulseDenoise.enabled && p.impulseDenoise.enabled == other.impulseDenoise.enabled;
<<<<<<< local
impulseDenoise.thresh = impulseDenoise.thresh && p.impulseDenoise.thresh == other.impulseDenoise.thresh; impulseDenoise.thresh = impulseDenoise.thresh && p.impulseDenoise.thresh == other.impulseDenoise.thresh;
=======
>>>>>>> other
dirpyrDenoise.enabled = dirpyrDenoise.enabled && p.dirpyrDenoise.enabled == other.dirpyrDenoise.enabled; dirpyrDenoise.enabled = dirpyrDenoise.enabled && p.dirpyrDenoise.enabled == other.dirpyrDenoise.enabled;
dirpyrDenoise.luma = dirpyrDenoise.luma && p.dirpyrDenoise.luma == other.dirpyrDenoise.luma; dirpyrDenoise.luma = dirpyrDenoise.luma && p.dirpyrDenoise.luma == other.dirpyrDenoise.luma;
@ -303,10 +297,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
if (colorDenoise.amount) toEdit.colorDenoise.amount = mods.colorDenoise.amount; if (colorDenoise.amount) toEdit.colorDenoise.amount = mods.colorDenoise.amount;
if (impulseDenoise.enabled) toEdit.impulseDenoise.enabled = mods.impulseDenoise.enabled; if (impulseDenoise.enabled) toEdit.impulseDenoise.enabled = mods.impulseDenoise.enabled;
<<<<<<< local
if (impulseDenoise.thresh) toEdit.impulseDenoise.thresh = mods.impulseDenoise.thresh; if (impulseDenoise.thresh) toEdit.impulseDenoise.thresh = mods.impulseDenoise.thresh;
=======
>>>>>>> other
if (dirpyrDenoise.enabled) toEdit.dirpyrDenoise.enabled = mods.dirpyrDenoise.enabled; if (dirpyrDenoise.enabled) toEdit.dirpyrDenoise.enabled = mods.dirpyrDenoise.enabled;
if (dirpyrDenoise.luma) toEdit.dirpyrDenoise.luma = mods.dirpyrDenoise.luma; if (dirpyrDenoise.luma) toEdit.dirpyrDenoise.luma = mods.dirpyrDenoise.luma;

View File

@ -109,10 +109,8 @@ class ImpulseDenoiseParamsEdited {
public: public:
bool enabled; bool enabled;
<<<<<<< local
bool thresh; bool thresh;
=======
>>>>>>> other
}; };
class DirPyrDenoiseParamsEdited { class DirPyrDenoiseParamsEdited {