perf: The real mean between images and the acceleration of denoise processing

This commit is contained in:
Artemy 2023-04-17 18:46:59 +03:00
parent fbc9112fba
commit 26702d57f1

View file

@ -1,21 +1,11 @@
from PIL import Image, ImageChops from PIL import Image, ImageChops
from tqdm import tqdm from tqdm import tqdm
import numpy as np
def denoise(files): def denoise(files):
bias = 1 images = [np.asarray(Image.open(file)) for file in tqdm(files)]
image = Image.open(files[0]) return Image.fromarray(np.uint8(np.mean(images, axis=0)))
for file in tqdm(files):
alpha = 1 / bias
im2 = Image.open(file)
im3 = Image.blend(image, im2, alpha)
image = im3
bias += 1
return image
def startracks(files): def startracks(files):