refactor: methods

This commit is contained in:
Artemy 2023-04-18 13:16:16 +03:00
parent 3f1d13c1c0
commit 09346cb114
6 changed files with 35 additions and 24 deletions

View file

@ -2,6 +2,8 @@ from PIL import Image, ImageFilter
from skimage import feature
import numpy as np
methods = ["Sharpen", "Edge detection", "Canny edge detection"]
def edge(file_name):
image = Image.open(file_name)
@ -22,3 +24,10 @@ def canny_edge(file_name):
def sharpen(file_name):
image = Image.open(file_name)
return image.filter(ImageFilter.SHARPEN)
methods_funcs = {
"Sharpen": sharpen,
"Edge detection": edge,
"Canny edge detection": canny_edge,
}

View file

@ -2,6 +2,8 @@ from PIL import Image, ImageChops
from tqdm import tqdm
import numpy as np
methods = ["Denoise", "StarTracks", "Noise extractor", "Untrack"]
def denoise(files):
images = [np.asarray(Image.open(file)) for file in tqdm(files)]
@ -36,3 +38,11 @@ def untrack(files):
image = im3
return image
methods_funcs = {
"Denoise": denoise,
"StarTracks": startracks,
"Noise extractor": noise_extractor,
"Untrack": untrack,
}