Infrared image processing method and device, electronic equipment and storage medium
By chunking processing and similarity calculation on infrared images, the degree of interference of infrared image background on infrared object detection is evaluated, and the problem of difficulty in evaluating infrared image background interference in the prior art is solved, and the accuracy and stability of infrared object detection is improved.
Patent Information
- Application Number
- CN202411935187.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-27
AI Technical Summary
The prior art is difficult to effectively evaluate the degree of interference of infrared image backgrounds for different types and application purposes on infrared object detection.
By chunking the infrared image, the similarity degree and area weight of each image sub-block and the target area are calculated, and the global background interference parameter is obtained to quantify the degree of interference of the infrared image background on the infrared target.
Quantitative evaluation of the degree of interference of infrared image background on infrared object detection is achieved, and the accuracy and stability of infrared object detection is improved.
Smart Images

Figure CN120047462A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of thermal imaging testing, and particularly relates to a method and device for processing infrared images, an electronic device, and a storage medium. Background Art
[0002] An infrared image is the final output result of an infrared imaging system, and the quality of the infrared image is an important indicator determining the performance of the infrared imaging system. Infrared target detection refers to using theories and methods such as image processing and pattern recognition to determine whether a target exists in an infrared image and to determine the position of the target. Therefore, the background of the infrared image will have a certain impact on the search for infrared targets. In related technologies, only specific interference factors that affect the target search in the background can be determined, and it is not possible to determine the impact of infrared image backgrounds of different types and different application purposes on the target search. Summary of the Invention
[0003] In a first aspect, an embodiment of the present invention provides a method for processing an infrared image, and the method for processing the infrared image includes:
[0004] Obtain an infrared image, and obtain a target area where an infrared target is located according to the infrared image;
[0005] Perform block processing on the infrared image to divide the infrared image into a plurality of image sub-blocks;
[0006] Obtain the similarity degree between each image sub-block in the plurality of image sub-blocks and the target area;
[0007] Obtain the area weight of each image sub-block in the plurality of image sub-blocks relative to the target area;
[0008] According to the similarity degree and the area weight, obtain a global background interference degree parameter;
[0009] According to the global background interference degree parameter, obtain the interference degree of the background of the infrared image on the infrared target.
[0010] In a second aspect, an embodiment of the present invention provides a processing device for infrared images, including: an infrared target annotation module, an infrared target adaptive segmentation module, a similarity degree calculation module, and a region weight calculation module. The infrared target annotation module is used to obtain the target region where the infrared target is located according to the infrared image; the infrared target adaptive segmentation module is used to perform block processing on the infrared image to segment the infrared image into a plurality of image sub-blocks; the similarity degree calculation module is used to obtain the similarity degree between each image sub-block in the plurality of image sub-blocks and the target region; the region weight calculation module is used to obtain the area weight of each image sub-block in the plurality of image sub-blocks relative to the target region; according to the similarity degree and the area weight, obtain a global background interference degree parameter; according to the global background interference degree parameter, obtain the interference degree of the background of the infrared image on the infrared target.
[0011] In a third aspect, an embodiment of the invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the infrared image processing method in the first aspect are implemented.
[0012] In a fourth aspect, an embodiment of the invention provides a storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the infrared image processing method in any of the above embodiments are implemented.
[0013] The beneficial effects brought by the present invention are as follows:
[0014] As can be seen from the above solution, an embodiment of the present invention provides a processing method for infrared images. The global background interference degree parameter can be used as a quantization index, so that the global background interference degree parameter can evaluate the interference degree of the background of the infrared image on the infrared target. When the global background interference degree parameter is low, it means that the background of the infrared image is relatively clean and the infrared target is easy to be retrieved; when the global background interference degree parameter is high, it means that there are many target-like regions similar to the target in the background of the infrared image, which may make it difficult to detect the target region. Therefore, this application calculates the similarity of each part of the image, and finally obtains a global background interference degree parameter that can reflect the global image quality of the infrared target, so that the interference of the image background on the infrared target detection can be determined according to the size of the global background interference degree parameter. In the task of infrared target detection, the parameters or strategies of the detection algorithm can be adjusted through the global background interference degree parameter to improve the accuracy and stability of infrared target detection. Description of the Drawings
[0015] Figure 1 It represents a flowchart of a processing method for infrared images according to an embodiment of the present invention;
[0016] Figure 2Schematic diagram showing the infrared image of an embodiment of the present invention;
[0017] Figure 3 One of the flowcharts showing the calculation of the global background interference degree parameter of an embodiment of the present invention;
[0018] Figure 4 Another flowchart showing the calculation of the global background interference degree parameter of an embodiment of the present invention;
[0019] Figure 5 One of the UAV infrared image samples of an embodiment of the present invention;
[0020] Figure 6 Another UAV infrared image sample of an embodiment of the present invention;
[0021] Figure 7 Another UAV infrared image sample of an embodiment of the present invention;
[0022] Figure 8 Another UAV infrared image sample of an embodiment of the present invention;
[0023] Figure 9 Schematic block diagram showing a processing device for an infrared image of an embodiment of the present invention;
[0024] Figure 10 Schematic block diagram showing an electronic device of an embodiment of the present invention.
[0025] Figure 9 and Figure 10 In, the corresponding relationship between the reference numerals and the component names is as follows:
[0026] 300 Processing device for infrared image, 310 Infrared target annotation module, 320 Infrared target adaptive segmentation module, 330 Similarity degree calculation module, 340 Region weight calculation module, 400 Electronic device, 410 Memory, 420 Processor. Detailed implementation manners
[0027] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0028] In some embodiments of the present invention, a method for processing an infrared image is proposed. As Figure 1 shown, the method for processing an infrared image includes:
[0029] S102, obtain an infrared image, and obtain a target area where an infrared target is located according to the infrared image;
[0030] S104, perform block processing on the infrared image to divide the infrared image into multiple image sub-blocks;
[0031] S106, obtain the similarity degree between each image sub-block in the multiple image sub-blocks and the target area;
[0032] S108, obtain the area weight of each image sub-block in the multiple image sub-blocks relative to the target area;
[0033] S110, obtain a global background interference degree parameter according to the similarity degree and the area weight;
[0034] S112, obtain the interference degree of the background of the infrared image on the infrared target according to the global background interference degree parameter.
[0035] In this embodiment, an infrared image is acquired, and a target area where the infrared target is located is obtained according to the infrared image, so that the position of the infrared target in the infrared image can be marked to determine the target area for subsequent processing. The infrared image is processed in blocks to divide the infrared image into multiple image sub-blocks. By dividing the infrared image into multiple small parts, the processing difficulty of the infrared image can be reduced. The similarity degree between each image sub-block in the multiple image sub-blocks and the target area is obtained, and it can be determined whether there are features similar to the infrared target in each image sub-block. The area weight of each image sub-block in the multiple image sub-blocks relative to the target area is obtained, and the proportion of the area of each image sub-block can be determined. According to the similarity degree and the area weight, the InterferenceDegree of Global Background (IDGB) parameter is obtained. According to the global background interference degree parameter, the interference degree of the background of the infrared image on the infrared target is obtained, so that the global background interference degree parameter can be used as a quantization index, and further the global background interference degree parameter can evaluate the interference degree of the background of the infrared image on the infrared target. When the global background interference degree parameter is low, it indicates that the background of the infrared image is relatively clean and the infrared target is easy to be retrieved; when the global background interference degree parameter is high, it indicates that there are many target-like regions similar to the target in the background of the infrared image, which may make it difficult to detect the target area. Therefore, in this application, by calculating the similarity of each part of the image, the global background interference degree parameter reflecting the global image quality of the infrared target is finally obtained, so that the interference of the image background on the infrared target detection can be determined according to the size of the global background interference degree parameter. In the task of infrared target detection, the parameters or strategies of the detection algorithm can be adjusted through the global background interference degree parameter to improve the accuracy and stability of infrared target detection. It is possible to determine the global background interference degree parameters of all infrared images of different types and different application purposes at the same time.
[0036] The processing method of the infrared image in this application is mainly used for the infrared target detection task. Infrared target detection refers to using theories and methods such as image processing and pattern recognition to judge whether a target exists in the infrared image and determine the position of the target. The general process of infrared target detection is as follows: First, all suspected target areas are listed in the infrared image; then it is judged whether there is a target in these suspected target areas; finally, for the local area where the target is located, it is judged whether each pixel belongs to the target or the background, that is, the target is accurately positioned. In this application, the parameters or strategies of the detection algorithm are adjusted through the global background interference degree parameter to improve the accuracy and stability of infrared target detection.
[0037] Through the method for processing infrared images of the present application, the global background interference degree parameter in the infrared image can be determined, and the global background interference degree parameter can determine the interference degree of the background in the infrared image on the infrared target, that is, the influence of the "target-like region" in the infrared image background on the correct positioning of the target region, so as to determine the quality of the infrared image. On the one hand, the infrared image is the final output result of the infrared imaging system, and the infrared image quality is an important indicator determining the performance of the infrared imaging system. On the other hand, the infrared image is mainly used to complete a specific task, such as image segmentation, target detection, image restoration, target tracking and other related image processing algorithms. Therefore, establishing and improving the infrared image quality evaluation method is a prerequisite for evaluating the effectiveness, completeness, and robustness of the infrared image processing algorithm. Through the global background interference degree parameter, the present application can determine the interference degree of the background in the infrared image on the infrared target, thereby judging the quality of the infrared image, further optimizing the parameters of the image algorithm, improving the algorithm performance, quantitatively evaluating the performance of the infrared image processing algorithm, determining the applicable range of the algorithm, shortening the research and development cycle of the image processing algorithm, and being of great significance to promoting the development of the infrared image processing technology.
[0038] In some embodiments, optionally, obtaining an infrared image and obtaining a target region where an infrared target is located according to the infrared image includes: obtaining a first region where the infrared target is located in the infrared image; and obtaining the target region where the infrared target is located according to the first region, the area of the target region being larger than the area of the first region, and the first region being located within the target region, and the region between the first region and the target region being a local background region.
[0039] In this embodiment, the first region where the infrared target is located in the infrared image is obtained, so that the first region containing the infrared target can be quickly determined in the infrared image. According to the first region, the target region where the infrared target is located is obtained, the area of the target region being larger than the area of the first region, and the first region being located within the target region, so as to obtain the target region, and the area of the target region being larger than the area of the first region, so that the infrared target can be completely located within the target region. The region between the first region and the target region is a local background region, so as to determine the local background region, which is convenient for subsequent calculation of the similarity degree.
[0040] In some embodiments, optionally, the first region is the smallest circumscribed rectangle centered on the infrared target and enclosing the infrared target; the target region includes the infrared target and is a rectangular region with an area twice that of the smallest circumscribed rectangle.
[0041] In this embodiment, the first region is the smallest circumscribed rectangle centered on the infrared target and enclosing the infrared target, so as to accurately locate the position and shape of the infrared target in the infrared image. The smallest circumscribed rectangle provides a compact and accurate bounding box, which is convenient for distinguishing the target and the background. The target region includes the infrared target and is a rectangular region with an area twice that of the smallest circumscribed rectangle, so as to determine the target region, so that the target region not only includes the infrared target, but also includes background information, because the similarity degree is determined according to the background information subsequently.
[0042] Obtain an infrared image, and obtain the target region where the infrared target is located according to the infrared image, which is to mark the position of the infrared target in the infrared image. The infrared target detection will complete the following three tasks: determine whether there is a relevant target in the infrared image; determine the specific position of the relevant target in the infrared image; judge whether each pixel belongs to the target or the background from the local region where the target is located. During the target search and detection (locating the region where the target is located) process, the position of the target is unknown, and the actual scene often contains "quasi-target regions". The so-called "quasi-target region" refers to a region that is similar to the target but is not the target. As the number of "quasi-target regions" increases, the difficulty of locating the target increases, and the difficulty even causes a wrong judgment of the region where the target is located. Therefore, the performance of target search and detection is mainly affected by the global background. It can be concluded that the performance of target search and detection is affected by three factors: the regions with different scene contents in the background have different effects on the detection performance; the greater the similarity between the background region and the target region, the stronger the interference; the larger the area of the background region similar to the target region, the stronger the interference.
[0043] Specifically, as Figure 2 shown, define the target region: taking the target T as the center, the smallest circumscribed rectangle enclosing the target is MR, and the rectangular region containing the target and having an area twice that of the smallest circumscribed rectangle MR is TR, and the centers of the rectangular regions MR and TR are the same, and the aspect ratio is the same. Then the local background region L where the target is located can be defined as the part of the rectangular region TR excluding the smallest circumscribed rectangle MR of the target.
[0044] In some embodiments, optionally, perform multiple block processing on the infrared image to divide the infrared image into multiple image sub-blocks, including: performing multiple block processing on the infrared image; stopping dividing the infrared image when the mean square error of each image sub-block is less than the mean square error of the target region, or the area of each image sub-block is less than the area of the target region. The divided infrared image includes multiple image sub-blocks.
[0045] In this embodiment, the infrared image is processed by block division multiple times, that is, the block division of the infrared image is repeated. When the mean square error of each image sub-block is less than the mean square error of the target area, or the area of each image sub-block is less than the area of the target area, the segmentation of the infrared image is stopped, so as to segment the infrared image into multiple different image sub-blocks. The larger image sub-blocks mainly contain flat areas, and the smaller image sub-blocks mainly contain details such as contours and edges, so that the information in each image sub-block can be accurately analyzed subsequently.
[0046] Specifically, when segmenting the infrared image, different regions in the background are divided according to the image frequency components, so as to segment the infrared image into multiple image sub-blocks.
[0047] In some embodiments, optionally, obtaining the similarity degree between each image sub-block and the target area in multiple image sub-blocks includes: obtaining the first hash value between the target area and the gray-scale features of each image sub-block; obtaining the second hash value between the local background area and the gray-scale features of each image sub-block; and obtaining the similarity degree according to the first hash value and the second hash value.
[0048] In this embodiment, the first hash value between the target area and the gray-scale features of each image sub-block is obtained, and the second hash value between the local background area and the gray-scale features of each image sub-block is obtained; the similarity degree is obtained according to the first hash value and the second hash value, that is, by calculating the hash values between the target area, the local background area and each image sub-block, a numerical similarity index can be obtained, so as to determine the similarity degree between each image sub-block and the target area.
[0049] In some embodiments, as Figure 3 and Figure 4 shown, the processing method of the infrared image includes: segmenting according to the obtained infrared target. Different regions in the background are divided according to the image frequency components; then, the similarity degree between each image sub-block and the target area TR is calculated; finally, the area weight of each image sub-block is calculated; according to the similarity degree and the area weight, the global background interference degree parameter corresponding to each image sub-block is obtained, and the global background interference degree parameters of multiple image sub-blocks are summed to obtain the global background interference degree parameter of the whole infrared image, that is, the IDGB index.
[0050] Specifically, as Figure 3 shown, the processing method of the infrared image includes:
[0051] S202, perform adaptive block division on the infrared image;
[0052] S204, determine whether to continue block division. If so, execute S202; if not, execute S206;
[0053] S206, calculate the similarity between the image sub-block and the target area;
[0054] S208, calculate the area weight of the image sub-block;
[0055] S210, obtain the IDGB metric.
[0056] In Figure 3 , in the case of N image sub-blocks, obtain the IDGB metric.
[0057] In Figure 4 , the infrared image is segmented into 7 image sub-blocks, and the corresponding similarities of the seven image sub-blocks are W 1 (1) = 0.346, W 1 (2) = 0.435, W 1 (3) = 0.370, W 1 (4) = 0.701, W 1 (5) = 0.663, W 1 (6) = 0.400, W 1 (7) = 0.338; the corresponding area weights of the seven image sub-blocks are W 2 (1) = 0.02, W 2 (2) = 0.02, W 2 (3) = 0.01, W 2 (4) = 0.01, W 2 (5) = 0.005, W 2 (6) = 0.005, W 2 (7) = 0.005, and IDGB = 0.033 is obtained.
[0058] Specifically, obtain the similarity between each image sub-block in multiple image sub-blocks and the target area, and then obtain a quantified value, which can measure the difference between each image area and the target area.
[0059] Specifically, the first hash value represents the difference between the hash value of the target area and the hash value of the gray-scale feature of the image sub-block; the second hash value represents the difference between the hash value of the background area and the hash value of the gray-scale feature of the image sub-block.
[0060] The specific calculation steps of the hash value are as follows:
[0061] (1) Resize: pHash (perceptual Hash algorithm) also operates on small pictures. The preferred size is set to 32 pixels × 32 pixels. The purpose of this is to simplify the calculation of DCT (Discrete Cosine Transform), and the picture frequency does not decrease accordingly.
[0062] (2) Simplify the color: Convert the picture into a grayscale image to further reduce the computational amount.
[0063] (3) Calculate the DCT: Perform DCT transformation on the picture to obtain a 32×32 DCT coefficient matrix.
[0064] (4) Reduce the DCT: The result of DCT is a 32×32 matrix. Only keep the 8×8 matrix in the upper left corner because this part contains the most information. Therefore, only this part is needed.
[0065] (5) Calculate the average value: Add up the DCT coefficients and then calculate the mean value of the DCT.
[0066] (6) Calculate the pHash value: Based on the 8×8 DCT matrix, set those greater than or equal to the DCT mean value to "1" and those less than the DCT mean value to "0" to obtain a 64-bit pHash value consisting of 0s or 1s.
[0067] In some embodiments, optionally, the calculation formula for the global background interference degree parameter is:
[0068]
[0069] where IDGB is the global background interference degree parameter, W 1 (i) is the similarity degree between the i-th image sub-block and the target area, w 2 (i) is the area weight of the i-th image sub-block.
[0070] In this embodiment, through the above formula, the global background interference degree parameter can be determined by the similarity degree between the image sub-block and the target area and the area weight of the image sub-block, so that the interference degree of the background of the infrared image on the infrared target can be determined according to the value of the global background interference degree parameter. The minimum value of the global background interference degree parameter is 0, indicating that there is no "quasi-target area" in the image background and there is no interference to the correct positioning of the target area; the larger the value of the global background interference degree parameter, the greater the impact of the "quasi-target area" in the image background on the correct positioning of the target area and the worse the quality of the infrared target image.
[0071] Compared with the infrared image quality evaluation algorithms in the related technologies, the infrared image processing method of this application uses the pHash algorithm to calculate the similarity of each part of the infrared image, and finally obtains the global image quality value of the infrared target, that is, the global background interference degree parameter. Compared with other algorithms, the global background interference degree parameter index proposed in this paper is more consistent with the actual situation. At the same time, the method proposed in this paper can also provide the specific reasons for the interference of the image background to the target detection, providing an accurate optimization direction for downstream image matching, image calibration, image tracking, etc.
[0072] In some embodiments, optionally, obtaining the area weight of each image sub-block relative to the target area includes: obtaining the area of each image sub-block; obtaining the area of the target area; and obtaining the area weight of each image sub-block according to the ratio of the area of each image sub-block to the area of the target area.
[0073] In this embodiment, obtaining the area of each image sub-block; obtaining the area of the target area; and obtaining the area weight of each image sub-block according to the ratio of the area of each image sub-block to the area of the target area to implement the calculation of the area weight of the image sub-block. By calculating the area weight of each image sub-block, the interference degree of the image background to the infrared target can be quantified, and the area weight helps to identify the background area with a greater interference to the infrared target.
[0074] Specifically, the infrared image is segmented to divide the infrared image into multiple image sub-blocks; an adaptive segmentation strategy can be adopted to divide different regions in the background according to the frequency components of the image. The method of adaptively segmenting the infrared image based on the mean square error: the contour, edge and other detail information in the infrared image change violently, while the flat area changes slowly; if there are more contour, edge and other detail components in the image area, the area has a larger mean square error; if the image area is a flat area, the area has a smaller mean square error. The specific segmentation process is as follows: the infrared image is divided into four equal parts, that is, the width and height are equally divided respectively, and this segmentation process is repeated until the mean square error of the image sub-block is less than the mean square error MSE (Mean Squared Error) of the target area TR, or the area of the image sub-block is less than the area ATR of the target area TR, then the algorithm ends. At this time, the infrared image is divided into different image sub-blocks, and the larger image sub-blocks mainly contain flat areas, and the smaller image sub-blocks mainly contain contour, edge and other detail information.
[0075] Specifically, obtaining the similarity degree between each image sub-block in the multiple image sub-blocks and the target area; the similarity degree between each image sub-block and the target area TR can be calculated according to the definition of the "quasi-target area".
[0076] According to the above definition of the "quasi-target region", it can be known that the greater the similarity degree between the image sub-block and the target T, and the smaller the similarity degree with the local background region L, the greater the interference of the image sub-block on the performance of the search and detection algorithm. The key to calculating the image similarity degree is to find a method that can effectively characterize the image information. At this time, the pHash method is used. Its core idea is to generate a hash value that can represent the fingerprint of the content by extracting the pHash features of the content. It has a certain robustness to common image transformations (such as scaling, compression, brightness adjustment); at the same time, the length of the hash value is fixed, and the calculation speed is fast, which is suitable for large-scale data processing. This method can be used to measure the similarity degree w1(i) between the i-th image sub-block and the target region, and the calculation method is as follows:
[0077] W 1 (i) = P Ti / (1 + P Li )
[0078] Where: P Ti , P Li respectively represent the pHash values between the target region TR, the local background L and the gray-scale features of the i-th image sub-block. By using the above specific calculation steps of the hash value, calculate the pHash value of the region TR where the target is located, the pHash value of the i-th image sub-block, and the pHash value of the local background L respectively. P Ti is obtained by taking the difference between the pHash value of the region TR where it is located and the pHash value of the i-th image sub-block, and P Li is obtained by taking the difference between the pHash value of the local background L and the pHash value of the i-th image sub-block.
[0079] Calculate the area weight W 2 (i) of each sub-block of the "quasi-target region", and the calculation method is as follows:
[0080] W 2 (i) = A Bi / A TR
[0081] Where A TR is the area of the target region TR, and A Bi is the area of the i-th image sub-block.
[0082] Calculate the final global background interference degree index IDGB:
[0083]
[0084] The minimum value of the global background interference degree IDGB is 0, indicating that there is no "target-like region" in the image background and there is no interference with the correct positioning of the region TR; the larger the value of the global background interference degree IDGB, the greater the impact of the "target-like region" in the image background on the correct positioning of the region TR, and the worse the quality of the infrared target image.
[0085] Specifically, to verify the effectiveness and accuracy of the global background interference degree index IDGB in evaluating the quality of infrared target images, 60 real infrared target images with a size of 256×256 pixels and different categories were selected for experiments. Since there is a large amount of experimental data, only Figures 5 to 8 the four representative real infrared images of drones shown in the figure are described in detail, and Table 2 shows the evaluation results.
[0086] Table 1 Evaluation results of the global background interference degree index for four typical images
[0087] a b c d IDGB 0.660 4.174 173.017 372.794
[0088] The four infrared images of drones were respectively selected with a pure sky background, a sky with clouds background, a city background, and a mountain forest background. It can be observed from Table 1 that a corresponds to Figure 5 , Figure 5 and has the smallest global background interference IDGB value of 0.660. At this time, the drone is in the sky without background interference; b corresponds to Figure 6 , Figure 6 and the background gradually becomes complex, and clouds begin to appear. At this time, the IDGB value gradually rises, indicating that the image quality gradually deteriorates; c corresponds to Figure 7 , Figure 7 and has strong global background interference (the IDGB value is 173.017). The reason for the difficulty in target detection in this image is the existence of a large number of background regions similar to the target, which in turn affects the correct positioning; d corresponds to Figure 8 , and the quality of the target area Figure 8 is the worst. The global interference background index of this image reaches 372.794, which means that there is a large amount of false target information in the global background during the target detection process.
[0089] Table 2 Evaluation results of different indexes for four typical images
[0090]
[0091]
[0092] Meanwhile, select the SNR (Signal-to-Noise Ratio), and conduct experiments using IDGB which does not use the pHash algorithm but instead uses the histogram estimation algorithm to verify the effectiveness of the infrared image processing method proposed in this paper. The test images selected are still Figures 5 to 8 the infrared images of drones shown. Table 2 shows the evaluation results. a corresponds to Figure 5 , b corresponds to Figure 6 , c corresponds to Figure 7 , d corresponds to Figure 8 , and
[0093] As Figure 9 shown, in an embodiment of the present application, a processing device 300 for infrared images is provided, including: an infrared target annotation module 310, an infrared target adaptive segmentation module 320, a similarity calculation module 330, and an area weight calculation module 340. The infrared target annotation module 310 is configured to obtain the target area where the infrared target is located according to the infrared image; the infrared target adaptive segmentation module 320 is configured to perform block processing on the infrared image to segment the infrared image into multiple image sub-blocks; the similarity calculation module 330 is configured to obtain the similarity between each image sub-block in the multiple image sub-blocks and the target area; the area weight calculation module 340 is configured to obtain the area weight of each image sub-block in the multiple image sub-blocks relative to the target area; obtain the global background interference degree parameter according to the similarity and the area weight; and obtain the interference degree of the background of the infrared image on the infrared target according to the global background interference degree parameter.
[0094] In this embodiment, the infrared target annotation module 310 is used to obtain the target area where the infrared target is located according to the infrared image, so as to annotate the position of the infrared target in the infrared image, thereby realizing the determination of the target area for subsequent processing. The infrared target adaptive segmentation module 320 is used to perform block processing on the infrared image to segment the infrared image into multiple image sub-blocks. By segmenting the infrared image into multiple small parts, the processing difficulty of the infrared image can be reduced. The similarity degree calculation module 330 is used to obtain the similarity degree between each image sub-block and the target area among the multiple image sub-blocks, and can determine whether there are features similar to the infrared target in each image sub-block. The area weight calculation module 340 is used to obtain the area weight of each image sub-block relative to the target area among the multiple image sub-blocks, and can determine the proportion of the area of each image sub-block. According to the similarity degree and the area weight, a global background interference degree parameter is obtained. According to the global background interference degree parameter, the interference degree of the background of the infrared image on the infrared target is obtained, so that the global background interference degree parameter can be used as a quantization index, and further the global background interference degree parameter can be used to evaluate the interference degree of the background of the infrared image on the infrared target. When the global background interference degree parameter is low, it indicates that the background of the infrared image is relatively clean and the infrared target is easy to be retrieved; when the global background interference degree parameter is high, it indicates that there are many target-like regions similar to the target in the background of the infrared image, which may make it difficult to detect the target area. Therefore, in this application, by calculating the similarity of each part of the image, a global background interference degree parameter that can reflect the global image quality of the infrared target is finally obtained, so that the interference of the image background on the infrared target detection can be determined according to the size of the global background interference degree parameter. In the task of infrared target detection, the parameters or strategies of the detection algorithm can be adjusted through the global background interference degree parameter to improve the accuracy and stability of infrared target detection.
[0095] As Figure 10 shown, in an embodiment of the present application, an electronic device 400 is provided, including a memory 410, a processor 420, and a computer program stored on the memory 410 and executable on the processor 420. When the processor 420 executes the program, the steps of the infrared image processing method in any of the above embodiments are implemented. Therefore, the electronic device 400 includes all the beneficial effects of the infrared image processing method, which will not be elaborated here.
[0096] In an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the infrared image processing method in any of the above embodiments are implemented. Therefore, the electronic device includes all the beneficial effects of the infrared image processing method, which will not be elaborated here.
[0097] The above are the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for processing infrared images, characterized in that: include: Acquire the infrared image, and acquire a target area where the infrared target is located according to the infrared image; Performing block processing on the infrared image to divide the infrared image into a plurality of image sub-blocks; Obtaining a degree of similarity between each image sub-block in the plurality of image sub-blocks and the target area; Obtaining an area weight of each image sub-block in the plurality of image sub-blocks relative to the target area; According to the similarity degree and the area weight, obtaining a global background interference degree parameter; The interference degree of the background of the infrared image to the infrared target is obtained according to the global background interference degree parameter.
2. The infrared image processing method according to claim 1, characterized in that: The step of acquiring the infrared image and acquiring a target area where the infrared target is located according to the infrared image includes: Acquire a first area where an infrared target is located in the infrared image; According to the first region, a target region where the infrared target is located is acquired, the area of the target region is larger than the area of the first region, and the first region is located within the target region, and the region between the first region and the target region is a local background region.
3. The infrared image processing method according to claim 2, characterized in that: The first area is a minimum circumscribed rectangle centered on the infrared target and surrounding the infrared target; The target area includes the infrared target and is a rectangular area whose area is twice that of the minimum circumscribed rectangle.
4. The infrared image processing method according to claim 1, characterized in that: The performing block processing on the infrared image to divide the infrared image into a plurality of image sub-blocks includes: Performing multiple block processing on the infrared image; When the mean square error of each image sub-block is smaller than the mean square error of the target area, or the area of each image sub-block is smaller than the area of the target area, the infrared image segmentation is stopped, and the segmented infrared image includes multiple image sub-blocks.
5. The infrared image processing method according to claim 2, characterized in that: The obtaining the similarity between each image sub-block in the plurality of image sub-blocks and the target area comprises: Obtaining a first hash value between the target area and the grayscale features of each image sub-block; Obtaining a second hash value between the grayscale feature of the local background area and each of the image sub-blocks; A similarity degree is obtained according to the first Hash value and the second Hash value.
6. The infrared image processing method according to claim 2, characterized in that: The calculation formula of the global background interference parameter is: Among them, IDGB is the global background interference parameter, w1(i) is the similarity between the i-th image sub-block and the target area, and w2(i) is the area weight of the i-th image sub-block.
7. The infrared image processing method according to claim 1, characterized in that: The obtaining of the area weight of each image sub-block in the plurality of image sub-blocks relative to the target area comprises: Obtaining the area of each of the image sub-blocks; Acquire the area of the target area; The area weight of each image sub-block is obtained according to the ratio of the area of each image sub-block to the area of the target region.
8. An infrared image processing device (300), characterized in that: include: An infrared target marking module (310) is used to obtain a target area where the infrared target is located according to the infrared image; An infrared target adaptive segmentation module (320) is used to perform block processing on the infrared image to segment the infrared image into a plurality of image sub-blocks; A similarity calculation module (330) is used to obtain the similarity between each image sub-block in the plurality of image sub-blocks and the target area; A region weight calculation module (340), used for obtaining the area weight of each image sub-block in the plurality of image sub-blocks relative to the target region; According to the similarity degree and the area weight, obtaining a global background interference degree parameter; The interference degree of the background of the infrared image to the infrared target is obtained according to the global background interference degree parameter.
9. An electronic device (400), comprising a memory (410), a processor (420), and a computer program stored in the memory (410) and executable on the processor (420), characterized in that: When the processor (420) executes the program, the steps of the infrared image processing method described in any one of claims 1 to 7 are implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the infrared image processing method described in any one of claims 1 to 7 are implemented.