0

Hello I'm working with images with Python. I want to convolve an image with a gaussian filter. The image is an array that it have the shape (64,64,3) 64x64 pixels and 3 channels of colour. How will it be the gaussian filter? which dimension? Do you know a function to define it and make the convolution with the image?

Skullgreymon
  • 193
  • 1
  • 1
  • 8
  • have a look at opencv module, sounds as if that could help you - unless you want to implement the convolution yourself, then probably numpy - se https://docs.opencv.org/3.1.0/d4/d13/tutorial_py_filtering.html - and read that: [fastest-2d-convolution-or-image-filter-in-python](https://stackoverflow.com/questions/5710842/fastest-2d-convolution-or-image-filter-in-python) – Patrick Artner Jan 12 '18 at 19:53
  • I'm thinking on having an array and make the convolution. But the array I have obtained with a function of the internet is 64x64, And it doesnt fit the shapes. – Skullgreymon Jan 12 '18 at 19:54
  • there are some other links for image convolution, they might help you out. added one above. – Patrick Artner Jan 12 '18 at 19:58

1 Answers1

0

You have to create a gaussian filter of the dimension you want e.g. 3x3 or 11x11.

Then do the convolution on each channel of colour.

If you want to do it using Fourir, you have to apply psf2otf (a matlab function that it is also in Python by users) and multiply both matrixs pointwise (on each channel).

Skullgreymon
  • 193
  • 1
  • 1
  • 8