So I wrote code to crop out the ball in the attached picture and paste it somewhere else. But despite providing the correct dimensions, I keep getting an error.
import cv2
img=cv2.imread('messi.jpg',1)
ball=img[448:511,426:486]
img[190:253,450:510]=ball
cv2.imshow('messi',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Error i get while executing this:
line 6, in img[190:253,450:510]=ball ValueError: could not broadcast input array from shape (49,60,3) into shape (63,60,3)
I would be really grateful if someone could help me out with this. Thanks!
The picture for reference: