March 2018
Beginner to intermediate
306 pages
9h 54m
English
import cv2, randomimport numpy as npimg = cv2.imread('bw.png', cv2.IMREAD_GRAYSCALE)
im2, contours, hierarchy = cv2.findContours(img, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)color = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)cv2.drawContours(color, contours, -1, (0,255,0), 3)cv2.imshow('contours', color)cv2.waitKey()cv2.destroyAllWindows()
contour = contours[0]image_to_show ...
Read now
Unlock full access