本代码转自厦门大学屈小波教授15年的DEMO代码。

% Demo for PCNN in image processing
% ---------
% Author:  Qu Xiao-Bo    <qxb_xmu [at] yahoo.com.cn>    Aug.28,2008
%          Postal address:
% Rom 509, Scientific Research Building # 2,Haiyun Campus, Xiamen University,Xiamen,Fujian, P. R. China, 361005
% Website:https://csrc.xmu.edu.cn/
%=============================================================
% References:
% [1]Qu Xiao-Bo, YAN Jing-Wen, XIAO Hong-Zhi, ZHU Zi-Qian. Image Fusion Algorithm Based on Spatial Frequency-Motivated Pulse Coupled Neural Networks in Nonsubsampled Contourlet Transform Domain. Acta Automatica Sinica, Vol.34, No.12, pp: 1508-1514.Dec.2008.
% [2]Xiao-Bo Qu,Jingwen Yan.Image Fusion Algorithm Based on Features Motivated Multi-channel Pulse Coupled Neural Networks, The 2nd International Conference on Bioinformatics and Biomedical Engineering-iCBBE2008,Shanghai, China, 16-18 May 2008, pp. 2103-2106
% [3]Xiaobo Qu, Changwei Hu, Jingwen Yan, Image Fusion Algorithm Based On Orientation Information Motivated Pulse Coupled Neural Networks, The seventh World Congress on Intelligent Control and Automation-WCICA 2008,Chongqing, China,25-27 June 2008, pp.2437-2441
% [4]Xiaobo Qu, Jingwen Yan, Ziqian Zhu, et al. Multi-focus image fusion algorithm based on regional firing characteristic of Pulse Coupled Neural Networks, Conference Pre-proceedings of The Second International Conference on Bio-Inspired Computing: Theories and Applications, pp:563-565,2007
% [5]Yan Jingwen, QU Xiaobo. Beyond Wavelets and Its Applications [M].Beijing: National Defense Industry Press, June 2008.(In Chinese)%=============================================================
%%
clc;
clear all;
close all;
%%
im=imread('2.jpg');
im=double(im);
%%
link_arrange=6;
iteration_times=200;
%%
firing_times=PCNN_large_arrange(im,link_arrange,iteration_times);
%%
figure,imshow(im,[])
figure,imshow(firing_times,[])
function [normalized_matrix,cmin,cmax]=Normalized(matrix)
% function [normalized_matrix,cmin,cmax]=Normalized(matrix)
% Computes the normalized form of matrix
% Input: matrix, denotes an image
% Output: normalized_matrix,normalized form of matrix
%         cmin, is the is the smallest element in matrix
%         cman is the is the largest  element in matrix
% ---------
% Author:  Qu Xiao-Bo    <qxb_xmu [at] yahoo.com.cn>    Aug.28,2008
%          Postal address:
% Rom 509, Scientific Research Building # 2,Haiyun Campus, Xiamen University,Xiamen,Fujian, P. R. China, 361005
% Website: http://quxiaobo.go.8866.org
%=============================================================
% References:
% [1]Qu Xiao-Bo, YAN Jing-Wen, XIAO Hong-Zhi, ZHU Zi-Qian. Image Fusion Algorithm Based on Spatial Frequency-Motivated Pulse Coupled Neural Networks in Nonsubsampled Contourlet Transform Domain. Acta Automatica Sinica, Vol.34, No.12, pp: 1508-1514.Dec.2008.
% [2]Xiao-Bo Qu,Jingwen Yan.Image Fusion Algorithm Based on Features Motivated Multi-channel Pulse Coupled Neural Networks, The 2nd International Conference on Bioinformatics and Biomedical Engineering-iCBBE2008,Shanghai, China, 16-18 May 2008, pp. 2103-2106
% [3]Xiaobo Qu, Changwei Hu, Jingwen Yan, Image Fusion Algorithm Based On Orientation Information Motivated Pulse Coupled Neural Networks, The seventh World Congress on Intelligent Control and Automation-WCICA 2008,Chongqing, China,25-27 June 2008, pp.2437-2441
% [4]Xiaobo Qu, Jingwen Yan, Ziqian Zhu, et al. Multi-focus image fusion algorithm based on regional firing characteristic of Pulse Coupled Neural Networks, Conference Pre-proceedings of The Second International Conference on Bio-Inspired Computing: Theories and Applications, pp:563-565,2007
% [5]Yan Jingwen, QU Xiaobo. Beyond Wavelets and Its Applications [M].Beijing: National Defense Industry Press, June 2008.(In Chinese)%=============================================================
% Get absolute value of matrix
input_matrix=abs(matrix);
Max_input=max(input_matrix(:));
Min_input=min(input_matrix(:));
min_matrix=ones(size(input_matrix)).*Min_input;
normalized_matrix=(input_matrix-min_matrix)./(Max_input-Min_input+eps);
cmin=Min_input;
cmax=Max_input;
%
function R=PCNN_large_arrange(matrix,link_arrange,np,pre_flag)
% R=PCNN_large_arrange(matrix,link_arrange,np,pre_flag)
% compute the fire times of each pixel in the PCNN
% np is the iterative times
% R is the fire times of coefficients of wavelet decomposition
% ---------
% Author:  Qu Xiao-Bo    <qxb_xmu [at] yahoo.com.cn>    Aug.28,2008
%          Postal address:
% Rom 509, Scientific Research Building # 2,Haiyun Campus, Xiamen University,Xiamen,Fujian, P. R. China, 361005
% Website: https://csrc.xmu.edu.cn/
%=============================================================
% References:
% [1]Qu Xiao-Bo, YAN Jing-Wen, XIAO Hong-Zhi, ZHU Zi-Qian. Image Fusion Algorithm Based on Spatial Frequency-Motivated Pulse Coupled Neural Networks in Nonsubsampled Contourlet Transform Domain. Acta Automatica Sinica, Vol.34, No.12, pp: 1508-1514.Dec.2008.
% [2]Xiao-Bo Qu,Jingwen Yan.Image Fusion Algorithm Based on Features Motivated Multi-channel Pulse Coupled Neural Networks, The 2nd International Conference on Bioinformatics and Biomedical Engineering-iCBBE2008,Shanghai, China, 16-18 May 2008, pp. 2103-2106
% [3]Xiaobo Qu, Changwei Hu, Jingwen Yan, Image Fusion Algorithm Based On Orientation Information Motivated Pulse Coupled Neural Networks, The seventh World Congress on Intelligent Control and Automation-WCICA 2008,Chongqing, China,25-27 June 2008, pp.2437-2441
% [4]Xiaobo Qu, Jingwen Yan, Ziqian Zhu, et al. Multi-focus image fusion algorithm based on regional firing characteristic of Pulse Coupled Neural Networks, Conference Pre-proceedings of The Second International Conference on Bio-Inspired Computing: Theories and Applications, pp:563-565,2007
% [5]Yan Jingwen, QU Xiaobo. Beyond Wavelets and Its Applications [M].Beijing: National Defense Industry Press, June 2008.(In Chinese)%=============================================================
disp('PCNN is processing...')
[p,q]=size(matrix);
% computes the normalized matrix of the matrixA and  matrixB
F_NA=Normalized(matrix);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Initialize the parameters.
% You'd better change them according to your applications
alpha_L=1;
alpha_Theta=0.2;beta=3;
vL=1.00;
vTheta=20;
% Generate the null matrix that could be used
L=zeros(p,q);
U=zeros(p,q);
Y=zeros(p,q);
Y0=zeros(p,q);
Theta=zeros(p,q);
% Compute the linking strength.
center_x=round(link_arrange/2);
center_y=round(link_arrange/2);
W=zeros(link_arrange,link_arrange);
for i=1:link_arrangefor j=1:link_arrangeif (i==center_x)&&(j==center_y)W(i,j)=0;elseW(i,j)=1./sqrt((i-center_x).^2+(j-center_y).^2);endend
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%
F=F_NA;
for n=1:npK=conv2(Y,W,'same');L=exp(-alpha_L)*L+vL*K;Theta=exp(-alpha_Theta)*Theta+vTheta*Y;U=F.*(1+beta*L);Y=im2double(U>Theta);Y0=Y0+Y;
end
R=Y0;

运行结果:

链接强度为6,迭代次数为200次。
代码可稳健运行。

【MATLAB图像融合】[14]PCNN脉冲耦合神经网络代码分享相关推荐

  1. PCNN 脉冲耦合神经网络整理

    PCNN 脉冲耦合神经网络 脉冲耦合神经元模型 神经元的输入有哪些? 首先来看看这个神经元的图示的左边,有YYY和FFF. YYY为这个神经元之前输出的数值,就是说这个模型需要进行多次的运算,每次的运 ...

  2. 基于PCNN脉冲耦合神经网络的图像分割

    目录 1.算法描述 2.仿真效果预览 3.MATLAB核心程序 4.完整MATLAB 1.算法描述 脉冲耦合神经网络(PCNN-Pulse Coupled Neural Network)与传统神经网络 ...

  3. 【MATLAB图像融合】[13]PCNN脉冲耦合神经网络基本原理

    →这是一篇学习笔记. →但考虑要发出来,还是排版了,请放心食用. PCNN在图像融合中应用广泛 1.脉冲耦合的神经元之间有有耦合和无耦合两种形式.,有耦合的神经元之间存在能量传播,产生同步脉冲发放,从 ...

  4. 神经网络 | 基于脉冲耦合神经网络(PCNN)的图像特征提取(Matlab源代码)

    博主github:https://github.com/MichaelBeechan 博主CSDN:https://blog.csdn.net/u011344545 一.代码 %------Pulse ...

  5. 毕业论文 | 基于脉冲耦合神经网络(PCNN)的图像特征提取:论文及源代码及参考文献

    =========================================== github:https://github.com/MichaelBeechan CSDN:https://bl ...

  6. 【图像分割】基于脉冲耦合神经网络实现图像分割附matlab代码

    1 简介 1950s数字图像处理产生,从此学术界对它的研究连绵不绝.十多年之后,数字图像的处理被独立出来成了一门课程.图像分割技术是处理图像的一种基础技术,在图像处理领域中占了重要地位,且在图像工程. ...

  7. matlab小波变换图像融合,MATLAB小波变换的图像融合算法的研究与实现+代码

    摘  要:随着科技的不断进步,图像融合由于其能够去除环境中的部分干扰以及加强原图像的有效信息等优点逐渐成为人们的研究热点之一.本文详细分析了小波变换和图像融合的相关理论,将小波变换的多分辨率分析的特点 ...

  8. matlab图像融合评价,MATLAB 图像融合评估算法

    MATLAB 图像融合评价算法 function laplacian(ori_A,ori_B) path(path,'FusionEvaluation/') %Ori_A = imread('cloc ...

  9. 【Matlab图像融合】小波变换遥感图像融合【含GUI源码 744期】

    一.代码运行视频(哔哩哔哩) [Matlab图像融合]小波变换遥感图像融合[含GUI源码 744期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 包子阳,余 ...

最新文章

  1. mysql选出重复的字段_mysql查询表里的重复数据方法:
  2. java 折半_折半算法
  3. 加速企业数字化转型,首届Spring Summit技术峰会圆满落幕
  4. 哪一类功率放大电路效率最高_电路分析基础(8)-最大功率传输与阻抗匹配分析...
  5. 神经网络与机器学习 笔记—基本知识点(上)
  6. [云炬创业基础笔记]第四章测试21
  7. NiftyNet开源平台使用
  8. intelij idea启动之谜
  9. 万级 K8S 集群背后,etcd 如何保持稳定性?
  10. 小甲鱼Python笔记(下)
  11. linux学习-将seafile启动脚本设置为开机启动服务
  12. 51CTO网站博客改版意见寻求
  13. 栈的典型应用 —— 逆序输出
  14. 帆软:不使用 __parameters__ 传参,问题。
  15. 热门好用的邮编查询API
  16. grpc双向流 python_gRPC Golang/Python使用
  17. Vue中使用pdfJs预览PDF、图片
  18. LeetCode通关:哈希表六连,这个还真有点简单
  19. RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors a
  20. 线程实用解析--------(六)Control.Invoke()和Control.BeginInvoke()

热门文章

  1. AngularJs with Webpackv1 升級到 Webpack4
  2. 逆向---02.je jmp jnz 、OD调试
  3. 求解TSP的改进模拟退火算法研究
  4. 集合框架详解之Set、Map接口与实现类
  5. 清除redis的key与数据
  6. 第021篇:易康(eCognition)中用点矢量文件制作样本验证分类精度的操作方法
  7. 科学计算与matlab语言期末答案,科学计算与MATLAB语言答案
  8. 瑞金医院计算机中心副主任朱立峰:从数字化医院到认知医疗
  9. CodeForces - 31D Chocolate【几何】【连通块】
  10. clap与slap_(2xslap,slap,slap,clap,slap)Doinapos;theFACTSNowthatapos;s.ppt