Method Bm3dDenoising
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Bm3dDenoising(InputArray, InputOutputArray, OutputArray, float, int, int, int, int, int, int, float, NormTypes, Bm3dSteps, TransformTypes)
Performs image denoising using the Block-Matching and 3D-filtering algorithm (http://www.cs.tut.fi/~foi/GCF-BM3D/BM3D_TIP_2007.pdf) with several computational optimizations.Noise expected to be a gaussian white noise.
public static void Bm3dDenoising(InputArray src, InputOutputArray dstStep1, OutputArray dstStep2, float h = 1, int templateWindowSize = 4, int searchWindowSize = 16, int blockMatchingStep1 = 2500, int blockMatchingStep2 = 400, int groupSize = 8, int slidingStep = 1, float beta = 2, NormTypes normType = NormTypes.L2, Bm3dSteps step = Bm3dSteps.STEPALL, TransformTypes transformType = TransformTypes.HAAR)
Parameters
srcInputArrayInput 8-bit or 16-bit 1-channel image.
dstStep1InputOutputArrayOutput image of the first step of BM3D with the same size and type as src.
dstStep2OutputArrayOutput image of the second step of BM3D with the same size and type as src.
hfloatParameter regulating filter strength. Big h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise.
templateWindowSizeintSize in pixels of the template patch that is used for block-matching. Should be power of 2.
searchWindowSizeintSize in pixels of the window that is used to perform block-matching. Affect performance linearly: greater searchWindowsSize - greater denoising time. Must be larger than templateWindowSize.
blockMatchingStep1intBlock matching threshold for the first step of BM3D (hard thresholding), i.e.maximum distance for which two blocks are considered similar.Value expressed in euclidean distance.
blockMatchingStep2intBlock matching threshold for the second step of BM3D (Wiener filtering), i.e.maximum distance for which two blocks are considered similar. Value expressed in euclidean distance.
groupSizeintMaximum size of the 3D group for collaborative filtering.
slidingStepintSliding step to process every next reference block.
betafloatKaiser window parameter that affects the sidelobe attenuation of the transform of the window.Kaiser window is used in order to reduce border effects.To prevent usage of the window, set beta to zero.
normTypeNormTypesNorm used to calculate distance between blocks. L2 is slower than L1 but yields more accurate results.
stepBm3dStepsStep of BM3D to be executed. Allowed are only BM3D_STEP1 and BM3D_STEPALL. BM3D_STEP2 is not allowed as it requires basic estimate to be present.
transformTypeTransformTypesType of the orthogonal transform used in collaborative filtering step. Currently only Haar transform is supported.
Bm3dDenoising(InputArray, OutputArray, float, int, int, int, int, int, int, float, NormTypes, Bm3dSteps, TransformTypes)
Performs image denoising using the Block-Matching and 3D-filtering algorithm (http://www.cs.tut.fi/~foi/GCF-BM3D/BM3D_TIP_2007.pdf) with several computational optimizations.Noise expected to be a gaussian white noise.
public static void Bm3dDenoising(InputArray src, OutputArray dst, float h = 1, int templateWindowSize = 4, int searchWindowSize = 16, int blockMatchingStep1 = 2500, int blockMatchingStep2 = 400, int groupSize = 8, int slidingStep = 1, float beta = 2, NormTypes normType = NormTypes.L2, Bm3dSteps step = Bm3dSteps.STEPALL, TransformTypes transformType = TransformTypes.HAAR)
Parameters
srcInputArrayInput 8-bit or 16-bit 1-channel image.
dstOutputArrayOutput image with the same size and type as src.
hfloatParameter regulating filter strength. Big h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise.
templateWindowSizeintSize in pixels of the template patch that is used for block-matching. Should be power of 2.
searchWindowSizeintSize in pixels of the window that is used to perform block-matching. Affect performance linearly: greater searchWindowsSize - greater denoising time. Must be larger than templateWindowSize.
blockMatchingStep1intBlock matching threshold for the first step of BM3D (hard thresholding), i.e.maximum distance for which two blocks are considered similar.Value expressed in euclidean distance.
blockMatchingStep2intBlock matching threshold for the second step of BM3D (Wiener filtering), i.e.maximum distance for which two blocks are considered similar. Value expressed in euclidean distance.
groupSizeintMaximum size of the 3D group for collaborative filtering.
slidingStepintSliding step to process every next reference block.
betafloatKaiser window parameter that affects the sidelobe attenuation of the transform of the window.Kaiser window is used in order to reduce border effects.To prevent usage of the window, set beta to zero.
normTypeNormTypesNorm used to calculate distance between blocks. L2 is slower than L1 but yields more accurate results.
stepBm3dStepsStep of BM3D to be executed. Allowed are only BM3D_STEP1 and BM3D_STEPALL. BM3D_STEP2 is not allowed as it requires basic estimate to be present.
transformTypeTransformTypesType of the orthogonal transform used in collaborative filtering step. Currently only Haar transform is supported.