Image de-scattering method and device based on rank-one prior
Through the unified spectral value calculation and dark channel constraints of the rank-one prior algorithm, combined with the FPGA hardware platform, efficient image descattering is achieved, solving the problem of high computational complexity in the existing technology, and significantly improving the efficiency of image descattering is achieved. and effects, especially in haze and underwater environments.
Patent Information
- Application Number
- CN202411022985.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-07-29
AI Technical Summary
The existing image descattering algorithm has high computational complexity under high resolution and real-time requirements, which is difficult to meet the efficiency and robustness requirements of real-time applications, especially in scattering media environments such as haze and sand and dust, and image quality deteriorates seriously. Impact subsequent processing and task execution.
Using a rank-one prior image descattering method, the histogram statistics and sorting are achieved through unified spectral value calculation and dark channel constraints, combined with dual-port BRAM and FIFO, and the scattering rate is performed using the minimum perceptible window function and sharpening filter. Graph optimization, estimating ambient light values and calculating descattering patterns, and designing an image descattering device suitable for FPGA hardware platform.
Improve the applicability and processing effect of image descattering algorithm, improve the operation efficiency of the algorithm, reduce resource occupation, solve artifact problems, significantly improve the descattering effect of foggy days and underwater scenes, and in color correction and details Excellent in retention and contrast enhancement.
Smart Images

Figure CN119090771A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image descattering method and device based on rank-one prior. Background Art
[0002] Due to the absorption and scattering of light by suspended particles in scattering media such as haze, dust, and turbid water, the final image shows low visibility, poor contrast, color distortion, etc., which seriously affects the subsequent processing and task execution. Image descattering technology resists image quality degradation by suppressing or removing scattered light and enhancing target light, and realizes image detail texture and color information. It is of great significance in transportation, remote sensing detection, video surveillance, ocean exploration and other fields.
[0003] Image descattering algorithms can be divided into two categories according to their basic principles: image enhancement-based methods and physical model-based methods. Image enhancement-based methods do not consider the physical causes of image quality degradation, and may introduce color distortion or artifacts during the enhancement process, affecting the naturalness and authenticity of the image. Physical model-based methods achieve scattering suppression through specific models and prior assumptions. They have a certain physical theoretical basis and can reasonably explain the essence of image quality degradation. The restoration effect is natural and realistic. However, as the requirements for image resolution and frame rate in practical applications continue to increase, the real-time and efficiency of image descattering algorithms are under great test. In order to solve this problem, most of the current solutions are based on dark channel prior algorithms, but the computational complexity of dark channel prior algorithms is high, and the requirements for hardware platforms in practical applications are high. The rank-one prior algorithm is a low-complexity real-time image restoration algorithm. Compared with the dark channel prior algorithm, the rank-one prior algorithm has excellent performance in efficiency and robustness. Therefore, it has the potential to deploy field programmable gate arrays (FPGAs) to achieve efficient descattering. Summary of the invention
[0004] The present invention aims to address the deficiencies of the prior art and solve the problem that the quality of images acquired by imaging equipment in a scattering medium environment is degraded, thereby affecting subsequent processing and task execution, and provides an image descattering method and device based on rank-one prior, which can improve the applicability and processing effect of the descattering algorithm, and at the same time improve the operating efficiency of the algorithm to meet a wide range of real-time application needs.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] An image descattering method based on rank-one prior comprises the following steps:
[0007] S1. Use the collected degraded image I to solve the unified spectral value su , the calculation method is as follows:
[0008] The histograms of the three color channels of the degraded image RGB are counted separately, and sorted from high to low according to the number of pixels, and the spectral value s is unified. u The calculation formula is:
[0009]
[0010]
[0011] in,
[0012] i represents an integer from 0 to 255;
[0013] P v (i) represents the pixel value after sorting;
[0014] P v (0) represents the pixel value with the largest number of pixels;
[0015] P v (255) represents the pixel value with the least number of pixels;
[0016] P c (i) represents P in histogram statistics v (i) The corresponding number of pixels;
[0017] and Ω represent the number of pixels involved in the calculation and the total number of pixels in the image respectively;
[0018] r∈(0,1] is an adjustment parameter, which indicates the range of the number of pixels involved in the calculation.
[0019] The histogram statistics operation is implemented using dual-port BRAM. The specific process is as follows:
[0020] The BRAM address range is set to 0 to 255. Each address stores the number of pixels with the corresponding grayscale value. The pixel grayscale value is used as the read and write address of the BRAM. The read data is accumulated by 1 and then rewritten into the memory with the same address. By pre-judging whether there are repeated grayscale value operations, the counting anomaly caused by the continuous appearance of the same pixel is solved. When the entire image is processed, the statistical values of the grayscale values from 0 to 255 are read out in sequence, and the read address space is cleared to prepare for the histogram statistics of the next frame of the image.
[0021] The histogram results are sorted using the radix sorting method based on FIFO. The specific process is as follows:
[0022] P1. Construct 16 FIFO sequences. The data width is the sum of the total pixel width of the image and the gray value label width. The depth is 256 and they are numbered from 0 to 15.
[0023] P2. Express the histogram statistics in hexadecimal, starting from the lowest bit, and put the statistics and gray value labels into the FIFO of the corresponding sequence number;
[0024] P3, repeat step P2 until the highest position is completed;
[0025] P4. Starting from FIFO numbered 15 and ending with FIFO numbered 0, each FIFO takes out data in turn to obtain the descending result.
[0026] Using dark channel constraints to improve the uniform spectral value s u The accuracy of the calculation results is as follows:
[0027]
[0028] in,
[0029] ε represents the dark channel constraint critical value;
[0030] In the dark channel prior, the dark channel intensity of a clear scene is very low and close to 0. The foreground and background are perceived and distinguished by adjusting the critical value ε. When the pixel value is lower than the critical value ε, the pixel is discarded and does not participate in the calculation of the unified spectrum. Otherwise, it is retained.
[0031] S2, use uniform spectral value s u Solve to get the transmittance diagram And optimize it, the specific process is as follows:
[0032] S21. Solve the normalized form s of the unified spectral value un ,for:
[0033]
[0034] S22, using normalization to unify the spectral value s un Solve the initial scattering rate map with the degraded image I for:
[0035]
[0036] S23. Use the minimum perceptible window function to initialize the scattering rate map To make a judgment, the expression is as follows:
[0037]
[0038] in,
[0039] Ω′(x) represents a 5×5 window with center coordinate x;
[0040] Indicates the color threshold, the value is
[0041] During the window sliding process, when the pixels in the window satisfy the formula in step S23, the image pixels in the window are processed using a sharpening filter, otherwise they are processed using a mean filter;
[0042] S24, execute step S23 until all pixels are processed to obtain the final optimized scattering rate map
[0043] S3. Using the optimized transmittance map Estimate the image ambient light value A by selecting the scattering rate map The ambient light value A is calculated by taking the mean of the top 0.1% pixel positions in the degraded image I.
[0044] S4. Using the Transmittance Map The descattering map J of the scene is calculated by the ambient light value A. The formula is:
[0045]
[0046] in,
[0047] ω∈(0,1] as a constant parameter factor;
[0048] The function of ξ is to prevent the denominator from being too small.
[0049] A rank-one prior-based image descattering device is used for the above-mentioned rank-one prior image descattering method. The device is implemented based on a ZYNQ7020 FPGA development board, and includes an image acquisition module, an image descattering algorithm module, and an HDMI display module; the image acquisition module is used to obtain an image to be processed from an external storage unit or a camera, the image descattering algorithm module is an image processing core module, and is used to restore a degraded image to a clear image; the HDMI display module is used to present the processed clear image data as a visual image.
[0050] The beneficial effects of the present invention are:
[0051] 1. The present invention improves on the limitations of the rank-one prior algorithm. First, the spatial correlation and dark channel prior constraints are used to divide the scenes in the image, eliminate the interference of the foreground and the highlight area, and solve a more accurate unified spectrum. Secondly, the JND theory is used to extract and retain the edges of the scattering rate map, which solves the artifact problem in the restored image. It can achieve an ideal descattering effect in foggy and underwater scenes, and has outstanding performance in color correction, detail retention, and contrast enhancement compared with traditional algorithms.
[0052] 2. The hardware structure of each part of the descattering algorithm module was designed, and the algorithm was deployed on the FPGA hardware platform. The histogram statistics module and the base sorting module were used to improve the calculation efficiency of the unified spectrum. The shared solution of the JND detection window and the filter window reduced the resource occupation, taking into account the image descattering effect and real-time requirements, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a flow chart of an image descattering method based on rank-one prior of the present invention;
[0054] Figure 2 It is a flow chart of an image descattering device based on rank-one prior of the present invention;
[0055] Figure 3 It is a simulation comparison test diagram of the method in the present invention and the DCP algorithm, CLAHE algorithm, CAP algorithm, and ROP algorithm;
[0056] The following is a detailed description of the embodiments of the present invention with reference to the accompanying drawings. DETAILED DESCRIPTION
[0057] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The embodiments are only used to explain the present invention and are not used to limit the scope of the present invention. The present invention is described in more detail by way of example with reference to the accompanying drawings in the following paragraphs. The advantages and features of the present invention will become clearer according to the following description. It should be noted that the accompanying drawings are all in a very simplified form and are not in precise proportions, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0059] The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Specific embodiment 1:
[0061] An image descattering method based on rank-one prior, such as Figure 1 As shown, the specific implementation steps are as follows:
[0062] Step 1: Use dual-port BRAM to implement histogram statistics operation on the input degraded image. The BRAM address range is set to 0 to 255. Each address stores the number of pixels with the corresponding grayscale value. The pixel grayscale value is used as the read and write address of the BRAM. The read data is accumulated by 1 and then rewritten into the same address memory. By pre-judging whether there are repeated grayscale value operations, the counting anomaly caused by the continuous appearance of the same pixel is solved. After the entire image is processed, the statistical values of the grayscale values from 0 to 255 are read out in sequence, and the read address space is cleared to prepare for the histogram statistics of the next frame of the image.
[0063] Step 2: Use the radix sorting method based on FIFO to sort the histogram results in step 1, as follows:
[0064] (201) Construct 16 FIFO sequences, where the data width is the sum of the total pixel width of the image and the gray value label width, the depth is 256, and they are numbered from 0 to 15;
[0065] (202), the histogram statistical results are expressed in hexadecimal, starting from the lowest bit, and the statistical results and gray value labels are placed into the FIFO of the corresponding sequence number;
[0066] (203), repeat step (202) until the highest bit is completed;
[0067] (204) Starting from FIFO numbered 15 and ending with FIFO numbered 0, each FIFO takes out data in turn, and a descending result can be obtained.
[0068] Step 3: Solve for the uniform spectrum value s u , the calculation formula is:
[0069]
[0070] i represents an integer from 0 to 255;
[0071] P v (i) represents the pixel value after sorting;
[0072] P v (0) represents the pixel value with the largest number of pixels;
[0073] P v (255) represents the pixel value with the least number of pixels;
[0074] P c (i) represents P in histogram statistics v (i) The corresponding number of pixels;
[0075] and Ω represent the number of pixels involved in the calculation and the total number of pixels in the image respectively;
[0076] r∈(0,1] is an adjustment parameter, which indicates the range of the number of pixels involved in the calculation.
[0077] Using dark channel constraints to improve the uniform spectral value s u The accuracy of the calculation results is as follows:
[0078]
[0079] Where ε represents the dark channel constraint critical value. In the dark channel prior, the dark channel intensity of the clear scene is very low and close to 0. The foreground and background are perceived and distinguished by adjusting the critical value ε. When the pixel value is lower than the critical value ε, the pixel is discarded and does not participate in the calculation of the unified spectrum. Otherwise, it is retained.
[0080] Step 4, solve the scattering rate map and optimize it, as follows:
[0081] (401) Solve the normalized form of the unified spectral value s un ,for:
[0082]
[0083] (402) Use normalization to unify the spectral value s un Solve the initial scattering rate map with the degraded image I for:
[0084]
[0085] (403) Use the minimum perceptible window function to initialize the scattering rate map To make a judgment, the expression is as follows:
[0086]
[0087] in,
[0088] Ω′(x) represents a 5×5 window with center coordinate x;
[0089] Indicates the color threshold, the value is
[0090] During the window sliding process, when the pixels in the window satisfy the formula in step S23, the image pixels in the window are processed using a sharpening filter, otherwise they are processed using a mean filter;
[0091] (404) Execute step (403) until all pixels are processed to obtain the final optimized scattering rate map
[0092] Step 5, by selecting the scattering rate map The ambient light value A is calculated by taking the mean of the top 0.1% pixel positions in the degraded image I.
[0093] Step 6: Use the scattering rate map The descattering map J of the scene is obtained by solving the ambient light value A, which is:
[0094]
[0095] Among them, ω∈(0,1] is a constant parameter factor, and ξ is used to prevent the denominator from being too small. Specific embodiment 2:
[0097] An image descattering device based on rank-one prior, such as Figure 2 As shown, the device includes an image acquisition module, an image descattering algorithm module, and an HDMI display module.
[0098] The image descattering device of the present invention is specifically implemented on a heterogeneous processing platform of FPGA+ARM architecture, and the chip model is ZYNQ7020. The specific implementation steps are as follows:
[0099] Step 1: The degraded image is stored in a secure digital card (SD card). The ARM initializes the SD card and writes the image data into the DDR3 buffer.
[0100] Step 2: Use direct memory access technology (DMA) to read the image data from the DDR3 buffer, pass it to the image descattering algorithm module for processing, and output a clear image after descattering.
[0101] Step 3, the processed de-scattered clear image is processed by the HDMI display module, which includes a VDMA submodule for data transmission and caching, an AXI-Stream to Video Out submodule for data encoding, and a DIV Transmitter submodule for converting the image data into a data format that can be output through the HDMI display device. Finally, the processed clear image can be displayed on the display.
[0102] The above is the whole process of the image descattering device based on rank-one prior of the present invention, but the above implementation process is not used to limit the present invention. Those skilled in the art can make corresponding improvements without departing from the present invention. The protection scope of the present invention shall be based on the scope defined in the claims.
[0103] In order to verify the effectiveness of the present invention in image descattering, five outdoor foggy scene real-life photos were selected as the test set. This example was compared with the dark channel prior (DCP) algorithm, the contrast-limited adaptive histogram equalization (CLAHE) algorithm, the color prior (CAP) algorithm, and the traditional rank-one prior (ROP) algorithm. The comparison results are shown in Figure 2. Figure 3 From the comparison results, it can be seen that the method of the present invention has a better defogging effect than the CLAHE and CAP methods, has more advantages in color correction than the DCP method, and removes the artifact problem of the near-field target compared to the traditional ROP method, and has a better visual effect.
[0104] In addition to intuitive comparison, the present invention uses three non-reference evaluation indicators, namely standard deviation (STD), natural image quality evaluator (Natural Image Quality Evaluator, NIQE), and perception-based image quality evaluator (Perceptionbased Image Quality Evaluator, PIQE), and four full-reference evaluation indicators, namely mean square error (MSE), peak signal-to-noise ratio (PSNR), structural similarity (SSIM), and feature similarity (FSIM), to quantitatively analyze different algorithms. Among them, STD is used to measure the contrast of the image; NIQE and PIQE describe whether the image is natural; MSE, PSNR, SSIM and FSIM use the fog-free image as the reference image, and the larger the value, the better the defogging effect. The test was carried out on the O-HAZY dataset, from which 20 groups of foggy-clear image pairs were selected, and the foggy images were processed using different defogging methods. The average quantitative results of each evaluation indicator were calculated, as shown in Table 1, and the optimal results of each evaluation indicator are indicated in bold. It can be seen from the data results that the method of the present invention has the best performance in multiple evaluation indicators.
[0105] Table 1 Average quantitative results of evaluation indicators of each dehazing algorithm on the O-HAZY dataset
[0106]
[0107] The present invention is described above by way of example in conjunction with the accompanying drawings. It is obvious that the specific implementation of the present invention is not limited to the above-mentioned method. As long as various improvements are made using the method concept and technical solution of the present invention, or are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.
Claims
1. An image descattering method based on rank-one prior, characterized in that: The following steps are involved: S1. Use the collected degraded image I to solve the unified spectral value s u ; S2, use uniform spectral value s u Solve to get the transmittance diagram and optimize it; S3. Using the optimized transmittance map Estimate the image ambient light value A; S4. Using the Transmittance Map The descattering map J of the scene is calculated by combining the ambient light value A.
2. The image descattering method based on rank-one prior according to claim 1, characterized in that: The uniform spectrum value s in step S1 u The calculation method is as follows: The histograms of the three color channels of the degraded image RGB are counted separately, and sorted from high to low according to the number of pixels, and the spectral value s is unified. u The calculation formula is: in, i represents an integer from 0 to 255; P v (i) represents the pixel value after sorting; P v (0) represents the pixel value with the largest number of pixels; P v (255) represents the pixel value with the least number of pixels; P c (i) represents P in histogram statistics v (i) The corresponding number of pixels; and Ω represent the number of pixels involved in the calculation and the total number of pixels in the image respectively; r∈(0,1] is an adjustment parameter, which indicates the range of the number of pixels involved in the calculation.
3. The image descattering method based on rank-one prior according to claim 2, characterized in that: The histogram statistics operation is implemented using dual-port BRAM. The specific process is as follows: The BRAM address range is set to 0 to 255. Each address stores the number of pixels with the corresponding grayscale value. The pixel grayscale value is used as the read and write address of the BRAM. The read data is accumulated by 1 and then rewritten into the memory with the same address. By pre-judging whether there are repeated grayscale value operations, the counting anomaly caused by the continuous appearance of the same pixel is solved. When the entire image is processed, the statistical values of the grayscale values from 0 to 255 are read out in sequence, and the read address space is cleared to prepare for the histogram statistics of the next frame of image.
4. The image descattering method based on rank-one prior according to claim 3, characterized in that: The histogram results are sorted using the radix sorting method based on FIFO. The specific process is as follows: P1. Construct 16 FIFO sequences. The data width is the sum of the total pixel width of the image and the gray value label width. The depth is 256 and they are numbered from 0 to 15. P2. Express the histogram statistics in hexadecimal, starting from the lowest bit, and put the statistics and gray value labels into the FIFO of the corresponding sequence number; P3, repeat step P2 until the highest position is completed; P4. Starting from FIFO numbered 15 and ending with FIFO numbered 0, each FIFO takes out data in turn to obtain the descending result.
5. The image descattering method based on rank-one prior according to claim 4, characterized in that: Using dark channel constraints to improve the uniform spectral value s u The accuracy of the calculation results is as follows: in, ε represents the dark channel constraint critical value.
6. The image descattering method based on rank-one prior according to claim 1, characterized in that: The specific process of step S2 is as follows: S21. Solve the normalized form s of the unified spectral value un ,for: S22, using normalization to unify the spectral value s un Solve the initial scattering rate map with the degraded image I for: S23. Use the minimum perceptible window function to initialize the scattering rate map To make a judgment, the expression is as follows: in, Ω′(x) represents a 5×5 window with center coordinate x; Indicates the color threshold, the value is During the window sliding process, when the pixels in the window satisfy the formula in step S23, the image pixels in the window are processed using a sharpening filter, otherwise they are processed using a mean filter; S24, execute step S23 until all pixels are processed to obtain the final optimized scattering rate map 7. The image descattering method based on rank-one prior according to claim 1, characterized in that: In step S3, by selecting the scattering rate map The ambient light value A is calculated by taking the mean of the top 0.1% pixel positions in the degraded image I.
8. The image descattering method based on rank-one prior according to claim 1, characterized in that: In step S4, the scattering rate map is used And the ambient light value A is solved to obtain the descattering map J of the scene, the formula is: in, ω∈(0,1] as a constant parameter factor; The function of ξ is to prevent the denominator from being too small.
9. An image descattering device based on rank-one prior, used to implement the image descattering method of rank-one prior according to any one of claims 1 to 8, characterized in that: The device is implemented based on a ZYNQ7020 FPGA development board, and includes an image acquisition module, an image descattering algorithm module, and an HDMI display module; the image acquisition module is used to obtain an image to be processed from an external storage unit or a camera, the image descattering algorithm module is used to restore a degraded image to a clear image, and the HDMI display module is used to present the processed clear image data as a visual image.
Citation Information
Patent Citations
Real scene vision enhancement method capable of simultaneously defogging and improving resolution
CN114820824A
Image Deblurring Algorithm Based on Sparse Positive Source Separation Model
US20190318459A1
Method for rapidly dehazing underground pipeline image based on dark channel prior
US20200394767A1
