Image processing method and device

By calculating the upper and lower bounds of the infrared image detail layer and replacing the abnormal points, and combining the edge-keeping smoothing filter to separate the background layer, the problem of excessive storage resource consumption during FPGA implementation is solved, and resource saving and image quality improvement are achieved.

CN114066756BActive Publication Date: 2025-01-17BEIJING XIAOXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111354931.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-16
Publication Date
2025-01-17
Estimated Expiration
2041-11-16

AI Technical Summary

Technical Problem

The existing infrared image digital detail enhancement technology occupies a large amount of on-chip storage resources when implemented in FPGA, resulting in excessive consumption of storage resources.

Method used

By obtaining the detail layer of the infrared image in the previous frame, calculating the square mean of all its pixel grayscale values ​​and square it, determining the upper and lower bounds of the detail layer, replacing the pixels with grayscale values ​​greater than or less than these boundaries in the infrared image in the infrared image in the current frame, value, reduce storage resource consumption, and use edge-keeping smoothing filter to separate background and detail layers.

Benefits of technology

It effectively reduces the consumption of FPGA storage resources, removes grayscale abnormal points in the detail layer, improves the resource utilization rate of image processing, and maintains the contrast and detail quality of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114066756B_ABST
    Figure CN114066756B_ABST
Patent Text Reader

Abstract

The present invention discloses an image processing method, including: obtaining an infrared image of the previous frame of the current frame of the infrared image; obtaining the detail layer of the previous frame of the infrared image, calculating the mean of the squares of the grayscale values ​​of all pixels, and taking a square root to obtain a square root value; multiplying the square root value by a first proportional coefficient and a second proportional coefficient respectively, as the upper and lower bounds of the detail layer of the previous frame of the infrared image; obtaining the detail layer of the current frame of the infrared image, replacing the grayscale values ​​of all pixels whose grayscale values ​​are greater than the upper bound with the upper bound, and replacing the grayscale values ​​of pixels whose grayscale values ​​are less than the lower bound with the lower bound. The present invention also provides an image processing device. The present invention can effectively reduce the occupation of storage resources when implementing FPGA.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to image processing, and more particularly to infrared image digital detail enhancement technology. Background Art

[0002] The details of infrared images are represented by small signal changes, so high analog-to-digital conversion accuracy is required to ensure accurate signal acquisition. However, existing display devices are all 8-bit, which means that infrared images need to be processed by image dynamic range compression algorithms when displayed on the display to avoid losing a lot of detail information during bit conversion, causing performance degradation. Among the existing dynamic range compression technologies, digital detail enhancement technology can enhance the contrast and details of the image while compressing the dynamic range, which can effectively improve the display quality of infrared images.

[0003] The basic idea of ​​digital detail enhancement technology is to divide the original image into a background layer and a detail layer, then process the background layer and the detail layer separately, and finally merge the background layer and the detail layer again. The existing processing of the detail layer requires the use of histogram statistics, but it occupies a large amount of on-chip storage resources when implemented in FPGA. Therefore, it is urgent to design a technical solution that can overcome the above defects to a certain extent. Summary of the invention

[0004] An object of the present invention is to provide an image processing method and device, which can effectively reduce the occupation of storage resources when implemented in FPGA.

[0005] In order to achieve these purposes and other advantages of the present invention, according to one aspect of the present invention, the present invention provides an image processing method, including: obtaining an infrared image frame previous to a current infrared image frame; obtaining a detail layer of the infrared image frame previous, calculating the mean of the squares of grayscale values ​​of all pixels, and taking a square root to obtain a square root value; multiplying the square root value by a first proportional coefficient and a second proportional coefficient, respectively, as an upper bound and a lower bound of the detail layer of the infrared image frame previous; obtaining the detail layer of the infrared image frame current, replacing the grayscale values ​​of all pixels whose grayscale values ​​are greater than the upper bound with the upper bound, and replacing the grayscale values ​​of pixels whose grayscale values ​​are less than the lower bound with the lower bound.

[0006] Furthermore, the method for obtaining the detail layer of the previous infrared image includes: filtering the previous infrared image with a filter to obtain a background layer, and then subtracting the background layer from the previous infrared image, wherein the grayscale value of the detail layer of the previous infrared image is the difference between the grayscale value of the previous infrared image and the grayscale value of the background layer.

[0007] Furthermore, the filter is an edge-preserving smoothing filter.

[0008] Furthermore, the method for calculating the square root value includes: using an accumulator to perform cumulative counting in sequence, and obtaining counting results and squares of the counting results in sequence. When the square of the counting result is greater than the mean of the squares of all pixel grayscale values, the corresponding counting result is used as the square root value.

[0009] Furthermore, the first proportional coefficient and the second proportional coefficient are 2.5 to 3.5 and -2.5 to -3.5 respectively.

[0010] Furthermore, the method for obtaining the detail layer of the current frame infrared image includes: filtering the current frame infrared image with a filter to obtain a background layer, and then subtracting the background layer from the current frame infrared image.

[0011] Furthermore, the filter is an edge-preserving smoothing filter.

[0012] Furthermore, the method further includes: fusing the detail layer after grayscale value replacement with the background layer to obtain an output image.

[0013] Furthermore, the image processing method is implemented in an FPGA chip.

[0014] According to another aspect of the present invention, an image processing device is provided, comprising: an FPGA chip storing executable instructions and configured to execute the executable instructions to perform the image processing method.

[0015] The present invention has at least the following beneficial effects:

[0016] The present invention first determines the upper and lower bounds of the detail layer of the previous frame of infrared image, and then processes the detail layer of the current frame of infrared image according to the upper and lower bounds, which can effectively remove points with particularly large and small grayscale values ​​in the detail layer and reduce the consumption of FPGA storage resources.

[0017] Other advantages, objectives and features of the present invention will be embodied in part through the following description, and in part will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0019] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.

[0020] It should be understood that the terms such as “having”, “including” and “comprising” used herein do not exclude the existence or addition of one or more other elements or combinations thereof.

[0021] like Figure 1 As shown, an embodiment of the present application provides an image processing method, comprising:

[0022] S1. Obtain the previous infrared image frame of the current infrared image frame. The current infrared image frame and its previous infrared image frame can be obtained from the infrared video.

[0023] S2, obtaining the detail layer of the previous infrared image, calculating the mean of the squares of all pixel grayscale values, and taking the square root to obtain the square root value. The detail layer of the previous infrared image can be obtained by using the existing technology, and the square root value can be calculated;

[0024] S3, multiplying the square root value by a first proportional coefficient and a second proportional coefficient respectively, as the upper and lower bounds of the detail layer of the previous frame of infrared image, the first proportional coefficient and the second proportional coefficient are determined according to actual experience or statistical results, after multiplying the square root value by the first proportional coefficient and the second proportional coefficient, it is possible to determine a range defined by the upper and lower bounds, within which no abnormal points with particularly large or small grayscale values ​​will appear;

[0025] S4. Obtain the detail layer of the infrared image of the current frame, replace the grayscale values ​​of all pixels whose grayscale values ​​are greater than the upper bound with the upper bound, and replace the grayscale values ​​of pixels whose grayscale values ​​are less than the lower bound with the lower bound. For the infrared image of the current frame, the upper bound and the lower bound are used to replace the points whose grayscale values ​​are greater than the upper bound and the points whose grayscale values ​​are less than the lower bound, respectively, so that abnormal points with particularly large or small grayscale values ​​will not appear in the detail layer, thereby reducing the consumption of FPGA storage resources.

[0026] In some other embodiments, the method for obtaining the detail layer of the previous infrared image includes: filtering the previous infrared image with a filter to obtain a background layer, and then subtracting the background layer from the previous infrared image, wherein the gray value of the detail layer of the previous infrared image is the difference between the gray value of the previous infrared image and the gray value of the background layer, that is, the gray value of the detail layer has positive and negative values. The specific implementation method may be: first, use an edge-preserving smoothing filter Filter to filter the previous original infrared image I k-1 Filter to get the background layer bg k-1 ; Then use the previous frame of original infrared image I k-1 Subtract the background layer bg k-1 , get the detail layer dt k-1 ,Right now

[0027] bg k-1 =Filter(I k-1 ) (0)

[0028] dt k-1 =I k-1 -bgk-1 (1)

[0029] Calculate detail layer dt k-1 The mean of the squared gray values ​​of all pixels Right now

[0030]

[0031] Among them, x and y are the position coordinates; wid and hei are the width and height of the detail layer.

[0032] In some other embodiments, the filter is an edge-preserving smoothing filter.

[0033] In other embodiments, the calculation method of the square root value includes: using an accumulator to perform cumulative counting in sequence, and obtaining counting results and the square of the counting results in sequence, and when the square of the counting result is greater than the average of the squares of all pixel gray values, the corresponding counting result is used as the square root value. That is, using an accumulator to perform cumulative counting S, comparing the square of the accumulator result S 2 and When S 2 Greater than hour, The square root result σ' k-1 It can be represented by S. Compared with other algorithms, the method of using accumulators obviously saves more computing resources.

[0034] In some other embodiments, the first proportional coefficient and the second proportional coefficient are 2.5 to 3.5 and -2.5 to -3.5 respectively, that is, the upper limit H of the detail layer is calculated. k-1 and the lower bound L k-1 , given by

[0035] H k-1 = mσ' k-1 (3)

[0036] L k-1 =-mσ' k-1 (4)

[0037] Among them, m is the proportional coefficient, which is 2.5 to 3.5. 2.5 to 3.5 is an empirical coefficient, under which the grayscale value in the detail layer is within a normal fluctuation range.

[0038] In some other embodiments, the method for obtaining the detail layer of the current frame infrared image includes: filtering the current frame infrared image using a filter to obtain a background layer, and then subtracting the background layer from the current frame infrared image. k Filter to get the background layer bg k ; Then use the current frame original infrared image Ik Subtract the background layer bg k , get the detail layer dt k ,Right now

[0039] bg k =Filter(I k ) (5)

[0040] dt k =I k -bg k (6)

[0041] Traverse the detail layer dt k , the gray value is greater than H k-1 The setting is H k-1 , the gray value is less than L k-1 The setting is L k-1 ,Right now

[0042]

[0043] In some other embodiments, the filter is an edge-preserving smoothing filter. Commonly used edge-preserving smoothing filters include guided filtering, bilateral filtering, and the like.

[0044] In some other embodiments, the method further includes: fusing the detail layer whose grayscale value has been replaced with the background layer to obtain an output image. Existing fusion methods may be used, and the output image obtained after fusion has good contrast and details.

[0045] In other embodiments, the image processing method is implemented in an FPGA chip.

[0046] An embodiment of the present application also provides an image processing device, including: an FPGA chip, which stores executable instructions and is configured to execute the executable instructions to perform the image processing method.

[0047] In order to reflect the advantage of the algorithm of this application in terms of the amount of resources occupied, the algorithm of this application is compared with the prior art. The prior art uses the method of performing grayscale value statistics on the image, filtering out the maximum 1% and the minimum 1% after statistics, and using the values ​​of these two points as the upper and lower limits of the detail layer. The comparison results are shown in Table 1

[0048] Table 1

[0049]

[0050] After using this application to perform upper and lower bound statistics, the storage resources are reduced by 8 36K BRAMs, accounting for 7.6% of the currently used boards, and 591 more LUT6 resources are used to build the calculation logic program of this application, accounting for 1.2% of the currently used boards. It can be seen that the number of computing units used in this algorithm is slightly increased, but compared with the statistical method for upper and lower bound calculations, 7% of storage resources can be saved. This algorithm can save a lot of storage resources for actual projects and save a lot of storage space for image processing algorithms.

[0051] The number of devices and processing scales described here are used to simplify the description of the present invention. Applications, modifications and variations of the image processing method of the present invention are obvious to those skilled in the art.

[0052] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. An image processing method, characterized in that: include: Get the previous infrared image frame of the current infrared image frame; Obtaining the detail layer of the previous frame of infrared image, calculating the mean of the squares of the grayscale values ​​of all pixels, and taking the square root to obtain the square root value; The square root value is multiplied by a first proportionality coefficient and a second proportionality coefficient respectively to serve as an upper bound and a lower bound of a detail layer of the previous frame of infrared image; Acquire the detail layer of the infrared image of the current frame, replace the grayscale values ​​of all pixels whose grayscale values ​​are greater than the upper limit with the upper limit, and replace the grayscale values ​​of all pixels whose grayscale values ​​are less than the lower limit with the lower limit; The method for obtaining the detail layer of the previous infrared image comprises: filtering the previous infrared image with a filter to obtain a background layer, and then subtracting the background layer from the previous infrared image, wherein the gray value of the detail layer of the previous infrared image is the difference between the gray value of the previous infrared image and the gray value of the background layer; The method for obtaining the detail layer of the current frame infrared image includes: filtering the current frame infrared image with a filter to obtain a background layer, and then subtracting the background layer from the current frame infrared image; The first proportional coefficient and the second proportional coefficient are 2.5~3.5 and -2.5~-3.5 respectively; The method also includes: fusing the detail layer replaced with grayscale values ​​with the background layer to obtain an output image.

2. The image processing method according to claim 1, characterized in that: The filter is an edge-preserving smoothing filter.

3. The image processing method according to claim 1, characterized in that: The calculation method of the square root value includes: using an accumulator to perform cumulative counting in sequence, and obtaining counting results and the squares of the counting results in sequence. When the square of the counting result is greater than the mean of the squares of all pixel grayscale values, the corresponding counting result is used as the square root value.

4. The image processing method according to any one of claims 1 to 3, characterized in that: The image processing method is implemented in an FPGA chip.

5. An image processing device, characterized in that include: An FPGA chip stores executable instructions and is configured to execute the executable instructions to perform the image processing method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Infrared chart digital signal processing system and method

    CN102413283A

  • Airborne photoelectric infrared digital image processing method and apparatus thereof

    CN106683056A