Reputation: 13
Getting a type error, 'tuple' object is not callable. Any idea what it could be? I am trying to create a program for steganography using DCT.
def write_to_image(path, text):
img = Image.open(path)
img.getdata()
r, g, b = [np.array(x) for x in img.split()]
lx, ly = r.shape() #Error is here
Upvotes: 1
Views: 240
Reputation: 63
As written here: the shape
attribute of a Numpy array is an attribute, not a method, and is a tuple.
Try lx, ly = r.shape
.
Note that I'm not calling r.shape
, I'm just accessing it like you would any other attribute of an object.
Upvotes: 1