看板 MATLAB 關於我們 聯絡資訊
我將影片讀取後 用 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
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
forb9823018:喔喔我saveas可以存了但figure('visible','off') 07/22 17:07
forb9823018:指令沒用了,還是會一直跳圖,感謝 07/22 17:08
forb9823018:我誤會gcf那格是圖片矩陣,原來真的只有gcf 07/22 17:09