Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可视化生成的图片与作者百度网盘中提供的图片大小不一致 #27

Closed
chenjiachengzzz opened this issue Apr 25, 2023 · 2 comments

Comments

@chenjiachengzzz
Copy link

您好,首先感谢您做出这么棒的工作,并且无私的开源出来。在运行可视化matlab代码时,我生成的图片与作者生成的图片不一致。
frame1channel1
frame1channel1
第一张是我生成的,第二张是作者提供的,我想知道为何出现这种问题,是作者已经裁剪过图像了嘛?希望得到您的解答!

@caiyuanhao1998
Copy link
Owner

caiyuanhao1998 commented Apr 25, 2023

你好,感谢你的关注。用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
Copy link
Author

你好,感谢你的关注。用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大哥 也太强了,太感谢您了啊。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants