使用MATLABR2010a进行图像处理 [英] Image processing using MATLABR2010a

查看:178
本文介绍了使用MATLABR2010a进行图像处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图读取图像并显示它,但是遇到错误并且我不理解它.请问有人可以帮助我吗?请注意,我使用的是MATLAB R2010a,下面的显示是错误的类型.

I tried to read an image and display it but i faced an error and i didn't understand it.can any one help me please, note that i use MATLAB R2010a, and the display below is the type of error.

>> imread('tas.jpg');
>> imshow('tas.jpg');
??? Attempt to call constructor image with incorrect letter case.


**Error in ==> basicImageDisplay at 9
hh = image(xdata,ydata,cdata, ...
Error in ==> imshow at 246
  hh = basicImageDisplay(fig_handle,ax_handle,...**

推荐答案

I = imread('tas.jpg');
imshow(I);

imread函数读取文件并将其转换为RGB像素矩阵.这存储在变量I中.然后,您可以调用imshow并将此RGB矩阵作为参数传递;)

The imread function reads the file and converts it to a RGB matrix of pixels. This is stored on the variable I. Then, you can call imshow passing this RGB matrix as a parameter ;)

编辑,您也可以使用文件名调用imshow,但是它没什么用,因为它不会返回稍后将用于处理的矩阵.而且由于错误仅在imshow上引发,因此我猜测imread函数由于某种原因而起作用.

edit you can call imshow with the filename as well, but it's not that useful because it does not return the matrix you will later use for processing. And as the error is thrown only on imshow, I'm guessing the imread function, for some reason, is working.

如果没有,只需仔细检查图像是否在实际目录中或路径中的目录中,或者是否未损坏.

If not, just double check if the image is on the actual directory or in a directory on the path, or if it is not corrupted.

这篇关于使用MATLABR2010a进行图像处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆