March 2018
Beginner to intermediate
306 pages
9h 54m
English
import cv2import numpy as npimport matplotlib.pyplot as plt
image = np.zeros((480, 640), np.uint8)cv2.ellipse(image, (320, 240), (200, 100), 0, 0, 360, 255, -1)
m = cv2.moments(image)for name, val in m.items(): print(name, '\t', val)
print('Center X estimated:', m['m10'] / m['m00'])print('Center Y estimated:', m['m01'] / m['m00'])