⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dwt_level_fn.m

📁 it is used to find traffic
💻 M
字号:
function [Image_Input_DWT_Fn,Image_DWT_Fn,LL_1,LL_2,HL_1,HL_2,LH_1,LH_2,HH_1,HH_2] = DWT_Level_Fn(Level);
close all;
% % low_pass_coeff_DWT = [-1/8,1/4,3/4,1/4,-1/8];
% % high_pass_coeff_DWT = [-1/2,1,-1/2];

Image_Input_DWT_Fn = imread('baboon.jpg');
Image_Input_DWT_Fn=imresize(Image_Input_DWT_Fn,0.5);
%Image_Input_Gray_DWT_Fn = rgb2gray(Image_Input_DWT_Fn);

[Image_Height,Image_Width] = size(Image_Input_DWT_Fn);

% figure;
% imshow(Image_Input_DWT_Fn);title('Input Gray Image');

for i = 1 : Image_Height
    for j = 1 : Image_Width
        Image_DC_Shifted_Fn(i,j) = double(Image_Input_DWT_Fn(i,j)) - 128;%(2^8); -- DC Shifting
    end
end

% % % [LL_Fn,LH_Fn,HL_Fn,HH_Fn] = dwt2(Image_DC_Shifted_Fn,low_pass_coeff_DWT,high_pass_coeff_DWT);
% % % [Image_DWT_Serial_Fn Size_Subbands] = wavedec2(Image_DC_Shifted_Fn,1,low_pass_coeff_DWT,high_pass_coeff_DWT);
% % % % % [Image_DWT_Fn] = [LL_Fn,HL_Fn ; LH_Fn,HH_Fn];
% % % 
% % % [Subband_Height Subband_Width] = S(1,:); 
% % % % % for r = 1 : 4
% % % for i = 1 : Subband_Height
% % % %     for j = 1 : Subband_Width
% % %     LL(i,:) = Image_DWT_Serial_DWT((1+((i-1)*Subband_Width):Subband_Width*i);
% % %     HL(i,:) = Image_DWT_Serial_DWT(((Subband_Height*Subband_Width)+1+((i-1)*Subband_Width)):((Subband_Height*Subband_Width)+s));   

LL_2 = zeros(1,1);
HL_2 = zeros(1,1);
LH_2 = zeros(1,1);
HH_2 = zeros(1,1);
if(Level == 1)
	[LL_1,HL_1,LH_1,HH_1] = dwt2(Image_DC_Shifted_Fn,'db1');
	[Image_DWT_Fn] = [LL_1,HL_1 ; LH_1,HH_1];
% % %     [Image_DCT_Fn] = dct2(Image_Input_Gray_DWT_Fn);
else
	[LL_1,HL_1,LH_1,HH_1] = dwt2(Image_DC_Shifted_Fn,'db1');
	[LL_2,HL_2,LH_2,HH_2] = dwt2(LL_1,'db1');
	[Image_DWT_Fn] = [[LL_2,HL_2;LH_2,HH_2],HL_1 ; LH_1,HH_1];
end
% figure;
% imshow((Image_DWT_Fn));
% figure;
% imshow(mat2gray(Image_DWT_Fn)); title('DWT_levels');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -