I am drawing a cv2 rectangle by using below line
cv2.rectangle(rightImg, (x, y), (x + w, y + h), (0, 0, 255), 2)
Now values are
x = 93
y = 62
w = 6
h = 3
Now I want to crop that part of the rectangle. Does below line of code make sense:
cropImg = rightImg[y:x, y+h:x+w]
or
cropImg = rightImg[y+h:x+w, y:x]
I have tried both of the above but its not cropping the exact area. What can I try next?