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

By using the block histogram linear interpolation method and the grayscale mapping table of the infrared thermal imager, the problem of brightness difference in infrared thermal image stitching and fusion is solved, generating high-quality fused images, improving image consistency and visual effect, and reducing computational cost.

CN120182103BActive Publication Date: 2025-11-21BEIJING BOP OPTO-ELECTRONICS TECH CO
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

During the stitching and fusion process of infrared thermal imagers, the differences in histogram distribution among the various thermal imagers lead to differences in brightness on both sides of the stitching seam, affecting image consistency and coherence, causing visual discomfort to the observer and a decrease in the quality of the stitched image.

Method used

A block histogram-based stitching method is adopted. By acquiring the high-bit original image and its grayscale mapping table of each infrared thermal imager, block histogram linear interpolation is performed to generate a low-bit fused image. Electronic equipment is used for partial processing to eliminate brightness differences at the stitching seams.

Benefits of technology

It generates richly detailed and coherent fused images, eliminates brightness differences at the stitching seams, improves image quality and visual effects, and reduces the computational burden and cost of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182103B_ABST
    Figure CN120182103B_ABST
Patent Text Reader

Abstract

The application 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 following steps: acquiring a first-bit original image transmitted by each infrared thermal imager and a gray mapping table, the gray mapping table representing a mapping relationship between a first-bit and a second-bit pixel value, and the first-bit is higher than the second-bit; splicing the acquired original images to obtain a spliced image; performing block histogram linear interpolation on the spliced image based on the gray mapping table transmitted by each infrared thermal imager to obtain a fused image after interpolation, and the fused image is second-bit data. The application can eliminate the brightness difference at the splicing seam of the original image, improve the image quality, reduce the scheme difficulty, and save the implementation cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a method and device for solving gray difference of spliced infrared images based on block histogram. BACKGROUND

[0002] The application of infrared thermal imager in the field of security monitoring is constantly expanding, especially in the scene that needs to cover a large field of view, a single thermal imager has been difficult to meet the demand. Therefore, using multiple infrared thermal imagers for splicing 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 data, such as converting 14-bit raw data into 8-bit gray data for subsequent processing. However, in this process, due to the different observation scenes of different infrared thermal imagers, there are differences in their histogram distributions, which leads to obvious brightness differences on both sides of the splicing seam when the gray images output by each infrared thermal imager are spliced and fused, thereby destroying the consistency and continuity of the image, not only causing the observer's visual discomfort, but also greatly affecting the presentation effect of the spliced image. SUMMARY

[0004] In order to solve the problem that the existing technology cannot solve the brightness difference on both sides of the splicing seam in the spliced image of different infrared thermal imagers, the present application provides a method and device for solving gray difference of spliced infrared images based on block histogram.

[0005] In a first aspect, the present application provides a method for solving gray difference of spliced infrared images based on block histogram, which adopts the following technical scheme:

[0006] A method for solving gray difference of spliced infrared images based on block histogram, comprising:

[0007] Obtaining the first-bit raw image transmitted by each infrared thermal imager and the gray mapping table, the gray mapping table representing the mapping relationship between the first-bit and second-bit pixel values, and the first-bit being higher than the second-bit;

[0008] Splicing each raw image obtained to obtain a spliced image;

[0009] Performing block histogram linear interpolation on the spliced image based on the gray mapping table transmitted by each infrared thermal imager to obtain a fused image after interpolation, the fused image being the second-bit data.

[0010] By adopting the technical scheme, the electronic device obtains high-bit original images transmitted by each infrared thermal imager and corresponding gray scale mapping tables, and performs partial processing operation by the infrared thermal imager, so that the electronic device fully and effectively utilizes the calculation results of each infrared thermal imager, greatly saves the calculation work of the processor of the electronic device, reduces the scheme difficulty and cost, and further, the electronic device splices the original images to form an overall view, and performs block histogram linear interpolation on the spliced image by using the gray scale mapping table, successfully converts high-bit data into low-bit data, and generates a fused image with rich details and continuity, and the brightness difference of the two original image splicing seams in the fused image is eliminated, and the image quality is improved.

[0011] In a preferred example, the application can be further configured to: performing block histogram linear interpolation on the spliced image based on the gray scale mapping tables transmitted by each infrared thermal imager to obtain a fused image after interpolation, comprising:

[0012] determining the first number of the infrared thermal imagers;

[0013] if the first number is two, determining two infrared thermal imagers as a first thermal imager and a second thermal imager; performing block histogram linear interpolation on the spliced image based on the gray scale mapping tables transmitted by the first thermal imager and the second thermal imager to obtain a fused image after interpolation.

[0014] By adopting the technical scheme, different cases of the number of infrared thermal imagers are considered, when the number of infrared thermal imagers is two, block histogram linear interpolation is performed on the spliced image based on the gray scale mapping tables transmitted by the two infrared thermal imagers, the brightness difference of the spliced image is eliminated, the consistency and continuity of the whole image are improved, and thus the quality and visual effect of image fusion are effectively improved.

[0015] In a preferred example, the application can be further configured to: performing block histogram linear interpolation on the spliced image based on the gray scale mapping tables transmitted by the first thermal imager and the second thermal imager to obtain a fused image after interpolation, comprising:

[0016] determining an interpolation region in the spliced image, the interpolation region being a region between a center column of a first original image and a center column of a second original image in the spliced image; the first original image being an original image obtained by the first thermal imager, and the second original image being an original image obtained by the second thermal imager;

[0017] performing a linear interpolation step on each pixel point in the interpolation region to obtain a mapping pixel value of each pixel point in the spliced image, and the mapping pixel values of the pixel points constitute a fused image after interpolation;

[0018] The linear interpolation step comprises:

[0019] determine a raw pixel value of the current pixel point in the spliced image;

[0020] determine a first mapping pixel value of the raw pixel value in a gray scale mapping table transmitted by the first thermal imager, and a second mapping pixel value of the raw pixel value in a gray scale mapping table transmitted by the second thermal imager;

[0021] obtain a first distance of the current pixel point from a center column of the first raw image, and a second distance of the current pixel point from a center column of the second raw image;

[0022] calculate a 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.

[0023] By adopting the technical solution, each pixel point in the interpolation region is subjected to fine linear interpolation processing, corresponding mapping values of each pixel point in two gray scale mapping tables are determined, and then the final mapping pixel value of each pixel point is calculated by weighting according to the distances of the pixel point from the center columns of the two raw images, so that a high-quality fusion image is generated, smooth transition and detail retention of image data are ensured, and the sense of reality and visual effect of image fusion are effectively improved.

[0024] In a preferred example, the application can be further configured to: the calculation of 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 comprises: substituting the first mapping pixel value, the second mapping pixel value, the first distance and the second distance into a fusion formula to obtain the mapping pixel value of the current pixel point;

[0025] The fusion formula is: H C =(H M y+H N x) / (x+y);

[0026] wherein, H C is the mapping pixel value; H M is the first mapping pixel value; H N is the second mapping pixel value; x is the first distance; and y is the second distance.

[0027] By adopting the technical scheme, the gray mapping values of two infrared thermal imagers and the distances of the pixel points relative to the center columns of the two infrared thermal imagers are comprehensively considered by using a specific fusion formula, the mapping pixel value of each pixel point is accurately calculated, the smooth transition of the image data in the splicing area is ensured, and the abrupt feeling caused by direct splicing is avoided, so that a fusion image with rich details and natural visual effect is generated.

[0028] The application can be further configured in a preferred example that if the first number exceeds two, the method further comprises:

[0029] determining the center column of each original image in the spliced image, taking the area between each two adjacent center columns in the spliced image as a sub-image, obtaining a second number of sub-images, and the difference between the first number and the second number is one; for each sub-image, the two original images constituting the sub-image are determined as a third thermal imager and a fourth thermal imager respectively; performing a linear interpolation step on each pixel point in the sub-image based on the gray mapping tables transmitted by the third thermal imager and the fourth thermal imager respectively, to obtain a sub-fusion image corresponding to the sub-image;

[0030] The sub-fusion images corresponding to the sub-images constitute the fusion image after interpolation of the spliced image.

[0031] By adopting the technical scheme, when the number of infrared thermal imagers exceeds two, multiple sub-images are divided from the spliced image, and a linear interpolation method is applied to each sub-image respectively, the mapping value of each pixel is calculated by using the gray mapping tables of the corresponding two thermal imagers, and finally a complete fusion image is combined, effectively solving the problem of inconsistent gray in multi-thermal imager image splicing, and ensuring the smooth transition and high-quality fusion of image data.

[0032] The application can be further configured in a preferred example that the gray mapping table of each infrared thermal imager is obtained based on the original image and a mapping formula;

[0033] The mapping formula is: Wherein, h i is the second number of pixel values mapped from the first number of pixel values i; i is the first number of pixel values, the value range of i is [0, 2 m -1], m is the first number; 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 number.

[0034] By adopting the technical scheme, each infrared thermal imager utilizes a specific mapping formula to map the high-bit original image pixel value to a low-bit pixel value, and generate a gray scale mapping table, the mapping formula is obtained by counting the frequency of each pixel value in the original image and normalizing it to the pixel value range of the low-bit number, thereby ensuring the reasonable distribution and conversion of the pixel value.

[0035] In a preferred example, the first bit number is 14 bits, and the second bit number is 8 bits.

[0036] In a second aspect, the application provides an electronic device, which adopts the following technical scheme:

[0037] one or more processors;

[0038] a memory;

[0039] at least one application program, wherein the at least one application program is stored in the memory and is configured to be executed by the at least one processor, and the at least one application program is configured to execute the block histogram-based infrared image splicing gray difference solving method according to any one of the first aspect.

[0040] In a third aspect, the application provides a computer-readable storage medium, which adopts the following technical scheme:

[0041] A computer-readable storage medium, which stores a computer program, when the computer program is executed in a computer, the computer is caused to execute the block histogram-based infrared image splicing gray difference solving method according to any one of the first aspect.

[0042] In a fourth aspect, the application provides a computer program product, which adopts the following technical scheme:

[0043] A computer program product, which includes a computer program, when the computer program is executed by a processor, the block histogram-based infrared image splicing gray difference solving method according to any one of the first aspect is realized.

[0044] In summary, the application has the following beneficial technical effects:

[0045] The application obtains high-bit original images and corresponding gray scale mapping tables transmitted by each infrared thermal imager through an electronic device, and performs partial processing operation by the infrared thermal imager. The electronic device fully and effectively utilizes the calculation results of each infrared thermal imager, greatly saves the calculation work of the electronic device processor, reduces the scheme difficulty, and reduces the cost. Further, the electronic device splices the original images to form an overall view, and performs block histogram linear interpolation on the spliced image by using the gray scale mapping table, successfully converts the high-bit data fusion into low-bit data, generates a fusion image with rich details and continuity, and eliminates the brightness difference of the two original image splicing seams in the fusion image, thereby improving the image quality. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 is a flowchart of a block histogram-based infrared image splicing gray scale difference solving method provided by an embodiment of the application;

[0047] Figure 2 is a schematic diagram of a spliced image composed of two original images provided by an embodiment of the application;

[0048] Figure 3 is a schematic diagram of a spliced image composed of three original images provided by an embodiment of the application;

[0049] Figure 4 is a schematic diagram of a spliced image composed of four original images provided by an embodiment of the application;

[0050] Figure 5 is a schematic diagram of block histogram linear interpolation provided by an embodiment of the application;

[0051] Figure 6 is a schematic diagram of a structure of an electronic device provided by an embodiment of the application. DETAILED DESCRIPTION

[0052] The following will be described in detail with reference to the accompanying drawings. Figure 1 - the accompanying drawings Figure 6 The application will be further described in detail.

[0053] The present embodiment is only an explanation of the application, and is not a limitation of the application. Those skilled in the art can make modifications to the embodiment without creative contribution after reading the present specification, but as long as the modifications are within the scope of the claims of the application, they are protected by the patent law.

[0054] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0055] In addition, the term "and / or" in the present application is only used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent three cases of A alone, A and B together, and B alone. In addition, the character " / " in the present application generally represents an "or" relationship between the associated objects unless otherwise specified.

[0056] It should be noted that in the optional embodiments of the present application, the object information and other related data involved in the embodiments of the present application when applied to specific products or technologies need to obtain the permission or consent of the object, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of countries and regions. That is, if the embodiments of the present application involve data related to the object, the data needs to be obtained with the authorization and consent of the object, the authorization and consent of the relevant department, and in compliance with the relevant laws, regulations and standards of the country and region. If personal information is involved in the embodiments, the consent of the individual needs to be obtained for all personal information, and the individual consent needs to be obtained for sensitive information. The embodiments also need to be implemented with the authorization and consent of the object.

[0057] The embodiments of the present application provide a method for solving the gray difference of spliced infrared images based on a block histogram, as shown in Figure 1 The method provided in the embodiments of the present application is executed by an electronic device, which can be a server or a terminal device. The server can be an independent physical server, a server cluster composed of multiple physical servers or a distributed system, 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 to this. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, and the embodiments of the present application do not limit this. The method includes steps S101-S103, wherein:

[0058] S101, acquiring a first number of original images transmitted by each infrared thermal imager and a gray mapping table, the gray mapping table representing a mapping relationship between the first number and the second number of pixel values, and the first number being higher than the second number.

[0059] Specifically, the imaging core of each infrared thermal imager will shoot a first number of original images, the first number is determined by the attribute 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, and the pixel value range of the pixel points in the original image is [0, 2 14 -1].

[0060] For any infrared thermal imager, the gray mapping table thereof is obtained by the original image shot by the infrared thermal imager through a histogram algorithm, and the second number can be 8 bits, and the gray mapping table includes the mapping value of each pixel value in [0, 2 14 -1] within the range of [0, 2 8 -1].

[0061] S102, splice the obtained original images to obtain a spliced image.

[0062] Specifically, the number of infrared thermal imagers is not less than 2, and the original images shot by different infrared thermal imagers are spliced left and right to obtain a spliced image containing a complete picture. The optional splicing algorithm includes a feature point-based splicing algorithm (such as a fade-in and fade-out algorithm), a gray information-based splicing algorithm, a template matching-based splicing algorithm, etc., and the present embodiment is not limited thereto, and the skilled person can flexibly select the splicing algorithm according to the actual needs.

[0063] S103, performing block histogram linear interpolation on the spliced image based on the gray mapping table transmitted by each infrared thermal imager to obtain a fused image after interpolation, and the fused image is second number data.

[0064] Specifically, the number of infrared thermal imagers is determined as a first number.

[0065] In one possible case, the first number is 2, as shown in Figure 2 , the two infrared thermal imagers are taken as a first thermal imager and a second thermal imager from left to right, the image shot by the first thermal imager is taken as a first original image (1 in Figure 2 ), the image shot by the second thermal imager is taken as a second original image (2 in Figure 2 ), the dashed line on 1 represents the center column of 1, and the dashed line on 2 represents the center column of 2. Perform block histogram linear interpolation on the spliced image based on the gray mapping tables transmitted by the first thermal imager and the second thermal imager, including determining an interpolation region from the spliced image composed of 1 and 2, and performing linear interpolation steps on each pixel point in the interpolation region. The interpolation region is the region between the center column of the first original image and the center column of the second original image in the spliced image, which is the region formed on the right side of the center column of 1 and on the left side of the center column of 2 in Figure 2 .

[0066] In another possible case, the first number is greater than 2, taking 3 infrared thermal imagers as an example, the original images shot by the 3 infrared thermal imagers are 3, 4 and 5 respectively, and a spliced image formed as shown in Figure 3 is shown, the first number is 3, the dashed line represents the center column of the original image, and the 3 original images correspond to the third thermal imager, the fourth thermal imager and the fifth thermal imager from left to right. In the spliced image, the area formed between the right side of the center column of 3 and the left side of the center column of 4 is a sub-image, and the area formed between the right side of the center column of 4 and the left side of the center column of 5 is a sub-image, thereby obtaining 2 sub-images. The left sub-image is executed by block histogram linear interpolation based on the gray scale mapping table transmitted by the third thermal imager and the fourth thermal imager respectively, and the right sub-image is executed by block histogram linear interpolation based on the gray scale mapping table transmitted by the fourth thermal imager and the fifth thermal imager respectively.

[0067] Taking 4 infrared thermal imagers as an example, the original images shot by the 4 infrared thermal imagers are 6, 7, 8 and 9 respectively, and a spliced image formed as shown in Figure 4 is shown, the first number is 4, the dashed line represents the center column of the original image, and the 4 original images correspond to the sixth thermal imager, the seventh thermal imager, the eighth thermal imager and the ninth thermal imager from left to right. In the spliced image, the area formed between the right side of the center column of 6 and the left side of the center column of 7 is a sub-image, the area formed between the right side of the center column of 7 and the left side of the center column of 8 is a sub-image, and the area formed between the right side of the center column of 8 and the left side of the center column of 9 is a sub-image, thereby obtaining 3 sub-images, and the 3 sub-images are sequentially taken as a first sub-image, a second sub-image and a third sub-image from left to right.

[0068] The first sub-image is executed by block histogram linear interpolation based on the gray scale mapping table transmitted by the sixth thermal imager and the seventh thermal imager respectively, the second sub-image is executed by block histogram linear interpolation based on the gray scale mapping table transmitted by the seventh thermal imager and the eighth thermal imager respectively, and the third sub-image is executed by block histogram linear interpolation based on the gray scale mapping table transmitted by the eighth thermal imager and the ninth thermal imager respectively,

[0069] By analogy, when the number of infrared thermal imagers exceeds 2, the center column of each original image in the spliced image is determined according to the above process, the area between every two adjacent center columns in the spliced image is taken as a sub-image, and block histogram linear interpolation is respectively performed on each sub-image. The block histogram linear interpolation adjusts the pixel value of each pixel point, and finally obtains a fused image in which the brightness difference at the joint is eliminated.

[0070] The embodiment obtains high-bit original images and corresponding gray scale mapping tables transmitted by each infrared thermal imager through an electronic device, and performs partial processing operation by the infrared thermal imager. The electronic device fully and effectively utilizes the calculation results of each infrared thermal imager, greatly saves the calculation work of the electronic device processor, reduces the scheme difficulty, and reduces the cost. Further, the electronic device splices the original images to form an overall view, and performs block histogram linear interpolation on the spliced image by using the gray scale mapping table, successfully converts the high-bit data into low-bit data, generates a fused image with rich details and continuity, and eliminates the brightness difference of the two original image splicing seams in the fused image, thereby improving the image quality.

[0071] In a possible implementation of the embodiment of the present application, the block histogram linear interpolation is performed on the spliced image based on the gray scale mapping tables transmitted by each infrared thermal imager to obtain the interpolated fused image, including:

[0072] determining the first number of infrared thermal imagers;

[0073] If the first number is two, the two infrared thermal imagers are determined as a first thermal imager and a second thermal imager; and the block histogram linear interpolation is performed on the spliced image based on the gray scale mapping tables transmitted by the first thermal imager and the second thermal imager to obtain the interpolated fused image.

[0074] The embodiment considers different cases of the number of infrared thermal imagers. When the number of infrared thermal imagers is two, the block histogram linear interpolation is performed on the spliced image based on the gray scale mapping tables transmitted by the two infrared thermal imagers to eliminate the brightness difference of the spliced image, improve the consistency and continuity of the overall image, and thus effectively improve the quality and visual effect of image fusion.

[0075] In a possible implementation of the embodiment of the present application, the block histogram linear interpolation is performed on the spliced image based on the gray scale mapping tables transmitted by the first thermal imager and the second thermal imager to obtain the interpolated fused image, including:

[0076] determining an interpolation region in the spliced image, the interpolation region being a region between a center column of a first original image and a center column of a second original image in the spliced image; the first original image being an original image acquired by the first thermal imager, and the second original image being an original image acquired by the second thermal imager;

[0077] performing a linear interpolation step on each pixel point in the interpolation region to obtain a mapping pixel value of each pixel point in the spliced image, and the mapping pixel values of the pixel points constituting the interpolated fused image;

[0078] The linear interpolation step includes:

[0079] determining an original pixel value of the current pixel point in the spliced image;

[0080] determining a first mapped pixel value of the original pixel value in a gray scale mapping table transmitted by the first thermal imager, and a second mapped pixel value of the original pixel value in a gray scale mapping table transmitted by the second thermal imager;

[0081] obtaining a first distance of the current pixel point from a center column of the first original image, and a second distance of the current pixel point from a center column of the second original image;

[0082] calculating a 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.

[0083] Referring to Figure 5 Taking any pixel point A in the spliced image as an example, the original pixel value of the current pixel point A in the spliced image is determined, the original pixel value is data of a first number of bits, and the first mapped pixel value and the second mapped pixel value are both data of a second number of bits. The column number of the current pixel point A in the spliced image is obtained, and the column number of the center column (dashed line a) of the first original image 1 is obtained. The absolute value of the column number difference between the column number of the current pixel point A and the column number of the dashed line a is taken as the first distance x. The column number of the center column (dashed line b) of the second original image 2 is determined, and the absolute value of the column number difference between the column number of the current pixel point A and the column number of the dashed line b is taken as the second distance y.

[0084] Further, the first mapped pixel value, the second mapped pixel value, the first distance and the second distance are substituted into the fusion formula to obtain the mapped pixel value of the current pixel point A.

[0085] The embodiment combines the gray scale mapping tables of the two infrared thermal imagers, performs fine linear interpolation processing on each pixel point in the interpolation region, determines the corresponding mapped values of each pixel point in the two gray scale mapping tables, and then calculates the final mapped pixel value of each pixel point according to the distances of the pixel points relative to the center columns of the two original images, so as to generate a high-quality fusion image, ensure smooth transition and detail retention of image data, and effectively improve the realism and visual effect of image fusion.

[0086] In one possible implementation of the embodiment, the mapped pixel value of the current pixel point is calculated based on the first mapped pixel value, the second mapped pixel value, the first distance and the second distance, and includes:

[0087] The first mapped pixel value, the second mapped pixel value, the first distance and the second distance are substituted into the fusion formula to obtain the mapped pixel value of the current pixel point;

[0088] When the current pixel point is located in the interpolation region, the fusion formula is:

[0089] H C =(H My+H N x) / (x+y);

[0090] When the current pixel is located in the left region of the center column of the first original image, the fusion formula is: H C =H M ;

[0091] When the current pixel is located in the right region of the center column of the second original image, the fusion formula is: H C =H N ;

[0092] Among them, H C H represents the mapped pixel value. M H is the first mapped pixel value; N y is the second mapped pixel value; x is the first distance; y is the second distance.

[0093] See Figure 5 When the current pixel is located in the interpolation region (i.e. Figure 5 When stitching together the regions to the right of dashed line a and to the left of dashed line b in an image, the fusion formula H is used. C =(H M y+H N x) / (x+y) determines the mapped pixel value of the current pixel; when the current pixel is located in the region to the left of the center column (dashed line a) of the first original image, the fusion formula is: H C =H M That is, without adjusting the pixel value of the current pixel, the pixel value of the current pixel in the first original image is used as the mapped pixel value; when the current pixel is located in the region to the right of the center column (dashed line b) of the second original image, the fusion formula is: H C =H N Instead of adjusting the pixel value of the current pixel, the pixel value of the current pixel in the second original image is used as the mapped pixel value.

[0094] This embodiment employs a specific fusion formula that comprehensively considers the grayscale mapping values ​​of the two infrared thermal imagers and the distance of each pixel relative to its respective center column. This accurately calculates the mapped pixel value of each pixel, ensuring a smooth transition of image data in the stitching area and avoiding the abruptness that may result from direct stitching. As a result, a fused image with rich details and a natural visual effect is generated.

[0095] In one possible implementation of this application embodiment, if the first quantity exceeds two, the method further includes:

[0096] Determine the center column of each original image in the stitched image, and take the area between every two adjacent center columns in the stitched image as a sub-image to obtain a second number of sub-images. The difference between the first number and the second number is one.

[0097] For each sub-image, the two original images corresponding to the sub-image are determined as the third and fourth thermal imagers respectively; a linear interpolation step is performed on each pixel point in the sub-image based on the gray scale mapping tables transmitted by the third and fourth thermal imagers, to obtain a sub-fusion image corresponding to the sub-image;

[0098] The sub-fusion images corresponding to the respective sub-images constitute the fused image after interpolation of the stitched image.

[0099] When the number of infrared thermal imagers exceeds two, multiple sub-images are divided from the stitched image, and a linear interpolation method is applied to each sub-image respectively, and the gray scale mapping tables of the corresponding two thermal imagers are used to calculate the mapping value of each pixel, and finally a complete fusion 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.

[0100] In one possible implementation of the embodiments of the present application, each infrared thermal imager obtains a gray scale mapping table based on the original image and a mapping formula;

[0101] The mapping formula is:

[0102] Wherein, h i is the second number of pixel value i after mapping; i is the first number of pixel value, the value range of i is [0, 2 m -1], m is the first number; 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 number.

[0103] Specifically, for any infrared thermal imager, a gray scale mapping table is generated according to the original image of the infrared thermal imager. Specifically, a histogram is counted to form a pixel statistics table, which contains the number of pixels in the original image for each pixel value in [0, 2 m -1]. Further, a gray scale mapping table is formed based on the mapping formula, which includes the mapping pixel value in [0, 2 m -1] for each pixel value in [0, 2 n -1].

[0104] When the first number is 14 and the second number is 8, the gray scale mapping table includes the mapping pixel value in [0, 255] for each pixel value in [0, 16383].

[0105] Wherein, the basic mapping formula is:

[0106] In order to prevent the image from being too bright, the platform histogram can be improved, and when the number of pixels reaches a certain value (i.e. the platform value), the accumulation is stopped, i.e. n i ≤L, L is the platform value.

[0107] At this time, the mapping formula is improved as:

[0108] In this embodiment, each infrared thermal imager uses a specific mapping formula to map the high-bit original image pixel value to a low-bit pixel value to generate a gray scale mapping table. The mapping formula is obtained by counting the frequency of each pixel value in the original image and normalizing it to the range of low-bit pixel values, thereby ensuring the reasonable distribution and conversion of the pixel values.

[0109] In one possible implementation of the embodiment, the first number of bits is 14, and the second number of bits is 8.

[0110] The embodiment can simply and effectively eliminate the gray scale difference between the infrared thermal imagers when multiple infrared thermal imagers are spliced and fused, so that the spliced and fused image has consistent gray scale output, and there is no obvious brightness difference between the infrared thermal imagers, thereby enhancing the comfort of human eye observation. At the same time, the technical solution of the embodiment is simple and effective, fully and effectively uses the calculation results of the infrared thermal imagers, greatly saves the calculation work of the electronic device processor, reduces the difficulty of the solution, and reduces the cost.

[0111] In the embodiment of the application, an electronic device is provided, as shown in Figure 6 The electronic device 600 shown in Figure 6 The electronic device 600 shown in

[0112] The processor 601 can 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 device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logical blocks, modules and circuits described in connection with the disclosure. The processor 601 can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0113] The bus 602 can include a path for transmitting information between the above-mentioned components. The bus 602 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 602 can be divided into an address bus, a data bus, a control bus, and the like. For convenience of representation, Figure 6 In the figure, only one thick line is used to represent the bus, but it does not mean that there is only one bus or one type of bus.

[0114] The memory 603 can 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, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, an optical disk storage (including a compact disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, and the like), a magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but not limited thereto.

[0115] The memory 603 is configured to store application program codes for implementing the scheme of the present application, and the processor 601 is configured to control the execution of the application program codes. The processor 601 is configured to execute the application program codes stored in the memory 603 to implement the above-mentioned content shown in the embodiment of the method for solving the gray difference of spliced infrared images based on a block histogram.

[0116] Figure 6 The electronic device shown is merely an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0117] The embodiments of the present application provide a computer readable storage medium, which stores a computer program. When the computer program is run on a computer, the computer can execute the above-mentioned content shown in the embodiment of the method for solving the gray difference of spliced infrared images based on a block histogram.

[0118] It should be understood that, although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.

[0119] The embodiments of the present application provide a computer program product, which includes a computer program. When the computer program is executed by a processor, the content shown in the above-mentioned embodiment of the method for solving the gray difference of spliced infrared images based on a block histogram is implemented.

[0120] The above is only some embodiments of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, several improvements and refinements can be made, which should also be considered as the protection scope of the present application.

Claims

1. A patch-based histogram-based mosaic infrared image gray difference solution method, characterized in that, The method comprises the following steps: acquiring a first number of original images transmitted by each infrared thermal imager and a gray scale mapping table, the gray scale mapping table representing a mapping relationship between a first number of pixel values and a second number of pixel values, and the first number being higher than the second number; splicing the acquired original images to obtain a spliced image; performing block histogram linear interpolation on the spliced image based on the gray scale mapping table transmitted by each infrared thermal imager to obtain a fused image after interpolation, the fused image being data of the second number; the step of performing block histogram linear interpolation on the spliced image based on the gray scale mapping table transmitted by each infrared thermal imager to obtain a fused image after interpolation comprises the following steps: determining a first number of infrared thermal imagers; if the first number is two, determining two infrared thermal imagers as a first thermal imager and a second thermal imager; performing block histogram linear interpolation on the spliced image based on the gray scale mapping tables transmitted by the first thermal imager and the second thermal imager to obtain a fused image after interpolation; the step of performing block histogram linear interpolation on the spliced image based on the gray scale mapping tables transmitted by the first thermal imager and the second thermal imager to obtain a fused image after interpolation comprises the following steps: determining an interpolation region in the spliced image, the interpolation region being a region between a center column of a first original image and a center column of a second original image in the spliced image; the first original image being an original image acquired by the first thermal imager, and the second original image being an original image acquired by the second thermal imager; performing a linear interpolation step on each pixel point in the interpolation region to obtain a mapping pixel value of each pixel point in the spliced image, the mapping pixel values of the pixel points constituting a fused image after interpolation; wherein the linear interpolation step comprises the following steps: determining an original pixel value of a current pixel point in the spliced image; determining a first mapping pixel value of the original pixel value in the gray scale mapping table transmitted by the first thermal imager and a second mapping pixel value of the original pixel value in the gray scale mapping table transmitted by the second thermal imager; acquiring a first distance of the current pixel point from the center column of the first original image and a second distance of the current pixel point from the center column of the second original image; calculating a 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.

2. The patch-based histogram-based method for solving the gray difference of spliced infrared images according to claim 1, characterized in that, the step of calculating a 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 comprises the following steps: substituting the first mapping pixel value, the second mapping pixel value, the first distance, and the second distance into a fusion formula to obtain the mapping pixel value of the current pixel point; The fusion formula is: ; wherein, is a mapped pixel value; is a first mapped pixel value; is a second mapped pixel value; is a first distance; is a second distance.

3. The patch-based histogram based mosaic infrared image gray difference resolution method according to claim 1, characterized in that, if the first number is more than two, the method further comprises the following steps: determining a center column of each original image in the spliced image, and regarding a region between every two adjacent center columns in the spliced image as a sub-image to obtain a second number of sub-images, the difference between the first number and the second number being one. For each sub-image, two original images constituting the sub-image are determined as a third thermal imager and a fourth thermal imager, respectively; a linear interpolation step is performed on each pixel point in the sub-image based on a gray scale mapping table transmitted by the third thermal imager and the fourth thermal imager, respectively, to obtain a sub-fusion image corresponding to the sub-image; The sub-fusion images corresponding to the respective sub-images constitute the fusion image after interpolation of the spliced image.

4. The patch-based histogram based mosaic infrared image gray difference resolution method according to claim 1, characterized in that, Each infrared thermal imager obtains a gray scale mapping table based on a captured original image and a mapping formula; The mapping formula is: ; wherein, is a first number of pixels, is a second number of pixels after mapping; is a first number of pixels, is in a range of , is a first number; is a number of pixel points in the original image whose pixel value is is a first number; is or , is a total number of pixel points in an original image; is , is a second number.

5. The method of claim 1, wherein the method further comprises: The first number of bits is 14, and the second number of bits is 8.

6. An electronic device, comprising: Comprise: At least one processor; Memory; At least one application program, wherein the at least one application program is stored in the memory and is configured to be executed by the at least one processor, and the at least one application program is configured to execute the block histogram-based infrared image splicing gray difference solving method according to any one of claims 1-5.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed in the computer, the computer is caused to execute the block histogram-based infrared image splicing gray difference solving method according to any one of claims 1-5.

8. A computer program product, characterised in that, The computer program is executed by the processor to implement the steps of the block histogram-based infrared image splicing gray difference solving method according to any one of claims 1-5.

Citation Information

Patent Citations

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

    US20230123664A1

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

    WO2023050723A1