Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %matplotlib inline
- import numpy as np
- import pandas as pd
- import matplotlib.pyplot as plt
- import skimage
- from skimage.io import imread
- image_example = imread("pictures/hamburger.jpg")
- morph = skimage.morphology.binary_erosion(image_example[:, :, 2], selem=None, out=None)
- morph = morph.astype(int)
- counter = np.count_nonzero(morph)
- print(counter)
- plt.imshow(morph, cmap = "gray")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement