TypeError: integer argument expected, got float?
Closed this issue · 3 comments
Basavaraj-PN commented
Traceback (most recent call last):
File "recognize.py", line 169, in
fingers = count(thresholded, segmented)
File "recognize.py", line 78, in count
cv2.circle(circular_roi, (cX, cY), radius, 255, 1)
TypeError: integer argument expected, got float
Catastrophe101 commented
change line 78 to cv2.circle(circular_roi, (int(cX), int(cY)), int(radius), 255, 1)
CooperPair commented
you can also do the changes at the line number 59 and 60 that is
cX = (extreme_left[0] + extreme_right[0]) // 2
cY = (extreme_top[1] + extreme_bottom[1]) // 2
since it is asking for integer value.
Basavaraj-PN commented
thanks