I'm stuck at this tutorial where a ROI is pasted over another region of same image. Python trows a value error when I try something similar:
img = cv2.imread(path, -1)
eye = img[349:307, 410:383]
img[30:180, 91:256] = eye
Exeption:
Traceback (most recent call last):
File "test.py", line 13, in <module>
img[30:180, 91:256] = eye
ValueError: could not broadcast input array from shape (0,0,3) into shape (150,165,3)
This might be very newb question, but I couldn't come up with an answer by searching on google. Are there other numpy methods for doing this?
EDIT: Also in the tutorial its not specified how the coordinates should be entered. Ex: I can enter coords of the region I want something like: eye = img[x1:y1, x2:y2]
or img[x1:x2, y1:y2]
. This is what confusing to me. Actually I tried to get these coords from a mouse callback method which printed the position of the mouse click. So, the coordinates are surely from the inside of image.