2

is there a python version for https://www.mathworks.com/help/images/sliding-neighborhood-operations.html, or a way to do it efficiently?

I want to be able to fit a custom sized window say [2x2] over an image/array, and apply a custom function to the values on that window. For example, like the matlab page, it could be setting the max of the surrounding numbers, though i know a convolution can do that. Specifically, I want to apply https://python-colormath.readthedocs.io/en/latest/delta_e.html the delta2000 function to each pixel and its neighbors and see the results.

I have not been able to find anything.

ha554an
  • 103
  • 6

1 Answers1

0

For discrete convolution operations which are the most common sliding neighborhood methods (to apply filters on images like gaussian, blurring, e.t.c), OpenCV is a good library (and for any image processing task).

You should check also Numpy, which is used to operate with arrays (for instance, 2D or 3D images) and works fine with OpenCV

Victor Ruiz
  • 1,192
  • 9
  • 9