0

Consider a 64 x 64 pixel image (2d matrix), where each pixel represents 100nm in size. Say most of these pixels have a value of 0, and some have a positive value (1,2,...). I want to convolve these pixels with a 2d gaussian that will transform the non-zero pixels into a smooth 2d gaussian-like blob, with a radius of 250nm. So the width of the gaussian for every non-zero pixel, I am expecting to be about 5 pixel in width.

I see there exists the convolve2d function in scipy (scipy.signal.convolve2d ), which is probably what I am looking for. But I am confused about the second input to the function, thefilter_kernel matrix that it takes as input. How do I construct this matrix given the criteria above? Am I missing criteria in the first place? I want to transform discrete pixel intensity into gaussian of some width.

hexaquark
  • 883
  • 4
  • 16
  • `scipy.signal` is for signal processing. Use `scipy.ndimage` for image processing. You are looking for `scipy.ndimage.gaussian_filter`. There are many other image processing packages out there, scikit-image, opencv, diplib, ... They all have a Gaussian filter. – Cris Luengo Oct 12 '22 at 22:28

0 Answers0