Advertisement
Guest User

Morphology q

a guest
Jan 7th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. %matplotlib inline
  2.  
  3. import numpy as np
  4. import pandas as pd
  5. import matplotlib.pyplot as plt
  6. import skimage
  7. from skimage.io import imread
  8.  
  9. image_example = imread("pictures/hamburger.jpg")
  10. morph = skimage.morphology.binary_erosion(image_example[:, :, 2], selem=None, out=None)
  11.  
  12. morph = morph.astype(int)
  13.  
  14. counter = np.count_nonzero(morph)
  15. print(counter)
  16.  
  17. plt.imshow(morph, cmap = "gray")
  18. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement