作者forb9823018 (风过无痕)
看板MATLAB
标题[问题]画图存图片问题
时间Mon Jul 21 20:15:20 2014
我将影片读取後
用
hold on
rectangle('Position',BB(m,:),'LineWidth',4,'LineStyle','-','EdgeColor','b');
画长方形加上去
跑出来的图是正常的
但用
imwrite(I,strcat(inputPath,'pic',num2str(a),'.jpg'),'jpg');
存档时却没把长方形存进去
有大大知道怎麽解决吗?
感谢!!!
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.113.202.193
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/MATLAB/M.1405944923.A.8D2.html
1F:→ aada:imwrite不适合, 试试看用saveas(f,'档名','格式') 07/22 07:54
我用saveas似乎不能改变路径
用cd以後还是会出现
Error using saveas (line 59)
Invalid handle.
saveas(I,strcat('pic',num2str(a),'.jpg'),'jpg');
※ 编辑: forb9823018 (140.113.202.193), 07/22/2014 15:22:17
用 print(I,'-djpeg',strcat(outputPath,'pic',num2str(a)));
会显示以下的error
Error using LocalCheckHandles (line 77)
Handle input must be scalar, vector, or cell-array of vectors.
Error in C:\Program
Files\MATLAB\R2012a\toolbox\matlab\graphics\private\checkArgsForHandleToPrint.p>checkArgsForHandleToPrint
(line 30)
Error in print>LocalCreatePrintJob (line 366)
handles = checkArgsForHandleToPrint(0, varargin{:});
Error in print (line 160)
[pj, inputargs] = LocalCreatePrintJob(varargin{:});
※ 编辑: forb9823018 (140.113.202.193), 07/22/2014 16:23:57
2F:→ forb9823018:喔喔我saveas可以存了但figure('visible','off') 07/22 17:07
3F:→ forb9823018:指令没用了,还是会一直跳图,感谢 07/22 17:08
4F:→ forb9823018:我误会gcf那格是图片矩阵,原来真的只有gcf 07/22 17:09