CN108810506A - A kind of Penetrating Fog enhancing image processing method and system based on FPGA - Google Patents
A kind of Penetrating Fog enhancing image processing method and system based on FPGA Download PDFInfo
- Publication number
- CN108810506A CN108810506A CN201810608569.4A CN201810608569A CN108810506A CN 108810506 A CN108810506 A CN 108810506A CN 201810608569 A CN201810608569 A CN 201810608569A CN 108810506 A CN108810506 A CN 108810506A
- Authority
- CN
- China
- Prior art keywords
- image
- fpga
- processing
- image data
- penetrating fog
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/646—Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4007—Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/44—Receiver circuitry for the reception of television signals according to analogue transmission standards
- H04N5/445—Receiver circuitry for the reception of television signals according to analogue transmission standards for displaying additional information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/73—Colour balance circuits, e.g. white balance circuits or colour temperature control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/77—Circuits for processing the brightness signal and the chrominance signal relative to each other, e.g. adjusting the phase of the brightness signal relative to the colour signal, correcting differential gain or differential phase
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
本发明提供了一种基于FPGA的透雾增强图像处理方法及系统,其中,图像处理系统包括FPGA芯片和ARM芯片,FPGA芯片与ARM芯片连接,FPGA芯片上设置有图像数据采集接口,并对采集的图像数据进行色偏校正处理、透雾增强处理、低对比度增强处理和/或细节增强处理;FPGA芯片上还设置用于将处理后的图像数据输出的输出接口。本发明对采集的图像进行了多次处理,使图像质量得到了很大的提高,在天气恶劣的情况下采集的图像数据不受影响,最终得到的无雾图像效果比较好,对现有技术中的各种监控设备可以起到增强、补充的效果。
The invention provides a method and system for image processing based on FPGA-based fog penetration enhancement, wherein the image processing system includes an FPGA chip and an ARM chip, the FPGA chip is connected to the ARM chip, an image data acquisition interface is provided on the FPGA chip, and the acquisition The image data is subjected to color shift correction processing, fog penetration enhancement processing, low contrast enhancement processing and/or detail enhancement processing; an output interface for outputting the processed image data is also provided on the FPGA chip. The present invention has processed the collected image for many times, so that the image quality has been greatly improved, and the image data collected under the condition of bad weather is not affected, and the effect of the finally obtained fog-free image is relatively good, which is different from the existing technology. Various monitoring equipment in the system can enhance and supplement the effect.
Description
技术领域technical field
本发明属于图像处理技术领域,特别涉及一种基于FPGA的透雾增强图像处理方法及系统。The invention belongs to the technical field of image processing, in particular to an FPGA-based image processing method and system for enhanced fog penetration.
背景技术Background technique
视频监控技术经过长期发展,现在已经进入比较成熟的应用阶段。但是,在某些领域,依然不能满足特定的观测需求。比如,在烟、雾、霾、水气、雨、雪、灰尘、黑暗、水下等环境下,传统监测设备很难发挥作用,甚至束手无策。在视频监控市场粗放式增长的时代,这一问题可以暂时忽略。但是,随着厂商和用户对科技设备效能的认识越来越深,要求也就相应的水涨船高。After long-term development, video surveillance technology has now entered a relatively mature application stage. However, in some fields, it still cannot meet the specific observational requirements. For example, in environments such as smoke, fog, haze, water vapor, rain, snow, dust, darkness, and underwater, traditional monitoring equipment is difficult to function, or even helpless. In the era of extensive growth of the video surveillance market, this problem can be temporarily ignored. However, as manufacturers and users have a deeper understanding of the performance of technological equipment, the requirements have also increased accordingly.
在一般情况下,现有的视频监控系统经过图像的传送和转换,如成像、幅值、扫描、传输和显示灯,经常会造成图像质量的下降。在摄影时由于光照条件不足或过度,会使图像过暗或过亮;光学系统的失真、相对运动、大气湍流等都会使图像模糊,传输过程中也会引入各种类型的噪声。总之,输入的图像在视觉效果和识别方便性等方面可能存在诸多问题。为了解决上述问题,提出了公开号为“CN105023256A”,名称为“一种图像去雾方法及系统”的中国专利,该专利的图像去雾方法需要获取图像的每一个通道的全局大气光和透射率,根据每一个通道的全局大气光和透射率恢复出每一个通道的无雾图像,从而获取无雾的图像。但是该专利的方法比较复杂、对图像无雾处理的效果也不够好,得到的图像质量不高。In general, the existing video surveillance system often causes image quality degradation after image transmission and conversion, such as imaging, amplitude, scanning, transmission, and display lights. Due to insufficient or excessive lighting conditions during photography, the image will be too dark or too bright; distortion of the optical system, relative motion, atmospheric turbulence, etc. will make the image blurred, and various types of noise will also be introduced during the transmission process. In short, the input image may have many problems in terms of visual effect and recognition convenience. In order to solve the above problems, a Chinese patent with the publication number "CN105023256A" and the title "An Image Dehazing Method and System" was proposed. The image dehazing method of this patent needs to obtain the global atmospheric light and transmission of each channel of the image. The haze-free image of each channel is restored according to the global atmospheric light and transmittance of each channel, so as to obtain a haze-free image. However, the method of this patent is relatively complicated, and the effect of fog-free image processing is not good enough, and the obtained image quality is not high.
发明内容Contents of the invention
本发明的目的在于提供一种基于FPGA的透雾增强图像处理方法及系统,用于解决现有技术中图像去雾处理效果不好的问题。The object of the present invention is to provide an FPGA-based image processing method and system for fog penetration enhancement, which is used to solve the problem of poor image defogging processing effect in the prior art.
为了实现上述目的,本发明提供了一种基于FPGA的透雾增强图像处理系统,包括FPGA芯片和ARM芯片,所述FPGA芯片与所述ARM芯片连接,所述FPGA芯片上设置有图像数据采集接口,并对采集的图像数据进行色偏校正处理、透雾增强处理、低对比度增强处理和/或细节增强处理;所述FPGA芯片上还设置用于将处理后的图像数据输出的输出接口。In order to achieve the above object, the present invention provides a FPGA-based fog penetration enhancement image processing system, including an FPGA chip and an ARM chip, the FPGA chip is connected to the ARM chip, and the FPGA chip is provided with an image data acquisition interface , and perform color shift correction processing, fog penetration enhancement processing, low contrast enhancement processing and/or detail enhancement processing on the collected image data; an output interface for outputting the processed image data is also set on the FPGA chip.
为了解决不能对FPGA灵活控制的问题,所述ARM芯片上设置有用于与上位机通信连接的网口,所述ARM芯片用于根据上位机下发的指令控制FPGA对采集的图像数据进行处理。In order to solve the problem that the FPGA cannot be flexibly controlled, the ARM chip is provided with a network port for communicating with the host computer, and the ARM chip is used to control the FPGA to process the collected image data according to the instructions issued by the host computer.
进一步地,还包括梯度统计模块,所述梯度统计模块用于对采集的图像数据进行梯度统计处理,并将经过梯度统计后的图像数据经过所述ARM芯片发送给上位机。Further, a gradient statistics module is also included, and the gradient statistics module is used for performing gradient statistics processing on the collected image data, and sending the image data after gradient statistics to the upper computer through the ARM chip.
所述FPGA芯片上设置有第一驱动接口及第一调试接口。The FPGA chip is provided with a first driver interface and a first debugging interface.
所述ARM芯片上设置有第二驱动接口及第二调试接口。The ARM chip is provided with a second driver interface and a second debugging interface.
为了方便对图像进行监控和观察,还包括电子变倍模块及字符叠加模块,采集的图像数据在细节增强处理后,经过电子变倍模块的变倍处理及字符叠加模块的叠加处理输出。In order to monitor and observe the image conveniently, it also includes an electronic zoom module and a character superimposition module. After detail enhancement processing, the collected image data is output through the zoom processing of the electronic zoom module and the superposition processing of the character superposition module.
本发明还提供了一种基于FPGA的透雾增强图像处理方法,包括如下步骤:The present invention also provides a method for image processing based on FPGA-based fog penetration enhancement, comprising the following steps:
采集图像数据,对所述图像数据进行色偏校正处理、透雾增强处理、低对比度增强处理和/或细节增强处理,并将处理后的图像数据输出。Collecting image data, performing color shift correction processing, fog penetration enhancement processing, low contrast enhancement processing and/or detail enhancement processing on the image data, and outputting the processed image data.
进一步地,对采集的图像数据进行了梯度统计处理。Further, gradient statistical processing is performed on the collected image data.
进一步地,所述色偏校正处理的过程为:获取采集的图像的R、G、B三个通道的数据,建立表征图像偏绿强度图,选取图像中含绿色成分最小的像素点作为图像整体偏色程度的度量,在所述强度图中按照设定的比例指对应的强度图值作为图像偏色的量化表示。Further, the process of color shift correction processing is as follows: acquire the data of the R, G, and B channels of the collected image, establish a greenish intensity map representing the image, and select the pixel point with the smallest green component in the image as the overall image The measure of the degree of color cast refers to the corresponding value of the intensity map according to the set ratio in the intensity map as a quantitative representation of the color cast of the image.
为了方便对图像进行监控和观察,采集的图像数据在细节增强处理后,经过电子变倍及字符叠加处理输出。In order to facilitate the monitoring and observation of the image, the collected image data is output through electronic zooming and character superposition processing after detail enhancement processing.
本发明的有益效果是:The beneficial effects of the present invention are:
本发明包括FPGA芯片和ARM芯片,所述FPGA芯片与所述ARM芯片连接,所述FPGA芯片上设置有图像数据采集接口,并对采集的图像数据进行色偏校正处理、透雾增强处理、低对比度增强处理和/或细节增强处理;所述FPGA芯片上还设置用于将处理后的图像数据输出的输出接口。本发明对采集的图像进行了多次处理,使图像质量得到了很大的提高,在天气恶劣的情况下采集的图像数据不受影响,最终得到的无雾图像效果比较好,对现有技术中的各种监控设备可以起到增强、补充的效果。The present invention includes an FPGA chip and an ARM chip, the FPGA chip is connected to the ARM chip, the FPGA chip is provided with an image data acquisition interface, and the collected image data is subjected to color shift correction processing, fog penetration enhancement processing, low Contrast enhancement processing and/or detail enhancement processing; an output interface for outputting the processed image data is also set on the FPGA chip. The present invention has processed the collected image for many times, so that the image quality has been greatly improved, and the image data collected under the condition of bad weather is not affected, and the effect of the finally obtained fog-free image is relatively good, which is different from the existing technology. Various monitoring equipment in the system can enhance and supplement the effect.
附图说明Description of drawings
图1为本发明的基于FPGA的电子透雾增强图像处理系统的结构示意图;Fig. 1 is the structure schematic diagram of the FPGA-based electronic fog penetration enhanced image processing system of the present invention;
图2为本发明的图像优化算法流程示意图;Fig. 2 is a schematic flow chart of an image optimization algorithm of the present invention;
图3-1为透雾算法三段线性变换示意图;Figure 3-1 is a schematic diagram of the three-segment linear transformation of the fog penetration algorithm;
图3-2为透雾算法的采用直方图统计方法计算亮度动态范围的示意图;Figure 3-2 is a schematic diagram of calculating the dynamic range of brightness using the histogram statistical method of the fog penetration algorithm;
图4-1为低对比度增强算法中核最右侧的列直方图更新的示意图;Figure 4-1 is a schematic diagram of the update of the column histogram on the far right of the kernel in the low contrast enhancement algorithm;
图4-2为低对比度增强算法中和直方图更新的示意图;Figure 4-2 is a schematic diagram of the update of the neutralization histogram in the low contrast enhancement algorithm;
图5为细节增强算法原理图;Figure 5 is a schematic diagram of detail enhancement algorithm;
图6为电子变倍算法的双线性差值处理的示意图。FIG. 6 is a schematic diagram of bilinear difference processing of the electronic zoom algorithm.
具体实施方式Detailed ways
下面结合附图对本发明的具体实施方式作进一步的说明:The specific embodiment of the present invention will be further described below in conjunction with accompanying drawing:
透雾技术从实际应用来讲,包括对灰尘、水气、细小障碍物(比如透明罩的轻微脏污和雨水等)的穿透。在这些恶劣的环境下,图像质量会大幅下降甚至无法采集监控目标的影像,因此需要采用透雾技术对图像进行后期处理和优化。图像优化处理,主要是采用各种算法对模糊的图像进行重新校正,再现现场图像。随着芯片技术的发展,把电脑上的图像优化系统做成单一的运行程序,固化到FPGA上,这就是所谓的数字透雾技术,由于单纯的数字透雾不会改变色彩,因此,也叫彩色透雾。From the perspective of practical application, fog penetration technology includes the penetration of dust, water vapor, and small obstacles (such as slight dirt and rain on the transparent cover, etc.). In these harsh environments, the image quality will be greatly reduced or even unable to collect images of surveillance targets. Therefore, it is necessary to use fog penetration technology for post-processing and optimization of images. Image optimization processing mainly uses various algorithms to re-correct blurred images and reproduce live images. With the development of chip technology, the image optimization system on the computer is made into a single operating program and solidified on the FPGA. This is the so-called digital fog penetration technology. Since the pure digital fog penetration will not change the color, it is also called Color through the fog.
本实施例的基于FPGA的电子透雾增强图像处理系统包括包括FPGA芯片和ARM芯片,FPGA芯片与ARM芯片连接,FPGA芯片上设置有图像数据采集接口,并对采集的图像数据进行色偏校正处理、透雾增强处理、低对比度增强处理和/或细节增强处理;FPGA芯片上还设置用于将处理后的图像数据输出的输出接口。The FPGA-based electronic fog penetration enhanced image processing system of this embodiment includes an FPGA chip and an ARM chip, the FPGA chip is connected to the ARM chip, the FPGA chip is provided with an image data acquisition interface, and performs color shift correction processing on the collected image data , fog penetration enhancement processing, low contrast enhancement processing and/or detail enhancement processing; an output interface for outputting the processed image data is also set on the FPGA chip.
ARM芯片上设置有用于与上位机通信连接的网口,ARM芯片用于根据上位机下发的指令控制FPGA对采集的图像数据进行处理。上述FPGA芯片上设置有第一驱动接口及第一调试接口,ARM芯片上设置有第二驱动接口及第二调试接口。The ARM chip is provided with a network port for communicating with the host computer, and the ARM chip is used to control the FPGA to process the collected image data according to the instructions issued by the host computer. The FPGA chip is provided with a first driver interface and a first debugging interface, and the ARM chip is provided with a second driver interface and a second debugging interface.
本实施例的基于FPGA的透雾增强图像处理系统,还包括梯度统计模块,所述梯度统计模块用于对采集的图像数据进行梯度统计处理,并将经过梯度统计后的图像数据经过所述ARM芯片发送给上位机;为了展示本实施例的图像处理系统的多样性功能,还包括电子变倍模块及字符叠加模块,采集的图像数据在细节增强处理后,经过电子变倍模块的变倍处理及字符叠加模块的叠加处理输出。The FPGA-based fog penetration enhanced image processing system of this embodiment also includes a gradient statistics module, which is used to perform gradient statistics processing on the collected image data, and pass the image data after gradient statistics through the ARM The chip is sent to the upper computer; in order to demonstrate the diversity functions of the image processing system of this embodiment, it also includes an electronic zoom module and a character superimposition module. After the details are enhanced, the collected image data is processed by the electronic zoom module. And the superposition processing output of the character superposition module.
采用上述基于FPGA的电子透雾增强图像处理系统对图像处理的方法,如图2所示,主要对采集的图像数据进行色偏校正处理、透雾增强处理、低对比度增强处理和/或细节增强处理等多次处理,使得到的图像质量很高,不影响在恶劣天气下对采集的图像的分析。Using the above-mentioned FPGA-based electronic fog penetration enhanced image processing system for image processing, as shown in Figure 2, mainly performs color shift correction processing, fog penetration enhancement processing, low contrast enhancement processing and/or detail enhancement on the collected image data Processing and other multiple processing, so that the obtained image quality is very high, does not affect the analysis of the collected images in bad weather.
具体来说,如图1所示,图像处理系统包括硬件部分和软件部分,硬件部分主要包括接口、处理核心、外设、电源模块。其中,接口包括1路HD-SDI输入、2路HD-SDI输出、2路PAL输出、1路RS422通讯、电源及第一调试接口,第一调试接口包括RS422调试接口及JTAG调试接口,ARM芯片与FPGA芯片共用JTAG调试接口,所以,ARM芯片的第二调试接口为JTAG调试接口。处理核心使用内嵌ARM的FPGA芯片内,考虑资源与功耗,选用Altera公司的Cycione VSX系列FPGA。外设主要包括ARM外接的第二驱动接口即DDR3驱动接口、1路TF卡、1路NorFlash,FPGA外接的第一驱动接口,即DDR3驱动接口,以及几个接口的转换芯片。电源模块接收5V输入,转换为板上各芯片所需电压,如3.3V、2.5V、1.8V、1.1V等。Specifically, as shown in Figure 1, the image processing system includes a hardware part and a software part, and the hardware part mainly includes an interface, a processing core, peripherals, and a power supply module. Among them, the interface includes 1 channel HD-SDI input, 2 channels HD-SDI output, 2 channels PAL output, 1 channel RS422 communication, power supply and the first debugging interface, the first debugging interface includes RS422 debugging interface and JTAG debugging interface, ARM chip The JTAG debugging interface is shared with the FPGA chip, so the second debugging interface of the ARM chip is the JTAG debugging interface. The processing core uses the FPGA chip embedded with ARM, considering resources and power consumption, chooses Cycione VSX series FPGA of Altera Company. Peripherals mainly include the second drive interface external to ARM, namely DDR3 drive interface, 1 channel TF card, 1 channel NorFlash, the first drive interface externally connected to FPGA, namely DDR3 drive interface, and conversion chips for several interfaces. The power module receives 5V input and converts it to the voltage required by each chip on the board, such as 3.3V, 2.5V, 1.8V, 1.1V, etc.
软件部分包括ARM软件和FPGA逻辑,ARM加载Linux操作系统,并实现串口、DDR3驱动接口、flash boot等基本驱动,应用层主要负责通讯命令解析、综合控制和字符掩膜图的绘制。The software part includes ARM software and FPGA logic. ARM loads the Linux operating system and implements basic drivers such as serial ports, DDR3 driver interfaces, and flash boot. The application layer is mainly responsible for communication command analysis, comprehensive control, and character mask drawing.
FPGA逻辑实现主要的图像处理功能,包括梯度统计、色偏校正、透雾增强、低对比度增强、细节增强、电子变倍、字符叠加、图像缩放,另外还包括接口驱动、工作模式配置等接口框架相关内容。FPGA logic implements main image processing functions, including gradient statistics, color shift correction, fog penetration enhancement, low contrast enhancement, detail enhancement, electronic zoom, character overlay, image scaling, and interface frameworks such as interface driver and working mode configuration related information.
图像处理系统通过HD-SDI接口外接1080p25/30高清相机,输入1080p彩色图像数据,进入到FPGA,数据进入FPGA后通过色偏校正、透雾增强、低对比度增强、细节增强处理,实现主要的处理算法,完成图像质量的改善,提高可观察性;后续通过电子变倍和字符叠加后经HD-SDI接口输出(2路SDI输出相同内容);同时为符合PAL制式,在电子变倍后通过图像缩放将1920*1080图像缩小为720*576,再叠加字符从PAL接口输出。在这里,经过细节增强处理后的图像数据经过电子变倍再经过图像缩放处理,是因为电子变倍处理能够保持在输出分辨率不变的情况下放大图像,相应的视场会变小,如果将细节增强处理后的数据直接进行图像缩放处理,其视场没有变化。The image processing system is connected to a 1080p25/30 high-definition camera through the HD-SDI interface, and the 1080p color image data is input into the FPGA. After the data enters the FPGA, the main processing is realized through color shift correction, fog penetration enhancement, low contrast enhancement, and detail enhancement. Algorithm to complete the improvement of image quality and improve the observability; after electronic zoom and character superimposition, it will be output via HD-SDI interface (two channels of SDI output the same content); Scaling reduces the 1920*1080 image to 720*576, and then superimposes characters to output from the PAL interface. Here, the image data after detail enhancement processing is electronically zoomed and then image zoomed, because the electronic zoom processing can enlarge the image while keeping the output resolution unchanged, and the corresponding field of view will become smaller. If The data after detail enhancement processing is directly processed for image scaling, and the field of view does not change.
为实现图像的清晰度评估,输入FPGA的图像数据同时进行区域梯度统计处理,并将统计值反馈给ARM部分,通过串口传给上位机。In order to realize the definition evaluation of the image, the image data input into the FPGA is processed by regional gradient statistics at the same time, and the statistical value is fed back to the ARM part, and transmitted to the host computer through the serial port.
ARM一方面通过串口接收上位机传输的数据和命令,包括叠加字符的相关数据和工作模式控制命令,并反馈自检状态、清晰度统计值等信息给上位机;另一方面根据上位机命令实现工作模式综合控制,并根据得到的系统信息更新字符掩膜图绘制,将字符掩膜图提供给FPGA的字符叠加模块。On the one hand, ARM receives the data and commands transmitted by the host computer through the serial port, including the relevant data of superimposed characters and the control command of the working mode, and feeds back information such as self-test status and definition statistics to the host computer; on the other hand, it realizes The working mode is comprehensively controlled, and the drawing of the character mask is updated according to the obtained system information, and the character mask is provided to the character overlay module of the FPGA.
图像处理系统以内嵌ARM的FPGA为处理核心,配置相关外设和接口电路,实现图像的实时处理。ARM软件主要负责3部分的内容:The image processing system takes the FPGA embedded with ARM as the processing core, configures related peripherals and interface circuits, and realizes real-time image processing. ARM software is mainly responsible for 3 parts:
(1)串口通讯综合控制:通过422串口接收上位机发来的模式控制及系统参数,根据模式控制命令内容对FPGA部分发出指令,控制FPGA工作模式的开关;同时将系统参数提供给字符掩膜图绘制模块,作为绘制输入信息;另外完成系统自检、综合任务调度等功能。(1) Integrated control of serial port communication: receive the mode control and system parameters from the host computer through the 422 serial port, issue instructions to the FPGA part according to the content of the mode control command, and control the switch of the FPGA working mode; at the same time, provide the system parameters to the character mask The graph drawing module is used as drawing input information; in addition, it completes functions such as system self-inspection and comprehensive task scheduling.
(2)字符掩膜图绘制:基于SKIA或其他字符绘制库,进行字符掩膜图的绘制,并缓存至ARM外接的DDR3,供FPGA部分后续叠加使用。(2) Character mask drawing: Based on SKIA or other character drawing libraries, the character mask drawing is performed and cached to the DDR3 externally connected to the ARM for subsequent superimposition of the FPGA part.
(3)接口驱动及系统boot:完成系统上电配置,包括ARM部分和FPGA部分,完成ARM部分的接口驱动,包括DDR3、串口、AXI总线等。(3) Interface driver and system boot: Complete system power-on configuration, including ARM part and FPGA part, complete the interface driver of ARM part, including DDR3, serial port, AXI bus, etc.
FPGA逻辑主要包括3部分内容:FPGA logic mainly includes 3 parts:
(1)接口驱动部分:1)完成HD-SDI解码和HD-SDI编码,该部分通过调用altera提供的IP完成;2)DDR3缓存控制,主要完成输入输出图像缓存,在官方提供IP基础上,进行多通道读写控制封装;3)SAF7129驱动,涉及SAF7129I2C配置、PAL制数据协议转换;(1) Interface driver part: 1) Complete HD-SDI decoding and HD-SDI encoding, this part is completed by calling the IP provided by altera; 2) DDR3 cache control, mainly completes the input and output image cache, on the basis of the official provided IP, Perform multi-channel read-write control encapsulation; 3) SAF7129 driver, involving SAF7129I2C configuration and PAL data protocol conversion;
(2)工作模式控制部分:1)完成与ARM的AXI总线通讯,接收ARM传来的控制命令,返回梯度统计信息和其他工作状态信息;2)基于ARM的控制命令,配置算法功能模块中各算法模块的工作模式。(2) Working mode control part: 1) Complete AXI bus communication with ARM, receive control commands from ARM, and return gradient statistics and other working status information; 2) Based on ARM control commands, configure each function module in the algorithm The working mode of the algorithm module.
(3)算法功能模块:完成包括梯度统计、色偏校正、透雾增强、低对比度增强、细节增强、电子变倍、图像缩放、字符叠加在内所有算法功能模块的处理,各模块间接口统一使用Dval、DataRGB[23:0]、CLK_pixel,实现全流水化处理,每个像素时钟输出1个像素处理结果。(3) Algorithm function module: complete the processing of all algorithm function modules including gradient statistics, color shift correction, fog penetration enhancement, low contrast enhancement, detail enhancement, electronic zoom, image zoom, character superposition, and the interface between each module is unified Use Dval, DataRGB[23:0], CLK_pixel to realize full pipeline processing, and output 1 pixel processing result per pixel clock.
下面分别对各图像优化算法进行详细说明:Each image optimization algorithm is described in detail below:
1)色偏校正算法1) Color shift correction algorithm
输入:原始图像视频序列,视频图像分辨率为1920×1080像素,位深为24bit。Input: original image video sequence, video image resolution is 1920×1080 pixels, bit depth is 24bit.
输出:白平衡后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Output: video image sequence after white balance, video image resolution is 1920×1080 pixels, bit depth is 24bit.
实现流程设计:Realize process design:
有雾图像由于自然光中不同波段光线的穿透能力不同,往往成像时存在色偏问题,在图像透雾增强之后,偏色也会被放大增强而变得异常明显,因此本算法针对样例视频出现的色调偏绿的问题,在透雾增强之前,提出一种色偏校正处理的方法。Due to the different penetration capabilities of different bands of light in natural light, foggy images often have color cast problems when imaging. After the image is enhanced through fog, the color cast will also be enlarged and enhanced to become extremely obvious. Therefore, this algorithm is aimed at the sample video For the problem of greenish hue, a method of color cast correction is proposed before fog penetration is enhanced.
已知输入图像I(x,y)的R、G、B三通道像素值分别为r(x,y)、g(x,y)和b(x,y),则表征图像偏绿强度图G(x,y),可以通过以下公式计算:It is known that the R, G, and B three-channel pixel values of the input image I(x,y) are r(x,y), g(x,y) and b(x,y) respectively, and the greenish intensity map of the image is represented G(x,y), can be calculated by the following formula:
G(x,y)=max(0,g(x,y)-max(r(x,y),b(x,y)))G(x,y)=max(0,g(x,y)-max(r(x,y),b(x,y)))
其中,max()运算符表示计算两个数的最大值,G(x,y)的取值范围是[0,255];G(x,y)的物理意义表征的是图像各个像素点所含绿色的多少。考虑到偏色图像的特性是绝大部分图像都包含有绿色成分,在图像处理中,可以计算全图中包含绿色成分最小的像素点作为图像整体偏色程度的度量,考虑到单点选取的误差,实际过程中选取强度图G(x,y)中从小到大选取一定比例的点所对应的强图值G40(x,y)作为图像偏色的量化表示。色偏校正后的G通道像素值g'(x,y)可以通过以下公式计算:Among them, the max() operator means to calculate the maximum value of two numbers, and the value range of G(x,y) is [0,255]; the physical meaning of G(x,y) represents the green color contained in each pixel of the image how much. Considering that the characteristic of color cast images is that most of the images contain green components, in image processing, the pixel that contains the smallest green components in the whole image can be calculated as the measure of the overall color cast of the image, considering the single point selected In the actual process, the intensity map value G 40 (x, y) corresponding to a certain proportion of points in the intensity map G(x, y) from small to large is selected as the quantitative representation of image color cast. The G channel pixel value g'(x,y) after color shift correction can be calculated by the following formula:
g′(x,y)=max(0,g(x,y)-G40(x,y))g'(x,y)=max(0,g(x,y)-G 40 (x,y))
本实施例的色偏校正算法相对于传统的白平衡算法,具有计算量小、适应性强等特点,且算法对比例值RThres的选取并不敏感,实现过程中RThres取值范围选取[0.3,0.4]为佳。Compared with the traditional white balance algorithm, the color shift correction algorithm of this embodiment has the characteristics of small amount of calculation and strong adaptability, and the algorithm is not sensitive to the selection of the ratio value R Thres . During the implementation process, the value range of R Thres is selected [ 0.3,0.4] is better.
2)透雾算法2) Fog penetration algorithm
输入:色偏校正后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Input: video image sequence after color shift correction, video image resolution is 1920×1080 pixels, bit depth is 24bit.
输出:透雾后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Output: the video image sequence after fog penetration, the video image resolution is 1920×1080 pixels, and the bit depth is 24bit.
实现流程设计:Realize process design:
透雾算法采用全局直方图拉伸的算法实现透雾增强功能。首先计算有雾图像的直方图分布,考虑到有雾图像整体由于在低亮度部分的直方图分布数量很少,因此造成视觉上对比度低的问题。本算法考虑图像像素直方图的统计分布特性,计算图像像素拉伸的高低亮度门限,然后通过R、G、B三通道直方图拉伸的方法增大对比度,实现透雾效果。The fog penetration algorithm uses the global histogram stretching algorithm to realize the fog penetration enhancement function. Firstly, the histogram distribution of the foggy image is calculated, considering that the overall foggy image has a small number of histogram distributions in the low-brightness part, which causes the problem of low visual contrast. This algorithm considers the statistical distribution characteristics of the image pixel histogram, calculates the high and low brightness thresholds of image pixel stretching, and then increases the contrast through the R, G, and B three-channel histogram stretching method to achieve the effect of fog penetration.
已知输入图像I(x,y)的R、G、B三通道像素值分别为r(x,y)、g(x,y)和b(x,y),则灰度图像Y(x,y)采用灰度计算的心理学公式计算:Given that the R, G, and B three-channel pixel values of the input image I(x,y) are r(x,y), g(x,y) and b(x,y) respectively, then the grayscale image Y(x ,y) is calculated using the psychological formula of grayscale calculation:
Y(x,y)=0.30*r(x,y)+0.59*g(x,y)+0.11*b(x,y)Y(x,y)=0.30*r(x,y)+0.59*g(x,y)+0.11*b(x,y)
图像增强处理时,为了突出感兴趣的目标或灰度区间,可以采用分段线性变换,把整个灰度区间划分为几个灰度区间,拉伸要增强目标对应的灰度区间,相对抑制不感兴趣的灰度级,从而达到增强的目的。常用的分段线性变换为三段线性变换,如图3-1所示,其数学表达式为:During image enhancement processing, in order to highlight the target or gray-scale interval of interest, piecewise linear transformation can be used to divide the entire gray-scale interval into several gray-scale intervals, stretching the gray-scale interval corresponding to the target to be enhanced, which is relatively insensitive to suppression The gray level of interest, so as to achieve the purpose of enhancement. The commonly used piecewise linear transformation is three-segment linear transformation, as shown in Figure 3-1, and its mathematical expression is:
式中M为图像最大亮度,通过调节折线拐点的位置及分段直线的斜率,即控制参数a、b、c,d的取值,可实现对任一灰度区间的扩展或压缩。In the formula, M is the maximum brightness of the image. By adjusting the position of the inflection point of the broken line and the slope of the segmented line, that is, controlling the values of parameters a, b, c, and d, any gray-scale interval can be expanded or compressed.
透雾算法采用统计灰度图像Y(x,y)的直方图,通过设定图像中低亮度比例门限Rlow和高亮度比例门限Rhigh来计算图像亮度的动态范围[LowThres,HighThres],最终确定三段线性变换的参数,原理如图3-2所示。在实际过程中,Rlow取0.005,Rhigh取0.01,a取LowThres,b取HighThres,c取LowThres/3,d取(HighThres+255)/2。The fog penetration algorithm uses the histogram of the statistical grayscale image Y(x, y), and calculates the dynamic range [LowThres, HighThres] of the image brightness by setting the low brightness ratio threshold Rlow and the high brightness ratio threshold Rhigh in the image, and finally determines three The parameters of segment linear transformation, the principle is shown in Figure 3-2. In the actual process, Rlow takes 0.005, Rhigh takes 0.01, a takes LowThres, b takes HighThres, c takes LowThres/3, and d takes (HighThres+255)/2.
3)低对比度增强算法3) Low contrast enhancement algorithm
输入:透雾后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Input: the video image sequence after fog penetration, the video image resolution is 1920×1080 pixels, and the bit depth is 24bit.
输出:低对比度增强后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Output: low-contrast enhanced video image sequence, the video image resolution is 1920×1080 pixels, and the bit depth is 24bit.
实现流程设计:图像去雾算法往往会使得图像整体亮度降低,而原有亮度比较低的区域由于亮度的进一步降低而使得原有的图像细节产生了一定程度上的缺失,这就需要采用低对比度增强的模块进行亮度补偿。Implementation process design: The image defogging algorithm often reduces the overall brightness of the image, and the original image details are lost to a certain extent due to the further reduction of the original brightness in areas with relatively low brightness, which requires the use of low contrast Enhanced module for brightness compensation.
低对比度算法设计的核心是对低对比度区域的估计,该算法针对灰度图像采用一定尺度的中值滤波的方式,忽略图像细节的同时提取像素所在区域的平均亮度作为该像素增强的参考权值,即亮度导引图;然后选择一个非线性变换函数(实际程序中选取指数函数),利用亮度导引图分别对图像R、G、B三通道进行亮度拉伸的方式实现对比度增强。已知输入图像I(x,y)的RGB三通道像素值分别为r(x,y)、g(x,y)和b(x,y),本模块的灰度图像Y(x,y)通过以下公式计算:The core of the low-contrast algorithm design is the estimation of the low-contrast area. The algorithm adopts a certain-scale median filtering method for the grayscale image, ignores the image details, and extracts the average brightness of the area where the pixel is located as the reference weight of the pixel enhancement. , that is, the brightness guide map; then select a nonlinear transformation function (exponential function is selected in the actual program), and use the brightness guide map to stretch the brightness of the three channels of the image R, G, and B to achieve contrast enhancement. It is known that the RGB three-channel pixel values of the input image I(x,y) are r(x,y), g(x,y) and b(x,y) respectively, and the grayscale image Y(x,y) of this module ) is calculated by the following formula:
Y(x,y)=max(r(x,y),g(x,y),b(x,y))Y(x,y)=max(r(x,y),g(x,y),b(x,y))
灰度图像中值滤波采用快速中值滤波算法,首先,对于每一列图像,都为其维护一个直方图(对于8位图像,该直方图有256个元素),在整个的处理过程中,这些直方图数据都必须得到维护。每列直方图累积了2r+1个垂直方向上相邻像素的信息(其中r为中值滤波半径),初始的时候,这2r+1个像素是分别以第一行的每个像素为中心的。核的直方图通过累积2r+1个相邻的列直方图数据获取。在整个滤波的过程中,这些直方图数据在两个步骤内用恒定的时间保持最新。如图4-1和4-2所示,考虑从某个像素向右移动一个像素的情况。对于当前行,核最右侧的列直方图首先需要更新,而此时该列的列直方图中的数据还是以上一行对应位置那个像素为中心计算的。因此需要减去最上一个像素对应的直方图然后加上其下面一像素的直方图信息。这样做的效果就是将列直方图数据降低一行。这一步很明显是个0(1)操作,只有一次加法和一次减法,而于半径r无关。第二步更新核直方图,其是2r+1个列直方图之和。这是通过减去最左侧的列直方图数据,然后再加上第一步所处理的那一列的列直方图数据获得的。如前所述,加法、减法以及计算直方图的中值的耗时都是一些依赖于图像位深的计算,而与滤波半径无关。Grayscale image median filtering adopts fast median filtering algorithm. First, for each column of images, a histogram is maintained for it (for 8-bit images, the histogram has 256 elements). During the entire processing process, these Histogram data must be maintained. Each column of the histogram accumulates the information of 2r+1 adjacent pixels in the vertical direction (where r is the median filter radius). Initially, these 2r+1 pixels are centered on each pixel in the first row. of. The histogram of the kernel is obtained by accumulating 2r+1 adjacent column histogram data. These histogram data are kept up-to-date with constant time in two steps throughout the filtering process. As shown in Figures 4-1 and 4-2, consider the case of moving one pixel to the right from a certain pixel. For the current row, the column histogram on the far right of the kernel needs to be updated first, and at this time the data in the column histogram of this column is still calculated centered on the pixel at the corresponding position of the previous row. Therefore, it is necessary to subtract the histogram corresponding to the uppermost pixel and then add the histogram information of the pixel below it. The effect of this is to lower the column histogram data by one line. This step is obviously a 0(1) operation, with only one addition and one subtraction, regardless of the radius r. The second step updates the kernel histogram, which is the sum of 2r+1 column histograms. This is obtained by subtracting the leftmost column histogram data and adding the column histogram data for the column processed in the first step. As mentioned earlier, the time-consuming addition, subtraction, and calculation of the median value of the histogram are all calculations that depend on the bit depth of the image, and have nothing to do with the filter radius.
利用亮度导引图,设图像R、G、B三通道灰度值为Yr/g/b(x,y),灰度拉伸之后的三通道灰度值为Y'r/g/b(x,y),灰度拉伸采用的非线性函数为:Using the brightness guide map, set the three-channel gray value of the image R, G, and B to Y r/g/b (x, y), and the three-channel gray value after gray scale stretching is Y' r/g/b (x,y), the non-linear function used for grayscale stretching is:
其中,Meduim(x,y)为灰度点,Yr/g/b(x,y)对应的中值滤波图像的像素值,Ymin为灰度图像像素最小值,Yavg为灰度图像像素平均值。Among them, Meduim(x, y) is the grayscale point, Y r/g/b (x, y) corresponds to the pixel value of the median filter image, Y min is the minimum pixel value of the grayscale image, and Y avg is the grayscale image Pixel average.
4)细节增强算法4) Detail enhancement algorithm
输入:低对比度增强后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Input: low-contrast enhanced video image sequence, the video image resolution is 1920×1080 pixels, and the bit depth is 24bit.
输出:细节增强后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Output: video image sequence after detail enhancement, video image resolution is 1920×1080 pixels, bit depth is 24bit.
实现流程设计:细节增强算法在实施例中是一个可选模块,其目标在于增强图像细节信息。算法重要流程采用经典的Unsharp Mask(USM)锐化算法,具体原理如图5所示,用具体的公式表达即为:Implementation process design: the detail enhancement algorithm is an optional module in the embodiment, and its goal is to enhance image detail information. The important process of the algorithm adopts the classic Unsharp Mask (USM) sharpening algorithm. The specific principle is shown in Figure 5, and the specific formula is:
y(n,m)=x(n,m)+λz(n,m)y(n,m)=x(n,m)+λz(n,m)
其中,x(n,m)为输入图像,y(n,m)为输出图像,λ是用于控制增强效果的一个缩放因子,而z(n,m)为校正信号,一般是通过输入图像对x进行高通滤波获取,在本算法中:Among them, x(n,m) is the input image, y(n,m) is the output image, λ is a scaling factor used to control the enhancement effect, and z(n,m) is the correction signal, generally through the input image Perform high-pass filtering on x to obtain, in this algorithm:
z(n,m)=x(n,m)-g(n,m)z(n,m)=x(n,m)-g(n,m)
其中,g(n,m)为对x(n,m)的高斯滤波结果。Among them, g(n,m) is the Gaussian filtering result of x(n,m).
采用细节增强算法对图像处理的过程中,首先对原始图像的R、G、B三个通道进行低通滤波,然后利用原始图像与低通滤波后图像的差分提取图像中的高频部分,最后将高频图像加权叠加,实现图像细节增强。In the process of image processing using the detail enhancement algorithm, the R, G, and B channels of the original image are first low-pass filtered, and then the difference between the original image and the low-pass filtered image is used to extract the high-frequency part of the image, and finally Weighted superposition of high-frequency images to achieve image detail enhancement.
5)电子变倍算法5) Electronic zoom algorithm
输入:细节增强后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Input: video image sequence after detail enhancement, the video image resolution is 1920×1080 pixels, and the bit depth is 24bit.
输出:2x或4x电子变倍后的视频图像序列,视频图像分辨率为1920×1080像素,位深为24bit。Output: video image sequence after 2x or 4x electronic zoom, video image resolution is 1920×1080 pixels, bit depth is 24bit.
实现流程设计:电子变倍的目的是将图像中心区域进行放大显示,以满足监控和观察的需要,分为2×电子变倍和4×电子变倍两种功能需求。Realize process design: The purpose of electronic zoom is to enlarge and display the central area of the image to meet the needs of monitoring and observation. It is divided into two functional requirements: 2× electronic zoom and 4× electronic zoom.
该算法设计综合考虑效率和效果两方面因素,采用双线性插值算法实现电子变倍功能。在数学上,双线性插值是有两个变量的插值函数的线性插值扩展,其核心思想是在两个方向分别进行一次线性插值,如图6所示。The design of the algorithm considers both efficiency and effect, and uses a bilinear interpolation algorithm to realize the electronic zoom function. Mathematically, bilinear interpolation is a linear interpolation extension of an interpolation function with two variables, and its core idea is to perform a linear interpolation in two directions, as shown in Figure 6.
若想得到未知函数f在点P=(x,y)的值,并且已知函数f在Q11=(x1,y1),Q12=(x1,y2),Q21=(x2,y1)及Q22=(x2,y2)四个点的值,其计算求解过程为:If you want to get the value of the unknown function f at point P=(x, y), and the known function f is at Q 11 = (x 1 , y 1 ), Q 12 = (x 1 , y 2 ), Q 21 = (x 2 , y 1 ) and Q 22 = (x 2 , y 2 ) the values of the four points, the calculation and solution process is as follows:
首先在x方向进行线性插值,得到:First perform linear interpolation in the x direction to get:
然后在y方向进行线性插值,得到:Then perform linear interpolation in the y direction to get:
这样就得到f(x,y的表达式:This results in an expression for f(x, y:
如果选择一个坐标系统使得f的四个已知点坐标分别为(0,0)、(0,1)、(1,0)和(1,1),那么插值公式就可以化简为:If a coordinate system is chosen so that the coordinates of the four known points of f are (0, 0), (0, 1), (1, 0) and (1, 1), then the interpolation formula can be simplified as:
f(x,y)≈f(0,0)(1-x)(1-y)+f(1,0)x(1-y)+f(0,1)(1-x)y+f(1,1)xy.f(x,y)≈f(0,0)(1-x)(1-y)+f(1,0)x(1-y)+f(0,1)(1-x)y+ f(1,1)xy.
或者用矩阵运算表示为:Or expressed in matrix operations as:
与这种插值方法不同的是,这种插值方法的结果通常不是线性的,表示为:Unlike this interpolation method, the result of this interpolation method is usually not linear, expressed as:
b1+b2x+b3y+b4xy.b 1 +b 2 x+b 3y +b 4 xy.
其中,常数的数目都对应于给定的f的数据点数目:where the number of constants corresponds to the number of data points for a given f:
b1=f(0,0)b 1 =f(0,0)
b2=f(1,0)-f(0,0)b 2 =f(1,0)-f(0,0)
b3=f(0,1)-f(0,0)b 3 =f(0,1)-f(0,0)
b4=f(1,1)-f(1,0)-f(0,1)+f(0,0)b 4 =f(1,1)-f(1,0)-f(0,1)+f(0,0)
线性插值的结果与插值的顺序无关。首先进行y方向的插值,然后进行x方向的插值,所得到的结果是一样的。The result of linear interpolation is independent of the order of interpolation. The interpolation in the y direction is performed first, and then the interpolation in the x direction is performed, and the result obtained is the same.
6)梯度统计算法6) Gradient statistics algorithm
输入:原始视频图像序列,视频图像分辨率为192×108像素,位深为24bit。Input: Original video image sequence, video image resolution is 192×108 pixels, bit depth is 24bit.
输出:梯度参考值。Output: gradient reference value.
实现流程设计:梯度统计算法主要是运用对比度对焦的原理,通过检测图像的轮廓边缘实现自动对焦的。图像的轮廓边缘越清晰,则它的亮度梯度就越大,或者说边缘处景物和背景之间的对比度就越大。反之,失焦的图像,轮廓边缘模糊不清,亮度梯度或对比度下降;失焦越远,对比度越低。利用这个原理,输出的对比度相差的绝对值最小时,说明对焦完成。Implementation process design: The gradient statistical algorithm mainly uses the principle of contrast focusing to realize automatic focusing by detecting the contour edge of the image. The sharper the edge of the outline of the image, the greater its brightness gradient, or the greater the contrast between the scene and the background at the edge. Conversely, for an out-of-focus image, the contour edge is blurred, and the brightness gradient or contrast decreases; the farther out of focus, the lower the contrast. Using this principle, when the absolute value of the output contrast difference is the smallest, it means that the focus is completed.
本算法采用Sobel梯度算子作为方差量的度量方式,计算图像中心区域(192×108像素)的梯度值,梯度值达到最大时,即为对焦完成。Sobel算子主要用作边缘检测,在技术上,它是一离散性差分算子,用来运算图像亮度函数的灰度之近似值。在图像的任何一点使用此算子,将会产生对应的灰度矢量或是其法矢量。Sobel卷积因子为:This algorithm uses the Sobel gradient operator as the measure of variance to calculate the gradient value of the image center area (192×108 pixels). When the gradient value reaches the maximum, the focus is completed. The Sobel operator is mainly used for edge detection. Technically, it is a discrete difference operator, which is used to calculate the approximate value of the gray level of the image brightness function. Using this operator at any point in the image will generate the corresponding grayscale vector or its normal vector. The Sobel convolution factor is:
该算子包含两组3x3的矩阵,分别为横向及纵向,将之与图像作平面卷积,即可分别得出横向及纵向的亮度差分近似值。如果以A代表原始图像,Gx及Gy分别代表经横向及纵向边缘检测的图像灰度值。The operator includes two sets of 3x3 matrices, which are horizontal and vertical respectively, and plane convolution is performed with the image to obtain the approximate values of the horizontal and vertical brightness differences respectively. If A represents the original image, Gx and Gy represent the gray value of the image detected by horizontal and vertical edges respectively.
图像的每一个像素的横向及纵向灰度值通过以下公式结合,来计算该点灰度的大小:The horizontal and vertical gray values of each pixel of the image are combined by the following formula to calculate the gray value of the point:
梯度统计算法为了提高效率使用不开平方的近似值为梯度值:In order to improve efficiency, the gradient statistical algorithm uses an approximation that does not take the square root as the gradient value:
|G|=|Gx|+|Gy||G|=|G x |+|G y |
7)局部清晰度统计模块7) Local definition statistics module
该模块是针对图像数据中关于各个像素点的清晰度进行统计,用于评判透雾增强效果,由ARM cpu完成记录。This module is to make statistics on the sharpness of each pixel in the image data, and is used to judge the enhancement effect of fog penetration, and the recording is completed by ARM cpu.
以上给出了具体的实施方式,但本发明不局限于以上所描述的实施方式。本发明的基本思路在于上述基本方案,对本领域普通技术人员而言,根据本发明的教导,设计出各种变形的模型、公式、参数并不需要花费创造性劳动。在不脱离本发明的原理和精神的情况下对实施方式进行的变化、修改、替换和变形仍落入本发明的保护范围内。Specific implementations have been given above, but the present invention is not limited to the above-described implementations. The basic idea of the present invention lies in the above-mentioned basic scheme. For those of ordinary skill in the art, according to the teaching of the present invention, it does not need to spend creative labor to design various deformation models, formulas, and parameters. Changes, modifications, substitutions and deformations to the embodiments without departing from the principle and spirit of the present invention still fall within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810608569.4A CN108810506B (en) | 2018-06-13 | 2018-06-13 | An FPGA-based image processing method and system for enhanced fog penetration |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810608569.4A CN108810506B (en) | 2018-06-13 | 2018-06-13 | An FPGA-based image processing method and system for enhanced fog penetration |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108810506A true CN108810506A (en) | 2018-11-13 |
| CN108810506B CN108810506B (en) | 2021-09-07 |
Family
ID=64085627
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810608569.4A Active CN108810506B (en) | 2018-06-13 | 2018-06-13 | An FPGA-based image processing method and system for enhanced fog penetration |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108810506B (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109544483A (en) * | 2018-12-26 | 2019-03-29 | 深圳朗田亩半导体科技有限公司 | Video image brightness, contrast enhancement process and device |
| CN111010497A (en) * | 2019-12-26 | 2020-04-14 | 苏州羿景睿图信息科技有限公司 | FPGA-based CLAHE fog penetration enhancement parallel operation method |
| CN112581509A (en) * | 2020-12-25 | 2021-03-30 | 北京环境特性研究所 | SOPC-based unmanned aerial vehicle-mounted ground target real-time tracking system and method |
| CN113970896A (en) * | 2021-10-25 | 2022-01-25 | 中国船舶重工集团公司第七一一研究所 | Control device based on FPGA chip and electronic equipment |
| CN115589455A (en) * | 2022-10-18 | 2023-01-10 | 杭州电子科技大学 | A Nocturnal Video Image Enhancement System Based on FPGA+ARM |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN202121711U (en) * | 2011-06-09 | 2012-01-18 | 南京觅踪电子科技有限公司 | Fog-penetrating monitoring system based on machine vision |
| CN105023256A (en) * | 2015-08-13 | 2015-11-04 | 丘璇 | Image defogging method and system |
| CN106506974A (en) * | 2016-12-13 | 2017-03-15 | 北京鸿合智能系统股份有限公司 | A kind of automatic photographing method and device |
| CN106998445A (en) * | 2017-03-28 | 2017-08-01 | 深圳市科美集成电路有限公司 | Haze penetrates camera circuit and system |
| CN206620225U (en) * | 2017-03-28 | 2017-11-07 | 深圳市科美集成电路有限公司 | Haze penetrates camera circuit and system |
| CN107895357A (en) * | 2017-12-25 | 2018-04-10 | 北京航空航天大学 | A kind of real-time water surface thick fog scene image Enhancement Method based on FPGA |
-
2018
- 2018-06-13 CN CN201810608569.4A patent/CN108810506B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN202121711U (en) * | 2011-06-09 | 2012-01-18 | 南京觅踪电子科技有限公司 | Fog-penetrating monitoring system based on machine vision |
| CN105023256A (en) * | 2015-08-13 | 2015-11-04 | 丘璇 | Image defogging method and system |
| CN106506974A (en) * | 2016-12-13 | 2017-03-15 | 北京鸿合智能系统股份有限公司 | A kind of automatic photographing method and device |
| CN106998445A (en) * | 2017-03-28 | 2017-08-01 | 深圳市科美集成电路有限公司 | Haze penetrates camera circuit and system |
| CN206620225U (en) * | 2017-03-28 | 2017-11-07 | 深圳市科美集成电路有限公司 | Haze penetrates camera circuit and system |
| CN107895357A (en) * | 2017-12-25 | 2018-04-10 | 北京航空航天大学 | A kind of real-time water surface thick fog scene image Enhancement Method based on FPGA |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109544483A (en) * | 2018-12-26 | 2019-03-29 | 深圳朗田亩半导体科技有限公司 | Video image brightness, contrast enhancement process and device |
| CN109544483B (en) * | 2018-12-26 | 2021-09-24 | 深圳朗田亩半导体科技有限公司 | Video image brightness and contrast enhancement method and device |
| US11205252B2 (en) | 2018-12-26 | 2021-12-21 | Shenzhen Lontium Semiconductor Technology Co., Ltd. | Method and device for enhancing brightness and contrast of video image |
| CN111010497A (en) * | 2019-12-26 | 2020-04-14 | 苏州羿景睿图信息科技有限公司 | FPGA-based CLAHE fog penetration enhancement parallel operation method |
| CN112581509A (en) * | 2020-12-25 | 2021-03-30 | 北京环境特性研究所 | SOPC-based unmanned aerial vehicle-mounted ground target real-time tracking system and method |
| CN112581509B (en) * | 2020-12-25 | 2023-08-15 | 北京环境特性研究所 | Unmanned aerial vehicle ground target real-time tracking system and tracking method based on SOPC |
| CN113970896A (en) * | 2021-10-25 | 2022-01-25 | 中国船舶重工集团公司第七一一研究所 | Control device based on FPGA chip and electronic equipment |
| CN115589455A (en) * | 2022-10-18 | 2023-01-10 | 杭州电子科技大学 | A Nocturnal Video Image Enhancement System Based on FPGA+ARM |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108810506B (en) | 2021-09-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108810506A (en) | A kind of Penetrating Fog enhancing image processing method and system based on FPGA | |
| Wang et al. | Variational single nighttime image haze removal with a gray haze-line prior | |
| US8570396B2 (en) | Multiple exposure high dynamic range image capture | |
| EP2515273B1 (en) | Multiple exposure high dynamic range image capture | |
| US8525900B2 (en) | Multiple exposure high dynamic range image capture | |
| CN107516319B (en) | High-precision simple interactive matting method, storage device and terminal | |
| US9589335B2 (en) | Method for dynamic range editing | |
| Chao et al. | Removal of water scattering | |
| US9407814B2 (en) | Approach for camera control | |
| CN107424198A (en) | Image processing method, device, mobile terminal, and computer-readable storage medium | |
| CN107451969A (en) | Image processing method, device, mobile terminal, and computer-readable storage medium | |
| CN101321270A (en) | A monitoring system and method for optimizing images in real time | |
| CN107317967A (en) | Image processing method, device, mobile terminal, and computer-readable storage medium | |
| Khan et al. | A deep hybrid few shot divide and glow method for ill-light image enhancement | |
| Mukaida et al. | Low-light image enhancement method using a modified gamma transform and gamma filtering-based histogram specification for convex combination coefficients | |
| CN109118458A (en) | A kind of low-luminance color image enchancing method | |
| US11640654B2 (en) | Image processing method and apparatus | |
| CN117221550B (en) | Image processing apparatus, method, device, and storage medium | |
| DE102012007838B4 (en) | High dynamic range image acquisition with multiple exposure | |
| CN111738949B (en) | Image brightness adjusting method and device, electronic equipment and storage medium | |
| Raikwar et al. | Structure based transmission estimation in single image dehazing | |
| Tang et al. | Sky-preserved image dehazing and enhancement for outdoor scenes | |
| Livingston et al. | Image processing for human understanding in low-visibility | |
| Pardhi et al. | Contrast enhancement using adaptive threshold based dynamic range adjustment in luv colour space | |
| Gao et al. | Single fog image dehazing via fast multi-scale image fusion |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |