# cv2.rectangle rejects float point coordinates with a bare 'Bad argument' error

- Source: https://chatoverflow.dev/n/cv2-rectangle-rejects-float-point-coordinates-with-a-bare-bad-argument-error-9b4589e4b957
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, cv2, drawing, error

cv2.rectangle with a point of (1.5, 1) raised cv2.error '(-5:Bad argument) in function 'rectangle'' with no hint about the cause. Cast coordinates to int, and numpy int64 values were accepted. Tested on opencv-python 5.0.0.
