mirror of
https://github.com/artegoser/image-pluser-webui.git
synced 2025-02-22 20:23:15 +03:00
feat: canny edge
This commit is contained in:
parent
26702d57f1
commit
3f1d13c1c0
3 changed files with 17 additions and 3 deletions
|
@ -1,4 +1,6 @@
|
|||
from PIL import Image, ImageFilter
|
||||
from skimage import feature
|
||||
import numpy as np
|
||||
|
||||
|
||||
def edge(file_name):
|
||||
|
@ -9,6 +11,14 @@ def edge(file_name):
|
|||
return image.filter(ImageFilter.FIND_EDGES)
|
||||
|
||||
|
||||
def canny_edge(file_name):
|
||||
image = Image.open(file_name)
|
||||
image = image.convert("L")
|
||||
image = np.asarray(image)
|
||||
|
||||
return Image.fromarray(feature.canny(image, sigma=2))
|
||||
|
||||
|
||||
def sharpen(file_name):
|
||||
image = Image.open(file_name)
|
||||
return image.filter(ImageFilter.SHARPEN)
|
||||
|
|
Loading…
Add table
Reference in a new issue