From 5afc3a6a4c6cc8a2226bbd96ea60c80d975b56cc Mon Sep 17 00:00:00 2001 From: dirk Date: Mon, 22 Feb 2016 16:25:05 +0100 Subject: [PATCH] Added waveletDenoise to Magick++. --- Magick++/lib/Image.cpp | 11 +++++++++++ Magick++/lib/Magick++/Image.h | 3 +++ Magick++/lib/Magick++/Include.h | 1 + 3 files changed, 15 insertions(+) diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 94f3a3405..a45782667 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -4802,6 +4802,17 @@ void Magick::Image::wave(const double amplitude_,const double wavelength_) ThrowImageException; } +void Magick::Image::waveletDenoise(const double threshold_) +{ + MagickCore::Image + *newImage; + + GetPPException; + newImage=WaveletDenoiseImage(constImage(),threshold_,exceptionInfo); + replaceImage(newImage); + ThrowImageException; +} + void Magick::Image::whiteThreshold(const std::string &threshold_) { modifyImage(); diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h index 457e9bd47..91e394f8d 100644 --- a/Magick++/lib/Magick++/Image.h +++ b/Magick++/lib/Magick++/Image.h @@ -1456,6 +1456,9 @@ namespace Magick // Map image pixels to a sine wave void wave(const double amplitude_=25.0,const double wavelength_=150.0); + // Removes noise from the image using a wavelet transform. + void waveletDenoise(const double threshold_); + // Forces all pixels above the threshold into white while leaving all // pixels at or below the threshold unchanged. void whiteThreshold(const std::string &threshold_); diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h index 7adf1c0c3..f85d7e2d6 100644 --- a/Magick++/lib/Magick++/Include.h +++ b/Magick++/lib/Magick++/Include.h @@ -1479,6 +1479,7 @@ namespace Magick using MagickCore::UnsharpMaskImage; using MagickCore::VignetteImage; using MagickCore::WaveImage; + using MagickCore::WaveletDenoiseImage; using MagickCore::WhiteThresholdImage; using MagickCore::WriteImage; -- 2.40.0