An infrared image simulation method based on gray scale migration
By calculating the mean and variance of infrared and grayscale images, and adjusting the mean and variance of the grayscale image, the problem of uneven grayscale distribution is solved, generating a grayscale image that is closer to the actual infrared image, thus improving the face detection effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INGENIC SEMICON CO LTD
- Filing Date
- 2022-09-15
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, the uneven grayscale distribution of infrared images obtained based on grayscale transformation leads to poor face detection results, and existing datasets cannot meet the needs of real-world infrared image scenarios.
By calculating the mean and variance of the infrared and grayscale images, adjusting the mean and variance of the grayscale image, and using a weighted method to convert the color image into a grayscale image, while limiting the range of grayscale values, an approximate infrared image is generated.
It achieves balanced grayscale distribution in grayscale images, improves the simulation effect of infrared images, and enhances the accuracy of face detection.
Smart Images

Figure CN117745853B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and specifically relates to an infrared image simulation method based on grayscale migration. Background Technology
[0002] With the development of science and technology, image processing technology has been continuously advancing. Currently, most infrared face detection datasets based on deep learning are derived from converting visible light color images to grayscale. Color images generally consist of three channels: R, G, and B, while grayscale images consist of a single channel. A weighted average method is typically used to convert color images to grayscale.
[0003] As shown in Figures 1(a) and 1(b), Figure 1(a) is the grayscale distribution histogram of an infrared image obtained from a standard infrared camera, and Figure 1(b) is the grayscale distribution histogram of a grayscale image converted from a color image. However, it can be seen from Figures 1(a) and 1(b) that the image converted using the grayscale transformation formula exhibits severe imbalance in grayscale distribution. In contrast, the infrared image acquired by the infrared camera shows a more balanced grayscale distribution. Although the techniques mentioned in the background section can yield datasets approximating infrared images, they have not yielded satisfactory results in practical project applications. Images obtained solely through grayscale transformation cannot meet the requirements of real-world infrared camera scenarios. Existing technologies urgently need to address the problem of uneven grayscale distribution caused during the grayscale conversion process.
[0004] In addition, the technical terms involved in the prior art include:
[0005] 1. Face Detection: Face detection technology uses facial contour information to determine whether an input image contains a human face. If the input image contains facial information, it outputs the position information of the top left and bottom right corners of the face bounding box, the confidence score, and other information.
[0006] 2. Data Augmentation: Based on the existing dataset, minor changes are made to the data through methods such as flipping, translating, and cropping, ensuring that the main features and data distribution remain consistent between the original and transformed data. Convolutional neural networks learn from the augmented data, resulting in better generalization ability.
[0007] 3. Infrared Grayscale Images: Infrared imaging devices form images by acquiring the radiation of a target in the infrared band. The imaging effect of infrared images is similar to that of grayscale images, and both are single-channel data formats. Using infrared grayscale images as datasets can overcome the influence of light.
[0008] 4. Grayscale image: Obtains the intensity of visible light from an object. It is composed of different shades of gray and black and white. Summary of the Invention
[0009] To address the aforementioned issues, this application aims to resolve the problem of poor face detection performance caused by grayscale image datasets not accurately reflecting real-world infrared image scenarios. By adjusting the grayscale distribution of existing grayscale datasets to better simulate infrared images, a method of mean and variance replacement is proposed.
[0010] Specifically, the present invention provides an infrared image simulation method based on grayscale migration, the method comprising:
[0011] S1, acquire the image, and calculate the mean m1 and variance s1 of the infrared image F:
[0012] The image size is H*W, and the pixel value at position i, j is P. i,j ,
[0013] mean
[0014] variance
[0015] S2, calculate the mean m2 and variance s2 of the grayscale image G:
[0016] The image size is H*W. Assume the pixel value at position i, j is I, where I is the value in the formula below. i,j ,
[0017] mean
[0018] variance
[0019] S3, According to the formula, readjust the mean and variance of the grayscale image:
[0020] G' = (G-m1)*s2 / s1+m2;
[0021] Where G is the original grayscale image, and G' is the approximate infrared image generated after adjusting the mean and variance;
[0022] S4, restricting the display range of the image grayscale values to (0, 255); step S4 is implemented through code and further includes:
[0023]
[0024] S5 finally yields an approximate infrared image after changing the grayscale values and their distribution; that is, the image obtained from S4 is the final approximate infrared image.
[0025] The method uses a camera with a resolution of 640*320 and is equipped with an 800nm near-infrared filter to capture infrared images indoors.
[0026] Step S2 further includes:
[0027] This method uses a 640*320 resolution three-channel color image as a grayscale image, which is converted to grayscale using a weighted method. The pixel value is I, which is I(x,y) in the formula below; the conversion formula is:
[0028] I(x,y)=0.3*I_R(x,y)+0.59*I_G(x,y)+0.11*I_B(x,y)
[0029] The image consists of three color channels: R, G, and B. The pixel value of the R channel is I_R(x,y), the pixel value of the G channel is I_G(x,y), and the pixel value of the B channel is I_B(x,y). I_R(x,y), I_G(x,y), and I_B(x,y) represent the pixel values at (x,y) for the corresponding channel.
[0030] The weighting coefficients 0.3, 0.59, and 0.11 are parameters adjusted based on the human brightness perception system and are standardized parameters.
[0031] Therefore, the advantage of this application is that the method is simple and allows the same image to have different infrared image styles, thereby solving the problem of uneven grayscale distribution caused during grayscale conversion. Attached Figure Description
[0032] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.
[0033] Figure 1(a) is the infrared grayscale distribution histogram.
[0034] Figure 1(b) is a histogram of grayscale image distribution.
[0035] Figure 2 This is a flowchart illustrating the method of the present invention. Detailed Implementation
[0036] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.
[0037] Experiments have shown that training with an infrared dataset outperforms training with a grayscale dataset. However, infrared datasets are relatively few, so this new method is needed to expand the infrared dataset.
[0038] like Figure 2 As shown, an infrared image simulation method based on grayscale migration is described. The method includes: using a camera with a resolution of 640*320 and equipped with an 800nm near-infrared filter, the infrared image is captured indoors.
[0039] S1, acquire the image, and calculate the mean m1 and variance s1 of the infrared image F:
[0040] The image size is H*W, and the pixel value at position i, j is P. i,j ,
[0041] mean
[0042] variance
[0043] S2, calculate the mean m2 and variance s2 of the grayscale image G:
[0044] The image size is H*W, and the pixel value at position i, j is I. i,j ,
[0045] mean
[0046] variance
[0047] This method uses a 640*320 resolution three-channel color image as a grayscale image, which is converted to grayscale using a weighted method. The pixel value is I, which is I(x,y) in the formula below; the conversion formula is:
[0048] I(x,y)=0.3*I_R(x,y)+0.59*I_G(x,y)+0.11*I_B(x,y)
[0049] The image consists of three color channels: R, G, and B. The pixel value of the R channel is I_R(x,y), the pixel value of the G channel is I_G(x,y), and the pixel value of the B channel is I_B(x,y). I_R(x,y), I_G(x,y), and I_B(x,y) represent the pixel values at (x,y) for the corresponding channel.
[0050] Among them, the weighting coefficients 0.3, 0.59, and 0.11 are parameters adjusted according to the human brightness perception system and are standardized parameters;
[0051] S3, According to the formula, readjust the mean and variance of the grayscale image:
[0052] G' = (G-m1)*s2 / s1+m2;
[0053] Where G is the original grayscale image, and G' is the approximate infrared image generated after adjusting the mean and variance;
[0054] S4, restrict the display range of image grayscale values to (0, 255):
[0055] Implemented through code, further including:
[0056]
[0057]
[0058] S5 finally yields an approximate infrared image after changing the grayscale values and their distribution; that is, the image obtained from S4 is the final approximate infrared image.
[0059] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An infrared image simulation method based on grayscale migration, characterized in that, The method includes the following steps: S1, acquire the image, and calculate the mean m1 and variance s1 of the infrared image F: The image size is H*W, and the pixel value at position i, j is P. i,j , S2, calculate the mean m2 and variance s2 of the grayscale image G: The image size is H*W. Assume the pixel value at position i, j is I, and the pixel value is I. i,j , S3, According to the formula, readjust the mean and variance of the grayscale image: G' = (G-m1)*s2 / s1+m2; Where G is the original grayscale image, and G' is the approximate infrared image generated after adjusting the mean and variance; S4, restricting the display range of the image grayscale values to (0, 255); step S4 is implemented through code and further includes: S5 finally yields an approximate infrared image after changing the grayscale values and their distribution; that is, the image obtained from S4 is the final approximate infrared image.
2. The infrared image simulation method based on grayscale migration according to claim 1, characterized in that, The method uses a camera with a resolution of 640*320 and is equipped with an 800nm near-infrared filter to capture infrared images indoors.
3. The infrared image simulation method based on grayscale migration according to claim 1, characterized in that, Step S2 further includes: This method uses a 640*320 resolution three-channel color image as a grayscale image, which is converted to grayscale using a weighted method. The pixel value is I, which is I(x,y) in the formula below; the conversion formula is: I(x,y)=0.3*I_R(x,y)+0.59*I_G(x,y)+0.11*I_B(x,y) The image consists of three color channels: R, G, and B. The pixel value of the R channel is I_R(x,y), the pixel value of the G channel is I_G(x,y), and the pixel value of the B channel is I_B(x,y). I_R(x,y), I_G(x,y), and I_B(x,y) represent the pixel values at (x,y) for the corresponding channel. The weighting coefficients 0.3, 0.59, and 0.11 are parameters adjusted based on the human brightness perception system and are standardized parameters.