Temperature image obtaining method and device
By processing the forward adjacent image information of the temperature sensing detection device in parallel, determining the compensation coefficient and compensating the pixel value, the problem of low accuracy of the temperature image generated by the temperature sensing detection device is solved, and efficient and accurate temperature image acquisition is achieved.
Patent Information
- Application Number
- CN202510598614.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-09-09
AI Technical Summary
When a temperature sensing device detects the thermal radiation energy on the surface of an object, the distance between the device and the object causes the detected thermal radiation energy to be lower than the actual value, resulting in a low accuracy of the generated temperature image.
By parallel processing the pixel value distribution representation values of the forward adjacent images generated by the temperature sensing detection equipment, performing binarization processing and determining the connected domain, the compensation coefficient is determined and the pixel value is compensated to improve the accuracy of the temperature image.
The processing time of a single-frame temperature image is shortened, the processing efficiency and accuracy of the temperature image are improved, and the operating efficiency of the temperature sensing detection equipment is improved.
Smart Images

Figure CN120612397A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and device for obtaining a temperature image. Background Art
[0002] Temperature sensing devices can detect the thermal radiation energy released from the surface of an object and generate a temperature image based on the detection results. However, due to the distance between the temperature sensing device and the object being measured, the thermal radiation energy released from the object's surface will decay over a certain distance. This can cause the thermal radiation energy detected by the temperature sensing device to be lower than the actual thermal radiation energy of the object's surface, resulting in a low accuracy of the generated temperature image. Summary of the Invention
[0003] The purpose of the embodiments of the present application is to provide a method and apparatus for obtaining a temperature image to improve the accuracy of the temperature image. The specific technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a method for obtaining a temperature image, the method comprising:
[0005] Obtaining a first temperature image generated by a temperature sensing device;
[0006] The following steps are performed in parallel to compensate pixel values of pixels in the first temperature image using the determined compensation coefficients to obtain a compensated first temperature image:
[0007] determining a first pixel value distribution representation value of the first temperature image;
[0008] Binarizing the first temperature image according to the second pixel value distribution representation value of the second temperature image to obtain a first binarized image, wherein the second temperature image is a forward adjacent image of the first temperature image generated by the temperature sensing device;
[0009] determining a first connected domain in a second binarized image of the second temperature image, wherein the second binarized image is obtained by binarizing the second temperature image according to a third pixel value distribution representation value of a third temperature image, where the third temperature image is a forward adjacent image of the second temperature image generated by the temperature sensing device;
[0010] A first compensation coefficient for pixel value compensation is determined based on a second connected domain in the third binarized image, wherein the third binarized image is obtained by binarizing the third temperature image based on a fourth pixel value distribution representation value of the fourth temperature image, and the fourth temperature image is a forward adjacent image of the third temperature image generated by the temperature sensing detection device.
[0011] In a second aspect, an embodiment of the present application provides a temperature image acquisition device, the device comprising:
[0012] An image acquisition module, configured to acquire a first temperature image generated by a temperature sensing device;
[0013] An image compensation module is configured to trigger the following submodules in parallel to compensate the pixel values of the pixels in the first temperature image using the determined compensation coefficients to obtain a compensated first temperature image:
[0014] a characterization value determination submodule, configured to determine a first pixel value distribution characterization value of the first temperature image;
[0015] A binarization submodule, configured to perform binarization on the first temperature image according to a second pixel value distribution representation value of the second temperature image to obtain a first binarized image, wherein the second temperature image is a forward adjacent image of the first temperature image generated by the temperature sensing device;
[0016] a connected domain determining submodule, configured to determine a first connected domain in a second binarized image of the second temperature image, wherein the second binarized image is obtained by binarizing the second temperature image according to a third pixel value distribution representation value of a third temperature image, wherein the third temperature image is a forward adjacent image of the second temperature image generated by the temperature sensing device;
[0017] A coefficient determination submodule is used to determine a first compensation coefficient for pixel value compensation based on a second connected domain in a third binarized image, wherein the third binarized image is obtained by binarizing the third temperature image according to a fourth pixel value distribution representation value of a fourth temperature image, and the fourth temperature image is: a forward adjacent image of the third temperature image generated by the temperature sensing detection device.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0019] Memory for storing computer programs;
[0020] The processor is configured to implement the method described in the first aspect when executing the program stored in the memory.
[0021] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0022] Beneficial effects of the embodiments of the present application:
[0023] As can be seen from the above, when the solution provided by the embodiment of the present application is applied to obtain a temperature image, in the process of processing a single-frame temperature image, the information obtained in the process of processing the forward adjacent image of the frame temperature image can be reused in the process of processing the frame temperature image, thereby realizing the parallel execution of multiple steps, shortening the processing time of the single-frame temperature image, improving the processing efficiency of the single-frame image, and also being able to compensate the pixel values of the pixel points in the temperature image to obtain an accurate temperature image and improve the accuracy of the temperature image. By adopting the temperature image acquisition solution provided by the embodiment of the present application, for the data continuously collected by the temperature sensing detection equipment, it is possible to achieve frame-level image acquisition efficiency, improve the operating efficiency of the compensation equipment, and shorten the single-frame processing time and performance overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0025] Figure 1 A schematic flow chart of a first temperature image acquisition method provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of a temperature image processing process provided in an embodiment of the present application;
[0027] Figure 3 A schematic flow chart of a second temperature image acquisition method provided in an embodiment of the present application;
[0028] Figure 4 A schematic flow chart of a third method for obtaining a temperature image provided in an embodiment of the present application;
[0029] Figure 5 A schematic structural diagram of a first temperature image acquisition device provided in an embodiment of the present application;
[0030] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of this application.
[0032] First, the application scenario of the temperature image acquisition solution provided in the embodiment of the present application is described.
[0033] A temperature sensing device can detect the thermal radiation energy released by the surface of an object within its detection range and generate a temperature image reflecting the surface temperature of the object based on the detection results. For example, the temperature sensing device can be a thermal imaging device, and the temperature image can be an infrared thermal image.
[0034] Temperature detection devices continuously generate temperature images during operation. However, because the temperature detection device operates at a certain distance from the object being measured, the thermal radiation energy it detects is always lower than the actual thermal radiation energy on the object's surface. Consequently, the accuracy of each temperature image generated by the temperature detection device is low. Therefore, after each temperature image is generated, the pixel values of the pixels in the temperature image must be compensated to obtain a compensated, accurate temperature image.
[0035] The temperature image generated by the temperature sensing detection device has not been compensated and has low accuracy. It can be regarded as the original RAW data output by the temperature sensing detection device. After the original RAW data is compensated, an accurate temperature image can be obtained as the final detection result.
[0036] Two solutions for performing pixel value compensation and obtaining an accurate temperature image are introduced below, and the device that performs the solution of performing pixel value compensation and obtaining an accurate temperature image is called a compensation device.
[0037] In the first option, see Figure 1 , provides a flow chart of the first temperature image acquisition method. After the temperature detection device generates a frame of temperature image, it can be Figure 1 In steps S101 to S105 shown, pixel values of pixels in the generated temperature image are compensated to obtain a compensated temperature image.
[0038] Below Figure 1 Steps S101 to S105 are described in detail.
[0039] Step S101: Determine a pixel value distribution representation value of a temperature image.
[0040] Specifically, after obtaining the temperature image generated by the temperature sensing detection device, the compensation device can determine a characterization value that characterizes the distribution of pixel values of pixel points in the temperature image based on the pixel values of the pixel points in the temperature image, as the pixel value distribution characterization value of the temperature image.
[0041] For example, the mean or median of the pixel values of the pixels in the temperature image may be calculated as a pixel value distribution representation value of the temperature image.
[0042] Furthermore, when determining the pixel value distribution representation value, it may be determined based on the pixel values of all pixels in the temperature image, or it may be determined based on the pixel values of some pixels in the temperature image, so as to reduce the amount of calculation.
[0043] For example, the pixel value distribution representation value is determined according to the pixel values of the pixel points located in odd rows and odd columns in the temperature image.
[0044] Step S102: performing binarization processing on the temperature image according to the determined pixel value distribution representation value to obtain a binarized image.
[0045] The pixel values of the pixels in the binary image are only two kinds. For example, the pixel values of the pixels in the binary image are 0 or 1.
[0046] Specifically, for each pixel in the temperature image, the compensation device may compare the pixel value of the pixel with the pixel value distribution representation value to obtain a comparison result for the pixel. The comparison result for the pixel may be a first comparison result in which the pixel value exceeds the pixel value distribution representation value, or a second comparison result in which the pixel value does not exceed the pixel value distribution representation value.
[0047] The two comparison results of the pixel point can correspond to two pixel values in the binary image, respectively. Hereinafter, the two pixel values in the binary image are referred to as the first pixel value and the second pixel value, respectively. The first comparison result can correspond to the first pixel value, and the second comparison result can correspond to the second pixel value. In this way, after obtaining the comparison result of each pixel point in the temperature image, the pixel value of the pixel point at the same position as the pixel point in the binary image can be determined according to the obtained comparison result.
[0048] For example, if the comparison result of the pixel point in the pth row and qth column in the temperature image is the first comparison result, the pixel value of the pixel point in the pth row and qth column in the binary image can be determined to be the first pixel value.
[0049] After comparing the pixel values of all pixels in the temperature image, the pixel values of all pixels in the binary image can be determined based on the comparison results of all pixels, thereby generating a binary image according to the determined pixel values and position information of the pixels.
[0050] Step S103: Determine connected components in the binary image.
[0051] Specifically, the compensation device can only determine the connected domain where the pixel points with the first pixel value in the binary image are located, or only determine the connected domain where the pixel points with the second pixel value in the binary image are located, or separately determine the connected domain where the pixel points with the first pixel value in the binary image are located and the connected domain where the pixel points with the second pixel value are located.
[0052] The following describes a method for determining a connected domain where a pixel point having a first pixel value is located.
[0053] For each pixel point in the binary image whose pixel value is the first pixel value, it can be determined whether the pixel value of the pixel point adjacent to the pixel point in the binary image is the first pixel value. If the pixel value of the pixel point adjacent to the pixel point is the first pixel value, it is determined that the pixel point and the pixel point adjacent to the pixel point belong to the same connected domain. After traversing all pixel points in the binary image whose pixel value is the first pixel value, the connected domains in which the pixel point with the pixel value of the first pixel value is located can be determined.
[0054] The method of determining the connected domain where the pixel point having the second pixel value is located is the same as the above method, which will not be described in detail here.
[0055] Step S104: determining a compensation coefficient for pixel value compensation according to the connected domain in the binary image.
[0056] Specifically, according to the connected domain in the binary image, the compensation coefficient may be determined in any one of the following three implementations.
[0057] In the first implementation method, a first correspondence between the number of pixels in a connected domain and a compensation coefficient can be pre-constructed. In this way, after determining each connected domain in the binary image, the number of pixels in each connected domain is counted, and based on the above-mentioned first correspondence, the compensation coefficient corresponding to the counted number is determined.
[0058] When determining the compensation coefficient in this implementation manner, each connected domain corresponds to a compensation coefficient.
[0059] In the second implementation method, a second correspondence between the size of the connected domain and the compensation coefficient can be pre-constructed. In this way, after determining each connected domain in the binary image, the size of each connected domain is determined, and based on the above second correspondence, the compensation coefficient corresponding to the counted size is determined.
[0060] When determining the compensation coefficient in this implementation manner, each connected domain corresponds to a compensation coefficient.
[0061] In the third implementation method, a third correspondence between the number of connected domains and the compensation coefficient can be pre-constructed. In this way, after determining each connected domain in the binary image, the number of connected domains can be counted, and the compensation coefficient corresponding to the counted number can be determined based on the above third correspondence.
[0062] When determining the compensation coefficient in this implementation manner, a compensation coefficient can be determined based on each connected domain.
[0063] The above three implementation methods respectively determine the compensation coefficient based on the number of pixels in the connected domain, the size of the connected domain, and the number of connected domains. In addition, the compensation coefficient can also be comprehensively determined by combining these three types of information and at least two of other information of the connected domain.
[0064] Step S105: using the determined compensation coefficient to compensate the pixel values of the pixels in the temperature image to obtain a compensated temperature image.
[0065] Specifically, when each connected component corresponds to a compensation coefficient, pixel value compensation can be performed in either of the following two implementations.
[0066] In the first implementation method, for each connected domain, the area with the same position as the connected domain can be determined in the temperature image based on the position of the connected domain in the binary image, and the compensation coefficient corresponding to the connected domain can be used to compensate the pixel values of each pixel point in the area determined in the temperature image.
[0067] In the second implementation, a final global compensation coefficient (or overall compensation coefficient) may be determined based on the compensation coefficients corresponding to each connected domain, and the pixel value of each pixel in the temperature image may be compensated using the determined global compensation coefficient.
[0068] When a compensation coefficient is determined based on each connected domain, the compensation coefficient can be directly used to compensate the pixel value of each pixel in the temperature image, or to compensate the pixel value of the pixel in the area of the temperature image with the same position as each connected domain.
[0069] In one embodiment of the present application, the compensation coefficient is: an increment of pixel value.
[0070] When using the compensation coefficient to compensate the pixel value of a pixel point, the pixel value of the pixel point can be directly added to the compensation coefficient, that is, the pixel value of the pixel point is added to the determined pixel value increment to obtain the compensated pixel value of the pixel point.
[0071] For example, if the above compensation coefficient is 20 and the pixel value of a pixel is 50, when the compensation coefficient is used to compensate the pixel value of the pixel, the pixel value of the pixel is directly added to the compensation coefficient, that is, 50+20=70, then the pixel value of the pixel after compensation is 70.
[0072] In another embodiment of the present application, the compensation coefficient is a coefficient indicating a degree of compensation for a pixel value.
[0073] When using the compensation coefficient to compensate the pixel value of a pixel point, the pixel value of the pixel point may be multiplied by the compensation coefficient to obtain the compensated pixel value of the pixel point.
[0074] For example, if the above compensation coefficient is 1.1, and the pixel value of a pixel is 50, when the compensation coefficient is used to compensate the pixel value of the pixel, the pixel value of the pixel is multiplied by the compensation coefficient, that is, 50×1.1=55, then the pixel value of the pixel after compensation is 55.
[0075] It can be seen that in this solution, after the temperature sensing device generates each temperature image frame, the pixel values of the pixels in the generated temperature image are compensated according to the above steps S101 to S105, so that a compensated and accurate temperature image can be obtained.
[0076] However, it takes a long time to execute the above steps S101-S105 serially in the order of steps. After each frame of temperature image is generated by the temperature sensing detection device, the process of the above steps S101-S105 needs to be executed again to obtain a compensated and accurate temperature image. This results in a long time and low efficiency in obtaining an accurate temperature image.
[0077] To solve the above problems, an embodiment of the present application provides a second temperature image acquisition scheme. In this scheme, in the process of processing a single-frame temperature image, the information obtained in the process of processing the forward adjacent image of the frame temperature image can be reused in the process of processing the frame temperature image, thereby realizing the parallel execution of multiple steps, reducing computational overhead, shortening the processing time of a single-frame temperature image, and improving the processing efficiency of a single-frame image. It can also compensate for the pixel values of the pixel points in the temperature image to obtain an accurate temperature image and improve the accuracy of the temperature image.
[0078] The second temperature image acquisition scheme is introduced in detail below.
[0079] The second temperature image acquisition scheme is as follows:
[0080] Obtaining a first temperature image generated by a temperature sensing device;
[0081] Perform the following steps 1 to 4 in parallel, and use the determined compensation coefficient to compensate the pixel values of the pixels in the first temperature image to obtain a compensated first temperature image:
[0082] Step 1: determining a first pixel value distribution representation value of a first temperature image;
[0083] Step 2: Binarizing the first temperature image according to the second pixel value distribution representation value of the second temperature image to obtain a first binary image, wherein the second temperature image is a forward adjacent image of the first temperature image generated by the temperature sensing device;
[0084] Step 3: Determine a first connected domain in a second binarized image of the second temperature image, wherein the second binarized image is obtained by binarizing the second temperature image according to a third pixel value distribution representation value of the third temperature image, where the third temperature image is a forward adjacent image of the second temperature image generated by the temperature sensing device;
[0085] Step 4: Determine a first compensation coefficient for pixel value compensation based on the second connected domain in the third binarized image, wherein the third binarized image is obtained by binarizing the third temperature image according to the fourth pixel value distribution representation value of the fourth temperature image, and the fourth temperature image is: a forward adjacent image of the third temperature image generated by the temperature sensing detection device.
[0086] See also Figure 2 , Figure 2 A temperature image processing flow is shown. Figure 2 The second temperature image acquisition scheme is introduced.
[0087] Figure 2 , the first to fourth temperature images are all temperature images generated by the temperature sensing detection device, and the second temperature image is the forward adjacent image of the first temperature image, the third temperature image is the forward adjacent image of the second temperature image, and the fourth temperature image is the forward adjacent image of the third temperature image.
[0088] A forward-adjacent image of a temperature image is an image that is adjacent to a temperature image and generated before the first temperature image. For example, if a second temperature image is a forward-adjacent image of a first temperature image, this means that the second temperature image is adjacent to the first temperature image and generated before the first temperature image. For example, if the first temperature image is the nth frame generated by a temperature sensing device, the second temperature image is the n-1th or n-2th frame generated by the temperature sensing device.
[0089] The generation time of the second temperature image, the third temperature image and the fourth temperature image are all earlier than the generation time of the first temperature image. It can be seen that the first temperature image is an image generated by the temperature sensing detection device after the third frame image, such as the fourth frame image.
[0090] The following describes the process of the compensation device compensating the pixel values of the pixels in the first temperature image to obtain an accurate temperature image in two cases: the first temperature image is the fourth frame image generated by the temperature sensing detection device, and the first temperature image is the image after the fourth frame image.
[0091] 1. The first temperature image is the fourth frame image generated by the temperature detection device
[0092] In this case, the second temperature image is the third frame image, the third temperature image is the second frame image, and the fourth temperature image is the first frame image.
[0093] When the compensation device obtains the first frame image generated by the temperature sensing detection device, that is, obtains the fourth temperature image, and processes the fourth temperature image, since there is no forward adjacent image of the first frame image, there is no information obtained in the process of processing the forward adjacent image of the first frame image. At this time, the fourth pixel value distribution representation value of the fourth temperature image can be determined according to the method provided in the above step S101.
[0094] After obtaining the fourth pixel value distribution representation value, the subsequent steps of obtaining a binary image, determining a connected domain, determining a compensation coefficient, and using the compensation coefficient to compensate for pixel values may be omitted, or these steps may be performed serially to obtain a temperature image after compensating the pixel values of the pixel points in the fourth temperature image.
[0095] When the compensation device obtains the second frame image, that is, obtains the third temperature image, and processes the third temperature image, the compensation device has already obtained the fourth pixel value distribution representation value. Therefore, the following steps can be performed in parallel according to the method provided in the above steps S101 and S102:
[0096] determining a third pixel value distribution representation value of the third temperature image;
[0097] The third temperature image is binarized according to the fourth pixel value distribution representation value to obtain a third binarized image.
[0098] After obtaining the third binary image, the subsequent steps of determining the connected domain, determining the compensation coefficient, and using the compensation coefficient to compensate for the pixel values may be omitted, or these steps may be performed serially to obtain a temperature image after compensating the pixel values of the pixel points in the third temperature image.
[0099] When the compensation device obtains the third frame image, that is, the second temperature image, and processes the second temperature image, the compensation device has already obtained the third pixel value distribution representation value and the third binarized image. Therefore, the following steps can be performed in parallel according to the method provided in the above steps S101 to S103:
[0100] determining a second pixel value distribution representation value of the second temperature image;
[0101] performing binarization processing on the second temperature image according to the third pixel value distribution representation value to obtain a second binarized image;
[0102] A second connected component in the third binarized image is determined.
[0103] After obtaining the second connected domain, the subsequent steps of determining the compensation coefficient and using the compensation coefficient to compensate the pixel values may not be performed, or these steps may be performed serially to obtain a temperature image after compensating the pixel values of the pixels in the second temperature image.
[0104] When the compensation device obtains the fourth frame image, that is, the first temperature image, and processes the first temperature image, the compensation device has already obtained the second pixel value distribution representation value, the second binarized image, and the second connected domain. Therefore, the following steps can be performed in parallel according to the method provided in steps S101 to S104 above:
[0105] determining a first pixel value distribution representation value of the first temperature image;
[0106] Binarizing the first temperature image according to the second pixel value distribution representation value to obtain a first binarized image;
[0107] determining a first connected component in the second binarized image;
[0108] A first compensation coefficient for pixel value compensation is determined according to the second connected component.
[0109] After the first compensation coefficient is determined, the first temperature image may be compensated using the first compensation coefficient in the manner provided in step S105 to obtain a compensated first temperature image.
[0110] 2. The first temperature image is the image after the fourth frame
[0111] In this case, when the compensation device processes the first temperature image, it has obtained the pixel value distribution representation value, binary image, connected domain and compensation coefficient corresponding to the forward adjacent image of the first temperature image, so that the above steps one to four can be executed in parallel.
[0112] Moreover, when using the compensation coefficient to compensate the pixel value of the pixel point in the first temperature image, the compensation coefficient used can be the compensation coefficient corresponding to the forward adjacent image of the first temperature image (i.e., the compensation coefficient corresponding to the second temperature image), or the first compensation coefficient obtained by executing step four.
[0113] For example, if the first temperature image is the fifth frame image, the compensation coefficient used to compensate the pixel value of the pixel point in the fifth frame image can be the compensation coefficient corresponding to the fourth frame image, or the compensation coefficient corresponding to the fifth frame image obtained by executing step four.
[0114] When the compensation coefficient used is the compensation coefficient corresponding to the forward adjacent image of the first temperature image (ie, the compensation coefficient corresponding to the second temperature image), the compensation coefficient corresponding to the forward adjacent image of the first temperature image may be referred to as the second compensation coefficient.
[0115] The above-mentioned second compensation coefficient is determined based on the third connected domain in the fourth binarized image. The fourth binarized image is obtained by binarizing the fourth temperature image according to the fifth pixel value distribution guarantee value of the fifth temperature image. The fifth temperature image is: the forward adjacent image of the fourth temperature image generated by the temperature sensing detection device.
[0116] Since the second compensation coefficient has been obtained in the process of processing the second temperature image, the step of compensating the pixel value of the pixel point in the first temperature image using the second compensation coefficient can be performed in parallel with steps 1 to 4, such as Figure 3 shown.
[0117] After the compensation device obtains the fifth temperature image, the step of determining a fifth pixel value distribution representation value of the fifth temperature image is performed.
[0118] After the compensation device obtains the fourth temperature image, the following steps are performed in parallel:
[0119] determining a fourth pixel value distribution representation value of the fourth temperature image;
[0120] The fourth temperature image is binarized according to the fifth pixel value distribution representation value to obtain a fourth binarized image.
[0121] After the compensation device obtains the third temperature image, the following steps are performed in parallel:
[0122] determining a third pixel value distribution representation value of the third temperature image;
[0123] performing binarization processing on the third temperature image according to the fourth pixel value distribution representation value to obtain a third binarized image;
[0124] A third connected component in the fourth binarized image is determined.
[0125] After the compensation device obtains the second temperature image, the following steps are performed in parallel:
[0126] determining a second pixel value distribution representation value of the second temperature image;
[0127] performing binarization processing on the second temperature image according to the third pixel value distribution representation value to obtain a second binarized image;
[0128] determining a second connected component in the third binarized image;
[0129] A second compensation coefficient for pixel value compensation is determined according to the third connected component.
[0130] After the compensation device obtains the first temperature image, the following steps are performed in parallel:
[0131] determining a first pixel value distribution representation value of the first temperature image;
[0132] Binarizing the first temperature image according to the second pixel value distribution representation value to obtain a first binarized image;
[0133] determining a first connected component in the second binarized image;
[0134] determining a first compensation coefficient for pixel value compensation according to the second connected component;
[0135] The pixel values of the pixels in the first temperature image are compensated using the second compensation coefficient to obtain a compensated first temperature image.
[0136] In this case, steps one to four and the step of compensating the pixel values of the pixels in the first temperature image are performed in parallel. That is, after the compensation device obtains the first temperature image, it can use the second compensation coefficient to compensate it without relying on the execution results obtained in other steps to obtain the compensation coefficient before compensating the pixel values of the pixels in the first temperature image. It can be seen that using the second compensation coefficient to compensate for the pixel values of the pixels in the first temperature image can greatly shorten the time consumption from obtaining the temperature image generated by the temperature sensing detection device to obtaining the accurate temperature image after compensation, greatly reduce the delay in obtaining an accurate temperature image, and improve the efficiency of obtaining an accurate temperature image.
[0137] In the case where the compensation coefficient used is the first compensation coefficient obtained by executing step 4, step 4 and the step of compensating the pixel values of the pixels in the first temperature image using the first compensation coefficient can be regarded as one step, which is parallel to steps 1 to 3. Figure 4 As shown, the last step is: determining a first compensation coefficient for pixel value compensation based on the second connected domain in the third binary image, and using the first compensation coefficient to compensate the pixel values of the pixels in the first temperature image to obtain the compensated first temperature image.
[0138] In this case, after the compensation device obtains the first temperature image, it only needs to determine the first compensation coefficient for pixel value compensation based on the second connected domain in the third binary image, and then use the first compensation coefficient to compensate the pixel values of the pixels in the first temperature image. It can be seen that compared with the first solution, this method of using the first compensation coefficient for pixel value compensation can also shorten the time-consuming overhead from obtaining the temperature image generated by the temperature sensing detection device to obtaining the accurate temperature image after compensation, reduce the delay in obtaining an accurate temperature image, and improve the efficiency of obtaining an accurate temperature image. In addition, the above-mentioned method of using the second compensation coefficient for pixel value compensation requires calling five processes to execute five parallel steps, while the method of using the first compensation coefficient for pixel value compensation requires calling four processes to execute four parallel steps, which can reduce the call of one process, thereby saving process resources.
[0139] The following describes the specific implementation of the above steps 1, 3, and 4, as well as the method of using the determined compensation coefficient to compensate the pixel values of the pixels in the first temperature image.
[0140] 1. Two ways to implement step 1
[0141] In a first implementation manner, the mean value of the pixel values of the pixels in the first temperature image may be calculated as the first pixel value distribution representation value of the first temperature image.
[0142] Since the mean of the pixel values of the pixel points in the first temperature image can accurately reflect the distribution of the pixel values of the pixel points in the first temperature image, using the mean as the first pixel value distribution representation value can improve the accuracy of the first pixel value distribution representation value, thereby performing subsequent pixel value compensation processing based on the first pixel value distribution representation value to obtain a compensated temperature image, which can improve the accuracy of the obtained temperature image.
[0143] In a second implementation manner, the median of the pixel values of the pixels in the first temperature image may be calculated as the first pixel value distribution representation value of the first temperature image.
[0144] 2. Two ways to implement step three
[0145] In a first implementation manner, a connected domain where a first pixel point in a second binarized image of the second temperature image is located is determined as a first connected domain.
[0146] The pixel value of the pixel point corresponding to the first pixel point in the second temperature image is greater than the third pixel value distribution representation value.
[0147] This implementation is similar to the method of determining the connected domain of the pixel point having the first pixel value in the aforementioned step S103, and will not be described in detail here.
[0148] The implementation method can accurately determine the first connected domain, and then perform subsequent pixel value compensation processing based on the first connected domain to obtain a compensated temperature image, thereby improving the accuracy of the obtained temperature image.
[0149] In a second implementation manner, a connected domain where a second pixel point in a second binarized image of the second temperature image is located is determined as a first connected domain.
[0150] The pixel value of the pixel point corresponding to the second pixel point in the second temperature image is not greater than the third pixel value distribution representation value.
[0151] The specific process of determining the connected domain where the second pixel point in the second binary image of the second temperature image is located is similar to the specific process of determining the connected domain where the first pixel point in the second binary image of the second temperature image is located, and will not be repeated here.
[0152] Similar to the first implementation, this implementation can accurately determine the first connected domain, thereby performing subsequent pixel value compensation processing based on the first connected domain to obtain a compensated temperature image, thereby improving the accuracy of the obtained temperature image.
[0153] 3. Two ways to implement step 4
[0154] In the first implementation method, for each second connected domain in the third binary image, the number of pixels contained in the second connected domain is counted, and based on the correspondence between the number of pixels and the compensation coefficient, the compensation coefficient corresponding to the counted number is determined as the first compensation coefficient.
[0155] This implementation is similar to the first implementation of determining the compensation coefficient in the aforementioned step S104, and will not be described in detail here.
[0156] This implementation method can accurately determine the first compensation coefficient, thereby performing subsequent pixel value compensation processing based on the first compensation coefficient to obtain a compensated temperature image, thereby improving the accuracy of the obtained temperature image.
[0157] In a second implementation, for each second connected domain in the third binarized image, the size of the second connected domain is determined, and based on the correspondence between the connected domain size and the compensation coefficient, the compensation coefficient corresponding to the obtained size is determined as the first compensation coefficient.
[0158] 4. Two implementation methods for compensating the pixel values of the pixels in the first temperature image using the determined compensation coefficients
[0159] In a first implementation, a compensation area in the first temperature image having the same position as the connected domain corresponding to the determined compensation coefficient is determined, and pixel values of pixels in the compensation area are compensated using the determined compensation coefficient to obtain a compensated first temperature image.
[0160] This implementation is similar to the first implementation of pixel value compensation in step S105, and will not be described in detail here.
[0161] By adopting this implementation method, it is only necessary to compensate the pixel values of some pixels in the first temperature image, which can reduce the amount of calculation and improve the efficiency of obtaining the temperature image.
[0162] In a second implementation, a global compensation coefficient is obtained based on the determined compensation coefficients, and the pixel value of each pixel point in the first temperature image is compensated using the global compensation coefficient to obtain a compensated first temperature image.
[0163] This implementation is similar to the second implementation of pixel value compensation in the aforementioned step S105, and will not be described in detail here.
[0164] By adopting this implementation method, the pixel value of each pixel point in the first temperature image can be fully compensated, thereby obtaining an accurate first temperature image and improving the accuracy of the obtained temperature image.
[0165] Corresponding to the temperature image obtaining method, an embodiment of the present application also provides a temperature image obtaining device.
[0166] In one embodiment of the present application, see Figure 5 , provides a schematic structural diagram of a temperature image acquisition device. In this embodiment, the device includes:
[0167] An image acquisition module 501 is configured to acquire a first temperature image generated by a temperature sensing device;
[0168] The image compensation module 502 is configured to trigger the following submodules in parallel to compensate the pixel values of the pixels in the first temperature image using the determined compensation coefficients to obtain a compensated first temperature image:
[0169] a characterization value determination submodule 502A, configured to determine a first pixel value distribution characterization value of the first temperature image;
[0170] A binarization submodule 502B is configured to perform binarization on the first temperature image according to a second pixel value distribution representation value of the second temperature image to obtain a first binarized image, wherein the second temperature image is a forward adjacent image of the first temperature image generated by the temperature sensing device;
[0171] a connected domain determining submodule 502C, configured to determine a first connected domain in a second binarized image of the second temperature image, wherein the second binarized image is obtained by binarizing the second temperature image according to a third pixel value distribution representation value of a third temperature image, where the third temperature image is a forward adjacent image of the second temperature image generated by the temperature sensing device;
[0172] The coefficient determination submodule 502D is used to determine the first compensation coefficient for pixel value compensation based on the second connected domain in the third binarized image, wherein the third binarized image is obtained by binarizing the third temperature image according to the fourth pixel value distribution representation value of the fourth temperature image, and the fourth temperature image is: the forward adjacent image of the third temperature image generated by the temperature sensing detection device.
[0173] When applying the solution provided in the embodiment of the present application to obtain a temperature image, in the process of processing a single-frame temperature image, the information obtained in the process of processing the forward adjacent image of the frame temperature image can be reused in the process of processing the frame temperature image, thereby realizing the parallel execution of multiple steps, shortening the processing time of the single-frame temperature image, and improving the processing efficiency of the single-frame image.
[0174] In one embodiment of the present application, the compensation coefficient used to compensate the pixel value of the pixel point in the first temperature image is: the first compensation coefficient.
[0175] In this solution, using the first compensation coefficient to compensate for pixel values can shorten the time required from obtaining the temperature image generated by the temperature sensing device to obtaining the compensated accurate temperature image, reduce the latency in obtaining an accurate temperature image, and improve the efficiency of obtaining an accurate temperature image. Furthermore, using the second compensation coefficient to compensate for pixel values requires calling five processes to execute five parallel steps, while using the first compensation coefficient to compensate for pixel values requires calling four processes to execute four parallel steps. This reduces the number of process calls and thus saves process resources.
[0176] In one embodiment of the present application, the compensation coefficient used to compensate for the pixel value of the pixel point in the first temperature image is: the second compensation coefficient for pixel value compensation determined according to the third connected domain in the fourth binarized image, wherein the fourth binarized image is obtained by binarizing the fourth temperature image according to the fifth pixel value distribution representation value of the fifth temperature image, and the fifth temperature image is: the forward adjacent image of the fourth temperature image generated by the temperature sensing detection device.
[0177] In this solution, the second compensation coefficient is used to compensate the pixel values of the pixel points in the first temperature image, which can significantly shorten the time consumption from obtaining the temperature image generated by the temperature sensing device to obtaining the accurate temperature image after compensation, significantly reduce the delay in obtaining an accurate temperature image, and improve the efficiency of obtaining an accurate temperature image.
[0178] In one embodiment of the present application, the coefficient determination submodule 502D is specifically configured to:
[0179] For each second connected domain in the third binarized image, the number of pixels included in the second connected domain is counted, and based on the correspondence between the number of pixels and the compensation coefficient, a compensation coefficient corresponding to the counted number is determined as the first compensation coefficient.
[0180] This solution can accurately determine the first compensation coefficient, thereby performing subsequent pixel value compensation processing based on the first compensation coefficient to obtain a compensated temperature image, thereby improving the accuracy of the obtained temperature image.
[0181] In one embodiment of the present application, the image compensation module 502 is specifically configured to:
[0182] A compensation area in the first temperature image having the same position as the connected domain corresponding to the determined compensation coefficient is determined, and pixel values of pixels in the compensation area are compensated using the determined compensation coefficient to obtain a compensated first temperature image.
[0183] By adopting this solution, only the pixel values of some pixels in the first temperature image need to be compensated, which can reduce the amount of calculation and improve the efficiency of obtaining the temperature image.
[0184] In one embodiment of the present application, the image compensation module 502 is specifically configured to:
[0185] A global compensation coefficient is obtained according to the determined compensation coefficients, and the pixel value of each pixel point in the first temperature image is compensated using the global compensation coefficient to obtain a compensated first temperature image.
[0186] By adopting this solution, the pixel value of each pixel point in the first temperature image can be fully compensated, thereby obtaining an accurate first temperature image and improving the accuracy of the obtained temperature image.
[0187] In one embodiment of the present application, the connected domain determining submodule 502C is specifically configured to:
[0188] Determine a connected domain where a first pixel point in the second binary image of the second temperature image is located as a first connected domain, wherein a pixel value of a pixel point corresponding to the first pixel point in the second temperature image is greater than the third pixel value distribution representation value.
[0189] The present solution can accurately determine the first connected domain, thereby performing subsequent pixel value compensation processing based on the first connected domain to obtain a compensated temperature image, thereby improving the accuracy of the obtained temperature image.
[0190] In one embodiment of the present application, the characterization value determination submodule 502A is specifically configured to:
[0191] The mean of the pixel values of the pixels in the first temperature image is calculated as a first pixel value distribution representation value of the first temperature image.
[0192] In this scheme, since the mean of the pixel values of the pixel points in the first temperature image can accurately reflect the distribution of the pixel values of the pixel points in the first temperature image, using the mean as the first pixel value distribution representation value can improve the accuracy of the first pixel value distribution representation value, thereby performing subsequent pixel value compensation processing based on the first pixel value distribution representation value to obtain a compensated temperature image, which can improve the accuracy of the obtained temperature image.
[0193] In the technical solution of this application, the operations involved in obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.
[0194] It should be noted that the head model in this embodiment is not a head model for a specific user and cannot reflect the personal information of a specific user.
[0195] It should be noted that the two-dimensional face images in this embodiment come from a public dataset.
[0196] The present application also provides an electronic device, such as Figure 6 Shown, including:
[0197] Memory 601, used for storing computer programs;
[0198] The processor 602 is configured to execute the program stored in the memory 601, and implement the following steps:
[0199] Obtaining a first temperature image generated by a temperature sensing device;
[0200] The following steps are performed in parallel to compensate pixel values of pixels in the first temperature image using the determined compensation coefficients to obtain a compensated first temperature image:
[0201] determining a first pixel value distribution representation value of the first temperature image;
[0202] Binarizing the first temperature image according to the second pixel value distribution representation value of the second temperature image to obtain a first binarized image, wherein the second temperature image is a forward adjacent image of the first temperature image generated by the temperature sensing device;
[0203] determining a first connected domain in a second binarized image of the second temperature image, wherein the second binarized image is obtained by binarizing the second temperature image according to a third pixel value distribution representation value of a third temperature image, where the third temperature image is a forward adjacent image of the second temperature image generated by the temperature sensing device;
[0204] A first compensation coefficient for pixel value compensation is determined based on a second connected domain in the third binarized image, wherein the third binarized image is obtained by binarizing the third temperature image based on a fourth pixel value distribution representation value of the fourth temperature image, and the fourth temperature image is a forward adjacent image of the third temperature image generated by the temperature sensing detection device.
[0205] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 602, the communication interface, and the memory 601 communicate with each other via the communication bus.
[0206] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0207] The communication interface is used for communication between the above electronic device and other devices.
[0208] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0209] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0210] In another embodiment provided in the present application, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps of any of the above-mentioned temperature image acquisition methods are implemented.
[0211] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the temperature image acquisition methods in the above embodiments.
[0212] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, 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 a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer 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 one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. 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), or a solid-state drive (SSD).
[0213] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0214] Each embodiment in this specification is described in a related manner. Similar portions between embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, since the apparatus, electronic device, computer-readable storage medium, and computer program product embodiments are generally similar to the method embodiments, their descriptions are relatively simplified. For related portions, reference can be made to the descriptions of the method embodiments.
[0215] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the scope of protection of the present application.
Claims
1. A method for obtaining a temperature image, characterized in that: The method comprises: Obtaining a first temperature image generated by a temperature sensing device; The following steps are performed in parallel to compensate pixel values of pixels in the first temperature image using the determined compensation coefficients to obtain a compensated first temperature image: determining a first pixel value distribution representation value of the first temperature image; Binarizing the first temperature image according to the second pixel value distribution representation value of the second temperature image to obtain a first binarized image, wherein the second temperature image is a forward adjacent image of the first temperature image generated by the temperature sensing device; determining a first connected domain in a second binarized image of the second temperature image, wherein the second binarized image is obtained by binarizing the second temperature image according to a third pixel value distribution representation value of a third temperature image, where the third temperature image is a forward adjacent image of the second temperature image generated by the temperature sensing device; A first compensation coefficient for pixel value compensation is determined based on a second connected domain in the third binarized image, wherein the third binarized image is obtained by binarizing the third temperature image based on a fourth pixel value distribution representation value of the fourth temperature image, and the fourth temperature image is a forward adjacent image of the third temperature image generated by the temperature sensing detection device.
2. The method according to claim 1, characterized in that The compensation coefficient used to compensate the pixel value of the pixel point in the first temperature image is: The first compensation coefficient, or A second compensation coefficient for pixel value compensation is determined based on the third connected domain in the fourth binarized image, wherein the fourth binarized image is obtained by binarizing the fourth temperature image according to the fifth pixel value distribution representation value of the fifth temperature image, and the fifth temperature image is: a forward adjacent image of the fourth temperature image generated by the temperature sensing detection device.
3. The method according to claim 1 or 2, characterized in that The determining of a first compensation coefficient for pixel value compensation according to the second connected domain in the third binarized image includes: For each second connected domain in the third binarized image, the number of pixels included in the second connected domain is counted, and based on the correspondence between the number of pixels and the compensation coefficient, a compensation coefficient corresponding to the counted number is determined as the first compensation coefficient.
4. The method according to claim 3, characterized in that The method of compensating pixel values of pixels in the first temperature image using the determined compensation coefficient to obtain a compensated first temperature image includes: determining a compensation region in the first temperature image having the same position as the connected domain corresponding to the determined compensation coefficient, and compensating pixel values of pixels in the compensation region using the determined compensation coefficient to obtain a compensated first temperature image; or A global compensation coefficient is obtained according to the determined compensation coefficients, and the pixel value of each pixel point in the first temperature image is compensated using the global compensation coefficient to obtain a compensated first temperature image.
5. The method according to claim 1 or 2, characterized in that The determining of a first connected domain in a second binarized image of the second temperature image includes: Determine a connected domain where a first pixel point in the second binary image of the second temperature image is located as a first connected domain, wherein a pixel value of a pixel point corresponding to the first pixel point in the second temperature image is greater than the third pixel value distribution representation value.
6. The method according to claim 1 or 2, characterized in that Determining a first pixel value distribution representation value of the first temperature image includes: The mean of the pixel values of the pixels in the first temperature image is calculated as a first pixel value distribution representation value of the first temperature image.
7. A temperature image acquisition device, characterized in that: The device comprises: An image acquisition module, configured to acquire a first temperature image generated by a temperature sensing device; An image compensation module is configured to trigger the following submodules in parallel to compensate the pixel values of the pixels in the first temperature image using the determined compensation coefficients to obtain a compensated first temperature image: a characterization value determination submodule, configured to determine a first pixel value distribution characterization value of the first temperature image; A binarization submodule, configured to perform binarization on the first temperature image according to a second pixel value distribution representation value of the second temperature image to obtain a first binarized image, wherein the second temperature image is a forward adjacent image of the first temperature image generated by the temperature sensing device; a connected domain determining submodule, configured to determine a first connected domain in a second binarized image of the second temperature image, wherein the second binarized image is obtained by binarizing the second temperature image according to a third pixel value distribution representation value of a third temperature image, wherein the third temperature image is a forward adjacent image of the second temperature image generated by the temperature sensing device; A coefficient determination submodule is used to determine a first compensation coefficient for pixel value compensation based on a second connected domain in a third binarized image, wherein the third binarized image is obtained by binarizing the third temperature image according to a fourth pixel value distribution representation value of a fourth temperature image, and the fourth temperature image is: a forward adjacent image of the third temperature image generated by the temperature sensing detection device.
8. The device according to claim 7, characterized in that The compensation coefficient used to compensate the pixel value of the pixel point in the first temperature image is: the first compensation coefficient; or A compensation coefficient used to compensate pixel values of pixels in the first temperature image is: a second compensation coefficient for pixel value compensation determined based on a third connected domain in a fourth binarized image, wherein the fourth binarized image is obtained by binarizing the fourth temperature image based on a fifth pixel value distribution representation value of a fifth temperature image, and the fifth temperature image is: a forward adjacent image of the fourth temperature image generated by the temperature sensing device; and / or The coefficient determination submodule is specifically configured to: for each second connected domain in the third binarized image, count the number of pixels included in the second connected domain, and determine the compensation coefficient corresponding to the counted number as the first compensation coefficient based on the corresponding relationship between the number of pixels and the compensation coefficient; and / or The image compensation module is specifically configured to: determine a compensation area in the first temperature image having the same position as the connected domain corresponding to the determined compensation coefficient, and compensate pixel values of pixels in the compensation area using the determined compensation coefficient to obtain a compensated first temperature image; or The image compensation module is specifically configured to obtain a global compensation coefficient based on the determined compensation coefficients, and compensate the pixel value of each pixel point in the first temperature image using the global compensation coefficient to obtain a compensated first temperature image; and / or The connected domain determining submodule is specifically configured to: determine that a connected domain where a first pixel point in the second binary image of the second temperature image is located is a first connected domain, wherein a pixel value of a pixel point corresponding to the first pixel point in the second temperature image is greater than the third pixel value distribution representation value; and / or The characterization value determination submodule is specifically configured to calculate a mean value of pixel values of pixels in the first temperature image as a first pixel value distribution characterization value of the first temperature image.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 6 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.