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

前端 未结 2 647
梦如初夏
梦如初夏 2021-01-14 10:16
[r,c,d] = size(rgbImage);  %# Get the image dimensions

What does r,c,d stand for here?

相关标签:
2条回答
  • 2021-01-14 11:09

    In that line of code:

    • r is the number of rows in the image (i.e. the size of the first dimension).
    • c is the number of columns in the image (i.e. the size of the second dimension).
    • d can be referred to as the "depth" or "planes" of the image (i.e. 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.

    0 讨论(0)
  • 2021-01-14 11:17

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

    0 讨论(0)
提交回复
热议问题