Method and device for solving gray scale difference of spliced infrared image based on block histogram

Through the method based on block histogram, linear interpolation processing is performed on the images spliced ​​by infrared thermal imagers, which solves the problem of brightness differences between the stitching seams and achieves high-quality image fusion.

CN120182103AActive Publication Date: 2025-06-20BEIJING BOP OPTO-ELECTRONICS TECH CO
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510197207.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-06-20
Estimated Expiration
2045-02-21

AI Technical Summary

Technical Problem

When infrared thermal imagers are stitched and fused, the difference in histogram distribution of each thermal imager results in a difference in brightness on both sides of the stitching seam, destroying the consistency and coherence of the image.

Method used

A solution to the grayscale difference between stitched infrared images based on chunked histograms is adopted. By obtaining the original image and grayscale mapping table transmitted by each infrared thermal imager, stitching and chunked histograms are linearly interpolated to generate rich and coherent fusion images.

Benefits of technology

Effectively eliminates the brightness difference of the stitching seams, improves image quality, and ensures smooth transition and high-quality fusion of image data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182103A_ABST
    Figure CN120182103A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a spliced infrared image gray difference solving method and device based on a block histogram. The method comprises the steps that a first-digit original image transmitted by each thermal infrared imager and a gray mapping table are acquired, the gray mapping table represents the mapping relation between pixel values of the first digit and pixel values of the second digit, and the first digit is higher than the second digit; splicing the obtained original images to obtain a spliced image; and block histogram linear interpolation is carried out on the spliced image based on the gray mapping table transmitted by each thermal infrared imager, a fused image after interpolation is obtained, and the fused image is data of the second digit. According to the invention, the brightness difference at the splicing seam of the original image can be eliminated, the image quality is improved, the scheme difficulty is reduced, and the implementation cost is saved.
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 technologies, and particularly to a method and device for solving the gray-scale difference of stitched infrared images based on a block histogram. Background Art

[0002] The application of infrared thermal imagers in the field of security monitoring is constantly expanding. Especially in scenarios that require covering a large field of view, a single thermal imager has been difficult to meet the requirements. Therefore, using multiple infrared thermal imagers for stitching and fusion to form a larger field-of-view image has become an effective solution to this problem.

[0003] Infrared thermal imagers usually need to convert high-bit raw data into low-bit gray-scale data. For example, converting 14-bit raw data into 8-bit gray-scale data for subsequent processing. However, during this process, due to different observation scenarios of different infrared thermal imagers, there are differences in their histogram distributions. As a result, when the gray-scale images output by each infrared thermal imager are stitched and fused, obvious brightness differences will occur on both sides of the stitching seam, thus destroying the consistency and coherence of the image. This will not only cause visual discomfort to the observer but also greatly affect the presentation effect of the stitched image. Summary of the Invention

[0004] In order to solve the problem that it is difficult to solve the brightness difference on both sides of the stitching seam in the stitched images of different infrared thermal imagers in the prior art, the present application provides a method and device for solving the gray-scale difference of stitched infrared images based on a block histogram.

[0005] In the first aspect, the present application provides a method for solving the gray-scale difference of stitched infrared images based on a block histogram, adopting the following technical solutions: A method for solving the gray-scale difference of stitched infrared images based on a block histogram includes: Obtaining a raw image with a first number of bits and a gray-scale mapping table transmitted by each infrared thermal imager, where the gray-scale mapping table represents the mapping relationship between the pixel values of the first number of bits and the second number of bits, and the first number of bits is higher than the second number of bits; Stitching the obtained raw images to obtain a stitched image; Performing block histogram linear interpolation on the stitched image based on the gray-scale mapping table transmitted by each infrared thermal imager to obtain an interpolated fused image, where the fused image is data of the second number of bits.

[0006] By adopting the above technical solution, the electronic device obtains the high-bit raw images transmitted by each infrared thermal imager and their corresponding gray-scale mapping tables. The infrared thermal imager performs partial processing operations, and the electronic device makes full and effective use of the calculation results of each infrared thermal imager, saving a large amount of calculation work of the electronic device processor, reducing the solution difficulty, and reducing the cost. Furthermore, the electronic device stitches the raw images to form an overall view, and uses the gray-scale mapping table to perform block histogram linear interpolation on the stitched image, successfully fusing and converting the high-bit data into low-bit data, generating a fused image with rich details and coherence, and eliminating the brightness difference at the stitching seam of the two raw images in the fused image, improving the image quality.

[0007] In a preferred example of the present application, it can be further configured that: performing block histogram linear interpolation on the stitched image based on the gray-scale mapping table transmitted by each infrared thermal imager to obtain an interpolated fused image, including: Determine the first quantity of the infrared thermal imagers; If the first quantity is two, determine two infrared thermal imagers as the first thermal imager and the second thermal imager; perform block histogram linear interpolation on the stitched image based on the gray-scale mapping tables respectively transmitted by the first thermal imager and the second thermal imager to obtain an interpolated fused image.

[0008] By adopting the above technical solution, different situations of the number of infrared thermal imagers are considered. When the number of infrared thermal imagers is 2, block histogram linear interpolation is performed on the stitched image based on the gray-scale mapping tables transmitted by the two infrared thermal imagers, eliminating the brightness difference of the stitched image, improving the overall consistency and coherence of the image, and thus effectively improving the quality and visual effect of image fusion.

[0009] In a preferred example of the present application, it can be further configured that: performing block histogram linear interpolation on the stitched image based on the gray-scale mapping tables respectively transmitted by the first thermal imager and the second thermal imager to obtain an interpolated fused image, including: Determine the interpolation region in the stitched image, where the interpolation region is the region between the central column of the first raw image and the central column of the second raw image in the stitched image; the first raw image is the raw image obtained by the first thermal imager, and the second raw image is the raw image obtained by the second thermal imager; Perform a linear interpolation step on each pixel point in the interpolation region to obtain the mapped pixel value of each pixel point in the stitched image, and the mapped pixel values of each pixel point form an interpolated fused image; Among them, the linear interpolation step includes: Determine the original pixel value of the current pixel point in the stitched image; Determine the first mapped pixel value of the original pixel value in the grayscale mapping table transmitted by the first thermal imager and the second mapped pixel value of the original pixel value in the grayscale mapping table transmitted by the second thermal imager; Obtain the first distance of the current pixel point from the central column of the first original image and the second distance of the current pixel point from the central column of the second original image; Calculate the mapped pixel value of the current pixel point based on the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance.

[0010] By adopting the above technical solution, combining the grayscale mapping tables of two infrared thermal imagers, performing fine linear interpolation processing on each pixel point in the interpolation area, determining the corresponding mapped values of each pixel point in the two grayscale mapping tables, and then calculating the final mapped pixel value of each pixel point according to the distances of the pixel points from the central columns of the two original images, a high-quality fused image is generated, ensuring smooth transition of image data and retention of details, and effectively improving the realism and visual effect of image fusion.

[0011] In a preferred example of the present application, it can be further configured that: calculating the mapped pixel value of the current pixel point based on the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance includes: substituting the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance into the fusion formula to obtain the mapped pixel value of the current pixel point; The fusion formula is: H C =(H M y + H N x) / (x + y); Wherein, H C is the mapped pixel value; H M is the first mapped pixel value; H N is the second mapped pixel value; x is the first distance; y is the second distance.

[0012] By adopting the above technical solution, using a specific fusion formula, comprehensively considering the grayscale mapped values of two infrared thermal imagers and the distances of pixel points from their respective central columns, accurately calculating the mapped pixel value of each pixel point, ensuring smooth transition of image data in the splicing area, avoiding the abruptness that may occur due to direct splicing, and thus generating a fused image with rich details and natural visual effects.

[0013] In a preferred example of the present application, it can be further configured that: if the first quantity exceeds two, the method further includes: Determine the central column of each original image in the stitched image, and take the area between every two adjacent central columns in the stitched image as a sub-image, obtaining a second quantity of sub-images. The difference between the first quantity and the second quantity is one. For each sub-image, respectively determine the thermal imagers corresponding to the two original images that constitute the sub-image as the third thermal imager and the fourth thermal imager. Perform a linear interpolation step on each pixel point in the sub-image based on the gray-scale mapping tables respectively transmitted by the third thermal imager and the fourth thermal imager to obtain the sub-fused image corresponding to the sub-image. The sub-fused images corresponding to the respective sub-images constitute the fused image after interpolation of the stitched image.

[0014] By adopting the above technical solution, when the number of infrared thermal imagers exceeds two, divide multiple sub-images from the stitched image, and respectively apply the linear interpolation method to each sub-image. Use the gray-scale mapping tables of the corresponding two thermal imagers to calculate the mapped value of each pixel, and finally combine them into a complete fused image, effectively solving the problem of inconsistent gray levels in multi-thermal imager image stitching, and ensuring smooth transition and high-quality fusion of image data.

[0015] In a preferred example, the present application can be further configured as: each infrared thermal imager obtains a gray-scale mapping table based on the captured original image and a mapping formula. The mapping formula is: where h i is the second-digit pixel value after mapping of the first-digit pixel value i; i is the pixel value of the first digit, and the value range of i is [0, 2 m -1], m is the first digit; n j is the number of pixel points with pixel value j in the original image; M is or Q, Q is the total number of pixel points in an original image; N is 2 n , n is the second digit.

[0016] By adopting the above technical solution, each infrared thermal imager uses a specific mapping formula to map the high-order original image pixel values to low-order pixel values to generate a gray-scale mapping table. The mapping formula ensures reasonable distribution and conversion of pixel values by statistically counting the frequencies of each pixel value in the original image and normalizing them to the range of low-order pixel values.

[0017] In a preferred example, the present application can be further configured as: the first digit is 14 bits, and the second digit is 8 bits.

[0018] In a second aspect, the present application provides an electronic device, adopting the following technical solution: One or more processors; A memory; At least one application program, where the at least one application program is stored in a memory and configured to be executed by at least one processor, and the at least one application program is configured to: execute the method for solving the gray-scale difference of the spliced infrared image based on the block histogram as described in any one of the first aspects.

[0019] In a third aspect, the present application provides a computer-readable storage medium, adopting the following technical solution: A computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is made to execute the method for solving the gray-scale difference of the spliced infrared image based on the block histogram as described in any one of the first aspects.

[0020] In a fourth aspect, the present application provides a computer program product, adopting the following technical solution: A computer program product includes a computer program. When the computer program is executed by a processor, it implements the method for solving the gray-scale difference of the spliced infrared image based on the block histogram as described in any one of the first aspects.

[0021] In summary, the present application includes the following beneficial technical effects: The present application obtains the high-order original images transmitted by each infrared thermal imager and their corresponding gray-scale mapping tables through an electronic device. The infrared thermal imager performs partial processing operations. The electronic device makes full and effective use of the calculation results of each infrared thermal imager, greatly saving the calculation work of the processor of the electronic device, reducing the difficulty of the solution, reducing the cost. Furthermore, the electronic device splices the original images to form an overall view, and uses the gray-scale mapping table to perform block histogram linear interpolation on the spliced image, successfully converting the high-order data fusion into low-order data, generating a fusion image with rich details and coherence, and eliminating the brightness difference at the splicing seam of the two original images in the fusion image, improving the image quality. Description of the Drawings

[0022] Figure 1 is a schematic flowchart of a method for solving the gray-scale difference of the spliced infrared image based on the block histogram provided by an embodiment of the present application; Figure 2 is a schematic diagram of a spliced image composed of 2 original images provided by an embodiment of the present application; Figure 3 is a schematic diagram of a spliced image composed of 3 original images provided by an embodiment of the present application; Figure 4 is a schematic diagram of a spliced image composed of 4 original images provided by an embodiment of the present application; Figure 5 is a schematic diagram of block histogram linear interpolation provided by an embodiment of the present application; Figure 6It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specific embodiments

[0023] The following will further elaborate on the present application in conjunction with the attached Figure 1 - attached Figure 6 drawings for a more detailed description.

[0024] This specific embodiment is only an interpretation of the present application and does not limit the present application. After reading this specification, those skilled in the art can make modifications to this embodiment without creative contributions as needed, but as long as it is within the scope of the claims of the present application, it is protected by the patent law.

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts fall within the scope of protection of the present application.

[0026] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after, unless otherwise specified.

[0027] It should be noted that in the optional embodiments of the present application, for relevant data such as object information, when the embodiments in the present application are applied to specific products or technologies, permission or consent from the object needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions. That is to say, if the embodiments in the present application involve data related to objects, it needs to be obtained under the authorization and consent of the object, the authorization and consent of relevant departments, and in compliance with the relevant laws, regulations, and standards of relevant countries and regions. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject needs to be obtained, and the embodiments also need to be implemented under the authorization and consent of the object.

[0028] The embodiments of the present application provide a method for solving the gray-scale difference of spliced infrared images based on a block histogram, as Figure 1As shown, the method provided in the embodiment of the present application is executed by an electronic device, which can be a server or a terminal device. Among them, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiment of the present application. The method includes steps S101 - step S103, where: S101. Obtain the original image of the first number and the gray scale mapping table transmitted by each infrared thermal imager. The gray scale mapping table represents the mapping relationship between the pixel values of the first number and the second number, and the first number is higher than the second number.

[0029] Specifically, the imaging core of each infrared thermal imager will capture the original image of the first number. The first number is determined by the attributes of the infrared thermal imager. The attributes of different infrared thermal imagers are the same. The first number represents the gray level of the pixel points in the original image. The first number can be 14 bits, then the pixel value range of the pixel points in the original image is [0, 2 14 -1].

[0030] For any infrared thermal imager, its gray scale mapping table is obtained by the histogram algorithm from the original image it captures. The second number can be 8 bits, then the gray scale mapping table includes the mapping value of each pixel value in [0, 2 14 -1] within the range of [0, 2 8 -1].

[0031] S102. Stitch the obtained original images to obtain a stitched image.

[0032] Specifically, the number of infrared thermal imagers is not less than 2. The original images captured by different infrared thermal imagers are stitched left and right through a stitching algorithm to obtain a stitched image containing a complete picture. Optional stitching algorithms include: feature point-based stitching algorithms (such as fade-in and fade-out algorithms), gray information-based stitching algorithms, template matching-based stitching algorithms, etc. This embodiment does not make a limitation, and those skilled in the art can flexibly select a stitching algorithm according to actual needs.

[0033] S103. Perform block histogram linear interpolation on the stitched image based on the gray scale mapping table transmitted by each infrared thermal imager to obtain an interpolated fused image. The fused image is data of the second number.

[0034] Specifically, determine that the number of infrared thermal imagers is represented as the first number.

[0035] In a possible case, the first number is 2, such as Figure 2As shown, the two infrared thermal imagers are taken as the first thermal imager and the second thermal imager from left to right, and the image captured by the first thermal imager is taken as the first original image ( Figure 2 1 in Figure 2 ), and the image captured by the second thermal imager is taken as the second original image ( Figure 2 2 in

[0036] ). The dashed line located on 1 represents the central column of 1, and the dashed line located on 2 represents the central column of 2. Block histogram linear interpolation is performed on the stitched image based on the grayscale mapping tables transmitted by the first thermal imager and the second thermal imager respectively, including determining the interpolation region from the stitched image composed of 1 and 2, and performing a linear interpolation step on each pixel point in the interpolation region. The interpolation region is the region between the central column of the first original image and the central column of the second original image in the stitched image, and in Figure 3 it is the region formed on the right side of the central column of 1 and the left side of the central column of 2 in the stitched image.

[0037] In another possible case, the first quantity is greater than 2. Taking 3 infrared thermal imagers as an example, the original images captured by the 3 infrared thermal imagers are 3, 4, and 5 respectively, and the formed stitched image is as Figure 4 shown. The first quantity is 3, and the dashed lines represent the central columns of the original images. The 3 original images respectively correspond to the third thermal imager, the fourth thermal imager, and the fifth thermal imager from left to right. In the stitched image, the region formed on the right side of the central column of 3 and the left side of the central column of 4 is a sub-image, and the region formed on the right side of the central column of 4 and the left side of the central column of 5 is a sub-image, thus obtaining 2 sub-images. Block histogram linear interpolation is performed on the left sub-image based on the grayscale mapping tables transmitted by the third thermal imager and the fourth thermal imager respectively, and block histogram linear interpolation is performed on the right sub-image based on the grayscale mapping tables transmitted by the fourth thermal imager and the fifth thermal imager respectively.

[0038] Perform block histogram linear interpolation on the first sub-image based on the grayscale mapping tables transmitted by the sixth thermal imager and the seventh thermal imager respectively, perform block histogram linear interpolation on the second sub-image based on the grayscale mapping tables transmitted by the seventh thermal imager and the eighth thermal imager respectively, and perform block histogram linear interpolation on the third sub-image based on the grayscale mapping tables transmitted by the eighth thermal imager and the ninth thermal imager respectively. And so on. When the number of infrared thermal imagers exceeds 2, refer to the above process to determine the central column of each original image in the stitched image. Take the area between every two adjacent central columns in the stitched image as a sub-image, and perform block histogram linear interpolation on each sub-image respectively. Block histogram linear interpolation is to adjust the pixel value of each pixel point, and finally obtain a fused image with the brightness difference at the seam eliminated after adjustment.

[0039] In this embodiment, the electronic device obtains the high-bit original images transmitted by each infrared thermal imager and their corresponding grayscale mapping tables. The infrared thermal imager performs partial processing operations. The electronic device makes full and effective use of the calculation results of each infrared thermal imager, greatly saving the calculation work of the electronic device processor, reducing the difficulty of the solution, and reducing the cost. Furthermore, the electronic device stitches the original images to form an overall view, and performs block histogram linear interpolation on the stitched image using the grayscale mapping table, successfully converting the high-bit data fusion into low-bit data, generating a fused image with rich details and coherence, and eliminating the brightness difference at the seam of the two original images in the fused image, improving the image quality.

[0040] A possible implementation manner of the embodiment of the present application is to perform block histogram linear interpolation on the stitched image based on the grayscale mapping table transmitted by each infrared thermal imager to obtain an interpolated fused image, including: Determine the first number of infrared thermal imagers; If the first number is two, determine the two infrared thermal imagers as the first thermal imager and the second thermal imager; perform block histogram linear interpolation on the stitched image based on the grayscale mapping tables transmitted by the first thermal imager and the second thermal imager respectively to obtain an interpolated fused image.

[0041] This embodiment considers different situations of the number of infrared thermal imagers. When the number of infrared thermal imagers is 2, block histogram linear interpolation is performed on the stitched image based on the grayscale mapping tables transmitted by the two infrared thermal imagers, eliminating the brightness difference of the stitched image, enhancing the overall consistency and coherence of the image, and thus effectively improving the quality and visual effect of image fusion.

[0042] A possible implementation manner of the embodiment of the present application is to perform block histogram linear interpolation on the stitched image based on the grayscale mapping tables transmitted by the first thermal imager and the second thermal imager respectively to obtain an interpolated fused image, including: Determine the interpolation region in the stitched image. The interpolation region is the region between the central column of the first original image and the central column of the second original image in the stitched image. The first original image is the original image obtained by the first thermal imager, and the second original image is the original image obtained by the second thermal imager. Perform a linear interpolation step on each pixel point in the interpolation region to obtain the mapped pixel value of each pixel point in the stitched image. The mapped pixel values of each pixel point form the interpolated fused image. Among them, the linear interpolation step includes: Determine the original pixel value of the current pixel point in the stitched image. Determine the first mapped pixel value of the original pixel value in the gray-scale mapping table transmitted by the first thermal imager, and the second mapped pixel value of the original pixel value in the gray-scale mapping table transmitted by the second thermal imager. Obtain the first distance of the current pixel point from the central column of the first original image and the second distance of the current pixel point from the central column of the second original image. Based on the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance, calculate the mapped pixel value of the current pixel point.

[0043] See Figure 5 , taking any pixel point A in the stitched image as an example, determine the original pixel value of the current pixel point A in the stitched image. The original pixel value is a data with the first number of digits, and both the first mapped pixel value and the second mapped pixel value are data with the second number of digits. Obtain the column number where the current pixel point A is located in the stitched image and the column number where the central column (dotted line a) of the first original image 1 is located, and calculate the absolute value of the difference between the column number where the current pixel point A is located and the column number where the dotted line a is located as the first distance x. Determine the column number where the central column (dotted line b) of the second original image 2 is located, and calculate the absolute value of the difference between the column number where the current pixel point A is located and the column number where the dotted line b is located as the second distance y.

[0044] Furthermore, substitute the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance into the fusion formula to obtain the mapped pixel value of the current pixel point A.

[0045] In this embodiment, by combining the gray-scale mapping tables of two infrared thermal imagers, a fine linear interpolation process is performed on each pixel point in the interpolation region to determine the corresponding mapped values of each pixel point in the two gray-scale mapping tables, and then according to the distances of the pixel points from the central columns of the two original images, the final mapped pixel value of each pixel point is calculated by weighting, so as to generate a high-quality fused image, ensuring the smooth transition and detail retention of the image data, and effectively improving the realism and visual effect of the image fusion.

[0046] A possible implementation of the embodiment of the present application calculates the mapped pixel value of the current pixel point based on the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance, including: Substitute the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance into the fusion formula to obtain the mapped pixel value of the current pixel point; When the current pixel point is located in the interpolation area, the fusion formula is: H C =(H M y + H N x) / (x + y); When the current pixel point is located in the area to the left of the central column of the first original image, the fusion formula is: H C =H M ; When the current pixel point is located in the area to the right of the central column of the second original image, the fusion formula is: H C =H N ; Wherein, H C is the mapped pixel value; H M is the first mapped pixel value; H N is the second mapped pixel value; x is the first distance; y is the second distance.

[0047] See Figure 5 , when the current pixel point is located in the interpolation area (i.e., Figure 5 the area to the right of the dashed line a and to the left of the dashed line b in the stitched image), the fusion formula H C =(H M y + H N x) / (x + y) is used to determine the mapped pixel value of the current pixel point; when the current pixel point is located in the area to the left of the central column (dashed line a) of the first original image, the fusion formula is: H C =H M , that is, the pixel value of the current pixel point is not adjusted, and the pixel value of the current pixel point in the first original image is used as the mapped pixel value; when the current pixel point is located in the area to the right of the central column (dashed line b) of the second original image, the fusion formula is: H C =H N , the pixel value of the current pixel point is not adjusted, and the pixel value of the current pixel point in the second original image is used as the mapped pixel value.

[0048] This embodiment adopts a specific fusion formula, comprehensively considers the gray-scale mapped values of two infrared thermal imagers and the distances of pixel points relative to their respective central columns, accurately calculates the mapped pixel value of each pixel point, ensures the smooth transition of image data in the stitching area, avoids the abrupt feeling that may be generated by direct stitching, and thus generates a fused image with rich details and natural visual effects.

[0049] In a possible implementation of the embodiment of the present application, if the first quantity exceeds two, the method further includes: Determine the central column of each original image in the stitched image, and take the area between every two adjacent central columns in the stitched image as a sub-image, obtaining a second quantity of sub-images. The difference between the first quantity and the second quantity is one; For each sub-image, respectively determine the thermal imagers corresponding to the two original images constituting the sub-image as the third thermal imager and the fourth thermal imager; perform a linear interpolation step on each pixel point in the sub-image based on the gray-scale mapping tables respectively transmitted by the third thermal imager and the fourth thermal imager, obtaining a sub-fused image corresponding to the sub-image; The sub-fused images corresponding to the respective sub-images constitute the fused image after interpolation of the stitched image.

[0050] In this embodiment, when the number of infrared thermal imagers exceeds two, multiple sub-images are divided from the stitched image, and the linear interpolation method is respectively applied to each sub-image. The gray-scale mapping tables of the corresponding two thermal imagers are used to calculate the mapped values of each pixel, and finally a complete fused image is combined, effectively solving the problem of inconsistent gray scale in multi-thermal imager image stitching, and ensuring smooth transition and high-quality fusion of image data.

[0051] In a possible implementation of the embodiment of the present application, each infrared thermal imager obtains a gray-scale mapping table based on the captured original image and a mapping formula; The mapping formula is: where h i is the pixel value of the second digit after mapping of the pixel value i of the first digit; i is the pixel value of the first digit, and the value range of i is [0, 2 m -1], m is the first digit; n j is the number of pixel points with pixel value j in the original image; M is or Q, Q is the total number of pixel points in an original image; N is 2 n , and n is the second digit.

[0052] Specifically, for any infrared thermal imager, a gray-scale mapping table is generated according to the original image of the infrared thermal imager. Specifically, histogram statistics are performed to form a pixel statistics table, and the pixel statistics table includes the number of pixels of each pixel value in [0, 2 m -1] in the original image. Furthermore, a gray-scale mapping table is formed based on the mapping formula, and the gray-scale mapping table includes the mapped pixel values of each pixel value in [0, 2 m -1] in [0, 2 n -1].

[0053] When the first number is 14 bits and the second number is 8 bits, the grayscale mapping table includes the mapped pixel values in [0, 255] for each pixel value in [0, 16383].

[0054] Among them, the basic mapping formula is:

[0055] To prevent the image from being too bright, it can be improved to a platform histogram. When the number of pixels reaches a certain value (i.e., the platform value), the accumulation stops, that is, n i ≤L, where L is the platform value.

[0056] At this time, the mapping formula is improved to:

[0057] In this embodiment, each infrared thermal imager uses a specific mapping formula to map the high-order original image pixel values to low-order pixel values, generating a grayscale mapping table. The mapping formula ensures a reasonable distribution and conversion of pixel values by statistically counting the frequencies of each pixel value in the original image and normalizing them to the range of low-order pixel values.

[0058] In a possible implementation manner of the embodiment of the present application, the first number is 14 bits and the second number is 8 bits.

[0059] This embodiment can simply and effectively eliminate the grayscale differences of each thermal imager when multiple infrared thermal imagers are stitched and fused, enabling the stitched and fused image to maintain a consistent grayscale output, without obvious brightness differences between each thermal imager, enhancing the comfort of human eye observation. At the same time, the technical solution of this embodiment is simple and effective, fully and effectively utilizes the calculation results of each infrared thermal imager, greatly saves the computing work of the electronic device processor, reduces the difficulty of the solution, and reduces the cost.

[0060] In the embodiment of the present application, an electronic device is provided, such as Figure 6 shown, Figure 6 The electronic device 600 shown includes: a processor 601 and a memory 603. Among them, the processor 601 and the memory 603 are connected, such as connected through a bus 602. Optionally, the electronic device 600 may further include a transceiver 604. It should be noted that in practical applications, the transceiver 604 is not limited to one, and the structure of the electronic device 600 does not constitute a limitation to the embodiment of the present application.

[0061] The processor 601 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of this application. The processor 601 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0062] The bus 602 may include a path for transmitting information between the above components. The bus 602 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 602 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0063] The memory 603 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or it may also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0064] The memory 603 is used to store the application program code for executing the solution of this application, and is controlled by the processor 601 for execution. The processor 601 is used to execute the application program code stored in the memory 603 to implement the content shown in the foregoing embodiments of the method for solving the gray-scale difference of the spliced infrared images based on the block histogram.

[0065] Figure 6 The illustrated electronic device is merely an example and should not impose any limitation on the functions and the scope of use of the embodiments of this application.

[0066] The embodiments of this application provide a computer-readable storage medium, on which a computer program is stored. When the computer program runs on a computer, the computer can execute the content shown in the foregoing embodiments of the method for solving the gray-scale difference of the spliced infrared images based on the block histogram.

[0067] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this application, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least some of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

[0068] The embodiments of this application provide a computer program product, including a computer program. When the computer program is executed by a processor, the content shown in the foregoing embodiments of the method for solving the gray-scale difference of the spliced infrared images based on the block histogram is implemented.

[0069] The above are only some embodiments of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A method for solving grayscale differences in spliced ​​infrared images based on block histograms, characterized in that: include: Acquire the original image of the first digit transmitted by each infrared thermal imager and a grayscale mapping table, wherein the grayscale mapping table represents a mapping relationship between the pixel values ​​of the first digit and the second digit, and the first digit is higher than the second digit; The obtained original images are stitched together to obtain a stitched image; Based on the grayscale mapping table transmitted by each infrared thermal imager, block histogram linear interpolation is performed on the stitched image to obtain an interpolated fused image, and the fused image is the data of the second digit.

2. The method for solving grayscale difference of mosaic infrared images based on block histogram according to claim 1 is characterized in that: The step of performing block histogram linear interpolation on the stitched image based on the grayscale mapping table transmitted by each infrared thermal imager to obtain an interpolated fused image includes: Determining a first number of the infrared thermal imagers; If the first number is two, the two infrared thermal imagers are determined to be a first thermal imager and a second thermal imager; and block histogram linear interpolation is performed on the stitched image based on the grayscale mapping tables respectively transmitted by the first thermal imager and the second thermal imager to obtain an interpolated fused image.

3. The method for solving grayscale difference of mosaic infrared images based on block histogram according to claim 2 is characterized in that: The performing block histogram linear interpolation on the stitched image based on the grayscale mapping tables respectively transmitted by the first thermal imager and the second thermal imager to obtain an interpolated fused image includes: Determine an interpolation area in the stitched image, where the interpolation area is an area between a center column of a first original image and a center column of a second original image in the stitched image; the first original image is an original image acquired by the first thermal imager, and the second original image is an original image acquired by the second thermal imager; Performing a linear interpolation step on each pixel point in the interpolation area to obtain a mapped pixel value of each pixel point in the stitched image, wherein the mapped pixel values ​​of each pixel point constitute an interpolated fused image; Wherein, the linear interpolation step comprises: Determine the original pixel value of the current pixel in the stitched image; Determine a first mapped pixel value of the original pixel value in the grayscale mapping table transmitted by the first thermal imager, and a second mapped pixel value of the original pixel value in the grayscale mapping table transmitted by the second thermal imager; Acquire a first distance between the current pixel and the center column of the first original image, and a second distance between the current pixel and the center column of the second original image; The mapped pixel value of the current pixel is calculated based on the first mapped pixel value, the second mapped pixel value, the first distance, and the second distance.

4. The method for solving grayscale difference of mosaic infrared images based on block histogram according to claim 3 is characterized in that: The calculating the mapping pixel value of the current pixel point based on the first mapping pixel value, the second mapping pixel value, the first distance, and the second distance includes: Substituting the first mapped pixel value, the second mapped pixel value, the first distance and the second distance into a fusion formula to obtain a mapped pixel value of the current pixel; The fusion formula is: C =(H M y+H N x) / (x+y); Among them, H C is the mapped pixel value; H M is the first mapped pixel value; H N is the second mapped pixel value; x is the first distance; y is the second distance.

5. The method for solving grayscale difference of mosaic infrared images based on block histogram according to claim 2 is characterized in that: If the first number exceeds two, the method further comprises: Determine a center column of each original image in the stitched image, and use an area between every two adjacent center columns in the stitched image as a sub-image to obtain a second number of sub-images, wherein a difference between the first number and the second number is one; For each sub-image, the thermal imagers corresponding to the two original images constituting the sub-image are respectively determined to be the third thermal imager and the fourth thermal imager; a linear interpolation step is performed on each pixel point in the sub-image based on the grayscale mapping tables respectively transmitted by the third thermal imager and the fourth thermal imager to obtain a sub-fusion image corresponding to the sub-image; The sub-fused images corresponding to the sub-images constitute the fused image after the stitched image is interpolated.

6. The method for solving grayscale difference problem of spliced ​​infrared images based on block histogram according to claim 1, characterized in that: Each infrared thermal imager obtains a grayscale mapping table based on the captured original image and the mapping formula; The mapping formula is: Among them, h i is the second-digit pixel value after mapping the first-digit pixel value i; i is the first-digit pixel value, and the value range of i is [0, 2 m -1], m is the first digit; n j is the number of pixels with pixel value j in the original image; M is Or Q, Q is the total number of pixels in an original image; N is 2 n , n is the second digit.

7. The method for solving grayscale difference problem of spliced ​​infrared images based on block histogram according to claim 1, characterized in that: The first digit is 14 digits, and the second digit is 8 digits.

8. An electronic device, characterized in that: include: at least one processor; Memory; At least one application, wherein at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the grayscale difference solution method for stitching infrared images based on block histograms as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the grayscale difference solution method for stitching infrared images based on block histograms as described in any one of claims 1 to 7.

10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of solving the grayscale difference solution of spliced ​​infrared images based on block histograms as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • High-dynamic image processing method and device, electronic equipment and readable storage medium

    CN117474774A

  • Method for stitching images of capsule endoscope, electronic device and readable storage medium

    US20230123664A1

  • Image processing method and apparatus, electronic device, and storage medium

    US20240046408A1

  • Infrared image processing method and device, and infrared camera

    WO2022061899A1

  • Video frame interpolation method and apparatus, and electronic device, storage medium, program and program product

    WO2023050723A1