Skip to content

xphoto_bm3dDenoising

xphotofunctionOpenCV 5.0.0
import { xphoto_bm3dDenoising } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSsrc, dstStep1, dstStep2, h
FUNCTIONxphoto_bm3dDenoising
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

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.

    See: fastNlMeansDenoising
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number, groupSize: number, slidingStep: number, beta: number, normType: number, step: number, transformType: number): void;
12 available overloads
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number, groupSize: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number, groupSize: number, slidingStep: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number, groupSize: number, slidingStep: number, beta: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number, groupSize: number, slidingStep: number, beta: number, normType: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number, groupSize: number, slidingStep: number, beta: number, normType: number, step: number): void;
xphoto_bm3dDenoising(src: Mat, dstStep1: Mat, dstStep2: Mat, h: number, templateWindowSize: number, searchWindowSize: number, blockMatchingStep1: number, blockMatchingStep2: number, groupSize: number, slidingStep: number, beta: number, normType: number, step: number, transformType: number): void;
src

Input 8-bit or 16-bit 1-channel image.

dstStep1

Input/output value, modified by the native operation. Output image of the first step of BM3D with the same size and type as src.

dstStep2

Output destination, filled by the native operation. Output image of the second step of BM3D with the same size and type as src.

h

Parameter regulating filter strength. Big h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise.

templateWindowSize

Size in pixels of the template patch that is used for block-matching. Should be power of 2.

searchWindowSize

Size 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.

blockMatchingStep1

Block 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.

blockMatchingStep2

Block 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.

groupSize

Maximum size of the 3D group for collaborative filtering.

slidingStep

Sliding step to process every next reference block.

beta

Kaiser 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.

normType

Norm used to calculate distance between blocks. L2 is slower than L1 but yields more accurate results.

step

Step of BM3D to be executed. Possible variants are: step 1, step 2, both steps.

transformType

Type of the orthogonal transform used in collaborative filtering step. Currently only Haar transform is supported.

This function expected to be applied to grayscale images. Advanced usage of this function can be manual denoising of colored image in different colorspaces.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.