毕业设计——人脸检测——001 图片导入MATLAB

本文详细介绍了如何在MATLAB中导入图片,包括使用绝对路径、相对路径和指定文件类型。同时,文章还讲解了MATLAB的注释方式,包括单行注释、多行注释和逻辑判断语句进行的隐式注释,并提供了相关资源链接作为进一步学习的参考。
摘要由CSDN通过智能技术生成

问题:如何导入图片到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.
  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值