Réponse acceptée

Image Analyst
Image Analyst le 22 Sep 2018

0 votes

They just want to know the number of rows and columns and don't care how many higher dimensions there are.
For images that may possibly be gray scale or color, I do this:
[rows, columns, numberOfColorChannels] = size(yourImage)
Note how I used more descriptive variable names that your code did. For grayscale, numberOfColorChannels = 1. For RGB, numberOfColorChannels = 3.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 22 Sep 2018

0 votes

Read the documentation about size() again, paying attention to the definition of the output when you the number of output is less than the number of dimensions of the data.

2 commentaires

zakir khan
zakir khan le 22 Sep 2018
Modifié(e) : Walter Roberson le 22 Sep 2018
~ asking about this sign for
example n is number of row and m is show number of column what dose this sing [M, N, ~] mean here

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by