简体   繁体   中英

What are the 3 dimensions of an RGB image in MATLAB?

[r,c,d] = size(rgbImage);  %# Get the image dimensions

r,c,d在这里代表什么?

In that line of code:

  • r is the number of rows in the image (ie the size of the first dimension).
  • c is the number of columns in the image (ie the size of the second dimension).
  • d can be referred to as the "depth" or "planes" of the image (ie the size of the third dimension).

For an RGB (or Truecolor) image , d is always 3. The first plane contains the degree of red in each pixel of the image, the second plane contains the degree of green in each pixel of the image, and the third plane contains the degree of blue in each pixel of the image.

Rows, Columns, Dimensions. Dimensions being the number of colors. Normally 3 for rgb, but sometimes 4 for an alpha channel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM