Road network automatic construction method and device, electronic equipment and readable storage medium
By extracting the outline information of indoor buildings using horizontal and vertical intercept methods, and combining morphological operations and centroid calculations, a highly automated and accurate main road network and branch road network are constructed. This solves the problems of complex and uneven indoor road network construction in existing technologies and is suitable for large-scale production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE SHANGHAI ICT CO LTD
- Filing Date
- 2021-09-30
- Publication Date
- 2026-06-19
AI Technical Summary
Existing methods for constructing indoor road networks suffer from complex processes, high costs, slow update speeds, uneven generated walking routes, lack of universality and branch networks, and are unable to effectively construct complete indoor road networks.
The contour information of the interior buildings is extracted using the horizontal and vertical cross-section methods, and horizontal and vertical road networks are constructed. The road networks are integrated through morphological operations, the shortest distance of the centroid is calculated, overlapping parts are removed, and the main road network and branch road network are constructed.
It enables rapid, accurate, and automated indoor road network construction, generating a smooth and complete road network suitable for large-scale production. It avoids issues such as disconnections and breakpoints at joints, improving the precision and accuracy of the road network.
Smart Images

Figure CN115880445B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, apparatus, electronic device and readable storage medium for automatic road network construction. Background Technology
[0002] With the development of indoor positioning technology, the demand for indoor navigation services has become increasingly strong. As the foundation for indoor navigation and route planning, the rapid and accurate construction of indoor road networks is of great practical significance. Existing methods for constructing indoor main road networks include: first, manually vectorizing the road network; second, selecting key points to calculate routes; and third, using skeleton extraction.
[0003] Technical problems: Existing road network construction methods have the following drawbacks: (1) The manual vectorization method is complex, has a long production cycle, high cost, and slow update speed; (2) The method of selecting key points to calculate the route has many broken lines, is not smooth, lacks universality, and does not build a branch road network; (3) The skeleton extraction method has the problem of overlapping shop maps, resulting in deviations in the walking route, and does not build a branch road network. Summary of the Invention
[0004] This invention provides a method, apparatus, electronic device, and readable storage medium for automatic road network construction, in order to solve the problems of low automation, cumbersome methods, inaccurate generated routes, and poor universality in existing road network construction technologies.
[0005] To solve the above-mentioned technical problems, the present invention is implemented as follows:
[0006] In a first aspect, embodiments of the present invention provide a method for automatically constructing a road network, comprising:
[0007] Acquire images containing multiple indoor buildings and preprocess the images to obtain a first base map containing the outline information of the indoor buildings;
[0008] The outline information of the indoor building in the first base map is extracted by using the horizontal and vertical intercept methods, and the horizontal and vertical road networks of the indoor building are constructed using the skeleton information.
[0009] The horizontal and vertical road networks are integrated onto the first base map, and morphological operations are performed on the horizontal and vertical road networks on the first base map to obtain the integrated main road network.
[0010] Obtain the centroid point of the indoor building on the first base map, calculate the shortest distance from the centroid point to the main road network, and obtain the shortest distance feature point of the indoor building on the main road network;
[0011] Remove the overlapping portion of the feature lines of the indoor buildings from the indoor buildings to obtain the branch network of the main road network. The feature lines are the lines connecting the centroid of the indoor buildings and their corresponding shortest distance feature points.
[0012] Optionally, performing morphological operations on the horizontal and vertical road networks to obtain the integrated main road network includes:
[0013] The expansion coefficient and convolution kernel size are determined based on the width difference between the horizontal road network and the vertical road network. The horizontal road network and / or the vertical road network are then expanded to obtain a first road network. The area of the first road network covers both the horizontal road network and the vertical road network.
[0014] Update the first road network to become the primary road network.
[0015] Optionally, after updating the first road network to become the main road network, the method further includes:
[0016] Based on the width of the main road network and the unit convolution kernel, the main road network is subjected to erosion and refinement processing. The main road network after erosion and refinement processing includes the central axis features of the first road network.
[0017] Optionally, the step of acquiring images containing multiple interior buildings and preprocessing the images to obtain a first base map containing the outline information of the interior buildings includes:
[0018] The image is then denoised.
[0019] The image after denoising is standardized to grayscale, and the grayscale values of the pixels in the image are rounded down.
[0020] Binarize the grayscale values of the pixels in the image to determine the outline of the interior building;
[0021] Extract the position information of the concave and convex vertices of the outline of the interior building.
[0022] Optionally, the step of extracting skeleton information from the outline information of the indoor building in the first base map using the horizontal and vertical intercept methods, and constructing the horizontal and vertical road networks of the indoor building using the skeleton information, includes:
[0023] Obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V;
[0024] Sort the y-coordinates of the concave and convex vertices in ascending order to obtain the first y-coordinate sequence (y1, y2, y3, ..., yn);
[0025] Starting from i=1, continuously obtain the intersection points of the horizontal line y=yi and the outline C of the indoor building, and store the intersection points in the set U until i=n, where i and n are both positive integers;
[0026] Sort the points in set U by their x-coordinates from smallest to largest, calculate the coordinates of the midpoints of any two connected points in set U, and store the midpoints in set W.
[0027] Based on the x-coordinate of the midpoint, the points in the set W are connected sequentially to construct a horizontal road network.
[0028] Optionally, the step of extracting skeleton information from the outline information of the indoor building in the first base map using the horizontal and vertical intercept methods, and constructing the horizontal and vertical road networks of the indoor building using the skeleton information, further includes:
[0029] Obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V;
[0030] Sort the x-coordinates of the concave and convex vertices in ascending order to obtain the first x-coordinate sequence (x1, x2, x3, ..., xn);
[0031] Starting from i=1, continuously obtain the intersection points of the horizontal line x=xi and the outline C of the indoor building, and store the intersection points in set P until i=n, where i and n are both positive integers;
[0032] Sort the points in set P by their ordinates from smallest to largest, calculate the coordinates of the midpoints of any two connected points in set P, and store the midpoints in set N.
[0033] Based on the ordinate of the midpoint, the points in the set N are connected sequentially to construct a vertical road network.
[0034] Optionally, removing the overlapping portion of the feature lines of the interior buildings with the interior buildings to obtain the branch network of the main road network includes:
[0035] For the indoor buildings and their feature lines, the method of intersection and reversal is used to delete the line segments of the feature lines that overlap with the indoor buildings, thereby obtaining the branch network of the main road network.
[0036] Secondly, embodiments of the present invention also provide an automatic road network construction device, comprising:
[0037] The acquisition module is used to acquire images containing multiple indoor buildings and preprocess the images to obtain a first base map containing the outline information of the indoor buildings;
[0038] The first extraction module is used to extract the skeleton information of the outline information of the indoor building in the first base map by using the horizontal and vertical intercept methods, and to construct the horizontal and vertical road networks of the indoor building using the skeleton information.
[0039] The first integration module is used to integrate the horizontal road network and the vertical road network onto the first base map, and to perform morphological operations on the horizontal road network and the vertical road network on the first base map to obtain the integrated main road network.
[0040] The second extraction module is used to obtain the centroid point of the indoor building on the first base map, calculate the shortest distance from the centroid point to the main road network, and obtain the shortest distance feature point of the indoor building on the main road network.
[0041] The second integration module is used to remove the overlapping part of the feature line of the indoor building and the indoor building to obtain the branch network of the main road network. The feature line is the line connecting the centroid of the indoor building and its corresponding shortest distance feature point.
[0042] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor; characterized in that, when the processor executes the program, it implements the steps of the automatic road network construction method as described in any of the first aspects.
[0043] Fourthly, embodiments of the present invention provide a readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the automatic road network construction method as described in any of the first aspects.
[0044] In this embodiment of the invention, an image containing multiple indoor buildings is first preprocessed to convert the image into a binary outline of an indoor road network and obtain the concave and convex vertices of the outline edges. Then, horizontal and vertical intercepts are used to extract road network feature points from the road network outline and traverse the entire outline. The road network obtained by the horizontal and vertical intercept methods is further extracted using morphological operations to extract the main road network information. Based on the centroid position of the indoor building blocks, the nearest intersection point to the centroid point on the main road network is calculated, and the points are connected to obtain the branch road network information between the position of the indoor building block "door" and the main road network. This provides a method for automatically constructing a road network containing both the main road network and the branch road network. The automatic road network construction method of this invention obtains road feature points and the indoor main road network based on horizontal and vertical cross-section methods, integrating features from both horizontal and vertical directions to supplement the single cross-section method. The integrated main road network, obtained by combining the horizontal and vertical road networks according to the road network width characteristics, ensures both the precision and smoothness of the road network construction while resolving issues such as disconnections and breakpoints at connection points in indoor images. Furthermore, based on the precise main road network, the "door" information of indoor buildings is further obtained to construct the branch road network, further improving the completeness and precision of the final constructed road network. This method requires no large number of images for processing, operating only on the input images. It is easy to implement, has a fast processing speed, and is suitable for large-scale production. Attached Figure Description
[0045] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0046] Figure 1 This is one of the flowcharts illustrating an automatic road network construction method provided in an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of a horizontal main road network provided for an embodiment of the present invention;
[0048] Figure 3 A schematic diagram of a vertical main road network provided for an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of a road network that integrates the horizontal main road network and the vertical main road network onto a first base map, provided as an embodiment of the present invention.
[0050] Figure 5 A schematic diagram of the road network after expanding the horizontal and vertical main road networks, provided in an embodiment of the present invention;
[0051] Figure 6This is a schematic diagram of a road network that undergoes erosion refinement treatment after expansion operation, provided as an embodiment of the present invention.
[0052] Figure 7 Comparison diagrams of road network structures obtained through various methods provided in embodiments of the present invention;
[0053] Figure 8 This is one of the structural schematic diagrams of an automatic road network construction device provided in an embodiment of the present invention;
[0054] Figure 9 This is one of the structural schematic diagrams of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0055] The technical solutions of the embodiments of the present 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 the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] Please refer to Figure 1 , Figure 1 This is one of the flowcharts illustrating an automatic road network construction method provided in an embodiment of the present invention;
[0057] This invention provides an automatic road network construction method, comprising:
[0058] Step 11: Acquire images containing multiple indoor buildings and preprocess the images to obtain a first base map containing the outline information of the indoor buildings;
[0059] Step 12: Extract skeleton information from the outline information of the indoor building in the first base map using the horizontal and vertical intercept methods, and construct the horizontal and vertical road networks of the indoor building using the skeleton information;
[0060] Step 13: Integrate the horizontal road network and the vertical road network onto the first base map, and perform morphological operations on the horizontal road network and the vertical road network on the first base map to obtain the integrated main road network;
[0061] Step 14: Obtain the centroid of the indoor building on the first base map, calculate the shortest distance from the centroid to the main road network, and obtain the shortest distance feature point of the indoor building on the main road network;
[0062] Step 15: Remove the overlapping portion of the feature line of the indoor building and the indoor building to obtain the branch network of the main road network. The feature line is the line connecting the centroid of the indoor building and its corresponding shortest distance feature point.
[0063] In this embodiment of the invention, an image containing multiple indoor buildings is first preprocessed to convert the image into a binary outline of an indoor road network and obtain the concave and convex vertices of the outline edges. Then, horizontal and vertical intercepts are used to extract road network feature points from the road network outline and traverse the entire outline. The road network obtained by the horizontal and vertical intercept methods is further extracted using morphological operations to extract the main road network information. Based on the centroid position of the indoor building blocks, the nearest intersection point to the centroid point on the main road network is calculated, and the points are connected to obtain the branch road network information between the position of the indoor building block "door" and the main road network. This provides a method for automatically constructing a road network containing both the main road network and the branch road network. The automatic road network construction method of this invention obtains road feature points and indoor main road networks based on horizontal and vertical cross-section methods, integrating features from both horizontal and vertical directions to supplement the single cross-section method. The integrated main road network, obtained by combining the horizontal and vertical road networks according to the road network width characteristics, ensures both the precision and smoothness of the road network construction while resolving issues such as disconnections and breakpoints at connection points in indoor images. Furthermore, based on the precise main road network, the "door" information of each indoor building is further obtained to construct the branch road network, further improving the completeness and precision of the final constructed road network. This method requires no large number of images for processing, operating only on the input images. It is easy to implement, has a fast processing speed, and is suitable for large-scale production.
[0064] In some embodiments of the present invention, optionally, morphological operations on the horizontal and vertical road networks on the first base map include, but are not limited to, one or more of the following: dilation operations and erosion refinement operations on the horizontal and vertical road networks.
[0065] In some embodiments of the present invention, optionally, the method for calculating the shortest distance from the centroid to the main road network is the nearest neighbor analysis shortest distance method.
[0066] Please see Figure 2 , Figure 2 This is a schematic diagram of a horizontal main road network provided in an embodiment of the present invention; wherein the left diagram shows the process of constructing the horizontal cross-section, and the right diagram shows the horizontal road network diagram obtained after further skeleton extraction based on the constructed horizontal cross-section.
[0067] Please see Figure 3 , Figure 3 This is a schematic diagram of a vertical main road network provided in an embodiment of the present invention; the left diagram shows the process of constructing the vertical cross-section, and the right diagram shows the vertical road network diagram obtained after further skeleton extraction based on the constructed vertical cross-section.
[0068] Please see Figure 4 , Figure 4 This is a schematic diagram of a road network that integrates the horizontal main road network and the vertical main road network onto a first base map, provided as an embodiment of the present invention. The thin solid lines represent the horizontal road network and the thick dashed lines represent the vertical road network.
[0069] Please see Figure 5 , Figure 5 This is a schematic diagram of the road network after the expansion operation of the horizontal main road network and the vertical main road network provided in an embodiment of the present invention; denoted as the first road network.
[0070] Please see Figure 6 , Figure 6 This is a schematic diagram of a road network for which the main road network (first road network) after expansion operation is subjected to erosion and refinement treatment, as provided in an embodiment of the present invention; referred to as the second road network.
[0071] Please see Figure 4 and Figure 5 In some embodiments of the present invention, optionally, performing morphological operations on the horizontal road network and the vertical road network to obtain the integrated main road network includes:
[0072] The expansion coefficient and convolution kernel size are determined based on the width difference between the horizontal road network and the vertical road network. The horizontal road network and / or the vertical road network are then expanded to obtain a first road network. The area of the first road network covers both the horizontal road network and the vertical road network.
[0073] Update the first road network to become the primary road network.
[0074] In this embodiment of the invention, if only the line cutting method is used to automatically construct the indoor main road network, the generated road network will have problems such as disconnection, breakpoints, and overlay on indoor buildings at the connection points. However, this embodiment first expands and integrates the horizontal and vertical road networks into one road network, which will greatly smooth the direction of the main road network and avoid problems such as disconnection and breakpoints at the connection points in the indoor images.
[0075] In some embodiments of the present invention, optionally, the dilation process includes: convolving the image integrating road network features with a convolution kernel. During the traversal, there is an overlapping area between the convolution kernel and the image, which is the image dilation result. The formula is as follows:
[0076]
[0077] Where A represents the original image (in this case, a horizontal or vertical road network);
[0078] B represents the convolution kernel;
[0079] Let B be the new set obtained by reflecting and translating it by z.
[0080] This formula represents the dilation of A with respect to B if the original image A can be hit.
[0081] Specifically, since the width of indoor road networks is generally limited and the difference in road width within buildings is small, generally not exceeding 20 meters, a convolution kernel size of 29 can be selected, and the expansion width is approximately 22 meters. The expansion operation is performed on the horizontal road network and / or the vertical road network. The area of the first road network obtained by the expansion operation covers both the horizontal and vertical road networks.
[0082] Please see Figure 6 In some embodiments of the present invention, optionally, after updating the first road network to the main road network, the method further includes:
[0083] Based on the width of the main road network and the unit convolution kernel, the main road network is subjected to erosion and refinement processing. The main road network after erosion and refinement processing includes the central axis features of the first road network.
[0084] In this embodiment of the invention, the expanded first road network may overlap with the indoor building blocks due to its excessive width. The expanded first road network is further refined by erosion. The resulting main road network contains both the vertical and horizontal features of the original road network, ensures its own smoothness, and avoids the impact of excessive road width on the original indoor building image. It has the characteristics of good visual effect, high smoothness and no overlap with shop blocks.
[0085] In some embodiments of the present invention, optionally, the erosion thinning process includes: calculating the width of the first road network after dilation, and then using a unit convolution kernel to traverse the entire image to obtain the eroded central axis features, thereby achieving the final extraction of the main road network. The erosion thinning formula is:
[0086]
[0087] Where: A represents the original image (in this case, the first road network);
[0088] B represents the convolution kernel;
[0089] Let B be the new set obtained by reflecting and translating it by z.
[0090] This formula represents if (B) z If it is still contained in A, then the set of all its z points is called the erosion of B by A. The result of the erosion is that the outer perimeter of the original image is removed.
[0091] In some embodiments of the present invention, optionally, acquiring images containing multiple indoor buildings and preprocessing the images to obtain a first base map containing the outline information of the indoor buildings includes:
[0092] The image is then denoised.
[0093] The image after denoising is standardized to grayscale, and the grayscale values of the pixels in the image are rounded down.
[0094] Binarize the grayscale values of the pixels in the image to determine the outline of the interior building;
[0095] Extract the position information of the concave and convex vertices of the outline of the interior building.
[0096] In this embodiment of the invention, the contours of indoor buildings are extracted by denoising, standardizing grayscale, and binarizing the image pixels of the original image. Furthermore, the positional information of the concave and convex vertices of the extracted contours is further extracted for use in the next step of road network skeleton extraction. The method extracts the concave and convex vertex positional information directly, quickly, easily, and is suitable for large-scale processing, with a high degree of automation.
[0097] In some embodiments of the present invention, median filtering may be used to denoise the image.
[0098] In some embodiments of the present invention, optionally, the calculation formula for standard grayscale processing of the denoised image is as follows:
[0099]
[0100] in:
[0101] Gray represents the grayscale value of the image after standard grayscale processing;
[0102] R represents the red pixel value of the image;
[0103] G represents the green pixel value of the image;
[0104] B represents the blue pixel value of the image.
[0105] In some embodiments of the present invention, optionally, rounding the grayscale value of the pixel of the image includes: retaining the calculated grayscale value to an integer value, in the range of 0-255.
[0106] In some embodiments of the present invention, optionally, binarizing the grayscale values of the pixels in the image includes setting the grayscale values of the pixels in the image to 0 or 255 to present a clear black and white effect, thereby determining the outline of the target.
[0107] Please see Figure 2 , Figure 2 This invention provides a schematic diagram of a horizontal main road network. In some embodiments of the invention, optionally, the step of extracting skeleton information from the outline information of the indoor buildings in the first base map using horizontal and vertical intercept methods, and constructing the horizontal and vertical road networks of the indoor buildings using the skeleton information, includes:
[0108] Obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V;
[0109] Sort the y-coordinates of the concave and convex vertices in ascending order to obtain the first y-coordinate sequence (y1, y2, y3, ..., yn);
[0110] Starting from i=1, continuously obtain the intersection points of the horizontal line y=yi and the outline C of the indoor building, and store the intersection points in the set U until i=n, where i and n are both positive integers;
[0111] Sort the points in set U by their x-coordinates from smallest to largest, calculate the coordinates of the midpoints of any two connected points in set U, and store the midpoints in set W.
[0112] Based on the x-coordinate of the midpoint, the points in the set W are connected sequentially to construct a horizontal road network.
[0113] In this embodiment of the invention, the road feature points of indoor buildings are obtained and the skeleton of the horizontal main road network is extracted based on the horizontal intercept method, providing a highly automated, accurate, complete and fast method for generating a horizontal main road network.
[0114] Please see Figure 3 , Figure 3 This invention provides a schematic diagram of a vertical main road network. In some embodiments of the invention, optionally, the step of extracting skeleton information from the outline information of the indoor buildings in the first base map using horizontal and vertical intercept methods, and constructing the horizontal and vertical road networks of the indoor buildings using the skeleton information, further includes:
[0115] Obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V;
[0116] Sort the x-coordinates of the concave and convex vertices in ascending order to obtain the first x-coordinate sequence (x1, x2, x3, ..., xn);
[0117] Starting from i=1, continuously obtain the intersection points of the horizontal line x=xi and the outline C of the indoor building, and store the intersection points in set P until i=n, where i and n are both positive integers;
[0118] Sort the points in set P by their ordinates from smallest to largest, calculate the coordinates of the midpoints of any two connected points in set P, and store the midpoints in set N.
[0119] Based on the ordinate of the midpoint, the points in the set N are connected sequentially to construct a vertical road network.
[0120] In this embodiment of the invention, the method of obtaining road feature points of indoor buildings and extracting the skeleton of the vertical main road network based on the vertical intercept method provides a highly automated, accurate, complete and fast method for generating a vertical main road network.
[0121] Please see Figure 7 , Figure 7 Comparative diagrams of road network structures obtained through various methods provided in embodiments of the present invention are shown. 71 represents a road network constructed using a point selection method (Prior Art 1), which suffers from missing information in some road networks. 72 represents a road network constructed using a single-line intercept method (Prior Art 2), which suffers from some road network overlapping shop blocks. 73 represents a road network constructed using the present invention, divided into a main road network and branch road networks. This results in a more complete, smooth, and detailed road network, with no overlap with indoor building blocks, and requires no extensive image processing. The method is simple and suitable for mass production. 730 is a magnified partial image of the road network constructed in this invention, where thin solid lines represent the main road network and thick solid lines represent branch road networks.
[0122] Please see Figure 7 In some embodiments of the present invention, at point 730, optionally, removing the overlapping portion of the feature lines of the interior building and the interior building to obtain the branch network of the main road network includes:
[0123] For the indoor buildings and their feature lines, the method of intersection and reversal is used to delete the line segments of the feature lines that overlap with the indoor buildings, thereby obtaining the branch network of the main road network.
[0124] In this embodiment of the invention, to further improve the precision of the indoor road network, it is necessary to construct a branch road network associated with the indoor buildings. This technical solution calculates the shortest distance between the centroid of the indoor building and the main road network to obtain the position of the "door". Based on the intersection and inversion of the line connecting the centroid and the "door", the overlapping part with the indoor building is removed as the branch road network of the indoor building. The branch road network of the main road network is then automatically constructed. This provides a road network construction method with high precision, high automation, convenient implementation and better meeting user needs.
[0125] Please refer to Figure 8 , Figure 8 This is one of the structural schematic diagrams of an automatic road network construction device provided in an embodiment of the present invention;
[0126] This invention also provides an automatic road network construction device, comprising:
[0127] The acquisition module 81 is used to acquire images containing multiple indoor buildings and preprocess the images to obtain a first base map containing the outline information of the indoor buildings;
[0128] The first extraction module 82 is used to extract the skeleton information of the outline information of the indoor building in the first base map by using the horizontal and vertical intercept methods, and to construct the horizontal and vertical road networks of the indoor building using the skeleton information.
[0129] The first integration module 83 is used to integrate the horizontal road network and the vertical road network onto the first base map, and to perform morphological operations on the horizontal road network and the vertical road network on the first base map to obtain the integrated main road network.
[0130] The second extraction module 84 is used to obtain the centroid point of the indoor building on the first base map, calculate the shortest distance from the centroid point to the main road network, and obtain the shortest distance feature point of the indoor building on the main road network.
[0131] The second integration module 85 is used to remove the overlapping part of the feature line of the indoor building and the indoor building to obtain the branch network of the main road network. The feature line is the line connecting the centroid of the indoor building and its corresponding shortest distance feature point.
[0132] In this embodiment of the invention, an image containing multiple indoor buildings is first preprocessed to convert the image into a binary outline of an indoor road network and obtain the concave and convex vertices of the outline edges. Then, horizontal and vertical cross-sections are used to extract road network feature points from the road network outline and traverse the entire outline. The road network obtained by the horizontal and vertical cross-section method is further extracted using morphological operations to extract the main road network information. Based on the centroid position of the indoor building blocks, the nearest intersection point to the centroid point on the main road network is calculated, and the line is connected to obtain the branch road network information between the position of the indoor building block "door" and the main road network. This provides a device for automatically constructing a road network containing a main road network and branch roads. The automatic road network construction device of this invention acquires road feature points and indoor main road networks based on horizontal and vertical cross-section methods, integrating features from both horizontal and vertical directions to supplement the single cross-section method. The integrated main road network, obtained by combining the horizontal and vertical road networks according to the road network width characteristics, ensures both the precision and smoothness of the road network construction while resolving issues such as disconnections and breakpoints at connection points in indoor images. Furthermore, based on the precise main road network, the "door" information of each indoor building is further obtained to construct the branch road network, further improving the completeness and precision of the final constructed road network. This device requires no large number of images for processing, operating only on the input images. The method is easy to implement, has a fast processing speed, and is suitable for large-scale production.
[0133] In some embodiments of the present invention, optionally, morphological operations on the horizontal and vertical road networks on the first base map include, but are not limited to, one or more of the following: dilation operations and erosion refinement operations on the horizontal and vertical road networks.
[0134] In some embodiments of the present invention, optionally, the method for calculating the shortest distance from the centroid to the main road network is the nearest neighbor analysis shortest distance method.
[0135] In some embodiments of the present invention, optionally, the first integration module 83 is further configured to determine the expansion coefficient and convolution kernel size based on the width difference between the horizontal road network and the vertical road network, perform expansion processing on the horizontal road network and / or the vertical road network to obtain a first road network, wherein the area of the first road network covers the horizontal road network and the vertical road network; and update the first road network to be the main road network.
[0136] In this embodiment of the invention, if only the line cutting method is used to automatically construct the indoor main road network, the generated road network has problems such as disconnection, breakpoints, and overlay on indoor buildings at the connection points. However, by first expanding and integrating the horizontal and vertical road networks into one road network, the direction of the main road network will be greatly smoothed, avoiding problems such as disconnection and breakpoints at the connection points in the indoor images.
[0137] In some embodiments of the present invention, optionally, the first integration module 83 is further configured to, after updating the first road network to a main road network, perform erosion and refinement processing on the main road network based on the width of the main road network and the unit convolution kernel, wherein the main road network after erosion and refinement processing includes the central axis feature of the first road network.
[0138] In this embodiment of the invention, the expanded first road network may overlap with the indoor building blocks due to its excessive width. The expanded first road network is further refined by erosion. The resulting main road network contains both the vertical and horizontal features of the original road network, ensures its own smoothness, and avoids the impact of excessive road width on the original indoor building image. It has the characteristics of good visual effect, high smoothness and no overlap with shop blocks.
[0139] In some embodiments of the present invention, optionally, the acquisition module 81 is further configured to perform denoising processing on the image; perform standardized grayscale processing on the denoised image and round down the grayscale values of the pixels of the image; binarize the grayscale values of the pixels of the image to determine the outline of the indoor building; and extract the position information of the concave and convex vertices of the outline of the indoor building.
[0140] In this embodiment of the invention, the contours of indoor buildings are extracted by denoising, standardizing grayscale, and binarizing the image pixels of the original image. Furthermore, the positional information of the concave and convex vertices of the extracted contours is further extracted for use in the next step of road network skeleton extraction. The positional information of the concave and convex vertices extracted by this device is direct, fast, easy to implement, suitable for large-scale processing, and highly automated.
[0141] In some embodiments of the present invention, optionally, the first extraction module 82 is further configured to obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V; sort the ordinates y of the concave and convex vertices from smallest to largest to obtain a first ordinate sequence (y1, y2, y3, ..., yn); starting from i = 1, continuously obtain the intersection points of the horizontal line y = yi and the outline C of the indoor building and store the intersection points in the set U until i = n, where i and n are both positive integers; sort the points in the set U by their abscissas from smallest to largest, calculate the coordinates of the midpoints of two connected points in the set U in turn, and store the midpoints in the set W; and connect the points in the set W in sequence according to the abscissa of the midpoints to construct a horizontal road network.
[0142] In this embodiment of the invention, the automatic road network construction device obtains road feature points of indoor buildings and extracts the skeleton of the horizontal main road network based on the horizontal intercept method, providing a road network construction device with a high degree of automation, high accuracy, completeness and fast and effective horizontal main road network.
[0143] In some embodiments of the present invention, optionally, the first extraction module 82 is further configured to obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V; sort the horizontal coordinates x of the concave and convex vertices from smallest to largest to obtain a first horizontal coordinate sequence (x1, x2, x3, ..., xn); starting from i = 1, continuously obtain the intersection points of the horizontal line x = xi and the outline C of the indoor building and store the intersection points in set P until i = n, where i and n are both positive integers; sort the points in set P by their vertical coordinates from smallest to largest, calculate the coordinates of the midpoints of two connected points in set P in turn, and store the midpoints in set N; and connect the points in set N in sequence according to the size of the vertical coordinates of the midpoints to construct a vertical road network.
[0144] In this embodiment of the invention, the automatic road network construction device obtains road feature points of indoor buildings and extracts the skeleton of the vertical main road network based on the vertical intercept method, providing a road network construction device with a high degree of automation, high accuracy, completeness and fast and effective vertical main road network.
[0145] In some embodiments of the present invention, optionally, the second extraction module 84 is further configured to, for the indoor building and its feature lines, use the intersection and inversion method to delete the part of the line segment that overlaps with the indoor building, so as to obtain the branch network of the main road network.
[0146] In this embodiment of the invention, to further improve the precision of the indoor road network, it is necessary to construct a branch road network associated with the indoor building. This technical solution calculates the shortest distance between the indoor building's centroid and the main road network to obtain the position of the "door". Based on the intersection and inversion of the line connecting the centroid and the "door", the overlapping part with the indoor building is removed as the branch road network of the indoor building. The branch road network of the main road network is then automatically constructed. This provides a road network construction device with high precision, high automation, convenient implementation and better meeting user needs.
[0147] Furthermore, it should be noted that all relevant content of each step involved in the above-described embodiment of the automatic road network construction method can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0148] Please refer to Figure 9 , Figure 9 for Figure 9 This is one of the structural schematic diagrams of an electronic device provided in an embodiment of the present invention. The present invention provides an electronic device 90, including a memory 91, a processor 92, and a program stored in the memory 91 and executable on the processor 92; when the processor 92 executes the program, it implements the steps in the automatic road network construction method as described in any of the above embodiments.
[0149] This invention also provides a readable storage medium storing a program that, when executed by a processor, implements the various processes of the road network automatic construction method embodiments described above; or implements the various processes of the road network automatic construction method embodiments described above, achieving the same technical effect. To avoid repetition, further details are omitted here. The readable storage medium can be any available medium or data storage device accessible to the processor, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs), etc.).
[0150] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other modifications under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these modifications are within the protection scope of the present invention.
Claims
1. A method for automatically constructing a road network, characterized in that, include: Acquire images containing multiple indoor buildings and preprocess the images to obtain a first base map containing the outline information of the indoor buildings; The outline information of the indoor building in the first base map is extracted by using the horizontal and vertical intercept methods, and the horizontal and vertical road networks of the indoor building are constructed using the skeleton information. The horizontal and vertical road networks are integrated onto the first base map, and morphological operations are performed on the horizontal and vertical road networks on the first base map to obtain the integrated main road network. Obtain the centroid point of the indoor building on the first base map, calculate the shortest distance from the centroid point to the main road network, and obtain the shortest distance feature point of the indoor building on the main road network; Remove the overlapping portion of the feature lines of the indoor buildings and the indoor buildings to obtain the branch network of the main road network. The feature lines are the lines connecting the centroid of the indoor buildings and their corresponding shortest distance feature points. The step of performing morphological operations on the horizontal and vertical road networks to obtain the integrated main road network includes: The expansion coefficient and convolution kernel size are determined based on the width difference between the horizontal road network and the vertical road network. The horizontal road network and / or the vertical road network are then expanded to obtain a first road network. The area of the first road network covers both the horizontal road network and the vertical road network. Update the first road network to become the primary road network.
2. The automatic road network construction method according to claim 1, characterized in that, After updating the first road network to become the main road network, the process also includes: Based on the width of the main road network and the unit convolution kernel, the main road network is subjected to erosion and refinement processing. The main road network after erosion and refinement processing includes the central axis features of the first road network.
3. The method of claim 1, wherein, The step of acquiring images containing multiple indoor buildings and preprocessing the images to obtain a first base map containing the outline information of the indoor buildings includes: The image is then denoised. The image after noise reduction is normalized to grayscale, and the grayscale values of the pixels in the image are rounded down. Binarize the grayscale values of the pixels in the image to determine the outline of the interior building; Extract the position information of the concave and convex vertices of the outline of the interior building.
4. The method of claim 1, wherein, The process of extracting skeleton information from the outline information of the indoor building in the first base map using horizontal and vertical intercept methods, and constructing the horizontal and vertical road networks of the indoor building using the skeleton information, includes: Obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V; Sort the y-coordinates of the concave and convex vertices in ascending order to obtain the first y-coordinate sequence (y1, y2, y3, ..., yn); Starting from i=1, continuously obtain the intersection points of the horizontal line y=yi and the outline C of the indoor building, and store the intersection points in the set U until i=n, where i and n are both positive integers; Sort the points in set U by their x-coordinates from smallest to largest, calculate the coordinates of the midpoints of any two connected points in set U, and store the midpoints in set W. Based on the x-coordinate of the midpoint, the points in the set W are connected sequentially to construct a horizontal road network.
5. The method of claim 1, wherein, The step of extracting skeleton information from the outline information of the indoor building in the first base map using horizontal and vertical intercept methods, and constructing the horizontal and vertical road networks of the indoor building using the skeleton information, further includes: Obtain the position coordinates of the concave and convex vertices of the outline C of the indoor building and store them in the skeleton point set V; Sort the x-coordinates of the concave and convex vertices in ascending order to obtain the first x-coordinate sequence (x1, x2, x3, ..., xn). Starting from i=1, continuously obtain the intersection points of the horizontal line x=xi and the outline C of the indoor building, and store the intersection points in set P until i=n, where i and n are both positive integers; Sort the points in set P by their ordinates from smallest to largest, calculate the coordinates of the midpoints of any two connected points in set P, and store the midpoints in set N. Based on the ordinate of the midpoint, the points in the set N are connected sequentially to construct a vertical road network.
6. The method of claim 1, wherein, The step of removing the overlapping portion of the feature lines of the interior buildings with the interior buildings to obtain the branch network of the main road network includes: For the indoor buildings and their feature lines, the method of intersection and reversal is used to delete the line segments of the feature lines that overlap with the indoor buildings, thereby obtaining the branch network of the main road network.
7. A road network automatic construction device characterized by comprising: include: The acquisition module is used to acquire images containing multiple indoor buildings and preprocess the images to obtain a first base map containing the outline information of the indoor buildings; The first extraction module is used to extract the skeleton information of the outline information of the indoor building in the first base map by using the horizontal and vertical intercept methods, and to construct the horizontal and vertical road networks of the indoor building using the skeleton information. The first integration module is used to integrate the horizontal road network and the vertical road network onto the first base map, and to perform morphological operations on the horizontal road network and the vertical road network on the first base map to obtain the integrated main road network. The second extraction module is used to obtain the centroid point of the indoor building on the first base map, calculate the shortest distance from the centroid point to the main road network, and obtain the shortest distance feature point of the indoor building on the main road network. The second integration module is used to remove the overlapping part of the feature line of the indoor building and the indoor building to obtain the branch network of the main road network. The feature line is the line connecting the centroid of the indoor building and its corresponding shortest distance feature point. The step of performing morphological operations on the horizontal and vertical road networks to obtain the integrated main road network includes: The expansion coefficient and convolution kernel size are determined based on the width difference between the horizontal road network and the vertical road network. The horizontal road network and / or the vertical road network are then expanded to obtain a first road network. The area of the first road network covers both the horizontal road network and the vertical road network. Update the first road network to become the primary road network.
8. An electronic device, characterized in that, It includes a memory, a processor, and a program stored in the memory and executable on the processor; characterized in that, when the processor executes the program, it implements the steps of the automatic road network construction method as described in any one of claims 1 to 6.
9. A readable storage medium having a program stored thereon, characterized in that, The program, when executed by the processor, implements the steps in the road network automatic construction method according to any one of claims 1 to 6.