본문 바로가기

일반

TypeError: Required argument 'rec' (pos 2) not found

opencv2에서 이와 같은 메세지 나올 경우중 한가지..

 

TypeError: Required argument 'rec' (pos 2) not found

toImage = cv2.rectangle(
image
, pt1=(int(value[2]), int(value[3]))
, pt2=(int(value[4]), int(value[5]))
, color=(0, 0, 255)
, thickness=3
)

위치 지정하는 point에 int값으로 설정. str 값이거나, float 일경우 위와 같은 에러 발생.

아마 래퍼된 2번째 함수와 혼동할까봐 알려주는 에러메세지인듯 하나, 첫번째 함수 호출이 분명하다면 위에 경우도 생각해야 함.