毕业设计——人脸检测——002 MATLAB实现提取一张图片像素点的RGB值
2011-11-26 05:05
726 查看
向Matlab中输入一张jpg图片,提取图片RGB值分别放到三个二维数组里,然后计算红绿蓝均值,完整程序.
C =
cell(dim)
C = cell(dim1,...,dimN)
D = cell(obj)
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中的单元格数组
Creating an empty array with the cell function, such as
使用‘cell’函数创建一个空数组,例如
is exactly equivalent to assigning an empty array to the last index of a new cell array:
与分配一个空数组给一个新单元格数组中最后一个索引恰好相同
Create an empty 3-by-4-by-2 cell array. 创建一个空的3*4*2的空单元格数组
Create a cell array that is the same size as mycell, created in the previous example. 创建一个和mycell相同大小的单元格数组
以上Cell摘自:http://www.mathworks.se/help/techdoc/ref/cell.html
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);
similar = cell(size(mycell));
以上Cell摘自:http://www.mathworks.se/help/techdoc/ref/cell.html
相关文章推荐
- 毕业设计——人脸检测——MATLAB 在图片上画矩形框(已知矩形左上角坐标、长、宽)
- 毕业设计——人脸检测——004 学习别人代码——《matlab读取一个目录下的所有图片》
- 毕业设计——人脸检测——001 图片导入MATLAB
- Java使用OpenCV实现人脸识别/人眼检测/图片截取/合成/添加水印
- PCA检测人脸的简单示例_matlab实现
- caffe 之 matlab 接口实现 做人脸识别--之人脸关键点检测
- 基于Gabor特征提取和人工智能神经网络的人脸检测matlab代码
- 利用ov511的webeye v2000摄像头实现YUV420P格式转RGB24格式来抓取一张图片
- 训练自己的人脸检测分类器(级联+LBP的Matlab的实现)
- opencv实现图片与视频中人脸检测功能
- 基于MATLAB的adaboost级联形式的人脸检测实现
- QT+opencv实现人脸检测并提取裁剪
- matlab—GUI实现摄像头人脸检测
- opencv实现图片及视频流(摄像头)的人脸检测
- 基于MATLAB的adaboost级联形式的人脸检测实现
- 基于肤色和眼睛定位的人脸检测算法——MATLAB实现【转】
- object-c实现获取一个图片像素点RGB值的代码
- 利用ov511的webeye v2000摄像头实现YUV420P格式转RGB24格式来抓取一张图片
- 关于Python+Opencv实现人脸检测的实验笔记(调用图片文件篇)
- 【分享】基于Gabor特征提取和人工智能神经网络的人脸检测matlab代码