MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / gm_blur_kernel

Function gm_blur_kernel

ldm/modules/image_degradation/bsrgan.py:86–96  ·  view source on GitHub ↗
(mean, cov, size=15)

Source from the content-addressed store, hash-verified

84
85
86def gm_blur_kernel(mean, cov, size=15):
87 center = size / 2.0 + 0.5
88 k = np.zeros([size, size])
89 for y in range(size):
90 for x in range(size):
91 cy = y - center + 1
92 cx = x - center + 1
93 k[y, x] = ss.multivariate_normal.pdf([cx, cy], mean=mean, cov=cov)
94
95 k = k / np.sum(k)
96 return k
97
98
99def shift_pixel(x, sf, upper_left=True):

Callers 1

anisotropic_GaussianFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected