export frames as pictures

来源:互联网 发布:高达ma 知乎 编辑:程序博客网 时间:2024/06/01 08:29
function show_initilization%show_target(0.2, 1)%show_template('v4_mesh0.obj', 0.5, 1, 'interp')name = 'target.obj';%options = [];options.name = name;[vertex,faces] = read_mesh(name);vertex = vertex * 0.01;vertex = vertex + repmat([0 -0.9 0], size(vertex,1), 1);options = [];%options = arrayfun(@(x) show_frame(x, vertex, faces,options), 0 );show_frame(1, vertex, faces, options);endfunction options = show_frame(index, vertex, faces, options)clf;%iptsetpref('ImshowBorder','tight'); show_target(vertex, faces, 0.2, 0, 1);name = strcat(strcat('h2g',num2str(index)),'.obj');    %name = 'coarse_mesh000.obj'name = 'v6_mesh.obj' options = show_template(name, 1, 1, 'interp', 1, 0, options);drawnow;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%fullscreenset(gcf,'color',[1 1 1]);%set figure background colorF = getframe(gcf);X = frame2im(F);save_name = strcat(strcat('frame', num2str(index)),'.png');imwrite(X, save_name)end

0 0
原创粉丝点击