【图像融合】小波变换全聚焦图像融合【含Matlab源码 1372期】

本文介绍了如何通过Matlab获取基于小波变换的全聚焦图像融合代码,包括两种获取方式:直接下载完整代码或订阅付费专栏。文章详细解释了小波变换的基本概念、在图像处理中的应用,如图像压缩、去噪等,并展示了部分Matlab源代码示例。
摘要由CSDN通过智能技术生成

在这里插入图片描述

⛄一、获取代码方式

获取代码方式1:
完整代码已上传我的资源:【图像融合】基于matlab小波变换全聚焦图像融合【含Matlab源码 1372期】
(https://download.csdn.net/download/TIQCmatlab/62925370)
点击上面蓝色字体,直接付费下载,即可。

获取代码方式2:
付费专栏Matlab图像处理(初级版)

备注:
点击上面蓝色字体付费专栏Matlab图像处理(初级版),扫描上面二维码,付费29.9元订阅海神之光博客付费专栏Matlab图像处理(初级版),凭支付凭证,私信博主,可免费获得1份本博客上传CSDN资源代码(有效期为订阅日起,三天内有效);
点击CSDN资源下载链接:1份本博客上传CSDN资源代码

⛄二、小波变换简介

1974年,法国工程师J.Morlet首先提出小波变换的概念,1986年著名数学家Y.Meyer偶然构造出一个真正的小波基,并与S.Mallat合作建立了构造小波基的多尺度分析之后,小波分析才开始蓬勃发展起来。小波分析的应用领域十分广泛,在数学方面,它已用于数值分析、构造快速数值方法、曲线曲面构造、微分方程求解、控制论等。在信号分析方面的滤波、去噪声、压缩、传递等。在图像处理方面的图像压缩、分类、识别与诊断,去噪声等。本章将着重阐述小波在图像中的应用分析。
1 小波变换原理
小波分析是一个比较难的分支,用户采用小波变换,可以实现图像压缩,振动信号的分解与重构等,因此在实际工程上应用较广泛。小波分析与Fourier变换相比,小波变换是空间域和频率域的局部变换,因而能有效地从信号中提取信息。小波变换通过伸缩和平移等基本运算,实现对信号的多尺度分解与重构,从而很大程度上解决了Fourier变换带来的很多难题。
小波分析作一个新的数学分支,它是泛函分析、Fourier分析、数值分析的完美结晶;小波分析也是一种“时间—尺度”分析和多分辨分析的新技术,它在信号分析、语音合成、图像压缩与识别、大气与海洋波分析等方面的研究,都有广泛的应用。
(1)小波分析用于信号与图像压缩。小波压缩的特点是压缩比高,压缩速度快,压缩后能保持信号与图像的特征不变,且在传递中能够抗干扰。基于小波分析的压缩方法很多,具体有小波压缩,小波包压缩,小波变换向量压缩等。
(2)小波也可以用于信号的滤波去噪、信号的时频分析、信噪分离与提取弱信号、求分形指数、信号的识别与诊断以及多尺度边缘检测等。
(3)小波分析在工程技术等方面的应用概括的包括计算机视觉、曲线设计、湍流、远程宇宙的研究与生物医学方面。
2 多尺度分析
在这里插入图片描述
3 图像的分解和量化
在这里插入图片描述
4 图像压缩编码
在这里插入图片描述
5 图像编码评价
在这里插入图片描述

⛄三、部分源代码

clear all;
close all;
clc;

help imedgefuse;

%
% demo of deblurring
%
para.nLv = 5;
para.debug_mode = 1; % show message
para.wpropagation = 1; % weight propagation among subbands from parent to children
para.denoise = 1; % weight smoothing at each subbands for denoising

% J = imedgefuse( para, ‘001.jpg’, ‘009.jpg’, ‘016.jpg’ );
J = imedgefuse( para, ‘001.jpg’, ‘016.jpg’ );

figure( 1 ), imshow( J ); title( ‘fused image’ );

%
% demo of exposure fusion
%
para.nLv = 7;
para.debug_mode = 1;
para.wpropagation = 0; % weight propagation among subbands from parent to children
para.denoise = 1; % weight smoothing at each subbands for denoising

J = imedgefuse( para, ‘takato_001.jpg’, ‘takato_002.jpg’, ‘takato_003.jpg’ );

figure( 2 ), imshow( J ); title( ‘fused image’ );
function J = imedgefuse( para, varargin )
%IMEDGEFUSE composite images taken with different depth-of-fields
% as a result a pan focus image is generated.
%
% Usage:
%
% J = IMEDGEFUSE( para, fname, fname, …, fname )
% J = IMEDGEFUSE( para, Image, Image, …, Image )
%
% input arguments :
%
% para - parameters (the detail is described later)
% image - gray scale images (R^MxN) and rgb color images (R^MxNx3)
% fname - file names of input images
%
% output arguments :
%
% J - a fused image
%
% parameters :
%
% para.nLv = 6 - the total number of decompositions.
% para.propagate = 1 - weight propagation among subbands from parent to children.
% para.denoise = 1 - smoothing at each subbands for noise reduction.
% para.debug_mode = 1 - show debug message.
%
%
%

%
%

%
% parameters
%
global g_para;
set_parameters( para );
g_para.nImg = length( varargin ); % number of images

nImg = g_para.nImg;
nLv = g_para.nLv; % total number of decomposition

%
% Wavelet decomposition for the Y of YCbCr
%
DEBUG_MSG( ‘Reading images and applying wavelet to them (Y of YCbCr)’ );

for k = 1:nImg
% RGB color images are converted into the YCrCb color.
I = my_imread( varargin{ k } );

if k == 1 % initialization of the coefficient array
	[ey, ex, nLv] = output_size( size(I,1), size(I,2), nLv );
	C = zeros(ey,ex,nImg);
end
[C(:,:,k), S] = wavedec97( I(:,:,1),  nLv );

DEBUG_MSG( '.' );

end
DEBUG_MSG( ’ OK\n’ );

W = gen3DWeightMatrix( C, S );
F = genNewSubbands( C, W );

J(:,:,1) = waverec97( F, S );

if g_para.bColor == 0
return
end

%
% Wavelet decomposition for the Cb of YCbCr
%
DEBUG_MSG( ‘Reading pictures and applying wavelet to them (Cb of YCbCr)’ );

for k = 1:nImg
I = my_imread( varargin{ k } );
[C(:,:,k), S] = wavedec97( I(:,:,2), nLv );

DEBUG_MSG( '.' );

end
DEBUG_MSG( ’ OK\n’ );

F = genNewSubbands( C, W );
J(:,:,2) = waverec97( F, S );

%
% Wavelet decomposition for the Cr of YCbCr
%
DEBUG_MSG( ‘Reading pictures and applying wavelet to them (Cr of YCbCr)’ );

for k = 1:nImg
I = my_imread( varargin{ k } );
[C(:,:,k), S] = wavedec97( I(:,:,3 ), nLv );

DEBUG_MSG( '.' );

end
DEBUG_MSG( ’ OK\n’ );

F = genNewSubbands( C, W );
J(:,:,3) = waverec97( F, S );

%
% Final conversion
%
J = ycbcr2rgb( J );

end

%
%--------------------------------------------------------------------------
%

function set_parameters( para )

global g_para;
g_para = para; % initialization

% total number of decompositions
if ~isfield( g_para, ‘nLv’ )
g_para.nLv = 5;
end

% weight propagation among subbands from parent to children
if ~isfield( g_para, ‘propagate’ )
g_para.propagate = 1;
end

% weight smoothing at each subband
if ~isfield( g_para, ‘denoise’ )
g_para.denoise = 1;
end

% hide debug message
if ~isfield( g_para, ‘debug_mode’ )
g_para.debug_mode = false(1);
end

g_para.bColor = true(1); % color image

end

⛄四、运行结果

在这里插入图片描述
在这里插入图片描述

⛄五、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1]管飚.基于小波变换的多聚焦图像融合方法[J].吉林大学学报(理学版). 2017,55(04)

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

  • 21
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Matlab领域

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

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

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

打赏作者

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

抵扣说明:

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

余额充值