[][src]Function opencv::xphoto::bm3d_denoising

pub fn bm3d_denoising(
    src: &dyn ToInputArray,
    dst_step1: &mut dyn ToInputOutputArray,
    dst_step2: &mut dyn ToOutputArray,
    h: f32,
    template_window_size: i32,
    search_window_size: i32,
    block_matching_step1: i32,
    block_matching_step2: i32,
    group_size: i32,
    sliding_step: i32,
    beta: f32,
    norm_type: i32,
    step: i32,
    transform_type: i32
) -> Result<()>

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.

Parameters

  • src: Input 8-bit or 16-bit 1-channel image.
  • dstStep1: Output image of the first step of BM3D with the same size and type as src.
  • dstStep2: 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.

See also

fastNlMeansDenoising

C++ default parameters

  • h: 1
  • template_window_size: 4
  • search_window_size: 16
  • block_matching_step1: 2500
  • block_matching_step2: 400
  • group_size: 8
  • sliding_step: 1
  • beta: 2.0f
  • norm_type: cv::NORM_L2
  • step: cv::xphoto::BM3D_STEPALL
  • transform_type: cv::xphoto::HAAR