How to compress a sequence of images using haar compression algorithm?

5 次查看(过去 30 天)
hii,i have to compress images to reduce their resolution so that the time of processing will be reduce. i have a code for compression for one image only but i have to compress the all frames of my folder. so please give the way to do this. So that i can read all the frames of the folder and silmultaneously can compress them and save them in an another folder. I am giving the code for single image compression below :-
clear;
close all;
image = imread('person200.jpeg');
input_image_used = im2double(image);
n=input('Enter the decomposition level : ');
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters('haar');
[c,s]=wavedec2(input_image_used,n,Lo_D,Hi_D);
disp('The decomposition vector output is');
disp(c);
disp('Size : ');
disp(s);
[thr,nkeep] = wdcbm2(c,s,1.5,3*prod(s(1,:)));
[xd,cxd,sxd,perf0,perfl2] = wdencmp('lvd',c,s,'haar',n,thr,'s');
disp('Compression ratio in percentage : ');
disp(perfl2);
%subplot(1,2,1);
figure(1),imshow(input_image_used);
title('Input image');
%subplot(1,2,2);
figure(2),imshow(xd);
title('Compressed image');
Please help me if anyone can, your help is much awaited and will be appreciated. thank you in advance.

回答(1 个)

Walter Roberson
Walter Roberson 2016-4-18

类别

Help CenterFile Exchange 中查找有关 Denoising and Compression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by