-
对算法进行验证时,选取型号为XC7A100T的Xilinx ARTIX-7系列的FPGA芯片。在ISE14.7平台上,采用Synplify工具综合后,最高工作频率为188 MHz (如表1所示),远远超过了红外相机的工作频率27 MHz,因此所设计的红外图像清晰化硬件系统满足实时处理视频图像的需求。从表2可以看出所提算法综合后FPGA的资源占用情况,其中Block RAMs占用率为6%,Slice Registers占用率为1%,LUT占用率为4%,硬件资源利用率较少,这就大大降低了设计成本。
Parameter Value Minimum period/ns 5.307 Maximum frequency/MHz 188.43 Table 1. Timing summary
Logic utilization Ref.[14] Ref.[15] Proposed hardware algorithm Slice LUTs 307 of 28800 (1%) 6119 of 39600 (15%) 2678 of 63400 (4%) Block RAMs 16 of 60 (26%) 40% 9 of 135 (6%) I/O cells 82 of 480 (17%) * 24 of 285 (8%) Slice registers 493 of 28800 (1%) * 2257 of 126800 (1%) Time period/ms 0.9057 0.3 0.1185 Table 2. Comparison of implementation results of the proposed work with the existing works
将所提算法的硬件实现方案在逻辑资源占用、时钟周期等方面与其他方案做了对比分析,如表2所示。参考文献[14]通过对红外图像灰度值乘以一个比例因子达到图像增强的目的,所处理的数据量较少,占用了较少的LUT和寄存器资源。参考文献[15]提出使用导向滤波器进行红外图像增强方案需要计算多幅图像的均值和方差,因此LUT和内存资源消耗过多。所提算法将软件算法生成的透射率查找表添加至硬件语言中,使得硬件系统避免了复杂的求取透射率值的计算,占用了最少的RAM和I/O资源和较少的LUT资源。并且,所提算法在硬件测试时使用了最短的时间,更加适合实时的处理视频图像。
-
软件算法实验平台为Intel Core(TM) i7-7700, 3.6 GHz CPU, 内存8 GB,软件平台为Dev-C++5.11。软件算法所使用的图片由红外相机拍摄之后经图像采集卡捕获得到。
为验证所提算法在红外图像清晰化方面的有效性和可行性,将所得结果(包括软、硬件算法结果)与参考文献[3]中的自适应平台直方图均衡化算法、He算法进行对比分析。并从主客观角度对图像质量进行评价。
图7是一组具有丰富细节信息的近景图像,其中图7(a)为非制冷长波红外相机采集的原始红外图像,可以看出图中目标和背景的差别较小,边缘特征模糊。He算法处理后的图像存在块效应,在加入软抠图后,块效应得到改善,但仍存在图像整体偏暗的情况,分别如图7(b)和7(d)所示。Wan算法利用自适应平台直方图均衡化来进行增强,平衡了图像整体的灰度,但是没有突出更多的细节特征。图7(e)和7(f)分别为改进算法软、硬件处理后的红外图像,可以看出算法突出了目标景物的细节信息,如近处树叶的纹理特征、远处墙体的轮廓特征都得到增强,图像整体对比度提高。
图8是一组包含天空区域图像,可以看出所提算法在天空区域有较好的处理效果,这是因为对暗通道图像数据进行了非线性滤波以及修正透射率后的结果,而且硬件算法处理后的图像效果逼近软件算法。He算法在加入软抠图后,整体处理效果较优,但是在天空区域存在偏暗的情况。Wan算法在处理此类图像时,由于自适应参数选取较简单,导致图像处理效果不明显。
为了更加全面的判断图像质量,采用常见的客观评价指标进行验证。可见边对比度能够体现处理前后图像细节的清晰化程度[16],新增的可见边之比可以表示为:
式中:
${n_o}$ 为处理前图像中可见边的数目;${n_r}$ 为清晰化后图像中可见边的数目。$e$ 值越大,表明处理后图像有更多的边缘可见,则图像更清晰。峰值信噪比(Peak Signal to Noise Ratio, PSNR)是衡量图像是否失真的指标,其定义为:式中:MSE为图像的均方误差。一幅图像的PSNR值越高,表明图像的质量越好[17]。调用Matlab2019自带的PSNR函数,并添加一幅加噪图像测试改进算法处理后图像效果。从表3可以看出,所提算法处理后的图像相比其他的算法有更高的PSNR的值,
$e$ 值也不弱于其他算法,并且硬件算法处理后图像的PSNR和$e$ 的值均接近软件算法。因此,所提算法在丰富图像细节信息方面更具优势。Image 1 Image 2 e PSNR e PSNR Original infrared image 0 22.7104 0 22.6584 He algorithm with block effect 2.1031 20.8784 4.7996 20.3565 Wan algorithm 0.0412 22.5418 0.1318 22.4613 He algorithm after soft mapping 2.0449 21.0164 3.8656 20.4240 Proposed software algorithm 2.6203 22.3909 3.3664 22.6171 Proposed hardware algorithm 1.1272 22.1199 2.0592 22.4859 Table 3. Infrared image quantitative evaluation result of different algorithm processing
Infrared image clarifying and FPGA implementation based on dark channel prior
doi: 10.3788/IRLA20200252
- Received Date: 2020-11-09
- Rev Recd Date: 2020-12-11
- Available Online: 2021-05-12
- Publish Date: 2021-03-15
-
Key words:
- infrared image /
- dark channel prior /
- transmission /
- FPGA
Abstract: In order to solve the problem of low contrast between the target and the background and blurred details in infrared images, an improved infrared image clearing algorithm based on dark channel prior theory was proposed and FPGA was used to design the hardware system of the proposed algorithm. The dark channel image was obtained based on nonlinear filtering of the current pixel and the neighborhood data of the input image. Moreover, the correction function was used to optimize the transmission to generate a look_up table. Then the transmission was looked up in the look_up table and the proposed algorithm enhanced the image with the atmospheric scattering model, thereby reducing or eliminating the block effects and the color distortion of the sky or other bright areas generated by the traditional dark channel algorithm. The design of FPGA hardware could work with an estimated frequency of 188 MHz by occupying only 4% of LUT and 8% of I/O resources, which was much higher than the operating frequency of 27 MHz of the camera used. Therefore, the design was realized to meet the requirements of real-time application of video images.