可视化生成的图片与作者百度网盘中提供的图片大小不一致
chenjiachengzzz opened this issue · comments
chenjiachengzzz commented
Yuanhao Cai commented
你好,感谢你的关注。用matlab可视化代码直接生成的图片是带白边的,提供在百度网盘里的图片是裁剪过后的。
你可以使用裁剪软件或者写一个裁剪代码来实现这一功能,以下是我自己写的一个裁剪代码,供你参考:
%Cut Out
clear all
method = ["MST","CST","DAUHST","MST_pp","HDNet","Truth"];
frame = 'frame1';
channel = ["channel6","channel16","channel21","channel28"];
save_dir = strcat(frame,'_simulation_compare_no_box\');
mkdir(save_dir);
for i=1:length(method)
for j=1:length(channel)
I = imread(strcat('simulation_results\rgb_results\',method(i),'\',frame,channel(j),'.png'));
rect = [181 37 553 553];
I_crop = imcrop(I,rect);
imwrite(I_crop,strcat(save_dir,method(i),'_',channel(j),'.png'));
end
end
chenjiachengzzz commented
你好,感谢你的关注。用matlab可视化代码直接生成的图片是带白边的,提供在百度网盘里的图片是裁剪过后的。 你可以使用裁剪软件或者写一个裁剪代码来实现这一功能,以下是我自己写的一个裁剪代码,供你参考:
%Cut Out clear all method = ["MST","CST","DAUHST","MST_pp","HDNet","Truth"]; frame = 'frame1'; channel = ["channel6","channel16","channel21","channel28"]; save_dir = strcat(frame,'_simulation_compare_no_box\'); mkdir(save_dir); for i=1:length(method) for j=1:length(channel) I = imread(strcat('simulation_results\rgb_results\',method(i),'\',frame,channel(j),'.png')); rect = [181 37 553 553]; I_crop = imcrop(I,rect); imwrite(I_crop,strcat(save_dir,method(i),'_',channel(j),'.png')); end end
哇 yuanhao大哥 也太强了,太感谢您了啊。