An automatic fusion method for large-scale tile maps
Through image segmentation model and registration technology, the automated fusion of large-scale segmented maps is achieved, which solves the problem of time-consuming and labor-intensive manual processing in the existing technology, improves splicing efficiency and accuracy, and supports multi-field applications.
Patent Information
- Application Number
- CN202411664879.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The use of large-scale segmented maps in the prior art is difficult, requiring manual scanning and processing, which makes it time-consuming and labor-intensive and difficult to meet the usage standards.
Image segmentation model training and registration technology are used to automatically extract and splice the segmented map area, and the deformation is corrected through computer vision technology to achieve automatic fusion of segmented maps.
The splicing process of segmented maps has been significantly simplified, and the splicing efficiency has been improved. The map area extraction accuracy has reached 98.63%, and the splicing accuracy has reached 96%, supporting the application of urban planning, historical research and cultural protection in fields.
Smart Images

Figure CN119515678B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of surveying and mapping technology, and in particular relates to an automatic fusion method for large-scale segmented maps. Background Art
[0002] In the last century and the early 21st century, maps were produced entirely on paper. Due to limitations in map size, maps of larger, higher-resolution scenes could only be produced in separate paper sheets. These historical map data hold significant research significance and practical value in key areas such as urban planning iteration, urban history research, cultural heritage preservation, and natural resource rights confirmation.
[0003] However, currently, utilizing these maps is extremely difficult. First, paper map frames must be scanned to create electronic images, which are then manually processed and aligned to create usable electronic images. Due to the sheer volume of framed maps and the cumbersome manual image processing process, processing map images is often time-consuming and labor-intensive, and rarely meets usability standards. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a large-scale automatic fusion method of segmented maps that overcomes the above problems or at least partially solves the above problems.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A large-scale automatic fusion method for map tiles, comprising the following steps:
[0007] S1. Train the image segmentation model to extract and segment the map area;
[0008] S2, registering the graphic area calibrated by the image segmentation model to restore it to a map image of a standard sheet;
[0009] S3. Determine the position order of different sub-frames in the full-frame map, and stitch a large number of sub-frames together to form the full-frame map.
[0010] Optionally, step S1 includes:
[0011] Select image segmentation model;
[0012] Prepare map image datasets in the surveying and mapping field;
[0013] Train an image segmentation model.
[0014] Optionally, preparation of map image datasets in the surveying and mapping field includes:
[0015] Collect and select tile maps for manual labeling of label images;
[0016] Mark the map area by selecting the vertices at the edge of the map area, and then obtain the label image through binarization processing;
[0017] The number of full-scale maps is expanded through the dataset augmentation method, and the dataset is divided into training and test sets according to the proportion. The image segmentation model is trained based on the dataset.
[0018] Optionally, map area extraction uses the original image as input, and the trained image segmentation model network outputs a binary mask of the image. Map area extraction and restoration are performed based on the binary mask, specifically including:
[0019] Use cv2.findcounters() function to extract the boundary vertices of the mask;
[0020] Use cv2.approxPolyDP() function to approximate the boundary polygon and reduce the number of vertices. The parameter epsilon is set to 0.01 times the boundary perimeter. The return value is the approximate vertex closed set, denoted as N = {n1,n2,…,n i ,…n |N|};
[0021] Use the cv2.minAreaRect() method to calculate the minimum bounding rectangle of the vertex set, and classify the vertex set into four categories according to the distance between the vertex and the four sides of the outer rectangle. The obtained N1, N2, N3, and N4 represent the corresponding point sets of the four sides of the approximate quadrilateral respectively.
[0022] Use the RANSAC algorithm to fit four straight line equations l1, l2, l3, l4 to the four point sets N1, N2, N3, N4 respectively, and calculate the intersection of the lines to obtain the vertices d1, d2, d3, d4 of the quadrilateral area;
[0023] For vertex n i , its projection point on the corresponding straight line is n i ′, so that the vertex vector [n1,n2,...,n |N| ]The projection vector on the quadrilateral is [n1′, n2′, ..., n |N| ′], use cv2.getPerspectiveTranfrom() function to calculate the projection matrix and use cv2.warpPerspective() function to perform projection transformation on the original image to map the map area to the quadrilateral area;
[0024] Let h and w be the height and width of the standard rectangular map sheet. For the vertex matrix [d1, d2, d3, d4] of the quadrilateral, calculate its projection matrix mapped to the standard map sheet matrix [[0, 0], [w, 0], [w, h], [0, h]], and perform projection transformation to map the map area onto the standard rectangular map sheet, so that the original image is restored to a map image in the standard map sheet style.
[0025] Optionally, the graphic area calibrated by the image segmentation model is registered through a map image restoration algorithm, and the mapping relationship between the edge vertices of the segmented map image and the standard map sheet is described. Computer vision technology is used to perform graphic transformation to correct the impact of deformation on the map area.
[0026] Optionally, step S3 includes:
[0027] According to the similarity law of pixels on the adjacent edges of two adjacent sub-images, an algorithm is designed to describe the similarity relationship between the boundaries of different sub-images;
[0028] The similarity is measured, and based on the similarity, candidate adjacent edges are determined. Rules are designed to determine the final adjacency relationship of the sub-images, and the splicing and fusion of all the sub-images are completed.
[0029] Optionally, the splicing of the sub-frames is based on the automatic fusion of edge features, specifically including:
[0030] For the adjusted standard map, the image pixels with a width of one pixel on each of the four sides are intercepted as edge vectors. For the horizontal and vertical edges of the frame i, we get Represent the edge vectors of the top, bottom, left and right sides respectively;
[0031] For frame i and frame j, the upper boundary edge vector is calculated by the dynamic time warping algorithm and the lower boundary edge vector The minimum regularization distance is denoted as and the left boundary edge vector and the right boundary edge vector The minimum regular distance between The distance metric is Manhattan distance;
[0032] For the upper boundary of tile i, select The corresponding edge of the corresponding sub-graph j is taken as the candidate adjacent edge, and The score of the candidate adjacent edge pair is used to measure the similarity between the two edges. Similarly, the candidate adjacent edges and similarity of each edge can be found.
[0033] For an m×n image combination, there should be m(n-1)n(m-1) pairs of adjacent edges. According to the scores of each adjacent edge pair from high to low, m(n-1)+n(m-1) adjacent edge pairs that do not conflict are selected as the final adjacent edges and the splicing and fusion of the image segments are performed to complete the automatic fusion of the full image.
[0034] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0035] 1. This invention achieves automated fusion of tiled maps in large-scale scenarios. This automation significantly simplifies the tiled map splicing process, reduces manual work, saves manpower, and significantly improves splicing efficiency. During the map region extraction and segmentation steps, the mean Intersection Over Union (MIoU) of the segmented map regions reached 98.63%, effectively developing a map image segmentation model suitable for surveying and mapping.
[0036] 2. This invention achieves a 96% accuracy rate for map stitching based on anchor point statistics, significantly improving stitching quality and map usability. This technology has broad application prospects in key areas such as urban planning iteration, urban history research, cultural heritage protection, and natural resource rights confirmation, providing an effective tool to better support urban development. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flowchart of a large-scale segmented map automatic fusion method provided in an embodiment of the present application;
[0038] Figure 2 This is a schematic diagram of the label image of an embodiment of the present application;
[0039] Figure 3 This is an effect diagram of the original image of the embodiment of the present application restored to a map image in a standard map format;
[0040] Figure 4 This is a schematic diagram of the splicing process (partial). After determining the splicing order, execute the splicing diagram according to the corresponding position;
[0041] Figure 5 Schematic diagram of the splicing effect;
[0042] Figure 6 Schematic diagram of anchor point pair marking in the map stitching accuracy process based on anchor point statistics. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0044] See also Figure 1 This embodiment provides a large-scale automatic fusion method for segmented maps, which includes the following steps:
[0045] S1. Train the image segmentation model to extract and segment the map area.
[0046] Step S1 includes:
[0047] Select an image segmentation model.
[0048] Prepare map image datasets in the surveying and mapping field.
[0049] Train the image segmentation model to ensure the model's ability to accurately segment map images.
[0050] Preparation of map image datasets in the surveying and mapping field includes:
[0051] 500 typical map tiles were collected and selected for manual labeling. The label image is a binary mask of the map area (the map area value is 255 and the background area value is 0).
[0052] The map area is marked by selecting the vertices at the edge of the map area, and then the label image is obtained through binarization. The specific effect is shown in the attached figure. Figure 2 shown.
[0053] The number of full-scale maps was expanded to 1,000 using the dataset augmentation method. The dataset was divided into a training set and a test set at a ratio of 9:1. The image segmentation model was trained based on this dataset. The training parameters are set as follows:
[0054]
[0055]
[0056] The map area extraction takes the original image as input, and the trained image segmentation model network outputs a binary mask of the image. The map area is extracted and restored based on the binary mask, specifically including:
[0057] Use cv2.findcounters() function to extract the boundary vertices of the mask.
[0058] Use cv2.approxPolyDP() function to approximate the boundary polygon and reduce the number of vertices. The parameter epsilon is set to 0.01 times the boundary perimeter. The return value is the approximate vertex closed set, denoted as N = {n1,n2,…,n i ,…n |N|}.
[0059] Use the cv2.minAreaRect() method to calculate the minimum enclosing rectangle of the vertex set, and classify the vertex set into four categories according to the distance between the vertex and the four sides of the outer rectangle. The obtained N1, N2, N3, and N4 respectively represent the corresponding point sets of the four sides of the approximate quadrilateral.
[0060] Use the RANSAC algorithm to fit four straight line equations l1, l2, l3, l4 to the four point sets N1, N2, N3, N4 respectively, and calculate the intersection of the lines to obtain the vertices d1, d2, d3, d4 of the quadrilateral area.
[0061] For vertex n i , its projection point on the corresponding straight line is n i ′, so that the vertex vector [n1, n2, ..., n |N| ]The projection vector on the quadrilateral is [n1′, n2′, ..., n |N| ′], use the cv2.getPerspectiveTranfrom() function to calculate the projection matrix and use the cv2.warpPerspective() function to perform the projection transformation on the original image to map the map area to the quadrilateral area.
[0062] Let h and w be the height and width of the standard rectangular map sheet. For the vertex matrix [d1, d2, d3, d4] of the quadrilateral, calculate its projection matrix mapped to the standard map sheet matrix [[0, 0], [w, 0], [w, h], [0, h]], and perform projection transformation to map the map area onto the standard rectangular map sheet. Thus, the original image is restored to a map image in the standard map sheet style. The specific effect is shown in the attached figure. Figure 3 shown.
[0063] S2. Register the graphic area calibrated by the image segmentation model and restore it to a map image of standard size.
[0064] The graphic area calibrated by the image segmentation model is registered through the map image restoration algorithm, and the mapping relationship between the edge vertices of the segmented map image and the standard map sheet is described. Computer vision technology is used to perform graphic transformation to correct the impact of deformation on the map area.
[0065] S3. Determine the position order of different sub-frames in the full-frame map, and stitch together a large number of sub-frames to form a full-frame map. The specific effect is shown in the attached figure. Figure 4 , Attachment Figure 5 and attached Figure 6 shown.
[0066] Step S3 includes:
[0067] According to the similarity law of pixels on the adjacent edges of two adjacent sub-images, an algorithm is designed to describe the similarity relationship between the boundaries of different sub-images.
[0068] The similarity is measured, and based on the similarity, candidate adjacent edges are determined. Rules are designed to determine the final adjacency relationship of the sub-images, and the splicing and fusion of all the sub-images are completed.
[0069] The splicing of the segmented maps is based on the automatic fusion of edge features. Ideally, the pixels of the adjacent edges of adjacent segmented maps should be exactly the same. In the use of segmented maps, due to possible map preparation errors, scanning image problems, deformation and contamination interference, there will be some differences in the pixels of adjacent edges, but they are still very similar on a large scale. And this similarity is difficult to be caused by other non-adjacent edges. Therefore, this method statistically calculates the similarity between the edges of the segmented maps, and constructs a candidate set of adjacent edges based on the similarity to determine the adjacency relationship between different segmented maps, specifically including:
[0070] For the adjusted standard map, the image pixels with a width of one pixel on each of the four sides are intercepted as edge vectors. For the horizontal and vertical edges of the frame i, we get Represent the edge vectors of the top, bottom, left and right sides respectively.
[0071] For frame i and frame j, the upper boundary edge vector is calculated by the dynamic time warping algorithm and the lower boundary edge vector The minimum regularization distance is denoted as and the left boundary edge vector and the right boundary edge vector The minimum regular distance between The distance metric is Manhattan distance.
[0072] For the upper boundary of tile i, select The corresponding edge of the corresponding sub-graph j is taken as the candidate adjacent edge, and The score of the candidate adjacent edge pair is used to measure the similarity between the two edges. Similarly, the candidate adjacent edges and similarity of each edge can be found.
[0073] For an m×n image combination, there should be m(n-1)+n(m-1) pairs of adjacent edges. According to the scores of each adjacent edge pair from high to low, m(n-1)+n(m-1) pairs of adjacent edges that do not conflict are selected as the final adjacent edges and the splicing and fusion of the image segments are performed to complete the automatic fusion of the full image.
[0074] This embodiment realizes the automated fusion of segmented maps in large-scale scenarios. Through automated operations, the segmented map splicing process is significantly simplified, a large amount of manual operations are reduced, manpower is saved, and the splicing efficiency is greatly improved. In the map area extraction and segmentation steps, the mIoU of the map area segmentation reached 98.63%, effectively developing a map image segmentation model suitable for the surveying and mapping field. In addition, the map splicing accuracy based on anchor point statistics reached 96%, significantly improving the splicing effect and map usability. This technology has broad application prospects in key areas such as urban planning iteration, urban history research, cultural heritage protection, and natural resource rights confirmation, providing an effective tool to better support urban development.
[0075] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. For those skilled in the art of the present invention, without departing from the concept of the present invention, several simple deductions or substitutions can be made, which should be considered to fall within the scope of protection of the present invention.
Claims
1. A large-scale automatic fusion method for map tiles, characterized in that: The method comprises the following steps: S1. Train the image segmentation model to extract and segment the map area; S2, registering the graphic area calibrated by the image segmentation model to restore it to a map image of a standard sheet; S3. Determine the position order of different sub-frames in the full-scale map, and stitch a large number of sub-frames together to form the full-scale map, where: Step S3 includes: According to the similarity law of pixels on the adjacent edges of two adjacent sub-images, an algorithm is designed to describe the similarity relationship between the boundaries of different sub-images; Measure the similarity, determine the candidate adjacent edges based on the similarity, and design rules to determine the final adjacency relationship of the sub-images to complete the splicing and fusion of all the sub-images; The splicing of the sub-frames is based on the automatic fusion of edge features, including: For the adjusted standard map, the image pixels with a width of one pixel on each of the four sides are intercepted as edge vectors. For the horizontal and vertical edges of the frame i, we get Represent the edge vectors of the top, bottom, left and right sides respectively; For frame i and frame j, the upper boundary edge vector is calculated by the dynamic time warping algorithm and the lower boundary edge vector The minimum regularization distance is denoted as and the left boundary edge vector and the right boundary edge vector The minimum regular distance between The distance metric is Manhattan distance; For the upper boundary of tile i, select The corresponding edge of the corresponding sub-graph j is taken as the candidate adjacent edge, and The score of the candidate adjacent edge pair is used to measure the similarity between the two edges. Similarly, the candidate adjacent edges and similarity of each edge can be found. For an m×n image combination, there are m(n-1)+n(m-1) pairs of adjacent edges. According to the scores of each adjacent edge pair from high to low, m(n-1)+n(m-1) adjacent edge pairs that do not conflict are selected as the final adjacent edges and the splicing and fusion of the image segments are performed to complete the automatic fusion of the full image.
2. The large-scale automatic fusion method of map tiles according to claim 1, characterized in that: Step S1 includes: Select image segmentation model; Prepare map image datasets in the surveying and mapping field; Train an image segmentation model.
3. The large-scale automatic fusion method of map tiles according to claim 2, characterized in that: Preparation of map image datasets in the surveying and mapping field includes: Collect and select tile maps for manual labeling of label images; Mark the map area by selecting the vertices at the edge of the map area, and then obtain the label image through binarization processing; The number of full-scale maps is expanded through the dataset augmentation method, and the dataset is divided into training and test sets according to the proportion. The image segmentation model is trained based on the dataset.
4. The large-scale segmented map automatic fusion method according to claim 1, characterized in that: The map area extraction takes the original image as input, and the trained image segmentation model network outputs a binary mask of the image. The map area is extracted and restored based on the binary mask, specifically including: Use cv2.findcounters() function to extract the boundary vertices of the mask; Use cv2.approxPolyDP() function to approximate the boundary polygon and reduce the number of vertices. The parameter epsilon is set to 0.01 times the boundary perimeter. The return value is the approximate vertex closed set, denoted as N = {n1, n2, ..., n i ,...,n |N| }; Use the cv2.minAreaRect() method to calculate the minimum bounding rectangle of the vertex set, and classify the vertex set into four categories according to the distance between the vertex and the four sides of the outer rectangle. The obtained N1, N2, N3, and N4 represent the corresponding point sets of the four sides of the approximate quadrilateral respectively. Use the RANSAC algorithm to fit four straight line equations l1, l2, l3, l4 to the four point sets N1, N2, N3, N4 respectively, and calculate the intersection of the lines to obtain the vertices d1, d2, d3, d4 of the quadrilateral area; For vertex n i , its projection point on the corresponding straight line is n i ′, so that the vertex vector [n1, n2, ..., n |N| ]The projection vector on the quadrilateral is [n1′, n2′, ..., n |N| ′], use cv2.getPerspectiveTranfrom() function to calculate the projection matrix and use cv2.warpPerspective() function to perform projection transformation on the original image to map the map area to the quadrilateral area; Let h and w be the height and width of the standard rectangular map sheet. For the vertex matrix [d1, d2, d3, d4] of the quadrilateral, calculate its projection matrix mapped to the standard map sheet matrix [[0, 0], [w, 0], [w, h], [0, h]], and perform projection transformation to map the map area onto the standard rectangular map sheet, so that the original image is restored to a map image in the standard map sheet style.
5. The large-scale automatic fusion method of map tiles according to claim 1, characterized in that: The graphic area calibrated by the image segmentation model is registered through the map image restoration algorithm, and the mapping relationship between the edge vertices of the segmented map image and the standard map sheet is described. Computer vision technology is used to perform graphic transformation to correct the impact of deformation on the map area.
Citation Information
Patent Citations
Image repeating data deletion method based on artificial intelligence
CN113721859A