只是Matlab中的程序语句
imgRgb=imread('C:\Program Files\MATLAB\yue.tif');
inshow(imgRgb)
总是报错,File "C:\Program Files\MATLAB\yue.tif" does not exist.
这是报错原因力的语句说明 error('MATLAB:imread:fileOpen', 'File "%s" does not exist.', filename);
我存储的路径是Matlab软件存储的大文件下,那还有什么问题出错呢
æ¹æ³/æ¥éª¤
1ãå¨matlab软件ä¸ï¼è¯»åå¾åæ°æ®ï¼è½½å ¥ï¼å©ç¨çæ¯imreadå½æ°ï¼ä¸»è¦æ以ä¸4ç§æ¹å¼ï¼
A = imread(filename, fmt)
[X, map] = imread(...)
[...] = imread(filename)
[...] = imread(URL,...)
[...] = imread(...,Param1,Val1,Param2,Val2...)
ä½ä¸ºåæ¥ä»¥åæ为常è§çæ¹å¼ï¼éå第ä¸ç§è®²è§£ã
å¦ä¸å¾æ示å³ä¸ºå°è½½å ¥çå¾çï¼å¾çæ ¼å¼(jpg) ï¼
2ãå¨å½ä»¤çªå£ï¼Command Window)è¾å ¥è¯å¥ï¼
>> imdata = imread('haibao.jpg');
å³è¯»å ¥å¾çæ°æ®ä¿åå¨imdataç©éµä¸ãå¦ä¸æ示ï¼å¨Workspaceå¯ä»¥çå°è¯¥ç©éµä¿¡æ¯ï¼æ¯ä¸ä¸ª3ç»´ç©éµã
3ãå¨è¯»å ¥å¾åæ°æ®åå°±å¯ä»¥è¿è¡åç§ç®æ³æä½ï¼ç®åä»ç»å ç§å¸¸è§çå¾çæä½ï¼å¦ä¸ä»£ç å¯ä»¥å°å½©è²å¾è½¬ä¸ºç°åº¦å¾ï¼
>> imdata = imread('haibao.jpg');
>> imgray = rgb2gray(imdata);
>> imshow(imgray);
4ãå¾åäºå¼åæä½ï¼å¦ä¸æ示å³å¯ï¼
>> imdata = imread('haibao.jpg');
>> lev = graythresh(imdata);
>> bwimg = im2bw(imdata,lev);
>> imshow(bwimg)
äºå¼ååå¾åå¦ä¸æ示ï¼
我后来存储的路径都换成英文,可是还是不行
本回答被网友采纳