I’m trying to draw a rectangle on an image using a tuple for color, which is what I see in all of the examples (0, 255, 0). The error I get says TypeError: an integer is required (got type tuple). I can draw a line just fine with a tuple for color, so I’m confused.
def annotateImage(cudaImage, detections):
# cv2
array = jetson.utils.cudaToNumpy(cudaImage)
cv2.cvtColor(array, cv2.COLOR_RGB2BGR)
color = (0, 255, 0)
thickness = 2
for detection in detections:
topLeft = (detection.Left, detection.Top)
bottomRight = (detection.Right, detection.Bottom)
cv2.rectangle(array, topLeft, bottomRight, color, thickness)
cv2.cvtColor(array, cv2.COLOR_BGR2RGB)
return jetson.utils.cudaFromNumpy(array)
Thanks for any help.