加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

如何将matlab的figure保存成jpg

(2013-11-30 04:16:13)
分类: AboutResearch

how to save the figure into image with the same size 

= imread('peppers.png'); %# Load a sample 
imageimshow
(I); %# Display it
[r,c,d] = size(I); %# Get the image size
set(gca,'Units','normalized','Position',[0 0 1 1]); %# Modify axes size
set(gcf,'Units','pixels','Position',[200 200 c r]); %# Modify figure size
hold on
;
plot(100,100,'r*'); %# Plot something over the image
= getframe(gcf); %# Capture the current window 
imwrite(f.cdata,'image2.jpg'); %# Save the frame data
 
 

            imshow(vid(:,:, row)); hold on;

            text(5, 18, strcat('#',num2str(row)), 'Color','y''FontWeight','bold','FontSize',20);

            rectangle('Position',round(a.BoundingBox),'LineWidth',4,'EdgeColor','g');

 

            hold off;

            pause(0.01);

            s_res = sprintf('mouse/F%.5d.jpg', row);

            set(gca,'position',[0 0 1 1]);

            saveas(gcf,s_res)

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有