How can I check the image whether it is two-dimensional or three-dimensional programmatically?

3 次查看(过去 30 天)
I have a variety of images that I try to treat with a single matlab program, and these pictures are some of three dimensions and some are two dimensions. In order to read all the images and process them in my program, I must specify a specific treatment for images with two dimensions in order to implement the program on all types. So I first need to check the images if they are two-dimensional so that I can then convert them to three dimensions like the rest of the pictures I have. I hope there is a programmatic way to the problem.

采纳的回答

madhan ravi
madhan ravi 2020-7-5
doc ndim % if ndims() == 3 or 2

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by