转载自https://www.geeksforgeeks.org/matlab-rgb-image-representation/

MATLAB | RGB image representation

An RGB image can be viewed as three different images(a red scale image, a green scale image and a blue scale image) stacked on top of each other, and when fed into the red, green and blue inputs of a colour monitor, it produces a colour image on the screen.

An RGB image is sometimes referred to as a true colour image as the precision with which a real-life image can be replicated has led to the nickname “true colour image.”

 

In MATLAB, an RGB image is basically a M*N*3 array of colour pixel, where each colour pixel is associated with three values which correspond to red, blue and green colour component of RGB image at a specified spatial location.
So, the colour of any pixel is determined by the combination of the red, green, and blue intensities stored in each colour plane at the pixel’s location.
Here each colour plane is a M*N array.

As can be seen in the above image, Pixel(A) has value (255, 0, 255) and is determined by the combination of intensities stored in the red colour plane, green colour plane and blue colour plane respectively.

Similarly, pixel(B) has value (127, 255, 0) and is determined in the same manner as pixel(A).

Colour planes of RGB image:
Consider an RGB image array ‘I’ then,
I(:, :, 1) represents the Red colour plane of the RGB image
I(:, :, 2) represents the Green colour plane of the RGB image
I(:, :, 3) represents the Blue colour plane of the RGB image

RGB image array range:
In MATLAB, an RGB image array can be of class ‘double’, ‘uint8’, or ‘uint16’ datatype. The datatype class of colour component determines the range of values.
For example,
if an RGB image is of class ‘double’ then each colour component is a value between 0 and 1.
Similarly, if an RGB image is of class ‘uint8’, the range of values that each colour component can have is [0 – 255] and [0 – 65535 ] if the RGB image is of class ‘uint16’.

Bit depth:
The number of bits used to store a pixel value of component image determines the bit depth of an RGB image. For example, if each colour component image is an 8-bit image, the RGB image will be said to have 24 bit deep.

Possible number of colours in RGB image:
Let an RGB image is of class ‘uint8’, i.e the range of values a colour component plane can have is [0 – 255 ] ( a total of 256 shades of that colour).
So, each individual colour plane of An RGB image is capable of showing 256 shade of that colour.
So total number of combination of colour that can be represented in an RGB image is 256 X 256 X 256 = 16777216, approximately 16 million.

最新文章

  1. 如何转换WMV到MP3,WMV到MP3播放器
  2. C++联合体(union)
  3. AC日记——二叉树最大宽度和高度 1501 codevs
  4. 一个servlet处理来自多个不同页面的请求!
  5. 【BZOJ】【2940】【POI2000】条纹
  6. DataTables给每一列添加下拉框搜索
  7. Ubuntu 13.10 下安装 eclipse
  8. Android项目开发五-《星星生活志》1.使用MediaRecorder录制音频
  9. (Problem 28)Number spiral diagonals
  10. 03-IOSCore - XML及解析、Plist
  11. 关于老版本ubuntu源不能用的问题
  12. Django-基础之web框架
  13. LAMP动静分离安装(源码安装)
  14. javascript 之 函数
  15. vsftp在iptables中的配置
  16. 七、PyQT5控件——QSlider,QSpinBox
  17. AX_RecordSortedList
  18. 【读书笔记】iOS-处理内存警告
  19. WPF基础学习笔记整理 (二) XAML
  20. linux(centOs)下memcached安装

热门文章

  1. 数字列表number,目标值target,找到number中两个不同数字之和等于target的数字,输出下标并顺序排列 ----笔试题记录扩展
  2. JZOJ 6801. NOIP2020.9.19模拟patrick
  3. Art of Illusion 一款**的开源 3D 建模和渲染软件
  4. Python 生成多个空列表 空List 空数组方法
  5. GPS地图生成04之数据预处理
  6. ArcGIS for Android 实现地图基本操作
  7. 马哥教育第一周作业N67044-张铭扬
  8. 金蝶AAS-V9精简版使用手册1.6
  9. 使用WTM框架项目的部署遇到的问题及解决方式
  10. windows下解决getAddressInfo Failed的一种办法