A municipal engineering surveying and mapping device and a municipal engineering surveying and mapping method

By performing threshold segmentation, connection domain merging and region division on images in municipal engineering surveying and mapping, and combining feature point matching calculation, the problem of inaccurate image matching in the prior art is solved, and the accuracy and quality of surveying and mapping are improved.

CN119737929AActive Publication Date: 2025-04-01NINGBO HAISHU YONGHAI REAL ESTATE SURVEYING & MAPPING CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510214299.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-04-01
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

In the process of municipal engineering surveying and mapping planning, image matching only through feature points may lead to inaccurate matching, affecting the stitching quality and accuracy of the overall image.

Method used

By performing threshold segmentation on the original municipal image, the segmented connective domains are obtained; the connected domains are merged according to shape similarity and position consistency; the regions are divided by analyzing the extension of the edges of the merged connective domains; the characteristic points of each region are determined and the degree of matching is calculated; overlapping areas are determined and spliced ​​by matching.

Benefits of technology

It improves the quality and accuracy of image stitching, and ensures the accuracy and reliability of municipal engineering surveying and mapping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119737929A_ABST
    Figure CN119737929A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of municipal survey, and discloses a municipal engineering surveying and mapping device and a surveying and mapping method. The method is as follows: an original municipal image and an overlapping image with a partial overlapping area are obtained, and then all connected domains in the segmented municipal image are obtained; the neighboring connected domains are merged according to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image to obtain a merged connected domain; the original municipal image is divided into regions according to the extension of the edge of the merged connected domain to obtain a plurality of regions; the feature points of each connected domain in each region are determined, and the matching degree between the region in the original municipal image and the region in the overlapping image is calculated according to the feature points of each connected domain and the number of connected domains; the overlapping area of ​​the original municipal image and the overlapping image is determined by the matching degree, and the original municipal image and the overlapping image are spliced ​​according to the overlapping area, thereby completing the municipal engineering surveying and mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of municipal surveying, and in particular to a municipal engineering surveying and mapping device and a surveying and mapping method. Background Art

[0002] In the process of surveying and mapping municipal projects, drone technology is often used to capture detailed images of the city. This method can provide high-resolution aerial images and videos to help engineers obtain accurate geographic information and urban layout. Drones usually automatically take a series of images at set intervals to ensure that the shooting area is fully covered. These images may overlap due to different shooting positions and angles.

[0003] The current method of identifying overlapping parts of images usually analyzes the feature points in the image and performs feature matching based on a single feature point to obtain the overlapping area in the two images. However, the buildings in an area of ​​a city may be similar, so image matching based only on feature points may result in inaccurate matching, thus affecting the stitching quality and accuracy of the overall image. Summary of the invention

[0004] In order to overcome the problem that in the above-mentioned prior art, image matching only through feature points in the process of municipal engineering surveying and mapping planning leads to inaccurate matching, which affects the stitching quality and accuracy of the overall image, the present invention provides a municipal engineering surveying and mapping device and method.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: A municipal engineering surveying and mapping method, the method comprising the following steps: Obtaining an original municipal image and an overlapping image having a partial overlapping area; Perform threshold segmentation on the original municipal image to obtain all connected domains in the segmented municipal image; According to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image, the neighboring connected domains are merged to obtain a merged connected domain; The original municipal image is divided into regions according to the extension of the edge of the merged connected domain to obtain several regions; Determine the characteristic points of each connected domain in each area, and calculate the matching degree between the area in the original municipal image and the area in the overlapping image according to the characteristic points of each connected domain in the area and the number of connected domains; The overlapping area between the original municipal image and the overlapping image is determined by the matching degree, and the original municipal image and the overlapping image are spliced ​​according to the overlapping area, thereby completing the municipal engineering surveying and mapping.

[0006] Preferably, threshold segmentation processing is performed on the original municipal image, including: Acquire an original municipal image, where the original municipal image is an RGB image; The original municipal image is converted into a grayscale image, and Gaussian filtering is used to remove noise points in the original municipal image. The denoised municipal image is threshold segmented using Otsu threshold segmentation to obtain the segmented municipal image.

[0007] Furthermore, all connected domains in the segmented municipal image are obtained, including: Obtain all connected domains in the segmented municipal image, mark the connected domains of the segmented municipal image, and specifically check whether each pixel in the segmented municipal image belongs to a connected domain, starting from the upper left corner, and checking row by row and column by column; for pixels with a mark value of 1, use the depth-first search method to find all pixels with a connected mark value of 1, and assign a unique label to obtain all connected domains in the segmented municipal image.

[0008] Preferably, the neighboring connected domains are merged according to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image to obtain a merged connected domain, including: Get multiple neighboring connected domains of the current connected domain; Calculate the shape similarity between the current connected domain and the neighboring connected domain according to the difference in area, perimeter, and number of corner points between the current connected domain and the neighboring connected domain; Calculate the position consistency between the current connected domain and the neighboring connected domain; According to the obtained shape similarity and position consistency, the possibility that the neighboring connected domain and the current connected domain belong to the same region is calculated; When the possibility that the neighboring connected domain and the current connected domain belong to the same area is greater than or equal to a preset area threshold, the neighboring connected domain and the current connected domain are considered to belong to the same area, and the neighboring connected domain and the current connected domain are merged to obtain a merged connected domain.

[0009] Furthermore, the position consistency between the current connected domain and the neighboring connected domain is calculated, including: For each neighborhood connected domain, obtain its N connected domains in the direction of the current connected domain as reference connected domains; Extract the skeletons of the neighboring connected domain, the current connected domain and the reference connected domain, and use the least square method to perform linear fitting on the skeletons extracted from all connected domains so that the skeletons form a straight line; Get the angle between the neighboring connected domain and the skeleton extension line of the current connected domain; Calculate the interval distance and angle between adjacent reference connected domains; According to the interval distances between adjacent reference connected domains, the average of the interval distances between adjacent reference connected domains is calculated; Get the distance between the neighboring connected domain and the current connected domain; Based on the angle between the skeleton extension line of the neighboring connected domain and the current connected domain, the average of the interval distances of adjacent reference connected domains, the angle between adjacent reference connected domains, and the distance between the neighboring connected domain and the current connected domain, the position consistency between the current connected domain and the neighboring connected domain is calculated.

[0010] Preferably, the original municipal image is divided into regions according to the extension of the edge of the merged connected domain to obtain several regions, including: Acquire a merged connected domain edge, where the merged connected domain edge represents the minimum perimeter of the current connected domain and the neighboring connected domain; Perform edge detection on the external neighborhood of the merged connected domain using an edge detection algorithm, obtain the length of each edge, and filter out edges whose length is greater than or equal to a preset length threshold; Calculate the possibility that the current edge belongs to the road edge through the extension of the edge; Normalizing the probability that an edge belongs to a road edge, and taking an edge whose normalized probability is greater than or equal to a preset edge threshold as a road edge; According to the shape similarity and position consistency between the current connected domain and the neighboring connected domain, the neighboring connected domains on the same side of the road edge are merged to obtain a merged connected domain; the merged connected domain constitutes a region, and the connected domains in the region are similar.

[0011] Furthermore, the possibility that the current edge belongs to the road edge is calculated by the extension of the edge, including: The edge is linearly fitted using the least square method to obtain the extension direction of the edge, and the reference edge of the edge is obtained in the extension direction; Based on the distance between the edge points of two adjacent edge ends, the distance between the edge point of the current edge end and a reference edge end, the distance between the pixel points of the current edge before and after linear fitting, the length of the current edge, and the number of reference edge lines, the possibility that the current edge is a road edge is calculated.

[0012] Preferably, determining the characteristic points of each connected domain in each region includes: Take any point in the connected domain of the region as the starting point, patrol each point on the edge, record the direction of the subsequent points relative to the current one, and convert the relative direction into a specific value; Obtaining a derivative chain code of the original chain code; the derivative refers to the difference between the previous chain code and the next chain code, measured in multiples of 45° counterclockwise rotation; Remove the pixels whose derivative is 0, so that the selected pixels all have the change of direction angle; When the number of pixels between a selected pixel and the next selected pixel is greater than or equal to a preset pixel number threshold, multiple selected pixels greater than or equal to the preset pixel number threshold are selected as feature points of the connected domain; Thus, the feature points of each connected domain in the region are obtained.

[0013] Preferably, calculating the matching degree between the region in the original municipal image and the region in the overlapping image according to the feature points of each connected domain in the region and the number of connected domains includes: Obtain the sum of the inner angles of the feature points of the connected domain of a certain area in the original municipal image; Get the sum of the interior angles of the feature points of the connected domain in a certain area of ​​the overlapping image; The sum of the internal angles is obtained by the following steps: obtaining the distances between the feature points in the connected domain and two adjacent feature points respectively. , the distance between two adjacent feature points is ; Draw a perpendicular line h perpendicular to the line segment c, and calculate the internal angle of the feature point by the inverse sine; thus, the internal angle sequence of the feature points formed by the lines connecting all the feature points is obtained, and the angles in the internal angle sequence of the feature points are added to obtain the internal angle sum between the feature points on a connected domain ; Get the number of connected domains in a certain area of ​​the original municipal image; Get the number of connected domains in a certain area of ​​the overlapping image; The matching degree between the area in the original municipal image and the area in the overlapping image is calculated based on the sum of the inner angles of the feature points of the connected domain of a certain area in the original municipal image, the sum of the inner angles of the feature points of the connected domain of a certain area in the overlapping image, the number of connected domains of a certain area in the original municipal image, and the number of connected domains of a certain area in the overlapping image.

[0014] A municipal engineering surveying and mapping device, comprising: An image acquisition module, used for acquiring an original municipal image and an overlapping image with a partially overlapping area; A preprocessing module is used to perform threshold segmentation on the original municipal image and obtain all connected domains in the segmented municipal image; A merging module is used to merge the neighboring connected domains according to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image to obtain a merged connected domain; A region division module is used to divide the original municipal image into regions according to the extension of the edge of the merged connected domain to obtain a number of regions; A matching degree calculation module is used to determine the characteristic points of each connected domain in each area, and calculate the matching degree between the area in the original municipal image and the area in the overlapping image according to the characteristic points of each connected domain in the area and the number of connected domains; The image stitching module is used to determine the overlapping area of ​​the original municipal image and the overlapping image through the matching degree, and stitch the original municipal image and the overlapping image according to the overlapping area, thereby completing the municipal engineering surveying and mapping.

[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention performs threshold segmentation processing on the acquired original municipal image to obtain all connected domains in the segmented municipal image; merges the neighboring connected domains according to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image to obtain a merged connected domain; divides the original municipal image into regions according to the extensibility of the edge of the merged connected domain to obtain a plurality of regions; determines the feature points of each connected domain in each region, and calculates the matching degree between the region in the original municipal image and the region in the overlapping image according to the feature points of each connected domain in the region and the number of connected domains; determines the overlapping region of the original municipal image and the overlapping image through the matching degree, splices the original municipal image and the overlapping image according to the overlapping region, and thereby completes the municipal engineering surveying and mapping.

[0016] The distribution of buildings in an area in the original municipal image is regular. The area is divided according to the location distribution characteristics of the buildings in the city, and the overlapping area is determined by the matching degree between the areas. Finally, the original municipal image and the overlapping image are spliced ​​through the overlapping area.

[0017] The present invention merges the neighboring connected domains according to their shape similarity and position consistency with the current connected domain, and filters the buildings on the opposite sides of the road by analyzing the extension of the edges of the merged connected domains, so that the similar buildings are distributed in the same area, thereby achieving the purpose of regional division. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flow chart of steps of a municipal engineering surveying and mapping method of the present invention; Figure 2 It is a schematic diagram of merging the edges of connected domains in the present invention; Figure 3 It is a principle block diagram of a municipal engineering surveying and mapping device of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The present invention is described in detail below in combination with the drawings and specific implementation methods.

[0020] It should be understood that when used in this specification, the terms "include" and "comprising" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0021] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention, unless the context clearly indicates otherwise, the singular forms of "a", "an" and "the" are intended to include plural forms.

[0022] It should be further understood that the term “and / or” used in the specification of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0023] Example 1 like Figure 1 As shown, a municipal engineering surveying and mapping method comprises the following steps: Obtaining an original municipal image and an overlapping image having a partial overlapping area; Perform threshold segmentation on the original municipal image to obtain all connected domains in the segmented municipal image; According to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image, the neighboring connected domains are merged to obtain a merged connected domain; The original municipal image is divided into regions according to the extension of the edge of the merged connected domain to obtain several regions; Determine the characteristic points of each connected domain in each area, and calculate the matching degree between the area in the original municipal image and the area in the overlapping image according to the characteristic points of each connected domain in the area and the number of connected domains; The overlapping area between the original municipal image and the overlapping image is determined by the matching degree, and the original municipal image and the overlapping image are spliced ​​according to the overlapping area, thereby completing the municipal engineering surveying and mapping.

[0024] The distribution of buildings in an area in the original municipal image is regular. The area is divided according to the location distribution characteristics of the buildings in the city, and the overlapping area is determined by the matching degree between the areas. Finally, the original municipal image and the overlapping image are spliced ​​through the overlapping area.

[0025] The present invention merges the neighboring connected domains according to their shape similarity and position consistency with the current connected domain, and filters the buildings on the opposite sides of the road by analyzing the extension of the edges of the merged connected domains, so that the similar buildings are distributed in the same area, thereby achieving the purpose of regional division.

[0026] In a specific embodiment, threshold segmentation processing is performed on the original municipal image, including: Acquire an original municipal image, where the original municipal image is an RGB image; The original municipal image is converted into a grayscale image, and Gaussian filtering is used to remove noise points in the original municipal image. The denoised municipal image is threshold segmented using Otsu threshold segmentation to obtain the segmented municipal image.

[0027] In a specific embodiment, all connected domains in the segmented municipal image are obtained, including: The connected domains of the segmented municipal image are marked. Specifically, for each pixel in the segmented municipal image, check whether it belongs to a connected domain, starting from the upper left corner, and check row by column; for pixels with a mark value of 1, if a pixel with a mark value of 1 is encountered, use the depth-first search method to find all connected pixels with a mark value of 1, and assign a unique label to obtain all connected domains in the segmented municipal image.

[0028] In a specific embodiment, buildings, gardens, etc. in a city are distributed regularly in an area, so the neighborhood connected domains are merged according to their shape similarity and position consistency, and then the original municipal image can be divided into regions by analyzing the extension of the edges of the merged connected domains.

[0029] When office buildings and industrial parks in cities are being built, their appearance must be consistent. A unified appearance design can improve the overall aesthetics of the area. In order to ensure good ventilation and lighting conditions for each household in the urban community, the distance between each building is consistent, so that the building has sufficient air circulation and sunlight. Therefore, by analyzing the shape similarity and position consistency of the neighborhood connected domain and the current connected domain, the similarity between the neighborhood connected domain and the current connected domain can be determined, and the neighborhood connected domains can be merged according to the shape similarity and position consistency.

[0030] In this embodiment, the neighboring connected domains are merged according to the shape similarity and position consistency between the current connected domain and the neighboring connected domains in the original municipal image to obtain a merged connected domain, including: Get multiple neighboring connected domains of the current connected domain; Calculate the shape similarity between the current connected domain and the neighboring connected domain according to the difference in area, perimeter, and number of corner points between the current connected domain and the neighboring connected domain; Calculate the position consistency between the current connected domain and the neighboring connected domain; According to the obtained shape similarity and position consistency, the possibility that the neighboring connected domain and the current connected domain belong to the same region is calculated; When the possibility that the neighboring connected domain and the current connected domain belong to the same area is greater than or equal to a preset area threshold, the neighboring connected domain and the current connected domain are considered to belong to the same area, and the neighboring connected domain and the current connected domain are merged to obtain a merged connected domain.

[0031] In this embodiment, the shape similarity between the current connected domain and the neighboring connected domain is calculated based on the difference in area, perimeter, and number of corner points between the current connected domain and the neighboring connected domain, as follows: If the shapes of two connected domains are similar, it means that their areas and perimeters are consistent, and the number of corner points of their connected domains is consistent; therefore, the similarity of the connected domains is represented by the perimeter, area, and number of corner points of the neighboring connected domain and the current connected domain. Connected to current domain The calculation formula for shape similarity is as follows: ; Where: represents the neighborhood connected domain; Represents the current connected domain; Represents the area of ​​the connected domain of the neighborhood; Represents the area of ​​the current connected domain; Indicates the number of corner points in the connected neighborhood; Indicates the number of corner points in the current connected domain, where the corner points can be obtained through the Harris corner detector; Represents the perimeter of the connected domain of the neighborhood; Indicates the perimeter of the current connected domain; The difference between the area of ​​the neighboring connected domain and the current connected domain; Indicates the difference between the perimeter of the neighboring connected domain and the perimeter of the current connected domain; Indicates the difference between the number of corner points in the neighboring connected domain and the number of corner points in the current connected domain. The larger the value, the more connected the neighborhood is. Connected to current domain The greater the shape similarity.

[0032] In this embodiment, calculating the position consistency between the current connected domain and the neighboring connected domain includes: For each neighborhood connected domain, obtain its N connected domains in the direction of the current connected domain as reference connected domains; Extract the skeletons of the neighboring connected domain, the current connected domain and the reference connected domain, and use the least square method to perform linear fitting on the skeletons extracted from all connected domains so that the skeletons form a straight line; Get the angle between the neighboring connected domain and the skeleton extension line of the current connected domain; Calculate the interval distance and angle between adjacent reference connected domains; According to the interval distances between adjacent reference connected domains, the average of the interval distances between adjacent reference connected domains is calculated; Get the distance between the neighboring connected domain and the current connected domain; Based on the angle between the skeleton extension line of the neighboring connected domain and the current connected domain, the average of the interval distances of adjacent reference connected domains, the angle between adjacent reference connected domains, and the distance between the neighboring connected domain and the current connected domain, the position consistency between the current connected domain and the neighboring connected domain is calculated.

[0033] In this embodiment, the more consistent the distances between buildings are and the more aligned the buildings are, the stronger the position consistency between the buildings is. Therefore, the neighborhood can be connected to the domain. The distance between the current connected domain, the consistency of the distance in the same direction and the neighboring connected domain The alignment degree between the current connected domain (the angle between the extension lines) is used to calculate the position consistency between the two. The specific process is as follows: Get the reference connected domain in the same direction, for the neighboring connected domain , obtain its N=3 connected domains in the direction of the current connected domain as reference connected domains .

[0034] Linear fitting is performed on all connected domains. , the current connected domain i and the obtained reference connected domain The Zhang-Suen algorithm is used to extract the skeleton of the connected domain. The Zhang-Suen algorithm is a well-known technology and will not be elaborated here. The skeleton extracted from all connected domains is linearly fitted using the least squares method to make the skeleton a straight line, which is convenient for subsequent distance calculation.

[0035] At this time, by referring to the connected domain The spacing between them and the connected domain of the neighborhood The consistency of the distance between the current connected domain and the neighboring connected domain The consistency of the distribution of the two is calculated by the degree of alignment with the current connected domain (the angle between the extension lines). At this time, the more consistent the above spacing is and the smaller the angle is, the more connected the neighborhood domain is. The more consistent the position is with the current connected domain, the more the neighboring connected domain is calculated. The position consistency with the current connected domain is as follows: ; In the formula, Represents the reference connected domain Location, Represents the reference connected domain Location, Represents the interval distance between adjacent reference connected domains; In order to make the denominator not equal to 0; represents normalization; represents the angle between adjacent reference connected domains; represents the weight of the distance between adjacent reference connected domains, The smaller it is, the greater the weight of the distance between the current adjacent reference connected domains; Represents the mean of the distances between adjacent reference connected domains; Represents the neighborhood connected domain The distance from the current connected domain i; The smaller it is, the more connected the neighborhood is. The distance between the current connected domain and the reference connected domain The more consistent the spacing between them; Represents the neighborhood connected domain Connected to current domain The angle between the two extension lines after extracting the skeleton, The smaller the value, the more connected the neighborhood is. The greater the degree of alignment with the current connected domain, the more parallel their geographical distributions are.

[0036] When the possibility that the neighboring connected domain and the current connected domain belong to the same region is greater than or equal to the preset region threshold, the neighboring connected domain and the current connected domain are considered to belong to the same region, and the neighboring connected domain and the current connected domain are merged to obtain a merged connected domain, as follows: According to the neighborhood connected domain Shape similarity with the current connected domain i and position consistency , determine the neighborhood connectivity domain Whether it needs to be merged with the current connected domain i; at this time , The larger the value, the more connected the neighborhood is. The more it belongs to the same region as the current connected domain i; the neighboring connected domain The possibility that the current connected domain i belongs to the same region . Set the region threshold , when the neighborhood is connected The possibility that it belongs to the same region as the current connected region i Greater than or equal to the preset area threshold When , it is considered that the neighboring connected domain and the current connected domain belong to the same area, that is, the two are in the same area, then the neighboring connected domain is merged with the current connected domain to obtain a merged connected domain.

[0037] In a specific embodiment, the adjacent similar buildings are merged, but for some areas, the distribution shapes and distribution positions of the buildings are similar, but they are separated by a road. In this case, the two buildings should not belong to the same area, so the original municipal image is divided into regions by merging the extension of the edges around the connected domain.

[0038] The original municipal image is divided into regions according to the extension of the edge of the merged connected domain, and several regions are obtained, including: Get the edge of the merged connected domain, where the edge of the merged connected domain represents the minimum perimeter of the current connected domain and the neighboring connected domain, such as Figure 2 As shown; Perform edge detection on the external neighborhood of the merged connected domain using an edge detection algorithm, obtain the length of each edge, and filter out edges whose length is greater than or equal to a preset length threshold; In this embodiment, the edges around the merged connected domain are obtained, and the edge detection of the outer neighborhood of the merged connected domain can be performed by the canny edge detection algorithm. A portion of the edges that may be roads are screened by the length of the edge, the length of each edge is obtained, and a threshold (length is 10) is set to screen out edges whose length is greater than or equal to the preset length threshold.

[0039] Calculate the possibility that the current edge belongs to the road edge through the extension of the edge; Normalizing the possibility that the current edge belongs to a road edge, and taking the current edge whose normalized possibility is greater than or equal to a preset edge threshold as a road edge; According to the shape similarity and position consistency between the current connected domain and the neighboring connected domain, the neighboring connected domains on the same side of the road edge are merged to obtain a merged connected domain; the merged connected domain constitutes a region, and the connected domains in the region are similar.

[0040] In this embodiment, the possibility that the current edge belongs to the road edge is calculated by the extension of the edge, including: The edge is linearly fitted using the least square method to obtain the extension direction of the edge, and the reference edge of the edge is obtained in the extension direction; The possibility that the edge is a road edge is calculated based on the distance between the edge points of two adjacent edge ends, the distance between the edge point of the current edge end and a reference edge end, the distance between the pixel points of the current edge before and after linear fitting, the length of the current edge, and the number of reference edge lines.

[0041] In this embodiment, roads in a city generally extend in every direction, and are represented as a continuously extending straight line in the edge. Therefore, the possibility that the current edge belongs to a road edge can be calculated by the extensibility of the edge.

[0042] Specifically, the edge w is linearly fitted using the least square method to obtain the extension direction of the edge, and the reference edge of the edge is obtained in the extension direction. The smaller the interval with the neighboring edge, the stronger the continuity, and the longer the length of the current edge is, the more it presents a straight line, which means that the current edge is more extended, that is, the greater the possibility of belonging to the road edge; the formula for calculating the possibility that the current edge belongs to the road edge is as follows: ; Where: w represents the current edge; Represents the distance between two adjacent edge end points; Indicates the distance between the current edge w and the end edge point of the m-1th reference edge, which is the weight of edge continuity. The closer the distance to the current edge, the higher the reference edge continuity weight; Represents the ordinate of the k pixels of the current edge w without linear fitting, Represents the ordinate of the kth pixel point of the current edge w after linear fitting; represents the distance between the k pixel points of the current edge w without linear fitting and the k-th pixel point of the current edge w after linear fitting; it should be noted that the abscissa of the k pixel points of the current edge w without linear fitting is the same as the abscissa of the k-th pixel point of the current edge w after linear fitting; T represents the length of the current edge, that is, the number of pixels; Indicates the number of reference edges; The smaller it is, the current edge presents a straight line; The smaller it is, the longer the length of the current edge is; exp (-) represents an exponential function with a natural constant as the base, which is used to realize the normalization processing of negative correlation of data; at this time The larger the value, the more likely the current edge w is to belong to the road.

[0043] In this embodiment, the regions are divided as follows: an edge threshold is set , the possibility of belonging to the edge of the road Greater than or equal to The current edge of the current connected domain is taken as the road edge. When obtaining the neighboring connected domain of the current connected domain, the neighboring connected domain on the opposite side of the road edge is not merged, that is, the connected domain on the opposite side of the road edge is no longer considered (the opposite side is not on the same side of the road edge as the merged connected domain). Finally, when the merged connected domain has no similar connected domain to merge, the merged connected domain at this time can form a region, and the connected domains in the region are similar.

[0044] In a specific embodiment, in order to analyze the structural similarity between regions, it is necessary to first determine the feature points that make the edges have obvious changes or mutations, and then determine the similarity between regions through the consistency of the feature points and the matching points. The present invention determines the feature points in the region by analyzing the turning points or direction change points in the chain code sequence.

[0045] This embodiment determines the characteristic points of each connected domain in each region, including: Take any point in the connected domain of the region as the starting point, patrol each point on the edge, record the direction of the subsequent points relative to the current one, and convert the relative direction into a specific value; In order to find the characteristic points on the edge, that is, the magnitude of the directional change of adjacent elements; obtain the derivative chain code of the original chain code; the derivative refers to the difference between the previous chain code and the next one, measured in multiples of 45° counterclockwise rotation; At this time, the connected domain pixels with a derivative of 0 do not have a change in direction, so the pixels with a derivative of 0 are removed, and the selected pixels thus obtained all have a change in direction angle. The more intervals there are between a selected point and the next selected point, the more likely it is to be a feature point; therefore, the number of pixels between each selected point and the next selected point is used as the basis for whether to select it as a feature point; When the number of pixels between the selected pixel and the next selected pixel is greater than or equal to the preset pixel number threshold ( ), selecting a plurality of selected pixels greater than or equal to a preset pixel number threshold as feature points of the connected domain; Thus, the feature points of each connected domain in the region are obtained.

[0046] In a specific embodiment, calculating the matching degree between the region in the original municipal image and the region in the overlapping image according to the feature points of each connected domain in the region and the number of connected domains includes: Obtain the sum of the inner angles of the feature points of the connected domain of a certain area in the original municipal image; Get the sum of the interior angles of the feature points of the connected domain in a certain area of ​​the overlapping image; The sum of the internal angles is obtained by the following steps: obtaining the distances between the feature points in the connected domain and two adjacent feature points respectively. , the distance between two adjacent feature points is ; Draw a perpendicular line h perpendicular to the line segment c, and calculate the internal angle of the feature point by the inverse sine; thus, the internal angle sequence of the feature points formed by the lines connecting all the feature points is obtained, and the angles in the internal angle sequence of the feature points are added to obtain the internal angle sum between the feature points on a connected domain ; Get the number of connected domains in a certain area of ​​the original municipal image; Get the number of connected domains in a certain area of ​​the overlapping image; The matching degree between the area in the original municipal image and the area in the overlapping image is calculated based on the sum of the inner angles of the feature points of the connected domain of a certain area in the original municipal image, the sum of the inner angles of the feature points of the connected domain of a certain area in the overlapping image, the number of connected domains of a certain area in the original municipal image, and the number of connected domains of a certain area in the overlapping image.

[0047] In this embodiment, if a region in one image is similar to a region in another image, that is, the number of connected domains between the two images is the same, and the shapes of the corresponding connected domains are also the same, the similarity of the shapes of the connected domains is determined by summing the internal angles between the feature points in the connected domains. Specifically, the angle of the feature points in the connected domain is calculated as follows: the distance between the feature point and the two adjacent feature points is recorded as , and connect two adjacent feature points with a distance of , draw a perpendicular line h perpendicular to line segment c, and calculate the internal angle of the feature point by using the inverse sine. At this time, the internal angle sequence of the feature points formed by the lines connecting all the feature points can be obtained. The sum of the internal angles between the feature points on a connected domain can be obtained by adding the angles in the sequence. .

[0048] This embodiment provides a calculation formula for calculating the matching degree between the area p in the original municipal image and the area q in the overlapping image, as follows: ; Where: represents the sum of the interior angles of the feature points of the e-th connected domain of region p in the original municipal image; represents the sum of the interior angles of the feature points of the f-th connected domain in the overlapping image; It represents the minimum difference between the sum of the internal angles of the connected domain feature point e in region p and the connected domain feature point f in region q; The smaller it is, the stronger the morphological similarity between the connected domains of region p and region q is; represents the number of connected domains of region p in the original municipal image, represents the number of connected domains of region q in the overlapping image, The smaller it is, the more consistent the number of connected domains between region p and region q is. is the matching degree between the area p in the original municipal image and the area q in the overlapping image; Represents the number of connected domain feature points of area p in the original municipal image.

[0049] In this embodiment, the overlapping area of ​​the image is determined according to the matching degree between the areas, as follows: The matching degree between each area in the original municipal image and the area in the overlapping image is calculated ,at this time The larger the value, the higher the matching degree between the area p in the original municipal image and the area q in the overlapping image. , if the value is 0.7, get Greater than or equal to If area p and area q are the overlapping areas of the municipal images, then these are the overlapping areas of the municipal images.

[0050] According to the overlapping area of ​​the original municipal image and the overlapping image obtained above, the original municipal image and the overlapping image are spliced ​​according to the overlapping area, thereby completing the municipal engineering surveying and mapping. By dividing the image into regions and then performing region matching, the quality and accuracy of the splicing of the two images can be improved.

[0051] Among them, image stitching includes roughly several steps: feature extraction, image registration, image deformation, and image fusion. The detailed implementation process of image stitching is prior art and is not within the scope of protection of the present invention, and will not be elaborated here.

[0052] Among them, feature extraction is to extract feature points of overlapping areas from the images to be stitched (original municipal images, overlapping images). Feature points can be significant points such as corners, edges, textures, etc. Commonly used feature detectors include SlFT (Scale-lnvariant Feature Transform), SURF (Speeded Up Robust Features) and ORB (OrientedFAST and Rotated BRIEF).

[0053] Image registration is to establish a correspondence between the images to be stitched. By calculating the similarity measure of the feature points in the images to be stitched, the corresponding feature point pairs can be found. Commonly used feature matching algorithms include brute force matching algorithm, FLANN (Fast Library for Approximate Nearest Neighbors) algorithm and BM (Brute-Force Matcher) algorithm, etc. These algorithms can match feature point pairs based on the similarity between feature descriptors.

[0054] Image deformation is to align the images to be stitched so that they can be seamlessly stitched together. By estimating the geometric transformation relationship between adjacent images, their relative position and posture can be determined. Commonly used geometric transformations include translation, rotation, scaling, and affine. When determining the geometric transformation, an optimization algorithm is needed to minimize the transformation parameters in order to obtain the best stitching effect.

[0055] Image fusion is the process of fusing stitched images into a complete image. In the image fusion process, the transition and fusion effects between different images need to be considered to avoid obvious stitching traces. Commonly used image fusion methods include pixel-level fusion, feature-level fusion, and decision-level fusion. According to the specific application scenario and requirements, you can choose a suitable fusion method.

[0056] Example 2 This example is based on a municipal engineering surveying and mapping method described in Example 1, and also provides a municipal engineering surveying and mapping device, such as Figure 3 As shown, including: An image acquisition module, used for acquiring an original municipal image and an overlapping image with a partially overlapping area; A preprocessing module is used to perform threshold segmentation on the original municipal image and obtain all connected domains in the segmented municipal image; A merging module is used to merge the neighboring connected domains according to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image to obtain a merged connected domain; A region division module is used to divide the original municipal image into regions according to the extension of the edge of the merged connected domain to obtain a number of regions; A matching degree calculation module is used to determine the characteristic points of each connected domain in each area, and calculate the matching degree between the area in the original municipal image and the area in the overlapping image according to the characteristic points of each connected domain in the area and the number of connected domains; The image stitching module is used to determine the overlapping area of ​​the original municipal image and the overlapping image through the matching degree, and stitch the original municipal image and the overlapping image according to the overlapping area, thereby completing the municipal engineering surveying and mapping.

[0057] Obviously, the above embodiments of the present invention are only examples for clearly explaining the present invention, and are not intended to limit the implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A municipal engineering surveying and mapping method, characterized in that: The method comprises the following steps: Obtaining an original municipal image and an overlapping image having a partial overlapping area; Perform threshold segmentation on the original municipal image to obtain all connected domains in the segmented municipal image; According to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image, the neighboring connected domains are merged to obtain a merged connected domain; The original municipal image is divided into regions according to the extension of the edge of the merged connected domain to obtain several regions; Determine the characteristic points of each connected domain in each area, and calculate the matching degree between the area in the original municipal image and the area in the overlapping image according to the characteristic points of each connected domain in the area and the number of connected domains; The overlapping area between the original municipal image and the overlapping image is determined by the matching degree, and the original municipal image and the overlapping image are spliced ​​according to the overlapping area, thereby completing the municipal engineering surveying and mapping.

2. The municipal engineering surveying and mapping method according to claim 1, characterized in that: Perform threshold segmentation on the original municipal image, including: Acquire an original municipal image, where the original municipal image is an RGB image; The original municipal image is converted into a grayscale image, and Gaussian filtering is used to remove noise points in the original municipal image. The denoised municipal image is threshold segmented using Otsu threshold segmentation to obtain the segmented municipal image.

3. The municipal engineering surveying and mapping method according to claim 2, characterized in that: Get all connected domains in the segmented municipal image, including: The connected domains of the segmented municipal image are marked. Specifically, each pixel in the segmented municipal image is checked to see whether it belongs to a connected domain. The check is performed row by row and column by column starting from the upper left corner. For pixels with a mark value of 1, a depth-first search method is used to find all pixels with a connected mark value of 1, and a unique label is assigned to obtain all connected domains in the segmented municipal image.

4. The municipal engineering surveying and mapping method according to claim 1, characterized in that: According to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image, the neighboring connected domains are merged to obtain a merged connected domain, including: Get multiple neighboring connected domains of the current connected domain; Calculate the shape similarity between the current connected domain and the neighboring connected domain according to the difference in area, perimeter, and number of corner points between the current connected domain and the neighboring connected domain; Calculate the position consistency between the current connected domain and the neighboring connected domain; According to the obtained shape similarity and position consistency, the possibility that the neighboring connected domain and the current connected domain belong to the same region is calculated; When the possibility that the neighboring connected domain and the current connected domain belong to the same area is greater than or equal to a preset area threshold, the neighboring connected domain and the current connected domain are considered to belong to the same area, and the neighboring connected domain and the current connected domain are merged to obtain a merged connected domain.

5. The municipal engineering surveying and mapping method according to claim 4, characterized in that: Calculate the position consistency between the current connected domain and the neighboring connected domain, including: For each neighborhood connected domain, obtain its N connected domains in the direction of the current connected domain as reference connected domains; Extract the skeletons of the neighboring connected domain, the current connected domain and the reference connected domain, and use the least square method to perform linear fitting on the skeletons extracted from all connected domains so that the skeletons form a straight line; Get the angle between the neighboring connected domain and the skeleton extension line of the current connected domain; Calculate the interval distance and angle between adjacent reference connected domains; According to the interval distances between adjacent reference connected domains, the average of the interval distances between adjacent reference connected domains is calculated; Get the distance between the neighboring connected domain and the current connected domain; Based on the angle between the skeleton extension line of the neighboring connected domain and the current connected domain, the average of the interval distances of adjacent reference connected domains, the angle between adjacent reference connected domains, and the distance between the neighboring connected domain and the current connected domain, the position consistency between the current connected domain and the neighboring connected domain is calculated.

6. The municipal engineering surveying and mapping method according to claim 1, characterized in that: The original municipal image is divided into regions according to the extension of the edge of the merged connected domain, and several regions are obtained, including: Acquire a merged connected domain edge, where the merged connected domain edge represents the minimum perimeter of the current connected domain and the neighboring connected domain; Perform edge detection on the external neighborhood of the merged connected domain using an edge detection algorithm, obtain the length of each edge, and filter out edges whose length is greater than or equal to a preset length threshold; Calculate the possibility that the current edge belongs to the road edge through the extension of the edge; Normalizing the possibility that the current edge belongs to a road edge, and taking the current edge whose normalized possibility is greater than or equal to a preset edge threshold as a road edge; According to the shape similarity and position consistency between the current connected domain and the neighboring connected domain, the neighboring connected domains on the same side of the road edge are merged to obtain a merged connected domain; the merged connected domain constitutes a region, and the connected domains in the region are similar.

7. The municipal engineering surveying and mapping method according to claim 6, characterized in that: The possibility that the current edge belongs to the road edge is calculated by the extension of the edge, including: The edge is linearly fitted using the least square method to obtain the extension direction of the edge, and the reference edge of the edge is obtained in the extension direction; Based on the distance between the edge points of two adjacent edge ends, the distance between the edge point of the current edge end and a reference edge end, the distance between the pixel points of the current edge before and after linear fitting, the length of the current edge, and the number of reference edge lines, the possibility that the current edge is a road edge is calculated.

8. The municipal engineering surveying and mapping method according to claim 1, characterized in that: Determine the characteristic points of each connected domain in each region, including: Take any point in the connected domain of the region as the starting point, patrol each point on the edge, record the direction of the subsequent points relative to the current one, and convert the relative direction into a specific value; Obtaining a derivative chain code of the original chain code; the derivative refers to the difference between the previous chain code and the next chain code, measured in multiples of 45° counterclockwise rotation; Remove the pixels whose derivative is 0, so that the selected pixels all have the change of direction angle; When the number of pixels between a selected pixel and the next selected pixel is greater than or equal to a preset pixel number threshold, multiple selected pixels greater than or equal to the preset pixel number threshold are selected as feature points of the connected domain; Thus, the feature points of each connected domain in the region are obtained.

9. The municipal engineering surveying and mapping method according to claim 1, characterized in that: The matching degree between the region in the original municipal image and the region in the overlapping image is calculated based on the feature points of each connected domain in the region and the number of connected domains, including: Obtain the sum of the inner angles of the feature points of the connected domain of a certain area in the original municipal image; Get the sum of the interior angles of the feature points of the connected domain in a certain area of ​​the overlapping image; The sum of the internal angles is obtained by the following steps: obtaining the distances between the feature points in the connected domain and two adjacent feature points respectively. , the distance between two adjacent feature points is ; Draw a perpendicular line h perpendicular to the line segment c, and calculate the internal angle of the feature point by the inverse sine; thus, the internal angle sequence of the feature points formed by the lines connecting all the feature points is obtained, and the angles in the internal angle sequence of the feature points are added to obtain the internal angle sum between the feature points on a connected domain ; Get the number of connected domains in a certain area of ​​the original municipal image; Get the number of connected domains in a certain area of ​​the overlapping image; The matching degree between the area in the original municipal image and the area in the overlapping image is calculated based on the sum of the inner angles of the feature points of the connected domain of a certain area in the original municipal image, the sum of the inner angles of the feature points of the connected domain of a certain area in the overlapping image, the number of connected domains of a certain area in the original municipal image, and the number of connected domains of a certain area in the overlapping image.

10. A municipal engineering surveying and mapping device, characterized in that: include: An image acquisition module, used for acquiring an original municipal image and an overlapping image with a partially overlapping area; A preprocessing module is used to perform threshold segmentation on the original municipal image and obtain all connected domains in the segmented municipal image; A merging module is used to merge the neighboring connected domains according to the shape similarity and position consistency between the current connected domain and the neighboring connected domain in the original municipal image to obtain a merged connected domain; A region division module is used to divide the original municipal image into regions according to the extension of the edge of the merged connected domain to obtain a number of regions; A matching degree calculation module is used to determine the characteristic points of each connected domain in each area, and calculate the matching degree between the area in the original municipal image and the area in the overlapping image according to the characteristic points of each connected domain in the area and the number of connected domains; The image stitching module is used to determine the overlapping area of ​​the original municipal image and the overlapping image through the matching degree, and stitch the original municipal image and the overlapping image according to the overlapping area, thereby completing the municipal engineering surveying and mapping.

Citation Information

Patent Citations

  • Video image mosaic method, device, terminal device and storage medium

    CN109146833A

  • Roof capping illegal building identification method based on region positioning and local feature matching

    CN114821334A

  • Municipal garden area measurement method based on aerial photography of unmanned aerial vehicle

    CN115272315A

  • Welded pipe corrosion state detection method based on image processing

    CN117152137A

  • Fully automatic position and alignment determination method for a terrestrial laser scanner and method for ascertaining the suitability of a position for a deployment for surveying

    US20200363202A1