目的 针对传统Retinex算法存在泛灰现象、光晕现象和边界突出的现象，以及高曝光区域细节增强不明显的现象，提出一种基于Retinex的改进双边滤波的多聚焦融合算法。方法 该算法把Retinex和多聚焦融合的思想融合在一起，首先根据具体图像情况在像素级层次将原始图像分解为最优亮暗区域两部分，然后利用线性积分变换和邻近像素最优推荐算法，将原始图像与最优亮区域多聚焦融合得到图像T，再将图像T与最优暗区域重复以上步骤得到图像S，最后利用引导滤波进行边界修复得到最终图像。结果 选择两组图片girl和boat进行实验，与BIFT算法和RVRG算法等四种方法相对比，本文所提方法在方差和信息熵两方面表现出明显优势。具体地， 在均值方面相较BIFT平均提高16.37，相较于RVRG平均提高20.90。在方差方面相较BIFT平均提高1.25，相较于RVRG平均提高4.42。在信息熵方面相较BIFT平均提高0.1，相较于RVRG平均提高0.17。在平均梯度方面相较BIFT平均提高1.21，相较于RVRG平均提高0.42。对比BIFT和RVRG的实验数据证明了本文算法的有效性。结论 实验结果证明，相比较其他图像增强算法，本文算法能更有效抑制图像泛灰现象和光晕现象和边界突出的现象，图像细节增强效果特别显著。
Improved multi-focus image fusion algorithm for bilateral filtering Retinex
Changjian,renying,hechunze(Liaoning Technical University)
Abstract: Objective At present, there are many image processing models and algorithms in the field of image processing. In the field, Retinex algorithms and multi-focus image fusion algorithms have become the most widely used image processing algorithms because of their simplicity, efficiency and easy implementation. However, in practical applications, Retinex algorithms and multi-focus image fusion algorithms have their own limitations on image processing. In this paper, the algorithm aims to combine the ideas of Retinex algorithm and multi-focus image fusion algorithm to achieve image enhancement. In view of the traditional Retinex algorithms, there are graying phenomenon, halo phenomenon and boundary phenomenon, and the problem that the detail of high exposure area is not enhanced. The traditional multi-focus image fusion algorithms must capture multiple images of different focus points in the same scene, extract the focus area from multiple images of different focus points, then operate the focus area for multi-focus fusion. For the multi-focus fusion algorithm, it is necessary to extract the repeated operations of multiple image focus areas. This paper proposes a multi-focus image fusion algorithm based on Retinex"s improved bilateral filtering. Method In this paper, the Retinex algorithm is used to improve the process of estimating illumination images. The effects of image space proximity similarity and pixel similarity on the enhancement effect are fully considered. The improved kernel function of the traditional Retinex algorithm is improved to obtain an improved bilateral filter function. Firstly, the improved bilateral filtering function is used to estimate the illumination image, and the influence of the illumination image on the visual effect is reduced or suppressed, then the reflected image of the essence of the response image is obtained. Furthermore, the optimal parameters of the optimal bright and dark regions are calculated respectively at the pixel level of the reflected image, and the optimal parameters are respectively brought into the algorithm to find the optimal solution. The optimal solution can be used to decompose the reflected image into the optimal bright region. And the optimal dark area. Combined with the idea of multi-focus image fusion algorithms, the original image is introduced at the same time, which can ensure the enhancement effect of the image and preserve the detail and quality in the original image, so that the enhancement effect is more obvious and clear. The original image, the optimal bright region image and the optimal dark region image are multi-focus fusion, and then the linear integral transform and the adjacent pixel optimal recommendation algorithm are used to obtain a smooth and accurate steering map, and the steering filter is used to further smooth the steering map. Using the processed guide map as a basis, the original image and the optimal bright region are fused according to different focal lengths to obtain an image T, and then the image T is repeated with the optimal dark region image to obtain the process image S by the above experimental steps, and finally utilized. The pilot filter performs boundary repair on the process image S to obtain a final result image. Result Two pictures of girl and boat which were selected for comparison experiments, with single-scale Retinex algorithm, bilateral filter-based Retinex algorithm, BIFT algorithm (Retinex image enhancement algorithm based on image fusion technology) and RVRG algorithm (Retinex variational model based on relative gradient regularization and Its application) Compared with the four methods. The proposed algorithm shows obvious advantages in both variance and information entropy. Specifically, the average is 16.37 higher than the BIFT, and the average is increased by 20.90 compared to RVRG. In terms of variance, the average increase is 1.25 compared to BIFT, which is an average increase of 4.42 compared to RVRG. In terms of information entropy, the average increase is 0.1 compared to BIFT, which is an average increase of 0.17 compared to RVRG. In terms of average gradient, the average increase was 1.21 compared to BIFT, which was an average increase of 0.42 compared to RVRG. Experimental data comparing BIFT and RVRG demonstrate the effectiveness of the proposed algorithm. In the girl image, the details in the original image and the dark portion of the right side of the car body are significantly enhanced, and the details of the bright areas in the original image are well preserved while being enhanced. In the boat image, the overall pixel value of the image is low, and the visual effect is darker. After the enhancement, the outline of the character is clear, the water surface is distinct, and the reef texture enhancement effect is remarkable. Conclusion The extensive experimentations show that due to the uncertainty of the process of acquiring images and the complexity of image information, the traditional algorithms are inevitably limited, and the enhancement effect cannot meet the high quality requirements of image preprocessing. The combination of Retinex algorithm and multi-focus fusion algorithms proposed in this paper has better image enhancement effect. Compared with the single-scale Retinex algorithm, the bilateral filter-based Retinex algorithm, the BIFT algorithm and the RVRG algorithm, the reconstructed image is superior to the contrast algorithm at both the subjective and objective levels, The objective evaluation parameters of the resulting image are greatly improved, especially in terms of information entropy. The algorithm in this paper can effectively suppress image graying phenomenon and halo phenomenon and boundary prominent phenomenon. The contrast is significantly enhanced, and it has a good enhancement effect on uneven illumination images and low contrast images. It is superior to other contrast algorithms in image enhancement and robustness, and the image detail enhancement effect is particularly remarkable. It laid the foundation for the subsequent processing of the image.