mirror of
https://github.com/artegoser/image-pluser-webui.git
synced 2025-02-22 20:23:15 +03:00
refactor: methods
This commit is contained in:
parent
3f1d13c1c0
commit
09346cb114
6 changed files with 35 additions and 24 deletions
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue