CN115546455B - Three-dimensional building model singulation method, device and storage medium - Google Patents

Three-dimensional building model singulation method, device and storage medium Download PDF

Info

Publication number
CN115546455B
CN115546455B CN202211169471.6A CN202211169471A CN115546455B CN 115546455 B CN115546455 B CN 115546455B CN 202211169471 A CN202211169471 A CN 202211169471A CN 115546455 B CN115546455 B CN 115546455B
Authority
CN
China
Prior art keywords
building
model
data
osgb
dimensional
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211169471.6A
Other languages
Chinese (zh)
Other versions
CN115546455A (en
Inventor
高金顶
刘耿
张鸿辉
李瑞珠
张恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong National Institute Of Land Resources And Environment
Guodi Spacetime Information Technology Beijing Co ltd
Guangdong Guodi Planning Technology Co ltd
Original Assignee
Guangdong National Institute Of Land Resources And Environment
Guodi Spacetime Information Technology Beijing Co ltd
Guangdong Guodi Planning Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong National Institute Of Land Resources And Environment, Guodi Spacetime Information Technology Beijing Co ltd, Guangdong Guodi Planning Technology Co ltd filed Critical Guangdong National Institute Of Land Resources And Environment
Priority to CN202211169471.6A priority Critical patent/CN115546455B/en
Publication of CN115546455A publication Critical patent/CN115546455A/en
Application granted granted Critical
Publication of CN115546455B publication Critical patent/CN115546455B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Computer Graphics (AREA)
  • Health & Medical Sciences (AREA)
  • Architecture (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computer Hardware Design (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a three-dimensional building model singulation method, a device and a storage medium, wherein the method comprises the following steps: dividing the three-dimensional building model to obtain a plurality of model blocks, and generating DSM data and DOM data corresponding to each model block; inputting DSM data and DOM data into a pre-trained example segmentation model, extracting to obtain all building boundary data, and converting the building boundary data into vector boundary data of a building; and establishing double indexes for the OSGB files in the three-dimensional building model, and extracting each building monomer from the three-dimensional building model according to the double indexes and the vector boundary data of the building. According to the invention, by establishing the double index for the OSGB file in the three-dimensional building model and according to the double index and the vector boundary data of the building, each building monomer can be rapidly extracted from the three-dimensional building model, so that the efficiency of building monomer can be effectively improved.

Description

Three-dimensional building model singulation method, device and storage medium
Technical Field
The present invention relates to the field of geographic information technologies, and in particular, to a method and apparatus for singulating a three-dimensional building model, and a storage medium.
Background
Live-action three-dimensional modeling with oblique photography is a three-dimensional modeling technique that has been rapidly developed in recent years, and the OSGB (Open Scene Graph Binary) format is a mainstream format of result data of an oblique-photographic three-dimensional model. The OSGB format stores triangle face index, vertex data, and corresponding texture coordinate data. Because the structure of the surface model is a continuous triangular surface, the surface model can not distinguish single body information of ground features such as buildings, small products, roads, vegetation and the like, has no attribute and is inconvenient to inquire. Therefore, in order to overcome the disadvantage that oblique photography can only be seen and cannot be checked and managed, it is necessary to perform object management, that is, so-called instance segmentation. The object management can realize the transformation of the world based on the knowledge of the world, and can truly realize the real-scene three-dimensional three-structural semantic modeling of the above-ground-earth-underground natural and artificial environment.
The existing three-dimensional building model singulation method is usually an artificial auxiliary singulation method, and the height, texture and top outline are utilized to carry out artificial auxiliary finishing treatment to achieve singulation, but the large-scale building data size is large, and the existing three-dimensional building model singulation method needs to spend a great deal of labor time and effort to complete building singulation, so that the building singulation efficiency is low.
Disclosure of Invention
The invention provides a three-dimensional building model singulation method, a device and a storage medium, which are used for solving the technical problem that the existing three-dimensional building model singulation method needs to spend a great deal of labor time and effort to complete building singulation, so that the efficiency of building singulation is low.
One embodiment of the present invention provides a three-dimensional building model singulation method comprising:
dividing the three-dimensional building model to obtain a plurality of model blocks, and generating DSM data and DOM data corresponding to each model block;
inputting the DSM data and the DOM data into a pre-trained instance segmentation model, extracting to obtain all building boundary data, and converting the building boundary data into vector boundary data of a building;
and establishing a double index for an OSGB file in the three-dimensional building model, and extracting each building monomer from the three-dimensional building model according to the double index and vector boundary data of the building.
Further, the dividing the three-dimensional building model to obtain a plurality of model blocks includes:
obtaining an external rectangle of the three-dimensional building model;
calculating the width and the height of each model block according to the resolution of each model block in the three-dimensional building model and the width and the height of the output image;
and dividing the three-dimensional building model into a plurality of model blocks according to the circumscribed rectangle and the width and the height of each model block.
Further, the generating the DSM data and DOM data corresponding to each model block includes:
calculating the total block number of a plurality of model blocks;
calculating a lower left corner coordinate and an upper right corner coordinate of each model block according to the row and column index number of each model block based on the total block number, and determining the position of each model block according to the upper left corner coordinate and the upper right corner coordinate;
according to the position, width and height of each model block, an orthographic projection matrix of each model block is obtained through calculation;
and constructing an RTT camera of each model block according to the orthographic projection matrix and the position of each model block, extracting texture information and depth information of each model block according to the RRT camera, generating DOM data according to the texture information, and generating DSM data according to the depth information.
Further, before inputting the DSM data and the DOM data into a pre-trained instance segmentation model, the method comprises:
creating a training data set according to the DSM data and the DOM data;
and after regularization treatment is carried out on the training data set, inputting the regularized training data set into a training model to train to obtain a trained example segmentation model, wherein the training model comprises a mask RCNN model and a PAN model.
Further, the regularizing the training data set includes:
regularizing DOM data in the training data set:
Figure BDA0003858688870000031
wherein v is the current DOM pixel value, mean is the mean value, and std is the standard deviation;
regularizing DSM data in the training data set:
Figure BDA0003858688870000032
where h is the current DSM pixel value, h min Is the minimum value of the pixel value, h max Is the maximum of the pixel values.
Further, the converting the building boundary data into vector boundary data of a building includes:
carrying out fusion processing on all the building boundary data to obtain merged building boundary data;
and after regularization processing is carried out on the combined building boundary data, converting the combined building boundary data into vector data, setting a corresponding coordinate system for the vector data, and outputting the vector data as the building vector boundary data.
Further, the building a double index to the OSGB file in the three-dimensional building model, extracting each building monomer from the three-dimensional building model according to the double index and the vector boundary data of the building, including:
establishing an R tree index for a first-layer OSGB file in the three-dimensional building model;
establishing a mapping relation between the vector boundary data of each building and a first-layer OSGB file in the three-dimensional building model, and reading the vector boundary of each building according to the mapping relation;
acquiring a spatial range of the building, and acquiring an intersecting OSGB file intersecting the spatial range according to the R tree index;
establishing a quadtree index according to the intersected OSGB file, and acquiring a last layer OSGB file of the intersected OSGB file according to the quadtree index;
reading all triangles in the OSGB file, judging the spatial relation between each triangle and the vector boundary of the building, acquiring triangles intersected with and contained in the vector boundary of the building according to the spatial relation, calculating intersection points of the intersected triangles, performing triangulation on the intersected triangles according to the intersection points to obtain a plurality of triangles, and extracting intersection coordinates of the triangles and the vector boundary of the building to obtain building monomers.
Further, after establishing a double index for the OSGB file in the three-dimensional building model, extracting each building monomer from the three-dimensional building model according to the double index and vector boundary data of the building, the method further includes:
calculating a first texture coordinate of an intersection point of the triangle and a vector boundary of the building;
calculating a second texture coordinate of an internal vertex of an intersection of a vector boundary of the building and the triangle;
and performing triangular mesh reconstruction and texture reconstruction on the building monomer according to the first texture coordinates and the second texture coordinates to obtain a reconstructed building monomer.
One embodiment of the present invention provides a three-dimensional building model singulation apparatus comprising:
the image data generation module is used for dividing the three-dimensional building model to obtain a plurality of model blocks and generating DSM data and DOM data corresponding to each model block;
the boundary data conversion module is used for inputting the DSM data and the DOM data into a pre-trained example segmentation model, extracting all building boundary data, and converting the building boundary data into vector boundary data of a building;
and the building monomer module is used for establishing a double index for the OSGB file in the three-dimensional building model, and extracting each building monomer from the three-dimensional building model according to the double index and the vector boundary data of the building.
An embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where the computer program when executed controls a device in which the computer readable storage medium is located to perform a three-dimensional building model singulation method as described above.
According to the embodiment of the invention, by establishing the double index for the OSGB file in the three-dimensional building model and according to the double index and the vector boundary data of the building, each building monomer can be rapidly extracted from the three-dimensional building model, so that the efficiency of building monomer can be effectively improved; according to the embodiment of the invention, the network framework of the maskRCNN model is modified, so that the modified maskRCNN model is suitable for large-scale building monomer identification and extraction, the monomer efficiency can be effectively improved, and the application universality is further realized; according to the embodiment of the invention, the triangular mesh reconstruction and the texture reconstruction are carried out on the building monomers, so that the boundary saw tooth problem and the texture deformation problem of the cut monomer building can be effectively solved, the building monomer effect can be effectively improved, and the building monomers meeting the requirement format can be obtained.
Drawings
FIG. 1 is a schematic flow chart of a method for singulating a three-dimensional building model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of DOM data provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of DSM data provided by an embodiment of the present invention;
FIG. 4 is a flow chart of generating DSM data and DOM data provided by an embodiment of the present invention;
FIG. 5 is a schematic flow chart of acquiring building boundary data according to an embodiment of the present invention;
FIG. 6 is a diagram of a building boundary extraction effect provided by an embodiment of the present invention;
FIG. 7 is a schematic diagram of a building singulation extraction process provided by an embodiment of the present invention;
FIG. 8 is an R-tree index graph created from OSGB files and building boundaries provided by an embodiment of the present invention;
FIG. 9 is a graph of the building singulation result provided by an embodiment of the present invention;
FIG. 10 is a schematic view of the intersection of building vector boundary data and triangles provided by an embodiment of the present invention;
FIG. 11 is a schematic illustration of a building monomer after reconstruction provided by an embodiment of the present invention;
fig. 12 is a schematic flow chart of a three-dimensional building model singulation apparatus according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In the description of the present application, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or an implicit indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present application, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be either fixedly connected, detachably connected, or integrally connected, for example; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art in a specific context.
Referring to fig. 1, one embodiment of the present invention provides a three-dimensional building model singulation method, which includes:
s1, dividing a three-dimensional building model to obtain a plurality of model blocks, and generating DSM data and DOM data corresponding to each model block;
in the embodiment of the invention, the DSM data is digital surface model (Digital Surface Model, DSM) data, and the digital surface model refers to a ground elevation model comprising the heights of surface buildings, bridges, trees and the like; the DOM data is digital orthophoto data. The three-dimensional building model of the embodiment of the invention is a three-dimensional building model of oblique photography, the three-dimensional building model comprises a plurality of files in OSGB (Open Scene Graph Binary) format, and the OSGB format is a main stream format of result data of the three-dimensional building model of oblique photography.
Please refer to fig. 2, which is a schematic diagram of DOM data provided in an embodiment of the present invention; referring to fig. 3, a DSM data diagram according to an embodiment of the present invention is shown.
S2, inputting DSM data and DOM data into a pre-trained example segmentation model, extracting to obtain all building boundary data, and converting the building boundary data into vector boundary data of a building;
according to the embodiment of the invention, the DOM data and the DSM data generated by oblique photography are adopted to extract the boundary of the building, so that the problem of inconsistent resolution can be effectively solved, and the DOM data and the DSM data can be directly generated by oblique photography.
S3, establishing double indexes for the OSGB files in the three-dimensional building model, and extracting each building monomer from the three-dimensional building model according to the double indexes and vector boundary data of the building.
According to the embodiment of the invention, the double indexes are established for the OSGB file in the three-dimensional building model, and each building monomer can be rapidly extracted from the three-dimensional building model according to the double indexes and the vector boundary data of the building, so that the efficiency of building monomer can be effectively improved.
In one embodiment, the method for dividing the three-dimensional building model to obtain a plurality of model blocks includes:
s11, obtaining an external rectangle of the three-dimensional building model;
in the embodiment of the invention, the circumscribed rectangle of the three-dimensional building model can be obtained by reading the OSGB file of the three-dimensional building model, and the left lower corner coordinate and the right upper corner coordinate of the circumscribed rectangle are obtained and stored as xMin, yMin, xMax and yMax.
S12, calculating the width and the height of each model block according to the resolution of each model block in the three-dimensional building model and the width and the height of the output image;
in the embodiment of the invention, the calculation formula is as follows:
modelWidth=pixel*imgWidth
modelHeight=pixel*imgHeight
where model width is the width of each model block, model height is the height of each model block, pixel is the pel size, imgWidth and imgHeight are the width and height of the model block output image.
S13, dividing the three-dimensional building model into a plurality of model blocks according to the circumscribed rectangle and the width and the height of each model block.
In the embodiment of the invention, according to the whole range of the three-dimensional building model, the width of the model block and the height of the model block, the total number of blocks obtained after division is calculated:
rows=(bb.yMax-bb.yMin)/modelWidth+1
cols=(bb.xMax-bb.xMin)/modelHeight+1
wherein, the total row number after rows division, bb is the whole range of the three-dimensional building model, yMax and yMin are the maximum value and the minimum value of y in the whole range respectively, and cols is the total column number after division, xMax and xMin are the maximum value and the minimum value of x in the 0SGB range respectively.
In one embodiment, generating the DSM data and DOM data for each model block includes:
s101, calculating the total block number of a plurality of model blocks;
in the embodiment of the invention, the total number of blocks obtained after division can be calculated according to the whole range of the three-dimensional building model, the width of each model block and the height of the model block.
S102, calculating a lower left corner coordinate and an upper right corner coordinate of each model block according to a row and column index number of each model block based on the total block number, and determining the position of each model block according to the upper left corner coordinate and the upper right corner coordinate;
in the embodiment of the present invention, the position calculation formula of each model block is:
modelLeftBottomX=xmin+col*modelWidth
modelLeftBottomY=ymin+row*modelHeight
modelRightTopX=xmin+(col+1)*modelWidth
modelRightTopY=ymin+(row+1)*modelHeight
where modelreftbotomx and modelreftbotomy are the lower left-hand x and y coordinates of the model block and modelRightTopX and modelRightTopY are the upper right-hand x and y coordinates of the model block. col and row are the width and height of the current model block, xmin and ymin are the lower left corner coordinate values of the whole range of the three-dimensional building model.
S103, calculating to obtain an orthographic projection matrix of each model block according to the position, the width and the height of each model block;
constructing RTT cameras of each model block according to the orthographic projection matrix and the position of each model block, extracting texture information and depth information of each model block according to the RRT cameras, generating DOM data according to the texture information, and generating DSM data according to the depth information.
In the embodiment of the invention, an RRT camera of each model block is constructed according to the orthographic projection matrix and the position of each model block, the RTT camera performs depth rendering and color rendering on the model blocks according to a three-dimensional building scene rendering mechanism to obtain color texture data and depth texture data, DOM data is generated according to the color texture data, and DSM image data is generated according to the depth texture data. In a specific embodiment, both DOM data and DSM data are saved as tif files.
In the embodiment of the invention, because the small coordinates relative to the center point are stored in the oblique photography, the calculated results are all offset values relative to the center point, and the real coordinate values need to be output when the calculated results are output, the offset values are added on the basis of the calculated results, and the corresponding coordinate system is set, so that the subsequent extraction of building vector boundaries is convenient.
Referring to fig. 4, a flow chart of generating DSM data and DOM data according to an embodiment of the present invention is shown.
In one embodiment, before inputting the DSM data and DOM data into the pre-trained instance segmentation model, it comprises:
creating a training data set according to the DSM data and the DOM data;
in the embodiment of the invention, a training data set and a test data set are manufactured according to DSM data and DOM data, wherein the training data set is used for model training to obtain an instance segmentation model, and the test data set is used for evaluating the accuracy of the trained instance segmentation model. One way to make the training data set is to add the DOM data to the DSM data as the 4 th band.
And (3) after regularization treatment is carried out on the training data set, inputting the regularized training data set into a training model to train to obtain a trained example segmentation model, wherein the training model comprises a mask RCNN model and a PAN model.
In the embodiment of the invention, in order to adapt to large-scale extraction of vector boundary data of a building, fine adjustment is further performed on a mask RCNN model frame, specifically: adding the conv module of the rpnhead of the maskRCNN model to 2 layers; because the number of the extracted buildings in training is larger than the number of the extracted natural image boundaries commonly used by the frames, one image can have hundreds of buildings, and in order to improve training accuracy, the embodiment of the invention also increases the proposal layer number in rcnn to two times.
According to the embodiment of the invention, the network framework of the maskRCNN model is modified, so that the modified maskRCNN model is suitable for large-scale building monomer identification and extraction, the monomer efficiency can be effectively improved, and the application universality is further realized.
Referring to fig. 5, in an embodiment of the present invention, before the training data set is input to the training model for training, the method further includes performing data enhancement processing and data regularization processing on the training data set, where the data enhancement processing includes: the data is subjected to various random conversions, mainly using Gaussian noise, gaussian blur, tone, saturation adjustment, random inversion and random center clipping enhancement methods.
The data regularization process includes:
regularizing DOM data in the training data set:
Figure BDA0003858688870000091
wherein v is the current DOM pixel value, mean is the mean value, and std is the standard deviation;
regularizing DSM data in the training data set:
Figure BDA0003858688870000092
where h is the current DSM pixel value, h min Is the minimum value of the pixel value, h max Is the maximum of the pixel values.
In an embodiment of the present invention, the process of model training further includes:
model training is carried out in an example mask RCNN model and a PAN model, a model with mAP_50 (mean average precision at IOU > 50%) of more than 88% is obtained by a gradient loss reduction method through manufacturing training samples for building identification, and a trained example segmentation model is output.
In one embodiment, converting building boundary data into vector boundary data for a building includes:
s21, carrying out fusion processing on all building boundary data to obtain merged building boundary data;
in the embodiment of the present invention, the training and extracted picture size is 640 x 640, and the overlapping of adjacent pictures is 100. The boundary fusion of the building is divided into two types, and a larger threshold value is set for a non-overlapping area; for overlapping border areas, a smaller threshold is set to merge buildings at the border to obtain merged building border data.
S22, regularizing the combined building boundary data, converting the combined building boundary data into vector data, setting a corresponding coordinate system for the vector data, and outputting the vector data as the building boundary data.
In the embodiment of the invention, regularization processing is carried out on the boundary data of the combined building, and the regularization processing comprises the following steps:
converting boundary points in the merged building boundary data into faces;
converting complex polygons in the merged building boundary data into simple polygons;
and converting the irregular polygons in the merged building boundary data into regular polygons.
Referring to fig. 6, a diagram of a building boundary extraction effect according to an embodiment of the present invention is shown.
Referring to fig. 7, in one embodiment, creating a double index to an OSGB file in a three-dimensional building model, extracting each building element from the three-dimensional building model according to the double index and vector boundary data of the building, includes:
establishing an R tree index for a first-layer OSGB file in the three-dimensional building model;
in the embodiment of the invention, since the OSGB data in the three-dimensional building model is stored in the file format, each region is composed of a plurality of folders, and each folder contains hundreds of files in the OSGB format.
Optionally, in the embodiment of the present invention, an R tree index is created only for the first layer OSGB file in each folder, and according to the association relationship between files in each folder, the association between all files in the same folder can be created through one R tree index. The method comprises the following steps: and reading the OSGB files with the same names of each folder and each folder by traversing the folders in the three-dimensional building model, obtaining the spatial range of the OSGB files, and establishing an R tree index according to the spatial range.
Establishing a mapping relation between the vector boundary data of each building and a first-layer OSGB file in the three-dimensional building model, and reading the vector boundary of each building according to the mapping relation;
acquiring a space range of a building, and acquiring an intersecting OSGB file intersecting the space range according to an R tree index;
after the intersecting OSGB files are obtained, they may also be stored by constructing a storage index. Referring to fig. 8, an R tree index diagram created from OSGB files and building boundaries is provided for implementation of the present invention. As shown in fig. 8, the storage index is constructed from the spatial relationship and the OSGB file is stored.
{
A:[Tile_+024_+010],
B:[Tile_+025_+10],
C:[Tile_+025_+10,Tile_+025_+11],
D:[Tile_+025_+011,Tile_+026_+011,Tile_+025_+012,Tile_+026_+012],
…..
}。
Establishing a quadtree index according to the intersected OSGB file, and acquiring a last layer of OSGB file of the intersected OSGB file according to the quadtree index;
reading all triangles in the OSGB file, judging the spatial relation between each triangle and the vector boundary of the building, acquiring the triangles intersected with and contained in the vector boundary of the building according to the spatial relation, calculating the intersection points of the intersected triangles, carrying out triangular mesh division on the intersected triangles according to the intersection points to obtain a plurality of triangles, and extracting the intersection coordinates of the triangles and the vector boundary of the building to obtain a building monomer. Wherein the triangle included is a triangle included in the vector boundary. Fig. 9 is a schematic diagram of a building monomer extraction result according to an embodiment of the present invention.
In the embodiment of the invention, all OSGB files intersected with the vector boundary of the building are read, specifically: and reading the space range of the second-layer OSGB file (sub-OSGB file of the first-layer OSGB file), judging whether the current OSGB file has an intersecting relation with the vector boundary of the building according to the space range, if so, acquiring a triangle intersecting with the vector boundary of the building and a triangle contained in the vector boundary of the building, and if not, skipping the current OSGB file. And after the current OSGB file is read, continuing to read the next OSGB file until all the OSGB files are read.
In one embodiment, after establishing a double index to the OSGB file in the three-dimensional building model, extracting each building monomer from the three-dimensional building model according to the double index and vector boundary data of the building, further includes:
calculating a first texture coordinate of an intersection point of the triangle and a vector boundary of the building;
in the embodiment of the invention, coordinate values of the intersection of the triangle and the vector boundary of the building are calculated:
and calculating an intersection point according to the intersection relation of the upper lines.
Referring to fig. 10, a broken line is one-sided data of a vector boundary of a building, and a triangle is V 0 V 1 V 2 The intersecting part is a polygon V 0 I 1 CI 2 V 2 . According to the intersecting relation of the upper lines, an intersecting point I is calculated 1 And I 2 X, y, z coordinate values of (c).
The intersection of a triangle with the vector boundary of a building, i.e. boundary point I 1 And I 2 The first texture coordinates of the triangle can be obtained by linear interpolation according to the texture coordinates of two end points on the triangle boundary:
Figure BDA0003858688870000121
Figure BDA0003858688870000122
wherein u is i1 And v i1 To calculate I 1 Uv coordinates of texture of (2), u 1 And v 1 Texture uv coordinates, u, starting point V1 0 And v 0 Texture uv coordinate, x, for endpoint V0 0 And y 0 The xy coordinates, x of the vertex as the origin V1 1 And y 1 At the end point V 0 X of the vertex xy coordinates of (x) i1 And y i1 Is the intersection point I 1 Xy coordinates of the vertex of (a).
Calculating a second texture coordinate of an internal vertex of an intersection of a vector boundary of the building and the triangle;
in the embodiment of the invention, the second texture coordinates of the internal vertexes of the intersection part of the vector boundary of the building and the triangle can be obtained according to the texture coordinate inverse distance interpolation of the 3 vertexes of the triangular patch:
Figure BDA0003858688870000123
Figure BDA0003858688870000124
wherein u is c And v c The texture uv coordinates for the interior point C to be calculated. u (u) i And v i Texture uv coordinates for three vertices V0, V1, V2 of the triangle. D (D) i And calculating the distance value from C to three vertexes of the triangle by adopting Euclidean distance.
And performing triangular mesh reconstruction and texture reconstruction on the building monomer according to the first texture coordinates and the second texture coordinates to obtain a reconstructed building monomer.
Fig. 11 is a schematic diagram of a reconstructed building monomer according to an embodiment of the present invention.
According to the embodiment of the invention, the triangular mesh reconstruction and the texture reconstruction are carried out on the building monomers, so that the boundary saw tooth problem and the texture deformation problem of the cut monomer building can be effectively solved, the building monomer effect can be effectively improved, and the building monomers meeting the requirement format can be obtained.
The embodiment of the invention has the following beneficial effects:
according to the embodiment of the invention, by establishing the double index for the OSGB file in the three-dimensional building model and according to the double index and the vector boundary data of the building, each building monomer can be rapidly extracted from the three-dimensional building model, so that the efficiency of building monomer can be effectively improved; according to the embodiment of the invention, the network framework of the maskRCNN model is modified, so that the modified maskRCNN model is suitable for large-scale building monomer identification and extraction, the monomer efficiency can be effectively improved, and the application universality is further realized; according to the embodiment of the invention, the triangular mesh reconstruction and the texture reconstruction are carried out on the building monomers, so that the boundary saw tooth problem and the texture deformation problem of the cut monomer building can be effectively solved, the building monomer effect can be effectively improved, and the building monomers meeting the requirement format can be obtained.
Referring to fig. 12, based on the same inventive concept as the above embodiment, an embodiment of the present invention provides a three-dimensional building model singulation apparatus, including:
the image data generating module 10 is configured to divide the three-dimensional building model to obtain a plurality of model blocks, and generate DSM data and DOM data corresponding to each model block;
the boundary data conversion module 20 is configured to input the DSM data and the DOM data into a pre-trained instance segmentation model, extract all building boundary data, and convert the building boundary data into vector boundary data of a building;
building singulation module 30 is configured to create a double index for the OSGB file in the three-dimensional building model, and extract each building singulated from the three-dimensional building model according to the double index and vector boundary data of the building.
In one embodiment, the image data generating module 10 is further configured to:
obtaining an external rectangle of the three-dimensional building model;
calculating the width and the height of each model block according to the resolution of each model block in the three-dimensional building model and the width and the height of the output image;
and dividing the three-dimensional building model into a plurality of model blocks according to the circumscribed rectangle and the width and the height of each model block.
In one embodiment, the image data generating module 10 is further configured to:
calculating the total block number of a plurality of model blocks;
calculating the left lower corner coordinate and the right upper corner coordinate of each model block according to the row and column index number of each model block based on the total block number, and determining the position of each model block according to the left upper corner coordinate and the right upper corner coordinate;
according to the position, the width and the height of each model block, an orthographic projection matrix of each model block is obtained through calculation;
constructing RTT cameras of each model block according to the orthographic projection matrix and the position of each model block, extracting texture information and depth information of each model block according to the RRT cameras, generating DOM data according to the texture information, and generating DSM data according to the depth information.
In one embodiment, the method further comprises a model training module for:
creating a training data set according to the DSM data and the DOM data;
and (3) after regularization treatment is carried out on the training data set, inputting the regularized training data set into a training model to train to obtain a trained example segmentation model, wherein the training model comprises a mask RCNN model and a PAN model.
In one embodiment, regularizing the training data set includes:
regularizing DOM data in the training data set:
Figure BDA0003858688870000141
wherein v is the current DOM pixel value, mean is the mean value, and std is the standard deviation;
regularizing DSM data in the training data set:
Figure BDA0003858688870000142
where h is the current DSM pixel value, h min Is the minimum value of the pixel value, h max Is the maximum of the pixel values.
In one embodiment, the boundary data conversion module 20 is further configured to:
carrying out fusion processing on all the building boundary data to obtain the merged building boundary data;
and (3) regularizing the combined building boundary data, converting the combined building boundary data into vector data, setting a corresponding coordinate system for the vector data, and outputting the vector data as the building vector boundary data.
In one embodiment, building singulation module 30 is also configured to:
establishing an R tree index for an OSGB file in the three-dimensional building model;
establishing a mapping relation between the vector boundary data of each building and all osbg files in the three-dimensional building model, and reading the vector boundary of each building according to the mapping relation;
acquiring a space range of a building, and acquiring an intersecting OSGB file intersecting the space range according to an R tree index;
establishing a quadtree index according to the intersected OSGB file, and acquiring a last layer of OSGB file of the intersected OSGB file according to the quadtree index;
reading all triangles in the OSGB file, judging the spatial relation between each triangle and the vector boundary of the building, acquiring the triangles intersected with and contained in the vector boundary of the building according to the spatial relation, calculating the intersection points of the intersected triangles, carrying out triangular mesh division on the intersected triangles according to the intersection points to obtain a plurality of triangles, and extracting the intersection coordinates of the triangles and the vector boundary of the building to obtain a building monomer. Wherein the triangle included is a triangle included in the vector boundary.
In one embodiment, the method further comprises a monomer reconstruction module for:
calculating a first texture coordinate of an intersection point of the triangle and a vector boundary of the building;
calculating a second texture coordinate of an internal vertex of an intersection of a vector boundary of the building and the triangle;
and performing triangular mesh reconstruction and texture reconstruction on the building monomer according to the first texture coordinates and the second texture coordinates to obtain a reconstructed building monomer.
An embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, where the computer-readable storage medium is controlled to execute the three-dimensional building model singulation method as described above in a device in which the computer program is located when the computer program is run.
The foregoing is a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention and are intended to be comprehended within the scope of the present invention.

Claims (8)

1. A method for singulating a three-dimensional building model, comprising:
dividing the three-dimensional building model to obtain a plurality of model blocks, and generating DSM data and DOM data corresponding to each model block;
inputting the DSM data and the DOM data into a pre-trained instance segmentation model, extracting to obtain all building boundary data, and converting the building boundary data into vector boundary data of a building;
the method comprises the steps of establishing a double index for an OSGB file in the three-dimensional building model, extracting each building monomer from the three-dimensional building model according to the double index and vector boundary data of the building, establishing a double index for the OSGB file in the three-dimensional building model, and extracting each building monomer from the three-dimensional building model according to the double index and the vector boundary data of the building, wherein the method comprises the following steps: establishing an R tree index for a first-layer OSGB file in the three-dimensional building model; establishing a mapping relation between the vector boundary data of each building and a first-layer OSGB file in the three-dimensional building model, and reading the vector boundary of each building according to the mapping relation; acquiring a spatial range of the building, and acquiring an intersecting OSGB file intersecting the spatial range according to the R tree index; establishing a quadtree index according to the intersected OSGB file, and acquiring a last layer OSGB file of the intersected OSGB file according to the quadtree index; reading all triangles in the OSGB file, judging the spatial relation between each triangle and the vector boundary of the building, acquiring triangles intersected with and contained in the vector boundary of the building according to the spatial relation, calculating intersection points of the intersected triangles, performing triangulation on the intersected triangles according to the intersection points to obtain a plurality of triangles, and extracting intersection coordinates of the triangles and the vector boundary of the building to obtain building monomers.
2. The method for singulating a three-dimensional building model according to claim 1, wherein the dividing the three-dimensional building model to obtain a plurality of model blocks comprises:
obtaining an external rectangle of the three-dimensional building model;
calculating the width and the height of each model block according to the resolution of each model block in the three-dimensional building model and the width and the height of the output image;
and dividing the three-dimensional building model into a plurality of model blocks according to the circumscribed rectangle and the width and the height of each model block.
3. The method for singulating a three-dimensional building model according to claim 1, wherein the generating the DSM data and DOM data corresponding to each model block comprises:
calculating the total block number of a plurality of model blocks;
calculating a lower left corner coordinate and an upper right corner coordinate of each model block according to the row and column index number of each model block based on the total block number, and determining the position of each model block according to the lower left corner coordinate and the upper right corner coordinate;
according to the position, width and height of each model block, an orthographic projection matrix of each model block is obtained through calculation;
constructing RTT cameras of each model block according to the orthographic projection matrix and the position of each model block, extracting texture information and depth information of each model block according to the RTT cameras, generating DOM data according to the texture information, and generating DSM data according to the depth information.
4. The method of three-dimensional building model singulation of claim 1, comprising, prior to inputting the DSM data and DOM data into a pre-trained instance segmentation model:
creating a training data set according to the DSM data and the DOM data;
and after regularization treatment is carried out on the training data set, inputting the regularized training data set into a training model to train to obtain a trained example segmentation model, wherein the training model comprises a mask RCNN model and a PAN model.
5. The method of three-dimensional building model singulation of claim 1, wherein the converting the building boundary data into vector boundary data for a building comprises:
carrying out fusion processing on all the building boundary data to obtain merged building boundary data;
and after regularization processing is carried out on the combined building boundary data, converting the combined building boundary data into vector data, setting a corresponding coordinate system for the vector data, and outputting the vector data as the building vector boundary data.
6. The method for singulating a three-dimensional building model according to claim 1, wherein after creating a double index for OSGB files in the three-dimensional building model, extracting each building unit from the three-dimensional building model according to the double index and vector boundary data of the building, further comprises:
calculating a first texture coordinate of an intersection point of the triangle and a vector boundary of the building;
calculating a second texture coordinate of an internal vertex of an intersection of a vector boundary of the building and the triangle;
and performing triangular mesh reconstruction and texture reconstruction on the building monomer according to the first texture coordinates and the second texture coordinates to obtain a reconstructed building monomer.
7. A three-dimensional building model singulation apparatus, comprising:
the image data generation module is used for dividing the three-dimensional building model to obtain a plurality of model blocks and generating DSM data and DOM data corresponding to each model block;
the boundary data conversion module is used for inputting the DSM data and the DOM data into a pre-trained example segmentation model, extracting all building boundary data, and converting the building boundary data into vector boundary data of a building;
building single module for establishing double index for OSGB file in the three-dimensional building model, extracting each building single from the three-dimensional building model according to the double index and vector boundary data of the building, wherein the building single module is specifically used for: establishing an R tree index for a first-layer OSGB file in the three-dimensional building model; establishing a mapping relation between the vector boundary data of each building and a first-layer OSGB file in the three-dimensional building model, and reading the vector boundary of each building according to the mapping relation; acquiring a spatial range of the building, and acquiring an intersecting OSGB file intersecting the spatial range according to the R tree index; establishing a quadtree index according to the intersected OSGB file, and acquiring a last layer OSGB file of the intersected OSGB file according to the quadtree index; reading all triangles in the OSGB file, judging the spatial relation between each triangle and the vector boundary of the building, acquiring triangles intersected with and contained in the vector boundary of the building according to the spatial relation, calculating intersection points of the intersected triangles, performing triangulation on the intersected triangles according to the intersection points to obtain a plurality of triangles, and extracting intersection coordinates of the triangles and the vector boundary of the building to obtain building monomers.
8. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the three-dimensional building model singulation method according to any one of claims 1 to 6.
CN202211169471.6A 2022-09-22 2022-09-22 Three-dimensional building model singulation method, device and storage medium Active CN115546455B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211169471.6A CN115546455B (en) 2022-09-22 2022-09-22 Three-dimensional building model singulation method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211169471.6A CN115546455B (en) 2022-09-22 2022-09-22 Three-dimensional building model singulation method, device and storage medium

Publications (2)

Publication Number Publication Date
CN115546455A CN115546455A (en) 2022-12-30
CN115546455B true CN115546455B (en) 2023-06-30

Family

ID=84728648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211169471.6A Active CN115546455B (en) 2022-09-22 2022-09-22 Three-dimensional building model singulation method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115546455B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117370582A (en) * 2023-11-02 2024-01-09 广州蓝图地理信息技术有限公司 Natural resource element three-dimensional materialization modeling method based on multi-data fusion

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785710A (en) * 2021-01-28 2021-05-11 湖北省国土测绘院 Rapid unitization method, system, memory and equipment for OSGB three-dimensional model building

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2006201207B2 (en) * 2000-06-09 2007-12-13 Honeywell Limited Human machine interface
DE10158786A1 (en) * 2001-11-30 2003-06-12 Icopal As Kastrup Building structure comprises a protective coating of two bitumen-impregnated core-containing coatings, a bitumen layer on the first layer's surface and an acrylic-based polymer layer
CN114612488A (en) * 2022-03-11 2022-06-10 中国电建集团中南勘测设计研究院有限公司 Building-integrated information extraction method, computer device, and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785710A (en) * 2021-01-28 2021-05-11 湖北省国土测绘院 Rapid unitization method, system, memory and equipment for OSGB three-dimensional model building

Also Published As

Publication number Publication date
CN115546455A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN110443842B (en) Depth map prediction method based on visual angle fusion
US8270704B2 (en) Method and apparatus for reconstructing 3D shape model of object by using multi-view image information
RU2215326C2 (en) Image-based hierarchic presentation of motionless and animated three-dimensional object, method and device for using this presentation to visualize the object
DE102015113240A1 (en) SYSTEM, METHOD AND COMPUTER PROGRAM PRODUCT FOR SHADING USING A DYNAMIC OBJECT ROOM GATE
CN113192179B (en) Three-dimensional reconstruction method based on binocular stereo vision
DE112009005074T5 (en) TECHNIQUES FOR QUICK STEREO RECONSTRUCTION FROM PICTURES
CN110544300B (en) Method for automatically generating three-dimensional model based on two-dimensional hand-drawn image characteristics
CN115546455B (en) Three-dimensional building model singulation method, device and storage medium
CN104182757A (en) Method of acquiring actual coverage area of measured target and device
CN113111861A (en) Face texture feature extraction method, 3D face reconstruction method, device and storage medium
JP2003323640A (en) Method, system and program for preparing highly precise city model using laser scanner data and aerial photographic image
CN112307553A (en) Method for extracting and simplifying three-dimensional road model
CN114549772B (en) Multi-source three-dimensional model fusion processing method and system based on engineering independent coordinate system
CN115861527A (en) Method and device for constructing live-action three-dimensional model, electronic equipment and storage medium
CN111508054B (en) Terrain construction method, device and equipment
CN115641415A (en) Method, device, equipment and medium for generating three-dimensional scene based on satellite image
CN115222806A (en) Polygon processing method, device, equipment and computer readable storage medium
CN116310111A (en) Indoor scene three-dimensional reconstruction method based on pseudo-plane constraint
CN116363290A (en) Texture map generation method for large-scale scene three-dimensional reconstruction
CN111524204B (en) Portrait hair cartoon texture generation method
CN117115358A (en) Automatic digital person modeling method and device
JP2002520969A (en) Automated 3D scene scanning from motion images
CN113077504B (en) Large scene depth map generation method based on multi-granularity feature matching
CN115033972A (en) Method and system for unitizing building main body structures in batches and readable storage medium
CN115131511A (en) Method for creating terrain based on oblique photography technology + Dynamo

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant