Chapdagi rasm o'ngdagi tasvirning piksel qiymatlarini ifodalaydi, 8 × 8 tasvir. 2D Haar o'zgartirishni ikkinchi daraja uchun qo'llash tasvir hajmining chiziqli qisqarishiga olib keladi:
VEYVLET IXCHAMLASHTIRISH Hisoblangan farqlar va tasvirning qisqarishi tasvirni sifatni saqlab qolgan holda kamroq ma'lumot bilan ixchamlash imkonini beradi. Ko'proq ixchamlash past sifatni anglatadi va yuqori sifat kamroq ixchamlashni anglatadi. Rangli tasvirlar uchun ham xuddi shunday qo'llaniladi: Misol (MATLAB) Misol (MATLAB) 1-usul. Global Thresholding. image(X) title('Original Image') colormap(map) thr = 20; % Threshold
keepapp = 1; % Approximation coefficients cannot be thresholded [xd,cxd,lxd,perf0,perfl2] = wdencmp(opt,c,l,w,n,thr,sorh,keepapp); image(x) title('Original Image') colormap(map) figure image(xd) title('Compressed Image - Global Threshold = 20') colormap(map) 2-usul. Level-Dependent Thresholding. load woman; % Load original image image(X) title('Original Image') colormap(map) n = 5; % Decomposition level w = 'sym8'; % Near symmetric wavelet [c,l] = wavedec2(x,n,w); % Multilevel 2-D wavelet decomposition
opt = 'lvd'; % Level-dependent thresholds thr_d = [19 20]; % Diagonal thresholds thr = [thr_h ; thr_d ; thr_v]; [xd2,cxd2,lxd2,perf02,perfl22] = wdencmp(opt,x,w,2,thr,sorh); image(x) title('Original Image') colormap(map) figure image(xd2) title('Compressed Image - Level-Dependent Thresholding') colormap(map) E'TIBORINGIZ UCHUN RAHMAT!
Do'stlaringiz bilan baham: |