stacking rgb images into 3d or 4d variable
8 views (last 30 days)
Adam Danz on 26 Sep 2019
Edited: Adam Danz on 26 Sep 2019
If the height and width are the same for all images, use cat().
a = ones(5,6,3)+0;
b = ones(5,6,3)+1;
c = ones(5,6,3)+2;
stacked = cat(4,a,b,c);
% ^ concatenate along 4th dim
If the image sizes are not identical, you can pad them smaller ones to match the size of the larged one by using paddarray() and then use cat().