modify shebang

This commit is contained in:
2024-11-19 13:50:23 +01:00
parent f6d62bff73
commit 3f97202a03
11 changed files with 173 additions and 118 deletions

View File

@@ -286,11 +286,13 @@ def richardson_lucy(image, psf, iterations=20, clip=True, filter_epsilon=None):
image = image.astype(float_type, copy=False)
psf = psf.astype(float_type, copy=False)
psf /= psf.sum()
im_deconv = image.copy()
im_deconv = np.full(image.shape, 0.5, dtype=float_type)
psf_mirror = np.flip(psf)
eps = 1e-20
for _ in range(iterations):
conv = convolve(im_deconv, psf, mode="same")
conv = convolve(im_deconv, psf, mode="same") + eps
if filter_epsilon:
relative_blur = np.where(conv < filter_epsilon, 0, image / conv)
else: