added haze removal tool

Based on the paper:
  "Single Image Haze Removal Using Dark Channel Prior" by He, Sun and Tang
using a guided filter for the "soft matting" of the transmission map
This commit is contained in:
Alberto Griggio
2018-10-10 10:02:06 +02:00
parent 30d8a674aa
commit 14ac4babec
24 changed files with 617 additions and 19 deletions

View File

@@ -566,6 +566,8 @@ void ParamsEdited::set(bool v)
filmSimulation.strength = v;
softlight.enabled = v;
softlight.strength = v;
dehaze.enabled = v;
dehaze.strength = v;
metadata.mode = v;
exif = v;
@@ -1119,6 +1121,8 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
filmSimulation.strength = filmSimulation.strength && p.filmSimulation.strength == other.filmSimulation.strength;
softlight.enabled = softlight.enabled && p.softlight.enabled == other.softlight.enabled;
softlight.strength = softlight.strength && p.softlight.strength == other.softlight.strength;
dehaze.enabled = dehaze.enabled && p.dehaze.enabled == other.dehaze.enabled;
dehaze.strength = dehaze.strength && p.dehaze.strength == other.dehaze.strength;
metadata.mode = metadata.mode && p.metadata.mode == other.metadata.mode;
// How the hell can we handle that???
@@ -3112,6 +3116,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
if (softlight.strength) {
toEdit.softlight.strength = dontforceSet && options.baBehav[ADDSET_SOFTLIGHT_STRENGTH] ? toEdit.softlight.strength + mods.softlight.strength : mods.softlight.strength;
}
if (dehaze.enabled) {
toEdit.dehaze.enabled = mods.dehaze.enabled;
}
if (dehaze.strength) {
toEdit.dehaze.strength = dontforceSet && options.baBehav[ADDSET_DEHAZE_STRENGTH] ? toEdit.dehaze.strength + mods.dehaze.strength : mods.dehaze.strength;
}
if (metadata.mode) {
toEdit.metadata.mode = mods.metadata.mode;