mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
Added implementation and doc string
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from skimage import io, data
|
||||
from skimage import transform
|
||||
from skimage import color, filters
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
def custom_sobel(img):
|
||||
if img.ndim == 3:
|
||||
img = color.rgb2gray(img)
|
||||
|
||||
return filters.sobel(img)
|
||||
|
||||
img = data.coins()
|
||||
out = transform.seam_carve(img, 'vertical', 80, energy_func = custom_sobel)
|
||||
out = transform.seam_carve(out, 'horizontal', 70, energy_func = custom_sobel)
|
||||
|
||||
io.imshow(out)
|
||||
plt.figure()
|
||||
io.imshow(img)
|
||||
io.show()
|
||||
Reference in New Issue
Block a user