I am trying to attract an arbitrary quadrangle on an image using the polyline function in OpenCV. When I receive the following error
OpenCV error: failure in filing in polyline (p.checkVector (2, CV_32S)> = 0), file / TMP / build / ROS-Opencv2 I do the same call to the function,
cv2.polylines (IMG, issue, 1, (255255255))
where the numbers are shown below, (as the image size is 1280x960):
[[910 641] [206 632] [6 6 488] [458 485]]
and IMG F is a normal image that I am showing. Currently I am just drawing the line between these points, but I am looking for a more beautiful solution.
How should I fix this error?
The problem in my case was that
numpy.array created
Int64 -bits number by default so I want it to be
int32 :
point = np.array ([[910, 641], [206, 632] ], [6, 6, 488], [458, 485]] # points.dtype = & gt; 'Int64' cv2.polylines (img, np.int32 ([points]), 1, (255,255,255))
(cv2 python looks like a bug in binding, it should be verified
dtype )
No comments:
Post a Comment