A list,

In 1974, J.Morlet, a French engineer, first proposed the concept of wavelet transform. In 1986, y.Meyer, a famous mathematician, accidentally constructed a real wavelet basis and cooperated with S.Mallat to establish the multi-scale analysis of constructing wavelet basis, wavelet analysis began to flourish. The application of wavelet analysis is very extensive. In mathematics, it has been used in numerical analysis, construction of rapid numerical methods, curve and surface construction, differential equation solution, cybernetics and so on. In signal analysis of filtering, noise, compression, transmission, etc. In the aspect of image processing, image compression, classification, recognition and diagnosis, noise removal, etc. This chapter will focus on the application of wavelet in image analysis.

1 principle of wavelet transform

Wavelet analysis is a difficult branch, users can use wavelet transform, image compression, vibration signal decomposition and reconstruction, so it is widely used in practical engineering. Wavelet analysis Compared with Fourier transform, wavelet transform is the local transformation of space domain and frequency domain, so it can effectively extract information from signals. Wavelet transform achieves multi-scale decomposition and reconstruction of signals through basic operations such as stretching and shifting, thus solving many problems caused by Fourier transform to a large extent.

Wavelet analysis is a new branch of mathematics, which is the perfect crystallization of functional analysis, Fourier analysis and numerical analysis. Wavelet analysis is also a new technique of “time-scale” analysis and multi-resolution analysis. It is widely used in signal analysis, speech synthesis, image compression and recognition, atmospheric and ocean wave analysis and so on.

(1) Wavelet analysis is used for signal and image compression. Wavelet compression is characterized by high compression ratio and fast compression speed. It can keep the characteristics of signal and image unchanged after compression, and can resist interference in transmission. There are many compression methods based on wavelet analysis, including wavelet compression, wavelet packet compression, wavelet transform vector compression and so on.

(2) Wavelet can also be used for signal filtering and denoising, signal time-frequency analysis, signal noise separation and weak signal extraction, fractal index, signal recognition and diagnosis and multi-scale edge detection, etc.

(3) The application of wavelet analysis in engineering technology, including computer vision, curve design, turbulence, remote universe research and biomedicine.

Multiscale analysis



3 image decomposition and quantization



4 image compression coding



5. Image coding evaluation

Ii. Source code

function varargout = MainForm(varargin)
% MAINFORM MATLAB code for MainForm.fig
%      MAINFORM, by itself, creates a new MAINFORM or raises the existing
%      singleton*.
%
%      H = MAINFORM returns the handle to a new MAINFORM or the handle to
%      the existing singleton*.
%
%      MAINFORM('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MAINFORM.M with the given input arguments.
%
%      MAINFORM('Property'.'Value',...). creates anew MAINFORM or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before MainForm_OpeningFcn gets called.  An
%      unrecognized property name orinvalid value makes property application % stop. All inputs are passed to MainForm_OpeningFcn via varargin. % % *See GUI  Options on GUIDE's Tools menu.  Choose "GUI allows only one % instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help MainForm

% Last Modified by GUIDE v2. 5 01-May- 2021. 22:52:25

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @MainForm_OpeningFcn, ...
                   'gui_OutputFcn',  @MainForm_OutputFcn, ...
                   'gui_LayoutFcn', [],...'gui_Callback'[]);if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before MainForm is made visible.
function MainForm_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to MainForm (see VARARGIN)

% Choose default command line output for MainForm
handles.output = hObject;
clc; 
axes(handles.axes1); cla reset; box on; set(gca, 'XTickLabel'.'a', 'YTickLabel'."); axes(handles.axes2); cla reset; box on; set(gca, 'XTickLabel'.'a', 'YTickLabel'."); axes(handles.axes3); cla reset; box on; set(gca, 'XTickLabel'.'a', 'YTickLabel'."); % Update handles structure guidata(hObject, handles); % UIWAIT makes MainForm wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = MainForm_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB %  handles structure with handles and user data (see GUIDATA) clc; axes(handles.axes1); cla reset; box on; set(gca, 'XTickLabel'.'a', 'YTickLabel'."); axes(handles.axes2); cla reset; box on; set(gca, 'XTickLabel'.'a', 'YTickLabel'."); axes(handles.axes3); cla reset; box on; set(gca, 'XTickLabel'.'a', 'YTickLabel'."); handles.file1 = []; handles.file2 = []; handles.result = []; [filename, pathname] = uigetfile({'*.jpg; *.bmp; *.tif; *.png; *.gif'.'All Image Files'; .'*. *'.'All Files' }, 'Select image 1'. fullfile(pwd,'images\\ experimental image 1\\a. if'));
if isequal(filename, 0)
    return;
end
handles.file1 = fullfile(pathname, filename);
Img1=imread(fullfile(pathname, filename));
% I=rgb2gray(Img);
% Img1 = imresize(I,[240.320]);
axes(handles.axes1); 
imshow(Img1, []);
handles.Img1 =Img1 ;
guidata(hObject, handles);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[filename, pathname] = uigetfile({'*.jpg; *.bmp; *.tif; *.png; *.gif'.'All Image Files'; .'*. *'.'All Files' }, 'Select image 2'. fullfile(pwd,'images\\ experimental image 1\\ b.if '));
if isequal(filename, 0)
    return;
end
handles.file2 = fullfile(pathname, filename);

Img2 =imread(fullfile(pathname, filename));
axes(handles.axes2);
imshow(Img2, []);
handles.Img2 =Img2 ;
guidata(hObject, handles);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)%% Wavelet transform algorithm imA= handles.Img1;
imB = handles.Img2;
M1 = double(imA) / 256;
M2 = double(imB) / 256;
zt = 2;
wtype = 'haar';
[c0, s0] = Wave_Decompose(M1, zt, wtype);
[c1, s1] = Wave_Decompose(M2, zt, wtype);
Coef_Fusion = Fuse_Process(c0, c1, s0, s1);
Y = Wave_Reconstruct(Coef_Fusion, s0, wtype);
handles.result = im2uint8(mat2gray(Y));
guidata(hObject, handles);
msgbox('Wavelet fusion processing completed! '.'Prompt message'.'modal');
% if isempty(handles.result)
%     msgbox('Please fill! '.'Prompt message'.'modal');
%     return;
% end
axes(handles.axes3); 
imshow(handles.result, []);
title('Result of wavelet transform fusion')
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)Laplacian pyramid algorithmaddpath('./ Laplacian pyramid image fusion ')
imA = handles.Img1;
imB = handles.Img2;
% im1 = double(imA) / 256;
% im2= double(imB) / 256;
im1 = double(imA);
im2 = double(imB); %% % Laplacian filter w = [1 4 6 4 1; 4 16 24 16 4; 6 24 36 24 6; 4 16 24 16 4; 1 4 6 4 1] /256;
G = cell(1.5);
H = cell(1.5);
I = cell(1.5);
G{1} = im1; % The first layer is the original image H{1} = im2;
function Y = Wave_Reconstruct(Coef_Fusion, s, wtype)

if nargin < 3
   
end

Y = waverec2(Coef_Fusion, s, wtype);
KK = size(c1);
Coef_Fusion = zeros(1, KK(2));
Coef_Fusion(1:s1(1.1)*s1(1.2)) = (c0(1:s1(1.1)*s1(1.2))+c1(1:s1(1.1)*s1(1.2))) /2; 
MM1 = c0(s1(1.1)*s1(1.2) +1:KK(2));
MM2 = c1(s1(1.1)*s1(1.2) +1:KK(2));
mm = (abs(MM1)) > (abs(MM2));
Y  = (mm.*MM1) + ((~mm).*MM2);
Copy the code

3. Operation results





Fourth, note

Version: 2014 Have questions or need private message