I am trying to use cv2.polylines to overlay a polygon (form) onto an image (img).
with :
cv2.polylines(img, [form], True, (255,0,0),3)
and I get following error:
error: OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-q3d_8t8e\opencv\modules\imgproc\src\drawing.cpp:2427: error: (-215:Assertion failed) p.checkVector(2, CV_32S) >= 0 in function ‘cv::polylines’
form is a np array
array([[3701.501, 1566.101],
[3649.776, 1557.93 ],
[3530.118, 1554.096],
[3490.237, 1562.728],
[3461.342, 1581.871],
[3488.825, 1635.816],
[3642.202, 1668.324],
[3761.117, 1693.492],
[3841.695, 1691.699],
[3850.564, 1662.13 ],
[3772.743, 1595.586]])
and img is a 4000 by 3000 3band 8bit image read with cv2.imread…
What could be the problem here?