April 2020
Intermediate to advanced
438 pages
12h 2m
English
Perform the following steps to count objects using morphological closing and opening, again using OpenCV-Python functions:
image = cv2.imread('images/rasagolla.jpg')gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)gray = cv2.bitwise_not(gray) #255 - gray
edged = cv2.Canny(gray, 50, 150)thresh = cv2.threshold(gray, 100, 255, cv2.THRESH_BINARY_INV)[1]kernel = np.ones((4,4),np.uint8) ...
Read now
Unlock full access