Guest User

Morphology q

a guest
Jan 7th, 2018
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×