I am following a tutorial in image recognition https://www.youtube.com/watch?v=ry9AzwTMwJQ&list=PLQVvvaa0QuDffXBfcH9ZJuvctJV3OtB8A&index=9
But the code built is made to compare images that have an alpha value and the image I want to test doesn't have alpha value.
I have tried a lot of things, here is how my last try looks like :
from PIL import Image
import numpy as np
i = Image.open('images/test.png')
iar = np.array(i)
def addAlpha(iar):
b = []
for eachRow in iar:
b += [[255]]
for eachRow in iar:
eachRow = np.append(eachRow, b, axis= 1)
print(eachRow)
print (iar)
return iar
iar = addAlpha(iar)
So when I print eachRow It looks like how I want it to be, but when I print iar nothing has changed, there are still only the RGB values.
I already thank you for any help and I apology for my bad English !
iar's shape? (Checkiar.shape)