毕业设计——人脸检测——001 图片导入MATLAB
来源:互联网 发布:中国软件评测 编辑:程序博客网 时间:2024/04/30 11:57
问题:如何导入图片到MATLAB
解决:
Image1 = imread('E:\Graduate project\Database\test\subject01.centerlight.gif'); % 括号内为绝对路径
Image2 = imread('subject01.centerlight.gif'); %使用文件相对路径
Image3 = imread('subject01.centerlight','GIF'); %注意文件只有文件名,无后缀(不区分大小写),记着加引号
imshow(Image1);%显示
IMREAD Read image from graphics file.A = IMREAD(FILENAME,FMT) reads a grayscale or color image from the file specified by the string FILENAME. If the file is not in the current directory, or in a directory on the MATLAB path, specify the full pathname.
The text string FMT specifies the format of the file by its standard file extension. For example, specify 'gif' for Graphics Interchange Format files. To see a list of supported formats, with their file extensions, use the IMFORMATS function. If IMREAD cannot find a file named FILENAME, it looks for a file named FILENAME.FMT.
The return value A is an array containing the image data. If the file contains a gray scale image, A is an M-by-N array. If the file contains a true color image, A is an M-by-N-by-3 array. For TIFF files containing color images that use the CMYK color space, A is an M-by-N-by-4 array. See TIFF in the Format-Specific Information section for more information.上面英文帮助来自MATLAB帮助文档(在MATLAB Command Window使用‘help imread’可以查询到)
MATLAB注释方式:
A、
%{
若干语句,测试可以使用,注意括号都在百分号后面
%}
B、
多行注释: 选中要注释的若干语句, 编辑器菜单Text->Comment, 或者快捷键Ctrl+R
取消注释: 选中要取消注释的语句, 编辑器菜单Text->Uncomment, 或者快捷键Ctrl+T
(Ctrl+R注释多行,Ctrl+T取消注释)C、
if LOGICAL(0)
若干语句
end
这个方法实际上是通过逻辑判断语句不执行相关的语句
最后一种方法还没有测试使用过,会在以后的学习中测试(???)
注释方法参考:http://icictech.blog.163.com/blog/static/2797425420084595725499/
http://blog.sciencenet.cn/home.php?mod=space&uid=296318&do=blog&id=273228
用类似下面的语句导入多幅图片数据:
geshi = {'*.jpg','JPEG image (*.jpg)';... '*.bmp','Bitmap image (*.bmp)';... '*.*','All Files (*.*)'};[FileName FilePath] = uigetfile(geshi,'导入外部图片','*.jpg','MultiSelect','on');if ~isequal([FileName,FilePath],[0,0]); FileFullName = strcat(FilePath,FileName); if iscell(FileName) FileFullName = FileFullName([2:end 1])'; FileName = FileName([2:end 1])'; else FileName = {FileName}; FileFullName = {FileFullName}; endelse return;endn = length(FileFullName);for i=1:n Ii = imread(FileFullName{i});end上面方法来自:http://www.matlabsky.com/thread-13432-1-1.html @xiezhh相关链接还有:http://www.ilovematlab.cn/thread-27106-1-1.html
http://www.paper.edu.cn/paper.php?serial_number=200812-844 图片导入matlab后色彩分量矩阵的处理
在此对各位表示谢意
- 毕业设计——人脸检测——001 图片导入MATLAB
- 毕业设计——人脸检测——002 MATLAB实现提取一张图片像素点的RGB值
- 毕业设计——人脸检测——004 学习别人代码——《matlab读取一个目录下的所有图片》
- 毕业设计——人脸检测——MATLAB 在图片上画矩形框(已知矩形左上角坐标、长、宽)
- 毕业设计——人脸检测——AdaBoost
- 毕业设计——人脸检测——003 学习别人代码
- Android—2015年代做安卓毕业设计 Android毕业设计毕业设计AndroidAPP
- 毕业设计——规划
- 毕业设计——Resources
- matlab 霍夫变换—检测圆
- matlab 霍夫变换—检测圆
- 毕业设计——阶段性成果展示
- 毕业设计——Core Systems
- 毕业设计源码——搜索引擎
- 毕业设计—排课算法
- matlab教学(2)——数据导入
- matlab数据导入——从Excel导入
- 基于肤色和眼睛定位的人脸检测算法——MATLAB实现
- popen函数详解
- 用GDB调试程序 - Ubuntu中文
- Linux/UNIX 命令行大全完整版
- 【CPU 与编译器版】资源集合
- [ThinkPad] PWMTR32V.Dll的问题
- 毕业设计——人脸检测——001 图片导入MATLAB
- STL之vector
- 自编JQuery插件第十二个:水平滚动图片
- 博客检讨
- const 总 结
- [读书笔记]ASCII字符的兼容性
- UVa Problem 10215 The Largest/Smallest Box... (最大/最小的盒子)
- 2011年下半年11月份系统架构设计师上午试题答案之一
- 生成符合flexigrid的json格式的java代码