An image seam line extraction method

CN122737445BActive Publication Date: 2026-10-27自然资源部第六地形测量队
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611208300.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-27
Estimated Expiration
2046-08-11

AI Technical Summary

Technical Problem

第一类为基于最优路径搜索的方法,该类方法首先构建重叠区域的像素差异代价图,再通过Dijkstra最短路径算法或动态规划方法在代价图上搜索全局代价最小的路径作为接缝线,可通过设计复合代价函数实现对明显地物的避让,但路径搜索的计算复杂度随重叠区域尺寸增长较为显著

Benefits of technology

[0043](1)通过获取重叠区域的矢量边界并动态计算贴合重叠区域的轴对齐外接矩形,仅在该外接矩形范围内构建局部掩膜并执行接缝线提取运算,将计算开销由原始影像整体幅面解耦至仅与重叠区域尺寸相关。降低了运算耗时与峰值内存占用,解决了传统全图掩膜运算在超大幅面影像中因内存溢出导致处理中断的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122737445B_ABST
    Figure CN122737445B_ABST
Patent Text Reader

Abstract

The application discloses an image seam line extraction method and belongs to the field of remote sensing image processing. In order to solve the problems of large memory consumption in full image operation, non-adaptability of fixed clipping window and positioning error caused by local operation coordinate restoration in the existing large-format remote sensing image seam line extraction, the application obtains a vector boundary of an overlapping area and constructs an axis-aligned circumscribed rectangle, performs extraction operation only in the local area, and restores the seam line to a full image coordinate system by using a symmetrical linear translation transformation. The application is used for automatic extraction of the seam line in remote sensing image mosaicking, has the advantages of significantly reducing memory occupation, improving operation efficiency and ensuring lossless geometric precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of remote sensing image processing technology, and specifically to a method for extracting image seam lines. Background Technology

[0002] Remote sensing image mosaicking is a core step in the production process of remote sensing data products. It involves stitching together multiple adjacent images with overlapping areas to generate a complete image with a larger coverage area. The accurate extraction of seam lines is a key technology that determines the geometric accuracy and visual consistency of the mosaicked image. With the rapid development of aerospace remote sensing technology, the ability to acquire high-resolution, large-format remote sensing images has continued to improve. The pixel size of a single orthophoto image often reaches tens of thousands or even hundreds of thousands, which places higher demands on the computational efficiency, memory usage control, and geometric accuracy of seam line extraction during the image mosaicking process.

[0003] Currently, automatic seam extraction technology in image mosaicking mainly falls into three mainstream categories. The first category is based on optimal path search. This method first constructs a pixel difference cost map of the overlapping area, and then searches for the path with the minimum global cost on the cost map using Dijkstra's shortest path algorithm or dynamic programming as the seam line. It can avoid obvious features by designing composite cost functions, but the computational complexity of the path search increases significantly with the size of the overlapping area. The second category is based on Voronoi diagrams and surface skeletons to generate mosaic networks. This method divides the overall mosaicking range into surface regions based on the adjacency relationships of the effective coverage areas of each image, forming a global seam line network using the common boundaries of adjacent mosaic surfaces. It is suitable for overall mosaicking of large batches of images, but its adaptability to the effective areas of images with complex shapes such as concave polygons and holes is limited. The third category is the extraction method based on the central axis (skeleton) of the region. This type of method first converts the overlapping region of the image into a binary mask, and then extracts the central axis of the overlapping region through morphological thinning (such as Zhang-Suen parallel thinning) algorithm or central axis transformation based on distance transformation. This central axis is used as the seam line. Its principle is intuitive and the generated seam line has a stable geometric shape. It has been widely used in mosaic scenarios of various regular and irregular overlapping regions. This is also the technical route to which this invention belongs and has been improved.

[0004] In existing seam line extraction techniques based on regional axes, a binary mask is typically constructed using a full-image canvas of the same size as the original image. Morphological processing, thinning operations, and skeleton analysis are then performed at the full-image scale. The mask's memory usage and the computation time of each step increase approximately linearly with the overall size of the original image. However, in real-world production scenarios, the effective overlap between adjacent images typically only constitutes a small portion of a single image. The vast majority of areas in the full-image mask are non-overlapping, invalid blank areas. Allocating storage space to these invalid areas and participating in pixel-by-pixel iterative calculations results in significant memory waste and computational overhead. When processing ultra-large format images, this can even lead to computational interruptions due to memory usage exceeding the hardware's capacity, severely restricting the production efficiency of large-format remote sensing image mosaicking.

[0005] To reduce the computational scope, some existing solutions attempt to use a preset fixed cropping window to extract local areas for processing. However, due to multiple factors such as image shooting posture, terrain undulation, and effective area cropping, overlapping areas can appear anywhere in the entire image and present arbitrary irregular shapes such as stripes, concave polygons, and holes. A cropping window with a fixed position and size cannot adaptively fit overlapping areas of different shapes and positions. If the window is set too large, a large amount of invalid blank areas are still retained, making it difficult to effectively reduce computational overhead. If the window is set too small, the boundary range of the overlapping area is easily truncated, resulting in incomplete seam lines that cannot meet the requirements of subsequent mosaicking operations. In addition, even when using the local area computation approach, existing technologies generally lack rigorous coordinate mapping and restoration mechanisms. The seam lines obtained from local computation are in a local coordinate system. If they cannot be accurately transformed to the full-image pixel coordinate system of the original image, additional positioning errors will be introduced, causing the seam lines to mismatch with the actual positions of the original image. If the coordinate transformation process involves operations such as rotation, interpolation, and resampling, geometric accuracy will be further lost, making it difficult to guarantee that the seam lines obtained from local computation have geometric consistency with the full-scale computation results.

[0006] Therefore, there is an urgent need for a method that can effectively reduce the memory usage and computational overhead of seam line extraction in large-format images without changing the geometric extraction results of the seam lines or sacrificing positioning accuracy, and that can be adapted to seam line extraction in image areas with overlapping shapes and locations. Summary of the Invention

[0007] To alleviate or partially alleviate the above-mentioned technical problems, the solution of the present invention is as follows:

[0008] This invention discloses a method for extracting image seam lines, comprising:

[0009] Step S1: Obtain the vertices of the vector boundary polygon of the overlapping area of ​​the remote sensing image;

[0010] Step S2: Based on the vertices of the vector boundary polygon, determine the axis-aligned circumscribed rectangle that fits the overlapping area of ​​the remote sensing image to obtain the local computation region;

[0011] Step S3: Translate the vertices of the vector boundary polygon from the full-image pixel coordinate system of the original image to the local coordinate system of the local computation region;

[0012] Step S4: Construct a local mask within the local computational region, and perform seam line extraction operations based on the local mask to obtain the seam line in the local coordinate system; wherein, performing seam line extraction operations based on the local mask includes:

[0013] Morphological preprocessing is performed on the local mask;

[0014] Perform a central thinning operation on the preprocessed local mask to extract the central skeleton with a single pixel width;

[0015] A graph structure is constructed based on the node adjacency of the central skeleton, short branch pruning is performed, and the longest main path is extracted as the main seam line.

[0016] The main seam line is smoothed and simplified, and the seam line in the local coordinate system is output.

[0017] Step S5: Translate the seam line in the local coordinate system back to the full-image pixel coordinate system of the original image, and output the seam line in the full-image pixel coordinate system;

[0018] The translation to the local coordinate system and the translation back to the global pixel coordinate system constitute a symmetrical linear translation transformation, which only involves the addition and subtraction of coordinate offsets.

[0019] In one implementation example, step S2 specifically includes:

[0020] Traverse all the vertices of the vector boundary polygon, obtain the minimum and maximum coordinates in the horizontal and vertical directions, and determine the axis-aligned circumscribed rectangle;

[0021] The axis-aligned circumscribed rectangle is extended outward by a preset margin, and the boundary of the extended circumscribed rectangle is clamped according to the size of the original image to obtain the local computation area.

[0022] In one implementation example, step S3 specifically includes:

[0023] Subtract the top-left corner coordinate offset of the local computation region in the full-image pixel coordinate system of the original image from the vertex coordinates of the vector boundary polygon;

[0024] Step S5 specifically includes: adding the coordinates of the seam line in the local coordinate system to the offset of the upper left corner of the local operation area in the full-image pixel coordinate system of the original image.

[0025] In one implementation example, step S4, specifically constructing a local mask within the local computational region, includes:

[0026] Allocate local storage space corresponding to the size of the local computation region and store it in a binary format;

[0027] Using the pixel center as the sampling point, a scan line filling algorithm is used in conjunction with odd-even rules or non-zero wrapping rules to perform nearest neighbor inclusion judgment and rasterization filling on the vertices of the polygon translated to the local coordinate system.

[0028] In one implementation example, the short branch pruning includes:

[0029] Hanging branches are obtained by tracing back along the central axis skeleton from each endpoint to the nearest fork point. Hanging branches with a path length less than a preset path length threshold are deleted. After each round of deletion, the endpoints and forks are recounted, and the iteration is repeated until no branches can be deleted.

[0030] In one implementation example, extracting the longest main path as the main seam line includes:

[0031] If the central skeleton after pruning is a non-cyclic tree structure, then the diameter path of the tree is solved by two width-first traversals, and the diameter path is used as the main seam line.

[0032] If the central axis skeleton has a ring-shaped branch due to the presence of holes in the overlapping area, then the endpoint pairs that cross the overlapping area are identified, the path between the endpoint pairs is extracted using the minimum cost path algorithm as the main seam line, and a penetration check is performed after extraction.

[0033] In one implementation example, after step S5, a geographic coordinate mapping step is also included:

[0034] Based on the affine transformation parameters or rational polynomial coefficient model in the georeferenced model, the seam lines in the full-map pixel coordinate system are mapped to the geographic coordinate system or the projected coordinate system, and the seam line vector data file containing geographic coordinates or projected coordinates is output according to the preset vector format.

[0035] In one implementation example, after step S1, there is also an automatic identification and processing step for overlapping regions of multiple connected systems:

[0036] Based on the directed area and spatial inclusion relationship of each sub-path in the vertex of the vector boundary polygon, the overlapping region is automatically determined to be either a first case of a single patch containing an internal hole or a second case of containing at least two mutually separated overlapping patches.

[0037] When the first case is identified, the outer contour and the corresponding inner contours of all holes are placed in the same local mask in the same local operation area. A multi-connected mask is formed by filling once, and the seam line extraction operation and coordinate restoration are performed based on the multi-connected mask.

[0038] When the second case is identified, an axis-aligned bounding rectangle is determined for each independent patch, a local mask is constructed, and seam line extraction and coordinate restoration are performed. Each patch completes coordinate translation transformation based on the coordinate offset of the upper left corner of its corresponding local operation region, and the seam line of each patch is output independently.

[0039] In one implementation example, the preset margin ranges from 1 to 5 pixels, which, combined with the neighborhood range setting of the thinning algorithm, satisfies... ;

[0040] in, This indicates the rounding up operation, where n is the size of the structuring element used in the morphological preprocessing, and pad is the preset margin.

[0041] In one implementation example, the local mask uses an 8-bit single-byte binary storage format, or a 1-bit bitmap storage format when hardware memory is limited.

[0042] The technical solution of this invention has one or more of the following beneficial technical effects:

[0043] (1) By obtaining the vector boundary of the overlapping area and dynamically calculating the axis-aligned outer rectangle that fits the overlapping area, a local mask is constructed only within the scope of this outer rectangle, and the seam line extraction operation is performed. This decouples the computational overhead from the overall size of the original image to only the size of the overlapping area. This reduces the computation time and peak memory usage, and solves the problem of processing interruption caused by memory overflow in traditional full-image masking operations in ultra-large format images.

[0044] (2) By translating the vector boundary vertices to the local coordinate system for mask construction and extraction, and then using a strictly symmetrical linear translation transformation to translate the extracted results back to the full-image pixel coordinate system of the original image, only the addition and subtraction of coordinate offsets are involved, avoiding rotation, scaling, or pixel-level interpolation resampling. This ensures that the local seam line extraction results are completely geometrically equivalent to the full-image scale calculation results, ensuring the lossless geometric accuracy of the seam lines.

[0045] (3) By automatically adjusting the size and position of the bounding rectangle based on the extreme values ​​of the vector polygon vertices, and setting adaptive outer margins and boundary clamping rules, the calculation window can dynamically fit the overlapping area of ​​any position and shape without the need for a preset fixed clipping window. This avoids the problem of incomplete seam lines due to the fixed window being too small and the boundary being cut off, or the window being too large and retaining invalid areas. It also has strong robustness and engineering reliability in extreme scenarios such as narrow strips, edge areas, and high proportion areas.

[0046] Furthermore, other beneficial effects of the present invention will be mentioned in the specific embodiments. Attached Figure Description

[0047] Figure 1 This is a flowchart illustrating the overall implementation of one embodiment of the present invention;

[0048] Figure 2 This is a comparison of memory usage and time consumption for full-image computation and local computation in one embodiment of the present invention. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0050] To facilitate a clear description of the technical solutions in the embodiments of the present invention, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order.

[0051] In this invention, the term "geographic reference" refers to the process and result of establishing a precise mapping and transformation relationship between the pixel space of remote sensing images and the real Earth geographic coordinate system; specifically, it enables each pixel in the original image to have its corresponding ground geographic coordinates (X, Y) calculated through a transformation model. The transformation model typically refers to the affine transformation parameters or rational polynomial coefficient (RPC) model carried in the geographic information file.

[0052] In this invention, the term "seam line result" refers to a vector data file containing a list of actual coordinate points in a geographic coordinate system or projected coordinate system, obtained by mapping the seam line extracted by the method of this application in the image pixel coordinate system to geographic coordinates. The seam line result can be encapsulated and output using a preset vector file format, such as Shapefile, GeoJSON, or KML / KMZ formats.

[0053] This invention discloses a method for extracting image seam lines, specifically a method based on local operations of the bounding rectangle of vector boundaries, primarily applied to mosaicking of large-format overlapping remote sensing images. This method aims to address the problems of existing regional centerline extraction techniques, such as high computational overhead during full-image processing, the inability of fixed clipping windows to adaptively fit overlapping areas, and the lack of a strict coordinate restoration mechanism in local operations leading to positioning errors. The method involves obtaining and pre-normalizing the vector boundaries of the overlapping areas, dynamically calculating the minimum axis-aligned bounding rectangle to fit the overlapping areas based on the boundary vertices, constructing a local mask only within the bounding rectangle, and performing seam line extraction operations such as morphological preprocessing, centerline thinning, skeleton pruning, and longest master path extraction within this local mask. Finally, symmetrical coordinate translation and restoration operations accurately restore the seam lines to the full-image coordinate system. The above scheme utilizes a strict symmetric linear translation transformation to decouple the computational cost from the entire original image area to only the area of ​​the bounding rectangle of the overlapping region, while ensuring that the local calculation results are completely equivalent to the full image calculation results (without loss of geometric accuracy). This significantly reduces the computation time and memory usage.

[0054] The implementation process of the present invention will be described in detail below with reference to a specific embodiment:

[0055] Figure 1 This is a flowchart illustrating the overall implementation of one embodiment of the present invention. Figure 1 As shown, the specific execution steps of this invention are as follows: First, step S1 is executed to obtain the vector boundary polygon vertices of the overlapping area of ​​the remote sensing image, and optionally, pre-normalization processing is performed. In step S1, the coordinates of the polygon vertices describing the boundary of the overlapping area are obtained. This boundary can be obtained by pre-processing methods such as layer transparency intersection or selection-to-path conversion. The vertex coordinates are located in the original image pixel coordinate system and are stored in floating-point type to retain sub-pixel accuracy; if the boundary comes from geographic coordinate system vector data (such as Shapefile), it is first transformed to the pixel coordinate system through the inverse transformation of image georeferenced affine transformation. All vertices are organized according to sub-paths, and each sub-path is closed at both ends and has no less than 3 vertices.

[0056] To ensure the accuracy of subsequent bounding rectangle calculations and the correctness of mask filling, pre-verification and preprocessing are performed on the boundary vertices in sequence: First, redundant vertices are removed by deleting adjacent duplicate vertices (e.g., vertices with a spacing of less than 0.01 pixels) and collinear redundant vertices (e.g., vertices whose distance to the line connecting their preceding and following vertices is less than 0.1 pixels); then, self-intersection detection and repair are performed, using the line segment intersection method to detect the self-intersection of sub-paths. If a self-intersection is detected, it is split and recombined into several simple polygons at the intersection point, equivalent to a polygon self-union Boolean operation, ensuring that each sub-path is a simple polygon without self-intersection; next, topology verification is performed to verify the closure of sub-paths and the minimum number of vertices, and to remove tiny debris sub-paths with an area less than a set threshold (e.g., 16 square pixels); finally, the wrapping direction is normalized by using the shoelace formula to calculate the directed area of ​​each sub-path, unifying the outer contour to a counterclockwise wrapping direction and the inner contour of the hole to a clockwise wrapping direction, providing a standardized input basis for subsequent mask filling and multi-connected scene determination.

[0057] After completing the boundary normalization described above, step S2 is executed. Based on the vertices of the vector boundary polygon, the axis-aligned bounding box (AABB) that fits the overlapping area of ​​the remote sensing image is determined, thus obtaining the local computation region. In step S2, the axis-aligned bounding box (AABB) is dynamically calculated from the boundary vertices, and the margins and clamping boundaries are expanded. Specifically, all polygon vertices are first traversed to obtain their extreme values ​​(minimum / maximum coordinates: x) in the horizontal and vertical directions. min y min x max y max This allows us to determine the coordinate range of AABB, which is located in the overlapping area.

[0058] During execution, the construction of AABB only requires a single (minimum / maximum) scan of the original vector vertices, without the need for pre-constructing the convex hull or performing complex rotation transformations. Furthermore, since the boundaries of AABB are naturally aligned with the row and column coordinates of the raster image, storage space can be directly allocated according to this rectangular range when constructing the local mask. This avoids boundary errors and additional computational overhead introduced by interpolation and resampling during coordinate system transformations (for example, rotating the minimum bounding rectangle requires first calculating the convex hull and then performing the rotation caliper, which increases the time complexity linearly and logarithmically compared to AABB; and mask rasterization under rotated coordinate systems requires interpolation and resampling, introducing boundary errors and significantly increasing implementation complexity). In addition, considering that overlapping areas in actual remote sensing images are usually distributed along the image edges, their shapes are often strip-shaped or approximately distributed along the coordinate axes, defining the computational region using AABB can fit the overlapping area with a low vacancy rate, effectively simplifying the preprocessing stage and ensuring that local operations maintain computational efficiency while ensuring good fit.

[0059] Then, the AABB is extended outward by pad pixels (pad refers to the outward margin) to ensure the neighborhood integrity of subsequent morphological and thinning operations at the rectangular boundary. The value of the outward margin pad corresponds to the maximum neighborhood radius of subsequent operations. Assuming the size of the subsequent morphological structuring element is n×n and the thinning algorithm neighborhood is 3×3, then pad must satisfy... ,in This indicates a rounding up operation, where n represents the size of the structuring element used in the morphological preprocessing, and pad represents the preset margin. The preferred range for pad is 1 to 5 pixels; in this embodiment, it is set to 3 pixels by default (corresponding to a 3×3 structuring element). (Add another 1 pixel margin).

[0060] Finally, the boundary clamping rules are executed. Let the original image width be W and the height be H. The coordinates (x0, y0, x1, y1) of the four sides of the expanded rectangle are uniformly clamped as follows:

[0061] x0=max(0, x min -pad);

[0062] y0=max(0, y min -pad);

[0063] x1=min(W﹣1, x max + pad);

[0064] y1=min(H﹣1, y max + pad).

[0065] When the overlapping region is close to the right or bottom boundary of the image, resulting in insufficient outward expansion on one side, subsequent morphological and thinning operations process it by extending it with invalid values ​​of 0 at the local mask boundary, so that the overlapping region naturally terminates at the boundary without producing a pseudo-response. Thus, the circumscribed rectangle can be dynamically calculated through the boundary vertices to adaptively fit overlapping regions of arbitrary position and shape.

[0066] After obtaining the circumscribed rectangle, i.e., the local computation region, step S3 is executed to translate the vertices of the vector boundary polygon from the global pixel coordinate system of the original image to the local coordinate system of the local computation region. In step S3, the coordinate offset of the upper left corner of the circumscribed rectangle, i.e., the coordinate offset of the upper left corner of the local computation region, i.e., the coordinates (x0, y0) corresponding to the upper left corner of the local computation region, is uniformly subtracted from the coordinates of each obtained polygon vector vertex, so that all vertices are translated from the original global pixel coordinate system to the local coordinate system based on the circumscribed rectangle.

[0067] Then, proceed to step S4, where a local mask is constructed within the local computation area, and seam extraction is performed based on the local mask to obtain the seam line in the local coordinate system. In the local mask construction stage of step S4, the local mask is constructed only within the local computation area. First, according to the AABB size determined in step 2, corresponding blank storage space is allocated in computer memory to generate the local mask. In this embodiment, an 8-bit single-byte binary storage format is preferably used, where the effective area is assigned a value of 255 and the invalid area is assigned a value of 0. Under this storage format, its memory usage is reduced to the ratio of the area of ​​the circumscribed rectangle to the area of ​​the entire image, effectively reducing the redundant overhead caused by storing the entire image canvas. Furthermore, compared to 1-bit bitmap storage, single-byte address-based access eliminates bitwise operation overhead, facilitating Single Instruction Multiple Data (SIMD) vectorization and table lookup acceleration operations, making it a preferred implementation that balances memory usage and access efficiency. Meanwhile, under specific hardware conditions with extremely limited memory, a 1-bit bitmap storage format can also be used as an alternative, which can further reduce memory usage by about 8 times. This variant is also within the scope of protection of this invention.

[0068] Subsequently, a scan-line filling algorithm combined with an even-odd rule is used to rasterize and fill the polygon in the local coordinate system. Specifically, for each scan line of the local mask, the intersection points of the scan line and all sub-path edges are calculated, the intersection points are sorted by their x-coordinates, and the segments between adjacent intersection point pairs are assigned a valid value of 255. Under this even-odd rule, the number of times the outer contour and the inner contour of the hole are covered alternately is odd and even, and a multi-connected mask with valid outer contours and invalid holes can be naturally formed without additional differentiation of hole paths. Alternatively, a non-zero winding rule can be used instead, which is combined with the counterclockwise direction of the outer contour and the clockwise direction of the holes in step S1, and the resulting mask is consistent with the even-odd rule.

[0069] During rasterization scanning, this implementation does not perform rounding preprocessing on floating-point vertex coordinates. Instead, it uses the pixel center coordinates (i+0.5, j+0.5) as the sampling point for nearest neighbor inclusion judgment (pixel center / nearest neighbor sampling), where i represents the pixel row number in the local coordinate system and j represents the pixel column number in the local coordinate system. No anti-aliasing is performed, ensuring that the deviation between the local mask boundary and the vector boundary is strictly controlled within 0.5 pixels. Based on the aforementioned pixel center sampling rule and the determinism of coordinate translation, the generated local mask is completely consistent pixel-by-pixel with the mask obtained by rasterization within the same corresponding area on the full-image canvas according to the exact same rules. This is the core premise for the geometric equivalence of subsequent local calculation results and full-image mask calculation results. Under this setting, all subsequent seam line extraction operations will be strictly limited to this local mask. The data scale involved in the operation is determined only by the area of ​​the bounding rectangle of the overlapping area, completely decoupled from the overall size of the original image, thereby achieving a significant reduction in memory usage and computation time.

[0070] After the local mask construction is completed (i.e., after the mask construction sub-step in step S4), the seam line extraction operation in step S4 is executed, and the seam line extraction operation is performed on the local mask. All sub-algorithms involved in step S4 are well-known algorithms in the field, and this invention does not improve the thinning, path search, or other sub-algorithms themselves. This invention strictly confines the entire algorithm chain to the small-sized local mask obtained in steps S2 to S3, achieving decoupling of computational overhead from the overall size of the original image.

[0071] In this embodiment, the complete extraction process is as follows: First, morphological preprocessing is performed. A closing operation (dilation followed by erosion) is applied to the local mask using a 3×3 square all-1 structuring element to fill the tiny holes and slits inside the mask. Then, an opening operation (erosion followed by dilation) is performed using the same structuring element to remove boundary burrs and isolated noise points. The core function of this preprocessing is to prevent the formation of ring-shaped skeletons due to tiny holes or pseudo-branches due to boundary burrs in the subsequent refinement stage. The shape and size of the structuring element can be flexibly selected according to the mask noise level (e.g., 3×3 or 5×5 square structuring elements), and the size of the structuring element needs to be linked with the outer margin pad in step S2 (n×n structuring elements correspond to...). ).

[0072] After preprocessing, single-pixel-width central axis thinning is performed using the Zhang-Suen parallel thinning algorithm, which alternately executes two sub-iterations. Deletable contour pixels are deleted in parallel based on neighborhood connectivity and boundary conditions until no pixels are deleted in a complete iteration, resulting in an 8-connected and single-pixel-width central axis skeleton. The thinning step can also be replaced by Guo-Hall thinning or central axis extraction based on distance transformation, which does not deviate from the localization architecture of this invention.

[0073] After obtaining the central skeleton, the skeleton graph is constructed and the main path is extracted: First, the graph structure is constructed using skeleton pixels as nodes and 8-adjacency relationships as edges. The edge weight is the Euclidean distance between pixel centers (horizontal / vertical adjacency is 1, diagonal adjacency is 0). The nodes are then classified according to their adjacency degree: nodes with a degree of 1 are endpoints, and nodes with a degree of 3 or higher are branching points. Short branch pruning is then performed, backtracking from each endpoint along the skeleton to the nearest branching point to obtain dangling branches, iteratively deleting paths with a length less than a threshold L. min Suspension branch (L) min The larger of 10 pixels and 5% of the total skeleton length can be used. After each round of deletion, the endpoints and branching points are recalculated until no branches remain to be deleted, thus eliminating pseudo-branches derived from burrs. Then, the longest main path is extracted. For the pruned acyclic tree skeleton, a two-step breadth-first traversal is used to calculate the tree diameter: first, search for the endpoint *u* furthest from any endpoint, then search for the endpoint *v* furthest from *u*. The path from endpoint *u* to endpoint *v* is the longest main path, serving as the main seam line. If the skeleton contains loops due to interconnected holes, a pair of endpoints crossing the overlapping area is first determined (selecting the endpoint pair with the furthest distance from the local mask's effective boundary (less than *pad+2* pixels) along the skeleton). Then, the minimum cost path between these endpoints is calculated using Dijkstra's algorithm as the main seam line. After extraction, a penetration check is performed. If the main path does not penetrate to the boundary neighborhood, the endpoint pair is reselected and extracted to ensure the seam line penetrates the entire overlapping area.

[0074] Finally, the main path is smoothed and simplified. First, the vertex sequence of the main path is smoothed. A sliding average smoothing with a window width of 5 (i.e., one-dimensional box filtering) or a one-dimensional Gaussian smoothing with a standard deviation of 1.5 can be used. The normal component of the smoothed displacement of each point is limited to within 1 pixel to prevent the path from deviating from the overlapping area. Then, the Douglas-Peucker algorithm is used for simplification, with a distance tolerance of 1.0 to 2.0 pixels. While maintaining the geometric shape, the number of vertices is compressed, and the final output is the seam line vertex coordinate sequence in the local coordinate system.

[0075] After obtaining the seam line in the local coordinate system, step S5 is executed to translate the seam line in the local coordinate system back to the global pixel coordinate system of the original image, and output the seam line in the global pixel coordinate system. That is, the coordinate offset is restored to the global coordinate system and further mapped to the geographic coordinate system. Specifically, pixel coordinate restoration is first performed by adding the coordinates (c′, r′) of each point of the seam line in the local coordinate system back to the offset (x0, y0) of the upper left corner of the circumscribed rectangle obtained in step S2 to obtain the global pixel coordinates:

[0076] (c, r) = (c′+x0, r′+y0);

[0077] Where c and r are the column and row coordinates in the full-image pixel coordinate system, respectively, c′ and r′ are the column and row coordinates in the local coordinate system, respectively, and x0 and y0 are the offsets of the top left corner of AABB in the full-image pixel coordinate system, thus ensuring that the seam line correctly corresponds to the position of the original image.

[0078] If the original imagery contains georeferences, such as affine six-parameter [X0, A] in GeoTIFF format... x B x ; Y0, A y B y Then, the pixel coordinates of the entire image are further mapped to projected / geographic coordinates (X, Y), and the mapping relationship is as follows:

[0079] X = X0 + c·A x + r·B x ;

[0080] Y = Y0 + c·A y + r·B y ;

[0081] Where X0 and Y0 are the geographic coordinates corresponding to the top left pixel of the image, and A x B y The ground resolution in the horizontal and vertical directions, respectively, B x A y This represents the image rotation coefficient.

[0082] For satellite imagery using the Rational Polynomial Coefficients (RPC) model, forward mapping is performed using RPC. The mapped seam lines can be output in vector formats such as Shapefile and GeoJSON and directly incorporated into the mosaic project.

[0083] In step S5, the process of restoring the seam line coordinates from the local coordinate system to the global pixel coordinate system is the inverse operation of the coordinate translation operation in step S3. The two constitute a strictly symmetrical linear translation transformation. This transformation only involves algebraic addition and subtraction of coordinate values ​​and does not introduce any rotation, scaling, or interpolation resampling processing. Therefore, theoretically, the coordinate restoration process itself will not produce additional pixel-level positional deviations. Based on the strict symmetry of this geometric transformation, this embodiment also includes a corresponding accuracy verification step: for the same overlapping area, the seam line can be extracted using both traditional global masking and the local masking operation described in this invention, and the Hausdorff distance and maximum per-vertex deviation between the two seam line polygons can be calculated respectively. According to the properties of the above-mentioned symmetrical linear translation transformation, the calculated geometric deviation between the polygons should be 0 pixels, thereby verifying that the localization operation of this invention can ensure that the final output accuracy is completely equivalent to the global operation without changing the geometric extraction result of the seam line.

[0084] To address the issue of interconnected overlapping regions that may arise during actual remote sensing image mosaicking, such as holes formed by cloud cover or the removal of effective areas within the overlapping region, or multiple separate effective overlapping patches, this embodiment, based on steps S1 to S5, further includes an automatic identification and differentiation process for interconnected overlapping regions. This process first identifies the scene based on the normalized topological information from step S1: the directed area of ​​each sub-path is calculated using the shoelace formula, and the sub-path type is determined based on the sign of the directed area; counter-clockwise encircling sub-paths are identified as candidate outer contours, and clockwise encircling sub-paths as candidate inner contours. Subsequently, a spatial inclusion relationship test is performed using the ray casting method. If a clockwise encircling sub-path is located inside a counter-clockwise outer contour, the sub-path is identified as the inner contour of a hole contained within that outer contour; conversely, if the outer contours do not contain each other, they are identified as multiple independent separate overlapping patches. The entire identification process is automatically completed based on geometric calculations, requiring no manual intervention.

[0085] Based on the above discrimination results, this embodiment executes corresponding processing strategies. For the first case where a single overlapping patch contains internal holes, the discerned outer contour and all inner contours belonging to the outer contour are assigned to the same local mask space within the same bounding rectangle. A filling is performed once according to the scan line parity rule in step S3 above, thus obtaining a multi-connected mask where the inner region of the outer contour has valid values ​​and the inner region of the inner contour has invalid values. If the skeleton exhibits a ring-shaped branch due to the hole structure in the subsequent refinement step, the Dijkstra minimum cost path algorithm for the ring-shaped skeleton in step S4 is executed to ensure the accurate penetration of the main seam line. For the second scenario with multiple separated and overlapping patches, the bounding rectangles of each independent patch, along with its respective inner contour, are calculated separately, local masks are constructed separately, and the seam line extraction process in step S4 and the coordinate restoration operation in step S5 are executed independently. The seam lines of each patch are output independently. By adopting the scheme of processing independent patches separately, the computational redundancy caused by including the blank and invalid areas between the separated patches into the same unified bounding rectangle can be effectively avoided. This ensures that the computational data scale of each patch is only directly related to the effective size of each patch itself, thereby further reducing the overall computational cost.

[0086] Through the above-described adaptive processing for the overlapping regions of multi-connected areas, the seam line extracted in this embodiment has a completely consistent geometric topological relationship with the seam line extracted by performing equivalent calculations directly on the full-map canvas. It does not introduce any positioning deviation caused by local processing, ensuring the strict equivalence of the final seam line result in geometric accuracy and the reliability of engineering applications.

[0087] The benchmark conditions for this performance comparison are as follows: Intel Core i7-12700 CPU, 32 GB RAM, Windows 10 64-bit operating system, C++ plugin implementation in Adobe Photoshop 2025 environment; masks are stored in 8-bit single-byte format; single-threaded execution except for image reading and writing; execution time is the average of 10 consecutive runs, and memory usage is the percentage of the process's peak working set to the total system memory.

[0088] Figure 2 This is a comparison of memory usage and time consumption for full-image computation and local computation in one embodiment of the present invention. For example... Figure 2 As shown, this embodiment uses a large-format image with a pixel size of 53562×54268 as the test object to compare the traditional full-image masking operation (hereinafter referred to as full-image operation) and the local masking operation of the present invention (hereinafter referred to as local operation) in terms of two core indicators: memory usage and operation time. Figure 2The bar chart on the left visually illustrates the memory usage: when using traditional full graph operations, the peak working set memory usage of the process reaches 71% of the total system memory; however, after adopting the localization processing method proposed in this invention, this value drops significantly to 17%, which is only about a quarter of the original usage. Figure 2 The bar chart on the right further compares the computation time: it takes 33 seconds to complete the seam extraction for the entire image, while the local computation only takes 1.5 seconds, achieving a computation speedup of approximately 22 times.

[0089] To fully verify the adaptability of the method of this invention under different data scales and scenarios, this embodiment conducted multiple sets of image comparison experiments with different image sizes and different overlap ratios under unified test benchmark conditions, the same algorithm chain (morphological preprocessing, Zhang-Suen thinning, skeleton pruning and longest path extraction, smoothing simplification) and the same parameter configuration, using "full-image masking operation" and "local masking operation" as the only variables. Experimental data show that for medium-sized images with a pixel size of 26505×25378 (overlap ratio of approximately 12%), memory usage decreased from 29% to 18%, and processing time decreased from 7.6 seconds to 0.9 seconds, an acceleration of approximately 8.3 times; while for small-sized images with a pixel size of 12800×11600 (overlap ratio of approximately 58%), memory usage decreased from 19% to 18%, and processing time decreased from 1.7 seconds to 1.0 seconds, an acceleration of approximately 1.7 times.

[0090] As can be seen from the above sets of comparative data, the computational speedup of this invention is inversely proportional to the overlap area ratio. The lower the overlap area ratio and the larger the image area, the more significant the performance gain brought by localization. Furthermore, even under the extreme condition of an overlap area ratio as high as 58%, the computation time and memory overhead of this method are still not inferior to conventional full-image computation, fully verifying that this method has good degradation safety. At the same time, combined with the coordinate symmetric translation and restoration mechanism described above in this embodiment, the two seam lines obtained by performing full-image computation and local computation respectively for the same overlap area have a Hausdorff distance and a maximum per-vertex deviation of 0 pixels, proving that this invention achieves strict equivalence of accuracy without changing the geometry of the seam line.

[0091] Furthermore, this method exhibits stable robustness in four typical extreme scenarios: First, in overlapping regions with narrow strips less than 50 pixels wide, the circumscribed rectangle degenerates into a thin rectangle, the computational chain remains normal, and the seam lines are correctly connected; second, in overlapping regions close to the image boundary, the four-sided clamping rules take effect, there are no out-of-bounds accesses, and the seam lines are correctly extracted; third, in multi-connected overlapping regions containing multiple holes, the odd-even fill rule can correctly generate the mask, and the loop skeleton processing logic runs normally; fourth, in scenarios where the overlapping region accounts for a high proportion of the entire image (e.g., greater than 50%), the localization benefit decreases as the proportion increases, but the computational cost is not inferior to full-image mask computation, and the method has degradation safety. It can guarantee correct mask construction and complete seam line connection in all scenarios, demonstrating strong engineering practical value.

[0092] To better illustrate the present invention, numerous specific details have been provided in the detailed embodiments described above. Those skilled in the art should understand that the present invention can be practiced even without certain specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of the present invention.

[0093] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for extracting image seam lines, characterized in that, include: Step S1: Obtain the vertices of the vector boundary polygon of the overlapping area of ​​the remote sensing image; Step S2: Based on the vertices of the vector boundary polygon, determine the axis-aligned circumscribed rectangle that fits the overlapping area of ​​the remote sensing image, thus obtaining the local computation region, specifically including: Traverse all the vertices of the vector boundary polygon, obtain the minimum and maximum coordinates in the horizontal and vertical directions, and determine the axis-aligned circumscribed rectangle; The axis-aligned circumscribed rectangle is extended outward by a preset margin, and the boundary of the extended circumscribed rectangle is clamped according to the size of the original image to obtain the local computation area; Step S3: Translate the vertices of the vector boundary polygon from the full-image pixel coordinate system of the original image to the local coordinate system of the local computation region; Step S4: Construct a local mask within the local computation area, and perform seam line extraction operation based on the local mask to obtain the seam line in the local coordinate system; The construction of a local mask within the local computation region specifically includes: Allocate local storage space corresponding to the size of the local computation region and store it in a binary format; Using the pixel center as the sampling point, a scan line filling algorithm is used in conjunction with odd-even rules or non-zero wrapping rules to perform nearest neighbor inclusion judgment and rasterization filling on the vertices of the polygon translated to the local coordinate system. The seam line extraction operation based on the local mask includes: Morphological preprocessing is performed on the local mask; Perform a central thinning operation on the preprocessed local mask to extract the central skeleton with a single pixel width; A graph structure is constructed based on the node adjacency of the central skeleton, short branch pruning is performed, and the longest main path is extracted as the main seam line. The main seam line is smoothed and simplified, and the seam line in the local coordinate system is output. Step S5: Translate the seam line in the local coordinate system back to the full-image pixel coordinate system of the original image, and output the seam line in the full-image pixel coordinate system; The translation to the local coordinate system and the translation back to the global pixel coordinate system constitute a symmetrical linear translation transformation, which only involves the addition and subtraction of coordinate offsets.

2. The image seam extraction method according to claim 1, characterized in that, Step S3 specifically includes: Subtract the top-left corner coordinate offset of the local computation region in the full-image pixel coordinate system of the original image from the vertex coordinates of the vector boundary polygon; Step S5 specifically includes: adding the coordinates of the seam line in the local coordinate system to the offset of the upper left corner of the local operation area in the full-image pixel coordinate system of the original image.

3. The image seam extraction method according to claim 1, characterized in that, The short branch pruning includes: Hanging branches are obtained by tracing back along the central axis skeleton from each endpoint to the nearest fork point. Hanging branches with a path length less than a preset path length threshold are deleted. After each round of deletion, the endpoints and forks are recounted, and the iteration is repeated until no branches can be deleted.

4. The image seam extraction method according to claim 1, characterized in that, The step of extracting the longest main path as the main seam line includes: If the central skeleton after pruning is a non-cyclic tree structure, then the diameter path of the tree is solved by two width-first traversals, and the diameter path is used as the main seam line. If the central axis skeleton has a ring-shaped branch due to the presence of holes in the overlapping area, then the endpoint pairs that cross the overlapping area are identified, the path between the endpoint pairs is extracted using the minimum cost path algorithm as the main seam line, and a penetration check is performed after extraction.

5. The image seam extraction method according to claim 1, characterized in that, Following step S5, a geographic coordinate mapping step is also included: Based on the affine transformation parameters or rational polynomial coefficient model in the georeferenced model, the seam lines in the full-map pixel coordinate system are mapped to the geographic coordinate system or the projected coordinate system, and the seam line vector data file containing geographic coordinates or projected coordinates is output according to the preset vector format.

6. The image seam extraction method according to claim 1, characterized in that, Following step S1, the system also includes steps for automatically identifying and processing overlapping regions of multiple connected systems. Based on the directed area and spatial inclusion relationship of each sub-path in the vertex of the vector boundary polygon, the overlapping area is automatically determined to be either a first case of a single patch containing an internal hole or a second case of containing at least two mutually separated overlapping patches. When the first case is identified, the outer contour and the corresponding inner contours of all holes are placed in the same local mask in the same local operation area. A multi-connected mask is formed by filling once, and the seam line extraction operation and coordinate restoration are performed based on the multi-connected mask. When the second case is identified, an axis-aligned bounding rectangle is determined for each independent patch, a local mask is constructed, and seam line extraction and coordinate restoration are performed. Each patch completes coordinate translation transformation based on the coordinate offset of the upper left corner of its corresponding local operation region, and the seam line of each patch is output independently.

7. The image seam extraction method according to claim 1, characterized in that: The preset margin ranges from 1 to 5 pixels. Combined with the neighborhood range setting of the thinning algorithm, it satisfies pad≥⌈n / 2⌉+1. Where ⌈·⌉ represents the rounding up operation, n is the size of the structuring element used in the morphological preprocessing, and pad is the preset margin.

8. The image seam extraction method according to claim 1, characterized in that: The local mask uses an 8-bit single-byte binary storage format, or a 1-bit bitmap storage format when hardware memory is limited.

Citation Information

Patent Citations

  • Satellite image optimal mosaic line generation method based on feature library intelligent decision

    CN112669459A

  • Incremental panoramic image splicing method and system based on cylindrical projection and multi-stage deep learning

    CN121921172A