フィルターのクリア

how to select threshold on haar wavelet

9 ビュー (過去 30 日間)
sholai kumar
sholai kumar 2017 年 1 月 30 日
回答済み: prabhat kumar sharma 2024 年 7 月 26 日 9:38
image compression using haar wavelet transform

回答 (1 件)

prabhat kumar sharma
prabhat kumar sharma 2024 年 7 月 26 日 9:38
Hi Sholai,
MATLAB provides functions like wthresh for thresholding wavelet coefficients. You can use these functions to apply hard or soft thresholding.
You can refer this documentation for further information: https://www.mathworks.com/help/wavelet/ref/wthresh.html
You can refer below code piece:
% Perform Haar wavelet decomposition
[coeffs, sizes] = wavedec2(image, level, 'haar');
% Choose a global threshold value
threshold = 20; % Example value, adjust based on your needs
% Apply soft thresholding
coeffs_thresh = wthresh(coeffs, 's', threshold);
% Reconstruct the image from thresholded coefficients
compressed_image = waverec2(coeffs_thresh, sizes, 'haar');
% Display the compressed image
imshow(compressed_image, []);
I hope it helps!

カテゴリ

Help Center および File ExchangeWavelet Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by