Skip to content

Commit

Permalink
LibRaw wavelet denoise options (#4028)
Browse files Browse the repository at this point in the history
- ``raw:threshold``
     - float
     - Libraw parameter for noise reduction through wavelet denoising..
       The best threshold should be somewhere between 100 and 1000.

- ``raw:fbdd_noiserd`` 
    - int 
    - Controls FBDD noise reduction before demosaic. 0 - do not use FBDD
       noise reduction, 1 - light FBDD reduction, 2 (and more) - full FBDD reduction

---------

Signed-off-by: ssh4net <[email protected]>
  • Loading branch information
ssh4net authored Oct 17, 2023
1 parent fd9c954 commit 5315e38
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/doc/builtinplugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,17 @@ options are supported:
- int
- Set libraw user flip value : -1 ignored, other values are between [0; 8] with the same
definition than the Exif orientation code.


* - ``raw:threshold``
- float
- Libraw parameter for noise reduction through wavelet denoising.
The best threshold should be somewhere between 100 and 1000.
(Default: 0.0)
* - ``raw:fbdd_noiserd``
- int
- Controls FBDD noise reduction before demosaic.
0 - do not use FBDD noise reduction, 1 - light FBDD reduction,
2 (and more) - full FBDD reduction
(Default: 0)


|
Expand Down
13 changes: 13 additions & 0 deletions src/raw.imageio/rawinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,19 @@ RawInput::open_raw(bool unpack, const std::string& name,
m_spec.attribute("raw:Demosaic", "AHD");
}

// Wavelets denoise before demosaic
// Use wavelets to erase noise while preserving real detail.
// The best threshold should be somewhere between 100 and 1000.
m_processor->imgdata.params.threshold
= config.get_float_attribute("raw:threshold", 0.0f);

// Controls FBDD noise reduction before demosaic.
// 0 - do not use FBDD noise reduction
// 1 - light FBDD reduction
// 2 (and more) - full FBDD reduction
m_processor->imgdata.params.fbdd_noiserd
= config.get_int_attribute("raw:fbdd_noiserd", 0);

// Values returned by libraw are in linear, but are normalized based on the
// whitepoint / sensor / ISO and shooting conditions.
// Technically the transformation for each camera body / lens / setup
Expand Down

0 comments on commit 5315e38

Please sign in to comment.