二维haar小波matlab_MATLAB实验之二维小波变换[附效果图]
MATLAB代码:
clear
% load wbarb;
[X,map] = imread('lena256gray.png');
X=double(X);
whos
figure(1); % Display the image
imshow (X,map); axis on; colorbar;
title('原始图像','FontSize',12,'FontName','隶书','color','b');
% Perform a single-level wavelet decomposition
[cA1,cH1,cV1,cD1] = dwt2(X,'bior3.7');
% Construct and display approximations and details from the coefficients
A1 = upcoef2('a',cA1,'bior3.7',1);
H1 = upcoef2('h',cH1,'bior3.7',1);
V1 = upcoef2('v',cV1,'bior3.7',1);
D1 = upcoef2('d',cD1,'bior3.7',1);
% Display the results of the level 1 decomposition, type
figure(2); % colormap(map);
subplot(2,2,1); imshow(wcodemat(A1,192),map); axis on;
xlabel('图(a) 近似系数A1','FontSize',12,'FontName','隶书','color','b');
subplot(2,2,2); imshow (wcodemat(H1,192),map); axis on;
xlabel('图(a) 水平细节系数H1','FontSize',12,'FontName','隶书','color','b');
subplot(2,2,3); imshow (wcodemat(V1,192),map); axis on;
xlabel('图(a) 垂直细节细节V1','FontSize',12,'FontName','隶书','color','b');
subplot(2,2,4); imshow (wcodemat(D1,192),map); axis on;
xlabel('图(a) 对角细节系数D1','FontSize',12,'FontName','隶书','color','b');
% Regenerate an image by single-level Inverse Wavelet Transform.
Xsyn = idwt2(cA1,cH1,cV1,cD1,'bior3.7');
figure(3); % colormap(map);
imshow(Xsyn,map); axis on; colorbar;
title('重构图像','FontSize',12,'FontName','隶书','color','b');
% Perform a multilevel wavelet decomposition.
[C,S] = wavedec2(X,2,'bior3.7');
% Extract approximation and detail coefficients
% Extract the level 2 approximation coefficients from C
cA2 = appcoef2(C,S,'bior3.7',2);
% Extract the first- and second-level detail coefficients from C
cH2 = detcoef2('h',C,S,2);
cV2 = detcoef2('v',C,S,2);
cD2 = detcoef2('d',C,S,2);
cH1 = detcoef2('h',C,S,1);
cV1 = detcoef2('v',C,S,1);
cD1 = detcoef2('d',C,S,1);
% Reconstruct the Level 2 approximation and the Level 1 and 2 details.
% Reconstruct the level 2 approximation from C
A2 = wrcoef2('a',C,S,'bior3.7',2);
% Reconstruct the level 1 and 2 details from C
H1 = wrcoef2('h',C,S,'bior3.7',1);
V1 = wrcoef2('v',C,S,'bior3.7',1);
D1 = wrcoef2('d',C,S,'bior3.7',1);
H2 = wrcoef2('h',C,S,'bior3.7',2);
V2 = wrcoef2('v',C,S,'bior3.7',2);
D2 = wrcoef2('d',C,S,'bior3.7',2);
% Display the results of the level 2 decomposition, type
figure (4);
subplot(2,4,1);imshow(wcodemat(A1,192),map);
xlabel('近似系数A1','FontSize',12,'FontName','隶书','color','b');
subplot(2,4,2);imshow(wcodemat(H1,192),map);
xlabel('水平细节H1','FontSize',12,'FontName','隶书','color','b');
subplot(2,4,3);imshow(wcodemat(V1,192),map);
xlabel('垂直细节V1','FontSize',12,'FontName','隶书','color','b');
subplot(2,4,4);imshow(wcodemat(D1,192),map);
xlabel('对角细节D1','FontSize',12,'FontName','隶书','color','b');
subplot(2,4,5);imshow(wcodemat(A2,192),map);
xlabel('近似系数A2','FontSize',12,'FontName','隶书','color','b');
subplot(2,4,6);imshow(wcodemat(H2,192),map);
xlabel('水平细节H2','FontSize',12,'FontName','隶书','color','b');
subplot(2,4,7);imshow(wcodemat(V2,192),map);
xlabel('垂直细节V2','FontSize',12,'FontName','隶书','color','b');
subplot(2,4,8);imshow(wcodemat(D2,192),map);
xlabel('对角细节D2','FontSize',12,'FontName','隶书','color','b');
% Reconstruct the original image from the multilevel decomposition.
X0 = waverec2(C,S,'bior3.7');
figure(5); % colormap(map);
imshow(X0,map); axis on; colorbar;
title('重构图像2','FontSize',12,'FontName','隶书','color','b');
%%*********************************************************************
效果图:
二维haar小波matlab_MATLAB实验之二维小波变换[附效果图]相关推荐
- 二维haar小波matlab_二维小波变换MATLAB实现.ppt
二维小波变换MATLAB实现 二维小波变换MATLAB实现 斑渺龋钝臃疗该限桨呀呕肚厌欧没规兰痊脱飘疑艰雁峪告涡稽朵猫著明帝二维小波变换MATLAB实现二维小波变换MATLAB实现 dwt2函数 功能 ...
- 二维haar小波matlab_洪泽湖入湖水沙序列的多时间尺度小波分析
摘要: 为了分析洪泽湖入湖水沙序列的多时间尺度变化过程及特征,预测洪泽湖入湖水沙变化趋势,利用洪泽湖1975-2015年的年来水.来沙量数据,在统计分析的基础上,对洪泽湖年来水.来沙序列进行延伸和距平 ...
- 单尺度二维离散小波重构(逆变换)idwt2
clc,clear all,close all; load woman; %单尺度二维离散小波分解.分解小波函数haar [cA,cH,cV,cD]=dwt2(X,'haar'); %单尺度二维离散小 ...
- c++ hough变换代码_基于Haar小波和Log-Gabor变换的虹膜识别方法
在虹膜的识别研究方面,学者提出多种识别方法.DAUGMAN J提出使用二维Gabor变换提取虹膜特征[1]:谭铁牛等使用多通道Gabor滤波器提取虹膜特征[2-3]:LIM S等用二维小波对虹膜进行特 ...
- 图像算法五:【图像小波变换】多分辨率重构、Gabor滤波器、Haar小波
matlab设计: 与单纯运用某种自适应算法相比,基于小波分解的自适应滤波算法在收敛速度和稳定性上都有了很大的提高 小波变换: 示意:尺度越大,采用越大的时间窗,尺度越小,采用越短的时间窗,即尺度与频 ...
- 【小波变换】小波变换入门----haar小波
小波可以认为是一个带通滤波器,只允许频率和小波基函数频率相近的信号通过.小波变换的基本思想是用一组小波函数和基函数表示一个函数或者信号. haar小波变换 首先,以haar小波变换过程为例来理解小波变 ...
- Haar小波提升算法
传统的小波变换是在傅里叶变换的基础上演变而来,计算过程中存在着大量的卷积运算或是乘累加的计算,如若在硬件上实现,势必会消耗大量的寄存器资源,而且速度也上不去.提升小波又称为第二代小波,最早是由 Swe ...
- VB / VBA 自制二维码小工具
现在二维码的使用越来越广泛了,广告.网址等等都用上了 从网上找了一个二维码的控件,自己做了个小工具. 二维码可以把一串字符,不管长短(没试过最长能多长),做成二维码图片 现在的的智能手机软件很多都有扫 ...
- 糕头:二维火小程序初探
2018 年 11 月 25 日,由又拍云主办的 Open Talk | 2018 小程序开发者沙龙杭州站圆满结束,二维火前端开发工程师糕头在活动上作了<二维火小程序初探>的分享. &qu ...
- 离散小波变换 python_用python中的“haar”小波对图像进行离散小波变换
我试图在python中的图像上应用haar小波.这是代码from pywt import dwt2, idwt2 img = cv2.imread('xyz.png') cA, (cH, cV, cD ...
最新文章
- session存入redis或memcached
- iOS开发的学习笔记
- .net类库学习(一)System.object
- 推出超低功耗数字式热释电传感器,翠展微电子厉害了……
- 产品案例:这些呼声很高功能,微信为何还不做?
- 三维工艺设计系统SVMAN
- SpringBoot中使用Mybatis-plus整合PageHelper分页插件踩坑
- 监控一个大事务的回滚
- express框架下载及使用
- Windows Mac 光盘刻录软件
- 串珠问题(今日头条笔试)
- ElementUI表格序号翻页后重置的解决办法
- 2021免费注册TK域名使用一年的方法
- UiPath Computer Vision本地版使用
- java倒计时_详解java倒计时三种简单实现方式
- 对日ODC与欧美ODC技术分析
- python信用卡识别_在python中验证信用卡号码
- 电脑狂、理论家、情报员……你是哪种类型的软件工程师?
- 信息收集之zoomeye
- 看山还是山,看水还是水
热门文章
- 4.1 Zend_Config
- 82. Session 应用
- magento xml配置详解(2)
- 广东石油化工学院大学计算机基础,大学计算机基础习题集-北京石油化工学院文档.doc...
- 轻量级网页安全漏洞扫描工具-Wapiti
- Ubuntu上,如何成功的安装pygrib
- POJ 1458 Common Subsequence
- .NET项目工程生成一份项目帮助文档chm--Sandcastle工具
- iPhone 开源游戏引擎
- cocos2d-iphone 区分ipad和iphone