1 Star 0 Fork 0

Xintao/matlab_functions_verification

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
imresize_bicubic.m 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
Xintao 提交于 2020-10-29 03:21 . add imresize bicubic (#1)
% read the test image
img = imread('imresize_bicubic/baboon.png');
img = im2double(img);
test_times = 1;
elapsed_time = zeros(test_times,1);
% downsample x2
for i = 1:test_times
t = tic;
img_down_x2 = imresize(img, 1/2, 'bicubic');
t = toc(t);
elapsed_time(i) = t;
end
time_avg = mean(elapsed_time)
imwrite(img_down_x2, 'imresize_bicubic/baboon_down_x2_matlab.png');
% downsample x3
for i = 1:test_times
t = tic;
img_down_x3 = imresize(img, 1/3, 'bicubic');
t = toc(t);
elapsed_time(i) = t;
end
time_avg = mean(elapsed_time)
imwrite(img_down_x3, 'imresize_bicubic/baboon_down_x3_matlab.png');
% downsample x4
for i = 1:test_times
t = tic;
img_down_x4 = imresize(img, 1/4, 'bicubic');
t = toc(t);
elapsed_time(i) = t;
end
time_avg = mean(elapsed_time)
imwrite(img_down_x4, 'imresize_bicubic/baboon_down_x4_matlab.png');
% upsample x2
for i = 1:test_times
t = tic;
img_up_x2 = imresize(img, 2, 'bicubic');
t = toc(t);
elapsed_time(i) = t;
end
time_avg = mean(elapsed_time)
imwrite(img_up_x2, 'imresize_bicubic/baboon_up_x2_matlab.png');
% upsample x3
for i = 1:test_times
t = tic;
img_up_x3 = imresize(img, 3, 'bicubic');
t = toc(t);
elapsed_time(i) = t;
end
time_avg = mean(elapsed_time)
imwrite(img_up_x3, 'imresize_bicubic/baboon_up_x3_matlab.png');
% upsample x4
for i = 1:test_times
t = tic;
img_up_x4 = imresize(img, 4, 'bicubic');
t = toc(t);
elapsed_time(i) = t;
end
time_avg = mean(elapsed_time)
imwrite(img_up_x4, 'imresize_bicubic/baboon_up_x4_matlab.png');
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xinntao/matlab_functions_verification.git
[email protected]:xinntao/matlab_functions_verification.git
xinntao
matlab_functions_verification
matlab_functions_verification
main

搜索帮助