[問題]畫圖存圖片問題

看板MATLAB作者 (風過無痕)時間9年前 (2014/07/21 20:15), 9年前編輯推噓0(004)
留言4則, 2人參與, 最新討論串1/1
我將影片讀取後 用 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://www.ptt.cc/bbs/MATLAB/M.1405944923.A.8D2.html

07/22 07:54, , 1F
imwrite不適合, 試試看用saveas(f,'檔名','格式')
07/22 07:54, 1F
我用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

07/22 17:07, , 2F
喔喔我saveas可以存了但figure('visible','off')
07/22 17:07, 2F

07/22 17:08, , 3F
指令沒用了,還是會一直跳圖,感謝
07/22 17:08, 3F

07/22 17:09, , 4F
我誤會gcf那格是圖片矩陣,原來真的只有gcf
07/22 17:09, 4F
文章代碼(AID): #1JpGHRZI (MATLAB)