[转载] MATLAB | RGB image representation
转载自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.
[转载] MATLAB | RGB image representation的更多相关文章
- [转载]Matlab之静态文本多行输出
转载文章,原文链接:Matlab中的静态文本框中显示多行内容 有时候,我们在GUI中利用静态文本框显示程序的结果,但是结果很长,一行未必可以显示的开,而静态文本框不像edit或listbox那样通过滚 ...
- [转载]Matlab中fft与fftshift命令的小结与分析
http://blog.sina.com.cn/s/blog_68f3a4510100qvp1.html 注:转载请注明出处——by author. 我们知道Fourier分析是信号处理里很重要的技术 ...
- [转载]Matlab生成Word报告
最近在进行一批来料的检验测试,一个个手动填写报告存图片太慢了,就有了种想要使用Matlab在分析完后数据可以自动生成PDF报告的想法,于是就去网上搜索了相关的资料,发现Matlab中文论坛上有xiez ...
- [转载]MATLAB中FFT的使用方法
http://blog.163.com/fei_lai_feng/blog/static/9289962200971751114547/ 说明:以下资源来源于<数字信号处理的MATLAB实现&g ...
- [转载]Matlab中插值函数汇总和使用说明
http://blog.sciencenet.cn/blog-457143-679275.html MATLAB中的插值函数为interp1,其调用格式为: yi= interp1(x,y,xi,' ...
- [转载] MATLAB快捷键
原文地址,点此查看 一.常用对象操作 除了一般windows窗口的常用功能键外. 1.!dir 可以查看当前工作目录的文件. !dir& 可以在dos状态下查看. 2.who 可以查看当前 ...
- [转载]matlab图像处理为什么要归一化和如何归一化
matlab图像处理为什么要归一化和如何归一化,一.为什么归一化1. 基本上归一化思想是利用图像的不变矩寻找一组参数使其能够消除其他变换函数对图像变换的影响.也就是转换成唯一的标准形式以抵抗仿射变 ...
- 006——转载-MATLAB数字与字符之间的转换
(一)参考文献:https://jingyan.baidu.com/article/5bbb5a1bd8dcb113eba1799d.html (二)数字转换成字符串 第一步在我们的电脑上打开matl ...
- [转载]matlab视频读取函数VideoReader
看到以前matlab中读取视频多 使用mmreader等(参考<matlab读取/播放视频的函数>),而现在matlab有一个专门的视频读取类VideoReader完成视频读取的功能. 相 ...
- 转载 matlab矩阵数组常用操作
一. length 返回矩阵最长维的的长度 ndims 返回维数 numel 返回矩阵元素个数size ...
随机推荐
- debug补充、员工管理系统、字符编码、文件操作
一.debug补充 在当前行的代码左侧点击一下,会出现一个红点(打断点) 在代码编辑区域右键选择debug,不要在选择run 二.员工管理系统 # 创建大列表 staff_info_list = [] ...
- JZOJ 100149. 一道联赛A题
\(\text{Solution}\) 一眼 \(ODT\) 为避免每次都数颜色数量,提前记录下来,每次修改更新下 \(\text{Code}\) #include <cstdio> #i ...
- 物语(monogatari)
\(Description\) 某一天,少年邂逅了同病相连的IA.见面后,IA一把牵起少年的手,决定和他一起逃离部落,离开这个无法容身的是非之地. 要逃离部落,少年和IA就需要先选择一条耗时最少的路线 ...
- JZOJ 3293. 【SHTSC2013】阶乘字符串
\(\text{Problem}\) 给定一个由前 \(n\) 个小写字母组成的串 \(S\). 串 \(S\) 是阶乘字符串当且仅当前 \(n\) 个小写字母的全排列(共 \(n!\) 种)都作为 ...
- Camera | 5.Linux v4l2架构(基于rk3568)
上一篇我们讲解了如何编写基于V4L2的应用程序编写,本文主要讲解内核中V4L2架构,以及一些最重要的结构体.注册函数. 厂家在实现自己的摄像头控制器驱动时,总体上都遵循这个架构来实现,但是不同厂家.不 ...
- 一步一步地完成题目——费解的开关(C/C++语言)递推、递归、顺序思维
前言 本文中博主将一步一步地.以正常人的顺序思维完成题目--费解的开关,使用的核心方法是递推与递归. 题目 参考题目:费解的开关 详细的题目信息相信大家都已经知道了,因此这里为了简洁只展示输入输出格式 ...
- 【面试题】面试官:请你实现一个深拷贝,那如果是正则/set/函数怎么拷贝?
一.面试官灵魂三连问: 你知道哪些拷贝的方法? 让你实现一个深拷贝怎么实现? 那像正则.Set.Map.函数等如何拷贝? 二.浅拷贝方法 自己创建一个新对象,来接收你要重新复制或引用的对象值.如果对象 ...
- software_programming
2020-04-04 12:05:43 todo list Java8 实战2> chapter2 行为参数化 业务逻辑的隔离 DSL
- RabbitMQ-01-使用Java进行简单消息发送与接收
前言 这里使用手动管理jar与使用Maven管理jar两种方式,分别演示消息的发送和接收. 手动管理jar实现消息发送与接收 添加jar amqp-client-5.7.1.jar slf4j-api ...
- 为 windows 10 右键菜单加打开DOS窗口
创建一个批处理文件,输入以下行,保存执行即可. echo off reg add "HKCR\*\shell\ms-dos" /ve /d 打开DOS命令 /f reg add & ...