3D modeling method based on digital twin cities
By collecting stereoscopic images in real time and performing pixel difference calculation and feature matching, we can identify architectural changes and correct the three-dimensional model, which solves the problems of frequent modeling updates and high costs caused by rapid urban development, and improves modeling efficiency and accuracy.
Patent Information
- Application Number
- CN202410776512.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-17
AI Technical Summary
With the rapid development of cities, existing technologies in automatic 3D modeling of cities lead to frequent equipment updates due to changes in new and old buildings, resulting in high costs and expensive maintenance, and the update process is time-consuming.
By setting the observation duration, the stereoscopic image sequence is collected in real time, the pixel difference is calculated, the undetermined area is identified, the building digital surface model is generated, differential calculation and feature matching are performed, the historical 3D model is corrected, and the final city 3D model is generated.
It improves the efficiency and accuracy of urban building modeling, reduces the amount of data processing calculations, and achieves accurate identification and detailed modeling of building changes.
Smart Images

Figure CN118799488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional city modeling, and in particular to a 3D modeling method based on a digital twin city. Background Art
[0002] Digital twins refer to digital models or virtual models that simulate actual physical systems or processes and are updated and optimized using real-time data inputs. Digital twin technology can help companies better understand their businesses and systems and make real-time optimizations and decisions. In the field of urban planning, digital twin technology can help urban planners create digital models to simulate urban development, transportation, and the environment. These digital models can receive real-time data inputs, such as population changes, traffic flow, and environmental quality, to help urban planners better understand urban development, predict possible problems, and take appropriate measures to optimize urban planning and improve the urban environment, realize the intelligent visualization of smart city construction, and provide full-process visualization support for various smart city applications.
[0003] With the development of digital twin technology, people have higher and higher requirements for the quality of automatic 3D modeling of urban planning. Existing technologies usually use real-life 3D models obtained from aerial oblique images to achieve automatic 3D modeling of cities. However, with the rapid development of cities, there are constant changes between old and new buildings. Therefore, after the platform is built, it still faces the task of updating. The high cost brought by expensive equipment and the inconvenience of subsequent updates make the maintenance of urban models time-consuming and expensive. Summary of the invention
[0004] The purpose of the present invention is to provide a 3D modeling method based on digital twin cities to solve the following technical problems:
[0005] However, with the rapid development of the city, there are constant changes between old and new buildings. Therefore, after the platform is built, it still faces the task of updating. The high cost of expensive equipment and the inconvenience of subsequent updates make the maintenance of the city model time-consuming and expensive.
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] A 3D modeling method based on a digital twin city comprises the following steps:
[0008] S1, set the observation time T, collect the continuous stereo image sequence Y1, Y2, ..., Yn of the current city in real time during the observation time T, pre-process the stereo images in sequence and calculate the pixel differences between adjacent stereo images respectively, obtain the pixel change frequency in any image area, and if there is any image area with a pixel change frequency less than or equal to a preset threshold, mark the image area as a pending area;
[0009] S2, performing building image recognition on the area to be determined, obtaining all building image areas and generating building digital surface models, obtaining the digital surface models of urban historical buildings and performing differential calculation with the building digital surface models to obtain change difference results, extracting edge features of the change difference results, and obtaining a number of target areas;
[0010] S3, select any target area and obtain street view photos of the target area from different perspectives, perform feature matching on the street view photos from different perspectives, generate a three-dimensional model of the target area, and modify the historical city three-dimensional model according to the three-dimensional model of the target area to obtain a final city three-dimensional model.
[0011] As a further solution of the present invention: in S1, the specific process of preprocessing the stereoscopic image is:
[0012] The stereo image is gray-processed to obtain a gray image, the gray image is geometrically corrected, radiometrically corrected and atmospherically corrected, the corrected gray image is denoised, Harris corner detection is used to extract feature points in the gray image, a nearest neighbor matching algorithm is used to match feature points of the gray image, and the stereo image is corrected in sequence according to the matching results.
[0013] As a further solution of the present invention: In S1, the specific generation process of the area to be determined is:
[0014] A corrected stereo grayscale image is obtained, a rectangular coordinate system is established with the central pixel of the stereo grayscale image as the origin, the coordinates (x, y) of all pixels in the stereo grayscale image are generated, and the grayscale values Pi (x, y) of all pixels in the stereo grayscale image are identified, i = 1, ..., n, i represents the order of the stereo grayscale image where the pixel is located in the sequence, and the grayscale difference D of the pixel at the same position between adjacent stereo grayscale images is calculated by the grayscale difference formula D = |Pi+1(x, y)-Pi(x, y)|. If D is greater than a preset threshold, it indicates that the corresponding pixel is a changed pixel. If D is less than or equal to the preset threshold, it indicates that the corresponding pixel is an unchanged pixel. The changed pixel value s of any image position is obtained, and the pixel change frequency in any image area is calculated according to the calculation formula p = s / n-1. The areas where the pixel change frequency of all image areas is less than or equal to the preset threshold are fitted to generate a pending area.
[0015] As a further solution of the present invention: in S1, if there is any image area whose pixel change frequency is greater than a preset threshold, the image area is marked as a non-building image area;
[0016] As a further solution of the present invention: In S2, the specific process of obtaining the building area is:
[0017] S11. Apply the edge extraction algorithm to the area to be determined for edge extraction. Then, based on the extracted edge features, extract the line features of the image, and use the Douglas–Peucker algorithm to simplify the line features.
[0018] S12. Select any straight line segment and calculate its length and direction to obtain the lengths and directions of all straight line segments. Obtain all straight line segments whose directions are within the preset direction interval [0, 180]. Divide the preset direction interval into several sub-direction intervals according to the preset step size, and calculate the line feature value P within any sub-direction interval in turn. The feature value where m is the number of straight lines in sub-direction interval j, n is the number of all sub-direction intervals, and qi is the length of any straight line segment. If there exists a line feature value P of any sub-direction interval greater than the preset threshold, then label this sub-direction interval as the target direction interval. Calculate the direction difference between the target direction intervals. If there exists a direction difference of 90 degrees, then label this target direction interval as the vertical interval to obtain the number N of all vertical intervals.
[0019] S13. Calculate the building coefficient A. If there exists a building coefficient A of any area to be determined greater than the preset threshold, then determine that this area to be determined is the building image area. Building coefficient A = (1 + N) * P0; N is the number of vertical intervals, and P0 represents the direction feature value of the interval with direction 0.
[0020] As a further solution of the present invention: In S2, it further includes classifying the difference change result. The specific process is as follows:
[0021] If the change object is a building in the historical building digital surface model and also a building in the current digital surface model, then obtain the elevation data DSM of this change object. If DSM t1 < DSM t2, then determine that the category of this change object is increase, where t1 is the historical time and t2 is the current time; if the change object is a building in the historical building digital surface model and also a building in the current digital surface model, then obtain the elevation data DSM of this change object. If DSM t1 > DSM t2, then determine that the category of this change object is decrease; if the change object is a building in the historical building digital surface model and a non-building in the current digital surface model, then the category of this object is demolition; if the change object is a non-building in the historical building digital surface model and a building in the current digital surface model, then the category of this change object is new construction.
[0022] As a further solution of the present invention: It further includes that if the classification result of any change object is increase or decrease, then directly calculate the elevation data difference dDSM of this change object and perform corresponding height adjustment on the original urban historical building digital surface model according to the calculated elevation data difference dDSM.
[0023] As a further solution of the present invention: in S3, the process of correcting the historical city three-dimensional model is:
[0024] The geometric relationship of the target area is determined through the street view image after feature matching, the dense point cloud is optimized by an accelerated dense matching algorithm, and a three-dimensional model of the target area is reconstructed. The target area is obtained and a minimum circumscribed rectangle is constructed to establish a buffer zone. A reference system is constructed with buildings in non-target areas within the buffer zone. The position information of the current target area is obtained based on the reference system, and the three-dimensional model of the historical city is corrected based on the position information.
[0025] Beneficial effects of the present invention:
[0026] The present invention first sets an observation time and acquires a city stereo image in real time, filters out non-building targets from the city building image according to the pixel change frequency at the same position between the stereo images, and obtains a pending area, then performs building image recognition on the pending area, further identifies the building target and constructs a building digital surface model, performs differential calculation with the city historical building surface model in advance, obtains the city building change area, acquires street view photos of the city change area from different perspectives, performs feature matching on the street view photos of the different perspectives, generates a three-dimensional model of the target area, and corrects the historical city three-dimensional model according to the three-dimensional model of the target area to obtain a final city three-dimensional model. The present invention greatly improves the efficiency and accuracy of urban building modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The present invention will be further described below in conjunction with the accompanying drawings.
[0028] Figure 1 It is a flow chart of a 3D modeling method based on a digital twin city of the present invention. DETAILED DESCRIPTION
[0029] 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 only 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.
[0030] See also Figure 1 As shown, the present invention is a 3D modeling method based on a digital twin city, comprising the following steps:
[0031] S1, set the observation time T, collect the continuous stereo image sequence Y1, Y2, ..., Yn of the current city in real time during the observation time T, pre-process the stereo images in sequence and calculate the pixel differences between adjacent stereo images respectively, obtain the pixel change frequency in any image area, and if there is any image area with a pixel change frequency less than or equal to a preset threshold, mark the image area as a pending area;
[0032] S2, performing building image recognition on the area to be determined, obtaining all building image areas and generating building digital surface models, obtaining the digital surface models of urban historical buildings and performing differential calculation with the building digital surface models to obtain change difference results, extracting edge features of the change difference results, and obtaining a number of target areas;
[0033] S3, select any target area and obtain street view photos of the target area from different perspectives, perform feature matching on the street view photos from different perspectives, generate a three-dimensional model of the target area, and modify the historical city three-dimensional model according to the three-dimensional model of the target area to obtain a final city three-dimensional model.
[0034] The present invention first sets an observation time and acquires a city stereo image in real time, filters out non-building targets from the city building image according to the pixel change frequency at the same position between the stereo images, and obtains a pending area, then performs building image recognition on the pending area, further identifies the building target and constructs a building digital surface model, performs differential calculation with the city historical building surface model in advance, obtains the city building change area, acquires street view photos of the city change area from different perspectives, performs feature matching on the street view photos of the different perspectives, generates a three-dimensional model of the target area, and corrects the historical city three-dimensional model according to the three-dimensional model of the target area to obtain a final city three-dimensional model. The present invention greatly improves the efficiency and accuracy of urban building modeling.
[0035] It is noteworthy that the present invention can quickly identify the pending area containing the building image area by acquiring a continuous stereo image sequence in real time and calculating the pixel difference between adjacent stereo images, and greatly reduce the amount of data processing calculation by further performing building image recognition on the pending area, while realizing accurate recognition of the building image, thereby generating a building digital surface model based on the building image, and performing differential calculation with the digital surface model of the historical building, so as to accurately obtain the building changes and obtain the target area, and generate a three-dimensional model of the target area by acquiring street view photos of the target area from different perspectives and performing feature matching, and the final three-dimensional model of the city is more accurate and detailed.
[0036] In a preferred embodiment of the present invention, in S1, the specific process of preprocessing the stereoscopic image is:
[0037] The stereo image is gray-processed to obtain a gray image, the gray image is geometrically corrected, radiometrically corrected and atmospherically corrected, the corrected gray image is denoised, Harris corner detection is used to extract feature points in the gray image, a nearest neighbor matching algorithm is used to match feature points of the gray image, and the stereo image is corrected in sequence according to the matching results.
[0038] By performing grayscale processing, geometric correction, radiation correction and atmospheric correction on stereo images, the noise and non-target features in the image can be effectively reduced and the image quality can be improved. Harris corner point detection is used to extract feature points in the grayscale image, and the nearest neighbor matching algorithm is used to match the feature points of the grayscale image. The stereo images are corrected in turn according to the matching results to ensure the consistency of the layout of adjacent images.
[0039] In another preferred embodiment of the present invention, in S1, the specific process of generating the area to be determined is:
[0040] A corrected stereo grayscale image is obtained, a rectangular coordinate system is established with the central pixel of the stereo grayscale image as the origin, the coordinates (x, y) of all pixels in the stereo grayscale image are generated, and the grayscale values Pi (x, y) of all pixels in the stereo grayscale image are identified, i = 1, ..., n, i represents the order of the stereo grayscale image where the pixel is located in the sequence, and the grayscale difference D of the pixel at the same position between adjacent stereo grayscale images is calculated by the grayscale difference formula D = |Pi+1(x, y)-Pi(x, y)|. If D is greater than a preset threshold, it indicates that the corresponding pixel is a changed pixel. If D is less than or equal to the preset threshold, it indicates that the corresponding pixel is an unchanged pixel. The changed pixel value s of any image position is obtained, and the pixel change frequency in any image area is calculated according to the calculation formula p = s / n-1. The areas where the pixel change frequency of all image areas is less than or equal to the preset threshold are fitted to generate a pending area.
[0041] In another preferred embodiment of the present invention, in said S1, if there is any image area whose pixel change frequency is greater than a preset threshold, the image area is marked as a non-building image area;
[0042] In another preferred embodiment of the present invention, in said S2, the specific process of obtaining the building area is:
[0043] S11, edge extraction algorithm is used to extract the edge of the determined area, and then the straight line features of the image are extracted based on the edge feature extraction and the Douglas–Peucker algorithm is used to simplify the line features;
[0044] S12, select any straight line segment and calculate the length and direction of the straight line segment, obtain the length and direction of all straight line segments, obtain all straight line segments in the preset direction interval [0, 180], divide the preset direction interval into several sub-direction intervals according to the preset step size, and calculate the straight line eigenvalue P in any sub-direction interval in turn. Wherein, m is the number of straight lines in sub-direction interval j, n is the number of all sub-direction intervals, qi is the length of any straight line segment; if there is a straight line characteristic value P of any sub-direction interval greater than the preset threshold, then the sub-direction interval is marked as the target direction interval; the direction difference between the target direction intervals is calculated, and if there is a direction difference of 90 degrees, then the target direction interval is marked as a vertical interval, and the number of all vertical intervals N is obtained;
[0045] S13, calculate the building coefficient A. If the building coefficient A of any undetermined area is greater than the preset threshold, the undetermined area is determined to be a building image area; the building coefficient A = (1 + N) * P0; N is the number of vertical intervals, and P0 represents the directional characteristic value of the 0 interval.
[0046] First, detect the edge in the image. On the basis of edge extraction, further extract the straight line features in the image. In order to reduce the amount of calculation and improve accuracy, the Douglas-Peucker algorithm is used to simplify the detected line segments. This algorithm can eliminate those points that are not the main part of the straight line. For each straight line segment, calculate its length and direction, divide all directions into a preset interval [0,180], and further subdivide them into several sub-direction intervals according to the preset step size. For each sub-direction interval, calculate an eigenvalue P. This eigenvalue is based on the length and number of straight line segments in the interval. If the eigenvalue P of a sub-direction interval is greater than the preset threshold, it means that the straight line feature of the sub-interval is the main body. Check the direction difference between the target direction intervals. If there is a 90-degree difference, it is marked as a vertical interval. For areas where buildings exist, there is usually long straightness. Therefore, the P0 value is used to measure the building coefficient. The building coefficient is calculated to accurately determine whether the area to be determined is a building image area.
[0047] In another preferred embodiment of the present invention, the step S2 further includes classifying the difference change results, and the specific process is as follows:
[0048] If the object of change is a building in the historical building digital surface model and also a building in the current digital surface model, then obtain the elevation data DSM of the object of change. If DSM t1 < DSM t2, it is determined that the category of the object of change is an increase, where t1 is the historical time and t2 is the current time; if the object of change is a building in the historical building digital surface model and also a building in the current digital surface model, then obtain the elevation data DSM of the object of change. If DSM t1 > DSM t2, it is determined that the category of the object of change is a decrease; if the object of change is a building in the historical building digital surface model and a non-building in the current digital surface model, then the category of this object is demolition; if the object of change is a non-building in the historical building digital surface model and a building in the current digital surface model, then the category of this object of change is new construction.
[0049] In another preferred embodiment of the present invention, it further includes that if the classification result of any object of change is an increase or a decrease, directly calculate the elevation data difference dDSM of the object of change and perform corresponding height adjustment on the original digital surface model of the historical urban building according to the calculated elevation data difference dDSM.
[0050] In another preferred embodiment of the present invention, in S3, the process of correcting the historical urban three-dimensional model is as follows:
[0051] Determine the geometric relationship of the target area through the street view pictures after feature matching, optimize the dense point cloud through the accelerated dense matching algorithm, reconstruct and generate the three-dimensional model of the target area, obtain the target area and construct the minimum circumscribed rectangle to establish a buffer zone, use the buildings in the non-target area within the buffer zone to construct a reference system, obtain the position information of the current target area according to the reference system, and correct the historical urban three-dimensional model according to the position information.
[0052] The above has described a specific embodiment of the present invention in detail, but the content described is only a preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. All equivalent changes and improvements made according to the scope of the present invention application should still fall within the scope covered by the patent of the present invention.
Claims
1. A 3D modeling method based on digital twin city, characterized in that: The following steps are involved: S1, set the observation time T, collect the continuous stereo image sequence Y1, Y2, ..., Yn of the current city in real time during the observation time T, pre-process the stereo images in sequence and calculate the pixel differences between adjacent stereo images respectively, obtain the pixel change frequency in any image area, and if there is any image area with a pixel change frequency less than or equal to a preset threshold, mark the image area as a pending area; S2, performing building image recognition on the area to be determined, obtaining all building image areas and generating building digital surface models, obtaining the digital surface models of urban historical buildings and performing differential calculation with the building digital surface models to obtain change difference results, extracting edge features of the change difference results, and obtaining a number of target areas; S3, select any target area and obtain street view photos of the target area from different perspectives, perform feature matching on the street view photos from different perspectives, generate a three-dimensional model of the target area, and modify the historical city three-dimensional model according to the three-dimensional model of the target area to obtain a final city three-dimensional model.
2. A 3D modeling method based on a digital twin city according to claim 1, characterized in that: In S1, the specific process of preprocessing the stereoscopic image is as follows: The stereo image is gray-processed to obtain a gray image, the gray image is geometrically corrected, radiometrically corrected and atmospherically corrected, the corrected gray image is denoised, Harris corner detection is used to extract feature points in the gray image, a nearest neighbor matching algorithm is used to match feature points of the gray image, and the stereo image is corrected in sequence according to the matching results.
3. The 3D modeling method based on digital twin city according to claim 1, characterized in that: In S1, the specific generation process of the pending area is: A corrected stereo grayscale image is obtained, a rectangular coordinate system is established with the central pixel of the stereo grayscale image as the origin, the coordinates (x, y) of all pixels in the stereo grayscale image are generated, and the grayscale values Pi (x, y) of all pixels in the stereo grayscale image are identified, i = 1, ..., n, i represents the order of the stereo grayscale image where the pixel is located in the sequence, and the grayscale difference D of the pixel at the same position between adjacent stereo grayscale images is calculated by the grayscale difference formula D = |Pi+1(x, y)-Pi(x, y)|. If D is greater than a preset threshold, it indicates that the corresponding pixel is a changed pixel. If D is less than or equal to the preset threshold, it indicates that the corresponding pixel is an unchanged pixel. The changed pixel value s of any image position is obtained, and the pixel change frequency in any image area is calculated according to the calculation formula p = s / n-1. The areas where the pixel change frequency of all image areas is less than or equal to the preset threshold are fitted to generate a pending area.
4. The 3D modeling method based on digital twin city according to claim 1, characterized in that: In S1, if there is any image area whose pixel change frequency is greater than a preset threshold, the image area is marked as a non-building image area.
5. The 3D modeling method based on digital twin city according to claim 1, characterized in that: In S2, the specific process of obtaining the building area is: S11, edge extraction algorithm is used to extract the edge of the determined area, and then the straight line features of the image are extracted based on the edge feature extraction, and the Douglas–Peucker algorithm is used to simplify the line features; S12, select any straight line segment and calculate the length and direction of the straight line segment, obtain the length and direction of all straight line segments, obtain all straight line segments in the preset direction interval [0, 180], divide the preset direction interval into several sub-direction intervals according to the preset step size, and calculate the straight line eigenvalue P in any sub-direction interval in turn. Wherein, m is the number of straight lines in sub-direction interval j, n is the number of all sub-direction intervals, qi is the length of any straight line segment; if there is a straight line characteristic value P of any sub-direction interval greater than the preset threshold, then the sub-direction interval is marked as the target direction interval; the direction difference between the target direction intervals is calculated, and if there is a direction difference of 90 degrees, then the target direction interval is marked as a vertical interval, and the number of all vertical intervals N is obtained; S13. Calculate the building coefficient A. If the building coefficient A of any undetermined area is greater than the preset threshold, determine that the undetermined area is a building image area. The building coefficient A = (1 + N) * P0, where N is the number of vertical intervals and P0 represents the direction feature value of the 0 interval.
6. The 3D modeling method based on digital twin city according to claim 1, characterized in that: In S2, it also includes classifying the difference change result. The specific process is as follows: If the change object is a building in the historical building digital surface model and also a building in the current digital surface model, obtain the elevation data DSM of the change object. If DSMt1 < DSMt2, determine that the category of the change object is increase, where t1 is the historical time and t2 is the current time. If the change object is a building in the historical building digital surface model and also a building in the current digital surface model, obtain the elevation data DSM of the change object. If DSMt1 > DSMt2, determine that the category of the change object is decrease. If the change object is a building in the historical building digital surface model and a non-building in the current digital surface model, the category of the object is demolition. If the change object is a non-building in the historical building digital surface model and a building in the current digital surface model, the category of the change object is new construction.
7. The 3D modeling method based on digital twin city according to claim 6 is characterized in that: It also includes that if the classification result of any change object is increase or decrease, directly calculate the elevation data difference dDSM of the change object and perform corresponding height adjustment on the original urban historical building digital surface model according to the calculated elevation data difference dDSM.
8. The 3D modeling method based on digital twin city according to claim 1, characterized in that: In S3, the process of correcting the historical city three-dimensional model is as follows: Determine the geometric relationship of the target area through the street view pictures after feature matching, optimize the dense point cloud through the accelerated dense matching algorithm, reconstruct and generate the three-dimensional model of the target area, obtain the target area and construct the minimum circumscribed rectangle to establish a buffer zone, use the buildings in the non-target area within the buffer zone as a reference system, obtain the position information of the current target area according to the reference system and correct the historical city three-dimensional model.
Citation Information
Patent Citations
Three-dimensional city-model rapid updating method
CN106875467A
Building change detecting method based on graph cut optimization and image structure features
CN108197583A
A sports building evacuation crowd track generation method based on video images and WiFi positioning
CN109583366A
Three-dimensional urban modeling apparatus and three-dimensional urban modeling method
KR1020110070660A
Cited By
Historical building digital data processing method and system based on AI
CN119089558A
AI-based historical building digital data processing method and system
CN119089558B
Urban building three-dimensional visual lightweight system based on data fusion
CN120765877A
A city building three-dimensional visual lightweight system based on data fusion
CN120765877B
Urban model generation method and device, electronic equipment and storage medium
CN121259237A
