How to combine multiple images into an array

7 次查看(过去 30 天)
Tarek Hajj Shehadi
Tarek Hajj Shehadi2021-10-17
编辑: Dave B ,2021-10-17
I have a set of 7 images each of size 256x256x3 but since these images are all in gray scale then the channels "3" are useless. My question is how can I combine these seven images in an array or cell of size 256x256x7?
I tried using the cat function
but this returned a cell of size 256x256x21


Dave B
Dave B 2021-10-17
编辑:Dave B 2021-10-17
You can convert a 'greyscale' RGB image to a 2D image in a few ways. For instance: you could just take one channel (like the red channel) if the red and green and blue channels are all identical, or you could take the mean or use im2gray (if the signal you're interested in is gray but the data are in color).

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by