Image stitching method and system for long screenshot
Patent Information
- Application Number
- CN202611158761.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-23
AI Technical Summary
[0006]本发明所要解决的技术问题是:如何基于场景自适应匹配不同分支的用于长截图的图像拼接方法,以解决重复纹理误匹配、段落细节定位不准、小重叠拼接不稳定以及无重叠样本强行拼接等问题
[0017]本发明取得的技术效果是:同时利用全局上下文与局部细节,对重复纹理和段落文本两类典型长截图场景以及混合场景进行自适应处理;使用多峰抑制训练结合唯一性感知加权的组合解决重复纹理场景难以找到准确特征点进行匹配的问题;通过置信度与峰值间隔共同筛选策略得到表征难以拼接的小重叠样本或无重叠样本的低置信度样本并拒绝拼接。本发明通过数据构建、样本优化、多分支特征融合、自适应匹配定位及专属训练策略,解决传统拼接技术在重复纹理、文本段落、细微偏差场景下的拼接失效、定位不准、泛化性差等问题,能够输出连续、完整、无明显重复或断裂的长截图。
Smart Images

Figure CN122966434A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an image processing technique, and more particularly to an image stitching technique for multiple single-page screenshots. Background Technology
[0002] On mobile devices, users often need to save content that exceeds the scope of a single screen—such as chat history, articles, spreadsheets, code pages, order lists, and application interfaces. This is typically achieved through long screenshots. Screenshots are also called screenshots or screen captures. Long screenshots, also known as scrolling screenshots, scroll captures, full-page screenshots, full-size screenshots, etc., involve manually or automatically scrolling down the screen, capturing multiple screen images in real time, and using a stitching algorithm to identify overlapping parts of the images, removing the overlaps, and aligning and stitching them together to obtain a single, continuous image in the vertical direction. Long screenshots overcome the limitation of traditional single-page screenshots, which can only save the content displayed on the current screen.
[0003] Traditional long screenshots typically rely on system-level scrolling events or fixed templates to crop the top and / or bottom obscuring bars (such as the top status bar or bottom navigation bar). When the screenshot source is complex, the scrolling distance between frames is unstable, there are top and / or bottom obscuring bars, or the page contains repeated lines or similar paragraphs, misalignment, duplicate content, missing content, or splicing breaks are likely to occur.
[0004] Traditional methods for stitching long screenshots typically employ keypoint-based feature matching, template matching or normalized cross-correlation-based methods, and optical flow or deep network-based registration methods. However, these methods have several limitations in long screenshot scenarios. First, long screenshots often consist of text, icons, list items, tables, and white backgrounds, resulting in sparse distribution of traditional corner points or local features, making it difficult to obtain stable geometric constraints. Second, in repetitive texture scenarios, adjacent list rows, similar filenames, similar number codes, repeated cards, or repeated paragraphs can generate multiple highly similar candidate positions, leading to multi-peaked template matching or correlation peaks and making it easy to select adjacent incorrect rows during stitching. Repetitive texture scenarios refer to screenshots where the content of lists, tables, charts, etc., is highly similar, differing only in numbers or local details. Third, in samples with small overlap or no overlap, without effective stitching confidence assessment, it's easy to forcibly output incorrect stitching positions. Fourth, paragraph text content requires high-resolution details to distinguish strokes, punctuation, and local text differences, while repetitive texture content requires a large global context, line-level positional relationships, and cross-scale semantic features to avoid misselection.
[0005] Long screenshots of paragraph text rely on local fine-grained features for image stitching, while long screenshots of repetitive textures rely on global contextual features. Therefore, there is an urgent need for an image stitching method for long screenshots that can automatically select local fine-grained features or global contextual features based on different screenshot scenarios, suppress multiple candidate matches in repetitive textures, reject invalid overlapping samples, and be adaptable to lightweight deployment on the edge. Summary of the Invention
[0006] The technical problem to be solved by this invention is: how to adaptively match different branches of the image stitching method for long screenshots based on the scene, so as to solve problems such as mismatch of repeated textures, inaccurate positioning of paragraph details, unstable stitching of small overlaps, and forced stitching of non-overlapping samples.
[0007] To address the aforementioned technical problems, this invention proposes an image stitching method for long screenshots, comprising the following steps: Step S1: Continuously acquire multiple single-screen screenshots of a browser or application on a mobile or desktop device. These screenshots are sequential and contain overlapping content between adjacent screenshots. Preprocess each screenshot. Step S2: Unify the size of all preprocessed screenshots by scaling or using image fill. Construct a screenshot sample pair from every two adjacent screenshots with the same size. Each screenshot sample pair is represented as (I... a I b Step S3: Input a screenshot sample pair into the image stitching model, which predicts and outputs the normalized vertical stitching offset dy. norm The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits Overlap confidence level conf ;dy norm Indicate I a To remove the bottom 1-dy norm Only the percentage area can be compared with I b The top is spliced together; P logits Represented as [P(0), P(1), ...]; where P(0) is the optimal candidate longitudinal splicing displacement, and P(1) is the second-best candidate longitudinal splicing displacement; overlap conf dy norm The confidence score. Step S4: According to the size uniformity method, dy norm Convert the vertical stitching offset dy of the screenshot sample pair before size unification. Step S5: Overlap conf Compared with the preset reliability threshold, P(0)-P(1) is also compared with the preset peak interval threshold; when overlap confWhen P(0) - P(1) ≥ the preset confidence threshold and P(0) - P(1) ≥ the preset peak interval threshold, both the splicing condition and the candidate position uniqueness condition are met, and the process proceeds to step S6; if either condition is not met, the current screenshot sample pair is not spliced. The order of steps S4 and S5 can be arbitrary or performed simultaneously. Step S6: Remove the overlapping back part of the existing spliced image according to dy, and splice the I in the current screenshot sample pair at the bottom of the cropped existing spliced image. b When stitching the Nth screenshot sample pair, the existing stitched image refers to the stitched result of the (N-1)th screenshot sample pair. Repeat steps S3-S6, continuously stitching the existing image with the I in the next screenshot sample pair. b Continue aligning and stitching until all screenshot samples are stitched together to generate a complete long screenshot.
[0008] Furthermore, in step S1, the preprocessing includes identifying and removing the top status bar, bottom navigation bar, vertical or horizontal scroll bar, and floating obscuring layer from each screenshot, retaining only the effective area of the page in each screenshot.
[0009] Furthermore, in step S5, when overlap conf When the confidence threshold is greater than or equal to the preset confidence threshold, it means that there are two graphs I. a with I b The conditions for splicing are met; when overlap conf <When the confidence threshold is preset, it means that there are two graphs I a with I b The splicing condition is not met; when P(0)-P(1)≥ the preset peak interval threshold, it means that the candidate position uniqueness condition is met; when P(0)-P(1)< the preset peak interval threshold, it means that the candidate position uniqueness condition is least met.
[0010] Furthermore, in step S6, boundary fusion is enabled, and the edges near overlapping edges are blended with linear weights.
[0011] Further, the image stitching model in step S3 adopts a scene-adaptive dual-branch network, which sequentially includes a shared encoder, a scene gating module, a global branch, a local branch, a fusion module, a coarse localization module, a fine localization module, and a sub-pixel fine-tuning module; wherein, the global branch and the local branch are two parallel branches without any order. The shared encoder is used to extract low-level shared features—basic edge, color, and texture features—from the input screenshot sample pairs. The scene gating module is used to simultaneously feed the low-level shared features of the input screenshot sample pairs into the global branch and the local branch, and autonomously infer and generate a gating weight g with a value range of [0,1] based on the feature statistics of the input screenshot sample pairs, as the global branch weight g and the local branch weight 1-g. The global branch is used to learn the large receptive field, cross-line relationship, and global position, and integrates multi-dimensional feature enhancement technology, channel attention, spatial attention, dynamic adaptive attention module, feature pyramid, and two-dimensional position encoding technology; the input of the global branch is the low-level shared features, and the output is the global feature F. g The local branch is used to learn high-resolution local textures and fine-grained text differences, fusing channel attention and spatial attention; the input of the local branch is the low-level shared features, and the output is the local feature F. l The fusion module is used to integrate global features F g With local features F l The fusion is performed to obtain the fusion feature F. fused The coarse localization module is used to determine the location based on the fusion feature F. fused The first module quickly and coarsely determines the stitching position of the input screenshot sample pairs globally, outputting a coarse localization result. The second module slowly and precisely narrows down the stitching position of the input screenshot sample pairs to the pixel level within a local area of the coarse localization result, outputting a fine localization result. The third module quickly and precisely narrows down the stitching position of the input screenshot sample pairs to the sub-pixel level within an extremely small area of the fine localization result, outputting a dy... norm P logits overlap conf .
[0012] Furthermore, when the original gating weight g output by the scene gating module is lower than the lower limit of the global branch weight, it is corrected to the gating weight after lower limit correction. ; The value range is [lower bound of global branch weight, 1], which is used as the global branch weight. and local branch weight 1- .
[0013] Furthermore, F fused = ·F g +(1- )·P(F l ); where · represents element-wise broadcast multiplication between a scalar and a feature tensor, + represents element-wise addition of two weighted feature matrices, and P() represents the channel projection function.
[0014] Further, the training method for the image stitching model in step S3 includes the following steps. Step S31: Obtain a long page or long screenshot, and evenly divide each long page or long screenshot into multiple single-page screenshots, with each two adjacent single-page screenshots partially overlapping; or continuously scroll the mobile device and take single-page screenshots, with each two adjacent single-page screenshots partially overlapping; each two adjacent single-page screenshots constitute a screenshot sample pair (I a I b Step S32: For each screenshot sample pair (I) a I b According to I a with I b The location in the original long page or long screenshot, or according to I a with I b Calculate I based on the relative position within the scrolling screenshot sequence. a with I b overlap height h The overlap ratio and the vertical splicing offset dy between the two are recorded as annotation information. This is based on each screenshot sample pair (I... a I b The page content is analyzed and automatically labeled with the scene category tag. label The system determines and automatically labels valid stitches based on the overlap ratio. label The input samples are categorized into three classes: paragraph text, repeating texture, and mixed scene; "valid" is used to mark whether there is a true overlapping area in the current screenshot sample pair. Step S33: For each screenshot sample pair (I... a I b I in ) a with I b Perform adaptive cropping. Step S34: Extract the cropped I using a foreground segmentation algorithm. a with I b The foreground area, or the cropped I element marked with an interface element mask. a with I b The foreground region; the foreground region refers to the region containing the core semantic information and that actually needs to be stitched together; for screenshot sample pairs of repeating texture classes (I a I b Background randomization is also performed. Step S35: Use cropped and labeled foreground region screenshot pairs (I a Ib The image stitching model is trained through candidate position distribution supervision, word-level diagonal matching supervision, multi-peak suppression supervision, and validity supervision, so that the stitching position dy output by the image stitching model is as close as possible to the labeled dy; the trained image stitching model can then be used for inference.
[0015] Furthermore, in step S35, during the training process, the encoder, fine localization module, and subpixel fine-tuning module in the global branch and local branch are first frozen, and then gradually unfrozen; sampling balance or hierarchical sampling is performed on minority class scenes; the following combination of loss functions is used during the training process: heatmap distribution loss constraint, strip word matching loss, peak isolation loss, uniqueness-aware weighted loss, and binary classification cross-entropy loss.
[0016] This invention also proposes an image stitching system for long screenshots, including a screenshot preprocessing module, a screenshot size unification module, a model inference module, a conversion module, a reliability judgment module, and a screenshot stitching module. The screenshot preprocessing module continuously acquires multiple single-screen screenshots of browsers or applications on mobile or desktop devices. These screenshots are sequential and contain overlapping content between adjacent screenshots, and each screenshot undergoes preprocessing. The screenshot size unification module unifies the size of all preprocessed screenshots through scaling or texture filling, and constructs a screenshot sample pair from every two adjacent screenshots with unified size; each screenshot sample pair is represented as (I... a I b The model inference module is used to predict an input screenshot sample using an image stitching model and output a normalized vertical stitching offset dy. norm The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits Overlap confidence level conf ;dy norm Indicate I a To remove the bottom 1-dy norm Only the percentage area can be compared with I b The top is spliced together, dy norm Passed to the conversion module; P logits Represented as [P(0), P(1), ...]; where P(0) is the optimal candidate longitudinal splicing displacement, and P(1) is the second-best candidate longitudinal splicing displacement; overlap conf dy norm Confidence score; P logits and overlap conf The data is then passed to the reliability assessment module. The conversion module is used to convert the dy value according to the size standardization method. normThe vertical stitching offset dy of the screenshot sample pairs before size unification is passed to the screenshot stitching module. The reliability judgment module is used to determine the overlap. conf Compared with the preset reliability threshold, P(0)-P(1) is also compared with the preset peak interval threshold; when overlap conf When P(0) - P(1) ≥ the preset confidence threshold and simultaneously satisfies the conditions for splicing and the uniqueness of the candidate position, the screenshot splicing module is entered; if either condition is not met, the current screenshot sample pair is not spliced. The screenshot splicing module is used to remove the overlapping back part of the existing spliced image according to dy, and splice the I in the current screenshot sample pair at the bottom of the cropped existing spliced image. b When stitching the Nth screenshot sample pair, the existing stitched image refers to the stitched result of the (N-1)th screenshot sample pair. The model inference module, transformation module, reliability judgment module, and screenshot stitching module are repeatedly executed, continuously combining the existing stitched image with the I in the next screenshot sample pair. b Continue aligning and stitching until all screenshot samples are stitched together to generate a complete long screenshot.
[0017] The technical effects achieved by this invention are as follows: It simultaneously utilizes global context and local details to adaptively process two typical long screenshot scenarios—repeated textures and paragraph text—as well as mixed scenarios; it uses a combination of multi-peak suppression training and uniqueness-aware weighting to solve the problem of finding accurate feature points for matching in repeated texture scenarios; and it uses a strategy of jointly filtering by confidence and peak intervals to obtain low-confidence samples representing small overlapping or non-overlapping samples that are difficult to splice, and rejects splicing them. This invention, through data construction, sample optimization, multi-branch feature fusion, adaptive matching and localization, and a dedicated training strategy, solves the problems of splicing failure, inaccurate localization, and poor generalization in traditional splicing techniques in scenarios with repeated textures, text paragraphs, and minor deviations, and can output continuous, complete long screenshots without obvious repetition or breaks. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the image stitching method for long screenshots proposed in this invention.
[0019] Figure 2 This is a schematic diagram of the image stitching model proposed in this invention.
[0020] Figure 3 This is a flowchart illustrating the training method of the image stitching model proposed in this invention.
[0021] Figure 4 This is a schematic diagram of the image stitching system for long screenshots proposed in this invention.
[0022] The attached diagrams are labeled as follows: Shared encoder 21, Scene gating module 22, Global branch 23, Local branch 24, Fusion module 25, Coarse positioning module 26, Fine positioning module 27, Sub-pixel fine-tuning module 28, Screenshot preprocessing module 1, Screenshot size unification module 2, Model inference module 3, Conversion module 4, Reliability judgment module 5, Screenshot stitching module 6. Detailed Implementation
[0023] Repetitive texture scenarios typically refer to screenshots of lists, tables, charts, or repetitive UIs (human-computer interfaces) where the rows have highly similar structures and differ only in numbers or local details. In repetitive texture scenarios, the local appearances of different rows are highly similar, and relying solely on local features such as fonts and edges can easily generate multiple closely matching peaks. Therefore, it is necessary to design a branch with a large receptive field that can perceive ambiguity from the entire image and the relative positions of images before and after it.
[0024] Paragraph text scenarios typically refer to screenshots of articles, chat logs, or other content consisting of continuous text or images, where fine alignment relies primarily on font shapes, images, and paragraph boundaries. In paragraph text scenarios, there are numerous identifiable and matchable features; therefore, it is necessary to design local features that guarantee high resolution and improve accuracy through sub-pixel alignment.
[0025] Please see Figure 1 The image stitching method for long screenshots proposed in this invention includes the following steps.
[0026] Step S1: When the mobile or desktop browser or application is running in the foreground, scroll down the displayed page of the browser or application—this can be done by user interaction or automatic system scrolling. During the scrolling process, continuously acquire multiple single-screen screenshots (hereinafter referred to as screenshots) using the operating system screenshot interface, in-application screenshot interface, browser screenshot interface, or external data collection tools. These screenshots are sequential and contain overlapping content; these screenshots are the raw material used to stitch together the long screenshot. Preprocess each screenshot: identify and remove the top status bar, bottom navigation bar, vertical or horizontal scrollbars, and floating obscuring layers from each screenshot, retaining only the valid page area in each screenshot. During preprocessing, ensure that the cropping parameters are consistent and that the size of the retained area is uniform for each screenshot.
[0027] Step S2: Scale all preprocessed screenshots to a fixed size. Alternatively, retain the original size of the preprocessed screenshots, paste each preprocessed screenshot onto a fixed-size canvas, and generate a padding mask in the remaining area of the canvas. Regardless of the scaling or padding method, all resulting screenshots will have the same size, for example, 512 pixels × 512 pixels. Construct a screenshot sample pair from every two adjacent screenshots of uniform size. Each screenshot sample pair is represented as (I... a I b ), I a This is called the top baseline screenshot, I b This is referred to as the screenshot below.
[0028] Step S3: Input a screenshot sample pair into the image stitching model, and the image stitching model predicts and outputs the normalized vertical stitching offset dy. norm The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits Overlap confidence level conf .
[0029] The normalized vertical splicing offset dy norm This represents the input screenshot sample pair (I a I b ), I a To remove the bottom 1-dy norm Only the percentage area can be compared with I b The top is pieced together. dy norm The value range of dy is [0,1] (i.e., between 0 and 1, with square brackets indicating inclusion). norm It is achieved by applying soft-argmax (a differentiable function used for approximation) to P. logits The result is obtained by normalizing and weighting the displacements of all candidate longitudinal splicing values.
[0030] The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits It is represented as [P(0), P(1), ...]. Where P(0) is the best candidate longitudinal splicing displacement, P(1) is the second best candidate longitudinal splicing displacement, and so on.
[0031] The overlap confidence level conf dy norm The confidence score is used to determine whether there is sufficient reliable overlap and matching evidence, mainly based on the value of P(0), the interval between P(0) and P(1), and P logitsThe entropy of the normalized distribution and the average of the vertical splicing displacements of the first five candidate layers are finally obtained by passing the fully connected layer and the sigmoid function (also known as the sigmoid function). conf The larger the value of dy, the more it indicates that dy norm The more likely it is to be the actual stitching location.
[0032] Step S4: Adjust the size according to the uniformity method (scaling or texture fill) for dy norm The vertical splicing offset dy of the screenshot sample pair before it is converted to a uniform size.
[0033] Step S5: Overlap conf P(0) - P(1) is compared with a preset reliability threshold and also with a preset peak interval threshold. When overlap conf When P(0) - P(1) ≥ the preset confidence threshold and P(0) - P(1) ≥ the preset peak interval threshold, both the splicing condition and the candidate position uniqueness condition are met, and the process proceeds to step S6. If either condition is not met, the input screenshot sample pair is determined to be non-overlapping, slightly overlapping, or low-confidence sample. The current screenshot sample pair is not spliced to avoid outputting an erroneous long image in a non-splicing scenario, and the process waits for the next screenshot sample pair.
[0034] When overlap conf When the confidence threshold is greater than or equal to the preset confidence threshold, it means that there are two graphs I. a with I b There is sufficient evidence of effective overlap to satisfy the splicability condition. When overlap... conf <When the confidence threshold is preset, it means that there are two graphs I a with I b The conditions for splicing may be that there is no overlap, the overlap is too small, there is severe occlusion, or the content is too different, thus failing to meet the requirements.
[0035] When P(0) - P(1) ≥ the preset peak interval threshold, it indicates that the optimal candidate longitudinal splicing displacement P(0) is sufficiently distinguishable from the second-best candidate longitudinal splicing displacement P(1), satisfying the candidate position uniqueness condition. When P(0) - P(1) < the preset peak interval threshold, it indicates that the optimal candidate longitudinal splicing displacement P(0) is not sufficiently distinguishable from the second-best candidate longitudinal splicing displacement P(1), and does not satisfy the candidate position uniqueness condition.
[0036] The order of steps S4 and S5 is not strictly limited; they can be performed either before or simultaneously.
[0037] Step S6: Remove the overlapping back part of the existing stitched image according to dy, and stitch the I from the current screenshot sample pair to the bottom of the cropped existing stitched image. bWhen stitching the first pair of screenshot samples, the existing stitched image is the I in the first pair of screenshot samples. a When stitching the second pair of screenshot samples, the existing stitched image is the result of stitching the first pair of screenshot samples. This process continues until the Nth pair of screenshot samples is stitched, at which point the existing stitched image is the result of stitching the (N-1)th pair of screenshot samples. Optionally, this step enables boundary fusion, blending near overlapping edges with linear weights to reduce visual discontinuities.
[0038] Repeat steps S3-S6, continuously matching the existing stitched image with the I in the next screenshot sample pair. b Continue aligning and stitching until all screenshot samples are stitched together to generate a complete long screenshot.
[0039] Please see Figure 2 The image stitching model in step S3 employs a scene-adaptive dual-branch network 20, which sequentially includes a shared encoder 21, a scene gate module 22, a global branch 23, a local branch 24, a fusion module 25, a coarse localization module 26, a fine localization module 27, and a subpixel refinement module 28. The global branch 23 and the local branch 24 are parallel branches with no specific order.
[0040] The shared encoder 21 is used to extract data from input screenshot sample pairs (I... a I b Extracting low-level shared features from I. Low-level shared features refer to basic edge, color, and texture features, such as those found in I. a I b The double-downsampled features s extracted using the same set of shared encoder parameters 2a s 2b The shared encoder uses lightweight convolutions, residual blocks, or depthwise separable convolutions to balance accuracy and inference efficiency. Subsequent global branch 23 and local branch 24 learn specific high-order features required for different splicing scenarios, building upon shared features from the same underlying layer. This design unifies the input representation, reduces redundant computation, ensures consistency in the high-level feature extraction of both branches, effectively reduces redundant model parameters, and significantly improves the model's inference speed.
[0041] The scene gating module 22 is used to process the input screenshot sample pairs (I a I b The underlying shared features of ) are simultaneously fed into both global branch 23 and local branch 24, and are based on the input screenshot sample pairs (Ia I b The feature statistics of the input screenshot sample pair (I) are autonomously inferred to generate a gate weight g with a value range of [0,1] to indicate the input screenshot sample pair (I). a I b The weights of global branch 23 and local branch 24. The feature statistics of the screenshot sample pairs are represented as [s]. 2a s 2b s 2a ⊙s 2b s 2a -s 2b ]. Where s 2a ⊙s 2b It is an element-wise product fusion feature, representing I a with I b Similar or co-activated regions; s 2a -s 2b It is an element-wise difference feature, representing I a with I b The content changes. The global branch weight is g, and the local branch weight is 1-g. The closer g is to 1, the more the input screenshot sample pair is biased towards repetitive texture scenes; the larger the global branch weight, the smaller the local branch weight. The closer g is to 0, the more the input screenshot sample pair is biased towards paragraph text scenes; the larger the local branch weight, the smaller the global branch weight. The closer g is to 0.5, the more the input screenshot sample pair is biased towards mixed scenes; the global and local branch weights are relatively balanced. During the model training phase, pre-labeled scene category tags can be used. label Supervised learning is completed for the scene gating module, guiding it to accurately distinguish the feature weight requirements of different scenes. During the model inference stage, a soft fusion mechanism is employed to adaptively adjust the fusion weights of global and local features based on the scene attributes of the input samples, achieving the optimal feature combination across multiple scenes.
[0042] Global branch 23 excels at handling vertically recurring structured content units in repeating texture samples—such as repeating list items, similar table rows, similar filenames, consecutive numbering, repeating cards, repeating icon layouts, chart scales, and adjacent paragraphs with highly similar local content. However, it may lose details of strokes, punctuation, and small icons when dealing with paragraph text samples. Local branch 24 excels at fine-grained localization, making it particularly suitable for handling paragraph text samples; however, it lacks sufficiently long context and is prone to selecting the wrong adjacent rows in repeating texture samples. If only one branch is selected, a misclassification will lead to an error or failure in the entire model's output. Therefore, this invention sends the input samples to both branches simultaneously, enabling it to handle not only repeating texture samples and paragraph text samples but also mixed scene samples containing tables, images, paragraphs, and lists.
[0043] Preferably, to prevent the scene gating module 22 from excessively favoring local branches 24 during inference, a lower limit for the weight of the global branch 23 is set. When the original gating weight g output by the scene gating module 22 is lower than the lower limit for the weight of the global branch 23, it is corrected to... . This is called the gating weight after lower bound correction. The value range is [lower bound of global branch weight, 1], and the global branch weight is The local branch weight is 1- This correction ensures that the global context required for repeated texture samples always retains a certain contribution, preventing the scene gating module 22 from misjudging and causing the complete loss of the global context.
[0044] The global branch 23 is used to learn the large receptive field, cross-line relationships, and global position. Global branch 23 integrates multi-dimensional feature enhancement techniques, strengthening the global semantic association of the image through channel attention, spatial attention, and dynamic adaptive attention modules to improve the ability to recognize inter-line differences. It combines line-level positional attention to accurately capture the line-dimensional positional information of the image, and with Feature Pyramid Network (FPN) fusion and two-dimensional positional encoding techniques, it comprehensively enhances cross-image line feature alignment and the model's global context awareness, line-level positional recognition, and cross-scale feature expression capabilities. From a global perspective, it avoids splicing misalignment and matching errors caused by repeated textures and similar content, solving the problem that a large amount of repetitive text content can only be distinguished by a few differentiated elements. Channel attention is used to improve the differentiation features such as text strokes, number edges, and icon outlines. Spatial attention is used to locate the areas containing a few differentiated characters and suppress large areas of background and repetitive areas with no different features. For repetitive texture scenarios in lists, tables, charts, or repetitive human-computer interfaces where rows have highly similar structures and differ only in numbers or local details, it is necessary to eliminate ambiguity by relying on the differences in the image's contextual content. Therefore, a dynamic attention module is introduced to establish the dependencies between features of different rows within the image. The feature pyramid progressively passes global structural information from deep features to a high-resolution feature layer, obtaining greater context while preserving stroke-level differences. Two-dimensional positional encoding ensures that each feature contains both content and positional information, allowing the same text to have distinguishable feature representations in consecutive images. The input to the global branch 23 is the low-level shared features (e.g., s). 2a s 2b Output global feature F g Compared to the shared features at the lower levels, the global features F g This belongs to high-level features. Global branch 23 is particularly suitable for handling global scene challenges that frequently occur in long image stitching, such as repeated texture interference, mismatch of adjacent content rows, and confusion of multiple candidate features.
[0045] The local branch 24 is configured to learn high-resolution local textures and fine-grained text differences. The local branch 24 retains high-resolution feature information of the image throughout the entire process, emphasizes text stroke differences, abandons the problem of fine feature loss caused by excessive downsampling, focuses on learning feature differences in local text content, punctuation marks, line edges, interface icons and tiny regions, accurately captures the splicing boundary details of paragraph-type samples, effectively improves the splicing positioning accuracy in text-type and fine interface-type scenarios, and makes up for the deficiency of the global branch in perceiving fine features. In addition, the local branch 24 still adopts spatial and channel attention to enhance the recognition of inter-line difference features. The input of the local branch 24 is the underlying shared features (for example, s 2a , s 2b ), and the output is the local feature F l . Compared with the underlying shared features, the local feature F l is a high-level feature. The local branch 24 is particularly suitable for handling local accuracy problems such as paragraph text splicing, fine feature difference recognition, and sub-pixel accurate positioning of splicing boundaries, and improves the boundary positioning accuracy in scenarios of paragraphs, punctuation marks, and thin lines.
[0046] The fusion module 25 is configured to fuse the global feature F g and the local feature F l to obtain the fused feature F fused . F g and F l are both feature tensors, and F fused = ·F g +(1- )·P(F l ). Herein, · denotes element-wise broadcast multiplication between a scalar ( or 1- ) and a feature tensor (F g or F l ), + denotes element-wise addition of two weighted feature matrices, and P() denotes a channel projection function. For example, the channel projection function P() is a combination of 1×1 convolution, Batch Normalization and activation function.
[0047] The coarse positioning module 26 is configured to quickly and roughly determine the splicing position between I fused and I in the input screenshot sample pair (I a , I b ) in the global range according to the fused feature F a b , and output a coarse positioning result (for example, with a hundred-pixel level error).
[0048] The fine positioning module 27 is used to slowly and precisely locate I within a local area of the coarse positioning result. a with I b The stitching position is reduced to the pixel level, and the output is a fine positioning result (e.g., pixel-level error).
[0049] The subpixel fine-tuning module 28 is used to quickly and precisely adjust I within a very small range of the fine-positioning result. a with I b The stitching position is reduced to the sub-pixel level (e.g., 0.1 pixel error), and the normalized vertical stitching offset dy is output. norm The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits Overlap confidence level conf .
[0050] Figure 2 In the image stitching model of the present invention, the two branches (global branch and local branch) share low-level features while learning high-level features separately, which can improve cross-scene robustness without significantly increasing the complexity of the model.
[0051] Please see Figure 3 The training method for the image stitching model in step S3 includes the following steps.
[0052] Step S31: Obtain long pages or long screenshots, and evenly divide each long page or long screenshot into multiple single-page screenshots, with each pair of adjacent single-page screenshots partially overlapping. The scrolling step size is set differently for different long pages or long screenshots during the division. Alternatively, continuously scroll the mobile device while taking single-page screenshots, with each pair of adjacent single-page screenshots partially overlapping. This data acquisition method allows the model to learn the real scrolling screenshot relationships. Both of these data acquisition methods cover scenarios such as social chat logs, long articles with images and text, data tables, list interfaces, application software interfaces, pages with mixed text and images, and pages with repetitive textures. Each pair of adjacent single-page screenshots constitutes a screenshot sample pair (I...). a I b ).
[0053] Step S32: For each screenshot sample pair (I a I b According to I a with I b The location in the original long page or long screenshot, or according to I a with I b Calculate I based on the relative position within the scrolling screenshot sequence. a with I b overlap height hThe overlap ratio and the vertical splicing offset dy between the two are recorded as annotation information. This is based on each screenshot sample pair (I... a I b The page content is analyzed and automatically labeled with the scene category tag. label The system automatically labels valid splices based on the overlap ratio, reducing manual labeling costs. If the overlap height is... h Very small overlap (e.g., less than 20 pixels) indicates a small overlap sample, which falls under the category of difficult and complex samples. If the overlap height is very small... h A value of zero indicates a non-overlapping sample, which is considered a failed sample.
[0054] The scene category label is "scene". label This is used to categorize input samples into three main types: paragraph text, repeating textures, and mixed scenes. If the page content belongs to the paragraph text category, then the scene... label A value of 0 indicates a paragraph text scene. If the page content belongs to a repeating texture class, the scene... label A value of 1 indicates a scene with repeating textures. If the page content is difficult to determine, the scene... label -1 (indicating a mixed scene class). The above values are for illustrative purposes only.
[0055] The valid splicing label is used to mark whether there is a real overlapping region in the current screenshot sample pair. If I a with I b There is overlap, and the valid concatenation tag is marked as 1 (valid). If I a with I b There is no overlap, and the valid tag is marked as 0 (invalid).
[0056] Step S33: For each screenshot sample pair (I a I b I in ) a with I b Perform adaptive cropping—remove I a The area above, retain I a The area below; retain I b Remove I from the upper area. b The area below. This allows the image stitching model to focus its attention on the region where stitching boundaries are most likely to occur—I. a The area below and I bIn the upper region, reduce interference from invalid content. Adjust the cropping height and anchor point offset according to the overlap ratio to ensure that small overlapping samples still contain sufficient context. In small overlapping samples, the overlap ratio is very small, so the removal area should be reduced and the retention area expanded to ensure that there is a clear contextual reference so that the convolution and attention mechanisms can obtain sufficient contextual information.
[0057] Step S34: Extract the cropped I using the foreground segmentation algorithm. a with I b The foreground area, or marked with an interface element mask after cropping. a with I b The foreground region. The foreground region refers to the area containing core semantic information that actually needs to be stitched together. The main purpose of the foreground region is to distinguish effective content such as text, icons, table lines, cards, and images within the already cropped area, and to suppress non-information areas such as background fill areas. For screenshot sample pairs of repeating texture classes (I... a I b Background randomization is performed to make the image stitching model focus more on text, icons, list items, and row content, rather than background patterns or fixed sidebars.
[0058] Step S35: Use cropped and labeled foreground region screenshot pairs (I a I b The image stitching model is trained through candidate position distribution supervision, token-level diagonal matching supervision, multi-peak suppression supervision, and validity supervision, so that the stitching position dy output by the image stitching model is as close as possible to the labeled dy. During training, the encoder, or fine localization module and sub-pixel fine-tuning module in the global and local branches can be frozen first, and then gradually unfrozen. Sampling balance or hierarchical sampling is performed on minority class scenes to ensure that repeated texture samples, paragraph text samples, small overlapping samples, and invalid samples are fully learned. The matching matrix M is used for token-level matching loss during the training phase. It converts high-resolution features into strip tokens according to "vertical rows × horizontal stripes". The token-level diagonal matching loss is used to improve the bidirectional matching probability of the true corresponding rows and the true corresponding stripes, thereby indirectly improving P. logits And the accuracy of dy. A trained image stitching model can then be used for inference.
[0059] To adapt to different sample attributes and solve training challenges in various scenarios, this invention designs a combination of differentiated loss functions and targeted training strategies. In the coarse localization stage, the model can use heatmap distribution loss or correlation maps to constrain the formation of a main peak near the true vertical stitching position; it uses Wing regression loss or smooth L1 loss to constrain continuous dy; and it uses binary classification or regression loss to learn overlap confidence. Furthermore, through peak isolation loss and uniqueness-aware weighted loss, the model explicitly suppresses false peaks in repetitive textures during training, creating a larger gap between the true matching position and the strongest incorrect candidate.
[0060] For splicable samples with effective overlapping regions, a combination of heatmap distribution loss, vertical dy regression loss, horizontal dx regression loss, diagonal cross-entropy loss, and token-level matching loss is employed. Adjacent negative sample constraints and online hard negative loss are also introduced to enhance the model's ability to learn effective matching features. Through stripe token matching and diagonal aggregation, the splicing position is determined by a large number of local correspondences through voting, avoiding the instability of a single feature point or a single correlation peak. Furthermore, the confidence level of candidate splicing positions can be naturally output for subsequent rule-based judgment.
[0061] To address the multi-peak spurious matching problem that easily occurs in repetitive texture scenes, a peak isolation loss is specifically designed. This loss forces the model prediction confidence of the true matching position to be significantly higher than all false peaks, thereby reducing multi-peak spurious matches. For each sample, this loss identifies several false peaks with the highest confidence scores, excluding the true vertical splicing value dy. It requires that the confidence score of the true dy be at least higher than the false peaks by a preset threshold, thus directly suppressing false positive peaks generated by adjacent repeated rows, similar numbers, or repeated cards.
[0062] For similar content rows with weak feature uniqueness (low uniqueness samples), a uniqueness-aware weighted loss is introduced. The uniqueness score of each row is estimated through an autocorrelation branch. When the uniqueness of the true matching row is low, greater weight is applied to the dy regression loss or matching loss, providing stronger supervision for the model on repetitive textures, low-discrimination lists, and similar paragraph samples. This adaptively increases the training weights for repetitive content samples, enhancing the model's learning performance on difficult samples.
[0063] For samples that cannot be spliced due to the absence of effective overlapping regions, the ValidityBinary Cross-Entropy Loss is used as the core to achieve accurate determination of the splicability of the samples.
[0064] Please see Figure 4 The image stitching system for long screenshots proposed in this invention includes a screenshot preprocessing module 1, a screenshot size unification module 2, a model reasoning module 3, a conversion module 4, a reliability judgment module 5, and a screenshot stitching module 6. Figure 4 The image stitching system shown corresponds to Figure 1 The image stitching method shown.
[0065] The screenshot preprocessing module 1 is used to continuously acquire multiple single-screen screenshots (hereinafter referred to as screenshots) and preprocess each screenshot.
[0066] The screenshot size unification module 2 is used to unify the size of all preprocessed screenshots by scaling or texture filling, and to construct a screenshot sample pair from every two adjacent screenshots with the same size.
[0067] The model inference module 3 is used to predict and output a normalized vertical stitching offset dy from an input screenshot sample using an image stitching model. norm The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits Overlap confidence level conf . dy norm Passed to conversion module 4. logits and overlap conf The data is then passed to the reliability assessment module 5.
[0068] The conversion module 4 is used to convert dy according to the size uniformity method. norm The vertical stitching offset dy of the screenshot sample pair before it is converted to a uniform size is passed to the screenshot stitching module 6.
[0069] The reliability judgment module 5 is used to determine overlap. conf Compared with the preset reliability threshold, P(0)-P(1) is also compared with the preset peak interval threshold; when overlap conf When P(0) - P(1) ≥ the preset confidence threshold and simultaneously meets the conditions for splicing and the uniqueness of the candidate position, the screenshot splicing module 6 is entered; when either condition is not met, the current screenshot sample pair is not spliced.
[0070] The screenshot stitching module 6 is used to remove the overlapping back part of the existing stitched image according to dy, and stitch the I of the current screenshot sample pair to the bottom of the cropped existing stitched image.b When stitching the Nth pair of screenshot samples, the existing stitched image is the result of stitching the (N-1)th pair of screenshot samples.
[0071] Repeatedly execute model inference module 3, transformation module 4, reliability judgment module 5, and screenshot stitching module 6, continuously comparing the existing stitched image with the I in the next screenshot sample pair. b Continue aligning and stitching until all screenshot samples are stitched together to generate a complete long screenshot.
[0072] Compared with the prior art, the present invention has the following unique and beneficial effects.
[0073] First, compared to methods that rely solely on keypoints, template matching, or single regression models, this invention can simultaneously utilize global context and local details to adaptively process two typical long screenshot scenarios: repetitive textures and paragraph text. The global branch primarily addresses the disambiguation of repeated lines, while the local branch focuses on precise boundary localization. Through scene gating and dual-branch fusion, the image stitching model can utilize global position and line-level attention more extensively in scenarios such as repetitive lists, similar numbering, and similar filenames, while leveraging local strokes and text details more effectively in scenarios like article paragraphs and chat logs, thereby reducing the probability of mis-stitching.
[0074] Second, addressing the challenge of finding accurate feature points for matching in repetitive texture scenes, this invention employs a multi-peak suppression training method. It uses peak isolation loss to explicitly constrain the confidence score of the true matching position to be higher than several strongest candidate positions, and uses uniqueness-aware weighting to enhance the weight of low-uniqueness row samples. These two methods are complementary. Uniqueness-aware weighting answers which samples and rows are most prone to repetitive matching, but it only changes the training gradient magnitude and cannot determine which erroneous position should be suppressed. Peak isolation loss determines the optimization direction between the true peak and the strongest false peak, simultaneously improving the true peak and suppressing false peaks, ensuring that they satisfy the margin constraint.
[0075] Third, this invention overcomes the instability of splicing small overlapping samples by using a low-confidence rejection method. Samples with different overlap ratios are specifically constructed in the training dataset to ensure sufficient coverage of small overlapping samples and to appropriately increase their training weights. The cropping window and splicing boundary anchor points are adjusted according to the overlap size to avoid fixed cropping that removes a small amount of overlapping content while preserving sufficient non-overlapping context. Through stripe lexical matching and diagonal aggregation, multiple local content correspondences are used to jointly vote to determine dy. Small overlapping samples that cannot be reliably located are not forcibly spliced; instead, a low-confidence state is output and splicing is rejected. For non-overlapping samples, this invention does not forcibly splice them; a low-confidence state is also output and splicing is rejected.
[0076] The above are merely preferred embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An image stitching method for long screenshots, characterized in that, Includes the following steps; Step S1: Continuously acquire multiple single-screen screenshots of browsers or applications on mobile or desktop devices. These screenshots are taken in sequence and have overlapping content between adjacent screenshots. Preprocess each screenshot. Step S2: Unify the size of all preprocessed screenshots by scaling or texture filling, and construct a screenshot sample pair from every two adjacent screenshots with the same size; each screenshot sample pair is represented as (I a I b ); Step S3: Input a screenshot sample pair into the image stitching model, and the image stitching model predicts and outputs the normalized vertical stitching offset dy. norm The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits Overlap confidence level conf ;dy norm Indicate I a To remove the bottom 1-dy norm Only the percentage area can be compared with I b The top is spliced together; P logits Represented as [P(0), P(1), ...]; where P(0) is the optimal candidate longitudinal splicing displacement, and P(1) is the second-best candidate longitudinal splicing displacement; overlap conf dy norm Confidence score; Step S4: According to the size uniformity method, dy norm The vertical stitching offset dy of the screenshot sample pair before conversion to uniform size; Step S5: Overlap conf Compared with the preset reliability threshold, P(0)-P(1) is also compared with the preset peak interval threshold; when overlap conf When P(0) - P(1) ≥ the preset confidence threshold and P(0) - P(1) ≥ the preset peak interval threshold, the splicing condition and the candidate position uniqueness condition are met at the same time, and the process proceeds to step S6; when either condition is not met, the current screenshot sample pair is not spliced. The order of steps S4 and S5 can be arbitrary, or they can be performed simultaneously. Step S6: Remove the overlapping back part of the existing stitched image according to dy, and stitch the I from the current screenshot sample pair to the bottom of the cropped existing stitched image. b When stitching the Nth pair of screenshot samples, the existing stitched image refers to the stitched result of the (N-1)th pair of screenshot samples. Repeat steps S3-S6, continuously matching the existing stitched image with the I in the next screenshot sample pair. b Continue aligning and stitching until all screenshot samples are stitched together to generate a complete long screenshot.
2. The image stitching method for long screenshots according to claim 1, characterized in that, In step S1, the preprocessing includes identifying and removing the top status bar, bottom navigation bar, vertical or horizontal scroll bar, and floating obscuring layer from each screenshot, retaining only the effective area of the page in each screenshot.
3. The image stitching method for long screenshots according to claim 1, characterized in that, In step S5, when overlap conf When the confidence threshold is greater than or equal to the preset confidence threshold, it means that there are two graphs I. a with I b The conditions for splicing are met; when overlap conf <When the confidence threshold is preset, it means that there are two graphs I a with I b The splicing condition is not met; when P(0)-P(1)≥ the preset peak interval threshold, it means that the candidate position uniqueness condition is met; when P(0)-P(1)< the preset peak interval threshold, it means that the candidate position uniqueness condition is least met.
4. The image stitching method for long screenshots according to claim 1, characterized in that, In step S6, boundary fusion is enabled, and the edges near overlapping edges are blended with linear weights.
5. The image stitching method for long screenshots according to claim 1, characterized in that, The image stitching model in step S3 adopts a scene-adaptive dual-branch network, which includes a shared encoder, a scene gating module, a global branch, a local branch, a fusion module, a coarse localization module, a fine localization module, and a sub-pixel fine-tuning module in sequence; wherein, the global branch and the local branch are two parallel branches without any order. The shared encoder is used to extract underlying shared features—basic edge, color, and texture features—from input screenshot sample pairs; The scene gating module is used to simultaneously send the underlying shared features of the input screenshot sample pairs into the global branch and the local branch, and autonomously infer and generate a gating weight g with a value range of [0,1] based on the feature statistics of the input screenshot sample pairs, so as to serve as the global branch weight g and the local branch weight 1-g. The global branch is used to learn the large receptive field, cross-row relationships, and global position, integrating multi-dimensional feature enhancement techniques, channel attention, spatial attention, dynamic adaptive attention modules, feature pyramids, and two-dimensional positional encoding techniques. The input to the global branch is the underlying shared features, and the output is the global feature F. g ; The local branch is used to learn high-resolution local textures and fine-grained text differences, fusing channel attention and spatial attention; the input of the local branch is the low-level shared features, and the output is the local feature F. l ; The fusion module is used to integrate global features F g With local features F l The fusion is performed to obtain the fusion feature F. fused ; The coarse localization module is used to determine the fusion feature F. fused Quickly and roughly determine the splicing position of input screenshot sample pairs in a global scope, and output coarse localization results; The fine positioning module is used to slowly and precisely reduce the stitching position of the input screenshot sample pairs within the local range of the coarse positioning result to the pixel level, and output the fine positioning result. The subpixel fine-tuning module is used to quickly and precisely reduce the stitching position of the input screenshot sample pairs to the subpixel level within a very small range of the fine positioning result, outputting dy. norm P logits overlap conf .
6. The image stitching method for long screenshots according to claim 5, characterized in that, When the original gating weight g output by the scene gating module is lower than the lower limit of the global branch weight, it is corrected to the gating weight after lower limit correction. ; The value range is [lower bound of global branch weight, 1], which is used as the global branch weight. and local branch weight 1- .
7. The image stitching method for long screenshots according to claim 6, characterized in that, F fused = ·F g +(1- )·P(F l ); where · represents element-wise broadcast multiplication between a scalar and a feature tensor, + represents element-wise addition of two weighted feature matrices, and P() represents the channel projection function.
8. The image stitching method for long screenshots according to claim 5, characterized in that, The training method for the image stitching model in step S3 includes the following steps; Step S31: Obtain long pages or long screenshots, and evenly divide each long page or long screenshot into multiple single-page screenshots, with each pair of adjacent single-page screenshots partially overlapping. Alternatively, continuously scroll through mobile devices and take single-page screenshots, with each pair of adjacent single-page screenshots partially overlapping; each pair of adjacent single-page screenshots constitutes a screenshot sample pair (I). a I b ); Step S32: For each screenshot sample pair (I a I b According to I a with I b The location in the original long page or long screenshot, or according to I a with I b Calculate I based on the relative position within the scrolling screenshot sequence. a with I b overlap height h The overlap ratio and the vertical splicing offset dy between the two are recorded as annotation information, based on each screenshot sample pair (I a I b The page content is analyzed and automatically labeled with the scene category tag. label The system determines and automatically labels valid stitches based on the overlap ratio. label This is used to classify input samples into three categories: paragraph text, repeating texture, and mixed scene; valid is used to mark whether there is a real overlapping area in the current screenshot sample pair; Step S33: For each screenshot sample pair (I a I b I in ) a with I b Perform adaptive cropping; Step S34: Extract the cropped I using the foreground segmentation algorithm. a with I b The foreground area, or the cropped I element marked with an interface element mask. a with I b The foreground region; the foreground region refers to the region containing the core semantic information and that actually needs to be stitched together; for screenshot sample pairs of repeating texture classes (I a I b Background randomization is also performed; Step S35: Use cropped and labeled foreground region screenshot pairs (I a I b The image stitching model is trained through candidate position distribution supervision, word-level diagonal matching supervision, multi-peak suppression supervision, and validity supervision, so that the stitching position dy output by the image stitching model is as close as possible to the labeled dy; the trained image stitching model can then be used for inference.
9. The image stitching method for long screenshots according to claim 8, characterized in that, In step S35, during the training process, the encoder, fine localization module, and subpixel fine-tuning module in the global branch and local branch are first frozen, and then gradually unfrozen; sampling balance or hierarchical sampling is performed on minority class scenes; the following combination of loss functions is used during the training process: heatmap distribution loss constraint, strip word matching loss, peak isolation loss, uniqueness-aware weighted loss, and binary classification cross-entropy loss.
10. An image stitching system for long screenshots, characterized in that, It includes a screenshot preprocessing module, a screenshot size unification module, a model inference module, a conversion module, a reliability judgment module, and a screenshot stitching module; The screenshot preprocessing module 1 is used to continuously acquire multiple single-screen screenshots of browsers or applications on mobile or desktop devices. These screenshots are taken in sequence and have overlapping content between adjacent screenshots. Each screenshot is preprocessed. The screenshot size unification module is used to unify the size of all preprocessed screenshots through scaling or texture filling, and to construct a screenshot sample pair from every two adjacent screenshots with unified size; each screenshot sample pair is represented as (I a I b ); The model inference module is used to predict an input screenshot sample using an image stitching model and output a normalized vertical stitching offset dy. norm The one-dimensional original score sequence P of all candidate longitudinal splicing displacements logits Overlap confidence level conf ;dy norm Indicate I a To remove the bottom 1-dy norm Only the percentage area can be compared with I b The top is spliced together, dy norm Passed to the conversion module; P logits It is represented as [P(0), P(1), ...]; where P(0) is the best candidate longitudinal splicing displacement and P(1) is the second best candidate longitudinal splicing displacement. overlap conf dy norm Confidence score; P logits and overlap conf The data is then transmitted to the reliability assessment module. The conversion module is used to convert dy according to the size uniformity method. norm The vertical stitching offset dy of the screenshot sample pair before it is converted to a uniform size is passed to the screenshot stitching module; The reliability assessment module is used to determine overlap. conf Compared with the preset reliability threshold, P(0)-P(1) is also compared with the preset peak interval threshold; when overlap conf When P(0) - P(1) ≥ the preset confidence threshold and P(0) - P(1) ≥ the preset peak interval threshold, the conditions for splicing and the uniqueness of the candidate position are met simultaneously, and the screenshot splicing module is entered; when either condition is not met, the current screenshot sample pair is not spliced. The screenshot stitching module is used to remove the overlapping back part of the existing stitched image according to dy, and to stitch the I of the current screenshot sample pair to the bottom of the cropped existing stitched image. b When stitching the Nth pair of screenshot samples, the existing stitched image refers to the stitched result of the (N-1)th pair of screenshot samples. Repeatedly execute the model inference module, transformation module, reliability judgment module, and screenshot stitching module, continuously comparing the existing stitched image with the I in the next screenshot sample pair. b Continue aligning and stitching until all screenshot samples are stitched together to generate a complete long screenshot.