Here's my code:
img = imread("lena.jpg")
for channel in range(3):
res = filter(img[:,:,channel], filter)
# todo: stack to 3d here
As you can see, I'm applying some filter for every channel in the picture. How do I stack them back to a 3d array? (= the original image shape)
Thanks
resin a list.np.stack(alist, axis=2)can be used to join them into an array on a lastchannelaxis.filterboth as a function and variable, beware of that. Also what kind of filter are you using? I don't see your filter variable is changing by the channel, so why not do a 3D filter and avoid the loop?