Creating a 5D array in Python
If I understand correctly, every pixel in the gray image is mapped to a single pixel in N other images. In that case, the map array is numpy.zeros((i.shape[0], i.shape[1], N, 2), dtype=numpy.int32) since you need to store 1 x and 1 y coordinate into each other N arrays, not the full Nth array every time.  Using integer indices will further reduce memory use.
Then result[y,x,N,0] and result[y,x,N,1] are the y and x mappings into the Nth image.
I have a gray image in which I want to map every pixel to N other matrices of size LxM.How do I initialize such a matrix?I tried
 result=numpy.zeros(shape=(i_size[0],i_size[1],N,L,M)) for which I get the Value Error 'array is too big'.Can anyone suggest an alternate method?