An image despeckling method and device based on rank-one prior
Patent Information
- Application Number
- CN202411022985.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-07-29
AI Technical Summary
[0004]本发明旨在解决现有技术的不足,解决成像设备在散射介质环境中获取的成像图像质量退化,进而影响后续处理及任务执行的问题,而提供一种基于秩一先验的图像去散射方法、装置,能够提高去散射算法的适用性和处理效果,同时提升算法的运行效率来满足广泛的实时性应用需求
[0051]1、本发明针对秩一先验算法的局限性进行改进,首先利用空间相关性与暗通道先验约束,对图像中的场景进行划分,排除掉近景与高亮区域的干扰,求解出更加准确的统一光谱;其次,使用JND理论提取并保留散射率图的边缘,解决了复原后图像中的伪影问题,在雾天和水下场景中均能取得理想的去散射效果,在色彩矫正、细节保留、对比度增强方面相较于传统算法具有突出表现。
Smart Images

Figure CN119090771B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image descattering method and apparatus based on rank-one prior. Background Technology
[0002] Due to the absorption and scattering of light by suspended particles in scattering media such as smog, dust, and turbid water, the final image exhibits low visibility, poor contrast, and color distortion, severely impacting subsequent processing and task execution. Image descattering technology resists image quality degradation by suppressing or removing scattered light and enhancing target light, thus restoring image detail, texture, and color information. This technology is of great significance in fields such as transportation, remote sensing, video surveillance, and marine exploration.
[0003] Image descattering algorithms can be divided into two categories based on their fundamental 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 realism of the image. Physical model-based methods achieve scattering suppression through specific models and prior assumptions, possessing a certain physical theoretical foundation and being able to reasonably explain the nature of image quality degradation, resulting in natural and realistic restoration effects. However, with the continuous improvement of image resolution and frame rate requirements in practical applications, the real-time performance and efficiency of image descattering algorithms are facing significant challenges. To address this issue, most current solutions are based on dark channel prior algorithms, but dark channel prior algorithms have high computational complexity and demanding hardware platform requirements in practical applications. The rank-one prior algorithm is a low-complexity real-time image restoration algorithm. Compared to dark channel prior algorithms, the rank-one prior algorithm exhibits superior performance in terms of efficiency and robustness, thus possessing greater potential for deployment on Field Programmable Gate Arrays (FPGAs) to achieve efficient descattering. Summary of the Invention
[0004] This invention aims to address the shortcomings of existing technologies and solve the problem of image quality degradation in imaging devices acquired in scattering medium environments, which in turn affects subsequent processing and task execution. It provides an image descattering method and apparatus based on rank-one prior, which can improve the applicability and processing effect of descattering algorithms, while improving the algorithm's running efficiency to meet the needs of a wide range of real-time applications.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] An image descattering method based on rank-one prior includes the following steps:
[0007] S1. Using the acquired degraded image I, solve for the uniform spectral value s.u The calculation method is as follows:
[0008] Calculate the histograms of the three color channels (RGB) of the degraded image separately, sort them from highest to lowest pixel count, and unify the spectral values s. u The calculation formula is:
[0009]
[0010]
[0011] in,
[0012] i represents an integer from 0 to 255;
[0013] P v (i) represents the sorted pixel values;
[0014] P v (0) represents the pixel value with the most pixels;
[0015] P v (255) represents the pixel value with the fewest pixels;
[0016] P c (i) represents P in the 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 that represents the range of the number of pixels involved in the calculation.
[0019] The histogram calculation operation is implemented using a dual-port BRAM, and the specific process is as follows:
[0020] The BRAM address range is set from 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 incremented by 1 and then rewritten to the memory at the same address. By pre-judging whether there are duplicate grayscale values, the counting anomaly caused by the consecutive appearance of the same pixels is resolved. After the entire image is processed, the statistical values of 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 image.
[0021] The histogram results are sorted using a radix sorting method based on FIFO. The specific process is as follows:
[0022] P1. Construct 16 FIFO sequences with a data width equal to the sum of the total pixel width of the image and the width of the grayscale label, and a depth of 256, numbered from 0 to 15.
[0023] P2. Represent the histogram statistical results in hexadecimal, starting from the least significant digit, and put the statistical results and grayscale value labels into the corresponding FIFO.
[0024] P3. Repeat step P2 until the highest bit is completed;
[0025] P4. Starting from FIFO number 15 and ending at FIFO number 0, data is extracted from each FIFO in sequence to obtain a descending order result.
[0026] Using dark channel constraints to improve uniform spectral values s u The accuracy of the calculation results is determined by the following formula:
[0027]
[0028] in,
[0029] ε represents the critical value of the dark channel constraint;
[0030] In the dark channel prior, the dark channel intensity of a sharp scene is very low, approaching 0. The foreground and background are distinguished by adjusting a threshold value ε. When a pixel value is below the threshold value ε, the pixel is discarded and does not participate in the unified spectrum calculation; otherwise, it is retained.
[0031] S2, Using uniform spectral values s u The transmittance map was obtained by solving the problem. And it was optimized, the specific process is as follows:
[0032] S21. Solve for the normalized form s of the unified spectral values. un ,for:
[0033]
[0034] S22, Using normalized unified spectral values s un Solving for the initial scattering rate map using the degraded image I for:
[0035]
[0036] S23. Initialize the scattering rate map using the minimum perceptible window function. The judgment is made using the following expression:
[0037]
[0038] in,
[0039] Ω′(x) represents a 5×5 window centered at x;
[0040] This represents the color threshold, with a value of [value missing].
[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 by a sharpening filter; otherwise, the mean filter is used.
[0042] S24. Execute step S23 until all pixels have been processed to obtain the final optimized scattering map.
[0043] S3. Using the optimized transmittance map Estimate the ambient light value A of the image by selecting a scattering map. The ambient light value A is calculated by taking the mean of the first 0.1% of pixels in the degraded image I based on the median norm.
[0044] S4. Using a transmittance graph The descattering map J of the scene is calculated from the ambient light value A using the following formula:
[0045]
[0046] in,
[0047] ω∈(0,1] is a constant parameter factor;
[0048] The purpose of ξ is to prevent the denominator from being too small.
[0049] An image descattering device based on rank-one prior is provided for the aforementioned rank-one prior image descattering method. The device is implemented 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 acquire the image to be processed from an external storage unit or a camera. The image descattering algorithm module is the core image processing module, used to restore the 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 this invention are:
[0051] 1. This invention improves upon the limitations of the rank-one prior algorithm. First, it utilizes spatial correlation and dark channel prior constraints to segment the scene in the image, eliminating interference from foreground and bright areas, and solving for a more accurate unified spectrum. Second, it uses JND theory to extract and preserve the edges of the scattering map, solving the artifact problem in the restored image. It can achieve ideal descattering effects in foggy and underwater scenes, and has outstanding performance compared to traditional algorithms in color correction, detail preservation, and contrast enhancement.
[0052] 2. The hardware structure of each part of the descattering algorithm module was designed, and the algorithm was deployed on an FPGA hardware platform. The computational efficiency of the unified spectrum was improved by utilizing the histogram statistics module and the radix sorting method module. The shared scheme of the JND detection window and the filtering window reduced resource consumption, balancing the image descattering effect and real-time requirements, and has broad application prospects. Attached Figure Description
[0053] Figure 1 This is a flowchart of an image descattering method based on rank-one prior according to the present invention;
[0054] Figure 2 This is a flowchart of an image descattering device based on rank-one prior according to the present invention;
[0055] Figure 3 The simulation comparison test diagrams show the method in this invention with the DCP algorithm, CLAHE algorithm, CAP algorithm, and ROP algorithm.
[0056] The following will describe in detail, with reference to the accompanying drawings, embodiments of the present invention. Detailed Implementation
[0057] The principles and features of the present invention are described below with reference to the accompanying drawings. The embodiments given are for illustrative purposes only and are not intended to limit the scope of the invention. The invention is described more specifically in the following paragraphs by way of example with reference to the accompanying drawings. The advantages and features of the invention will become clearer from the following description. It should be noted that the drawings are in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the invention.
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0059] The present invention will be further described below with reference to the accompanying drawings and embodiments: Specific Implementation Example 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: A dual-port BRAM is used to perform histogram statistics on the input degraded image. The BRAM address range is set from 0 to 255, with each address storing the number of pixels corresponding to a grayscale value. The pixel grayscale value is used as the read / write address of the BRAM. The read data is incremented by 1 and then rewritten to the same memory address. A pre-check for duplicate grayscale values is used to resolve counting anomalies caused by consecutive occurrences of the same pixel. After the entire image processing is complete, the statistical values of grayscale values from 0 to 255 are read sequentially, and the read address space is cleared to prepare for histogram statistics of the next frame.
[0063] Step 2: Sort the histogram results from Step 1 using a radix sorting method based on FIFO, as follows:
[0064] (201) Construct 16 FIFO sequences with a data width equal to the sum of the width of the total number of pixels in the image and the width of the gray value label, and a depth of 256, numbered from 0 to 15.
[0065] (202) Represent the histogram statistics in hexadecimal, starting from the least significant bit, and put the statistics and gray value labels into the corresponding FIFO.
[0066] (203) Repeat step (202) until the highest bit is completed;
[0067] (204) Starting from FIFO number 15 and ending at FIFO number 0, data is extracted from each FIFO in sequence to obtain a descending order result.
[0068] Step 3, Solve for the uniform spectral value s u The calculation formula is:
[0069]
[0070] i represents an integer from 0 to 255;
[0071] P v (i) represents the sorted pixel values;
[0072] P v (0) represents the pixel value with the most pixels;
[0073] P v (255) represents the pixel value with the fewest pixels;
[0074] P c (i) represents P in the 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 that represents the range of the number of pixels involved in the calculation.
[0077] Using dark channel constraints to improve uniform spectral values s u The accuracy of the calculation results is determined by the following formula:
[0078]
[0079] Here, ε represents the dark channel constraint threshold. In the dark channel prior, the dark channel intensity of a sharp scene is very low, approaching 0. The foreground and background are distinguished by adjusting the threshold value ε. When a pixel value is below the threshold value ε, the pixel is discarded and does not participate in the unified spectrum calculation; otherwise, it is retained.
[0080] Step 4: Solve for and optimize the scattering rate map, as detailed below:
[0081] (401) Solve for the normalized form s of the uniform spectral values. un ,for:
[0082]
[0083] (402) Using normalized uniform spectral values s un Solving for the initial scattering rate map using the degraded image I for:
[0084]
[0085] (403) Use the minimum perceptible window function to initialize the scattering map The judgment is made using the following expression:
[0086]
[0087] in,
[0088] Ω′(x) represents a 5×5 window centered at x;
[0089] This represents the color threshold, with a value of [value missing].
[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 by a sharpening filter; otherwise, the mean filter is used.
[0091] (404) Execute step (403) until all pixels have been processed to obtain the final optimized scattering map.
[0092] Step 5, by selecting a scattering rate map The ambient light value A is calculated by taking the mean of the first 0.1% of pixels in the degraded image I based on the median norm.
[0093] Step 6, using the scattering rate map The descattering map J of the scene is obtained by solving for the ambient light value A, and is as follows:
[0094]
[0095] Here, ω∈(0,1] serves as a constant parameter factor, and ξ is used to prevent the denominator from being too small. Specific Implementation Example 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 with an FPGA+ARM architecture, using the ZYNQ7020 chip. The specific implementation steps are as follows:
[0099] Step 1: The degraded image is stored in a secure digital card (SD card). The ARM side initializes the SD card and writes the image data into the DDR3 buffer.
[0100] Step 2: Use Direct Memory Access (DMA) to read the image data from the DDR3 buffer, pass it to the image descattering algorithm module for processing, and output the clear image after descattering.
[0101] Step 3: The processed, descattered, clear image is processed by the HDMI display module, which includes the VDMA submodule for data transmission and buffering, the AXI-StreamtoVideo Out submodule for data encoding, and the DIVTransmitter submodule for converting the image data into a data format that can be output by the HDMI display device. Finally, the processed, clear image can be displayed on the monitor.
[0102] The above describes the entire process of an image descattering device based on rank-one prior according to the present invention. However, the above implementation process is not intended to limit the present invention. Those skilled in the art can make corresponding improvements without departing from the present invention. The scope of protection of the present invention shall be determined by the scope defined in the claims.
[0103] To verify the effectiveness of this invention in image descattering, five real-world outdoor scene images taken in foggy weather were selected as a 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 as follows: Figure 3 As shown in the comparison results, the method of the present invention has a better dehazing effect than the CLAHE and CAP methods, has a greater advantage in color correction than the DCP method, and removes the artifact problem of near-field targets compared with the traditional ROP method, resulting in better visual effects.
[0104] In addition to intuitive comparisons, this invention employs three no-reference evaluation metrics—Standard Deviation (STD), Natural Image Quality Evaluator (NIQE), and Perception-based Image Quality Evaluator (PIQE)—and four full-reference evaluation metrics—Mean-Square Error (MSE), Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM), and Feature Similarity (FSIM)—to quantitatively analyze different algorithms. STD measures image contrast; NIQE and PIQE describe the naturalness of the image; MSE, PSNR, SSIM, and FSIM use haze-free images as reference images, with higher values indicating better dehazing performance. Testing was conducted on the O-HAZY dataset, selecting 20 pairs of hazy-clear images. Different dehazing methods were used to process the hazy images, and the average quantitative results for each evaluation metric were calculated, as shown in Table 1. The optimal results for each evaluation metric are indicated in bold. The data results show that the method of this invention exhibits the best performance across multiple evaluation metrics.
[0105] Table 1. Average quantitative results of evaluation metrics for each dehazing algorithm on the O-HAZY dataset.
[0106]
[0107] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any improvements made using the inventive concept and technical solution of the present invention, or direct application to other occasions without modification, are all within the protection scope of the present invention.
Claims
1. An image descattering method based on rank-one prior, characterized in that, Includes the following steps: S1. Utilizing the acquired degraded images Solving for uniform spectral values ; Unified spectral values The calculation method is as follows: Calculate the histograms of the three color channels (RGB) of the degraded image separately, sort them from highest to lowest pixel count, and unify the spectral values. The calculation formula is: ; in, Represented as an integer from 0 to 255; This represents the sorted pixel values; This represents the pixel value with the most pixels. This represents the pixel value with the fewest pixels. Indicating histogram statistics The corresponding number of pixels; and These represent the number of pixels involved in the calculation and the total number of pixels in the image, respectively. The adjustable parameter represents the range of the number of pixels involved in the calculation; Using dark channel constraint to improve uniform spectral values The accuracy of the calculation results is determined by the following formula: ; in, This represents the critical value for dark channel constraints. S2. Use uniform spectral values The transmittance map was obtained by solving the problem. And optimize it; The specific process is as follows: S21. Solve for the normalized form of the unified spectral values. ,for: ; S22. Utilizing normalized uniform spectral values With degraded images Solving the initial scattering rate map ,for: ; S23. Initialize the scattering map using the minimum perceptible window function. The judgment is made using the following expression: ; in, Represents a center coordinate as The size is The window; This represents the color threshold, with a value of [value missing]. ; 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 by a sharpening filter; otherwise, the mean filter is used. S24. Execute step S23 until all pixels have been processed to obtain the final optimized scattering map. ; S3. Using the optimized transmittance map Estimated ambient light values in the image ; S4. Using a transmittance graph and ambient light value The descattering map of the scene is calculated. .
2. The image descattering method based on rank-one prior according to claim 1, characterized in that, The histogram calculation operation is implemented using a dual-port BRAM, and the specific process is as follows: The BRAM address range is set from 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 incremented by 1 and then rewritten to the memory at the same address. By pre-judging whether there are duplicate grayscale value operations, the counting abnormality caused by the consecutive appearance of the same pixel is resolved. After the entire image processing is completed, the statistical values of grayscale values from 0 to 255 are read out sequentially, and the read address space is cleared to prepare for the histogram statistics of the next frame image.
3. The image descattering method based on rank-one prior according to claim 2, characterized in that, The histogram results are sorted using a radix sorting method based on FIFO. The specific process is as follows: P1. Construct 16 FIFO sequences with a data width equal to the sum of the total pixel width of the image and the width of the grayscale label, and a depth of 256, numbered from 0 to 15. P2. Represent the histogram statistical results in hexadecimal, starting from the least significant digit, and put the statistical results and grayscale value labels into the corresponding FIFO. P3. Repeat step P2 until the highest bit is completed; P4. Starting from FIFO number 15 and ending at FIFO number 0, data is extracted from each FIFO in sequence to obtain a descending order result.
4. The image descattering method based on rank-one prior according to claim 1, characterized in that, In step S3, by selecting a scattering rate map The top 0.1% of pixels in the median norm in the degraded image The ambient light value is calculated from the mean value of the values. .
5. 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 ambient light value The descattering map of the scene is obtained by solving. The formula is: ; in, As a constant parameter factor; Its purpose is to prevent the denominator from being too small.
6. An image descattering device based on rank-one prior, used to implement the image descattering method based on any one of claims 1-5, 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 acquire images to be processed from an external storage unit or a camera. The image descattering algorithm module is used to restore degraded images to clear images. The HDMI display module is used to present the processed clear image data as a visual image.