I'm trying to warp two images of different sizes using PIL; specifically, by setting the shape (size) for future warped target image as a numpy array and I'm encountering AttributeError:
File "C:\Anaconda2\lib\site-packages\PIL\Image.py", line 632, in getattr raise AttributeError(name) AttributeError: shape
Why does this happen? I'm under the impression that I was doing this exact thing some time ago and it was working just fine, not to mention the fact that I absolutely don't understand what is it that python doesn't understand (the shape attribute should take this as an input with no problem)
import skimage.io
from PIL import Image
import numpy as np
Img1 = Image.open(picture1 + ".png")
Img1
Img2 = Image.open(picture2 + ".png")
Img2
r, c = Img2.shape[:2]
# creates array for the future shape in x,y
corners = np.array([[0, 0],
[0, r],
[c, 0],
[c, r]])
...
Regards, JJ