【图像分解】基于小波变换实现二维图像分解附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

⛄ 内容介绍

​小波分析是当前数学中一个迅速发展的新领域,在Matlab中,图像的增强,除噪,压缩是其应用领域中的一个方面.文中首先介绍了小波分析的历史与现状,然后详细地说明了当前小波分析在图像方面的各个应用领域和研究的意义,以及其研究工具Matlab组成和特点,从理论上讲解了小波变换的由来,定义和特点,在分析中所涉及到的连续小波变换,离散小波变换,二维小波变换.通过小波分析的理论研究,应用Matlab来实现了一般图像的压缩,除噪和增强,然后利用小波分析的工具箱打开图形接口方式,来实现相关小波分析的应用.由于小波分析在图像中有许多的优点,因此小波分析在各个应用领域也越来越广.

⛄ 部分代码

function varargout = waveletgui(varargin)

% WAVELETGUI MATLAB code for waveletgui.fig

%      WAVELETGUI, by itself, creates a new WAVELETGUI or raises the existing

%      singleton*.

%

%      H = WAVELETGUI returns the handle to a new WAVELETGUI or the handle to

%      the existing singleton*.

%

%      WAVELETGUI('CALLBACK',hObject,eventData,handles,...) calls the local

%      function named CALLBACK in WAVELETGUI.M with the given input arguments.

%

%      WAVELETGUI('Property','Value',...) creates a new WAVELETGUI or raises the

%      existing singleton*.  Starting from the left, property value pairs are

%      applied to the GUI before waveletgui_OpeningFcn gets called.  An

%      unrecognized property name or invalid value makes property application

%      stop.  All inputs are passed to waveletgui_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 waveletgui

% Last Modified by GUIDE v2.5 25-Dec-2022 00:20:39

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name',       mfilename, ...

                   'gui_Singleton',  gui_Singleton, ...

                   'gui_OpeningFcn', @waveletgui_OpeningFcn, ...

                   'gui_OutputFcn',  @waveletgui_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 waveletgui is made visible.

function waveletgui_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 waveletgui (see VARARGIN)

% Choose default command line output for waveletgui

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes waveletgui wait for user response (see UIRESUME)

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = waveletgui_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)

global im

global cmap

%选择图片路径

[filename, pathname] = ...

    uigetfile({'*.jpg';'*.bmp';'*.gif'},'选择图片');

%合成路径+文件名

str = [pathname, filename];

%读取图片

[im,cmap] = imread(str);

%使用第一个axes

axes(handles.axes1);

%显示图片

imshow(im);

% --- 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)

close(gcf)

% --- 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)

global im

global cmap

global wavename

X = im;

map = cmap;

% X contains the loaded image.

% map contains the loaded colormap.

nbcol = size(map,1);

% Perform single-level decomposition

% of X using db1.

[cA1,cH1,cV1,cD1] = dwt2(X,wavename);

% Images coding.

cod_X = wcodemat(X,nbcol);

cod_cA1 = wcodemat(cA1,nbcol);

cod_cH1 = wcodemat(cH1,nbcol);

cod_cV1 = wcodemat(cV1,nbcol);

cod_cD1 = wcodemat(cD1,nbcol);

⛄ 运行结果

⛄ 参考文献

[1]刘鹏远, 骆升平. Matlab基于小波变换的图形图像处理[J]. 江西理工大学学报, 2011, 32(1):3.

⛄ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值