Methods, apparatus, equipment and media for 3D model individualization and semantic segmentation
By combining the establishment of surface models and sparse point clouds, high-precision monomerization and semantic segmentation of 3D models are achieved, which solves the problem of insufficient segmentation accuracy in the existing technology and is suitable for precise management and analysis of 3D models.
Patent Information
- Application Number
- CN202410703313.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The existing three-dimensional model single segmentation method is affected by angles and vectors, resulting in insufficient segmentation accuracy, making it difficult to achieve high-precision single segmentation and semantic segmentation.
Build a surface model by acquiring dense point clouds from the image set, and map it. Combined with the coordinate information of the sparse point cloud, obtain the relevant atlas of the target instance, perform semantic segmentation and assign instance names, and accurately match the vertices of the surface model to achieve Single and semantic segmentation of 3D models.
It improves the accuracy of single segmentation of three-dimensional models, reduces the amount of calculation, and achieves high-precision segmentation and acquisition of semantic information for single objects in three-dimensional space, which is suitable for further analysis and applications.
Smart Images

Figure CN118279329B
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional reconstruction technology, and in particular to a method, device, equipment and medium for monomerization and semantic segmentation of a three-dimensional model. Background Art
[0002] Three-dimensional reconstruction technology refers to the process of converting two-dimensional images or data into corresponding three-dimensional models using computer algorithms and mathematical models. Through this technology, the three-dimensional structure of objects or scenes can be restored from plane images or data, realizing the conversion from surface to space.
[0003] Oblique photography technology realizes three-dimensional reconstruction of the shooting scene through sparse reconstruction, dense reconstruction, point cloud modeling and other technologies; monomers such as buildings in the three-dimensional model obtained by three-dimensional reconstruction are segmented to facilitate model management; the existing monomer segmentation method: after reconstructing the three-dimensional model based on oblique photography technology, monomers such as buildings in the three-dimensional model are segmented through digital surface models and digital orthophoto data. This method is affected by angles and vectors, resulting in insufficient accuracy in monomer segmentation.
[0004] Therefore, the present application proposes a three-dimensional model monomerization and semantic segmentation method that can improve the accuracy. Summary of the invention
[0005] The present application provides a three-dimensional model monomerization and semantic segmentation method, device, equipment and medium to solve the problem of insufficient monomerization segmentation accuracy in the prior art.
[0006] In a first aspect, the present application provides a method for monomerization and semantic segmentation of a three-dimensional model, comprising:
[0007] Establishing a surface model according to a dense point cloud obtained from an image set, and mapping the surface model to obtain a mapping model;
[0008] Acquire a first target instance according to the top view of the mapping model, wherein the first target instance is a single object in the three-dimensional space represented by the image set;
[0009] Acquire a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud acquired from the image set;
[0010] Performing semantic segmentation on second target instances in the image set, and assigning an instance name to each second target instance, wherein the second target instance is a single object in the three-dimensional space represented by the image set, and the second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name;
[0011] According to the related atlas of the first target instance and the instance name of the second target instance, a third target instance corresponding to the vertices of the surface model is obtained, wherein the third target instance is a single object in the three-dimensional space represented by the image set.
[0012] In a possible implementation manner, acquiring a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud acquired from the image set includes:
[0013] Acquire the coordinate accuracy of the first target instance according to the first length and the first width of the top view, and the camera field of view and the camera height corresponding to the top view;
[0014] Acquire the geographic coordinates of the center point of the target frame of the first target instance according to the image coordinates of the center point of the target frame of the first target instance and the coordinate accuracy;
[0015] Acquire a third length and a third width of the target frame of the first target instance according to the second length and the second width of the target frame of the first target instance and the coordinate accuracy;
[0016] Acquire a first feature point set of the first target instance from the sparse point cloud according to the geographic coordinates of the center point of the target frame of the first target instance, and the third length and the third width of the target frame of the first target instance;
[0017] According to the first feature point set, a related atlas of the first target instance is acquired from the image set.
[0018] In a possible implementation manner, allocating an instance name to each second target instance includes:
[0019] According to the area occupied by the second target instance in the first image of the image set, an initial instance is obtained from multiple second target instances, an instance name is assigned to the initial instance, and a second feature point set in the mask of the initial instance is obtained;
[0020] A third feature point set of a second image in the image set is obtained. If a ratio of the third feature point set to the second feature point set exceeds a preset ratio, it is confirmed that the unnamed instance in the second image and the initial instance are the same single object, and the instance name of the initial instance is assigned to the unnamed instance.
[0021] In a possible implementation manner, performing semantic segmentation on the second target instance in the image set includes:
[0022] According to the segmentation requirements of the image set, obtaining the text prompt word of the second target instance;
[0023] Inputting the text prompt word into a semantic detection model to obtain a type detection box of the second target instance;
[0024] The type detection box is input into a segmentation model to obtain a mask of the second target instance in the type detection box.
[0025] In a possible implementation, acquiring the third target instance corresponding to the vertex of the surface model according to the related atlas of the first target instance and the instance name of the second target instance includes:
[0026] Obtain pixel coordinates of the vertices of the surface model with the highest accuracy on the third image according to the vertex coordinates of the surface model with the highest accuracy, the rotation matrix, the translation vector and the intrinsic parameters of the third image in the related atlas of the first target instance;
[0027] Acquire the third image covering the pixel coordinates to obtain a fourth image;
[0028] Assign the instance name of the first target instance that appears most times in the fourth image to the vertex of the surface model with the highest accuracy, and obtain the third target instance corresponding to the vertex of the surface model with the highest accuracy, wherein the instance names of the first target instance and the second target instance of the same single object are the same.
[0029] In a possible implementation, acquiring the first target instance according to the top view of the mapping model includes:
[0030] The first target instance is obtained according to the top view of the mapping model and the detection model, wherein the detection model is a model obtained by performing network training according to the top view of the historical mapping model and the annotation of the historical first target instance of the top view of the historical mapping model.
[0031] In a possible implementation, mapping the surface model to obtain a mapping model includes:
[0032] Mapping the surface model with the lowest precision to obtain a mapping model;
[0033] Before establishing the surface model according to the dense point cloud obtained from the image set, the method further includes:
[0034] Aerial images are acquired through a camera, and if the overlap rate between two consecutive aerial images is within a preset value range, it is confirmed that the two consecutive aerial images are selected into the image set.
[0035] In a second aspect, the present application provides a three-dimensional model monomerization and semantic segmentation device, comprising:
[0036] A modeling module, used for establishing a surface model according to a dense point cloud obtained from an image set, and mapping the surface model to obtain a mapping model;
[0037] A detection module, configured to obtain a first target instance according to a top view of the mapping model, wherein the first target instance is a single object in the three-dimensional space represented by the image set;
[0038] An indexing module, configured to obtain a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud obtained from the image set;
[0039] a segmentation module, configured to perform semantic segmentation on the second target instances in the image set and assign an instance name to each of the second target instances, wherein the second target instance is a single object in the three-dimensional space represented by the image set, and the second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name;
[0040] A processing module is used to obtain a third target instance corresponding to the vertices of the surface model according to the relevant atlas of the first target instance and the instance name, wherein the third target instance is a single object in the three-dimensional space represented by the image set.
[0041] In a third aspect, the present application provides a three-dimensional model monomerization and semantic segmentation device, including: at least one processor and a memory;
[0042] The memory stores computer-executable instructions;
[0043] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the three-dimensional model monomerization and semantic segmentation method as described above.
[0044] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the three-dimensional model monomerization and semantic segmentation method as described above.
[0045] The present application provides a method, apparatus, device and medium for monomerization and semantic segmentation of a three-dimensional model. A surface model is established based on a dense point cloud obtained from an image set, and the surface model is mapped to obtain a mapped model; a first target instance is obtained based on a top view of the mapped model, wherein the first target instance is a single object in the three-dimensional space represented by the image set; a related atlas of the first target instance is obtained from the image set based on the coordinate information of the first target instance and the sparse point cloud obtained from the image set; semantic segmentation is performed on the second target instance in the image set, and an instance name is assigned to each of the second target instances, wherein the second target instance is a single object in the three-dimensional space represented by the image set, and the second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name; a third target instance corresponding to the vertices of the surface model is obtained based on the related atlas and the instance name of the first target instance, wherein the third target instance is a single object in the three-dimensional space represented by the image set.
[0046] In the above method, the image data in the collected image set is processed into dense point cloud and sparse point cloud, and a three-dimensional surface model is established based on the dense point cloud, and the surface model is mapped to obtain a mapped model including more data information (such as color information); according to the top view of the mapped model, it is obtained which targets are in the mapped model to obtain a first target instance; the sparse point cloud has the same coordinate system as the dense point cloud, and the coordinate information of the first target instance is matched to the sparse point cloud, and the relevant atlas containing the first target instance can be obtained from the image set; the targets in the image set are obtained to obtain a second target instance; the second target instance is semantically segmented, the second target instance can be distinguished, and an instance name is assigned to the distinguished second target instance to achieve high-precision segmentation; in order to accurately match the targets corresponding to the vertices of the surface model, the relevant atlas of the first target instance and the instance name of the second target instance can be used to find the targets corresponding to the vertices of the surface model to obtain a third target instance, so that the targets in the surface model are accurately individualized and the semantic information of the targets can be obtained at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 A schematic diagram of a scene of three-dimensional model singulation and semantic segmentation provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 1 ;
[0050] Figure 3 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 2 ;
[0051] Figure 4 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 3 ;
[0052] Figure 5 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 4 ;
[0053] Figure 6 A diagram of a three-dimensional model monomerization and semantic segmentation device provided in an embodiment of the present invention;
[0054] Figure 7 A hardware schematic diagram of a 3D model singularization and semantic segmentation device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] Oblique photography technology achieves three-dimensional reconstruction of the captured scene through sparse reconstruction, dense reconstruction, point cloud modeling and other technologies; most of the existing oblique photography methods reconstruct an overall continuous three-dimensional model, without dividing the building into objects that can be selected individually, nor does it contain the structural information of the building (including the building's exterior walls, roofs, doors and windows, etc.). Such a three-dimensional model only serves as a browsing function and is not conducive to further analysis and application of the three-dimensional model.
[0057] The monomers such as buildings in the three-dimensional model obtained by three-dimensional reconstruction are segmented to facilitate model management; the existing monomer segmentation method: after reconstructing the three-dimensional model based on oblique photography technology, the monomers such as buildings in the three-dimensional model are segmented through digital surface models and digital orthophoto data. This method has a large amount of calculation required for adding models and processing images, and is affected by angles and vectors, resulting in insufficient accuracy in monomer segmentation.
[0058] Therefore, the present application proposes a three-dimensional model monomerization and semantic segmentation method that can improve accuracy and reduce the amount of calculation.
[0059] The following describes the implementation process of a three-dimensional model monomerization and semantic segmentation method proposed in the present application in conjunction with the accompanying drawings and specific embodiments.
[0060] Figure 1 A schematic diagram of a scene of three-dimensional model singulation and semantic segmentation provided in an embodiment of the present application. Figure 1 As shown, the system includes: an image set-101, a related atlas-102 and a top view-103;
[0061] The images in image set 101 are images taken by cameras, including monocular cameras and multi-camera cameras. The cameras can be set on drones to take images. The images in image set 101 include images of a single building and images of multiple buildings.
[0062] Dense point clouds and sparse point clouds can be obtained based on the images in the image set, and a surface model is established based on the dense point cloud. The three-dimensional surface model is a white model, which only includes the basic shape, structure and layout of the building, and does not include detailed information such as color, material, etc.; the surface model is mapped to obtain a three-dimensional mapping model;
[0063] The three-dimensional texture model has multiple perspectives, including top view-103, Figure 1 The top view-103 in the figure does not provide the three-dimensional detail information, etc., and is only a simplified example; there are multiple first target instances in the top view-103, that is, there are multiple single objects in the image sets;
[0064] The sparse point cloud has the same coordinate system as the dense point cloud. According to the coordinate information of the first target instance and the sparse point cloud, an image related to the first target instance can be selected from the image set. Multiple related images of the first target instance of the same single object constitute a related atlas-102. Figure 1 Two buildings are exemplified, i.e., two related atlases corresponding to two first target instances - 102;
[0065] By performing semantic segmentation on the second target instance in the image set, each single object in the image set can be obtained to obtain the second target instance, and an instance name is assigned to each second target instance, so that the second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name;
[0066] The surface model includes point information and edge information, wherein the point corresponding to the point information is a vertex. According to the vertex of the surface model, it can correspond to the relevant atlas-102 of the first target instance; according to the relevant atlas-102 and the instance name confirmed for the single object according to the second target instance, the third target instance corresponding to the vertex of the surface model can be obtained, that is, the single object corresponding to the vertex of the surface model; wherein the single object can be classified according to actual needs, including buildings, street trees, etc.
[0067] Figure 2 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 1 .like Figure 2 As shown, the method includes:
[0068] S201, establishing a surface model according to a dense point cloud obtained from an image set, and mapping the surface model to obtain a mapping model.
[0069] After selecting the shooting area, the camera is used to obtain images of the shooting area from various angles and used to form an image set; the images in the image set include objects shot at close range, objects shot at long distance, etc., and the objects include buildings, roadside trees, vehicles, etc.;
[0070] Before building a 3D model, it is necessary to obtain the point cloud of the captured 3D space based on the image set; first, the pose information and sparse point cloud are used. The camera pose of each image is obtained according to the sparse reconstruction (structure from motion, SFM) algorithm, and the image feature points are mapped to 3D coordinates through reprojection technology to obtain a sparse point cloud that can roughly reflect the 3D scene information; then the dense point cloud is used. The depth of each image is estimated according to the depth estimation algorithm, and then the camera pose obtained in the sparse point cloud is combined to obtain a dense point cloud;
[0071] In the 3D reconstruction process, dense point clouds with different densities can be obtained through downsampling. Based on the dense point clouds with different densities and Poisson surface reconstruction, the dense point clouds are triangulated to obtain a surface model. The surface model is a white model, and the surface model presents different precisions according to the number of triangular mesh pieces. The more triangular mesh pieces there are, the higher the precision. According to the precision, a surface model can be selected from multiple surface models for mapping to obtain a mapping model. The open source mvs-texturing library can be used for mapping in the mapping process.
[0072] For example, mapping the surface model to obtain the mapping model includes:
[0073] Mapping the surface model with the lowest precision to obtain a mapping model;
[0074] Before establishing the surface model according to the dense point cloud obtained from the image set, the method further includes:
[0075] Aerial images are acquired through a camera, and if the overlap rate between two consecutive aerial images is within a preset value range, it is confirmed that the two consecutive aerial images are selected into the image set.
[0076] The mapping process does not require too fine mapping. In order not to increase the amount of calculation, the surface model with the lowest accuracy can be selected for mapping, that is, the surface model with the least number of triangular mesh pieces can be selected for mapping;
[0077] When constructing an image set, the image of the shooting area can be acquired by using a camera mounted on a drone. The camera continuously acquires aerial images at preset time intervals during the shooting period. The overlap rate between two consecutive aerial images needs to be within a preset value range to be suitable aerial images that can be selected as an image set. The overlap rate between consecutive aerial images needs to be above 60%, and 70% is better.
[0078] S202. Acquire a first target instance according to the top view of the mapping model, wherein the first target instance is a single object in the three-dimensional space represented by the image set.
[0079] The mapping model includes multiple perspective images. The top view can reflect the approximate surface conditions of the shooting area. The top view can be used to obtain which targets are in the mapping model. A target is regarded as a single object. Multiple types of targets can be selected according to individual requirements. The single object in the top view is obtained as the first target instance, and the acquisition method is detection and identification through the detection model.
[0080] For example, the first target instance is obtained based on the top view of the mapping model and the detection model, wherein the detection model is a model obtained by network training based on the top view of the historical mapping model and the historical first target instance annotations of the top view of the historical mapping model.
[0081] The detection model is a trained target detection model. When training the detection model: the existing oblique photography model can be used to construct a training set of overhead view and annotate the targets therein, that is, the overhead view of the historical mapping model and the historical first target instance annotation of the overhead view of the historical mapping model; the training set and the annotated data can be input into the yolov5 deep learning detection network for training. During the training process, the model with the highest F1 score can be selected as the final detection model; the detection model can be used to detect the target object in the overhead view of the mapping model and obtain the first target instance.
[0082] S203: Acquire a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud acquired from the image set.
[0083] In the process of obtaining a dense point cloud based on an image set, a sparse point cloud of the image set is also obtained; the coordinate system of the sparse point cloud is the same as the coordinate system of the dense point cloud, so according to the features corresponding to the sparse point cloud, the relevant atlas of the first target instance can be indexed in the image set, that is, the set of images including the first target instance; when indexing the relevant atlas of the first target instance, the coordinate information of the first target instance is also required, and because the coordinate system of the first target instance is inconsistent with the coordinate system of the sparse point cloud, the coordinates of the first target instance need to be transformed before indexing.
[0084] S204. Perform semantic segmentation on the second target instances in the image set and assign an instance name to each of the second target instances, wherein the second target instance is a single object in the three-dimensional space represented by the image set, and the second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name.
[0085] The image set is processed by semantic segmentation to obtain the target object of the image set, that is, the second target instance. By obtaining the target object through semantic segmentation, there is no need to re-collect all-round images of the model under various viewing angles, which can reduce the workload and avoid errors caused by the 3D modeling and mapping process, and has higher segmentation accuracy.
[0086] After the second target instance is segmented, each second target instance is named for subsequent three-dimensional singulation, and the second target instances of the same single object are assigned the same instance name; for example, the same building can be given one same instance name, and the same street tree can be given another same instance name.
[0087] S205. Obtain a third target instance corresponding to the vertices of the surface model according to the related atlas of the first target instance and the instance name of the second target instance, wherein the third target instance is a single object in the three-dimensional space represented by the image set.
[0088] When the three-dimensional model is monomerized, a three-dimensional surface model is selected; the vertices of the surface model are also the vertices of the triangular mesh; the vertices of the surface model are mapped to the relevant atlas of the first target instance, and according to the instance name of the first target instance, the object corresponding to the vertex of the surface model can be found to obtain the corresponding third target instance, and the third target instance is monomerized from the surface model and can be selected separately; wherein, the instance name of the first target instance and the second target instance of the same object is consistent, for example, the instance name of the building A in the image set is the same as the instance name of the building A in the relevant atlas.
[0089] In an embodiment of the present application, the image data in the collected image set is processed into a dense point cloud and a sparse point cloud, and a three-dimensional surface model is established based on the dense point cloud, and the surface model is mapped to obtain a mapped model including more data information (such as color information); according to the top view of the mapped model, it is obtained which targets are in the mapped model to obtain a first target instance; the sparse point cloud has the same coordinate system as the dense point cloud, and the coordinate information of the first target instance is corresponded to the sparse point cloud, and the relevant atlas containing the first target instance can be obtained from the image set; the targets in the image set are obtained to obtain a second target instance; the second target instance is semantically segmented, the second target instance can be distinguished, and an instance name is assigned to the distinguished second target instance to achieve high-precision segmentation; in order to accurately match the targets corresponding to the vertices of the surface model, the relevant atlas of the first target instance and the instance name of the second target instance can be used to find the targets corresponding to the vertices of the surface model to obtain a third target instance, so that the targets in the surface model are accurately individualized and the semantic information of the targets can be obtained at the same time.
[0090] Figure 3 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 2 .like Figure 3 As shown, the method includes:
[0091] S301. Acquire the coordinate accuracy of the first target instance according to a first length and a first width of the top view, and a camera field of view and a camera height corresponding to the top view.
[0092] According to the image resolution of the overhead view and the ground distance resolution, the image coordinates of the first target instance in the overhead view can be converted into geographic coordinates, and the coordinates of the first target instance can be mapped to the coordinates of the sparse point cloud; for example, the geographic coordinates are the WGS-84 coordinate system; the coordinate accuracy includes the horizontal axis coordinate accuracy and the vertical axis coordinate accuracy;
[0093] According to the first length of the top view, the camera field of view angle, and the camera height, the horizontal axis coordinate accuracy of the transformed coordinates of the first target instance can be obtained;
[0094] A first parameter may be obtained according to the camera field of view angle, the first length and the first width of the top view, and a vertical axis coordinate accuracy of the transformed coordinates of the first target instance may be obtained according to the first parameter, the camera height and the first width of the top view;
[0095] Get the horizontal axis coordinate accuracy , vertical axis coordinate accuracy The formula is:
[0096]
[0097] Among them, tan is the tangent function; is the camera height; is a constant, ; is the camera field of view; is the first length of the top view; is the first width of the top view.
[0098] S302: Acquire the geographic coordinates of the center point of the target frame of the first target instance according to the image coordinates of the center point of the target frame of the first target instance and the coordinate accuracy.
[0099] Obtain the horizontal and vertical coordinates of the upper left corner of the image in the coordinate system of the geographic coordinates, and obtain the adjustment coordinates according to the image coordinates and coordinate accuracy of the center point of the target frame of the first target instance; obtain the geographic coordinates of the center point of the target frame of the first target instance according to the adjustment coordinates and the horizontal and vertical coordinates of the upper left corner of the image in the coordinate system of the geographic coordinates;
[0100] Get geographic coordinates The formula is:
[0101]
[0102] in, The horizontal and vertical coordinates of the upper left corner of the image in the geographic coordinate system; The image coordinates of the center point of the target bounding box of the first target instance.
[0103] S303 . Acquire a third length and a third width of the target frame of the first target instance according to the second length and the second width of the target frame of the first target instance and the coordinate accuracy.
[0104] The second length of the target frame of the first target instance is multiplied by the horizontal axis coordinate precision in the coordinate precision to obtain a third length of the target frame of the first target instance; the second width of the target frame of the first target instance is multiplied by the vertical axis coordinate precision in the coordinate precision to obtain a third width of the target frame of the first target instance;
[0105] Get the third length of the target box of the first target instance and the third width The formula is:
[0106]
[0107] in, is the second length of the target box; The second width of the target box.
[0108] S304. Acquire a first feature point set of the first target instance from the sparse point cloud according to the geographic coordinates of the center point of the target frame of the first target instance, and the third length and third width of the target frame of the first target instance.
[0109] After mapping the coordinate system of the first target instance to the coordinate system of the sparse point cloud, the sparse point cloud is cropped according to the geographic coordinates of the first target instance, the third length and the third width of the target box, and the first feature point set of the cropped area is obtained. Based on the first feature point set, images with these feature points can be searched in the image set to form a corresponding image set.
[0110] S305: Acquire a related atlas of the first target instance from the image set according to the first feature point set.
[0111] According to the first feature point set, corresponding images are searched in the image set, wherein the images that can correspond to the first feature point set include the first target instance. There may be multiple images containing the first target instance. The images containing the first target instance of the same single object are formed into a related atlas, and finally the related atlas of multiple first target instances is obtained.
[0112] In the embodiment of the present application, by performing coordinate mapping on the first target instance, an image corresponding to the first target instance is obtained through a sparse point cloud to form a related atlas of the first target instance, thereby ensuring that images corresponding to the first target instance of the same single object are accurately collected.
[0113] Figure 4 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 3 .like Figure 4 As shown, the method includes:
[0114] S401. According to the area occupied by the second target instance in the first image of the image set, an initial instance is obtained from multiple second target instances, an instance name is assigned to the initial instance, and a second feature point set in the mask of the initial instance is obtained.
[0115] Before assigning instance names, semantic segmentation is performed on the second target instance in the image set:
[0116] For example, according to the segmentation requirements of the image set, a text prompt word of the second target instance is obtained;
[0117] Inputting the text prompt word into a semantic detection model to obtain a type detection box of the second target instance;
[0118] The type detection box is input into a segmentation model to obtain a mask of the second target instance in the type detection box.
[0119] Some large models trained on multimodal data (text, images, etc.), such as CLIP and DALL-E, can link images and texts for training, so that the model can understand the content in the image and associate it with the text description; this embodiment processes the image set through a semantic segmentation model;
[0120] The semantic segmentation model can use the Grounding DINO model as the semantic detection model and the SAM (SegmantAnything Model) model as the segmentation model; according to the content of the image set and the segmentation requirements, the text prompt words of the semantic detection model, that is, the text prompt words of the second target instance, are confirmed; for example, for the image set of the community, it is usually necessary to separate residential buildings, street trees, roads, green spaces, etc., so residential buildings, etc. can be set as text prompt words and input into the semantic detection model; the semantic detection model can obtain the type detection box of the second target instance according to the text prompt words;
[0121] By inputting the type detection box as a prompt into the segmentation model, we can obtain the mask of each type detection box, that is, the mask of the second target instance; further, through the semantic detection model and the segmentation model, we can also segment the specific structures of the building, such as doors, windows, exterior walls, and roofs.
[0122] After completing the semantic segmentation of the second target instance, assigning an instance name to the second target instance, and assigning the same instance name to the second target instances of the same single object;
[0123] Traverse all images in the image set, that is, the first image, and obtain the area occupied by the second target instance in the first image; the second target instance in the first image corresponding to the maximum area occupied can be selected as the initial instance, and an instance name is assigned to the initial instance, and the second feature point set in the mask of the initial instance is obtained, that is, the second feature point set of the initial instance.
[0124] S402, obtaining a third feature point set of the second image in the image set, and if a ratio of the third feature point set to the second feature point set exceeds a preset ratio, confirming that the unnamed instance in the second image and the initial instance are the same single object, and assigning the instance name of the initial instance to the unnamed instance.
[0125] Obtain other images in the image set, namely the second image, and obtain the third feature point set of the second image; obtain the product of the second feature point set and the preset ratio, if the third feature point set is greater than or equal to the product, it is confirmed that the second image contains the same instance as the first image, and the instance is an unnamed instance, and the instance name of the initial instance can be assigned to the unnamed instance; in this way, the instances of the same object in different images are assigned the same instance name; next, the image with the largest area among the remaining images to which instance names are not assigned can be assigned instance names again until the instance name assignment of all instances is completed.
[0126] In the embodiment of the present application, each individual object in the image is provided with an instance name, so that it is possible to confirm whether there is an identical instance in the image based on the instance name, which facilitates management.
[0127] Figure 5 A schematic diagram of a 3D model singulation and semantic segmentation method provided in an embodiment of the present application Figure 4 .like Figure 5 As shown, the method includes:
[0128] S501. Obtain the pixel coordinates of the vertices of the surface model with the highest accuracy on the third image based on the vertex coordinates of the surface model with the highest accuracy, the rotation matrix, translation vector and intrinsic parameters of the third image in the related atlas of the first target instance.
[0129] The vertex coordinates of the surface model with the highest accuracy are obtained, and the vertex coordinates are reversely mapped to the image in combination with the image pose information; in the reverse mapping process, the pixel coordinates of the vertex coordinates of the surface model on the third image can be calculated based on the vertex coordinates of the surface model, the rotation matrix, translation vector and intrinsic parameters of the third image in the relevant atlas of the first target instance, and the pixel coordinates are the coordinates mapped to the image;
[0130] Get pixel coordinates The formula is:
[0131]
[0132] in, is the vertex coordinate of the surface model; is the internal parameter matrix, whose dimension can be 3×3, including the focal length and principal point of the camera; is the rotation matrix, whose dimension can be 3×3; t is a translation vector, whose dimension can be 1×3, then The dimensions are 3×4.
[0133] S502: Acquire the third image covering the pixel coordinates to obtain a fourth image.
[0134] If the horizontal coordinate of the pixel coordinate Less than or equal to the third image width, and the horizontal coordinate of the pixel coordinate If the pixel coordinate is less than or equal to the height of the third image, it is confirmed that the third image covers the pixel coordinate and is the fourth image; if multiple third images cover the pixel coordinate, multiple fourth images are obtained.
[0135] S503. Assign the instance name of the first target instance that appears most times in the fourth image to the vertex of the surface model with the highest accuracy, and obtain the third target instance corresponding to the vertex of the surface model with the highest accuracy, wherein the instance names of the first target instance and the second target instance of the same single object are the same.
[0136] When performing semantic segmentation, each instance of the image has its weight. The class with the largest weight is taken in the fourth image as the final segmentation result, that is, the instance corresponding to the instance name of the first target instance with the most occurrences is selected as the instance corresponding to the fourth image, and the instance name is assigned to the vertices of the surface model, so that the vertices of the surface model can obtain the third target instance corresponding to the instance name according to the instance name; after the assignment is completed for each vertex of the surface model, the vertex contains semantic information and instance information, thereby realizing the monomerization of the surface model.
[0137] In the embodiment of the present application, by combining the surface model and the instance mask, the three-dimensional surface model can be monomerized, and the process has low computational complexity and high speed, and can simultaneously realize the assignment of semantic information and monomer information of the three-dimensional mesh vertices without further calculation after the modeling is completed.
[0138] Figure 6 A diagram of a three-dimensional model monomerization and semantic segmentation device provided by an embodiment of the present invention, such as Figure 6 As shown, the device includes: a modeling module 601, a detection module 602, an indexing module 603, a segmentation module 604, and a processing module 605;
[0139] The modeling module 601 is used to establish a surface model according to the dense point cloud obtained from the image set, and map the surface model to obtain a mapping model.
[0140] The detection module 602 is used to obtain a first target instance according to the top view of the texture model, wherein the first target instance is a single object in the three-dimensional space represented by the image set.
[0141] The indexing module 603 is configured to obtain a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud obtained from the image set.
[0142] The indexing module 603 is further used to obtain the coordinate accuracy of the first target instance according to the first length and the first width of the top view, and the camera field of view and the camera height corresponding to the top view;
[0143] Acquire the geographic coordinates of the center point of the target frame of the first target instance according to the image coordinates of the center point of the target frame of the first target instance and the coordinate accuracy;
[0144] Acquire a third length and a third width of the target frame of the first target instance according to the second length and the second width of the target frame of the first target instance and the coordinate accuracy;
[0145] Acquire a first feature point set of the first target instance from the sparse point cloud according to the geographic coordinates of the center point of the target frame of the first target instance, and the third length and the third width of the target frame of the first target instance;
[0146] According to the first feature point set, a related atlas of the first target instance is acquired from the image set.
[0147] The segmentation module 604 is used to perform semantic segmentation on the second target instances in the image set and assign an instance name to each of the second target instances, wherein the second target instance is a single object in the three-dimensional space represented by the image set, and the second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name.
[0148] The segmentation module 604 is further configured to obtain an initial instance from the plurality of second target instances according to the area occupied by the second target instance in the first image of the image set, assign an instance name to the initial instance, and obtain a second feature point set in the mask of the initial instance;
[0149] A third feature point set of a second image in the image set is obtained. If a ratio of the third feature point set to the second feature point set exceeds a preset ratio, it is confirmed that the unnamed instance in the second image and the initial instance are the same single object, and the instance name of the initial instance is assigned to the unnamed instance.
[0150] The processing module 605 is used to obtain a third target instance corresponding to the vertices of the surface model according to the relevant atlas of the first target instance and the instance name, wherein the third target instance is a single object in the three-dimensional space represented by the image set.
[0151] The processing module 605 is further used to obtain the pixel coordinates of the vertices of the surface model with the highest accuracy on the third image according to the vertex coordinates of the surface model with the highest accuracy, the rotation matrix, the translation vector and the intrinsic parameter of the third image in the related atlas of the first target instance;
[0152] Acquire the third image covering the pixel coordinates to obtain a fourth image;
[0153] Assign the instance name of the first target instance that appears most times in the fourth image to the vertex of the surface model with the highest accuracy, and obtain the third target instance corresponding to the vertex of the surface model with the highest accuracy, wherein the instance names of the first target instance and the second target instance of the same single object are the same.
[0154] The present application also provides a three-dimensional model monomerization and semantic segmentation device, including: at least one processor and a memory;
[0155] The memory stores computer-executable instructions;
[0156] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs a three-dimensional model monomerization and semantic segmentation method.
[0157] Figure 7 The hardware diagram of the 3D model singulation and semantic segmentation device provided by the embodiment of the present invention. Figure 7 As shown, the 3D model monomerization and semantic segmentation device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. The device 70 also includes a communication component 703. The processor 701, the memory 702 and the communication component 703 are connected via a bus 704.
[0158] In a specific implementation process, at least one processor 701 executes the computer-executable instructions stored in the memory 702, so that at least one processor 701 executes the above three-dimensional model monomerization and semantic segmentation method.
[0159] The specific implementation process of the processor 701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0160] In the above Figure 7 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0161] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0162] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0163] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method described above is implemented.
[0164] The computer-readable storage medium mentioned above may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium may be any available medium that can be accessed by a general or special-purpose computer.
[0165] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0166] The division of the units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, which may be electrical, mechanical or other forms.
[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0168] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0169] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for monomerization and semantic segmentation of a three-dimensional model, characterized in that: include: Establishing a surface model according to a dense point cloud obtained from an image set, and mapping the surface model to obtain a mapping model; Acquire a first target instance according to the top view of the mapping model, wherein the first target instance is a single object in the three-dimensional space represented by the image set; Acquire a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud acquired from the image set; Performing semantic segmentation on second target instances in the image set, and assigning an instance name to each second target instance, wherein the second target instance is a single object in the three-dimensional space represented by the image set, and second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name; According to the related atlas of the first target instance and the instance name of the second target instance, a third target instance corresponding to the vertices of the surface model is obtained, wherein the third target instance is a single object in the three-dimensional space represented by the image set.
2. The method for 3D model singulation and semantic segmentation according to claim 1, characterized in that: The step of acquiring a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud acquired from the image set includes: Acquire the coordinate accuracy of the first target instance according to the first length and the first width of the top view, and the camera field of view and the camera height corresponding to the top view; Acquire the geographic coordinates of the center point of the target frame of the first target instance according to the image coordinates of the center point of the target frame of the first target instance and the coordinate accuracy; Acquire a third length and a third width of the target frame of the first target instance according to the second length and the second width of the target frame of the first target instance and the coordinate accuracy; Acquire a first feature point set of the first target instance from the sparse point cloud according to the geographic coordinates of the center point of the target frame of the first target instance, and the third length and the third width of the target frame of the first target instance; According to the first feature point set, a related atlas of the first target instance is acquired from the image set.
3. The method for three-dimensional model singulation and semantic segmentation according to claim 1, characterized in that: The assigning an instance name to each of the second target instances comprises: According to the area occupied by the second target instance in the first image of the image set, an initial instance is obtained from multiple second target instances, an instance name is assigned to the initial instance, and a second feature point set in the mask of the initial instance is obtained; A third feature point set of a second image in the image set is obtained. If a ratio of the third feature point set to the second feature point set exceeds a preset ratio, it is confirmed that the unnamed instance in the second image and the initial instance are the same single object, and the instance name of the initial instance is assigned to the unnamed instance.
4. The method for three-dimensional model singulation and semantic segmentation according to claim 3, characterized in that: The performing semantic segmentation on the second target instance in the image set includes: According to the segmentation requirements of the image set, obtaining the text prompt word of the second target instance; Inputting the text prompt word into a semantic detection model to obtain a type detection box of the second target instance; The type detection box is input into a segmentation model to obtain a mask of the second target instance in the type detection box.
5. The method for 3D model singulation and semantic segmentation according to claim 1, characterized in that: The acquiring, according to the related atlas of the first target instance and the instance name of the second target instance, the third target instance corresponding to the vertex of the surface model comprises: Obtain pixel coordinates of the vertices of the surface model with the highest accuracy on the third image according to the vertex coordinates of the surface model with the highest accuracy, the rotation matrix, the translation vector and the intrinsic parameters of the third image in the related atlas of the first target instance; Acquire the third image covering the pixel coordinates to obtain a fourth image; Assign the instance name of the first target instance that appears most times in the fourth image to the vertex of the surface model with the highest accuracy, and obtain the third target instance corresponding to the vertex of the surface model with the highest accuracy, wherein the instance names of the first target instance and the second target instance of the same single object are the same.
6. The method for three-dimensional model singulation and semantic segmentation according to claim 1, characterized in that: The step of acquiring a first target instance according to the top view of the mapping model includes: The first target instance is obtained according to the top view of the mapping model and the detection model, wherein the detection model is a model obtained by performing network training according to the top view of the historical mapping model and the annotation of the historical first target instance of the top view of the historical mapping model.
7. The method for three-dimensional model singulation and semantic segmentation according to claim 1, characterized in that: The step of mapping the surface model to obtain a mapping model comprises: Mapping the surface model with the lowest precision to obtain a mapping model; Before establishing the surface model according to the dense point cloud obtained from the image set, the method further includes: Aerial images are acquired through a camera, and if the overlap rate between two consecutive aerial images is within a preset value range, it is confirmed that the two consecutive aerial images are selected into the image set.
8. A 3D model singularization and semantic segmentation device, characterized in that: include: A modeling module, used for establishing a surface model according to a dense point cloud obtained from an image set, and mapping the surface model to obtain a mapping model; A detection module, configured to obtain a first target instance according to a top view of the mapping model, wherein the first target instance is a single object in the three-dimensional space represented by the image set; An indexing module, configured to obtain a related atlas of the first target instance from the image set according to the coordinate information of the first target instance and the sparse point cloud obtained from the image set; a segmentation module, configured to perform semantic segmentation on the second target instances in the image set and assign an instance name to each of the second target instances, wherein the second target instance is a single object in the three-dimensional space represented by the image set, and the second target instances of the same single object in the three-dimensional space where the image set is located in different images of the image set have the same instance name; A processing module is used to obtain a third target instance corresponding to the vertices of the surface model according to the relevant atlas of the first target instance and the instance name, wherein the third target instance is a single object in the three-dimensional space represented by the image set.
9. A 3D model singularization and semantic segmentation device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the three-dimensional model monomerization and semantic segmentation method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the three-dimensional model monomerization and semantic segmentation method as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Semantic segmentation and point cloud processing combined plant recognition and model construction method
CN113128405A
3D database making method based on three-dimensional reconstruction
CN114022542A
Building monomer instance segmentation method and device
CN114266780A
Three-dimensional patch model construction method based on image building structure learning
CN115564926A
Plant three-dimensional segmentation model construction method and device, equipment and storage medium
CN117274992A
