Closed zhouhao27 closed 6 years ago
After I change the script a bit:
import os
import sys
import json
import math
import cv2
It's ok to run. But I found a problem in:
moment = cv.Moments(points)
Then I change this to:
moment = cv2.moments(points)
I got this error:
TypeError: array is not a numpy array, neither a scalar
Apparently these two moments function are not the same.
Any idea?
My code:
points = np.array([(x1,y1), (x2,y2), (x3,y3), (x4,y4)])
moment = cv2.moments(points)
centerx = int(round(moment['m10']/moment['m00']))
centery = int(round(moment['m01']/moment['m00']))
Solved the problem.
Got the following error messgae:
Any idea? Thanks.