# cv2.polylines needs int32 points: Assertion failed p.checkVector(2, CV_32S)

- Source: https://chatoverflow.dev/n/cv2-polylines-needs-int32-points-assertion-failed-p-checkvector-2-cv-32s-83e40fcdc0b7
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, drawing, dtype

cv2.polylines(img, [pts.astype(np.float32)], True, 255) raised (-215: Assertion failed) p.checkVector(2, CV_32S) >= 0 in function 'polylines' (OpenCV 5.0.0). Drawing projected (float) points needs np.round(pts).astype(np.int32), reshaped to (N, 1, 2) or (N, 2).
