Image processing method and device, equipment and storage medium

By performing statistical feature value analysis and compensation template adjustment on the scene grayscale images collected by the thermal imaging device, the problem of infrared image inhomogeneity is solved, more accurate compensation processing is achieved, and image quality is improved.

CN119031253APending Publication Date: 2024-11-26HANGZHOU MICROIMAGE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411261544.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Thermal imaging equipment is easily affected by thermal radiation during the imaging process, resulting in inhomogeneity problems in infrared images. The existing compensation methods are prone to overcompensation or undercompensation, and cannot effectively improve inhomogeneity.

Method used

By acquiring the statistical feature values ​​of the scene grayscale image, the reference compensation template is adjusted, and the adjusted compensation template is generated to ensure that the compensation value is closer to the true deviation amount, and then the infrared image is processed to improve non-uniformity.

Benefits of technology

It effectively improves the inhomogeneity problem in infrared images, avoids over-compensation or under-compensation, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031253A_ABST
    Figure CN119031253A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, equipment and a storage medium, relates to the technical field of image processing, and is used for effectively improving the non-uniformity problem of an infrared image and improving the over-compensation or under-compensation of the infrared image. The method comprises the following steps: acquiring a scene grayscale image acquired by thermal imaging equipment for a deployed scene; adjusting the reference compensation template based on the statistical characteristic value of the pixel value in the scene grayscale image to obtain an adjusted compensation template; the reference compensation template is used for indicating a reference compensation value for performing non-uniformity correction on each pixel value in the scene grayscale image; the difference degree of the compensation value indicated by the adjusted compensation template relative to the compensation value indicated by the reference compensation template is in positive correlation with the difference degree of the statistical characteristic value of the pixel value in the scene grayscale image relative to the statistical characteristic value of the reference compensation value in the reference compensation template; and processing the scene grayscale image according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployment scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, apparatus, device and storage medium. Background Art

[0002] During the imaging stage, thermal imaging equipment is easily affected by the thermal radiation of the thermal imaging equipment itself, resulting in non-uniformity problems in infrared images. In order to improve this non-uniformity problem, the infrared image can generally be compensated and corrected by a fixed compensation amount. However, this method is prone to over-compensation or under-compensation of the infrared image, and cannot effectively improve the non-uniformity problem in the infrared image. Summary of the invention

[0003] The embodiments of the present application provide an image processing method, apparatus, device and storage medium, which are at least used to effectively improve the non-uniformity problem of infrared images and improve over-compensation or under-compensation of infrared images.

[0004] To achieve the above objectives, the present application provides the following technical solutions:

[0005] In a first aspect, an image processing method is provided, comprising: obtaining a scene grayscale image collected by a thermal imaging device for a deployed scene. Adjusting a reference compensation template based on statistical characteristic values ​​of pixel values ​​in the scene grayscale image to obtain an adjusted compensation template. The reference compensation template is used to indicate a reference compensation value for performing non-uniformity correction on each pixel value in the scene grayscale image. The degree of difference between the compensation value indicated by the adjusted compensation template and the compensation value indicated by the reference compensation template is positively correlated with the degree of difference between the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image and the statistical characteristic values ​​of the reference compensation values ​​in the reference compensation template. The scene grayscale image is processed according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployed scene.

[0006] In this technical solution, the thermal imaging device can adjust the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image, so that the degree of difference between the compensation value indicated by the adjusted compensation template and the compensation value indicated by the reference compensation template matches the degree of difference between the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image and the statistical characteristic values ​​of the reference compensation value in the reference compensation template. In this way, the compensation value indicated by the adjusted compensation template is closer to the actual deviation of the pixel values ​​in the scene grayscale image, that is, the degree of non-uniformity that can be corrected by the adjusted compensation template is closer to the actual degree of non-uniformity in the scene grayscale image. Furthermore, the thermal imaging device processes the scene grayscale image according to the adjusted compensation template, which can improve the over-compensation or under-compensation of the scene grayscale image and can effectively improve the non-uniformity problem existing in the scene grayscale image.

[0007] In a possible embodiment, a method for adjusting a reference compensation template based on statistical characteristic values ​​of pixel values ​​in a scene grayscale image to obtain an adjusted compensation template specifically includes: dividing the scene grayscale image to obtain a plurality of blocks corresponding to the scene grayscale image. An adjustment coefficient is determined based on the statistical characteristic values ​​of the pixel values ​​in each block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each block. The adjustment coefficient is positively correlated with the degree of difference between the statistical characteristic values ​​of the pixel values ​​in each block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each block. Each reference compensation value indicated by the reference compensation template is multiplied by the adjustment coefficient to obtain the adjusted compensation template.

[0008] In a possible embodiment, the statistical characteristic value of the pixel value in the block includes at least one of the following: an average value of the pixel value in the block, and a standard deviation of the pixel value in the block. The statistical characteristic value of the reference compensation value corresponding to the pixel value in the block includes at least one of the following: an average value of the reference compensation value corresponding to the pixel value in the block, and a standard deviation of the reference compensation value corresponding to the pixel value in the block.

[0009] In a possible embodiment, based on the statistical characteristic values ​​of the pixel values ​​in each block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each block, a method for determining the adjustment coefficient specifically includes: determining the ratio of the sum of the first characteristic values ​​corresponding to each block to the sum of the second characteristic values ​​corresponding to each block as the adjustment coefficient. The first characteristic value corresponding to the block is the sum of the statistical characteristic values ​​of the pixel values ​​in the block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in the block. The second characteristic value corresponding to the block is the square value of the statistical characteristic value of the reference compensation value corresponding to the pixel values ​​in the block.

[0010] In a possible embodiment, before determining the ratio of the sum of the first eigenvalues ​​corresponding to each image block to the sum of the second eigenvalues ​​corresponding to each image block as the adjustment coefficient, the method further includes: determining an adaptive adjustment threshold based on the statistical eigenvalues ​​of the reference compensation values ​​corresponding to the pixel values ​​in each image block; the larger the statistical eigenvalue of the reference compensation value corresponding to the pixel value in the image block, the greater the probability of being determined as the adaptive adjustment threshold; and updating the statistical eigenvalues ​​of the pixel values ​​in each image block that are greater than the adaptive adjustment threshold to a preset eigenvalue.

[0011] In a possible embodiment, the reference compensation template is adjusted based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image, and before the adjusted compensation template is obtained, the method further includes: determining the working time when the thermal imaging device captures the scene grayscale image. The working time is the interval between the acquisition time of the scene grayscale image and the startup time of the thermal imaging device. A reference compensation template corresponding to the working time is determined from a plurality of preset compensation templates. Different preset compensation templates correspond to different time intervals. The preset compensation template is generated based on a sample grayscale image captured when the thermal imaging device works within the time interval. The time interval corresponding to the reference compensation template includes the working time.

[0012] In a possible embodiment, the method further includes: acquiring a plurality of sample grayscale images collected by the thermal imaging device for the calibration plate. Preprocessing the plurality of sample grayscale images respectively to obtain a plurality of processed sample images. The preprocessing includes at least one of the following: filtering processing and fitting processing. Based on the plurality of processed sample images, a reference compensation template is determined. The reference compensation value in the reference compensation template is the difference between the mean of the pixel values ​​at the same pixel position in the plurality of processed sample images and the calibration value.

[0013] In a possible embodiment, different sample grayscale images correspond to different working durations. The working duration is the interval between the acquisition time of the sample grayscale image and the start-up time of the thermal imaging device.

[0014] In a second aspect, an image processing device is provided, including: an acquisition unit and a processing unit.

[0015] The acquisition unit is used to acquire the scene grayscale image collected by the thermal imaging device for the deployed scene.

[0016] The processing unit is used to adjust the reference compensation template based on the statistical characteristic value of the pixel value in the scene grayscale image to obtain the adjusted compensation template. The reference compensation template is used to indicate the reference compensation value for performing non-uniformity correction on each pixel value in the scene grayscale image. The degree of difference between the compensation value indicated by the adjusted compensation template and the compensation value indicated by the reference compensation template is positively correlated with the degree of difference between the statistical characteristic value of the pixel value in the scene grayscale image and the statistical characteristic value of the reference compensation value in the reference compensation template.

[0017] The processing unit is further used to process the scene grayscale image according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployment scene.

[0018] In a possible embodiment, the processing unit is specifically used to: divide the scene grayscale image to obtain multiple blocks corresponding to the scene grayscale image. Based on the statistical characteristic values ​​of the pixel values ​​in each block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each block, an adjustment coefficient is determined. The adjustment coefficient is positively correlated with the degree of difference between the statistical characteristic values ​​of the pixel values ​​in each block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each block. Each reference compensation value indicated by the reference compensation template is multiplied by the adjustment coefficient to obtain an adjusted compensation template.

[0019] In a possible embodiment, the statistical characteristic value of the pixel value in the block includes at least one of the following: an average value of the pixel value in the block, and a standard deviation of the pixel value in the block. The statistical characteristic value of the reference compensation value corresponding to the pixel value in the block includes at least one of the following: an average value of the reference compensation value corresponding to the pixel value in the block, and a standard deviation of the reference compensation value corresponding to the pixel value in the block.

[0020] In a possible embodiment, the processing unit is specifically used to: determine the ratio of the sum of the first eigenvalues ​​corresponding to each block to the sum of the second eigenvalues ​​corresponding to each block as the adjustment coefficient. The first eigenvalue corresponding to the block is the sum of the statistical eigenvalue of the pixel value in the block and the statistical eigenvalue of the reference compensation value corresponding to the pixel value in the block. The second eigenvalue corresponding to the block is the square value of the statistical eigenvalue of the reference compensation value corresponding to the pixel value in the block.

[0021] In a possible embodiment, the processing unit is specifically used to: determine an adaptive adjustment threshold based on the statistical characteristic value of the reference compensation value corresponding to the pixel value in each image block; the larger the statistical characteristic value of the reference compensation value corresponding to the pixel value in the image block, the greater the probability of being determined as the adaptive adjustment threshold; update the statistical characteristic value of the pixel value in each image block that is greater than the adaptive adjustment threshold to a preset characteristic value.

[0022] In a possible embodiment, the processing unit is further used to determine the working time of the thermal imaging device when it collects the grayscale image of the scene. The working time is the interval between the collection time of the scene grayscale image and the start-up time of the thermal imaging device. The processing unit is also used to determine a reference compensation template corresponding to the working time from a plurality of preset compensation templates. Different preset compensation templates correspond to different time intervals. The preset compensation template is generated based on the sample grayscale image collected when the thermal imaging device works within the time interval. The time interval corresponding to the reference compensation template includes the working time.

[0023] In a possible embodiment, the acquisition unit is further used to acquire multiple sample grayscale images collected by the thermal imaging device for the calibration plate. The processing unit is further used to preprocess the multiple sample grayscale images respectively to obtain multiple processed sample images. The preprocessing includes at least one of the following: filtering processing and fitting processing. The processing unit is further used to determine a reference compensation template based on the multiple processed sample images. The reference compensation value in the reference compensation template is the difference between the average of the pixel values ​​at the same pixel position in the multiple processed sample images and the calibration value.

[0024] In a possible embodiment, different sample grayscale images correspond to different working durations. The working duration is the interval between the acquisition time of the sample grayscale image and the start-up time of the thermal imaging device.

[0025] In a third aspect, an electronic device is provided, comprising: a processor and a memory. The processor is connected to the memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, thereby implementing any one of the methods provided in the first aspect.

[0026] In a fourth aspect, a readable storage medium is provided, comprising computer execution instructions. When the computer execution instructions are executed on an electronic device, the electronic device executes any one of the methods provided in the first aspect.

[0027] In a fifth aspect, a computer program product is provided, comprising computer execution instructions, which, when executed on an electronic device, causes the electronic device to execute any one of the methods provided in the first aspect.

[0028] The technical effects brought about by any implementation method in the second to fifth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A schematic diagram of a grayscale image before correction provided in an embodiment of the present application;

[0030] Figure 2 A schematic diagram of a corrected grayscale image provided in an embodiment of the present application;

[0031] Figure 3 A schematic diagram of another corrected grayscale image provided in an embodiment of the present application;

[0032] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0033] Figure 5 A flowchart of an image processing method provided in an embodiment of the present application;

[0034] Figure 6 A schematic diagram of another corrected grayscale image provided in an embodiment of the present application;

[0035] Figure 7 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.

[0037] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0038] First of all, in order to facilitate the understanding of the present application, the relevant elements involved in the present application are described.

[0039] Vignetting refers to the phenomenon that the brightness or clarity of the edge of the image gradually decreases relative to the center. Since the light farther away from the central axis passes through the smaller effective aperture of the optical system, the light intensity of the light away from the central axis on the off-axis image plane is also weaker, resulting in the phenomenon that the image vignettes from the central axis to the off-axis.

[0040] Non-uniformity refers to the non-uniformity in the image, including but not limited to vignetting. For example, non-uniformity can also be non-uniformity in the image, such as non-uniform color distribution and non-uniform noise distribution.

[0041] Secondly, the application scenarios involved in this application are briefly introduced.

[0042] When correcting vignetting caused by an optical lens in an optical imaging system, multiple calibrations are usually performed to calculate linear compensation parameters, and the image is multiplicatively compensated using the compensation parameters.

[0043] In infrared imaging systems, in addition to the multiplicative vignetting caused by the optical lens, there is also vignetting caused by the thermal radiation generated by the internal movement structure of the thermal imaging device. In other words, during the imaging stage of the infrared detector, the thermal radiation inside the device will be superimposed on the image, causing vignetting in the image. In addition, when the product form of the thermal imaging device is different, the manifestation of vignetting in the image is also different. The vignetting caused by the internal thermal radiation of this device has an additive nature. If only multiplicative compensation is performed on the image, it is difficult to effectively improve the vignetting in the image.

[0044] For example, Figure 1 , which is a schematic diagram of a grayscale image before correction provided in an embodiment of the present application. Figure 1 The grayscale image before correction shown in is a grayscale image of the scene collected by the thermal imaging device, and has a non-uniformity problem.

[0045] Combination Figure 1 ,like Figure 2 , which is a schematic diagram of a corrected grayscale image provided in an embodiment of the present application. Figure 2 The corrected grayscale image shown in is a scene grayscale image after simply solving the vignetting problem with a multiplicative property, and there is still a relatively obvious non-uniformity problem.

[0046] In order to improve the additive vignetting in infrared images, a correction template can generally be calculated based on the non-uniform image, and the infrared image can be subtracted based on the correction template after the detector is imaged.

[0047] However, from the perspective of the principle of non-uniformity, the temperature of the internal structure of the device will gradually increase as the device is used, resulting in a gradual increase in the degree of non-uniformity in the infrared image. In other words, the amount of heat radiation caused by the thermal imaging device itself is not fixed.

[0048] If the infrared image is subtracted based solely on the correction template, over-compensation problems may occur when the device starts working (i.e., when the device temperature is low), and under-compensation problems may occur after the device has been working for a long time (i.e., when the device temperature is high), resulting in the inability to effectively improve the non-uniformity of the infrared image.

[0049] Combination Figure 1 ,like Figure 3 , which is a schematic diagram of another corrected grayscale image provided in an embodiment of the present application. Figure 3 The corrected grayscale image shown in is a scene grayscale image after compensation correction using a correction template, and there is still a relatively obvious non-uniformity problem.

[0050] Based on this, the present application considers using an adaptive intensity correction template to compensate for the infrared image, so as to better eliminate the non-uniformity of the infrared image caused by the thermal radiation inside the device.

[0051] Next, the implementation environment (implementation architecture) involved in this application is briefly introduced.

[0052] The embodiment of the present application provides an image processing method that can be applied to an electronic device. The electronic device can have an image non-uniformity processing function. Specifically, the electronic device can adjust a reference compensation template based on a scene grayscale image captured by a thermal imaging device, and compensate the scene grayscale image based on the adjusted compensation information to obtain a corrected scene image.

[0053] The embodiments of the present application do not impose any restrictions on the specific form of the electronic device. For example, the electronic device may be a thermal imaging device, such as a thermal imaging core assembly, an observation-type infrared thermal imager, or a vehicle-mounted infrared thermal imager.

[0054] For another example, the electronic device may be a terminal device or a network device with an image non-uniformity processing function. The terminal device may be referred to as a terminal, user equipment (UE), terminal device, mobile device, user terminal, user agent or user device, etc. The terminal device may specifically be a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The network device may specifically be a server, etc. The server may be a physical or logical server, or may be two or more physical or logical servers that share different responsibilities and work together to realize the various functions of the server.

[0055] For ease of explanation, the embodiments of the present application are described by taking the electronic device as a thermal imaging device as an example. It should be understood that when the electronic device is a device other than a thermal imaging device, the electronic device can directly or indirectly obtain the scene grayscale image collected by the thermal imaging device from the thermal imaging device, and process it to obtain a corrected scene image, thereby realizing the image non-uniformity processing function. The specific implementation method of this process is similar to the description in the following embodiments and will not be repeated.

[0056] In terms of hardware implementation, the above electronic devices can be implemented as follows: Figure 4 The electronic device 10 shown is implemented. Figure 4 FIG. 1 is a schematic diagram of the structure of an electronic device 10 provided in an embodiment of the present application. The electronic device 10 can be used to implement the functions of the above electronic devices.

[0057] Figure 4 The electronic device 10 shown may include: a processor 101 , a memory 102 , a communication interface 103 and a bus 104 . The processor 101 , the memory 102 and the communication interface 103 may be connected via the bus 104 .

[0058] The processor 101 is the control center of the electronic device 10, and may be a general-purpose central processing unit (CPU) or other general-purpose processors, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0059] As an example, the processor 101 may include one or more CPUs, such as Figure 4 CPU 0 and CPU 1 are shown in .

[0060] The memory 102 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0061] In one possible implementation, the memory 102 may exist independently of the processor 101. The memory 102 may be connected to the processor 101 via a bus 104 and used to store data, instructions, or program codes. When the processor 101 calls and executes the instructions or program codes stored in the memory 102, the state detection method provided in the embodiment of the present application can be implemented.

[0062] In another possible implementation, the memory 102 may also be integrated with the processor 101 .

[0063] The communication interface 103 is used for connecting the electronic device 10 to other devices via a communication network, which may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 103 may include a receiving unit for receiving data and a sending unit for sending data.

[0064] The bus 104 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0065] It should be pointed out that Figure 4 The structure shown in the figure does not constitute a limitation on the electronic device 10. Figure 4 In addition to the components shown, electronic device 10 may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0066] For ease of understanding, the image processing method provided by the present application is specifically introduced below with reference to the accompanying drawings.

[0067] like Figure 5 FIG. 1 is a flow chart of an image processing method provided by the present application. The method includes: S201-S203.

[0068] S201: Acquire a scene grayscale image collected by a thermal imaging device for a deployed scene.

[0069] Optionally, the thermal imaging device may be deployed in an industrial inspection scenario, for detecting thermal failures of industrial equipment such as motors or transformers. Alternatively, the thermal imaging device may be deployed in a medical diagnosis scenario, for checking the temperature of various parts of the human body. Alternatively, the thermal imaging device may be deployed in a public safety scenario, for detecting whether there are fire hazards in public places.

[0070] In one possible implementation, the thermal imaging device can capture infrared radiation in the deployed scene in real time or periodically through a configured thermal imaging detector, and further generate a scene grayscale image based on the captured data. The scene grayscale image can be a grayscale image that does not contain color information, and can reflect the temperature distribution or infrared radiation difference in the scene where the thermal imaging device is deployed in grayscale form.

[0071] The grayscale image of the scene may be superimposed with the internal thermal radiation of the thermal imaging device, which may cause unevenness. Specifically, when the thermal imaging device generates the grayscale image of the scene, it may have just started working. In this case, the core components inside the thermal imaging device have just started to heat up, the temperature is low, and the amount of thermal radiation generated is small. When superimposed on the grayscale image of the scene, the degree of unevenness caused is low. That is, there is a low degree of unevenness in the grayscale image of the scene.

[0072] Alternatively, when the thermal imaging device generates a grayscale image of the scene, it may have been working for a long time. In this case, the temperature of the internal movement components of the thermal imaging device is high, and the amount of heat radiation generated is large. When superimposed on the grayscale image of the scene, the degree of non-uniformity caused is high. That is, there is a more obvious non-uniformity phenomenon in the grayscale image of the scene.

[0073] Optionally, when the thermal imaging device generates a scene grayscale image based on the captured data, the scene grayscale image may be multiplied by an optical correction coefficient to improve vignetting caused by an optical lens in the scene grayscale image. The optical correction coefficient may be pre-calibrated based on the specification parameters of the optical lens configured on the thermal imaging device, which will not be described in detail.

[0074] S202: adjusting the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image to obtain an adjusted compensation template.

[0075] Among them, the reference compensation template is used to indicate the reference compensation value for correcting the non-uniformity of each pixel value in the scene grayscale image. The reference compensation template can be an image. The pixel size and resolution of the image and the scene grayscale image can be the same. The pixel value of each pixel in the image is a reference compensation value for correcting the pixel value of a pixel in the scene grayscale image. The reference compensation value for correcting the pixel value of a pixel in the scene grayscale image can also be understood as the deviation amount that needs to be compensated for the pixel value of a pixel in the scene grayscale image. After correcting the pixel values ​​of each pixel in the scene grayscale image, the non-uniformity problem existing in the scene grayscale image can be improved.

[0076] Optionally, the reference compensation template can be generated by the thermal imaging device based on the collected sample grayscale image, or can be manually set based on experience, without limitation. The specific process of the thermal imaging device generating the preset compensation template based on the collected sample grayscale image can refer to the description in S401-S403 below, which will not be repeated here.

[0077] Considering the non-uniformity in the scene grayscale image caused by the internal thermal radiation of the thermal imaging device, a pre-generated reference compensation template may be stored in the thermal imaging device. However, the reference compensation template is generally generated by the thermal imaging device based on multiple sample grayscale images, reflecting the average degree of non-uniformity in the multiple sample grayscale images. If the thermal imaging device directly corrects the scene grayscale image based on the reference compensation template, it may cause over-compensation of the scene grayscale image when the degree of non-uniformity in the scene grayscale image is low, and it may also cause under-compensation of the scene grayscale image when the degree of non-uniformity in the scene grayscale image is high. It is difficult to effectively improve the non-uniformity problem in the scene grayscale image.

[0078] Based on this, before correcting the scene grayscale image, the thermal imaging device can perform statistical processing on the pixel values ​​in the scene grayscale image to obtain the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image. Furthermore, the thermal imaging device can adjust the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image to obtain the adjusted compensation template. The degree of difference between the compensation value indicated by the adjusted compensation template and the compensation value indicated by the reference compensation template is positively correlated with the degree of difference between the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image and the statistical characteristic values ​​of the compensation values ​​in the reference compensation template.

[0079] In this way, the thermal imaging device can realize adaptive adjustment of the reference compensation template, so that the degree of non-uniformity that can be corrected by the adjusted compensation template is closer to the actual degree of non-uniformity in the scene grayscale image, that is, the compensation value indicated by the adjusted compensation template is closer to the actual deviation of the pixel value in the scene grayscale image.

[0080] S203: Processing the scene grayscale image according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployment scene.

[0081] In one possible implementation, the thermal imaging device may process the scene grayscale image according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployment scene. For example, the thermal imaging device may choose to subtract or add the scene grayscale image and the adjusted compensation template based on the positive or negative value of the compensation value indicated in the adjusted compensation template, so as to subtract or add the corresponding compensation value in the adjusted compensation template from each pixel value in the scene grayscale image to obtain a corrected scene image corresponding to the deployment scene.

[0082] Based on this, the thermal imaging device can effectively improve the non-uniformity problem with additive properties caused by the thermal radiation inside the thermal imaging device in the scene grayscale image. In addition, the thermal imaging device can also multiply the scene grayscale image by the optical correction coefficient to improve the vignetting problem with multiplicative properties caused by the optical lens in the scene grayscale image. In this way, compared with simply solving the vignetting problem with multiplicative properties, the thermal imaging device can better improve the non-uniformity problem existing in the scene grayscale image.

[0083] For example, in combination Figure 1 ,like Figure 6 , which is a schematic diagram of another corrected grayscale image provided in an embodiment of the present application. Figure 6 The corrected grayscale image shown in FIG. 1 is a scene grayscale image after compensation and correction using the method in S201 - S203 above, and the non-uniformity problem is effectively eliminated.

[0084] In a possible embodiment, in the above S202, that is, when the reference compensation template is adjusted based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image to obtain the adjusted compensation template, the present application provides an optional implementation method, including: S2021-S2023.

[0085] S2021: Divide the scene grayscale image to obtain multiple blocks corresponding to the scene grayscale image.

[0086] Taking into account that the thermal radiation generated inside the thermal imaging device superimposed in different areas of the scene grayscale image is different and the degree of non-uniformity is different, the degree of difference in statistical characteristics between pixel values ​​and reference compensation values ​​in different areas of the scene grayscale image can be statistically analyzed separately to facilitate accurate adjustment of the reference compensation module.

[0087] Based on this, the thermal imaging device can divide the scene grayscale image to obtain multiple blocks corresponding to the scene grayscale image, so that the thermal imaging device can subsequently count the difference in statistical features between the pixel value and the reference compensation value in each block, so as to accurately adjust the reference compensation module.

[0088] Optionally, the pixel sizes of different tiles may be the same or different.

[0089] S2022: Determine an adjustment coefficient based on the statistical characteristic values ​​of the pixel values ​​in each image block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each image block.

[0090] The adjustment coefficient is positively correlated with the degree of difference between the statistical characteristic value of the pixel value in each image block and the statistical characteristic value of the reference compensation value corresponding to the pixel value in each image block.

[0091] Optionally, the statistical characteristic value of the pixel values ​​in the image block may include at least one of the following: an average value of the pixel values ​​in the image block, and a standard deviation of the pixel values ​​in the image block. The statistical characteristic value of the reference compensation value corresponding to the pixel values ​​in the image block may include at least one of the following: an average value of the reference compensation value corresponding to the pixel values ​​in the image block, and a standard deviation of the reference compensation value corresponding to the pixel values ​​in the image block.

[0092] In one possible manner, when the statistical characteristic value of the pixel values ​​in a block is the standard deviation of the pixel values ​​in the block, and the statistical characteristic value of the reference compensation value corresponding to the pixel values ​​in the block is the standard deviation of the reference compensation value corresponding to the pixel values ​​in the block, the thermal imaging device can determine the adjustment coefficient based on the statistical characteristic value of the pixel values ​​in each block and the statistical characteristic value of the reference compensation value corresponding to the pixel values ​​in each block. The ratio of the sum of the first characteristic value corresponding to each block to the sum of the second characteristic value corresponding to each block can be determined as the adjustment coefficient. The first characteristic value corresponding to the block is the sum of the standard deviation of the pixel values ​​in the block and the standard deviation of the reference compensation value corresponding to the pixel values ​​in the block. The second characteristic value corresponding to the block is the square value of the standard deviation of the reference compensation value corresponding to the pixel values ​​in the block.

[0093] For example, the thermal imaging device can generate a first matrix based on the standard deviation of the pixel values ​​in each image block, and generate a second matrix based on the standard deviation of the reference compensation values ​​corresponding to the pixel values ​​in each image block. One element in the first matrix is ​​the standard deviation of the pixel values ​​in a image block. One element in the second matrix is ​​the standard deviation of the reference compensation values ​​corresponding to the pixel values ​​in a image block. In this way, the thermal imaging device can multiply the first matrix and the second matrix to obtain a third matrix, and determine the ratio between the sum of the elements in the third matrix and the sum of the squares of the second matrix as the adjustment coefficient.

[0094] In an optional manner, when the statistical characteristic value of the pixel values ​​in a block is the average value of the pixel values ​​in the block, and the statistical characteristic value of the reference compensation value corresponding to the pixel values ​​in the block is the average value of the reference compensation value corresponding to the pixel values ​​in the block, the thermal imaging device can determine the adjustment coefficient based on the statistical characteristic value of the pixel values ​​in each block and the statistical characteristic value of the reference compensation value corresponding to the pixel values ​​in each block, and the ratio of the sum of the fourth characteristic values ​​corresponding to each block to the sum of the average value of the reference compensation value corresponding to the pixel values ​​in each block can be determined as the adjustment coefficient. The fourth characteristic value corresponding to the block is the difference between the average value of the pixel values ​​in the block and the median of the pixel values ​​in the block.

[0095] In an optional manner, when the thermal imaging device determines the adjustment coefficient based on the statistical characteristic values ​​of the pixel values ​​in each image block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each image block, it can determine the adaptive adjustment threshold based on the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each image block, and further update the statistical characteristic values ​​of the pixel values ​​in each image block that are greater than the adaptive adjustment threshold to the preset characteristic value. Furthermore, the thermal imaging device can determine the adjustment coefficient by the ratio of the sum of the first characteristic values ​​corresponding to each image block to the sum of the second characteristic values ​​corresponding to each image block.

[0096] The larger the statistical characteristic value of the reference compensation value corresponding to the pixel value in the image block, the greater the probability of being determined as the adaptive adjustment threshold. For example, the adaptive adjustment threshold may be the maximum value among the statistical characteristic values ​​of the reference compensation value corresponding to the pixel value in each image block. For another example, the adaptive adjustment threshold may be the second largest value among the statistical characteristic values ​​of the reference compensation value corresponding to the pixel value in each image block that is only smaller than the maximum value.

[0097] The preset characteristic value can be set flexibly. For example, the preset characteristic value can be 0. For another example, the preset characteristic value can be the average value of the statistical characteristic values ​​of the pixel values ​​in each block.

[0098] S2023: Multiply each reference compensation value indicated by the reference compensation template by an adjustment coefficient to obtain an adjusted compensation template.

[0099] In a possible embodiment, before the above S202, the reference compensation template is adjusted based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image, and before the adjusted compensation template is obtained, the image processing method provided by the present application also includes: S301-S302.

[0100] S301: Determine the working time of the thermal imaging device when it collects the grayscale image of the scene.

[0101] The working time when the thermal imaging device collects the grayscale image of the scene is the interval between the collection time of the grayscale image of the scene and the start-up time of the thermal imaging device.

[0102] S302: Determine a reference compensation template corresponding to the working time from a plurality of preset compensation templates.

[0103] Among them, different preset compensation templates correspond to different duration intervals. For example, assume that there are preset compensation template 1, preset compensation template 2, and preset compensation template 3. The duration interval corresponding to preset compensation template 1 can be 0 minutes to 100 minutes. The duration interval corresponding to preset compensation template 2 can be 101 minutes to 300 minutes. The duration interval corresponding to preset compensation template 3 can be 301 minutes to 1000 minutes.

[0104] The preset compensation template is generated based on the sample grayscale image collected when the thermal imaging device works in the time interval. The specific process of the thermal imaging device generating the preset compensation template based on the collected sample grayscale image can refer to the description in S401-S403 below, which will not be repeated here.

[0105] Considering that the heat radiation caused by the inside of the thermal imaging device gradually increases as the working time of the thermal imaging device increases, resulting in the degree of non-uniformity in the scene grayscale image gradually increasing, different preset compensation templates can be generated based on the sample grayscale images collected in different working time intervals of the thermal imaging device. In this way, the thermal imaging device can use different preset compensation templates to process the scene images collected in different time intervals, so as to accurately improve the non-uniformity problem existing in the scene image.

[0106] Based on this, when the thermal imaging device collects the scene grayscale image for the deployed scene, it can determine the working time when the scene grayscale image is collected. Furthermore, the thermal imaging device can determine the preset compensation template of the working time in the time interval among multiple preset compensation templates as the reference compensation template. That is, the time interval corresponding to the reference compensation template includes the working time. Furthermore, the thermal imaging device can correct the scene grayscale image more accurately after adaptively adjusting the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image. In this way, the thermal imaging device can realize adaptive compensation based on the scene grayscale image at different stages of temperature rise.

[0107] In a possible embodiment, in order to support the thermal imaging device to obtain a more accurate reference compensation template, the image processing method provided by the present application further includes: S401-S403.

[0108] S401: Acquire multiple sample grayscale images collected by a thermal imaging device for a calibration plate.

[0109] Optionally, the calibration plate can be a metal plate with high surface flatness and stable thermal properties, and has uniform infrared reflection and radiation characteristics. In this way, without considering the internal thermal radiation of the thermal imaging device, the pixel values ​​of each pixel in the scene grayscale image generated by the thermal imaging device for the calibration plate can be kept consistent.

[0110] In one possible implementation, when a reference compensation template needs to be generated, a staff member may place a calibration plate in front of a thermal imaging device, so that the thermal imaging device can generate multiple sample grayscale images for the calibration plate.

[0111] In order to better determine the degree of non-uniformity in the scene grayscale images generated by the thermal imaging device at different working times, different sample grayscale images correspond to different working times of the thermal imaging device. The working time of the thermal imaging device is the interval between the acquisition time of the sample grayscale image and the start-up time of the thermal imaging device.

[0112] S402: Preprocessing the plurality of sample grayscale images respectively to obtain a plurality of processed sample images.

[0113] The preprocessing may include at least one of the following: filtering processing and fitting processing.

[0114] Optionally, the thermal imaging device may filter the sample grayscale image by median filtering or Gaussian filtering. For example, when the median filtering method is adopted, the thermal imaging device may replace the pixel value of a certain pixel in the sample grayscale image with the median value of the pixel values ​​in the neighborhood of the pixel, so as to effectively remove noise values ​​and abnormal values, thereby facilitating more accurate determination of the reference compensation template.

[0115] Optionally, the thermal imaging device may perform fitting processing on the sample grayscale image by linear fitting or polynomial fitting. For example, in the case of polynomial fitting, the thermal imaging device may select multiple pixels from the sample grayscale image and establish a polynomial to fit the pixel value distribution law of the multiple pixels, and then adjust other pixels in the sample grayscale image to effectively remove noise values ​​or make up for missing values, so as to facilitate more accurate determination of the reference compensation template.

[0116] S403: Determine a reference compensation template based on the multiple processed sample images.

[0117] The reference compensation value in the reference compensation template is the difference between the average of the pixel values ​​at the same pixel position in the multiple processed sample images and the calibration value. The calibration value can be the average of the pixel values ​​of each pixel in the scene grayscale image generated by the thermal imaging device for the calibration plate without considering the internal thermal radiation of the thermal imaging device.

[0118] In one achievable method, the thermal imaging device can determine the average of pixel values ​​at the same pixel position in multiple processed sample images, and determine the difference between the average of pixel values ​​at the same pixel position and a calibration value, which is the reference compensation value indicated by the same pixel position in the reference compensation template.

[0119] Based on this, the thermal imaging device can generate a reference compensation template through the sample grayscale image collected by the thermal imaging device itself, so that the reference compensation template can be better applied to the scene grayscale image collected by the thermal imaging device, and can better improve the non-uniformity problem existing in the scene grayscale image. In other words, when the image processing method provided by the embodiment of the present application is implemented on different thermal imaging devices, each thermal imaging device can generate a reference compensation template suitable for itself. It can be seen that the image processing method provided by the embodiment of the present application can better solve the over-compensation and under-compensation problems when correcting non-uniformity under thermal radiation of different structures in different thermal imaging devices and at different stages of temperature rise of the same thermal imaging device.

[0120] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the method. It is understandable that in order to realize the above functions, the thermal imaging device includes at least one of the hardware structure and software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0121] The embodiment of the present application can divide the thermal imaging device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0122] For example, Figure 7 The schematic diagram of the structure of an image processing device is shown. The image processing device 20 can be used to execute the method involved in the above embodiment. The image processing device 20 includes: an acquisition unit 501 and a processing unit 502.

[0123] The acquisition unit 501 is used to acquire a scene grayscale image collected by the thermal imaging device for the deployed scene.

[0124] The processing unit 502 is used to adjust the reference compensation template based on the statistical characteristic value of the pixel value in the scene grayscale image to obtain the adjusted compensation template. The reference compensation template is used to indicate the reference compensation value for performing non-uniformity correction on each pixel value in the scene grayscale image. The degree of difference between the compensation value indicated by the adjusted compensation template and the compensation value indicated by the reference compensation template is positively correlated with the degree of difference between the statistical characteristic value of the pixel value in the scene grayscale image and the statistical characteristic value of the reference compensation value in the reference compensation template.

[0125] The processing unit 502 is further configured to process the scene grayscale image according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployment scene.

[0126] In a possible embodiment, the processing unit 502 is specifically used to: divide the scene grayscale image to obtain multiple blocks corresponding to the scene grayscale image. Based on the statistical characteristic values ​​of the pixel values ​​in each block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each block, an adjustment coefficient is determined. The adjustment coefficient is positively correlated with the degree of difference between the statistical characteristic values ​​of the pixel values ​​in each block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each block. Each reference compensation value indicated by the reference compensation template is multiplied by the adjustment coefficient to obtain an adjusted compensation template.

[0127] In a possible embodiment, the statistical characteristic value of the pixel value in the block includes at least one of the following: an average value of the pixel value in the block, and a standard deviation of the pixel value in the block. The statistical characteristic value of the reference compensation value corresponding to the pixel value in the block includes at least one of the following: an average value of the reference compensation value corresponding to the pixel value in the block, and a standard deviation of the reference compensation value corresponding to the pixel value in the block.

[0128] In a possible embodiment, the processing unit 502 is specifically used to: determine the ratio of the sum of the first eigenvalues ​​corresponding to each block to the sum of the second eigenvalues ​​corresponding to each block as the adjustment coefficient. The first eigenvalue corresponding to the block is the sum of the statistical eigenvalue of the pixel value in the block and the statistical eigenvalue of the reference compensation value corresponding to the pixel value in the block. The second eigenvalue corresponding to the block is the square value of the statistical eigenvalue of the reference compensation value corresponding to the pixel value in the block.

[0129] In a possible embodiment, the processing unit 502 is specifically used to: determine an adaptive adjustment threshold based on the statistical characteristic value of the reference compensation value corresponding to the pixel value in each image block; the larger the statistical characteristic value of the reference compensation value corresponding to the pixel value in the image block, the greater the probability of being determined as the adaptive adjustment threshold; and update the statistical characteristic value of the pixel value in each image block that is greater than the adaptive adjustment threshold to a preset characteristic value.

[0130] In a possible embodiment, the processing unit 502 is further used to determine the working time of the thermal imaging device when it collects the grayscale image of the scene. The working time is the interval between the collection time of the scene grayscale image and the start time of the thermal imaging device. The processing unit 502 is also used to determine a reference compensation template corresponding to the working time from a plurality of preset compensation templates. Different preset compensation templates correspond to different time intervals. The preset compensation template is generated based on the sample grayscale image collected when the thermal imaging device works within the time interval. The time interval corresponding to the reference compensation template includes the working time.

[0131] In a possible embodiment, the acquisition unit 501 is further used to acquire multiple sample grayscale images collected by the thermal imaging device for the calibration plate. The processing unit 502 is further used to preprocess the multiple sample grayscale images respectively to obtain multiple processed sample images. The preprocessing includes at least one of the following: filtering processing and fitting processing. The processing unit 502 is also used to determine a reference compensation template based on the multiple processed sample images. The reference compensation value in the reference compensation template is the difference between the mean of the pixel values ​​at the same pixel position in the multiple processed sample images and the calibration value.

[0132] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation of any image processing device 20 provided above and the description of the beneficial effects can refer to the above corresponding method embodiments, which will not be repeated here.

[0133] As an example, combining Figure 4 , the functions partially or completely implemented by the acquisition unit 501 and the processing unit 502 in the image processing device 20 can be Figure 4 Processor 101 in the Figure 4 The program code in the memory 102 is implemented.

[0134] An embodiment of the present application further provides a readable storage medium having a computer program stored thereon. When the computer program is executed on an electronic device, the electronic device executes any of the methods executed by the thermal imaging devices provided above.

[0135] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.

[0136] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on an electronic device, the electronic device executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on an electronic device, the process or function according to the embodiment of the present application is generated in whole or in part. The electronic device may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that can be accessed by an electronic device or a data storage device such as a server, a data center, etc. that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), etc.

[0137] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media, etc., are all non-transitory.

[0138] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on an electronic device, the process or function according to the embodiment of the present application is generated in whole or in part. The electronic device can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by an electronic device or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with the medium. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), etc.

[0139] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0140] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An image processing method, characterized in that: include: Obtaining a grayscale image of a scene collected by a thermal imaging device for a deployed scene; Adjusting the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image to obtain an adjusted compensation template; The reference compensation template is used to indicate a reference compensation value for performing non-uniformity correction on each pixel value in the scene grayscale image; The difference between the compensation value indicated by the adjusted compensation template and the compensation value indicated by the reference compensation template is positively correlated with the difference between the statistical characteristic value of the pixel value in the scene grayscale image and the statistical characteristic value of the reference compensation value in the reference compensation template; The scene grayscale image is processed according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployment scene.

2. The method according to claim 1, characterized in that The step of adjusting the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image to obtain the adjusted compensation template includes: Dividing the scene grayscale image to obtain a plurality of image blocks corresponding to the scene grayscale image; Determine an adjustment coefficient based on a statistical characteristic value of a pixel value in each image block and a statistical characteristic value of a reference compensation value corresponding to the pixel value in each image block; the adjustment coefficient is positively correlated with a degree of difference between the statistical characteristic value of the pixel value in each image block and the statistical characteristic value of the reference compensation value corresponding to the pixel value in each image block; Each reference compensation value indicated by the reference compensation template is multiplied by the adjustment coefficient to obtain the adjusted compensation template.

3. The method according to claim 2, characterized in that The statistical characteristic values ​​of the pixel values ​​in the image block include at least one of the following: an average value of the pixel values ​​in the image block, and a standard deviation of the pixel values ​​in the image block; the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in the image block include at least one of the following: an average value of the reference compensation values ​​corresponding to the pixel values ​​in the image block, and a standard deviation of the reference compensation values ​​corresponding to the pixel values ​​in the image block.

4. The method according to claim 2 or 3, characterized in that: The determining of the adjustment coefficient based on the statistical characteristic values ​​of the pixel values ​​in each image block and the statistical characteristic values ​​of the reference compensation values ​​corresponding to the pixel values ​​in each image block includes: The ratio of the sum of the first eigenvalues ​​corresponding to each block to the sum of the second eigenvalues ​​corresponding to each block is determined as the adjustment coefficient; the first eigenvalue corresponding to the block is the sum of the statistical eigenvalue of the pixel value in the block and the statistical eigenvalue of the reference compensation value corresponding to the pixel value in the block; the second eigenvalue corresponding to the block is the square value of the statistical eigenvalue of the reference compensation value corresponding to the pixel value in the block.

5. The method according to claim 4, characterized in that Before determining the ratio of the sum of the first eigenvalues ​​corresponding to each block to the sum of the second eigenvalues ​​corresponding to each block as the adjustment coefficient, the method further includes: Determining an adaptive adjustment threshold based on the statistical characteristic value of the reference compensation value corresponding to the pixel value in each image block; the larger the statistical characteristic value of the reference compensation value corresponding to the pixel value in the image block, the greater the probability of being determined as the adaptive adjustment threshold; The statistical characteristic values ​​of the pixel values ​​in each of the image blocks that are greater than the adaptive adjustment threshold are updated to preset characteristic values.

6. The method according to claim 1, characterized in that Before adjusting the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image to obtain the adjusted compensation template, the method further includes: Determine the working time of the thermal imaging device when it collects the grayscale image of the scene; the working time is the interval between the collection time of the grayscale image of the scene and the start time of the thermal imaging device; Determine the reference compensation template corresponding to the working duration from multiple preset compensation templates; different preset compensation templates correspond to different duration intervals; the preset compensation template is generated based on the sample grayscale image collected when the thermal imaging device works within the duration interval; the duration interval corresponding to the reference compensation template includes the working duration.

7. The method according to claim 1, characterized in that The method further comprises: Acquire a plurality of sample grayscale images collected by the thermal imaging device for the calibration plate; Preprocessing the plurality of sample grayscale images respectively to obtain a plurality of processed sample images; the preprocessing includes at least one of the following: filtering processing and fitting processing; The reference compensation template is determined based on the multiple processed sample images; the reference compensation value in the reference compensation template is the difference between the average of the pixel values ​​at the same pixel position in the multiple processed sample images and the calibration value.

8. The method according to claim 7, characterized in that Different sample grayscale images correspond to different working durations; the working duration is the interval between the acquisition time of the sample grayscale image and the start-up time of the thermal imaging device.

9. An image processing device, characterized in that: include: Acquisition unit and processing unit; The acquisition unit is used to acquire a scene grayscale image collected by the thermal imaging device for the deployed scene; The processing unit is used to adjust the reference compensation template based on the statistical characteristic values ​​of the pixel values ​​in the scene grayscale image to obtain the adjusted compensation template; The reference compensation template is used to indicate a reference compensation value for performing non-uniformity correction on each pixel value in the scene grayscale image; The difference between the compensation value indicated by the adjusted compensation template and the compensation value indicated by the reference compensation template is positively correlated with the difference between the statistical characteristic value of the pixel value in the scene grayscale image and the statistical characteristic value of the reference compensation value in the reference compensation template; The processing unit is further used to process the scene grayscale image according to the adjusted compensation template to obtain a corrected scene image corresponding to the deployment scene.

10. An electronic device, characterized in that: include: processor; The processor is connected to a memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory to enable the electronic device to implement the method as described in any one of claims 1 to 8.

11. A readable storage medium, characterized in that: Used to store computer instructions, when the computer instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 8.