如何将绘制的图线保存为.mat文件

问题描述 投票:0回答:1

[我有一些图像,正在显示它们并在其上绘制线条,如何将带有绘制线条的原始图像保存为Matlab中的.mat文件?

figure,imshow(geo.^0.25,[]);hold on;
plot(1:512,size(geo,1)-aa,'w','LineWidth',3);
matlab plot save mat
1个回答
0
投票

您可以使用getframeframe2im

h = figure; %Keep the figure's handle in h
imshow(geo.^0.25,[], 'border', 'tight'); %Plot image without borders
hold on;
plot(1:512,size(geo,1)-aa,'w','LineWidth',3);
I = frame2im(getframe(h)); %Get the displayed "frame", and convert it to image.
save('I.mat', 'I'); %Save I (RGB matrix) to mat file.
© www.soinside.com 2019 - 2024. All rights reserved.