matlab 画框(三) 画框并保存图像
initstate = [x y w h];
%-----------------------------------------Show the tracking result
imshow(uint8(img1));
rectangle('Position',initstate,'LineWidth',4,'EdgeColor','r');
text(5, 18, strcat('#',num2str(i)), 'Color','y', 'FontWeight','bold', 'FontSize',20);
set(gca,'position',[0 0 1 1]);
%保存结果
%outputImg---文件夹
outputImgName = [outputImg,num2str(i),'.jpg'];
saveas(gcf, outputImgName, 'jpg');