Image fusion evaluation index

Infrared and visible light image fusion evaluation indicators

The blogger's review paper on image fusion, a review of image fusion methods based on deep learning, has been officially accepted by the "Chinese Journal of Image and Graphics"!

Python version evaluation indicators: Image fusion evaluation indicators Python version

Python evaluation indicators Demo: https://download.csdn.net/download/fovever_/87547835

The author’s blog posts related to the direction of image fusion also include:
Image fusion blog series also includes:

  1. For the most comprehensive collection of image fusion papers and codes, see: The most comprehensive collection of image fusion papers and codes
  2. For the collection of image fusion review papers, see: Collection of image fusion review papers
  3. For image fusion evaluation indicators, see: Infrared and visible light image fusion evaluation indicators
  4. For the organization of commonly used data sets for image fusion, see: Organization of commonly used data sets for image fusion.
  5. General image fusion framework papers and code arrangement see: General image fusion framework papers and code arrangement
  6. Infrared and visible light image fusion papers and code collection based on deep learning see: Infrared and visible light image fusion papers and code collection based on deep learning
  7. For more detailed infrared and visible light image fusion codes, see: Infrared and visible light image fusion papers and code collection
  8. Multi-exposure image fusion papers and code compilation based on deep learning see: Multi-exposure image fusion papers and code compilation based on deep learning
  9. Multi-focus image fusion papers and code collection based on deep learning see: Multi-focus Image Fusion papers and code collection based on deep learning
  10. Pan-color image sharpening papers and codes based on deep learning, see: Pan-color image sharpening papers and codes based on deep learning (Pansharpening)
  11. For medical image fusion papers and code compilation based on deep learning, see: Medical image fusion papers and code compilation based on deep learning
  12. For color image fusion, see: Color Image Fusion
  13. DIVFusion: The first framework for coupling mutually promoting low-light enhancement & image fusion. See: DIVFusion: The first framework for coupling mutually promoting low-light enhancement & image fusion.

In order to better evaluate the performance of the infrared and visible light image fusion algorithm and conduct a quantitative evaluation of the fusion algorithm, this blog has organized and summarized some of the existing evaluation indicators. Although it is used to evaluate the infrared and visible light image fusion algorithm performance, but some evaluation indicators are also applicable to other such as multi-exposure, multi-focus, and medical image fusion. A total of 17 evaluation method codes have been compiled, namely:

Evaluation indicators abbreviation
information entropy IN
spatial frequency SF
standard deviation SD
peak signal-to-noise ratio PSNR
mean square error MSE
mutual information MI
visual fidelity VIF
average gradient AG
Correlation coefficient CC
difference correlation sum SCD
Gradient-based fusion performance Catch it
Structural similarity measurement YES
Multi-scale structural similarity measurement MS-SSIM
Fusion performance based on noise assessment Nabf
Pixel feature mutual information FMI_pixel
Discrete cosine feature mutual information FMI_dct
Wavelet feature mutual information FMI_w
Performance evaluation indicators are mainly divided into four categories, namely evaluation indicators based on information theory , which mainly include ** EN, MI, FMI_pixel, FMI_w, FIM_dct, PSNR**, and evaluation indicators based on structural similarity , which mainly include SSIM, MS_SSIM, MSE , Evaluation indicators based on image features , mainly include SF, SD, AG , evaluation indicators based on human visual perception , mainly include VIF , and evaluation indicators based on source images and generated images , mainly including CC, SCD, Qabf, Nabf .
Next is the introduction of the main function of the evaluation algorithm
clc
clear all
names = {'AEFusion', 'CNN', 'DenseFuse', 'FusionGAN', 'GTF', 'IFCNN', 'JSRSD', 'Latlrr', 'MaskFusion', 'PMGI', 'WLS'}; #用于保存对比算法的名称
rows = ['B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L']; #用于保存测试指标对应的位置
easy = 0
row_name1 = 'row1';
row_data1 = 'row2';
for i = 1 : length(names)
    method_name = cellstr(names(i))
    row = rows(i)
    row_name = strrep(row_name1, 'row', row);
    row_data = strrep(row_data1, 'row', row);
   

    fileFolder=fullfile('../Comparison/Test_ir'); #此处我将需要测试的图像放置在Test_ir文件夹中

    dirOutput=dir(fullfile(fileFolder,'*.bmp')); #测试图像全部是bmp后缀

    fileNames = {dirOutput.name};
    [m, num] = size(fileNames);
    ir_dir = '../Comparison/New_Test_ir/'; #用于评估算法性能的红外图像文件夹
    vi_dir = '../Comparison/New_Test_vi/'; #用于评估算法性能的可见光图像文件夹
    Fused_dir = '../Comparison/'; # 用于存放对比结果的文件夹,Comparison中主要包括所有对比算法,对比算法的文件夹以DenseFuse为例 ‘/DenseFuse/DenseFuse_Results’类似的存放
    Fused_dir = char(strcat(Fused_dir, names(i), '\', names(i), '_Results', '\'));
    EN_set = [];    SF_set = [];SD_set = [];PSNR_set = [];
    MSE_set = [];MI_set = [];VIF_set = []; AG_set = [];
    CC_set = [];SCD_set = []; Qabf_set = [];
    SSIM_set = []; MS_SSIM_set = [];
    Nabf_set = [];FMI_pixel_set = [];
    FMI_dct_set = []; FMI_w_set = [];
    disp(method_name)
    for i = 1:num
        disp('---------------------------Analysis---------------------------');

        fileName_source_ir = strcat(ir_dir, fileNames{i});
        fileName_source_vi = strcat(vi_dir, fileNames{i}); 
        fileName_Fusion = strcat(Fused_dir, fileNames{i});
        ir_image = imread(fileName_source_ir);
        vi_image = imread(fileName_source_vi);
        fused_image   = imread(fileName_Fusion);
        [m, n] = size(fused_image);
    %     fused_image = fused_image(7:m-6, 7:n-6);
        ir_size = size(ir_image);
        vi_size = size(vi_image);
        fusion_size = size(fused_image);
        if length(ir_size) < 3 & length(vi_size) < 3
            disp(fileNames{i})
            [EN, SF,SD,PSNR,MSE, MI, VIF, AG, CC, SCD, Qabf, Nabf, SSIM, MS_SSIM, FMI_pixel, FMI_dct, FMI_w] = analysis_Reference(fused_image,ir_image,vi_image, easy);
            EN_set = [EN_set, EN];SF_set = [SF_set,SF];SD_set = [SD_set, SD];PSNR_set = [PSNR_set, PSNR];
            MSE_set = [MSE_set, MSE];MI_set = [MI_set, MI]; VIF_set = [VIF_set, VIF];
            AG_set = [AG_set, AG]; CC_set = [CC_set, CC];SCD_set = [SCD_set, SCD];
            Qabf_set = [Qabf_set, Qabf]; Nabf_set = [Nabf_set, Nabf];
            SSIM_set = [SSIM_set, SSIM]; MS_SSIM_set = [MS_SSIM_set, MS_SSIM];
            FMI_pixel_set = [FMI_pixel_set, FMI_pixel]; FMI_dct_set = [FMI_dct_set,FMI_dct];
            FMI_w_set = [FMI_w_set, FMI_w];
        else
            disp('unsucessful!  ')
            disp( fileName_Fusion)
        end
        disp('Done');
    end
    # easy == 1 主要是由于在运行程序过程中有的评估指标耗时较长,easy == 1 时对于耗时较长的指标不进行测试
    if easy == 1
        xlswrite('评估指标.xlsx', method_name,'EN',row_name)
        xlswrite('评估指标.xlsx', method_name,'SF',row_name)
        xlswrite('评估指标.xlsx', method_name,'SD',row_name) 
        xlswrite('评估指标.xlsx', method_name,'PSNR',row_name)
        xlswrite('评估指标.xlsx', method_name,'MSE',row_name)
        xlswrite('评估指标.xlsx', method_name,'MI',row_name)
        xlswrite('评估指标.xlsx', method_name,'VIF',row_name)
        xlswrite('评估指标.xlsx', method_name,'AG',row_name)
        xlswrite('评估指标.xlsx', method_name,'CC',row_name)
        xlswrite('评估指标.xlsx', method_name,'SCD',row_name)
        xlswrite('评估指标.xlsx', method_name,'Qabf',row_name)
        xlswrite('评估指标.xlsx',SF_set','SF',row_data)
        
        xlswrite('评估指标.xlsx',SD_set','SD',row_data) 
        xlswrite('评估指标.xlsx',PSNR_set','PSNR',row_data)
        xlswrite('评估指标.xlsx',MSE_set','MSE',row_data)
        xlswrite('评估指标.xlsx',MI_set','MI',row_data)
        xlswrite('评估指标.xlsx',VIF_set','VIF',row_data)
        xlswrite('评估指标.xlsx',AG_set','AG',row_data)
        xlswrite('评估指标.xlsx',CC_set','CC',row_data)
        xlswrite('评估指标.xlsx',EN_set','EN',row_data)
        xlswrite('评估指标.xlsx',SCD_set','SCD',row_data)
        xlswrite('评估指标.xlsx',Qabf_set','Qabf',row_data)
    else        
        xlswrite('评估指标.xlsx', method_name,'Nabf',row_name)
        xlswrite('评估指标.xlsx', method_name,'SSIM',row_name)
        xlswrite('评估指标.xlsx', method_name,'MS_SSIM',row_name)
        xlswrite('评估指标.xlsx', method_name,'FMI_pixel',row_name)
        xlswrite('评估指标.xlsx', method_name,'FMI_dct',row_name)
        xlswrite('评估指标.xlsx', method_name,'FMI_w',row_name)

        xlswrite('评估指标.xlsx',Nabf_set','Nabf',row_data)
        xlswrite('评估指标.xlsx',SSIM_set','SSIM',row_data)
        xlswrite('评估指标.xlsx',MS_SSIM_set','MS_SSIM',row_data)
        xlswrite('评估指标.xlsx',FMI_pixel_set','FMI_pixel',row_data)
        xlswrite('评估指标.xlsx',FMI_dct_set','FMI_dct',row_data)
        xlswrite('评估指标.xlsx',FMI_w_set','FMI_w',row_data)
    end
end

The program list except the main function includes:
Insert image description here
All test codes are integrated at: https://download.csdn.net/download/fovever_/12543640

Supplementary on 2021/05/27

I'm really sorry about the missing 'sobel_fn.m' in the test code. It was the author who missed the 'sobel_fn.m' function when packaging the program. I'm very sorry for the inconvenience caused to everyone.
Therefore, the 'sobel_fn.m' function is added to the blog. I hope that friends who use it can create a new 'sobel_fn.m' file and copy the program there.

function [gv gh]=sobel_fn(x)

%%% sobel_fn: Computes the vertical & horizontal edges of x using sobel operator.
%%% 
%%% [gv gh]=sobel_fn(x) 
%%%
%%% Author : B. K. SHREYAMSHA KUMAR 
%%% Created on 28-10-2011.
%%% Updated on 28-10-2011.


vtemp=[-1 0 1;-2 0 2;-1 0 1]/8;
htemp=[-1 -2 -1;-0 0 0;1 2 1]/8;

[a b]=size(htemp);
x_ext=per_extn_im_fn(x,a);
[p,q]=size(x_ext);
for ii=2:p-1
   for jj=2:q-1
      gv(ii-1,jj-1)=sum(sum(x_ext(ii-1:ii+1,jj-1:jj+1).*vtemp));
      gh(ii-1,jj-1)=sum(sum(x_ext(ii-1:ii+1,jj-1:jj+1).*htemp));
   end
end

2021/08/31 Supplement

Since many friends who are not familiar with matlab will encounter many problems when using the previous main function, the main.m function is simplified here. You can create a new main function and copy the following code to test the results of a certain algorithm.

clc
clear all
easy = 0
fileFolder=fullfile('./Comparison/Test_ir'); % 需要测试的红外图像所在文件夹
dirOutput=dir(fullfile(fileFolder,'*.bmp')); %测试图像全部是bmp后缀
fileNames = {
    
    dirOutput.name};
[m, num] = size(fileNames);
ir_dir = './Comparison/Test_ir'; %用于评估算法性能的红外图像文件夹
vi_dir = './Comparison/Test_vi'; %用于评估算法性能的可见光图像文件夹
Fused_dir = './Comparison/PMGI'; % 用于存放对比结果的文件夹,Comparison中主要包括所有对比算法,对比算法的文件夹以DenseFuse为例 ‘/DenseFuse/DenseFuse_Results’类似的存放
EN_set = [];    SF_set = [];SD_set = [];PSNR_set = [];
MSE_set = [];MI_set = [];VIF_set = []; AG_set = [];
CC_set = [];SCD_set = []; Qabf_set = [];
SSIM_set = []; MS_SSIM_set = [];
Nabf_set = [];FMI_pixel_set = [];
FMI_dct_set = []; FMI_w_set = [];
disp(method_name)
for i = 1:num
    disp('---------------------------Analysis---------------------------');
    fileName_source_ir = fullfile(ir_dir, fileNames{
    
    i});
    fileName_source_vi = fullfile(vi_dir, fileNames{
    
    i}); 
    fileName_Fusion = fullfile(Fused_dir, fileNames{
    
    i});
    ir_image = imread(fileName_source_ir);
    vi_image = imread(fileName_source_vi);
    fused_image   = imread(fileName_Fusion);
    [m, n] = size(fused_image);
    [ir_m, ir_n, ir_c] = size(ir_image);
    if ir_c > 1
        ir_image = rgb2gray(ir_image);
    end
    [vi_m, vi_n, vi_c] = size(vi_image);
    if vi_c > 1
        vi_image = rgb2gray(vi_image);
    end
    [EN, SF,SD,PSNR,MSE, MI, VIF, AG, CC, SCD, Qabf, Nabf, SSIM, MS_SSIM, FMI_pixel, FMI_dct, FMI_w] = analysis_Reference(fused_image,ir_image,vi_image, easy);
    EN_set = [EN_set, EN];SF_set = [SF_set,SF];SD_set = [SD_set, SD];PSNR_set = [PSNR_set, PSNR];
    MSE_set = [MSE_set, MSE];MI_set = [MI_set, MI]; VIF_set = [VIF_set, VIF];
    AG_set = [AG_set, AG]; CC_set = [CC_set, CC];SCD_set = [SCD_set, SCD];
    Qabf_set = [Qabf_set, Qabf]; Nabf_set = [Nabf_set, Nabf];
    SSIM_set = [SSIM_set, SSIM]; MS_SSIM_set = [MS_SSIM_set, MS_SSIM];
    FMI_pixel_set = [FMI_pixel_set, FMI_pixel]; FMI_dct_set = [FMI_dct_set,FMI_dct];
    FMI_w_set = [FMI_w_set, FMI_w];
    fprintf('Evaluating %s Image', fileNames{
    
    i});
end

Due to the limited personal level of the blogger, there may be shortcomings. Everyone is welcome to correct and communicate.

If you have any questions, please contact: [email protected] ; please note your name + school

Guess you like

Origin blog.csdn.net/fovever_/article/details/106906768