numpy - Gaussian Smoothing an image in python -


i new programming in python, , im still trying figure out, have problem trying gaussian smooth or convolve image. easy fix, i've spent time trying figure out im starting go crazy. have 3d .fits file of group of galaxies , have cut out 1 , saved png aplpy. basically, needs smoothed gaussian larger beam size (i.e. make whole thing larger expanding out fwhm dimming output). know there things scipy.ndimage.convolve , similar function in numpy can use, im having hard time translating usefull. if can give me hand , point me in right direction huge help.

something perhaps?

import numpy np import scipy.ndimage ndimage import matplotlib.pyplot plt  img = ndimage.imread('galaxies.png') plt.imshow(img, interpolation='nearest') plt.show() # note 0 sigma last axis, don't wan't blurr color planes together! img = ndimage.gaussian_filter(img, sigma=(5, 5, 0), order=0) plt.imshow(img, interpolation='nearest') plt.show() 

enter image description here enter image description here

(original image taken here)


Comments