How to compress a sequence of images using haar compression algorithm?
조회 수: 7 (최근 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.
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!