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

Function gm_blur_kernel

ldm/modules/image_degradation/bsrgan_light.py:85–95  ·  view source on GitHub ↗
(mean, cov, size=15)

Source from the content-addressed store, hash-verified

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

Callers 1

anisotropic_GaussianFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected