You are viewing a single comment's thread. Return to all comments →
DON'T UNDERSTAND WHY RUNTIME ERROR, MY PROGRAM IS IN PYTHON3
import cv2 import numpy as np im = 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, ]], dtype = np.uint8) kernel = np.ones((3,3), dtype = np.uint8) img_dilation = cv2.dilate(im, kernel, iterations=1) print(int(np.sum((img_dilation == 1))))
Seems like cookies are disabled on this browser, please enable them to open this website
Morphological Operations: Dilation
You are viewing a single comment's thread. Return to all comments →
DON'T UNDERSTAND WHY RUNTIME ERROR, MY PROGRAM IS IN PYTHON3