Image splicing method and system for optimizing splicing quality based on deep learning

Through deep learning technology, the ResNet50 network and STL transformation network are used to optimize image splicing, which solves the problem of irregular boundaries of spliced ​​images, improves the splicing quality and realism, and achieves a more efficient image splicing effect.

CN118644385APending Publication Date: 2024-09-13CHINA THREE GORGES UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410763156.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Existing image stitching methods often have problems with irregular boundaries when stitching images, resulting in reduced quality and realism of the stitched images.

Method used

Using a method based on deep learning, the semantic information of the image is extracted through the ResNet50 network, combined with the global correlation layer and STL transformation network, to estimate the homography matrix, generate a smooth transformation image, and use the residual progressive regression network and the grid motion prediction module Optimize edges to produce high-quality stitched images with regular boundaries.

Benefits of technology

It improves the quality and realism of the spliced ​​image, reduces manual intervention, improves the user's viewing experience, and improves the robustness of the splicing effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644385A
    Figure CN118644385A
Patent Text Reader

Abstract

The invention discloses an image splicing method and method for optimizing splicing quality based on deep learning. The method comprises a homography matrix estimation stage: extracting feature information including semantic information of an image to be spliced based on a ResNet50 network; the similarity of the two images to be spliced is calculated through the global correlation layer; obtaining the offset of the image vertex through the convolution layer and the full connection layer; and estimating a homography matrix H by a DLT algorithm. In the preliminary splicing stage, a smooth change image is obtained according to the homography matrix H obtained in the homography matrix estimation stage by utilizing an STL transformation network; and generating a preliminary spliced image from the to-be-spliced image by means of average fusion. And an image quality optimization stage: predicting a complete boundary of the preliminarily spliced image and the corresponding mask so as to generate a high-quality image with the complete boundary. According to the method and the system, the image splicing quality can be improved, manual intervention is reduced, and the impression experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image stitching, and in particular to an image stitching method and system based on deep learning to optimize stitching quality. Background Art

[0002] Image stitching is an important technology with wide applications in the field of image processing. Its goal is to seamlessly stitch together images from different perspectives to generate images with high resolution and wide field of view. This technology plays an important role in the fields of camera ultra-wide angle image synthesis, space exploration, seabed survey, medical imaging, virtual reality, geological survey, remote sensing technology and video compression. In the field of image stitching, image stitching is the process of seamlessly fusing multiple images together to form a panoramic image or a high-resolution image.

[0003] Image stitching is a key research direction in the field of image processing. Its goal is to fuse multiple images together to generate a panoramic image or a high-resolution image with a larger field of view. Image stitching technology can eliminate the field of view limitation during shooting and fuse information from multiple perspectives into a single image, allowing observers to obtain a panoramic and continuous observation experience.

[0004] Traditional image stitching methods are mainly based on computer vision and image processing techniques, including feature extraction, image alignment, and overlapping region fusion. These methods usually rely on manually designed feature descriptions, such as SIFT (Scale Invariant Feature Transform) or SURF (Speeded Up Robust Features), to achieve image alignment by matching and aligning these feature points. Then, overlapping regions are fused through pixel-level fusion strategies to achieve seamless stitching. The limitations of traditional methods are that they require manual selection and adjustment of parameters, and the stitching effect is limited for large scenes or complex textures. In recent years, image stitching methods based on deep learning have gradually attracted attention. These methods use deep learning models such as deep convolutional neural networks (CNNs) or generative adversarial networks (GANs) to automatically learn image feature representations and stitching strategies through end-to-end learning. These methods can automatically extract semantic information and contextual relationships of images, and improve the quality and realism of stitching by generating realistic stitching results.

[0005] However, there are still some problems with the current image stitching methods. Although the stitched images can provide a wide field of view, irregular boundaries often occur, which makes people feel uncomfortable. Irregular boundaries refer to the uneven edges of the stitched images, with obvious transitions or artifacts. The presence of such irregular boundaries will reduce the quality and realism of the stitched images. Summary of the invention

[0006] In view of the current problems in image stitching based on deep learning, the present invention provides an image stitching method and system based on deep learning to optimize stitching quality. The deep learning model is used to learn and infer the rectangular boundaries in image stitching, and an automated way is provided to generate a stitched image with smooth and natural rectangular boundaries. At the same time, by introducing deep learning technology, the method and system can improve the quality of image stitching, reduce manual intervention, and improve the user's viewing experience.

[0007] The technical solution adopted by the present invention is:

[0008] Image stitching method based on deep learning to optimize stitching quality, including:

[0009] Homography matrix estimation stage:

[0010] S1.1: Extract feature information containing semantic information of the image to be spliced ​​based on the ResNet50 network;

[0011] S1.2: Calculate the similarity of the two images to be stitched through the global correlation layer;

[0012] S1.3: Obtain the offset of the image vertices through the convolution layer and the fully connected layer;

[0013] S1.4: Estimate the homography matrix H by the DLT algorithm;

[0014] Initial splicing stage:

[0015] S2.1: Using the STL transformation network, a smoothly changing image is obtained according to the homography matrix H obtained in the homography matrix estimation stage;

[0016] S2.2: using average fusion to generate the images to be stitched into a preliminary stitched image;

[0017] Image quality optimization stage:

[0018] The preliminary spliced ​​image and its corresponding mask Mask are used to predict its complete boundary, thereby generating a high-quality image with a complete boundary.

[0019] In S1.2, the global correlation layer can evaluate the geometric transformation relationship between the two images by calculating the similarity between them, thereby improving the accuracy and quality of stitching;

[0020]

[0021] Among them: x1, x2 represent the features respectively Figure 1 and Features Figure 2 Position; F A (x1) indicates the feature Figure 1The one-dimensional feature vector at position x1 in F B (x2) indicates characteristics Figure 2 The one-dimensional feature vector at position x2 in the middle; Z represents the integer domain, and the formula CV(x1,x2) represents the cosine similarity, which is usually used to measure the similarity between two things, where x1,x2∈Z 2 It can be understood that x1 and x2 are two elements in the set of square integers, so we can get the ordered integer pair (x1,F A (x1)) and (x2,F B (x2)).

[0022] CV(x1,x2) represents F A (x1) and F B The closer the similarity of (x2) is to 1, the higher the similarity between the two, which means the better the feature match between the two.

[0023] The preliminary splicing stage specifically includes the following steps:

[0024] b3.1: two input images I Input2 and image I Input1 Generate two grids, each element in the grid represents its two-dimensional spatial position (u i , v i ), i=1,2:

[0025]

[0026] Where: H represents from I Input2 To I Input1 Projection transformation; (x, y, z) are the homogeneous coordinates of the original image;

[0027] (x, y, z) are the homogeneous coordinates of the original image. The meaning of homogeneous coordinates is: a coordinate system representing a point in three-dimensional space, which is often used in the fields of computer graphics and computer vision. Then x represents the position of the point on the x-axis, that is, the coordinate value in the horizontal direction; y represents the position of the point on the y-axis, that is, the coordinate value in the vertical direction; z represents the position of the point on the z-axis, that is, the coordinate value along the third axis perpendicular to the x and y axes; the subscripts 1 and 2 of x, y, and z represent two input images respectively: Image I Input1 、Image I Input2 .

[0028] By the above formula, we can obtain W Input2 The corresponding coordinates of W are obtained by replacing H with the identity matrix E Input1 The coordinates of .

[0029] b3.2: Obtain a smooth transformed image W through STL transformation Input1 and WInput2 ;

[0030] b3.3: The image W obtained in step b3.2 Input1 and W Input2 Perform preliminary stitching to obtain a preliminary stitching image;

[0031] The initial stitching step includes: Input1 and W Input2 Perform average fusion stitching. Specifically, the pixel value of the overlapping area is equal to I AW and I BW The sum of the pixel values, weighted by 0.5; where: I AW and I BW Respectively represent the output image: W Input1 , W Input2 The pixel values ​​corresponding to the overlapping area.

[0032] like Figure 3 As shown, the input image (I Input1 and I Input2 ) is transformed by STL to obtain the output image (W Input1 and W Input2 ), I AW and I BW They represent the output image (W Input1 and W Input2 ) The pixel values ​​corresponding to the overlapping areas are obtained because the two images need to be averaged and fused in this step. The principle of average fusion and splicing is to average the pixel values ​​of the two images.

[0033] b3.4: Obtain a mask of corresponding size from the preliminary spliced ​​image.

[0034] The image quality optimization stage includes inputting the obtained preliminary stitched image and mask Mask to generate an optimized stitched image, which specifically includes the following steps:

[0035] c3.1: The obtained preliminary spliced ​​image is fused with the mask Mask and then input into the feature extraction module;

[0036] c3.2: Feature extraction module When performing feature extraction, simple convolutional pooling blocks are stacked to extract high-level semantic features from the input. Eight convolutional layers are used, and the number of filters is set to 64, 64, 64, 64, 128, 128, 128, and 128 respectively. The maximum pooling layer is used after the 2nd, 4th, and 6th convolutional layers, and after extraction, it is input into the residual progressive regression network module.

[0037] c3.3: In the residual progressive regression network module, an adaptive pooling layer is used to fix the resolution of the feature map, and a fully convolutional structure is designed as a regression network to predict the horizontal and vertical motion of each vertex based on a regular grid. Assuming the grid resolution is U×V, the output size is (U+1)×(V+1)×2;

[0038] c3.4: The output size of the grid is (U+1)×(V+1)×2, which is input into the grid motion prediction module. The shape is repaired according to the extracted features to obtain a preliminary optimized image, which is a concave rectangular stitching result;

[0039] c3.5: Input the initial optimized image obtained in c3.4 into the residual progressive regression network module. At the same time, the image to be spliced ​​I Input2 and image I Input1 Extract features through the feature extraction module with weight sharing in step c3.2 to obtain the required local information and further optimize the spliced ​​image with concavity;

[0040] c3.6: The result obtained in step c3.5 is input into the grid motion prediction module to obtain a complete rectangular stitching result.

[0041] An image stitching system based on deep learning to optimize stitching quality, the system includes:

[0042] A grayscale processing module, used for grayscale processing of the image to be spliced;

[0043] The feature extraction module introduces the ResNet50 network, which is a deep network that can capture higher-level semantic information and extract richer feature information of the images to be spliced.

[0044] The regularization module uses L1 Normalization to regularize the extracted information and improve the effect of feature selection;

[0045] The global correlation module calculates the global similarity of features between the two images to be stitched. The higher the similarity, the better the feature matching.

[0046] The convolutional fully connected module, which consists of convolutional layers and fully connected layers, is used to predict the offset as the input of DLT;

[0047] The direct linear transformation (DLT) module takes the predicted offset as input and calculates the homography matrix H;

[0048] The spatial transformation module introduces an STL transformation network, adjusts the optimal parameters according to the input, inputs the image to be stitched, as well as the homography matrix H and the unit matrix E, deforms the input image, and finally obtains a smooth transformation image through interpolation;

[0049] Average fusion module, input the processed image to be stitched, according to the pixel points of the feature area, the pixel value of the overlapping area is equal to the sum of the pixel values ​​of the two images, and the weight value is 0.5;

[0050] The fusion module performs simple channel superposition on the preliminary spliced ​​image result and the corresponding mask, and then inputs them into the feature extraction module;

[0051] The residual progressive regression network module is used to predict the length and width of the input image data, which is beneficial for subsequent data processing;

[0052] The grid motion prediction module predicts the length and width of the input image data, and then predicts the complete content of the stitched image, and optimizes the stitching result into a rectangle.

[0053] The present invention provides an image stitching system and method based on deep learning to optimize stitching quality, and the technical effects are as follows:

[0054] 1) The present invention uses the ResNet50 network, which can capture higher-level semantic information and extract richer feature information of the images to be spliced.

[0055] 2) The present invention uses the image to be spliced ​​and the mask generated by it to predict a regular boundary, as follows:

[0056] First, a mask is a binary image or matrix used to mark or indicate a specific area in an image. The mask image usually has the same size as the original image, where the target or area of ​​interest is marked in white, such as Figure 4 As shown in Mask, by using masks, specific areas of the image can be selected, operated or analyzed;

[0057] Then, by using image stitching and the generated mask to predict the regular boundaries, the accuracy of boundary prediction and the stitching quality can be improved; the mask provides more accurate semantic information to help the model understand the target area and boundary position in the image, thereby improving the discontinuity and transition problems in the stitching process; in short, using image stitching and mask to predict regular boundaries is an effective method that can improve prediction accuracy and stitching quality.

[0058] 3) The present invention uses a residual progressive regression module and a grid motion prediction module to optimize the irregular edges of the preliminary spliced ​​image and predict a regular boundary. The advantages are:

[0059] Improved edge matching: The residual progressive regression module can optimize the irregular edges of the preliminary stitched images and make edge matching more accurate by learning residual information;

[0060] Improve stitching effect: The grid motion prediction module can predict regular boundaries by modeling and predicting the grid motion in the image;

[0061] Increased robustness: Through residual progressive regression and mesh motion prediction, the model can better adapt to the edge features of different scenes and images;

[0062] In short, the two methods can improve edge matching, enhance stitching effects, and increase the robustness of the model, thereby effectively optimizing the irregular edges of the preliminary stitched images and obtaining better stitching results. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The present invention will be further described below in conjunction with the accompanying drawings and examples;

[0064] Figure 1 is a pair of images to be spliced ​​randomly selected from the COCO2014 dataset in the present invention.

[0065] Figure 2 Schematic diagram of the initial image stitching stage in the present invention.

[0066] Figure 3 It is a schematic diagram of the specific process of image fusion in the present invention.

[0067] Figure 4 Schematic diagram of the stitching image quality optimization stage in the present invention.

[0068] Figure 5 is a randomly selected image from the COCO2014 dataset.

[0069] Figure 6 The difference between the processed image and the input image.

[0070] Figure 7 The two input images are the cropped images to be stitched.

[0071] Figure 8 Grayscale processing of the image to be stitched.

[0072] Fig. 9 Schematic diagram of ResNet50 used for feature extraction.

[0073] Fig.10 This is the preliminary stitching image (to be optimized).

[0074] Fig.11 To initially optimize the image.

[0075] Fig.12 This is the final optimized stitched image. DETAILED DESCRIPTION

[0076] An image stitching system and method for optimizing stitching quality based on deep learning is proposed. The method is mainly divided into three stages: first, the homography matrix corresponding to the two images is estimated; then, the transformed image to be stitched is obtained by STL transformation according to the homography matrix, and then the preliminary stitching result is obtained according to the average fusion; finally, based on the preliminary stitching result and the corresponding mask, the local information of the image to be stitched is used to obtain a high-quality stitching result.

[0077] The image stitching method based on deep learning to optimize stitching quality includes the following steps:

[0078] Step 1: Generate an image stitching dataset (Stitched-COCO) from the COCO2014 dataset; this step includes the following sub-steps:

[0079] Step 1.1. Select the original dataset: Use the COCO2014 dataset as the original dataset, which contains a large number of diverse images.

[0080] Step 1.2. Generate images to be stitched: Randomly select an image from the COCO2014 dataset as a basis to generate a set of images to be stitched. The size of these images to be stitched can be any size.

[0081] Figure 1 It represents a pair of images to be stitched after generation. The two images in the stitched image contain the same parts, and the goal is to superimpose the same parts to obtain a larger image.

[0082] Since there are not many datasets of images to be stitched, we randomly select an image from the COCO2014 dataset to generate the required dataset of images to be stitched. Figure 1 is the generated image to be stitched, and step 1 is the step of gradually generating the image to be stitched, how to gradually generate the required pair of images to be stitched from an original image. Figure 5 For example, a normal photo is processed to obtain two Figure 1 The images to be stitched.

[0083] Step 1.3. Simulate the characteristics of image stitching: On the selected image, the four vertices of the image block are randomly perturbed in the range of [-ρ, ρ]. At the same time, random translation is added to simulate the situation in which the baseline is large and the overlap is low in image stitching.

[0084] Random perturbation, the range of perturbation is [-ρ, ρ], where ρ is a very small value, representing a slight perturbation; similarly, random translation is also a slight change, and the processed image is not much different from the input image, such as Figure 6As shown, the significance of random perturbation and random movement is to increase the diversity and generalization ability of images. By randomly perturbing and randomly translating images, different changes and interferences in actual scenes can be simulated, making the model more robust and adaptable when facing unknown data; such transformations can help the model learn more features and patterns, and improve the accuracy and stability of its subsequent model processing; at the same time, random perturbation and random translation can also effectively reduce the risk of overfitting.

[0085] Step 1.4. Crop the images to be stitched: Randomly crop two images from the processed images as the images to be stitched. The purpose of this is to obtain the local area of ​​the stitched image for subsequent processing and evaluation of the stitching task. Figure 7 The two inputs are shown in Fig.

[0086] Step 2: If Figure 2 As shown, it is the initial image stitching stage, which is used to obtain the initial stitching image. This step includes:

[0087] Step 2.1: Grayscale the image to be stitched. Grayscale processing has the following effects: (1) Reduce computational complexity: Grayscale converts color images into single-channel images, reducing the amount of data to be processed and the complexity of computation; (2) Eliminate color distribution interference: The color distribution of color images may vary due to factors such as lighting and white balance. Grayscale can eliminate these differences, making the colors consistent when stitching images and avoiding interference; (3) Improve stitching accuracy: The grayscaled image has higher contrast and detail information, making the stitched image more realistic and natural. Grayscale can reduce the interference of color information and improve the perception and matching accuracy of features such as textures, lines, and corners. The grayscaled image is shown in the figure below. Figure 8 As shown, the two images are changed, and the RGB color image is converted into a grayscale image.

[0088] Step 2.2: Use the ResNet50 network with shared weights to extract features from the grayscaled images to be spliced, such as Figure 2 One of the steps shown is feature extraction. This step uses the ResNet50 network to extract its features. The following ResNet50 network is briefly explained and its approximate image is drawn as follows:

[0089] like Fig. 9As shown in the figure, ResNet50 is a variant model of a deep residual network. The core idea of ​​ResNet is to solve the problems of gradient vanishing and model degradation by introducing residual connections. In traditional neural networks, the input of each layer is directly connected to the output, which causes the gradient to shrink layer by layer during back propagation, making network training difficult. In ResNet, the input of each layer is connected to the output through a skip connection to form a residual block. In this way, during back propagation, even if the gradient shrinks, it can still be propagated to the shallower layer through the residual block, thereby alleviating the problem of gradient vanishing.

[0090] Among them, 50 represents the depth of the ResNet50 model, that is, the network has 50 convolutional layers. Compared with the shallower ResNet model, ResNet50 has a deeper network structure and can extract more advanced feature information.

[0091] In image classification, the ResNet50 network performs well in feature extraction, so it is selected to extract features of the two images. Its effectiveness includes: (1) Compared with shallow network models, ResNet50 has a deeper network structure and can learn richer and more abstract feature representations. Deep networks help capture higher-level semantic information and improve the ability of image understanding and feature representation; (2) ResNet50 adopts a shared weight structure, sharing parameters between multiple convolutional layers in the network, reducing the number of network parameters. This shared weight mechanism can improve the reusability of features, reduce the computational and storage overhead of the model, and effectively prevent overfitting; (3) ResNet50 introduces residual connections, which directly transmit the original input information through cross-layer connections. This residual connection mechanism makes the network easier to train, can better solve the problems of gradient disappearance and gradient explosion, accelerate the convergence of the model, and help reduce overfitting.

[0092] Step 2.3: After ResNet50 network processing, the extracted feature vector is regularized and L1 regularization is selected. L1 regularization is a technique used for regularization. It is used to penalize the sum of the absolute values ​​of the parameters in the model during model training. L1 regularization can force the model to learn a sparse weight distribution by adding a penalty term of the L1 norm to the loss function, thereby preventing overfitting and improving the generalization ability of the model. The L1 regularization formula is as follows:

[0093]

[0094] Where w is the feature vector extracted in step 2.2; w′ is the feature vector after L1 regularization; w i is each element in the eigenvector.

[0095] The functions of L1 regularization include: (1) generating a sparse weight matrix: L1 regularization can make the weights of some features become 0, thereby generating a sparse weight matrix. This helps in feature selection, retaining only the key features that are helpful for splicing and filtering out redundant features that do not contribute to splicing; (2) preventing overfitting: L1 regularization can limit the complexity of the model, prevent overfitting, and improve the generalization ability of the model.

[0096] Step 2.4: After regularization, the output is sent to the global correlation layer to calculate the similarity of the two images. The purpose of this step is to reduce the average corner error and improve the estimation accuracy of the homography matrix; the global correlation layer can evaluate the geometric transformation relationship between the two images by calculating the similarity of the two images, thereby improving the accuracy and quality of the stitching.

[0097]

[0098] Where x1 and x2 are features Figure 1 and Features Figure 2 Position; F A (x1) is a feature Figure 1 The one-dimensional feature vector at position x1 in F B (x2) is a feature Figure 2 The one-dimensional feature vector at position x2 in F; CV(x1,x2) is A (x1) and F B The closer the similarity of (x2) is to 1, the higher the similarity between the two, which means the better the feature match between the two.

[0099] Step 2.5: The global correlation layer is followed by a convolutional layer and a fully connected layer, which outputs 8 parameters f, which are image I Input2 Relative to I Input1 The horizontal and vertical offsets of the four vertices;

[0100] Step 2.6: Use direct linear transformation DLT to estimate the image I based on the 8 parameters in the previous step. Input2 Change to I Input1 The homography matrix H of .

[0101] In the above description, step 2.5 obtains 8 parameters f, corresponding to image I Input2 Relative to I Input1The horizontal and vertical offsets of the four vertices, that is, the four pairs of parameters include four pairs of feature points: (Δx1, Δy1), (Δx2, Δy2), (Δx3, Δy3), (Δx4, Δy4)).

[0102] Direct linear transformation DLT solves the homography matrix process:

[0103] In the field of image stitching, the features of the two images to be stitched are matched, and the point sets of the two images are recorded as X and Y respectively. The homography transformation can be used to fit the relationship between the two. The expression is as follows:

[0104]

[0105] Among them, (u, v, 1) T is the image to be stitched I Input2 The coordinates of the point set Y; (x, y, 1) T is the image to be stitched I Input1 The coordinates of the point set X; H is the homography matrix, which represents the transformation relationship between the two images.

[0106] The purpose is to find the homography matrix H. In step 2.5, four pairs of feature points (the coordinate offsets of the four vertices of the two images to be stitched) are found, that is, the four vertices of the two images to be stitched meet the following conditions:

[0107]

[0108] Among them, (u, v) and (x, y) are the coordinate points of the images to be stitched.

[0109] The homography matrix H is a 3*3 matrix with 8 degrees of freedom, as shown below:

[0110]

[0111] The derivation process of the DLT algorithm is as follows: combine (1) with (3), then expand (1), divide the first two rows by the third row, and get:

[0112]

[0113] Formula (4) can be rearranged as:

[0114] A i h=0 (5)

[0115] in,

[0116]

[0117] The four pairs of parameters obtained in step 2.5 can be used to solve h, and then the homography matrix H can be solved.

[0118] Step 2.7: Use the homography matrix H obtained in step 2.7 to transform image I Input2 and image I Input1 Perform preliminary image stitching to obtain a preliminary stitched image. The specific steps include:

[0119] Step 3, such as Figure 3 As shown in FIG. 1 , the specific process of preliminary stitching of the images to be stitched is shown, and the process includes:

[0120] Step 3.1: For the two input images I Input2 and image I Input1 Generate two grids. Each element in the grid represents its two-dimensional spatial position, and each element in the grid represents its two-dimensional spatial position (u i , v i ), (i=1, 2):

[0121]

[0122] Where: H represents from I Input2 To I Input1 The projection transformation of ; (x, y, z) are the homogeneous coordinates of the original image.

[0123] By the above formula, we can obtain W Input2 The corresponding coordinates of , and W is obtained by replacing H with the identity matrix E Input1 The coordinates of .

[0124] Step 3.2: Obtain a smooth transformed image W through STL transformation Input1 and W Input2 ,like Figure 3 As shown;

[0125] Step 3.3: The image W obtained in step 3.2 Input1 and W Input2 Perform preliminary stitching to obtain a preliminary stitching image, such as Figure 3 As shown;

[0126] The initial stitching step includes: Input1 and W Input2 Perform average fusion stitching. Specifically, the pixel value of the overlapping area is equal to I AW and I BW The sum of the pixel values, weighted by 0.5.

[0127] Step 3.4: Obtain a mask of corresponding size from the preliminary spliced ​​image.

[0128] Step 4: Input the preliminary stitched image Stitchedimage and mask Mask obtained in step 3 to generate an optimized stitched image.

[0129] Step 4.1: The preliminary stitched image Stitchedimage obtained in step 3 is fused with the mask Mask, and then input into the feature extraction module;

[0130] Step 4.2: When performing feature extraction, simple convolutional pooling blocks are stacked to extract high-level semantic features from the input. Formally, 8 convolutional layers are used, and the number of filters is set to 64, 64, 64, 64, 128, 128, 128, and 128 respectively. The maximum pooling layer is used after the 2nd, 4th, and 6th convolutional layers, and after extraction, it is input into the residual progressive regression network module.

[0131] Step 4.3: In the residual progressive regression network module, an adaptive pooling layer is used to fix the resolution of the feature map. A fully convolutional structure is designed as a regression network to predict the horizontal and vertical motion of each vertex based on a regular grid. Assuming the grid resolution is U×V, the output size is (U+1)×(V+1)×2.

[0132] Step 4.4: The output size of the grid is (U+1)×(V+1)×2, which is input into the grid motion prediction module. The shape is repaired according to the extracted features to obtain a preliminary optimized image, which is a concave rectangular stitching result. The image to be stitched is as follows: Figure 7 As shown, the preliminary stitching image (to be optimized) is as follows Fig.10 As shown; the initial optimized image is as follows Fig.11 shown.

[0133] Step 4.5: Input the preliminary optimized image obtained in step 4.4 into the residual progressive regression network module. At the same time, the image to be spliced ​​I Input2 and image I Input1 The feature extraction module with weight sharing in step 4.2 is used to extract features, obtain the required local information, and further optimize the spliced ​​image with concave. Figure 4 As shown, this step inputs the original image to be stitched I Input2 and image I Input1 , by extracting features from the two, the feature information of the area to be spliced ​​is obtained as an input for subsequent optimization.

[0134] Step 4.6: The result obtained in step 4.5 is input into the grid motion prediction module to obtain a complete rectangular stitching result. Figure 4 The final optimized image is generated as Fig.12As shown in the figure, the initially optimized image and the local feature information of the two original input images to be stitched (extracted by the eight simple convolutional layers mentioned in step 4.2) are taken as input together and then input into the model to obtain the final optimized stitched image.

Claims

1. Image stitching method based on deep learning to optimize stitching quality, Features include: Homography matrix estimation stage: S1.1: Extract feature information containing semantic information of the image to be spliced ​​based on the ResNet50 network; S1.2: Calculate the similarity of the two images to be stitched through the global correlation layer; S1.3: Obtain the offset of the image vertices through the convolution layer and the fully connected layer; S1.4: Estimate the homography matrix H by the DLT algorithm; Initial splicing stage: Using the STL transformation network, a smoothly changing image is obtained according to the homography matrix H obtained in the homography matrix estimation stage; the images to be spliced ​​are generated into a preliminary spliced ​​image by using average fusion; Image quality optimization stage: The preliminary spliced ​​image and its corresponding mask Mask are used to predict its complete boundary, thereby generating a high-quality image with a complete boundary.

2. The image stitching method based on deep learning to optimize stitching quality according to claim 1, Features: In S1.2, the global correlation layer can evaluate the geometric transformation relationship between the two images by calculating the similarity between them, thereby improving the accuracy and quality of stitching; Where: x 1 ,x 2 Respectively represent the positions of feature map 1 and feature map 2; F A (x1) represents the one-dimensional feature vector at position x1 in feature map 1; F B (x2) represents the one-dimensional feature vector at position x2 in feature map 2; Z represents the integer domain. The formula CV(x 1 ,x 2 ) represents the cosine similarity, which is usually used to measure the similarity between two things. 1 ,x 2 ∈Z 2 For x 1 and x 2 are two elements in the set of squared integers, thus obtaining an ordered pair of integers (x 1 ,F A (x 1 )) and (x2,F B (x 2 )); CV(x 1 ,x 2 ) indicates F A (x1) and F B The closer the similarity of (x2) is to 1, the higher the similarity between the two, which means the better the feature match between the two.

3. The image stitching method based on deep learning to optimize stitching quality according to claim 1, Features: The preliminary splicing stage specifically includes the following steps: b3.1: two input images I Input2 and image I Input1 Generate two grids, each element in the grid represents its two-dimensional spatial position (u i , v i ), i=1,2: Where: H represents from I Input2 To I Input1 Projection transformation; (x, y, z) are the homogeneous coordinates of the original image; (x, y, z) are the homogeneous coordinates of the original image, x represents the position of the point on the x-axis, that is, the coordinate value in the horizontal direction; y represents the position of the point on the y-axis, that is, the coordinate value in the vertical direction; z represents the position of the point on the z-axis, that is, the coordinate value along the third axis perpendicular to the x and y axes; the subscripts 1 and 2 of x, y, and z represent the two input images respectively: Image I Input1 、Image I Input2 ; By the above formula, we can obtain W Input2 The corresponding coordinates of , and W is obtained by replacing H with the identity matrix E Input1 The coordinates of b3.2: Obtain a smooth transformed image W through STL transformation Input1 and W Input2 ; b3.3: The image W obtained in step b3.2 Input1 and W Input2 Perform preliminary stitching to obtain a preliminary stitching image; The initial stitching step includes: Input1 and W Input2 Perform average fusion stitching. Specifically, the pixel value of the overlapping area is equal to I AW and I BW The sum of the pixel values, weighted by 0.5; where: I AW and I BW Respectively represent the output image: W Input1 , W Input2 The pixel values ​​corresponding to the overlapping areas; b3.4: Obtain a mask of corresponding size from the preliminary spliced ​​image.

4. The image stitching method based on deep learning to optimize stitching quality according to claim 1, Features: The image quality optimization stage includes inputting the obtained preliminary stitched image and mask Mask to generate an optimized stitched image, which specifically includes the following steps: c3.1: The obtained preliminary spliced ​​image is fused with the mask Mask and then input into the feature extraction module; c3.2: When performing feature extraction, the feature extraction module extracts high-level semantic features from the input by stacking simple convolutional pooling blocks. In form, 8 convolutional layers are used, and the number of filters is set to 64, 64, 64, 64, 128, 128, 128, and 128 respectively; the maximum pooling layer is used after the 2nd, 4th, and 6th convolutional layers, and after extraction, it is input into the residual progressive regression network module; In the residual progressive regression network module, an adaptive pooling layer is used to fix the resolution of the feature map, and a fully convolutional structure is designed as a regression network to predict the horizontal and vertical motion of each vertex based on a regular grid; Assuming the grid resolution is U×V, the output size is (U+1)×(V+1)×2; c3.4: The output size of the grid is (U+1)×(V+1)×2, which is input into the grid motion prediction module. The shape is repaired according to the extracted features to obtain a preliminary optimized image, which is a concave rectangular stitching result; c3.5: Input the initial optimized image obtained in c3.4 into the residual progressive regression network module. At the same time, the image to be spliced ​​I Input2 and image I Input1 Extract features through the feature extraction module with weight sharing in step c3.2 to obtain the required local information and further optimize the spliced ​​image with concavity; c3.6: The result obtained in step c3.5 is input into the grid motion prediction module to obtain a complete rectangular stitching result.

5. Image stitching system based on deep learning to optimize stitching quality, It is characterized in that The system includes: A grayscale processing module, used for grayscale processing of the image to be spliced; The feature extraction module introduces the ResNet50 network, which is a deep network that can capture higher-level semantic information and extract richer feature information of the images to be spliced. The regularization module uses L1 Normalization to regularize the extracted information and improve the effect of feature selection; The global correlation module calculates the global similarity of features between the two images to be stitched. The higher the similarity, the better the feature matching. The convolutional fully connected module, which consists of convolutional layers and fully connected layers, is used to predict the offset as the input of DLT; The direct linear transformation (DLT) module takes the predicted offset as input and calculates the homography matrix H; The spatial transformation module introduces an STL transformation network, adjusts the optimal parameters according to the input, inputs the image to be stitched, as well as the homography matrix H and the unit matrix E, deforms the input image, and finally obtains a smooth transformation image through interpolation; Average fusion module, input the processed image to be stitched, according to the pixel points of the feature area, the pixel value of the overlapping area is equal to the sum of the pixel values ​​of the two images, and the weight value is 0.5; The fusion module performs simple channel superposition on the preliminary spliced ​​image result and the corresponding mask, and then inputs them into the feature extraction module; The residual progressive regression network module is used to predict the length and width of the input image data; The grid motion prediction module predicts the length and width of the input image data, and then predicts the complete content of the stitched image, and optimizes the stitching result into a rectangle.

Citation Information

Cited By

  • Cornea laser confocal microscope-oriented multi-image automatic rapid splicing method

    CN119887518A

  • A multi-image automatic and rapid stitching method for corneal laser confocal microscopy

    CN119887518B

  • Transition switching method of image

    CN121585778A