New Threshold slider for Hot/Dead Pixel Filters to suppress false positives which lead to artifacts, issue 2738

This commit is contained in:
DrSlony
2015-04-17 22:51:12 +02:00
parent 16d0841f1e
commit 8aeae061c4
26 changed files with 47 additions and 48 deletions

View File

@@ -24,7 +24,7 @@
using namespace rtengine;
using namespace rtengine::procparams;
BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RAW_LABEL"), true)
BayerPreProcess::BayerPreProcess () : FoldableToolPanel(this, "bayerpreprocess", M("TP_PREPROCESS_LABEL"), true)
{
lineDenoise = Gtk::manage(new Adjuster (M("TP_PREPROCESS_LINEDENOISE"),0,1000,1,0));
lineDenoise->setAdjusterListener (this);

View File

@@ -22,7 +22,7 @@
using namespace rtengine;
using namespace rtengine::procparams;
BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerpreprocess", M("TP_PREPROCESS_LABEL"), true)
BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RAW_LABEL"), true)
{
Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ());
hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") +": ")),Gtk::PACK_SHRINK, 4);

View File

@@ -706,10 +706,10 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
if (!raw_ca_autocorrect->get_active ()) filterPE.raw.caCorrection = falsePE.raw.caCorrection;
if (!raw_cared->get_active ()) filterPE.raw.caRed = falsePE.raw.caRed;
if (!raw_cablue->get_active ()) filterPE.raw.caBlue = falsePE.raw.caBlue;
if (!raw_hotpix_filt->get_active ()) { filterPE.raw.hotPixelFilter = falsePE.raw.hotPixelFilter;
filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh; }
if (!raw_deadpix_filt->get_active ()) { filterPE.raw.deadPixelFilter = falsePE.raw.deadPixelFilter;
filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh; }
if (!raw_hotpix_filt->get_active ()) { filterPE.raw.hotPixelFilter = falsePE.raw.hotPixelFilter; }
if (!raw_deadpix_filt->get_active ()) { filterPE.raw.deadPixelFilter = falsePE.raw.deadPixelFilter; }
if (!raw_deadpix_filt->get_active () && !raw_hotpix_filt->get_active ())
filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh;
if (!df_file->get_active ()) filterPE.raw.darkFrame = falsePE.raw.darkFrame;
if (!df_AutoSelect->get_active ()) filterPE.raw.dfAuto = falsePE.raw.dfAuto;
if (!ff_file->get_active ()) filterPE.raw.ff_file = falsePE.raw.ff_file;

View File

@@ -38,6 +38,13 @@ PreProcess::PreProcess () : FoldableToolPanel(this, "preprocess", M("TP_PREPROCE
hotdeadPixel->pack_start( *hotPixel, Gtk::PACK_SHRINK);
hotdeadPixel->pack_start( *deadPixel, Gtk::PACK_SHRINK, 0);
pack_start(*hotdeadPixel, Gtk::PACK_SHRINK, 0);
hdThreshold = Gtk::manage (new Adjuster (M("TP_RAW_HD"),20,200,2,100));
hdThreshold->set_tooltip_markup (M("TP_RAW_HD_TOOLTIP"));
hdThreshold->setAdjusterListener (this);
if (hdThreshold->delay < 1000) hdThreshold->delay = 1000;
hdThreshold->show();
pack_start( *hdThreshold, Gtk::PACK_SHRINK, 4);
// hotdeadPixel->show();
hpixelconn = hotPixel->signal_toggled().connect ( sigc::mem_fun(*this, &PreProcess::hotPixelChanged), true);
dpixelconn = deadPixel->signal_toggled().connect ( sigc::mem_fun(*this, &PreProcess::deadPixelChanged), true);
@@ -57,7 +64,7 @@ void PreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEd
lastDead = pp->raw.deadPixelFilter;
hotPixel->set_active (pp->raw.hotPixelFilter);
deadPixel->set_active (pp->raw.deadPixelFilter);
hdThreshold->setValue (pp->raw.hotdeadpix_thresh);
hpixelconn.block (false);
dpixelconn.block (false);
enableListener ();
@@ -67,13 +74,22 @@ void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedi
{
pp->raw.hotPixelFilter = hotPixel->get_active();
pp->raw.deadPixelFilter = deadPixel->get_active();
pp->raw.hotdeadpix_thresh = hdThreshold->getIntValue();
if (pedited) {
pedited->raw.hotDeadPixelThresh = hdThreshold->getEditedState ();
pedited->raw.hotPixelFilter = !hotPixel->get_inconsistent();
pedited->raw.deadPixelFilter = !deadPixel->get_inconsistent();
}
}
void PreProcess::adjusterChanged (Adjuster* a, double newval)
{
if (listener) {
if (a == hdThreshold)
listener->panelChanged (EvPreProcessHotDeadThresh, a->getTextValue() );
}
}
void PreProcess::hotPixelChanged ()
{
if (batchMode) {

View File

@@ -22,17 +22,19 @@
#include <gtkmm.h>
//#include "adjuster.h"
#include "toolpanel.h"
#include "adjuster.h"
#include "guiutils.h"
#include "../rtengine/rawimage.h"
class PreProcess : public ToolParamBlock, /*public AdjusterListener,*/ public FoldableToolPanel {
class PreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel {
protected:
Gtk::CheckButton* hotPixel;
Gtk::CheckButton* hotPixel;
Gtk::CheckButton* deadPixel;
bool lastHot,lastDead;
sigc::connection hpixelconn;
sigc::connection hpixelconn;
sigc::connection dpixelconn;
Adjuster* hdThreshold;
public:
PreProcess ();
@@ -42,8 +44,10 @@ class PreProcess : public ToolParamBlock, /*public AdjusterListener,*/ public Fo
//void setBatchMode (bool batchMode);
//void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
void hotPixelChanged();
void hotPixelChanged();
void deadPixelChanged();
void adjusterChanged (Adjuster* a, double newval);
//void adjusterChanged (Adjuster* a, double newval);
//void setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd);