I have a images, each with a single value of 1
(delta) within it and previously known sigma. Reproduction of a single example:
img = np.zeros((40,40))
idx1 = np.random.randint(0, img.shape[0])
idx2 = np.random.randint(0, img.shape[1])
img [idx1, idx2] = 1
I wish to convolve each image with it's respected sigma value, such as in:
out_image = scipy.ndimage.filters.gaussian_filter(img, sigma, mode='constant')
The thing is since it is only a single delta, the output will just be to substitute the gaussian's values into the image, centered around the location of the delta. Will it be faster to implement this? If so, how do I generate the sigma filter? Maybe there is a faster sparse representation in skimage
or cv2
which can make a faster job for me?
What will be the most efficient way (in terms of execution time), to repeatedly calculate such a case, given that the location of the delta and sigma size changes each time?