2

I would like to make a noise reducition filter on OpenCV just like the Gimp's Selective Gaussian Blur: https://docs.gimp.org/en/plug-in-sel-gauss.html

The filter compares each pixel with its surroundings and only blurs if the difference is lower the a maximum delta.

Pedro Serra
  • 781
  • 1
  • 5
  • 8
  • 1
    I found the implementation here, I think: https://gitlab.gnome.org/GNOME/gegl/blob/master/operations/common-gpl3+/gaussian-blur-selective.c – chris Sep 26 '18 at 20:31
  • Basic idea maybe: blur the entire image, get the gradient of the image, and use it as a mask to restore the blurred image back to the original where the gradient is too high. (I just made that up, I don't know what they do in that implementation) – chris Sep 26 '18 at 20:34

1 Answers1

1

You can try cv2.bilateralFilter(): https://docs.opencv.org/2.4/modules/imgproc/doc/filtering.html#bilateralfilter

"bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters."

chris
  • 1,831
  • 18
  • 33