In [1]:
import imageio.v2 as imageio
import numpy as np
import matplotlib.pyplot as plt
def plot_image_from_array(image_array, title=''''Image''''):
plt.imshow(image_array)
plt.axis(''''off'''') # Hide axes
plt.title(title)
plt.show()
In [2]:
from skimage import io, filters
image = io.imread("lena.jpg", as_gray=False)
gaussian = filters.gaussian(image, sigma=1)
plot_image_from_array(gaussian, title=''''gaussian'''')
In [3]:
from skimage import io, filters
image = io.imread("lena.jpg", as_gray=False)
edges_sobel = filters.sobel(image)
plot_image_from_array(edges_sobel, title=''''sobel'''')
In [4]:
from skimage import io, filters
image = io.imread("lena.jpg", as_gray=False)
edges_scharr = filters.scharr(image)
plot_image_from_array(edges_scharr, title=''''scharr'''')
In [5]:
from skimage import io, filters
image = io.imread("lena.jpg", as_gray=False)
edges_prewitt = filters.prewitt(image)
plot_image_from_array(edges_prewitt, title=''''prewitt'''')
In [6]:
from skimage import io, filters
image = io.imread("lena.jpg", as_gray=True)
edges_roberts = filters.roberts(image)
plot_image_from_array(edges_roberts, title=''''roberts'''')
In [7]:
from skimage import io, filters
image = io.imread("lena.jpg", as_gray=False)
median = filters.median(image)
plot_image_from_array(median, title=''''median'''')