Home > Back-end >  Wavelet image denoising MATLAB running error
Wavelet image denoising MATLAB running error

Time:10-07

The function varargout=wavlet (varargin)
% WAVLET M - file for WAVLET. FIG
% WAVLET, by itself, and creates a new WAVLET or raises the existing
% singleton *.
%
% H=WAVLET returns the handle to a new WAVLET or the handle to
% the existing singleton *.
%
% WAVLET (' CALLBACK 'hObject, eventData, handles,... ) calls the local
% function named CALLBACK in WAVLET. M with the given input arguments.
%
% WAVLET (' Property ', 'Value',... ) creates a new WAVLET or raises the
% existing singleton *. Starting from the left, the property value pairs are
% applied to the GUI before wavlet_OpeningFunction gets called. An
% unrecognized property name or invalid value top service property application
% stop. All inputs are passed to wavlet_OpeningFcn via varargin.
%
% * See GUI Options on GUIDE 's the Tools menu, Choose "GUI allows only one
% the instance to run (singleton). "
%
% (See also: GUIDE, GUIDATA GUIHANDLES

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

% Last Modified by GUIDE v2.5 11:13:32 21 - Jun - 2004

% the Begin initialization code - DO NOT EDIT


Gui_Singleton=1;
Gui_State=struct (' gui_Name, mfilename,...
'gui_Singleton' gui_Singleton,...
'gui_OpeningFcn, @ wavlet_OpeningFcn,...
'gui_OutputFcn, @ wavlet_OutputFcn,...
'gui_LayoutFcn, [],...
'gui_Callback, []);
If nargin & amp; Isstr (varargin {1})
Gui_State. Gui_Callback=str2func (varargin {1});
End

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


% - Executes just before wavlet is made visible.
The function wavlet_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 wavlet (see varargin)

% Choose the default command line output for wavlet
Handles. The output=hObject;

% the Update handles structure
Guidata (hObject, handles);

% UIWAIT top service wavlet wait for the user the response (see UIRESUME)
% uiwait (handles. Figure1);


% - the Outputs from this function are returned to the command line.
The function varargout=wavlet_OutputFcn (hObject, eventdata, handles)
% varargout cell array for returning the 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)

% the Get the default command line output from handles structure
Varargout {1}=handles. The output;


% - Executes during object creation, after setting all properties.
The function edit1_CreateFcn (hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles the not created until after all CreateFcns called

% Hint: edit controls, usually have a white background on Windows.
% See ISPC and COMPUTER.
If ispc
Set (hObject, 'BackgroundColor', 'white');
The else
Set (hObject, "BackgroundColor", the get (0, 'defaultUicontrolBackgroundColor'));
End



The function edit1_Callback (hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Global pp;
Pp=str2double (get (hObject, 'String'));
% Hints: get (hObject, 'String') returns contents of edit1 as text
% str2double (get) (hObject, 'String') returns contents of edit1 as a double


% - Executes on the button press in pushbutton1.
The 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)
Global pp;
Global psnr_noise_remove;
The load psnr_noise_remove;
Global PSNR.
The load PSNR.
% into the original image and display
I=imread (' Lena. BMP);
Subplot (2, 2, 1);
Imshow (I);
The title (' original image);
The axis square;

% to generate noise image and display
J=imnoise (I, "gaussian", 0, pp);
Subplot (2,2,2);
Imshow (j);
The title (' noise images');
The axis square;
% with sym4 wavelet function to layer 2 j decomposition
[c] l=wavedec2 (j, 2, 'sym4');
% to realize low-pass filtering de-noising
A1=uint8 (wrcoef2 (' a ', c, l, 'sym4, 2));
% with coif2 wavelet function to layer 2 j decomposition
[gc, gl]=wavedec2 (a1, 2, 'coif2');
N=[1, 2]; % set scale vector
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related