You are viewing a single comment's thread. Return to all comments →
import numpy as np import matplotlib.pyplot as plt from skimage.io import imread, imshow from skimage.draw import disk from skimage.morphology import (erosion, dilation, closing, opening, area_closing, area_opening) from skimage.color import rgb2gray a = np.array([ [0,0,0,0,0,0,0,0,0,0], [0,1,1,1,1,1,1,1,0,0], [0,0,0,0,1,1,1,1,0,0], [0,0,0,0,1,1,1,1,0,0], [0,0,0,1,1,1,1,1,0,0], [0,0,0,0,1,1,1,1,0,0], [0,0,0,1,1,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0] ]) s = np.array([ [1,1,1], [1,1,1], [1,1,1]]) unique, freq = np.unique(erosion(a,s), return_counts=True) print(freq[1]) unique, freq = np.unique(erosion(a,s), return_counts=True) print(freq[1])
Seems like cookies are disabled on this browser, please enable them to open this website
Morphological Operations: Erosion
You are viewing a single comment's thread. Return to all comments →