A scanning image splicing method and device, computer equipment and storage medium
By combining feature extraction and regression modules, the problem of poor stitching effect in scanned image stitching is solved, and stitching quality is improved while simplifying the process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EEASY TECH CO LTD
- Filing Date
- 2023-04-23
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies cannot effectively solve the problem of poor stitching results caused by similar text structures, complex backgrounds and noise interference in scanned image stitching, and traditional methods are computationally cumbersome and difficult to improve stitching speed.
The feature extraction module extracts features from the images acquired by the scanning device, and the regression module regresses the image offset and predicted score. Image stitching is performed only when the score is greater than a threshold, which simplifies the calculation process and improves the stitching effect.
It simplifies the process of stitching scanned images and improves the stitching effect, especially the quality of stitching images with text and complex backgrounds.
Smart Images

Figure CN116721423B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, and in particular relates to a method, apparatus, computer equipment and storage medium for stitching scanned images. Background Technology
[0002] Rapid text image stitching refers to stitching multiple text images together in a short time to create a complete image without any omissions or redundancies, providing effective input data for subsequent text recognition. The rapid text image stitching method can be widely used in camera stitching, text scanning, and other fields.
[0003] Existing image stitching methods used in scanning pens employ traditional methods. Two relatively mature and fast approaches exist: one is based on feature corner points and descriptors to stitch two images, primarily involving feature point extraction, descriptor calculation, and feature point matching; the other is based on block-region stitching, which mainly involves calculating the similarity between blocks. However, for text images, firstly, due to the many structural similarities between characters, and secondly, real-world application scenarios involving complex backgrounds, noise interference, and motion blur, local feature point matching or local block stitching can easily lead to poor stitching results. Furthermore, traditional image stitching methods are computationally cumbersome, making it difficult to improve stitching speed. Summary of the Invention
[0004] The purpose of this invention is to provide a scanning image stitching method, apparatus, computer device, and storage medium, aiming to solve the problem that the existing technology cannot provide an effective scanning image stitching method, resulting in poor scanning image stitching effect.
[0005] On one hand, the present invention provides a method for stitching scanned images, the method comprising the following steps:
[0006] The feature extraction module extracts features from the first and second images acquired sequentially by the scanning device to obtain the offset information between the first and second images.
[0007] Based on the offset information between the first image and the second image, the image offset between the first image and the second image and the prediction score of the image offset are regressed by the regression module;
[0008] When the predicted score is greater than a preset threshold, the second image is stitched to the stitched image including the first image according to the image offset.
[0009] On the other hand, the present invention provides a scanned image stitching device, the device comprising:
[0010] The feature extraction unit is used to extract features from the first image and the second image acquired sequentially by the scanning device through the feature extraction module, so as to obtain the offset information between the first image and the second image.
[0011] An offset prediction unit is used to regress the image offset between the first image and the second image and a prediction score for the image offset based on the offset information between the first image and the second image via a regression module; and
[0012] An image stitching unit is used to stitch the second image into an already stitched image including the first image according to the image offset when the prediction score is greater than a preset threshold.
[0013] On the other hand, the present invention also provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.
[0014] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0015] This invention extracts features from a first image and a second image sequentially acquired by a scanning device using a feature extraction module to obtain offset information between the first and second images. Based on this offset information, a regression module regresses the image offset and the prediction score of the image offset between the first and second images. When the prediction score is greater than a preset threshold, the second image is stitched into the stitched image including the first image according to the image offset. This simplifies the image stitching process and improves the stitching effect of the scanned images. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the implementation of the scanned image stitching method provided in Embodiment 1 of the present invention;
[0017] Figure 2a This is a schematic diagram of the feature extraction module in the scanned image stitching method provided in Embodiment 2 of the present invention;
[0018] Figure 2b This is a schematic diagram of the structure of the first convolutional block in the scanning image stitching method provided in Embodiment 2 of the present invention;
[0019] Figure 2c This is a schematic diagram of the structure of the first grouped convolutional block in the scanning image stitching method provided in Embodiment 2 of the present invention;
[0020] Figure 2dThis is a schematic diagram of the channel attention module in the scanning image stitching method provided in Embodiment 2 of the present invention;
[0021] Figure 3 This is a flowchart of the training process for the feature extraction module and the regression module in the scanned image stitching method provided in Embodiment 4 of the present invention;
[0022] Figure 4 This is a schematic diagram of the structure of the scanning image stitching device provided in Embodiment 5 of the present invention; and
[0023] Figure 5 This is a schematic diagram of the structure of the computer device provided in Embodiment Six of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0025] The specific implementation of the present invention will be described in detail below with reference to specific embodiments:
[0026] Example 1:
[0027] Figure 1 The implementation flow of the scanned image stitching method provided in Embodiment 1 of the present invention is illustrated. For ease of explanation, only the parts related to the embodiments of the present invention are shown, and are described in detail below:
[0028] In step S101, the feature extraction module extracts features from the first image and the second image acquired sequentially by the scanning device to obtain the offset information between the first image and the second image;
[0029] This invention is applicable to computer devices for image stitching, such as scanning devices and computers. Specifically, the scanning device can be a scanning pen to stitch together images scanned by the pen. The first image and the second image are two adjacent images acquired or scanned sequentially by the scanning device. The feature extraction module can be a pre-trained convolutional neural network with feature extraction capabilities to extract features from the first image and the second image, obtaining offset information or offset features between the first image and the second image. This offset information describes the relative offset between the first image and the second image.
[0030] In step S102, based on the offset information between the first image and the second image, the image offset and the predicted score of the image offset between the first image and the second image are regressed by the regression module.
[0031] In this embodiment of the invention, considering that the scanning device acquires images of consecutive frames with only a small distance change, the first image and the second image are considered to have only undergone vertical and horizontal translation transformations. Here, based on the offset information between the first image and the second image, a regression module is used to regress the image offset and the prediction score of the image offset between the first image and the second image. The image offset describes the offset of the second image relative to the first image, and the prediction score of the image offset describes the accuracy of the predicted offset. The regression module can be a pre-trained convolutional neural network to obtain the image offset and the prediction score of the image offset between the first image and the second image.
[0032] In a preferred embodiment, when regressing the image offset and the predicted score of the image offset between the first image and the second image through the regression module, based on the offset information between the first image and the second image, the regression module regresses the angular offset and the predicted score of the four corners between the first image and the second image. The average value of the angular offset of the four corners is set as the image offset, and the average value of the predicted score of the four corners is set as the predicted score of the image offset. This avoids using the homography matrix and transmission transformation to calculate the image offset, reduces the computational load when obtaining the image offset, and also ensures the accuracy of the predicted offset.
[0033] In step S103, when the prediction score is greater than a preset threshold, the second image is stitched to the stitched image including the first image according to the image offset.
[0034] In this embodiment of the invention, if the predicted score of the image offset is greater than a preset threshold, it indicates that the predicted offset is highly accurate. In this case, the second image is stitched to the stitched image including the first image according to the image offset, resulting in a new stitched image. Here, the received image refers to the already stitched image, for example, the image obtained by stitching the first image and the image preceding the first image.
[0035] If the predicted score of the image offset is not greater than a preset threshold, it indicates that the predicted offset deviation is large, and the second image should not be stitched onto the already stitched image. In this case, in a preferred embodiment, the second image is set as a new stitched image, and the process jumps to the step of extracting features from the first and second images sequentially acquired by the scanning device through the feature extraction module, so as to continue stitching the scanned images. That is, the second image is no longer stitched onto the previously stored stitched image, but is stored as a new stitched image. Then, the second image and its adjacent next image are set as the first and second images, and the second image and its adjacent next image are stitched together through steps S101 to S103. This process is repeated until the stitching of the scanned images is completed.
[0036] In this embodiment of the invention, a feature extraction module extracts features from a first image and a second image sequentially acquired by a scanning device to obtain offset information between the first image and the second image. Based on the offset information between the first image and the second image, a regression module regresses the image offset and the prediction score of the image offset between the first image and the second image. When the prediction score is greater than a preset threshold, the second image is stitched into the stitched image including the first image according to the image offset. This simplifies the scanning image stitching process and improves the stitching effect of the scanning image.
[0037] Example 2:
[0038] Figure 2a The structure of the feature extraction module in the scanned image stitching method provided in Embodiment 2 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, and are described in detail below:
[0039] In this embodiment of the invention, the feature extraction module includes a first convolutional block 211, a second convolutional block 212, a third convolutional block 213, a fourth convolutional block 214, a first grouped convolutional block 221, a second grouped convolutional block 222, a third grouped convolutional block 223, a fourth grouped convolutional block 224, and a channel attention module 231. The input to the first convolutional block 211 is a first image, and the input to the second convolutional block 212 is a second image. The outputs of the first and second convolutional blocks are concatenated (channel concatenated) and then used as the input to the third convolutional block 213. The third convolutional block 213... The output serves as the input to the fourth convolutional block 214. The output of the fourth convolutional block 214 is the input to the first group convolutional block 221. The output of the first group convolutional block 221 is the input to the channel attention module 231. The cross product of the outputs of the first group convolutional block 221 and the channel attention module 231 is used as the input to the second group convolutional block 222. The output of the second group convolutional block 222 is the input to the third group convolutional block 223. The output of the third group convolutional block 223 is the input to the fourth group convolutional block 224. The output of the fourth group convolutional block 224 is the offset information. This feature extraction module can accurately obtain the offset information between the first and second images.
[0040] In one specific embodiment, the first, second, third, and fourth convolutional blocks each include a first convolutional layer, a first batch of normalized layers, and a first linear rectified function layer. The output of the first convolutional layer is the input of the first batch of normalized layers, and the output of the first batch of normalized layers is the input of the first linear rectified function layer. As an example, Figure 2bThe structure of the first convolutional block is shown. The first convolutional block includes a first convolutional layer (Conv), a first batch normalization layer (BN), and a first linear rectified function layer (ReLU). The convolutional kernel size of the first convolutional layer is 3*3, the number of output channels is 32, the stride is 1, and the padding value is equal to 1.
[0041] In one specific embodiment, the first, second, third, and fourth grouped convolutional blocks each include a grouped convolutional layer, a second batch normalization layer, a second linear rectified function layer, a fifth convolutional block, and a sixth convolutional block. The output of the grouped convolutional layer is the input of the second batch normalization layer, the output of the second batch normalization layer is the input of the second linear rectified function layer, the output of the second linear rectified function layer is the input of the fifth convolutional block, and the output of the fifth convolutional block is the input of the sixth convolutional block. As an example, Figure 2c The structure of the first grouped convolutional block is shown. The first grouped convolutional block includes a grouped convolutional layer (DConv), a second batch normalization layer (BN), a second linear rectified function layer (ReLU), a fifth convolutional block, and a sixth convolutional block. The grouped convolutional layer is a grouped convolution with a kernel size of 3*3, 96 output channels, a stride of 1, a padding value of 1, and 96 groups. The structures of the fifth and sixth convolutional blocks can be referenced from the structures of the first, second, third, and fourth convolutional blocks.
[0042] In one specific embodiment, such as Figure 2d As shown, the channel attention module includes a global average pooling layer, a global max pooling layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a third linear rectified function layer, a fourth linear rectified function layer, a fifth linear rectified function layer, a sixth linear rectified function layer, a first activation function layer, and a second activation function layer. The output of the global average pooling layer is the input of the second convolutional layer, the output of the second convolutional layer is the input of the third linear rectified function layer, the output of the third linear rectified function layer is the input of the fourth linear rectified function layer, the output of the fourth linear rectified function layer is the input of the first activation function layer, the output of the global max pooling layer is the input of the fourth convolutional layer, the output of the fourth convolutional layer is the input of the fifth linear rectified function layer, the output of the fifth linear rectified function layer is the input of the sixth linear rectified function layer, and the output of the sixth linear rectified function layer is the input of the second activation function layer. The output of the first activation function layer and the output of the second activation function layer are added together to obtain the output of the channel attention module.
[0043] Example 3:
[0044] In the scanned image stitching method provided in this embodiment of the invention, the regression module is a regression layer, specifically a convolutional layer. As an example, this convolutional layer is a 1*1 convolutional layer with 3 channels, 0 padding, and a stride of 1. After passing through this layer, the resulting data is 2*2*3. Thus, the first two 2*2*2 layers are used as the model's regression prediction of the image offset between the first and second images, and the last 2*2*1 layer is used as the regression prediction score for the offset of the four points (corners). This effectively reduces the computational load when obtaining the image offset while ensuring the accuracy of the predicted offset.
[0045] Example 4:
[0046] Figure 3 The training flow of the feature extraction module and the regression module in the scanned image stitching method provided in Embodiment 4 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, and are described in detail below:
[0047] In step S301, each original image in the image set acquired by the scanning device is subjected to transmission transformation to obtain the corresponding transformed image, thus obtaining an initial training set including the original image and the transformed image pair;
[0048] In this embodiment of the invention, the feature extraction module and the regression module form an offset information extraction network to obtain offset information between two input images. This offset information extraction network is a convolutional neural network. The specific structures of the feature extraction module and the regression module can be found in the descriptions of embodiments two and three, and will not be repeated here. When obtaining the initial training set for training the offset information extraction network, original text images can be acquired using a scanning device. Then, each original image in the image set acquired by the scanning device undergoes a transmission transformation to obtain a corresponding transformed image (this transformed image can be considered the next frame image of the original image), resulting in an initial training set including pairs of original images and transformed images.
[0049] In step S302, data augmentation is performed on any image in the original image and the transformed image pair to augment the initial training set and obtain the augmented training set.
[0050] In this embodiment of the invention, in order to increase the diversity of transformations, data augmentation is performed on any image in the original image and the transformed image pair. For example, backgrounds or text deformations can be added to any image in the image pair to expand and augment the initial training set, thereby obtaining an augmented training set.
[0051] In step S303, the offset information extraction network composed of the feature extraction module and the regression module is initially trained using the augmented training set to obtain the initially trained offset information extraction network.
[0052] In this embodiment of the invention, an augmented training set is used to initially train the offset information extraction network, which consists of a feature extraction module and a regression module, to obtain a pre-trained offset information extraction network. During training, the loss function is L = λ1L1smooth + λ2L s ,in, L s =-(label*ln(sigmoid(x)+(1-label)*ln(1-sigmoid(x)))), x represents the difference between the predicted offset coordinates of the four corners of the image and the actual offset coordinates, which can effectively improve the training efficiency of the offset information extraction network.
[0053] In step S304, based on the pre-trained offset information extraction network, the image pairs in the augmented training set are stitched together to obtain the stitched long text image.
[0054] In this embodiment of the invention, the feature extraction module of the image pair input offset information extraction network in the augmented training set extracts features from the first and second images in the image pair to obtain the offset information between the first and second images. Based on the offset information between the first and second images, the image offset and the prediction score of the image offset between the first and second images are regressed by the regression module. When the prediction score is greater than a preset threshold, the second image is stitched to the first image according to the image offset to obtain the stitched long text image. This process is repeated until the long text images corresponding to all image pairs in the augmented training set are obtained.
[0055] In step S305, all long text images are cropped to obtain image pairs and a secondary training dataset with overlapping regions for secondary training.
[0056] In this embodiment of the invention, two images are randomly extracted from each long text image to obtain corresponding image pairs. There is an overlapping area between the two images. After cropping all long text images, a secondary training dataset for secondary training can be obtained. Of course, the secondary training dataset can also be augmented to broaden and expand it.
[0057] In step S306, the initially trained offset information extraction network is trained again using the secondary training dataset to obtain the trained offset information extraction network.
[0058] In this embodiment of the invention, the initially trained offset information extraction network is retrained using a secondary training dataset to obtain a trained offset information extraction network. The feature extraction module within this trained offset information extraction network can extract features from two input images, accurately obtaining the offset information between them. The regression module within the trained offset information extraction network regresses the image offset and its predicted score, avoiding the use of homography matrix and transmission transformation to calculate the image offset, thus reducing the computational load when obtaining the image offset while ensuring the accuracy of the predicted offset.
[0059] Example 5:
[0060] Figure 4 The structure of the scanning image stitching device provided in Embodiment 5 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, including:
[0061] Feature extraction unit 41 is used to extract features from the first image and the second image acquired sequentially by the scanning device through the feature extraction module, so as to obtain the offset information between the first image and the second image;
[0062] Offset prediction unit 42 is used to regress the image offset and the image offset prediction score between the first image and the second image based on the offset information between the first image and the second image through a regression module; and
[0063] The image stitching unit 43 is used to stitch the second image into the stitched image including the first image according to the image offset when the prediction score is greater than a preset threshold.
[0064] In this embodiment of the invention, each unit of the scanning image stitching device can be implemented by a corresponding hardware or software unit. Each unit can be an independent hardware or software unit, or it can be integrated into a single hardware or software unit, which is not intended to limit the invention. Specific implementation methods for each unit can be found in the description of the foregoing embodiments, and will not be repeated here.
[0065] Example 6:
[0066] Figure 5 The structure of a computer device provided in Embodiment Six of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown.
[0067] The computer device 5 of this embodiment includes a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50. When the processor 50 executes the computer program 52, it implements the steps in the various scanning image stitching method embodiments described above, for example... Figure 1The steps S101 to S103 are shown. Alternatively, when the processor 50 executes the computer program 52, it implements the functions of each unit in the above-described device embodiment, for example... Figure 4 The functions of units 41 to 43 are shown.
[0068] In this embodiment of the invention, the feature extraction module extracts features from the first image and the second image acquired sequentially by the scanning device to obtain the offset information between the first image and the second image. Based on the offset information between the first image and the second image, the image offset and the prediction score of the image offset between the first image and the second image are regressed by the regression module. When the prediction score is greater than a preset threshold, the second image is stitched into the stitched image including the first image according to the image offset. This simplifies the stitching process of the scanned image and improves the stitching effect of the scanned image.
[0069] The computer device in this embodiment of the invention can be a scanning pen, etc. When the processor 50 of the computer device 5 executes the computer program 52 to implement the scanning image stitching method, the steps implemented can be referred to the description of the foregoing method embodiment, and will not be repeated here.
[0070] Example 7:
[0071] In this embodiment of the invention, a computer-readable storage medium is provided, which stores a computer program. When executed by a processor, the computer program implements the steps in the above-described embodiments of the scanned image stitching method, for example... Figure 1 Steps S101 to S103 are shown. Alternatively, when the computer program is executed by a processor, it implements the functions of each unit in the above-described device embodiment, for example... Figure 4 The functions of units 41 to 43 are shown.
[0072] In this embodiment of the invention, a feature extraction module extracts features from a first image and a second image sequentially acquired by a scanning device to obtain offset information between the first image and the second image. Based on the offset information between the first image and the second image, a regression module regresses the image offset and the prediction score of the image offset between the first image and the second image. When the prediction score is greater than a preset threshold, the second image is stitched into the stitched image including the first image according to the image offset. This simplifies the stitching process of the scanned image and improves the stitching effect of the scanned image.
[0073] The computer-readable storage medium in embodiments of the present invention may include any entity or device capable of carrying computer program code, a recording medium, such as ROM / RAM, disk, optical disk, flash memory, etc.
[0074] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method of scanning image stitching, characterized by, The method includes the following steps: The feature extraction module extracts features from the first and second images acquired sequentially by the scanning device to obtain the offset information between the first and second images. Based on the offset information between the first image and the second image, the image offset between the first image and the second image and the prediction score of the image offset are regressed by the regression module; When the predicted score is greater than a preset threshold, the second image is stitched to the stitched image including the first image according to the image offset; The feature extraction module includes first, second, third, and fourth convolutional blocks, first, second, third, and fourth grouped convolutional blocks, and a channel attention module. The input of the first convolutional block is the first image, the input of the second convolutional block is the second image, the outputs of the first and second convolutional blocks are concatenated into channels and then used as the input of the third convolutional block, the output of the third convolutional block is used as the input of the fourth convolutional block, the output of the fourth convolutional block is used as the input of the first grouped convolutional block, the output of the first grouped convolutional block is used as the input of the channel attention module, the outputs of the first grouped convolutional block and the output of the channel attention module are cross-multiplied and then used as the input of the second grouped convolutional block, the output of the second grouped convolutional block is used as the input of the third grouped convolutional block, the output of the third grouped convolutional block is used as the input of the fourth grouped convolutional block, and the output of the fourth grouped convolutional block is the offset information. The regression module is 1. A convolutional layer with 1 channel, 3 channels, 0 padding, and 1 stride outputs 2. 2 Data 3, the first two layers of the channel 2 2 2. As a regression prediction of the image offset between the first and second images, the last layer 2 2 1 is used as the regression prediction score for the four corner offsets.
2. The method of claim 1, wherein, The first, second, third, and fourth convolutional blocks each include a first convolutional layer, a first batch of normalized layers, and a first linear rectified function layer. The output of the first convolutional layer is the input of the first batch of normalized layers, and the output of the first batch of normalized layers is the input of the first linear rectified function layer.
3. The method of claim 1, wherein, The first, second, third, and fourth grouped convolutional blocks each include a grouped convolutional layer, a second batch normalization layer, a second linear rectified function layer, a fifth convolutional block, and a sixth convolutional block. The output of the grouped convolutional layer is the input of the second batch normalization layer, the output of the second batch normalization layer is the input of the second linear rectified function layer, the output of the second linear rectified function layer is the input of the fifth convolutional block, and the output of the fifth convolutional block is the input of the sixth convolutional block.
4. The method of claim 1, wherein, The channel attention module includes a global average pooling layer, a global max pooling layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a third linear rectified function layer, a fourth linear rectified function layer, a fifth linear rectified function layer, a sixth linear rectified function layer, a first activation function layer, and a second activation function layer. The output of the global average pooling layer is the input of the second convolutional layer, the output of the second convolutional layer is the input of the third linear rectified function layer, the output of the third linear rectified function layer is the input of the third convolutional layer, and the output of the third convolutional layer is the input of the fourth linear rectified function layer. The inputs are as follows: the output of the fourth linear rectified function layer is the input of the first activation function layer; the output of the global max pooling layer is the input of the fourth convolutional layer; the output of the fourth convolutional layer is the input of the fifth linear rectified function layer; the output of the fifth linear rectified function layer is the input of the fifth convolutional layer; the output of the fifth convolutional layer is the input of the sixth linear rectified function layer; the output of the sixth linear rectified function layer is the input of the second activation function layer; and the outputs of the first activation function layer and the second activation function layer are added together to form the output of the channel attention module.
5. The method of claim 1, wherein, Based on the offset information between the first image and the second image, the step of regressing the image offset between the first image and the second image and the prediction score of the image offset using a regression module includes: Based on the offset information between the first image and the second image, the angular offset and angular offset prediction score of the four corners between the first image and the second image are regressed by the regression module. The average of the angular offsets of the four corners is set as the image offset, and the average of the angular offset prediction scores of the four corners is set as the prediction score of the image offset.
6. The method of claim 1, wherein, The method includes the following steps: When the predicted score is not greater than the preset threshold, the second image is set as the stitched image, and the process jumps to the step of extracting features from the first and second images sequentially acquired by the scanning device through the feature extraction module, so as to continue stitching the scanned images.
7. A scanning image stitching apparatus characterized by comprising: The device includes: The feature extraction unit is used to extract features from the first image and the second image acquired sequentially by the scanning device through the feature extraction module, so as to obtain the offset information between the first image and the second image. An offset prediction unit is used to regress the image offset between the first image and the second image and a prediction score for the image offset based on the offset information between the first image and the second image via a regression module; and An image stitching unit is used to stitch the second image into an already stitched image including the first image according to the image offset when the prediction score is greater than a preset threshold. The feature extraction module includes first, second, third, and fourth convolutional blocks, first, second, third, and fourth grouped convolutional blocks, and a channel attention module. The input of the first convolutional block is the first image, the input of the second convolutional block is the second image, the outputs of the first and second convolutional blocks are concatenated into channels and then used as the input of the third convolutional block, the output of the third convolutional block is used as the input of the fourth convolutional block, the output of the fourth convolutional block is used as the input of the first grouped convolutional block, the output of the first grouped convolutional block is used as the input of the channel attention module, the outputs of the first grouped convolutional block and the output of the channel attention module are cross-multiplied and then used as the input of the second grouped convolutional block, the output of the second grouped convolutional block is used as the input of the third grouped convolutional block, the output of the third grouped convolutional block is used as the input of the fourth grouped convolutional block, and the output of the fourth grouped convolutional block is the offset information. The regression module is 1. A convolutional layer with 1 channel, 3 channels, 0 padding, and 1 stride outputs 2. 2 Data 3, the first two layers of the channel 2 2 2. As a regression prediction of the image offset between the first and second images, the last layer 2 2 1 is used as the regression prediction score for the four corner offsets.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.