A method for infrared image stitching based on multi-scale depth homography

By constructing a multi-scale deep homography infrared image splicing network, using convolution blocks and skip connections for feature extraction and splicing, and combining edge and content loss functions, the ghosting and artifact problems caused by parallax in the existing technology are solved, and the implementation It achieves efficient and natural infrared image stitching effects.

CN116091314BActive Publication Date: 2024-08-27CHANGCHUN UNIV OF SCI & TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202211719372.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2024-08-27
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing infrared image stitching methods are difficult to completely solve the parallax problem when the camera motion model includes displacement, rotation and scaling, especially when the scene is close to the camera, resulting in poor stitching effects, such as ghosting and artifacts. And the calculation complexity is high and the efficiency is low.

Method used

An infrared image splicing method based on multi-scale deep homography is adopted. By constructing a network model including an infrared image alignment module and a splicing module, convolution blocks and skip connections are used for feature extraction and splicing, and the loss function combines edge loss and content loss. , fine-tune the model to improve the stitching effect.

Benefits of technology

It achieves a more natural infrared spliced ​​image, eliminates ghosting, improves feature point alignment accuracy and splicing efficiency, generates images that are more in line with human visual effects, and reduces computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116091314B
    Figure CN116091314B
Patent Text Reader

Abstract

The present invention belongs to the field of image stitching technology, and in particular is an infrared image stitching method based on multi-scale deep homography, comprising the following steps: Step 1, constructing a network model: the entire infrared image stitching network includes an infrared image alignment module and an infrared image stitching module; Step 2, preparing a data set: selecting a KAIST data set, adjusting the size of each image in the data set, and fixing the size of the input image; Step 3, training the network model. At the same time, the optimal evaluation index is selected to measure the accuracy of the algorithm and evaluate the performance of the system. The infrared image alignment module proposed in the present invention is a three-layer feature pyramid composed of four convolution blocks. By processing the input image, the homography is estimated using the features extracted from each layer of the pyramid, and the homography estimated by the upper layer is passed to the lower layer, thereby gradually improving the alignment accuracy of feature points and improving the network feature extraction capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image stitching, and in particular relates to an infrared image stitching method based on multi-scale depth homography. Background Art

[0002] Infrared image stitching has been widely used in different fields such as biology, medicine, surveillance video, autonomous driving, virtual reality, etc. Existing methods use estimated deformation functions to deform the feature points of the overlapping area of ​​two infrared images. Homography is the most commonly used deformation function. However, when the camera motion model includes not only displacement, but also rotation and scaling degrees of freedom, especially when the distance between the scene being photographed and the camera is very close, the surfaces of the scene being photographed are at different depths or planes at different directions at the same depth, the methods based on global or local homography estimation cannot completely solve this problem and will be affected by parallax. In these cases, "parallax problems" will occur, resulting in poor stitching effects, such as ghosting and artifacts in the stitched image.

[0003] The Chinese patent publication number is "CN115035281A", and the name is "A fast infrared panoramic image stitching method". This method first performs image preprocessing operations on the original image; then uses the ROI algorithm to select the region of the processed image; uses the SIFT algorithm to extract feature points from the infrared image of the selected area; then uses the RANSAC algorithm to screen out the correct feature matching pairs; then based on the infrared image after feature matching, uses the adaptive similarity algorithm to calculate the similarity of the infrared image to be stitched, and determines the stitching order of the infrared image; finally, uses the weighted image fusion algorithm to fuse the image to achieve the stitching of the infrared panoramic image. This method has low feature extraction capability, and the infrared stitching image obtained has ghosting and artifacts, which does not meet the visual effect of the human eye. At the same time, the calculation complexity is high and the efficiency is low. Summary of the invention

[0004] 1. Technical issues to be solved

[0005] In view of the shortcomings of the prior art, the present invention provides an infrared image stitching method based on multi-scale depth homography, which solves the problems of ghosting, artifacts, unnaturalness, etc. in the images obtained by the infrared image stitching method.

[0006] (II) Technical solution

[0007] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions:

[0008] An infrared image stitching method based on multi-scale depth homography comprises the following steps:

[0009] Step 1, building a network model: the entire infrared image stitching network includes an infrared image alignment module and an infrared image stitching module;

[0010] Step 2, prepare the dataset: select the KAIST dataset, adjust the size of each image in the dataset, and fix the size of the input image;

[0011] Step 3, training the network model: input the data set prepared in step 2 into the network model built in step 1 for training;

[0012] Step 4, select the minimized loss function and the optimal evaluation index: By minimizing the loss function of the network output image and label, until the number of training times reaches the set threshold or the value of the loss function reaches the set range, the model parameters are considered to have been pre-trained and saved. At the same time, select the optimal evaluation index to measure the accuracy of the algorithm and evaluate the performance of the system;

[0013] Step 5, fine-tuning the model: Use the LTIR dataset to train and fine-tune the model to obtain stable and usable model parameters, which ultimately makes the model more effective for infrared image stitching;

[0014] Step 6, save the model: solidify the final model parameters, and when the infrared image stitching operation is needed, directly input the image into the network to obtain the final stitching image.

[0015] Further, in step 1, the infrared image alignment module is composed of four convolution blocks, each of which is composed of a skip connection, a convolution layer, a normalization layer, an activation function, and a maximum pooling layer; convolution block 1 performs primary feature extraction on the input image, and convolution blocks 2, 3, and 4 form a three-layer feature pyramid, using the convolution blocks of each layer in the pyramid to extract high-level features in the image and estimate homography; the infrared image stitching module is composed of seven convolution modules, wherein convolution block 5 is composed of a skip connection, a convolution layer, a normalization layer, and an activation function, convolution blocks 6, 7, and 8 are composed of a skip connection, a convolution layer, a normalization layer, an activation function, and a maximum pooling layer, and are responsible for downsampling, and convolution blocks 9, 10, and 11 are composed of a skip connection, a convolution layer, a normalization layer, an activation function, and a deconvolution layer, and are responsible for upsampling. The size of the feature map finally obtained is consistent with the size of the input image.

[0016] Furthermore, in the step 4, the loss function selected during the training process uses a combination of edge loss and content loss; the selection of the loss function affects the quality of the model, can truly reflect the difference between the predicted value and the true value, and can correctly feedback the quality of the model; the obtained infrared stitching image has a more natural stitching effect and is more in line with human visual observation.

[0017] The selection of appropriate evaluation indicators such as root mean square error, peak signal-to-noise ratio and structural similarity during the training process can effectively evaluate the quality of the infrared image stitching algorithm results and the degree of distortion of the infrared stitching images, and measure the role of the stitching network.

[0018] (III) Beneficial effects

[0019] Compared with the prior art, the present invention provides an infrared image stitching method based on multi-scale depth homography, which has the following beneficial effects:

[0020] The infrared image alignment module proposed in the present invention is a three-layer feature pyramid composed of four convolution blocks. By processing the input image, the homography is estimated using the features extracted from each layer in the pyramid, and the homography estimated in the upper layer is passed to the lower layer, thereby gradually improving the alignment accuracy of feature points and improving the network feature extraction capability.

[0021] The infrared image stitching module proposed in the present invention consists of an edge-preserving deformation network composed of seven convolutional blocks. By learning the deformation law of image stitching from edge to content, the deformed images are stitched to eliminate the ghosting effect while maintaining the edge continuity of the stitched image.

[0022] The present invention proposes a composite loss function composed of edge loss and content loss, which enables the splicing network to generate a more natural infrared splicing image, while making the image more realistic and improving the visual effect of the human eye.

[0023] The present invention uses a variety of activation functions in a backbone network, which can make the image output by the network more consistent with human visual observation; adding jump connections in the network helps to reduce network parameters, making the entire network structure simple and improving splicing efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flow chart of an infrared image stitching method based on multi-scale depth homography;

[0025] Figure 2 This is a network model structure diagram of an infrared image stitching method based on multi-scale depth homography;

[0026] Figure 3 The specific composition of convolution block 1, convolution block 2, convolution block 3, convolution block 4, convolution block 6, convolution block 7 and convolution block 8 of the present invention;

[0027] Figure 4 The specific composition of the convolution block 5 of the present invention;

[0028] Figure 5 The specific composition of convolution block nine, convolution block ten and convolution block eleven of the present invention;

[0029] Figure 6 The following is a comparison of relevant indicators between the prior art and the method proposed by the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] Example 1

[0032] like Figure 1 As shown, a method for stitching infrared images based on multi-scale depth homography comprises the following steps:

[0033] Step 1, build a network model; the entire infrared image stitching network includes an infrared image alignment module and an infrared image stitching module; the infrared image alignment module consists of four convolution blocks, each of which consists of a skip connection, a convolution layer, a normalization layer, an activation function and a maximum pooling layer; convolution block 1 performs primary feature extraction on the input image, and convolution blocks 2, 3 and 4 form a three-layer feature pyramid. The convolution blocks of each layer in the pyramid are used to extract high-level features in the image and estimate the homography, and the homography estimated by the upper layer is passed to the next layer, one by one. In order to improve the accuracy of feature point alignment, the size of convolution kernels in all convolution blocks is unified to n×n; the infrared image stitching module consists of seven convolution modules, among which convolution block five consists of skip connection, convolution layer, normalization layer and activation function, convolution block six, convolution block seven and convolution block eight consist of skip connection, convolution layer, normalization layer, activation function and maximum pooling layer, convolution block nine, convolution block ten and convolution block eleven consist of skip connection, convolution layer, normalization layer, activation function and deconvolution layer, and the size of the feature map obtained is consistent with the input image size;

[0034] Step 2, prepare the dataset; select the KAIST dataset, adjust the size of each image in the dataset, and fix the size of the input image;

[0035] Step 3, training the network model: input the data set prepared in step 2 into the network model constructed in step 1 for training;

[0036] Step 4: Select the minimized loss function and the optimal evaluation index. By minimizing the loss function of the network output image and the label, the model parameters are considered to have been trained until the number of training times reaches the set threshold or the value of the loss function reaches the set range. The model parameters are saved. During the training process, the loss function is selected to use a combination of edge loss and content loss.

[0037] The purpose is to obtain an infrared stitching image with a more natural stitching effect, which is more in line with human visual observation. The choice of loss function affects the quality of the model, can truly reflect the difference between the predicted value and the true value, and can correctly feedback the quality of the model. The appropriate evaluation indicators are root mean square error and structural similarity, which can effectively evaluate the quality of the infrared image stitching algorithm results and the degree of image distortion, and measure the role of the stitching network;

[0038] Step 5: Fine-tune the model. Use the LTIR dataset to train and fine-tune the model to obtain stable and usable model parameters, which ultimately makes the model more effective for infrared image stitching.

[0039] Step 6, save the model and solidify the final model parameters. When the infrared image stitching operation is needed, the image can be directly input into the network to obtain the final stitched image.

[0040] Embodiment 2:

[0041] The infrared image stitching network model structure in step 1 is as follows Figure 2 shown.

[0042] The infrared image stitching network includes an infrared image alignment module and an infrared image stitching module; the infrared image alignment module consists of four convolution blocks, each of which consists of a skip connection, two convolution layers, two normalization layers, an activation function and a maximum pooling layer; convolution block one performs primary feature extraction on the input image, and convolution blocks two, three and four form a three-layer feature pyramid. The convolution blocks of each layer in the pyramid are used to extract high-level features in the image and estimate the homography, and the homography estimated in the upper layer is passed to the next layer to gradually improve the accuracy of feature point alignment. The size of the convolution kernel in all convolution blocks is unified to 3×3, the step size is 1, and the activation function selects the S-type function. The specific composition of each convolution block is as follows: Figure 3 As shown in the figure, the infrared image stitching module consists of seven convolution modules, among which the convolution block 5 consists of a skip connection, two convolution layers, two normalization layers, and two activation functions. The size of the convolution kernel is 3×3, the step size is 1, and the activation function selects the S-type function. The structure of the convolution block 5 is as follows: Figure 4As shown; convolutional block six, convolutional block seven, and convolutional block eight are composed of skip connections, activation functions, two convolutional layers, two normalization layers, and a maximum pooling layer. The size of the convolution kernel is 3×3, the step size is 1, and the activation function selects the R-type function. The specific composition of each convolutional block is as follows Figure 3 As shown; convolution block nine, convolution block ten, and convolution block eleven are composed of skip connections, activation functions, two convolution layers, two normalization layers, and a deconvolution layer. The size of the convolution kernel is 3×3, the step size is 1, and the activation function selects the R-type function. The specific composition of each convolution block is as follows Figure 5 As shown;

[0043] In order to ensure that the network can retain more structural information and fully extract infrared image features, the activation functions used in the present invention are R-type function and S-type function. The definitions of R-type function and S-type function are as follows:

[0044]

[0045]

[0046] In step 2, the infrared image dataset uses the KAIST dataset, where the training set contains 50,187 images and the test set contains 45,141 images. The dataset captures various conventional traffic scenes including campuses, streets, and countryside during the day and at night, and the image size is 640×480.

[0047] In step 3, image enhancement is performed on the images in the data set, random diffraction transformation is performed on the same image, and it is cropped to the size of the input image as the input of the entire network, and the annotated images in the data set are used as labels; the random size and position can be achieved through software algorithms; the annotated images in the data set are used as labels to enable the network to learn better feature extraction capabilities and ultimately achieve better splicing effects.

[0048] The output of the network in step 4 and the label calculate the loss function, and a better splicing effect is achieved by minimizing the loss function. The loss function uses edge loss and content loss. The edge loss calculation formula is as follows:

[0049]

[0050] Where W and H represent the width and height of the stitched image, respectively, ·1 represents the L1 norm, is the ground truth edge feature map, and E is the edge feature map. Compared with the rich texture, content and other information in infrared images, the edge only contains the outline of the object in the image, so the edge loss is used to make image stitching easier to achieve.

[0051] In order to make the splicing network generate more natural spliced ​​images, content loss is adopted. Specifically, the perceptual loss of ReLU activation in the VGG-19 network is used as the representation of image content. The content loss is defined as follows:

[0052]

[0053] Among them, W j , H j and C j are the width, height and number of channels of the feature map, ·2 represents the L2 norm, Φ j Represents the feature representation of the j-th max pooling layer in the VGG-19 network.

[0054] Taking into account the constraints of edge and content, the overall loss function is defined as:

[0055] L S =λ e L edge +λ c L content

[0056] where λ e and λ c are the weighting parameters for edge loss and content loss, respectively. The weights are set based on preliminary experiments on the training dataset.

[0057] Edge loss and content loss help the network learn clearer edges and more detailed textures, so that the stitching of images can eliminate gaps, make the stitching more natural, and achieve better visual effects.

[0058] In step 4, appropriate evaluation indicators include root mean square error, peak signal-to-noise ratio and structural similarity. The root mean square error can effectively evaluate the accuracy of pixel registration in the overlapping area; the peak signal-to-noise ratio is the most common and widely used objective measurement method for evaluating the degree of image distortion; the structural similarity measures the image similarity from three aspects: brightness, contrast and structure. It is an indicator used to measure the similarity between two digital images. The root mean square error and structural similarity are defined as follows:

[0059]

[0060]

[0061] in, and is the matching point pair between the reference image and the target image in the image to be stitched, T is the transformation model, θ is the model parameter, · is the distance between the two points, μ x , μ y denote the mean and variance of the reference image and the target image respectively, and denote the standard deviation of the reference image and the target image, σ xy represents the covariance of the reference image and the target image, and C1 and C2 are constants.

[0062] The peak signal-to-noise ratio is defined as follows:

[0063]

[0064] Where max represents the maximum grayscale value of all pixels in the image. If the image is 8 bits, the max value is 255; if the image is n bits, the max value is 2. n -1.

[0065] The number of training times is set to 200, and the number of images input to the network each time is about 8-16. The upper limit of the number of images input to the network each time is mainly determined by the performance of the computer graphics processor. Generally, the larger the number of images input to the network each time, the better, making the network more stable. The learning rate of the training process is set to 0.0001, which can ensure fast fitting of the network without causing overfitting of the network. The network parameter optimizer selects the adaptive moment estimation algorithm. Its main advantage is that after bias correction, each iteration learning rate has a certain range, which makes the parameters relatively stable. The threshold of the loss function value is set to about 0.0003. If it is less than 0.0003, it can be considered that the training of the entire network has been basically completed.

[0066] Step 5, fine-tune the model. Use the LTIR dataset to train and fine-tune the model. For the LTIR dataset, we use 500 images for training and 200 images for testing.

[0067] Step 6, save the model. After the network training is completed, all parameters in the network need to be saved. Then, the infrared image to be stitched can be input into the network to obtain the stitched image. The network has no requirements for the input image size and any size is acceptable.

[0068] Among them, the implementation of convolution, activation function, maximum pooling, etc. are algorithms well known to those skilled in the art, and the specific processes and methods can be found in corresponding textbooks or technical literature.

[0069] The present invention constructs an infrared image stitching method based on multi-scale depth homography, which can directly stitch two infrared images with narrow viewing angles into an infrared image with ultra-wide viewing angle. The obtained infrared stitching image will not be affected by parallax, and artifacts are eliminated, which is more in line with the visual effect of the human eye. Under the same conditions, the relevant indicators of the image obtained by calculating the existing method are further verified, and the feasibility and superiority of the method are further verified. The comparison of the relevant indicators of the existing technology and the method proposed in the present invention is shown in Table 6.

[0070] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for stitching infrared images based on multi-scale depth homography, characterized by: The steps include: Step 1, building a network model: the entire infrared image stitching network includes an infrared image alignment module and an infrared image stitching module; In the step 1, the infrared image alignment module is composed of four convolution blocks, wherein each convolution block is composed of a skip connection, a convolution layer, a normalization layer, an activation function and a maximum pooling layer; convolution block 1 performs primary feature extraction on the input image, and convolution block 2, convolution block 3 and convolution block 4 form a three-layer feature pyramid, and the convolution blocks of each layer in the pyramid are used to extract high-level features in the image and estimate homography; the infrared image stitching module is composed of seven convolution modules, wherein convolution block 5 is composed of a skip connection, a convolution layer, a normalization layer and an activation function, convolution block 6, convolution block 7 and convolution block 8 are composed of a skip connection, a convolution layer, a normalization layer, an activation function and a maximum pooling layer, and are responsible for down sampling, convolution block 9, convolution block 10 and convolution block 11 are composed of a skip connection, a convolution layer, a normalization layer, an activation function and a deconvolution layer, and are responsible for up sampling, and the size of the feature map finally obtained is consistent with the size of the input image; Step 2, prepare the dataset: select the KAIST dataset, adjust the size of each image in the dataset, and fix the size of the input image; Step 3, training the network model: input the data set prepared in step 2 into the network model built in step 1 for training; Step 4: Select the minimized loss function and the optimal evaluation index: By minimizing the loss function of the network output image and the label, until the number of training times reaches the set threshold or the value of the loss function reaches the set range, the model parameters are considered to have been pre-trained, and the model parameters are saved. At the same time, the optimal evaluation index is selected to measure the accuracy of the algorithm and evaluate the performance of the system; Step 5, fine-tuning the model: Use the LTIR dataset to train and fine-tune the model to obtain stable and usable model parameters, which ultimately makes the model more effective for infrared image stitching; Step 6, save the model: solidify the final model parameters, and when the infrared image stitching operation is needed, directly input the image into the network to obtain the final stitching image.

2. The infrared image stitching method based on multi-scale depth homography according to claim 1, characterized in that: In the step 4, the loss function selected during the training process uses a combination of edge loss and content loss; the choice of loss function affects the quality of the model, can truly reflect the difference between the predicted value and the true value, and can correctly feedback the quality of the model; the obtained infrared stitching image has a more natural stitching effect, which is more in line with human visual observation. During the training process, appropriate evaluation indicators such as root mean square error, peak signal-to-noise ratio and structural similarity are selected, which can effectively evaluate the quality of the infrared image stitching algorithm results and the degree of distortion of the infrared stitching image, and measure the role of the stitching network.

Citation Information

Patent Citations

  • Rapid infrared panoramic image splicing method

    CN115035281A

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

    CN110070511A

  • Method for evaluating spliced image of 360-degree panoramic looking-around equipment

    CN113191952A

  • Image processing method and device, computer equipment and storage medium

    CN113344794A

  • Infrared image semantic segmentation method based on U-Net

    CN114092481A