| 查看: 132 | 回复: 2 | |||
| 当前主题已经存档。 | |||
[交流]
谁能帮在程序员联合开发网(pudn.com)下东西【有效期至2008年5月27日】
|
|||
|
下面是文件页面的链接:http://www.programsalon.com/down ... h/detail173516.html 麻烦帮我下一下传给我! 邮箱是liuguoliang126@126.com [ Last edited by sxyxs13754 on 2008-5-26 at 08:39 ] |
» 猜你喜欢
基金委咋了?2026年的指南还没有出来?
已经有4人回复
纳米粒子粒径的测量
已经有8人回复
疑惑?
已经有5人回复
国自然申请面上模板最新2026版出了吗?
已经有14人回复
计算机、0854电子信息(085401-058412)调剂
已经有5人回复
Materials Today Chemistry审稿周期
已经有5人回复
溴的反应液脱色
已经有7人回复
推荐一本书
已经有12人回复
基金申报
已经有4人回复
常年博士招收(双一流,工科)
已经有4人回复
2楼2008-05-25 01:25:50
shootyou25
金虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 458.5
- 红花: 1
- 帖子: 214
- 在线: 11.3小时
- 虫号: 517752
- 注册: 2008-03-04
- 专业: 计算机软件
小波阈值去噪声(MATLAB)给你!!!
★ ★ ★ ★
lgl820420(金币+4,VIP+0):谢谢
sparrow1290(金币-8,VIP+0):非法转移金币http://emuch.net/bbs/viewthread.php?tid=830277&fpage=1
lgl820420(金币+4,VIP+0):谢谢
sparrow1290(金币-8,VIP+0):非法转移金币http://emuch.net/bbs/viewthread.php?tid=830277&fpage=1
|
function varargout = wavlet(varargin) % WAVLET M-file for wavlet.fig % WAVLET, by itself, 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, property value pairs are % applied to the GUI before wavlet_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to wavlet_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 wavlet % Last Modified by GUIDE v2.5 21-Jun-2004 11:13:32 % 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 & isstr(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 wavlet is made visible. 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 default command line output for wavlet handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes wavlet wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = wavlet_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 during object creation, after setting all properties. 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 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'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end 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 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) global pp; global psnr_noise_remove; load psnr_noise_remove; global psnr; load psnr; %读入原始图像并显示 i=imread('lena.bmp'); subplot(2,2,1); imshow(i); title('原始图像'); axis square; %生成含噪图像并显示 j=imnoise(i,'gaussian',0,pp); subplot(2,2,2); imshow(j); title('含噪图像'); axis square; %用sym4小波函数对j进行2层分解 [c,l]=wavedec2(j,2,'sym4'); %实现低通滤波消噪 a1=uint8(wrcoef2('a',c,l,'sym4',2)); %用coif2小波函数对j进行2层分解 [gc,gl]=wavedec2(a1,2,'coif2'); n=[1,2];%设置尺度向量 p=[10.28,24.08];%设置阈值向量 %对三个高频系数进行阈值处理 nc=wthcoef2('h',gc,gl,n,p,'s'); nc=wthcoef2('v',gc,gl,n,p,'s'); nc=wthcoef2('d',gc,gl,n,p,'s'); mc=wthcoef2('h',gc,gl,n,p,'s'); mc=wthcoef2('v',gc,gl,n,p,'s'); mc=wthcoef2('d',gc,gl,n,p,'s'); %对更新后的小波分解结构进行阈值处理 x2=waverec2(mc,gl,'coif2'); %进行中值滤波 for ii=1:252; for jj=1:252; temp=0; for m=0:3 for n=0:3 temp=temp+double(x2(ii+m,jj+n)); end end temp=temp/16; x4(ii,jj)=temp; end end for ii=253:256 for jj=253:256 x4(ii,jj)=double(i(ii,jj)); end end %显示去噪图像 subplot(2,2,3); imshow(uint8(x4)); title('消噪图像'); axis square; %计算psnr q=0.0; for x=1:256; for j=1:256; diff=x4(x,j)-double(i(x,j)); q=q+diff*diff; end end psnr_y = q / (256*256); psnr_y = (255 * 255)/psnr_y; set(psnr_noise_remove,'String',psnr_y); for ii=1:10 if psnr(ii)==0 psnr(ii)=psnr_y; break; end end save psnr psnr; % --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called global psnr_noise_remove; % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end psnr_noise_remove=hObject; save psnr_noise_remove psnr_noise_remove; function edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double |
3楼2008-05-25 01:27:17











回复此楼