Error in loading image

Hi,
I've used the syntax :
A=imread('Image1.jpg'); imshow(A)
I get the error:
??? Undefined function or method 'Image' for input arguments of type 'char'.
(I'm working in the same directory of the image file)

 採用された回答

EK
EK 2013 年 2 月 7 日

0 投票

Thank you both for suggestions.
I've used 'image' inside my program name. The 'image' displayed in the error was referring to it.
The error has disappeared by renaming the program.
Thank you for help
EK

1 件のコメント

Image Analyst
Image Analyst 2013 年 2 月 7 日
You can use "image" inside your program name and it won't cause a problem. For example an m-file named 123imageabc.m has "image" in the name but won't cause a problem. Now, if your m-file was called image.m so that "image" was the WHOLE name, not just inside the name, then that would cause a problem.

サインインしてコメントする。

その他の回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 7 日
編集済み: Azzi Abdelmalek 2013 年 2 月 7 日

0 投票

Try
clear imread
A=imread('Image1.jpg');
imshow(A)
% You probably used imread as a variable
Image Analyst
Image Analyst 2013 年 2 月 7 日

0 投票

I'm doubt imread() calls a function called Image(). That just doesn't sound right. Why? Well there's a built in function called image() - with a lower case i. So would the Mathworks make a function internal to imread() called Image() - with an upper case i? I doubt it.
I think this is a case of you not copying the actual error message but just typing it in, paraphrasing it, and getting it wrong. Please copy all the red text, and paste it back here so that we have the EXACT error message, which will include line numbers and actual lines of code and actual error messages.
Just to be sure you didn't redefine functions with your own and destroy the built in functions (as Azzi suggested), tell me what these lines of code typed into the command line say:
which -all imread
which -all imshow
If you don't see this:
C:\Program Files\MATLAB\R2012b\toolbox\matlab\imagesci\imread.m
C:\Program Files\MATLAB\R2012b\toolbox\images\imuitools\imshow.m
then you need to rename your programs of the same name that are confusing the interpreter.

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

タグ

質問済み:

EK
2013 年 2 月 7 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by