I need to reshape an image to obtain a 3D matrix made by his rows,by his cols and by his number of channels and obtain so 3 components (everyone has a decorrelated version , I did before, of input image) Thanks the 3rd dimension I have to use the 3 different image.
In Matlab I do :

Code:
Decorr=colorDecorrelation(inComp,numColComp); //decorrelation (yet done)


rgbDecorr= reshape(Decorr, r, c, numColComp);

//some function to use 3 new images in the 3d matrix