Infrared long-distance image short-distance simulation method and system based on bit decomposition pseudo-color
Through bit decomposition and value domain mapping processing combined with diffusion model, the problem of insufficient detail recovery of long-distance infrared images is solved, and the simulation generation of close-distance infrared images under long-distance conditions is realized, and image quality and temperature measurement accuracy are improved.
Patent Information
- Application Number
- CN202510634585.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-26
AI Technical Summary
The prior art is difficult to effectively restore the details of small areas of temperature change in infrared images taken from a long distance, resulting in reduced image quality and temperature measurement accuracy, especially in industrial scenarios.
By acquiring close-range and long-range infrared image pairs, the region of interest is cropped, bit decomposed, and domain mapping are processed to convert it into a pseudo-color image, and the diffusion model is used to train it to generate a close-range pseudo-color image, and finally obtaining an infrared image simulated close-range acquisition through inverse processing.
Without changing the shooting conditions, the infrared image quality and temperature measurement accuracy are significantly improved, and the requirements for infrared camera layout position are reduced, and it is suitable for industrial scenarios where it is difficult to collect close distances.
Smart Images

Figure CN120543375A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of infrared temperature measurement, and in particular relates to a method for short-range simulation of infrared long-range images based on bit-decomposed pseudo-color. Background Art
[0002] Infrared thermal imagers play a vital role in industrial monitoring, equipment fault diagnosis, and early warning. Infrared thermal imaging captures infrared radiation emitted by an object, visually displaying its surface temperature distribution in the form of a grayscale image. The grayscale values represent the temperature.
[0003] However, the image quality and measurement accuracy of infrared thermal imaging are affected by a variety of factors, with shooting distance being one of the most significant. When the infrared thermal imager is far from the target object, atmospheric absorption, scattering, humidity, and dust can cause the captured infrared image to lose detail, reduce contrast, and distort temperature information. Due to safety concerns or equipment layout constraints, close-range infrared temperature measurement is not possible in many industrial scenarios, significantly reducing its accuracy and reliability.
[0004] Traditional solutions fall into two main categories: one involves calculating distance compensation coefficients through mathematical models, such as atmospheric transmittance correction models, and then performing post-calibration on the measurement results; the other involves improving long-distance imaging quality through optical zoom and high-sensitivity sensors. The former often requires complex environmental parameter measurements and has limited adaptability; the latter is limited by hardware costs and technical bottlenecks, hindering widespread application.
[0005] In recent years, deep learning has achieved remarkable success in image processing. Image-to-image translation, in particular, has provided new insights into solving these problems. However, existing deep learning-based infrared image enhancement methods mostly process grayscale images directly, failing to fully consider the information representation of low-gradient regions in infrared grayscale images. This results in poor recovery of details in areas with subtle temperature variations.
[0006] Therefore, there is an urgent need for a new method that can convert infrared images taken at a long distance into images with the same effect as those taken at a close distance, thereby improving the infrared image quality and temperature measurement accuracy without changing the shooting conditions. Summary of the Invention
[0007] The purpose of the present invention is to solve the problem in the prior art that it is difficult to obtain close-range infrared images, and to provide a close-range simulation method and system for infrared long-range images based on bit-decomposed pseudo-color.
[0008] The specific technical solutions adopted in the present invention are as follows:
[0009] In a first aspect, the present invention provides a method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color, which comprises:
[0010] S1, obtaining a first image pair consisting of a close-range infrared image and a long-range infrared image collected in pairs for different targets;
[0011] S2, cropping the long-range infrared image in the first image pair to a region of interest so that it aligns with the field of view of the short-range infrared image, obtaining a short-range simulated infrared image, and pairing it with the short-range infrared image to form a second image pair;
[0012] S3, converting the close-range simulated infrared images and the close-range infrared images in all the second image pairs into close-range simulated pseudo-color images and close-range pseudo-color images through bit decomposition and range mapping, and then using them as training samples to train the diffusion model so that the model can generate close-range pseudo-color images based on the close-range simulated pseudo-color images;
[0013] S4. After cropping the region of interest of the infrared image collected at a long distance, the image is converted into a pseudo-color image through bit decomposition and range mapping, and then input into the trained diffusion model. The output image is subjected to range inverse mapping and bit value restoration processing opposite to the bit decomposition and range mapping processing to obtain an infrared image simulated at a close distance.
[0014] As a preferred embodiment of the first aspect, in the first image pair, the short-range infrared image and the long-range infrared image are acquired synchronously by two cameras at different distances from the target object at the same viewing angle.
[0015] As a preferred embodiment of the first aspect, the second image pair needs to be downsampled to an input image size that meets the requirements of the diffusion model.
[0016] As a preferred embodiment of the first aspect, the second image pairs need to be data enhanced to obtain more second image pair samples.
[0017] As a preferred embodiment of the above-mentioned first aspect, when the infrared image is subjected to the above-mentioned bit decomposition and value range mapping processing, the grayscale value of each pixel of the infrared image must first be converted into an 8-bit binary value, and then 2 bits, 3 bits, and 3 bits of the 8-bit binary value are extracted in order from the highest bit to the lowest bit and converted into decimal, respectively as the R channel value, G channel value, and B channel value of the corresponding pixel, and then the value range of each of the three channels is scaled and mapped to the range of 0 to 255, thereby converting the infrared image into a pseudo-color image.
[0018] As a preferred embodiment of the first aspect, the diffusion model adopts a Diffir network.
[0019] As a preferred embodiment of the above-mentioned first aspect, when training the diffusion model, the model input is a close-range simulated pseudo-color image, the model's true value label is a close-range pseudo-color image, and the diffusion model is trained by minimizing the error loss between the model output and the true value label.
[0020] As a preferred embodiment of the first aspect, the finally obtained infrared image acquired by simulating close-range capture needs to be amplified by a super-resolution network.
[0021] In a second aspect, the present invention provides a near-range simulation system for infrared long-range images based on bit-decomposed pseudo-color, comprising:
[0022] An image acquisition module is used to acquire a first image pair consisting of a close-range infrared image and a long-range infrared image collected in pairs of different targets;
[0023] A field of view alignment module is used to crop the long-range infrared image in the first image pair to a region of interest so that it is aligned with the field of view of the short-range infrared image, thereby obtaining a short-range simulated infrared image and pairing it with the short-range infrared image to form a second image pair;
[0024] a model training module, configured to convert the close-range simulated infrared images and the close-range infrared images in all second image pairs into close-range simulated pseudo-color images and close-range pseudo-color images through bit decomposition and range mapping, and then use them as training samples to train the diffusion model so that the model can generate close-range pseudo-color images based on the close-range simulated pseudo-color images;
[0025] The close-range simulation module is used to crop the region of interest of the infrared image collected at a long distance, convert it into a pseudo-color image through bit decomposition and range mapping, and then input it into a trained diffusion model. The output image is subjected to range inverse mapping and bit value restoration processing that are opposite to the bit decomposition and range mapping processing to obtain an infrared image simulated at a close distance.
[0026] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color as described in any one of the schemes of the first aspect above is implemented.
[0027] In a fourth aspect, the present invention provides a computer electronic device comprising a memory and a processor;
[0028] The memory is used to store computer programs;
[0029] The processor is configured to implement the method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color as described in any one of the solutions of the first aspect when executing the computer program.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] In response to the problem that it is difficult to capture infrared images at close range in actual industry, the present invention provides a method for simulating the conversion of infrared images captured at a long distance to obtain infrared images at close range. The present invention performs bit decomposition and range mapping processing on infrared images captured at a long distance to convert them into simulated pseudo-color images at close range, and then uses a diffusion model network to process the pre-processed long-distance images to obtain simulated infrared images captured at close range. Based on the diffusion model trained by the present invention, users only need to capture infrared images at a long distance to generate infrared images captured at close range at the same angle, thereby greatly reducing the requirements for the layout position of infrared cameras when capturing infrared images in industry. The present invention can be used in some industrial scenarios where close-range infrared temperature measurement is difficult due to safety considerations or equipment layout limitations, and accurate temperature information can still be obtained when capturing infrared images at a long distance. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The present invention is a flowchart of the steps of a method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color;
[0033] Figure 2 The schematic diagram of the module composition of the infrared long-range image close-range simulation system based on bit-decomposed pseudo-color is shown in FIG.
[0034] Figure 3 It is a schematic diagram of the structure of computer electronic equipment;
[0035] Figure 4 is an exemplary long-range infrared image in an embodiment of the present invention;
[0036] Figure 5 For Figure 4 The close-range simulated infrared image obtained after cropping;
[0037] Figure 6 Based on Figure 4 The infrared image generated by the long-distance infrared image in the simulation of close-range acquisition;
[0038] Figure 7 For Figure 6 The corresponding infrared image is actually collected at close range. DETAILED DESCRIPTION
[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in the various embodiments of the present invention can be combined accordingly without conflicting with each other.
[0040] In the description of the present invention, it should be understood that when an element is considered to be "connected" to another element, it can be directly connected to the other element or indirectly connected, that is, there are intermediate elements. On the contrary, when an element is said to be "directly" connected to another element, there are no intermediate elements.
[0041] In the description of the present invention, it should be understood that the terms "first" and "second" are used solely for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly specifying the number of technical features being described. Therefore, features defined as "first" or "second" may explicitly or implicitly include at least one of such features.
[0042] like Figure 1 As shown, in a preferred embodiment of the present invention, a method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color is provided, which includes the following steps S1 to S4. The specific implementation of each step is described in detail below.
[0043] S1. Acquire a first image pair consisting of a short-range infrared image and a long-range infrared image collected in pairs for different targets.
[0044] It should be noted that the near-range infrared image and the long-range infrared image in the above-mentioned first image pair need to be acquired in pairs, that is, each pair of first images needs to maintain the same target object and the same acquisition time. Generally speaking, two infrared cameras can be used, placed at different distances from the target object, and then the two cameras are kept at the same viewing angle to synchronously acquire the near-range infrared image and the long-range infrared image. Generally speaking, the composition area captured by the near-range infrared image is mainly the target object, with a small amount of background, while the long-range infrared image generally covers a larger field of view and introduces more background in addition to the target object.
[0045] The types of objects in the first image pairs and the number of first image pairs should be as large as possible to facilitate training a diffusion model with strong generalization capabilities. However, the specific types of objects and the number of first image pairs are not limited and can be determined based on actual needs.
[0046] S2. Crop the long-range infrared image in the first image pair for the region of interest so that the region of interest is aligned with the field of view of the short-range infrared image to obtain a short-range simulated infrared image, and pair the image with the short-range infrared image to form a second image pair.
[0047] It should be noted that the region of interest in the long-range infrared image refers to the target object in the image. The specific cropping area should be based on the near-range infrared image, ensuring that the two cropped images have the same field of view. The field of view here refers to the range of visual space recorded in the image. When the long-range infrared image is cropped, the resulting cropped long-range infrared image is called a near-range simulated infrared image. This near-range simulated infrared image and the original near-range infrared image in the first image pair form a second image pair. This second image pair has the same field of view and can be used as the basis for training the diffusion model.
[0048] Furthermore, in embodiments of the present invention, if the second image pair is large, it needs to be downsampled to meet the input image size requirements of the diffusion model. For example, all images in the second image pair can be downsampled to a 256*192 resolution. This not only meets the model input requirements, but also reduces the number of points in the image, which can better facilitate the model's learning of grayscale and color variations.
[0049] In addition, if the number of second image pairs actually obtained is insufficient, data enhancement may be performed, such as rotation, flipping, scaling, translation, etc., to expand and obtain more second image pair samples.
[0050] S3. Convert the close-range simulated infrared images and the close-range infrared images in all the second image pairs into close-range simulated pseudo-color images and close-range pseudo-color images through bit decomposition and range mapping, and then use them as training samples to train the diffusion model so that it can generate close-range pseudo-color images based on the close-range simulated pseudo-color images.
[0051] It should be noted that the second image pair is not used directly to train the diffusion model. Instead, it first undergoes color conversion through bit decomposition and range mapping. This step, through bit decomposition and range mapping, allows low-gradient regions in the grayscale image to obtain richer color information in the pseudo-color representation, thereby enhancing the diffusion model's ability to learn these regions. This conversion method is particularly suitable for scenes where low-gradient details must be preserved, effectively improving the diffusion model's performance in detail preservation.
[0052] It should be noted that an infrared image is a grayscale image, in which each pixel value is represented by an integer between 0 and 255. Therefore, 255 converted to binary is 11111111, which is 8 bits, and each pixel value can be converted into an 8-bit binary representation. In an embodiment of the present invention, when performing the bit decomposition and range mapping processing on an infrared image, the grayscale value of each pixel of the infrared image must first be converted into an 8-bit binary value, and then the 8-bit binary value is extracted in order from the highest bit to the lowest bit. 2 bits, 3 bits, and 3 bits are converted to decimal, respectively, as the R channel value, G channel value, and B channel value of the corresponding pixel, and then the value range of each of the three channels is scaled and mapped to the range of 0 to 255, thereby converting the infrared image into a pseudo-color image.
[0053] It should be noted that the three RGB channels have different value ranges because the number of binary bits extracted is different. The number of bits extracted from the R channel is 2 bits, and its value range is 0 to 3. When mapping it to the range of 0 to 255, the original calculated R channel value needs to be multiplied by 255 / 3. The number of bits extracted from the G channel is 3 bits, and its value range is 0 to 7. When mapping it to the range of 0 to 255, the original calculated R channel value needs to be multiplied by 255 / 7. The number of bits extracted from the B channel is 3 bits, and its value range is 0 to 7. When mapping it to the range of 0 to 255, the original calculated R channel value needs to be multiplied by 255 / 7.
[0054] For each pair of second images, the close-range simulated infrared image can be converted into a close-range simulated pseudo-color image through the above-mentioned bit decomposition and range mapping processing, and the close-range infrared image can also be converted into a close-range pseudo-color image through the above-mentioned bit decomposition and range mapping processing. Therefore, all the second image pairs converted into pseudo-color images can be used as training sample data sets to train the diffusion model. When training the diffusion model, the model input is the close-range simulated pseudo-color image, and the model's true value label is the close-range pseudo-color image. The diffusion model is trained by minimizing the error loss between the model output and the true value label, so that it can generate a close-range pseudo-color image based on the close-range simulated pseudo-color image. The loss function form of the error loss can be MSE loss, of course, other forms can also be used.
[0055] Therefore, based on the diffusion model trained by the present invention, in actual industrial scenarios where it is difficult to capture infrared images at close range, users only need to capture infrared images from a long distance to generate infrared images captured at close range at the same angle, thereby greatly reducing the requirements for the layout of infrared cameras when capturing infrared images in industry.
[0056] It should be noted that the aforementioned diffusion model is a probabilistic generative model whose core concept is to corrupt data by gradually adding noise and then learn the reverse process to generate new data. The diffusion model comprises a forward diffusion process and a reverse denoising process. In the forward diffusion process, Gaussian noise is gradually added to the data until the data becomes completely random (e.g., pure Gaussian noise). In the reverse denoising process, the noise is gradually removed from the noise, ultimately restoring the original data distribution and generating new data. The specific network form of the diffusion model can be implemented using existing technologies. In embodiments of the present invention, the diffusion model preferably employs a Diffir network (DiffIR: Efficient Diffusion Model for Image Restoration, see https: / / arxiv.org / pdf / 2303.09472).
[0057] S4. After cropping the region of interest of the infrared image collected at a long distance, the image is converted into a pseudo-color image through bit decomposition and range mapping, and then input into the trained diffusion model. The output image is subjected to range inverse mapping and bit value restoration processing opposite to the bit decomposition and range mapping processing to obtain an infrared image simulated at a close distance.
[0058] It should be noted that the infrared image collected at a long distance in the above-mentioned step S4 refers to the infrared image collected at a long distance from the target object in actual application. The infrared image can be cropped, bit decomposed and range mapped according to the same region of interest as the sample image in the above-mentioned S1 to S3, and then converted into a pseudo-color image and input into the trained diffusion model. The image output by the model is then re-processed with range inverse mapping and bit value restoration to obtain an infrared image simulated at a close distance.
[0059] The above-mentioned range demapping and bit value restoration processing is divided into two steps: range demapping processing and bit value restoration processing. The two steps are respectively the inverse of the above-mentioned range mapping processing and bit decomposition processing, and will not be described in detail.
[0060] It should be noted that the method steps shown in S1 to S3 above can essentially be implemented in the form of a computer program.
[0061] Therefore, based on the same inventive concept, Figure 2 As shown, the present invention further provides a near-range simulation system for infrared long-distance images based on bit-decomposition pseudo-color, corresponding to the near-range simulation method for infrared long-distance images based on bit-decomposition pseudo-color provided in the above embodiment, which includes:
[0062] An image acquisition module is used to acquire a first image pair consisting of a close-range infrared image and a long-range infrared image collected in pairs of different targets;
[0063] A field of view alignment module is used to crop the long-range infrared image in the first image pair to a region of interest so that it is aligned with the field of view of the short-range infrared image, thereby obtaining a short-range simulated infrared image and pairing it with the short-range infrared image to form a second image pair;
[0064] a model training module, configured to convert the close-range simulated infrared images and the close-range infrared images in all second image pairs into close-range simulated pseudo-color images and close-range pseudo-color images through bit decomposition and range mapping, and then use them as training samples to train the diffusion model so that the model can generate close-range pseudo-color images based on the close-range simulated pseudo-color images;
[0065] The close-range simulation module is used to crop the region of interest of the infrared image collected at a long distance, convert it into a pseudo-color image through bit decomposition and range mapping, and then input it into a trained diffusion model. The output image is subjected to range inverse mapping and bit value restoration processing that are opposite to the bit decomposition and range mapping processing to obtain an infrared image simulated at a close distance.
[0066] In addition, based on the same inventive concept, Figure 3 As shown, the present invention also provides a computer electronic device corresponding to the method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color provided in the above embodiment, which includes a memory and a processor;
[0067] The memory is used to store computer programs;
[0068] The processor is configured to implement the aforementioned method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color when executing the computer program;
[0069] Furthermore, the logic instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention.
[0070] Therefore, based on the same inventive concept, the present invention provides a computer-readable storage medium corresponding to a method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color as described above can be implemented.
[0071] Therefore, based on the same inventive concept, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the aforementioned infrared long-range image close-range simulation method based on bit-decomposed pseudo-color.
[0072] Specifically, in the computer-readable storage medium of the above three embodiments, the stored computer program is executed by the processor to perform the above steps S1 to S4.
[0073] It is understood that the storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Furthermore, the storage medium may be any medium capable of storing program code, such as a USB flash drive, a mobile hard drive, a magnetic disk, or an optical disk.
[0074] It is understandable that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0075] It should also be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division. In actual implementation, there may be other division methods, for example, multiple modules or steps can be combined or integrated together, and a module or step can also be split.
[0076] The following is a specific embodiment to illustrate the specific implementation process and technical effects of the method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color described in S1 to S4.
[0077] Example
[0078] In this embodiment, the infrared long-distance image close-range simulation method based on bit-decomposed pseudo-color is divided into a model training process and an actual close-range simulation process after training.
[0079] 1. Model training process:
[0080] Step 1.1: Create a training set and preprocess images
[0081] Step 1.1.1: Collect approximately 500 sets of first image pairs from different angles for different targets. Each set of first image pairs must consist of two images of the same target, captured at the same time. However, the infrared cameras were positioned at different distances: 50 cm (close distance) and 100 cm (far distance), respectively. These images are recorded as the close-range infrared image and the far-range infrared image.
[0082] Step 1.1.2: Crop the long-range infrared image in the first image pair according to the field of view range corresponding to the short-range infrared image to obtain a short-range simulated infrared image, which is paired with the short-range infrared image to form a second image pair.
[0083] Step 1.1.3: All images in the second image pair need to be downsampled to 256*192 resolution images to reduce the number of points in the image, which is more conducive to the model's learning of grayscale color changes.
[0084] Step 1.1.4: Perform data augmentation on the dataset of the downsampled second image, such as rotation, flipping, scaling, translation, and expanding the number of samples.
[0085] Step 1.2: Convert all infrared images in the second image pair from 8-bit grayscale to pseudo-color images through bit decomposition and range mapping.
[0086] Step 1.2.1: Bit decomposition processing:
[0087] The grayscale values in the infrared image in the second image pair are converted into 8-bit binary representation to form an 8-bit grayscale image, and the 8-bit binary representation of the pixel value is decomposed into the initial channel values of the three RGB channels, where:
[0088] R channel: extract the highest 2 bits (by shifting right 6 bits and then ANDing with 0b11)
[0089] G channel: extract the middle 3 bits (by shifting right 3 bits and then ANDing with 0b111)
[0090] B channel: extract the lowest 3 bits (directly AND with 0b111 to extract)
[0091] Step 1.2.2: Range Mapping
[0092] Since the channel value range of RGB should be 0 to 255, the value range mapping process is performed on each channel after decomposition, where
[0093] R channel: Converts a 2-bit binary value to a decimal value (range 0 to 3), and then maps it to the range 0 to 255 (divide by 3 and multiply by 255).
[0094] G channel: Convert the 3-bit binary value to a decimal value (range 0 to 7), and then map it to the range 0 to 255 (divide by 7 and multiply by 255);
[0095] Channel B: Converts the 3-bit binary number to a decimal value (0 to 7), and then maps it to the range of 0 to 255 (divide by 7 and multiply by 255).
[0096] Step 1.2.3: Combine the range-mapped R, G, and B channel values of each pixel in the infrared image into the three-channel value for that pixel, thereby converting each infrared image in the second image pair into a pseudo-color image. The close-range simulated pseudo-color images and close-range pseudo-color images obtained from all second image pairs constitute the pseudo-color image training set.
[0097] This step uses bit decomposition and normalization to enrich the pseudo-color representation of low-gradient regions in the grayscale image, thereby enhancing the diffusion model's ability to learn these regions. This conversion method is particularly suitable for scenes where low-gradient details need to be preserved, effectively improving the diffusion model's performance in detail preservation.
[0098] Step 1.3: Diffusion model training
[0099] The Diffir network is used as the diffusion model architecture, and the pseudo-color image training set converted in step 2 is used as training data. Iterative sampling training is used to optimize the diffusion model parameters. The law of color change is learned through the diffusion process, and the optimal model weights are saved after training is completed.
[0100] 2. Actual close-range simulation process after training:
[0101] Step 2.1: For the target infrared detection object, select an appropriate location for the infrared camera based on the actual on-site conditions to capture infrared images from a distance. Then, crop the long-range infrared image to the region of interest corresponding to the close-range infrared image required for actual detection. The cropped close-range simulated infrared image is then downsampled to a resolution of 256 x 192 to obtain the input image.
[0102] like Figure 4 As shown in FIG, an exemplary long-range infrared image of this embodiment is shown, which contains a large amount of background area. Therefore, after cropping the region of interest, the central target object area is retained and the background area is removed. The cropped close-range simulated infrared image is as follows: Figure 5 shown.
[0103] Step 2.2: Use the same bit decomposition and range mapping method as in the training phase to process the input image and convert the 8-bit grayscale image into a pseudo-color image corresponding to the input image.
[0104] Step 2.3: Input the pseudo-color image corresponding to the input image into the trained diffusion model, perform model inference, and obtain the generated pseudo-color image.
[0105] Step 2.4: Convert the pseudo-color image output in step 2.3 back to a grayscale image to obtain an infrared image that simulates close-range acquisition. The specific steps are as follows:
[0106] Step 2.4.1: Extract the values of the R, G, and B channels from the pseudo-color image and perform value range inverse mapping, where:
[0107] Map the R channel value from the 0-255 range back to the 0-3 range (divide by 255 and multiply by 3)
[0108] Map the G channel value from the 0-255 range back to the 0-7 range (divide by 255 and multiply by 7)
[0109] Map the B channel value from the 0-255 range back to the 0-7 range (divide by 255 and multiply by 7)
[0110] Step 2.4.2: Perform bit value restoration on the RGB channel values after the value range inverse mapping process, where:
[0111] Shift the R channel value left by 6 bits and restore it to the high 2 bits.
[0112] Shift the G channel value left by 3 bits and restore it to the middle 3 bits.
[0113] The B channel value is kept in the lower 3 bits
[0114] Then combine the three channels through bit operation to get the final grayscale value = (R<<6)|(G<<3)|B
[0115] By converting the RGB channel values of each pixel in the pseudo-color image into grayscale values, we can create an infrared image that simulates close-range acquisition. Although the original infrared image was acquired from a distance, after being processed by the aforementioned diffusion model, it has the corresponding characteristics of a close-range acquisition image, which can better reflect the infrared temperature field distribution of the target object.
[0116] As an example, based on Figure 4 The long-distance infrared image in the embodiment is as follows: Figure 6 As shown in the figure. The actual infrared image collected at close range is as follows Figure 7 As shown in the figure, the grayscale values in the infrared images simulated by the present invention are closer to the real grayscale values of the actual close-up images than the original long-distance captured images. This can improve the accuracy of long-distance infrared detection in industrial scenarios where it is difficult to capture infrared images at close range.
[0117] Step 2.5: After completing step 2.4, to further improve image quality and detail, this embodiment can also use a super-resolution network (also using a Diffir network) to upscale the processed image, resolving the 256*192 resolution to 1024*768. Through its deep learning architecture, the super-resolution network effectively increases image resolution while maintaining image fidelity, enhancing texture detail and making target features in infrared images more clearly discernible.
[0118] The embodiments described above are merely some preferred implementations of the present invention and are not intended to limit the present invention. Persons skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent substitution or equivalent transformation falls within the scope of protection of the present invention.
Claims
1. A method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color, characterized in that: include: S1, obtaining a first image pair consisting of a close-range infrared image and a long-range infrared image collected in pairs for different targets; S2, cropping the long-range infrared image in the first image pair to a region of interest so that it aligns with the field of view of the short-range infrared image, obtaining a short-range simulated infrared image, and pairing it with the short-range infrared image to form a second image pair; S3, converting the close-range simulated infrared images and the close-range infrared images in all the second image pairs into close-range simulated pseudo-color images and close-range pseudo-color images through bit decomposition and range mapping, and then using them as training samples to train the diffusion model so that the model can generate close-range pseudo-color images based on the close-range simulated pseudo-color images; S4. After cropping the region of interest of the infrared image collected at a long distance, the image is converted into a pseudo-color image through bit decomposition and range mapping, and then input into the trained diffusion model. The output image is subjected to range inverse mapping and bit value restoration processing opposite to the bit decomposition and range mapping processing to obtain an infrared image simulated at a close distance.
2. The method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color according to claim 1, wherein: In the first image pair, the short-range infrared image and the long-range infrared image are acquired synchronously by two cameras at different distances from the target object at the same viewing angle.
3. The method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color according to claim 1, wherein: The second image pair needs to be downsampled to an input image size that meets the diffusion model's requirements.
4. The method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color according to claim 1, wherein: The second image pair needs to be data enhanced to obtain more second image pair samples.
5. The method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color according to claim 1, wherein: When performing the bit decomposition and range mapping processing on an infrared image, the grayscale value of each pixel of the infrared image must first be converted into an 8-bit binary value. Then, 2 bits, 3 bits, and 3 bits of the 8-bit binary value are extracted in order from the highest bit to the lowest bit and converted into decimal, which are used as the R channel value, G channel value, and B channel value of the corresponding pixel respectively. The value range of each of the three channels is then scaled and mapped to the range of 0 to 255, thereby converting the infrared image into a pseudo-color image.
6. The method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color according to claim 1, wherein: The diffusion model adopts a Diffir network, and when training the diffusion model, the model input is a close-range simulated pseudo-color image, the model's true value label is a close-range pseudo-color image, and the diffusion model is trained by minimizing the error loss between the model output and the true value label.
7. The method for simulating close-range infrared long-range images based on bit-decomposed pseudo-color according to claim 1, wherein: The final simulated close-range infrared image needs to be magnified through a super-resolution network.
8. A system for simulating close-range infrared long-range images based on bit-decomposed pseudo-color, characterized in that: include: An image acquisition module is used to acquire a first image pair consisting of a close-range infrared image and a long-range infrared image collected in pairs of different targets; A field of view alignment module is used to crop the long-range infrared image in the first image pair to a region of interest so that it is aligned with the field of view of the short-range infrared image, thereby obtaining a short-range simulated infrared image and pairing it with the short-range infrared image to form a second image pair; a model training module, configured to convert the close-range simulated infrared images and the close-range infrared images in all second image pairs into close-range simulated pseudo-color images and close-range pseudo-color images through bit decomposition and range mapping, and then use them as training samples to train the diffusion model so that the model can generate close-range pseudo-color images based on the close-range simulated pseudo-color images; The close-range simulation module is used to crop the region of interest of the infrared image collected at a long distance, convert it into a pseudo-color image through bit decomposition and range mapping, and then input it into a trained diffusion model. The output image is subjected to range inverse mapping and bit value restoration processing that are opposite to the bit decomposition and range mapping processing to obtain an infrared image simulated at a close distance.
9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by the processor, the method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color according to any one of claims 1 to 7 is implemented.
10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is configured to implement the method for close-range simulation of infrared long-range images based on bit-decomposed pseudo-color according to any one of claims 1 to 7 when executing the computer program.