2023-04-15 19:36:31 +03:00
|
|
|
from methods.stack_methods import denoise, startracks, noise_extractor, untrack
|
|
|
|
import os
|
2023-04-16 09:55:33 +03:00
|
|
|
from processing.utils import generate_name
|
2023-04-15 19:36:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
def stacking(dir, method):
|
|
|
|
files = os.listdir(dir)
|
|
|
|
files = list(map(lambda x: os.path.join(dir, x), files))
|
|
|
|
files = list(filter(lambda x: x.endswith(".png"), files))
|
|
|
|
|
|
|
|
if method == "denoise":
|
|
|
|
img = denoise(files)
|
|
|
|
elif method == "startracks":
|
|
|
|
img = startracks(files)
|
|
|
|
elif method == "noise extractor":
|
|
|
|
img = noise_extractor(files)
|
|
|
|
elif method == "untrack":
|
|
|
|
img = untrack(files)
|
|
|
|
|
|
|
|
name = generate_name()
|
|
|
|
img.save(name)
|
|
|
|
|
|
|
|
return [name]
|