毕业设计——人脸检测——002 MATLAB实现提取一张图片像素点的RGB值
来源:互联网 发布:日本女生保养知乎 编辑:程序博客网 时间:2024/05/17 09:33
向Matlab中输入一张jpg图片,提取图片RGB值分别放到三个二维数组里,然后计算红绿蓝均值,完整程序.
clear all,clc;im=imread('1.jpg');%1.jpg为图片,在m文件所在目录下 im矩阵中(x,y,1~3)分别代表红、绿、蓝三色的矩阵s=size(im);R=im(:,:,1);G=im(:,:,2);B=im(:,:,3);R=reshape(R,[s(1),s(2)]);G=reshape(G,[s(1),s(2)]);B=reshape(B,[s(1),s(2)]);r=mean(mean(R));%红色均值g=mean(mean(G));%绿色均值b=mean(mean(B));%蓝色均值代码来自百度 @天上的一条龙
cell 单元格 -Create cell array 创建单元格数组
Syntax 语法
C = cell(dim)
C = cell(dim1,...,dimN)
D = cell(obj)
Description 描述
C = cell(dim) creates a cell array of empty matrices. If dim is a scalar, C is dim-by-dim. If dim is a vector, C is dim(1)-by-...-dim(N), where Nis the number of elements of dim.创建一个空矩阵的单元格数组。如果dim是标量,C为dim*dim。如果dim是矢量,C为dim(1)*...*dim(N),N是dim中成员个数
C = cell(dim1,...,dimN) creates cell array C, where C is dim1-by-...-dimN.创建一个数组C,C为dim1*...*dimN
D = cell(obj) converts a Java array or .NET array of System.String or System.Object into a MATLAB cell array. 包含Java数组或.Net中System.String的数组或者System.Object在MATLAB中的单元格数组
Tips 小贴士
Creating an empty array with the cell function, such as使用‘cell’函数创建一个空数组,例如
C = cell(3,4,2);
is exactly equivalent to assigning an empty array to the last index of a new cell array:与分配一个空数组给一个新单元格数组中最后一个索引恰好相同
C{3,4,2} = [];
Input Arguments 输入参数
dim
Scalar integer or vector of integers that specifies the dimensions of cell array C. 整数标量或整数矢量指定单元格数组的维数
dim1,...,dimN
Scalar integers that specify the dimensions of C. 标量整数指定C的维数
obj
One of the following: 一下一种
Java array or object JAVA的数组或object类型
.NET array of type System.String or System.ObjectSystem.String或System.Object型的.Net数组
Output Arguments 输出参数
C
Cell array. Each cell contains an empty, 0-by-0 array of type double. 单元格数组。每个单元格包含一个空的0*0类型为double的数组
D
Cell array. Each cell contains a MATLAB type closest to the Java or .NET type. For more information, see:
单元格数组。每个单元格包含一个MATLAB型类似于JAVA或.NET类型。如果需要更多相关信息,请浏览如下
Conversion of Java Return Types
.NET Type to MATLAB Type Mapping
Examples 例子
Create an empty 3-by-4-by-2 cell array. 创建一个空的3*4*2的空单元格数组
mycell = cell(3,4,2);
Create a cell array that is the same size as mycell, created in the previous example. 创建一个和mycell相同大小的单元格数组
similar = cell(size(mycell));以上Cell摘自:http://www.mathworks.se/help/techdoc/ref/cell.html
- 毕业设计——人脸检测——002 MATLAB实现提取一张图片像素点的RGB值
- 毕业设计——人脸检测——001 图片导入MATLAB
- 毕业设计——人脸检测——004 学习别人代码——《matlab读取一个目录下的所有图片》
- 数字图像处理——用Java获取像素点的RGB值
- object-c实现获取一个图片像素点RGB值的代码
- 获取一个图片像素点RGB值的代码
- 获取一个图片像素点RGB值的代码
- java获取图片像素点的RGB值
- 毕业设计——人脸检测——MATLAB 在图片上画矩形框(已知矩形左上角坐标、长、宽)
- 利用matlab提取并分割RGB图像中的某一个已知像素值的图像
- harris角点提取—matlab
- 新手求助解决如何提取像素点RGB值的问题
- Matlab 图像像素点在RGB空间的显示
- matlab 修改rbg图像中指定范围内像素点的rgb值
- 毕业设计——人脸检测——AdaBoost
- java获得一张图片的rgb值
- OpenCV 中读取一张图片的像素点,并显示
- c# 获取图片像素的RGB值
- C#.net 编写Windows服务
- poj 2240 Arbitrage floyd基础,字符串输入有点麻烦
- fat32转ntfs
- CLRS-Ch2(插入排序、合并排序、冒泡排序)
- 黑马程序员--数据集
- 毕业设计——人脸检测——002 MATLAB实现提取一张图片像素点的RGB值
- bad news
- 结构体小技巧
- 位的一些基本操作
- git下载google最新源码
- 关于指针偏移
- 解决执行 df -h 卡住,yum和rpm都无法安装软件问题
- 关于C#的精确计时问题
- oracle 分析函数