WO2022021309A1 - Method and apparatus for establishing model, electronic device, and computer readable storage medium - Google Patents

Method and apparatus for establishing model, electronic device, and computer readable storage medium Download PDF

Info

Publication number
WO2022021309A1
WO2022021309A1 PCT/CN2020/106167 CN2020106167W WO2022021309A1 WO 2022021309 A1 WO2022021309 A1 WO 2022021309A1 CN 2020106167 W CN2020106167 W CN 2020106167W WO 2022021309 A1 WO2022021309 A1 WO 2022021309A1
Authority
WO
WIPO (PCT)
Prior art keywords
grid
display layer
mesh
scene
geometric error
Prior art date
Application number
PCT/CN2020/106167
Other languages
French (fr)
Chinese (zh)
Inventor
黄文杰
冯乐满
黄胜
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2020/106167 priority Critical patent/WO2022021309A1/en
Publication of WO2022021309A1 publication Critical patent/WO2022021309A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering

Definitions

  • the present application relates to the technical field of model establishment, and in particular, to a method, apparatus, electronic device, and computer-readable storage medium for establishing a model.
  • Levels of Detail refers to determining the resource allocation when rendering objects of the 3D model according to the position and importance of the 3D model in the display environment, so as to reduce the amount of distant or non-important objects. The number of faces and the degree of detail, thus reducing the consumption of resources.
  • LOD technology is often used in the field of computer graphics. Its purpose is to establish a three-dimensional model including multiple model display layers. Each model display layer is used to represent the same object, and different model display layers have different levels of detail. index.
  • the perfect display layer is simplified into multiple model display layers with decreasing details, and each model display layer is The hausdorff distance between the perfect display layer and the perfect display layer is used as the detail level indicator of each model display layer and the iteration termination condition of the simplified operation, so that the subsequent renderer can select the corresponding model display layer according to the detail level indicator. For display, for example, the farther the object is from the viewpoint, the model display layer with lower level of detail is selected to display the object.
  • the hausdorff distance reflects the model display layer and the perfect display layer.
  • the maximum distance value of the layer, and the hausdorff distance is used as the detail level indicator of the model display layer, which will cause the detail level indicator of the model display layer to be too large, resulting in a decrease in the subsequent rendering accuracy.
  • the present application provides a method, an apparatus and a computer-readable storage medium for establishing a model, which can solve the problems in the prior art that a perfect display layer needs to be calculated and generated, which leads to time-consuming and labor-intensive, and easily leads to a decrease in the subsequent rendering accuracy.
  • an embodiment of the present application provides a method for establishing a model, including:
  • Acquiring description accuracy information of the scene by the first grid display layer of the 3D model of the scene wherein the first grid display layer includes a plurality of grid surfaces used to display the surface of the 3D model of the scene, and the description accuracy
  • the information includes: the physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or the actual projection point of the position point of the scene displayed by the sampling point in the first grid display layer deviation information from the sampling point;
  • the target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
  • the grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces.
  • the edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error.
  • the difference is less than the preset threshold;
  • the new mesh surface formed is stored as the second mesh display layer of the three-dimensional model of the scene.
  • an apparatus for establishing a model including:
  • the memory is used for acquiring description accuracy information of the scene by a first grid display layer of the scene 3D model, wherein the first grid display layer includes a plurality of grids used to display the surface of the scene 3D model
  • the description accuracy information includes: physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or, the position point of the scene displayed by the sampling point is displayed in the first grid deviation information between the actual projection point in the layer and the sampling point;
  • the processor is used to:
  • the target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
  • Grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces.
  • the edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error.
  • the difference is less than the preset threshold.
  • the present application provides an electronic device, comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program implementing the above when executed by the processor the method described in the aspect.
  • the present application provides a computer-readable storage medium, the computer-readable storage medium comprising instructions, which when executed on a computer, cause the computer to perform the method described in the above aspects.
  • the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method described in the above aspects.
  • the present application determines the geometric error in the first grid display layer by using the existing physical size information and/or deviation information of the sampling points in the first grid display layer, so as to utilize the geometric error
  • the first grid display layer has a measure of the degree of detail.
  • the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process.
  • the existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of
  • the accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer.
  • the process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved.
  • the indicator is too large, which causes the problem of subsequent rendering accuracy decline.
  • FIG. 1 is a flowchart of a method for establishing a model provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a grid display layer provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a simplified process of a grid display layer provided by an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of a grid display layer provided by an embodiment of the present application.
  • FIG. 6 is a block diagram of an apparatus for establishing a model provided by an embodiment of the present application.
  • FIG. 1 is a flowchart of a method for establishing a model provided by an embodiment of the present application. As shown in FIG. 1 , the method may include:
  • Step 101 Acquire the description accuracy information of the scene by the first grid display layer of the three-dimensional model of the scene.
  • the first grid display layer includes a plurality of grid surfaces used to display the surface of the three-dimensional model of the scene
  • the description accuracy information includes: the scene corresponding to the sampling point in the first grid display layer Physical size information, and/or deviation information between the actual projection point of the scene represented by the sampling point and the sampling point in the first grid presentation layer.
  • the method for building a model can be applied to the field of building a three-dimensional model of a scene based on an image of a scene.
  • the method for building a model can reconstruct the scene based on images collected by a movable platform in the scene.
  • the 3D scene model can be displayed on the terminal through the renderer, so as to realize the 3D reconstruction display of the scene.
  • the movable platform may include: unmanned aerial vehicle, unmanned vehicle, unmanned boat, handheld shooting equipment, etc.
  • the goal of building a 3D model of a scene is to build a multi-layer grid display layer, and the level of detail of the multi-layer grid display layer decreases.
  • Each grid display layer can include multiple grid surfaces, and the grid surfaces are used for displaying
  • the 3D model of the scene corresponds to the surface of the object.
  • the mesh display layer can be understood as a regular polyhedron that wraps the sphere.
  • Different mesh display layers have different numbers of mesh faces. The higher the number of mesh faces, the higher the level of detail in the mesh display layer.
  • FIG. 2 it shows a schematic diagram of a grid display layer provided by an embodiment of the present application.
  • the grid display layer 10 is a regular hexahedron
  • the grid display layer 10 is a regular hexahedron
  • Layer 11 is a regular dodecahedron.
  • the number of grid surfaces of the grid display layer increases, and the grid display layer 11 is closer to a sphere than the grid display layer 10 . Therefore, the detail level of the grid display layer 11 is higher than that of the grid display layer 10 .
  • the first grid display layer can be the first layer with the highest level of detail in the three-dimensional model of the scene.
  • the first grid display layer can be constructed based on the images collected by the movable platform in the scene.
  • An implementation situation Motion recovery structure (SFM, structure from motion) technology can be used to realize the construction of the image collected by the movable platform in the scene as the first grid display layer.
  • the SFM technology can be based on the camera of the movable platform when the camera captures the image. pose, extract the point cloud data of the image, and establish a textured mesh display layer based on the textureless mesh layer of the point cloud data component and the texture of the image, and the textured mesh display layer can be used as the detail The highest level of the first grid presentation layer.
  • the first grid display layer may be in other layers except the last layer in the 3D model of the scene.
  • the first grid display layer may be constructed based on the previous grid display layer.
  • reference may be made to the following process of obtaining the second grid display layer from the first grid display layer.
  • the description accuracy information can be used to determine the detail level of the grid display layer, and the detail level of the grid display layer can be represented by a geometric error, which is used to characterize the mesh surface in the grid display layer relative to the scene.
  • the geometric distance between the surfaces of the 3D model that is, the surface of the object corresponding to the 3D model of the scene, and can also be understood as the surface of the mesh surface of the perfect mesh display layer.
  • the smaller the geometric error of the grid display layer the greater the number of grid surfaces included in the grid display layer, and the smaller the geometric distance between the grid surface of the grid display layer and the surface of the 3D model of the scene. Since the number of mesh faces is large, and the mesh faces are closer to the perfect mesh display layer, the more similar the mesh display layer is to the perfect mesh display layer, the higher the level of detail of the mesh display layer.
  • the grid display layer 10 is a regular hexahedron
  • the grid display layer 11 is a regular dodecahedron. It can be seen that the greater the number of grid surfaces of the grid display layer, the smaller the geometric distance between the grid surface and the sphere surface, so that the geometric error of the grid display layer 11 is smaller than that of the grid display layer 11 .
  • the description accuracy information of the scene on the first grid display layer of the 3D model of the scene is obtained, specifically, the physical size information of the scene corresponding to the sampling point in the first grid display layer may be obtained, and/or the sampling Deviation information between the actual projection point and the sampling point of the location point of the scene displayed by the point in the first grid display layer.
  • the sampling point can include the physical size information of the corresponding scene, and the physical size information can be called the ground sampling distance (gsd, ground sample distance), which can refer to the physical distance between the center point of adjacent pixels in the image corresponding to the ground .
  • the deviation information between the actual projection point of the scene displayed by the sampling point and the sampling point in the first grid display layer can be referred to as the motion recovery structure (SFM, Structure) in the first grid display layer.
  • SFM Motion recovery structure
  • SFM is a technology that calculates the internal and external parameters of a group of pictures according to the principle of multi-view geometry. Some sparse spots.
  • the deviation between the two-dimensional projection point projected from the position point to the image and the actual sampling point is also called the reconstruction residual.
  • the core of the SFM algorithm is to optimize the internal and external parameters of the camera and the three-dimensional point coordinates to minimize the reconstruction residual.
  • the deviation information in this embodiment of the present application may include the maximum value or the average value of the reconstruction residuals of the SFM sparse points in the first grid display layer.
  • the grid precision of each area of the scene is different.
  • the deviation information between the actual projection point of the scene displayed by the sampling point and the sampling point in the first grid display layer is used as the description accuracy information of the scene by the first grid display layer to display the first grid.
  • the geometric error of the layer is measured so that the first mesh display layer has a measure of the level of detail.
  • a global hausdorff distance is used to measure the detail level of each grid display layer. Due to the different grid precisions corresponding to different areas in the actual scene, the deviation of many areas is not as large as the global hausdorff distance. , the use of the global hausdorff distance will ignore the differences in each area, resulting in the level of detail of each grid display layer being represented by a larger hausdorff distance, resulting in a larger level of detail in the model display layer. Therefore, in the embodiment of the present application, the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that the measurement of the detail level of the grid display layer is combined with the camera shooting process in the three-dimensional reconstruction scene. The existing features in each region better match the actual situation that the details of different regions are differentiated, and reduce the accuracy loss caused by using the global hausdorff distance.
  • Step 102 Determine the target geometric error of the second mesh display layer of the three-dimensional model of the scene according to the description accuracy information.
  • the target geometric error is used to represent the geometric error of the mesh surface in the second mesh display layer relative to the surface of the three-dimensional model of the scene.
  • the first grid display layer after obtaining the description accuracy information of the first grid display layer, the first grid display layer can be simplified by performing a simplified operation to reduce the number of grid surfaces in the first grid display layer, and the result is obtained In the second mesh display layer, since the number of mesh faces in the second mesh display layer is reduced, the detail level of the second mesh display layer is reduced, thereby meeting the requirements of the LOD technology.
  • the target geometric error needs to be used as the termination condition of the simplification operation, that is, the geometric error between the new mesh surface formed after the simplification of the first mesh display layer and the surface of the three-dimensional model of the scene is continuously determined, until This geometric error is equal to or close to the target geometric error.
  • the target geometric error of the second grid display layer is determined according to the description accuracy information of the first grid display layer. Specifically, the description accuracy of the first grid display layer can be determined first. The geometric error of the first grid display layer is obtained by information calculation, and then the geometric error of the second grid display layer is determined according to the geometric error of the first grid display layer.
  • step 102 may specifically include:
  • Sub-step 1021 Determine the target geometric error of the first mesh display layer according to the description precision information and the first coefficient.
  • the product of the description precision information and the first coefficient may be determined as the target of the first grid display layer Geometric error, where the first coefficient may be a fixed conversion coefficient, or may be a coefficient established according to actual scene requirements, which is not limited in this embodiment of the present application.
  • Sub-step 1022 Determine the target geometric error of the second grid display layer according to the target geometric error of the first grid display layer.
  • the target geometric error of the second grid display layer may be determined according to the target geometric error of the first grid display layer according to actual modeling requirements and simplification requirements. If the level of detail of the layer is low, the target geometric error of the second grid display layer can be set to a larger value based on the target geometric error of the first grid display layer; If the value is high, the target geometric error of the second grid display layer may be set to a smaller value based on the target geometric error of the first grid display layer.
  • sub-step 1022 may specifically include:
  • Sub-step A1 Determine the target geometric error of the second grid display layer according to the target geometric error of the first grid display layer and the second coefficient.
  • the second coefficient increases as the number of layers where the second mesh display layer is located in the three-dimensional model of the scene increases.
  • the target geometric error of the second grid display layer is determined according to the target geometric error of the first grid display layer.
  • the product value of the target geometric error of the first grid display layer and the second coefficient may be determined as
  • the second coefficient can be a value greater than 1, so that as the number of layers where the grid display layer is located in the 3D model of the scene increases, the target geometric error of the grid display layer also increases. Large, the detail level of the grid display layer is gradually reduced to meet the requirements of LOD technology.
  • the three-dimensional model of the scene includes 3 mesh presentation layers m1, m2, and m3.
  • the target geometric error of each grid display layer is the product of the target geometric error of the previous grid display layer and the second coefficient, and the second coefficient can be the number of layers where the grid display layer is located.
  • the target geometric error is a, then the target geometric error of the grid display layer m2 is 2a, and the target geometric error of the grid display layer m2 is 3a.
  • the target geometric error of the grid display layer also increases, and the detail level of the grid display layer is gradually reduced.
  • the value of the second coefficient may be set according to actual needs, which is not limited in the embodiment of the present application.
  • Step 103 Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain new grid surfaces.
  • the mesh simplification processing includes: folding the edges of the plurality of mesh surfaces to form new points, and using the formed new points as corner points of the new mesh surfaces, and the new mesh surfaces are relative to all the mesh surfaces.
  • the difference between the actual geometric error of the surface of the three-dimensional model of the scene and the target geometric error is smaller than a preset threshold.
  • the purpose of mesh simplification processing is to obtain the next mesh display layer by reducing the number of mesh faces in the current mesh display layer, so that the detail level of the next mesh display layer is lower .
  • FIG. 3 it shows a schematic diagram of a simplified process of a grid display layer provided by an embodiment of the present application.
  • An embodiment of the present application uses a relatively simple example to describe the grid simplification process.
  • FIG. 3 shows a mesh face set 12 and a mesh face set 13.
  • the mesh face set 12 includes 9 mesh faces, and the mesh face set 13 includes 7 mesh faces.
  • a new corner point may not be generated in the simplified operation, but one of the existing corner points may be used as the corner point of the new mesh surface, which is not made in this embodiment of the present application. limited.
  • the corner point v2 and the edge associated with the corner point v2 may be eliminated, and the obtained simplified mesh face set includes four triangular mesh faces and one pentagonal mesh face.
  • the first grid display layer obtains the second grid display layer through grid simplification processing, and the entire grid simplification processing can be implemented by multiple simplified iterative operations.
  • the obtained target geometric error of the second mesh display layer can be calculated in each or preset simplified iterative operation, and the actual geometric error of the currently obtained new mesh surface relative to the surface of the three-dimensional model of the scene and the target Whether the difference between the geometric errors is smaller than a preset threshold, if it is smaller, it is considered that the grid simplification process has been completed, and the actual geometric error of the second grid display layer obtained at this time is very close to the target geometric error, which is in line with the current application scenario. and LOD technology requirements. If it is greater than this, it is considered that the mesh simplification process has not been completed, and the next simplification iteration operation needs to be continued.
  • the preset threshold may be set according to actual requirements. For example, if the requirement for the accuracy of grid simplification processing is high, the preset threshold may be set to a smaller value.
  • Step 104 Store the formed new mesh surface as the second mesh display layer of the three-dimensional scene model.
  • the grid and texture data contained in the second grid display layer can be stored, specifically in the directory of the 3D model of the scene, so that the second grid display layer can be used as a scene A presentation layer for a 3D model.
  • the 3D model of the scene is established, and then the renderer can be used to render one or more layers of grid display layers in the 3D model of the scene.
  • the renderer can be used to render one or more layers of grid display layers in the 3D model of the scene.
  • Display in order to achieve resource allocation through multi-layer grid display layers when rendering objects in the 3D model of the scene, so as to reduce the number of faces and details of distant or non-important objects, thereby reducing resource consumption. For example, the farther the object is from the viewpoint, the mesh display layer with lower level of detail is selected to display the object.
  • the second grid display layer may be the next grid display layer of the first grid display layer, and the second grid display layer may also be several layers of grids below the first grid display layer.
  • the presentation layer for example, the first grid presentation layer is the first grid presentation layer of the scene 3D model, and the second grid presentation layer may be the nth grid presentation layer of the scene 3D model, where n ⁇ 2. This embodiment of the present application does not limit this.
  • a method for establishing a model uses the existing physical size information and/or deviation information of sampling points in the first grid display layer to determine the geometric error in the first grid display layer. A determination is made such that the first mesh presentation layer has a measure of the level of detail using the geometric error.
  • the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process.
  • the existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of
  • the accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer.
  • the process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved.
  • the indicator is too large, which causes the problem of subsequent rendering accuracy decline.
  • FIG. 4 is a specific flowchart of a method for establishing a model provided by an embodiment of the present application, and the method may include:
  • Step 201 Acquire the description accuracy information of the scene by the first grid display layer of the three-dimensional model of the scene.
  • step 201 reference may be made to the foregoing step 101, and details are not repeated here.
  • Step 202 Determine the target geometric error of the second mesh display layer of the three-dimensional scene model according to the description accuracy information.
  • step 202 reference may be made to the foregoing step 102, and details are not repeated here.
  • Step 203 Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain new grid surfaces.
  • step 203 reference may be made to the foregoing step 103, and details are not repeated here.
  • Step 204 Store the formed new mesh surface as the second mesh display layer of the three-dimensional scene model.
  • step 205 reference may be made to the foregoing step 104, and details are not repeated here.
  • the first grid display layer includes a plurality of first grid blocks, and each of the first grid blocks includes a plurality of grid surfaces;
  • the target geometry of the first grid display layer The error includes a geometric error of each of the first grid blocks, and the description accuracy information of the first grid display layer includes a description accuracy value of each of the first grid blocks;
  • the second grid The display layer includes a plurality of second grid blocks, each of the second grid blocks includes at least one grid face;
  • the target geometric error of the second grid display layer includes each of the second grids
  • the geometric error of the block, the description precision information of the second grid display layer includes the description precision value of each of the second grid blocks.
  • the entire grid display layer may be divided into multiple independent grid blocks.
  • FIG. 5 shows the A block diagram of a grid display layer.
  • three grid display layers are included: grid display layer m0, grid display layer m1, grid display layer m2, and from grid display layer m0 to grid display layer m2, the level of detail decreases in order, grid display layer m0 has 16 grid blocks, the grid display layer m1 has 4 grid blocks, and the grid display layer m2 has 1 grid block, each grid block is equivalent to a node, forming a four-fork In a tree structure, the nodes between different layers have a parent-child relationship.
  • the grid display layer m2 has four child nodes, that is, the four grid blocks of the grid display layer m1.
  • the quad-tree structure is only a tree-shaped structure obtained by a block operation.
  • the tree-shaped structure may also include: a binary tree structure, a ternary tree structure, an octree structure, and the like.
  • the description precision information of each grid display layer may specifically include a description precision value of each grid block in the layer, that is, the description precision information may specifically be a set of description precision values of each grid block.
  • the target geometric error of each grid display layer may specifically include the geometric error of each grid block in the layer, that is, the target geometric error may specifically be a set of geometric errors of each grid block.
  • each grid block can correspond to a certain local area in the scene, the geometric error of each grid block can accurately reflect the accuracy and error of its corresponding local area.
  • the target geometric error of the layer can include the existing characteristics of each local area in the scene, which better matches the actual situation that the degree of detail in different areas is different, and further improves the termination of simplification when the mesh surface is simplified.
  • the precision of the condition is the most important to be considered.
  • grid simplification processing is performed on the grid surface of each first grid block in the first grid display layer to obtain a new grid surface in each of the first grid blocks.
  • the folded cost of the edges in the grid block is calculated according to the distance between the corner points of the new grid surface obtained after the grid simplification process and the target grid surface, the target grid surface For the mesh face adjacent to the corner point of the new mesh face in the mesh block before the mesh simplification process.
  • the reduced cost may actually be a value of a distance property, which can reflect the distance between the corner points of the new mesh surface obtained after the mesh simplification process and the target mesh surface. 3. Assuming that the grid block 12 and the grid block 13 are included in FIG. 3, the grid block 12 is simplified to obtain the grid block 13. In an implementation manner, the reduced cost of the grid block 13 can be The sum of the squares of the distances between the corner v3 of the new mesh face and the target mesh face (9 mesh faces in mesh block 12).
  • the iteration termination error of each grid block in the grid simplification process is a value obtained by the same hausdorff distance
  • the iteration termination error of each grid block in the embodiment of the present application is determined by each grid block. Obtained from the respective description precision values of the blocks, and the description precision values can be the gsd value of the largest corner point in the grid block, the product of the gsd value of the largest corner point and the preset coefficient, and the reconstruction residual of the SFM sparse point. any of the .
  • each grid block can retain its own characteristics, which better matches the actual situation that the details of different areas in the scene are different, and reduces the accuracy loss caused by the hausdorff distance scheme.
  • the texture resolution of the texture part in each grid block can also be adjusted according to the description precision value of the grid block during the grid simplification process, so as to simplify the details of the texture part.
  • the relevant information of each grid block can be specifically saved in a general LOD format file, such as an Open Scene Graph (OSG, OpenSceneGraph) format file.
  • OSG Open Scene Graph
  • OpenSceneGraph Open Scene Graph
  • the number of the second grid blocks is smaller than the number of the first grid blocks.
  • the number of grid blocks included in the grid display model at a higher layer is greater than the number of grid blocks included in the grid display model at a lower layer, that is, the number of grid blocks The smaller the number, the lower the level of detail of the grid display layer.
  • the number of grid blocks decreases layer by layer to meet the requirements of LOD technology to realize the 3D model of the scene including the multi-layer grid display layer with decreasing detail.
  • Step 205 Obtain a three-dimensional model of the scene including at least two grid display layers when the number of all grid surfaces of the second grid display layer satisfies a preset condition.
  • the termination condition for the establishment of the 3D model of the scene under the entire LOD architecture may be that the number of all mesh faces of the last mesh display layer is less than the preset number, that is, all meshes of the mesh display layer The number of grids is small enough so that the detail level of the grid display layer is low enough.
  • the preset quantity value may be set according to actual requirements, which is not limited in the embodiment of the present application.
  • Step 206 Render and display the target mesh display layer in the three-dimensional model of the scene that is within the range of the visible window of the screen.
  • the 3D scene model can be displayed, wherein the screen of the display device has a range of visible windows.
  • the 3D scene model can be imagined as a larger range
  • the user casts the visual window of the screen to watch the 3D model of the scene, and the visual window of the screen is smaller than the scene, that is, the visual window of the screen maintains a relative positional relationship with the 3D model of the scene at a moment, so that The visible window of the screen can only display a part of the 3D model of the scene.
  • the relative positional relationship between the visible window of the screen and the 3D model of the displayed scene can be changed.
  • a target mesh display layer in the three-dimensional model of the scene within the range of the visible window of the screen can be determined for rendering display.
  • the visual window of the screen is equivalent to the user's viewpoint, and the target grid display layer within the range of the visual window of the screen is selected for display, and the following rules can be followed: If the scene is far away, the grid display layer with the lower level of detail is selected to display the scene, thereby reducing the consumption of rendering resources by using the lower face count and detail degree of the grid display layer of the distant scene.
  • step 206 may specifically include:
  • Sub-step 2061 Calculate the maximum pixel error of each target grid display layer on the visible window in the order from the smallest to the largest number of grid faces included, and when the maximum pixel error is less than
  • the target grid display layer is equal to or equal to the preset error value, the target grid display layer whose maximum pixel error is less than or equal to the preset threshold is rendered and displayed.
  • the renderer can use the target geometric error ⁇ (L) of the grid display layer as the detail level indicator for selection and display.
  • the renderer can calculate a grid display during real-time rendering.
  • ⁇ (L) (f ⁇ (L))/D, where f is the focal length of the visible window, and D is the closest distance from the viewpoint to the grid display layer.
  • the fidelity requirements for the renderer to display according to the LOD are: ⁇ (L) ⁇ , ⁇ is a preset threshold value of constant nature, generally set to 1, then select the target grid layer that satisfies the condition of ⁇ (L) ⁇ to carry out Display it.
  • grid display layer m0 grid display layer m0
  • grid display layer m1 grid display layer m2
  • grid display layer m2 the specific process of rendering the scene in real time by the renderer is:
  • the display fidelity requirements of LOD technology ⁇ , ⁇ is generally taken as 1, that is, the maximum pixel error of the grid projected to the screen is less than one pixel. So if ⁇ (m2) ⁇ 1, then the renderer will select the grid display layer m2 for rendering, and no longer traverse its child nodes; if ⁇ (m2)>1, then the renderer will then traverse its child nodes in turn, that is, The grid displays the four block grids in the layer m1, and judges whether the grid display layer m1 is in the visible window, and if it is in the visible window, go to the next step; calculate the maximum pixel error of the grid display layer m1 projected to the screen ⁇ (m1), the subsequent process is the same as the above-mentioned processing for the grid display layer m2, until ⁇ 1 or the leaf node is reached. Through this rule, the grid display layer that meets the fidelity requirements can be selected and rendered.
  • the method further includes:
  • Step 207 Under the condition that the difference between the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene and the target geometric error is greater than or equal to the preset threshold The grid surface is used as the first grid display layer, and the process goes to step 203 .
  • the first grid presentation layer obtains the second grid presentation layer through grid simplification processing, and the entire grid simplification processing can be implemented through multiple simplified iterative operations. How to determine when to stop the iteration, this application
  • the actual geometric error of the currently obtained new mesh surface relative to the surface of the three-dimensional model of the scene may be calculated in each or a preset simplified iterative operation.
  • the difference between the geometric error of the target and the target is less than a preset threshold, if it is less than, it is considered that the grid simplification process has been completed, and the actual geometric error of the second grid display layer obtained at this time is very close to the target geometric error, Meet the requirements of current application scenarios and LOD technology. If it is greater than that, it is considered that the mesh simplification process has not been completed, and the process goes to step 203, and the next simplification iterative operation is continued until the difference between the actual geometric error and the target geometric error is smaller than the preset threshold.
  • step 201 it may further include:
  • Step B1 Acquire at least one image to be reconstructed.
  • Step B2 constructing and obtaining the first grid display layer according to the image to be reconstructed.
  • the method for establishing the first grid display layer may be based on the images to be reconstructed collected in the scene by the movable platform, technology to obtain the first mesh display layer, so as to use it as the mesh display layer with the highest level of detail in the three-dimensional model of the scene.
  • the structure from motion (SFM, structure from motion) technology can be used to realize the construction of the image collected by the movable platform in the scene as the first grid display layer, and the SFM technology can be captured based on the camera of the movable platform.
  • the camera pose at the time of the image extract the point cloud data of the image, and establish a textured mesh display layer according to the textureless mesh layer of the point cloud data component and the texture of the image.
  • the textured mesh display layer is Can be used as the first mesh display layer with the highest level of detail.
  • step B2 may specifically include:
  • Step B21 Determine the camera pose and texture map corresponding to each of the to-be-reconstructed images.
  • the camera pose corresponding to each image to be reconstructed can be obtained based on the internal and external parameters of the image to be reconstructed by the camera, and a texture extraction model (convolutional neural network model is sufficient) ) can obtain the texture map corresponding to each image to be reconstructed.
  • a texture extraction model convolutional neural network model is sufficient
  • the internal and external parameters of the camera refer to the internal parameters of the camera (camera focal length, camera center point offset, camera distortion parameters, etc.) and external parameters (the rotation matrix and translation vector of the camera in the world coordinate system).
  • Step B22 Perform point cloud matching on two target images in the plurality of images to be reconstructed according to the camera posture to obtain point cloud data, and there are overlapping parts in the frames of the two target images.
  • point cloud matching is performed on two target images with overlapping parts in the multi-image to be reconstructed, and point cloud data can be obtained.
  • view stereo technology implementation.
  • the point cloud data in the scene refers to the collection of point data on the appearance surface of the objects in the scene obtained by the measuring instrument in the reverse engineering.
  • Step B23 constructing a textureless mesh display layer according to the point cloud data.
  • the point cloud data includes the three-dimensional coordinates of each point in the scene. Therefore, according to the point cloud data, a textureless mesh display layer reflecting the three-dimensional structure of the scene can be constructed. Specifically, this process can be obtained by the Poisson surface reconstruction technique.
  • Step B24 Map the textureless mesh display layer to the texture map, so as to determine the texture area corresponding to each mesh surface in the textureless mesh display layer from the texture map, and map the textureless mesh display layer to the texture map.
  • the texture area is added to the corresponding mesh surface to obtain the first mesh display layer.
  • the embodiment of the present application may map the textureless mesh display layer to the texture map as a whole, so as to obtain the texture map from the texture map. Determine the texture area corresponding to each mesh surface in the textureless mesh display layer, and add the texture area to the corresponding mesh surface to obtain the first mesh display layer. At this time, the obtained first mesh
  • the presentation layer has textures and can be rendered directly.
  • a method for establishing a model uses the existing physical size information and/or deviation information of sampling points in the first grid display layer to determine the geometric error in the first grid display layer. A determination is made such that the first mesh presentation layer has a measure of the level of detail using the geometric error.
  • the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process.
  • the existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of
  • the accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer.
  • the process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved.
  • the indicator is too large, which causes the problem of subsequent rendering accuracy decline.
  • FIG. 6 is a block diagram of an apparatus for establishing a model provided by an embodiment of the present application.
  • the apparatus 300 for establishing a model may include: a memory 301 and a processor 302;
  • the memory 301 is configured to perform: acquiring description accuracy information of the scene by a first mesh display layer of the three-dimensional model of the scene, wherein the first mesh display layer includes a plurality of surfaces used to display the three-dimensional model of the scene.
  • the description accuracy information includes: physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or, the position of the scene displayed by the sampling point is in the first grid Deviation information between the actual projection point in the grid display layer and the sampling point; storing the formed new grid surface as the second grid display layer of the three-dimensional model of the scene;
  • the processor 302 is configured to execute:
  • the target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
  • Grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces.
  • the edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error.
  • the difference is less than the preset threshold.
  • the processor 302 is specifically configured to:
  • a target geometric error of the second grid presentation layer is determined according to the target geometric error of the first grid presentation layer.
  • the processor 302 is specifically configured to:
  • the target geometric error of the second grid display layer is determined according to the target geometric error of the first grid display layer and the second coefficient.
  • the second coefficient increases as the number of layers where the second mesh display layer is located in the three-dimensional model of the scene increases.
  • the first grid display layer includes a plurality of first grid blocks, and each of the first grid blocks includes a plurality of grid surfaces;
  • the target geometry of the first grid display layer The error includes a geometric error of each of the first grid blocks, and the description precision information of the first grid display layer includes a description precision value of each of the first grid blocks;
  • the second grid display layer includes a plurality of second grid blocks, and each of the second grid blocks includes at least one grid surface; the target geometric error of the second grid display layer includes each The geometric error of the second grid block, and the description precision information of the second grid display layer includes a description precision value of each of the second grid blocks.
  • the number of the second grid blocks is smaller than the number of the first grid blocks.
  • the processor 302 is specifically configured to:
  • the processor 302 is specifically configured to:
  • all the new mesh surfaces As the first mesh display layer, and enter the step of performing mesh simplification processing on the plurality of mesh surfaces in the first mesh display layer to obtain a new mesh surface.
  • the processor 302 is specifically configured to:
  • the target mesh display layer in the three-dimensional model of the scene within the range of the visible window of the screen is rendered and displayed.
  • the processor 402 is specifically configured to:
  • the processor 402 is specifically configured to:
  • the first grid display layer is constructed and obtained according to the to-be-reconstructed image.
  • the processor 402 is specifically configured to:
  • point cloud matching is performed on two target images in the plurality of images to be reconstructed to obtain point cloud data, and there are overlapping parts in the frames of the two target images;
  • the textureless mesh display layer is mapped to the texture map to determine a texture area corresponding to each mesh face in the textureless mesh display layer from the texture map, and the texture The regions are added to the corresponding mesh faces to obtain the first mesh display layer.
  • the apparatus for establishing a model determines the geometric error in the first grid display layer by using the existing physical size information and/or deviation information of the sampling points in the first grid display layer , so that the first mesh display layer has a measure of the degree of detail by using the geometric error.
  • the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process.
  • the existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of
  • the accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer.
  • the process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved.
  • the indicator is too large, which causes the problem of subsequent rendering accuracy decline.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, each process of the above-mentioned method for establishing a model is implemented, and can achieve the same The technical effect, in order to avoid repetition, will not be repeated here.
  • the computer-readable storage medium such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), magnetic disk or optical disk and so on.
  • the memory can be an interface for connecting an external control terminal with a model-building device.
  • the external control terminal may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a control terminal with an identification module, an audio input /Output (I/O) ports, video I/O ports, headphone ports, and more.
  • the memory may be used to receive input (eg, data information, power, etc.) from an external control terminal and transmit the received input to one or more elements within the apparatus for modelling or may be used in the apparatus for modelling and Transfer data between external control terminals.
  • At least one magnetic disk storage device For example at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the processor is the control center of the control terminal. It uses various interfaces and lines to connect various parts of the entire control terminal, and executes control by running or executing the software programs and/or modules stored in the memory and calling the data stored in the memory. Various functions of the terminal and processing data, so as to carry out overall monitoring of the control terminal.
  • the processor may include one or more processing units; preferably, the processor may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor Mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor.
  • the embodiments of the present application may be provided as a method, a control terminal, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising the instruction to control the terminal,
  • the instruction controls the terminal to implement the function specified in one flow or multiple flows of the flowchart and/or one block or multiple blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

A method and apparatus for establishing a model and a computer readable storage medium. The method comprises: obtaining description accuracy information of a first grid display layer of a scene three-dimensional model for a scene (101); determining a target geometric error of a second grid display layer of the scene three-dimensional model according to the description accuracy information (102); performing grid simplification processing on multiple grid surfaces in the first grid display layer to obtain new grid surfaces (103); and using the newly formed grid surfaces as the second grid display layer of the scene three-dimensional model for storage (104). According to the method, in the process of obtaining the grid display layers having decreasing levels of detail, the process of calculation of a perfect display layer is eliminated and calculation pressure is reduced; moreover, because more accurate physical size information and/or deviation information of sampling points are used for determining the target geometric error, the problem that when a global hausdorff distance is used as the geometric error, the level index of detail of the grid display layer is too large, thereby causing the subsequent rendering accuracy to decrease is solved.

Description

建立模型的方法、装置、电子设备及计算机可读存储介质Method, apparatus, electronic device, and computer-readable storage medium for establishing a model 技术领域technical field
本申请涉及模型建立技术领域,特别是涉及一种建立模型的方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of model establishment, and in particular, to a method, apparatus, electronic device, and computer-readable storage medium for establishing a model.
背景技术Background technique
多细节层次(LOD,Levels of Detail)技术是指根据三维模型在显示环境中所处的位置和重要度,决定对该三维模型的物体进行渲染时的资源分配,以降低远处或者非重要物体的面数和细节度,从而减少了资源的耗用。Levels of Detail (LOD, Levels of Detail) technology refers to determining the resource allocation when rendering objects of the 3D model according to the position and importance of the 3D model in the display environment, so as to reduce the amount of distant or non-important objects. The number of faces and the degree of detail, thus reducing the consumption of resources.
在目前方案中,LOD技术常用于计算机图形学领域,其宗旨是建立包括多层模型展示层的三维模型,每层模型展示层都用于表示同一物体,且不同模型展示层具有不同的细节程度指标。具体的,在计算机图形学领域的应用中,首先基于已知的完美展示层(即最精细层),将完美展示层简化为多个细节程度递减的模型展示层,并将每层模型展示层与完美展示层之间的豪斯多夫(hausdorff)距离,作为每层模型展示层的细节程度指标以及简化操作的迭代终止条件,以供后续渲染器根据细节程度指标,选取对应的模型展示层进行展示,如,物体距离视点越远,则选取细节程度越低的模型展示层来对物体进行展示。In the current scheme, LOD technology is often used in the field of computer graphics. Its purpose is to establish a three-dimensional model including multiple model display layers. Each model display layer is used to represent the same object, and different model display layers have different levels of detail. index. Specifically, in the application in the field of computer graphics, first, based on the known perfect display layer (ie, the finest layer), the perfect display layer is simplified into multiple model display layers with decreasing details, and each model display layer is The hausdorff distance between the perfect display layer and the perfect display layer is used as the detail level indicator of each model display layer and the iteration termination condition of the simplified operation, so that the subsequent renderer can select the corresponding model display layer according to the detail level indicator. For display, for example, the farther the object is from the viewpoint, the model display layer with lower level of detail is selected to display the object.
但是,在基于影像重建三维场景的领域中,并无已知的完美展示层,采用目前方案则需要计算产生完美展示层,导致耗时耗力,另外,由于hausdorff距离反映模型展示层与完美展示层的最大距离值,采用hausdorff距离作为模型展示层的细节程度指标,会导致模型展示层的细节程度指标偏大,造成后续渲染精度下降。However, in the field of image-based reconstruction of 3D scenes, there is no known perfect display layer. Using the current solution requires calculation to generate a perfect display layer, which is time-consuming and labor-intensive. In addition, the hausdorff distance reflects the model display layer and the perfect display layer. The maximum distance value of the layer, and the hausdorff distance is used as the detail level indicator of the model display layer, which will cause the detail level indicator of the model display layer to be too large, resulting in a decrease in the subsequent rendering accuracy.
发明内容SUMMARY OF THE INVENTION
本申请提供一种建立模型的方法、装置及计算机可读存储介质,可以解决现有技术中需要计算产生完美展示层,导致耗时耗力,且易造成后续渲染精度下降的问题。The present application provides a method, an apparatus and a computer-readable storage medium for establishing a model, which can solve the problems in the prior art that a perfect display layer needs to be calculated and generated, which leads to time-consuming and labor-intensive, and easily leads to a decrease in the subsequent rendering accuracy.
第一方面,本申请实施例提供了一种建立模型的方法,包括:In a first aspect, an embodiment of the present application provides a method for establishing a model, including:
获取场景三维模型的第一网格展示层对场景的描述精度信息,其中,所述第一网格展示层包括用于展示所述场景三维模型的表面的多个网格面,所述描述精度信息包括:所述第一网格展示层中采样点对应的场景的物理尺寸 信息,和/或,所述采样点展示的场景的位置点在所述第一网格展示层中的实际投影点与所述采样点之间的偏差信息;Acquiring description accuracy information of the scene by the first grid display layer of the 3D model of the scene, wherein the first grid display layer includes a plurality of grid surfaces used to display the surface of the 3D model of the scene, and the description accuracy The information includes: the physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or the actual projection point of the position point of the scene displayed by the sampling point in the first grid display layer deviation information from the sampling point;
根据所述描述精度信息确定所述场景三维模型的第二网格展示层的目标几何误差,其中,所述目标几何误差用于表征所述第二网格展示层中的网格面相对于所述场景三维模型的表面的几何误差;The target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面,其中,所述网格简化处理包括:折合所述多个网格面的边形成新的点,将形成的新的点作为所述新的网格面的角点,所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值小于预设阈值;Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain a new grid surface, wherein the grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces. The edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error. The difference is less than the preset threshold;
将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储。The new mesh surface formed is stored as the second mesh display layer of the three-dimensional model of the scene.
第二方面,本申请实施例提供了一种建立模型的装置,包括:In a second aspect, an embodiment of the present application provides an apparatus for establishing a model, including:
存储器和处理器;memory and processor;
所述存储器用于,获取场景三维模型的第一网格展示层对场景的描述精度信息,其中,所述第一网格展示层包括用于展示所述场景三维模型的表面的多个网格面,所述描述精度信息包括:所述第一网格展示层中采样点对应的场景的物理尺寸信息,和/或,所述采样点展示的场景的位置点在所述第一网格展示层中的实际投影点与所述采样点之间的偏差信息;The memory is used for acquiring description accuracy information of the scene by a first grid display layer of the scene 3D model, wherein the first grid display layer includes a plurality of grids used to display the surface of the scene 3D model On the other hand, the description accuracy information includes: physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or, the position point of the scene displayed by the sampling point is displayed in the first grid deviation information between the actual projection point in the layer and the sampling point;
将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储;storing the formed new mesh surface as the second mesh display layer of the three-dimensional model of the scene;
所述处理器用于:The processor is used to:
根据所述描述精度信息确定所述场景三维模型的第二网格展示层的目标几何误差,其中,所述目标几何误差用于表征所述第二网格展示层中的网格面相对于所述场景三维模型的表面的几何误差;The target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面,其中,所述网格简化处理包括:折合所述多个网格面的边形成新的点,将形成的新的点作为所述新的网格面的角点,所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值小于预 设阈值。Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain a new grid surface, wherein the grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces. The edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error. The difference is less than the preset threshold.
第三方面,本申请提供一种电子设备,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述方面所述的方法。In a third aspect, the present application provides an electronic device, comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program implementing the above when executed by the processor the method described in the aspect.
第四方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质包括指令,当其在计算机上运行时,使得计算机执行上述方面所述的方法。In a fourth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium comprising instructions, which when executed on a computer, cause the computer to perform the method described in the above aspects.
第五方面,本申请提供一种计算机程序产品,所述计算机程序产品包括指令,当其在计算机上运行时,使得计算机执行上述方面所述的方法。In a fifth aspect, the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method described in the above aspects.
在本申请实施例中,本申请通过利用第一网格展示层中采样点已有的物理尺寸信息和或偏差信息,来对第一网格展示层中的几何误差进行确定,从而利用几何误差使得第一网格展示层具有了细节程度的度量。本申请实施例中,利用了场景三维重建得到的第一网格展示层中的采样点已有的信息,使得在三维重建场景中,对网格展示层细节程度的度量,结合了相机拍摄过程中在各个场景的区域中的已有特性,更好的吻合了不同区域的细节程度具有差异化的实际情况,提高了对网格面进行网格简化处理时终止简化条件的精度,降低了采用全局hausdorff距离作为该终止简化条件时带来的精度损失,使得在得到多层细节程度递减的网格展示层的过程中,不再依赖一个已知的完美展示层,消除了计算完美展示层的过程,降低了计算压力,且由于采用了更准确的采样点的物理尺寸信息和或偏差信息去确定目标几何误差,解决了采用全局hausdorff距离作为几何误差时,产生的网格展示层的细节程度指标偏大,造成后续渲染精度下降的问题。In the embodiment of the present application, the present application determines the geometric error in the first grid display layer by using the existing physical size information and/or deviation information of the sampling points in the first grid display layer, so as to utilize the geometric error The first grid display layer has a measure of the degree of detail. In the embodiment of the present application, the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process. The existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of The accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer. The process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved. The indicator is too large, which causes the problem of subsequent rendering accuracy decline.
附图说明Description of drawings
图1是本申请实施例提供的一种建立模型的方法的流程图;1 is a flowchart of a method for establishing a model provided by an embodiment of the present application;
图2是本申请实施例提供的一种网格展示层的示意图;2 is a schematic diagram of a grid display layer provided by an embodiment of the present application;
图3是本申请实施例提供的一种网格展示层的简化过程示意图;3 is a schematic diagram of a simplified process of a grid display layer provided by an embodiment of the present application;
图4是本申请实施例提供的一种建立模型的方法的具体步骤流程图;4 is a flowchart of the specific steps of a method for establishing a model provided by an embodiment of the present application;
图5是本申请实施例提供的一种网格展示层的分块示意图;5 is a schematic block diagram of a grid display layer provided by an embodiment of the present application;
图6是本申请实施例提供的一种建立模型的装置的框图。FIG. 6 is a block diagram of an apparatus for establishing a model provided by an embodiment of the present application.
具体实施方式detailed description
为了使得本发明的目的、技术方案和优点更为明显,下面将参照附图详细描述根据本发明的示例实施例。显然,所描述的实施例仅仅是本发明的一部分实施例,而不是本发明的全部实施例,应理解,本发明不受这里描述的示例实施例的限制。基于本发明中描述的本发明实施例,本领域技术人员在没有付出创造性劳动的情况下所得到的所有其它实施例都应落入本发明的保护范围之内。In order to make the objects, technical solutions and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of the embodiments of the present invention, and it should be understood that the present invention is not limited by the example embodiments described herein. Based on the embodiments of the present invention described in the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
在下文的描述中,给出了大量具体的细节以便提供对本发明更为彻底的理解。然而,对于本领域技术人员而言显而易见的是,本发明可以无需一个或多个这些细节而得以实施。在其他的例子中,为了避免与本发明发生混淆,对于本领域公知的一些技术特征未进行描述。In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without one or more of these details. In other instances, some technical features known in the art have not been described in order to avoid obscuring the present invention.
应当理解的是,本发明能够以不同形式实施,而不应当解释为局限于这里提出的实施例。相反地,提供这些实施例将使公开彻底和完全,并且将本发明的范围完全地传递给本领域技术人员。It should be understood that the present invention may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
在此使用的术语的目的仅在于描述具体实施例并且不作为本发明的限制。在此使用时,单数形式的“一”、“一个”和“所述/该”也意图包括复数形式,除非上下文清楚指出另外的方式。还应明白术语“组成”和/或“包括”,当在该说明书中使用时,确定所述特征、整数、步骤、操作、元件和/或部件的存在,但不排除一个或更多其它的特征、整数、步骤、操作、元件、部件和/或组的存在或添加。在此使用时,术语“和/或”包括相关所列项目的任何及所有组合。The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms "a," "an," and "the/the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the terms "compose" and/or "include", when used in this specification, identify the presence of stated features, integers, steps, operations, elements and/or components, but do not exclude one or more other The presence or addition of features, integers, steps, operations, elements, parts and/or groups. As used herein, the term "and/or" includes any and all combinations of the associated listed items.
为了彻底理解本发明,将在下列的描述中提出详细的结构,以便阐释本发明提出的技术方案。本发明的可选实施例详细描述如下,然而除了这些详细描述外,本发明还可以具有其他实施方式。For a thorough understanding of the present invention, detailed structures will be presented in the following description in order to explain the technical solutions proposed by the present invention. Alternative embodiments of the present invention are described in detail below, however, the invention is capable of other embodiments in addition to these detailed descriptions.
下面结合附图,对本申请的建立模型的方法和装置、系统进行详细说明。在不冲突的情况下,下述的实施例及实施方式中的特征可以相互组合。The method, device, and system for establishing a model of the present application will be described in detail below with reference to the accompanying drawings. The features of the embodiments and implementations described below may be combined with each other without conflict.
图1是本申请实施例提供的一种建立模型的方法的流程图,如图1所示,该方法可以包括:FIG. 1 is a flowchart of a method for establishing a model provided by an embodiment of the present application. As shown in FIG. 1 , the method may include:
步骤101、获取场景三维模型的第一网格展示层对场景的描述精度信息。Step 101: Acquire the description accuracy information of the scene by the first grid display layer of the three-dimensional model of the scene.
其中,所述第一网格展示层包括用于展示所述场景三维模型的表面的多 个网格面,所述描述精度信息包括:所述第一网格展示层中采样点对应的场景的物理尺寸信息,和/或,所述采样点展示的场景的位置点在所述第一网格展示层中的实际投影点与所述采样点之间的偏差信息。Wherein, the first grid display layer includes a plurality of grid surfaces used to display the surface of the three-dimensional model of the scene, and the description accuracy information includes: the scene corresponding to the sampling point in the first grid display layer Physical size information, and/or deviation information between the actual projection point of the scene represented by the sampling point and the sampling point in the first grid presentation layer.
在本申请实施例中,建立模型的方法可以应用于基于场景的图像建立该场景的场景三维模型的领域,具体的,建立模型的方法可以基于可移动平台在场景中采集的图像,重建该场景的场景三维模型,场景三维模型建立好之后,可以在终端通过渲染器对场景三维模型进行展示,以实现场景的三维重构展示。其中,可移动平台可以包括:无人机、无人车、无人船、手持拍摄设备等。In this embodiment of the present application, the method for building a model can be applied to the field of building a three-dimensional model of a scene based on an image of a scene. Specifically, the method for building a model can reconstruct the scene based on images collected by a movable platform in the scene. After the 3D scene model is established, the 3D scene model can be displayed on the terminal through the renderer, so as to realize the 3D reconstruction display of the scene. Among them, the movable platform may include: unmanned aerial vehicle, unmanned vehicle, unmanned boat, handheld shooting equipment, etc.
具体的,建立场景三维模型的目标是建立多层网格展示层,且多层网格展示层的细节程度递减,每层网格展示层可以包括多个网格面,网格面用于展示场景三维模型对应物体的表面。Specifically, the goal of building a 3D model of a scene is to build a multi-layer grid display layer, and the level of detail of the multi-layer grid display layer decreases. Each grid display layer can include multiple grid surfaces, and the grid surfaces are used for displaying The 3D model of the scene corresponds to the surface of the object.
例如,假设场景三维模型对应物体为一个表面光滑的球体,则网格展示层可以被理解为一个将该球体包裹在内的正多面体,不同的网格展示层的网格面的数量不同。网格面的数量越高,说明网格展示层的细节程度越高。参照图2,其示出了本申请实施例提供的一种网格展示层的示意图,对于一个网格展示层10和一个网格展示层11,网格展示层10为正六面体,网格展示层11为正十二面体。在将网格展示层10变化为网格展示层11的过程中,网格展示层的网格面的数量增加,且网格展示层11相较于网格展示层10更与球体相近,这就使得网格展示层11相较于网格展示层10的细节程度越高。For example, assuming that the corresponding object of the 3D model of the scene is a sphere with a smooth surface, the mesh display layer can be understood as a regular polyhedron that wraps the sphere. Different mesh display layers have different numbers of mesh faces. The higher the number of mesh faces, the higher the level of detail in the mesh display layer. Referring to FIG. 2 , it shows a schematic diagram of a grid display layer provided by an embodiment of the present application. For a grid display layer 10 and a grid display layer 11 , the grid display layer 10 is a regular hexahedron, and the grid display layer 10 is a regular hexahedron. Layer 11 is a regular dodecahedron. During the process of changing the grid display layer 10 to the grid display layer 11 , the number of grid surfaces of the grid display layer increases, and the grid display layer 11 is closer to a sphere than the grid display layer 10 . Therefore, the detail level of the grid display layer 11 is higher than that of the grid display layer 10 .
第一网格展示层可以处于场景三维模型中的细节程度最高第一层,在这种情况下,第一网格展示层可以基于可移动平台在场景中采集的图像进行构建,一种实现情况下,可以采用运动恢复结构(SFM,structure from motion)技术,实现将可移动平台在场景中采集的图像构建为第一网格展示层,SFM技术可以基于可移动平台的相机拍摄图像时的相机姿态,提取图像的点云数据,并根据点云数据构件的无纹理网格层和图像的纹理,建立带有纹理的网格展示层,该带有纹理的网格展示层即可作为该细节程度最高的第一网格展示层。The first grid display layer can be the first layer with the highest level of detail in the three-dimensional model of the scene. In this case, the first grid display layer can be constructed based on the images collected by the movable platform in the scene. An implementation situation Motion recovery structure (SFM, structure from motion) technology can be used to realize the construction of the image collected by the movable platform in the scene as the first grid display layer. The SFM technology can be based on the camera of the movable platform when the camera captures the image. pose, extract the point cloud data of the image, and establish a textured mesh display layer based on the textureless mesh layer of the point cloud data component and the texture of the image, and the textured mesh display layer can be used as the detail The highest level of the first grid presentation layer.
需要说明的是,第一网格展示层可以处于场景三维模型中除最后一层的其它层,在这种情况下,第一网格展示层可以基于其上一层网格展示层构建得到,具体构建方式可以参照下文由第一网格展示层得到第二网格展示层的过程。It should be noted that the first grid display layer may be in other layers except the last layer in the 3D model of the scene. In this case, the first grid display layer may be constructed based on the previous grid display layer. For the specific construction method, reference may be made to the following process of obtaining the second grid display layer from the first grid display layer.
具体的,描述精度信息可以用于确定网格展示层的细节程度,而网格展 示层的细节程度则可以用几何误差进行表示,几何误差用于表征网格展示层中的网格面相对于场景三维模型的表面(即场景三维模型对应的物体的表面,也可理解为完美网格展示层的网格面的表面)之间的几何距离。通常来说,网格展示层的几何误差越小,说明该网格展示层包括的网格面的数量越多,网格展示层的网格面与场景三维模型的表面的几何距离越小,由于网格面的数量较多,且网格面与完美网格展示层更贴近,使得该网格展示层与完美网格展示层越相似,该网格展示层的细节程度越高。Specifically, the description accuracy information can be used to determine the detail level of the grid display layer, and the detail level of the grid display layer can be represented by a geometric error, which is used to characterize the mesh surface in the grid display layer relative to the scene. The geometric distance between the surfaces of the 3D model (that is, the surface of the object corresponding to the 3D model of the scene, and can also be understood as the surface of the mesh surface of the perfect mesh display layer). Generally speaking, the smaller the geometric error of the grid display layer, the greater the number of grid surfaces included in the grid display layer, and the smaller the geometric distance between the grid surface of the grid display layer and the surface of the 3D model of the scene. Since the number of mesh faces is large, and the mesh faces are closer to the perfect mesh display layer, the more similar the mesh display layer is to the perfect mesh display layer, the higher the level of detail of the mesh display layer.
如,参照图2,在场景三维模型对应物体为一个表面光滑的球体的情况下,网格展示层10为正六面体,网格展示层11为正十二面体。可以看出,网格展示层的网格面的数量越多,则网格面距离球体表面的几何距离越小,使得网格展示层11的几何误差小于网格展示层11的几何误差。For example, referring to FIG. 2 , when the object corresponding to the three-dimensional scene model is a sphere with a smooth surface, the grid display layer 10 is a regular hexahedron, and the grid display layer 11 is a regular dodecahedron. It can be seen that the greater the number of grid surfaces of the grid display layer, the smaller the geometric distance between the grid surface and the sphere surface, so that the geometric error of the grid display layer 11 is smaller than that of the grid display layer 11 .
在本申请实施例中,获取场景三维模型的第一网格展示层对场景的描述精度信息,具体可以获取第一网格展示层中采样点对应的场景的物理尺寸信息,和/或,采样点展示的场景的位置点在第一网格展示层中的实际投影点与采样点之间的偏差信息。In this embodiment of the present application, the description accuracy information of the scene on the first grid display layer of the 3D model of the scene is obtained, specifically, the physical size information of the scene corresponding to the sampling point in the first grid display layer may be obtained, and/or the sampling Deviation information between the actual projection point and the sampling point of the location point of the scene displayed by the point in the first grid display layer.
其中,在根据可移动设备的相机采集的影像重建场景三维模型的过程中,网格展示层的网格面与网格面之间具有交点,该交点也称为网格面的角点或采样点,使得该采样点可以包括对应的场景的物理尺寸信息,该物理尺寸信息可以被称为地面采样距离(gsd,ground sample distance),可以指图像中相邻像素的中心点对应地面的物理距离。Among them, in the process of reconstructing the three-dimensional model of the scene according to the image collected by the camera of the mobile device, there is an intersection point between the grid surface of the grid display layer and the grid surface, and the intersection point is also called the corner point or sampling point of the grid surface. point, so that the sampling point can include the physical size information of the corresponding scene, and the physical size information can be called the ground sampling distance (gsd, ground sample distance), which can refer to the physical distance between the center point of adjacent pixels in the image corresponding to the ground .
采样点v的gsd的计算方式为:在已知采样点v在图像中的深度depth(v)以及相机的焦距focal的情况下,采样点v的gsd=depth(v)/focal。The calculation method of the gsd of the sampling point v is: when the depth (v) of the sampling point v in the image and the focal length focal of the camera are known, the gsd of the sampling point v=depth(v)/focal.
进一步的,采样点展示的场景的位置点在第一网格展示层中的实际投影点与采样点之间的偏差信息,可以被称为第一网格展示层中运动恢复结构(SFM,Structure From Motion)稀疏点的重建残差,SFM是一种根据多视图几何原理来计算一组图片的相机内外参数的技术,其中需要利用图像之间稀疏特征点之间的匹配对应关系,来交汇得到一些稀疏点。Further, the deviation information between the actual projection point of the scene displayed by the sampling point and the sampling point in the first grid display layer can be referred to as the motion recovery structure (SFM, Structure) in the first grid display layer. From Motion) reconstruction residuals of sparse points, SFM is a technology that calculates the internal and external parameters of a group of pictures according to the principle of multi-view geometry. Some sparse spots.
例如,输入两张图片,首先提取每张图片的采样点,然后对两张图片的采样点进行匹配,得到匹配之后,就可以进行前方交汇得到位置点。位置点投影到图像上的二维投影点和实际采样点之间的偏差又称为重建残差,SFM算法的核心就是优化相机的内外参数、以及三维点坐标,使得重建残差最小。本申请实施例中的偏差信息可以包括第一网格展示层内的SFM稀疏点的重建残差的最大值或者平均值。For example, inputting two pictures, first extract the sampling points of each picture, and then match the sampling points of the two pictures, after obtaining the matching, you can conduct forward intersection to obtain the position point. The deviation between the two-dimensional projection point projected from the position point to the image and the actual sampling point is also called the reconstruction residual. The core of the SFM algorithm is to optimize the internal and external parameters of the camera and the three-dimensional point coordinates to minimize the reconstruction residual. The deviation information in this embodiment of the present application may include the maximum value or the average value of the reconstruction residuals of the SFM sparse points in the first grid display layer.
在基于可移动平台采集的场景的图像重建场景三维模型的过程中,场景的各个区域的网格精度是不一样的,通过采用第一网格展示层中采样点对应物理尺寸信息,和/或,采样点展示的场景的位置点在第一网格展示层中的实际投影点与采样点之间的偏差信息作为第一网格展示层对场景的描述精度信息,来对第一网格展示层的几何误差进行度量,从而使得第一网格展示层具有细节程度的度量。In the process of reconstructing the 3D model of the scene based on the images of the scene collected by the movable platform, the grid precision of each area of the scene is different. By using the first grid to display the physical size information corresponding to the sampling points in the layer, and/or , the deviation information between the actual projection point of the scene displayed by the sampling point and the sampling point in the first grid display layer is used as the description accuracy information of the scene by the first grid display layer to display the first grid. The geometric error of the layer is measured so that the first mesh display layer has a measure of the level of detail.
相较于现有技术中通过一个全局的hausdorff距离来度量每层网格展示层的细节程度,由于实际场景中不同区域对应的网格精度不同,很多区域的偏差并没有全局的hausdorff距离那么大,采用全局的hausdorff距离会忽略各个区域的差异性,导致各个网格展示层的细节程度都按照较大的hausdorff距离表示,导致模型展示层的细节程度偏大。因此,本申请实施例中,利用了场景三维重建得到的第一网格展示层中的采样点已有的信息,使得对网格展示层的细节程度的度量结合了三维重建场景中相机拍摄过程中在各个区域中的已有特性,更好的吻合了不同区域的细节程度具有差异化的实际情况,降低了采用全局hausdorff距离带来的精度损失。Compared with the prior art, a global hausdorff distance is used to measure the detail level of each grid display layer. Due to the different grid precisions corresponding to different areas in the actual scene, the deviation of many areas is not as large as the global hausdorff distance. , the use of the global hausdorff distance will ignore the differences in each area, resulting in the level of detail of each grid display layer being represented by a larger hausdorff distance, resulting in a larger level of detail in the model display layer. Therefore, in the embodiment of the present application, the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that the measurement of the detail level of the grid display layer is combined with the camera shooting process in the three-dimensional reconstruction scene. The existing features in each region better match the actual situation that the details of different regions are differentiated, and reduce the accuracy loss caused by using the global hausdorff distance.
步骤102、根据所述描述精度信息确定所述场景三维模型的第二网格展示层的目标几何误差。Step 102: Determine the target geometric error of the second mesh display layer of the three-dimensional model of the scene according to the description accuracy information.
其中,目标几何误差用于表征所述第二网格展示层中的网格面相对于所述场景三维模型的表面的几何误差。The target geometric error is used to represent the geometric error of the mesh surface in the second mesh display layer relative to the surface of the three-dimensional model of the scene.
在本申请实施例中,在得到第一网格展示层的描述精度信息之后,可以通过对第一网格展示层进行简化操作,以减少第一网格展示层中网格面的数量,得到第二网格展示层,由于第二网格展示层中网格面的数量变少,使得第二网格展示层的细节程度降低,从而符合LOD技术的要求。In this embodiment of the present application, after obtaining the description accuracy information of the first grid display layer, the first grid display layer can be simplified by performing a simplified operation to reduce the number of grid surfaces in the first grid display layer, and the result is obtained In the second mesh display layer, since the number of mesh faces in the second mesh display layer is reduced, the detail level of the second mesh display layer is reduced, thereby meeting the requirements of the LOD technology.
具体的,在简化操作中,需要利用目标几何误差作为简化操作的终止条件,即不断确定第一网格展示层简化后形成的新的网格面,与场景三维模型的表面的几何误差,直至该几何误差等于或接近目标几何误差。Specifically, in the simplification operation, the target geometric error needs to be used as the termination condition of the simplification operation, that is, the geometric error between the new mesh surface formed after the simplification of the first mesh display layer and the surface of the three-dimensional model of the scene is continuously determined, until This geometric error is equal to or close to the target geometric error.
由于已在步骤101中解释了几何误差的概念,则根据第一网格展示层的描述精度信息确定第二网格展示层的目标几何误差,具体可以先由第一网格展示层的描述精度信息计算得到第一网格展示层的几何误差,再根据第一网格展示层的几何误差,确定第二网格展示层的几何误差。Since the concept of geometric error has been explained in step 101, the target geometric error of the second grid display layer is determined according to the description accuracy information of the first grid display layer. Specifically, the description accuracy of the first grid display layer can be determined first. The geometric error of the first grid display layer is obtained by information calculation, and then the geometric error of the second grid display layer is determined according to the geometric error of the first grid display layer.
可选的,步骤102具体可以包括:Optionally, step 102 may specifically include:
子步骤1021、根据所述描述精度信息和第一系数,确定所述第一网格展示层的目标几何误差。Sub-step 1021: Determine the target geometric error of the first mesh display layer according to the description precision information and the first coefficient.
在本申请实施例中,由于描述精度信息和几何误差是两种不同的参数,则一种实现方式中,可以将描述精度信息和第一系数的乘积,确定为第一网格展示层的目标几何误差,其中,第一系数可以为固定的转换系数,也可以为根据实际场景需求建立的系数,本申请实施例对此不作限定。In the embodiment of the present application, since the description precision information and the geometric error are two different parameters, in an implementation manner, the product of the description precision information and the first coefficient may be determined as the target of the first grid display layer Geometric error, where the first coefficient may be a fixed conversion coefficient, or may be a coefficient established according to actual scene requirements, which is not limited in this embodiment of the present application.
子步骤1022、根据所述第一网格展示层的目标几何误差,确定所述第二网格展示层的目标几何误差。Sub-step 1022: Determine the target geometric error of the second grid display layer according to the target geometric error of the first grid display layer.
在本申请实施例中,可以根据实际的建模需求和简化需求,根据第一网格展示层的目标几何误差确定第二网格展示层的目标几何误差,如,若希望第二网格展示层的细节程度较低,则可以基于第一网格展示层的目标几何误差,将第二网格展示层的目标几何误差设置为较大值;若希望第二网格展示层的细节程度较高,则可以基于第一网格展示层的目标几何误差,将第二网格展示层的目标几何误差设置为较小值。In this embodiment of the present application, the target geometric error of the second grid display layer may be determined according to the target geometric error of the first grid display layer according to actual modeling requirements and simplification requirements. If the level of detail of the layer is low, the target geometric error of the second grid display layer can be set to a larger value based on the target geometric error of the first grid display layer; If the value is high, the target geometric error of the second grid display layer may be set to a smaller value based on the target geometric error of the first grid display layer.
可选的,子步骤1022具体可以包括:Optionally, sub-step 1022 may specifically include:
子步骤A1、根据所述第一网格展示层的目标几何误差与第二系数,确定所述第二网格展示层的目标几何误差。Sub-step A1: Determine the target geometric error of the second grid display layer according to the target geometric error of the first grid display layer and the second coefficient.
可选的,第二系数随着所述第二网格展示层在所述场景三维模型中所处层数的增大而增大。Optionally, the second coefficient increases as the number of layers where the second mesh display layer is located in the three-dimensional model of the scene increases.
具体的,根据第一网格展示层的目标几何误差,确定第二网格展示层的目标几何误差,具体可以将第一网格展示层的目标几何误差与第二系数的乘积值,确定为第二网格展示层的目标几何误差,第二系数可以为大于1的值,使得随着场景三维模型中网格展示层所处层数的增大,网格展示层的目标几何误差也增大,网格展示层的细节程度逐渐减低,以达到LOD技术的要求。Specifically, the target geometric error of the second grid display layer is determined according to the target geometric error of the first grid display layer. Specifically, the product value of the target geometric error of the first grid display layer and the second coefficient may be determined as For the target geometric error of the second grid display layer, the second coefficient can be a value greater than 1, so that as the number of layers where the grid display layer is located in the 3D model of the scene increases, the target geometric error of the grid display layer also increases. Large, the detail level of the grid display layer is gradually reduced to meet the requirements of LOD technology.
例如,假设场景三维模型包括3个网格展示层m1、m2、m3。每个网格展示层的目标几何误差为上一层网格展示层的目标几何误差与第二系数的乘积,第二系数可以为网格展示层所处的层数,网格展示层m1的目标几何误差为a,则网格展示层m2的目标几何误差为2a,网格展示层m2的目标几何误差为3a,达到了随着场景三维模型中网格展示层所处层数的增大,网格展示层的目标几何误差也增大,网格展示层的细节程度逐渐减低的需求。For example, it is assumed that the three-dimensional model of the scene includes 3 mesh presentation layers m1, m2, and m3. The target geometric error of each grid display layer is the product of the target geometric error of the previous grid display layer and the second coefficient, and the second coefficient can be the number of layers where the grid display layer is located. The target geometric error is a, then the target geometric error of the grid display layer m2 is 2a, and the target geometric error of the grid display layer m2 is 3a. , the target geometric error of the grid display layer also increases, and the detail level of the grid display layer is gradually reduced.
需要说明的是,第二系数的值可以根据实际需求进行设定,本申请实施例对此不作限定,It should be noted that the value of the second coefficient may be set according to actual needs, which is not limited in the embodiment of the present application.
步骤103、对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面。Step 103: Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain new grid surfaces.
其中,网格简化处理包括:折合所述多个网格面的边形成新的点,将形成的新的点作为所述新的网格面的角点,所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值小于预设阈值。The mesh simplification processing includes: folding the edges of the plurality of mesh surfaces to form new points, and using the formed new points as corner points of the new mesh surfaces, and the new mesh surfaces are relative to all the mesh surfaces. The difference between the actual geometric error of the surface of the three-dimensional model of the scene and the target geometric error is smaller than a preset threshold.
在本申请实施例中,网格简化处理的宗旨是通过降低当前网格展示层中网格面的数量,得到下一层网格展示层,使得下一层网格展示层的细节程度更低。In this embodiment of the present application, the purpose of mesh simplification processing is to obtain the next mesh display layer by reducing the number of mesh faces in the current mesh display layer, so that the detail level of the next mesh display layer is lower .
具体的,参照图3,其示出了本申请实施例提供的一种网格展示层的简化过程示意图,本申请实施例通过一个较简单的示例,进行网格简化处理的说明,图3中,示出了一个网格面集合12和一个网格面集合13,网格面集合12包括9个网格面,网格面集合13包括7个网格面,在一次简化操作中,通过折合网格面集合12中网格面的边,消除其中的角点v1和角点v2,并形成新的角点v3,得到网格面集合13,即通过边的坍塌,网格面集合12中间的角点v1和角点v2合并为一个角点v3,使得中间的两个三角形网格面被消除了,也就是降低了网格面的数量。Specifically, referring to FIG. 3 , it shows a schematic diagram of a simplified process of a grid display layer provided by an embodiment of the present application. An embodiment of the present application uses a relatively simple example to describe the grid simplification process. In FIG. 3 , , shows a mesh face set 12 and a mesh face set 13. The mesh face set 12 includes 9 mesh faces, and the mesh face set 13 includes 7 mesh faces. In a simplified operation, by folding The edge of the grid surface in the grid surface set 12, eliminate the corner points v1 and v2, and form a new corner point v3 to obtain the grid surface set 13, that is, through the collapse of the edge, the middle of the grid surface set 12 The corner point v1 and the corner point v2 are merged into a corner point v3, so that the two triangular mesh faces in the middle are eliminated, that is, the number of mesh faces is reduced.
需要说明的是,根据实际需求,也可以在简化操作中不生成新的角点,而是将其中一个已有角点作为所述新的网格面的角点,本申请实施例对此不作限定。例如,图3中,可以仅消除角点v2以及角点v2所关联的边,得到的简化后的网格面集合包括4个三角形网格面和1个五边形网格面。It should be noted that, according to actual requirements, a new corner point may not be generated in the simplified operation, but one of the existing corner points may be used as the corner point of the new mesh surface, which is not made in this embodiment of the present application. limited. For example, in FIG. 3 , only the corner point v2 and the edge associated with the corner point v2 may be eliminated, and the obtained simplified mesh face set includes four triangular mesh faces and one pentagonal mesh face.
进一步的,第一网格展示层通过网格简化处理得到第二网格展示层,整个网格简化处理可以通过多次简化迭代操作实现,如何去确定何时停止迭代,本申请实施例通过步骤103得到的第二网格展示层的目标几何误差,可以在每次或预设次简化迭代操作时,计算当前得到的新的网格面相对于场景三维模型的表面的实际几何误差与所述目标几何误差的差值,是否小于一个预设阈值,若小于,则认为网格简化处理已完成,此时得到的第二网格展示层的实际几何误差已非常接近目标几何误差,符合当前应用场景和LOD技术的要求。若大于,则认为网格简化处理还未完成,需要继续进行下一次简化迭代操作。Further, the first grid display layer obtains the second grid display layer through grid simplification processing, and the entire grid simplification processing can be implemented by multiple simplified iterative operations. 103 The obtained target geometric error of the second mesh display layer can be calculated in each or preset simplified iterative operation, and the actual geometric error of the currently obtained new mesh surface relative to the surface of the three-dimensional model of the scene and the target Whether the difference between the geometric errors is smaller than a preset threshold, if it is smaller, it is considered that the grid simplification process has been completed, and the actual geometric error of the second grid display layer obtained at this time is very close to the target geometric error, which is in line with the current application scenario. and LOD technology requirements. If it is greater than this, it is considered that the mesh simplification process has not been completed, and the next simplification iteration operation needs to be continued.
需要说明的是,预设阈值可以根据实际需求进行设定,例如,若对网格简化处理的精度要求较高,则可以将预设阈值设定为较小值。It should be noted that the preset threshold may be set according to actual requirements. For example, if the requirement for the accuracy of grid simplification processing is high, the preset threshold may be set to a smaller value.
步骤104、将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储。Step 104: Store the formed new mesh surface as the second mesh display layer of the three-dimensional scene model.
在得到第二网格展示层之后,可以将第二网格展示层所包含的网格及纹理数据进行存储,具体可以存储在场景三维模型的目录下,使得第二网格展 示层可以作为场景三维模型的一层展示层。After the second grid display layer is obtained, the grid and texture data contained in the second grid display layer can be stored, specifically in the directory of the 3D model of the scene, so that the second grid display layer can be used as a scene A presentation layer for a 3D model.
当根据实际需求得到了多层细节程度递减的网格展示层并进行了存储之后,场景三维模型建立完毕,后续可以通过渲染器对场景三维模型中的一层或多层网格展示层进行渲染展示,以在对该场景三维模型的物体进行渲染时,通过多层网格展示层实现资源分配,以降低远处或者非重要物体的面数和细节度,从而减少了资源的耗用。例如,物体距离视点越远,则选取细节程度越低的网格展示层来对物体进行展示。After the multi-layer grid display layers with decreasing levels of detail are obtained and stored according to actual requirements, the 3D model of the scene is established, and then the renderer can be used to render one or more layers of grid display layers in the 3D model of the scene. Display, in order to achieve resource allocation through multi-layer grid display layers when rendering objects in the 3D model of the scene, so as to reduce the number of faces and details of distant or non-important objects, thereby reducing resource consumption. For example, the farther the object is from the viewpoint, the mesh display layer with lower level of detail is selected to display the object.
需要说明的是,第二网格展示层可以为第一网格展示层的下一层网格展示层,第二网格展示层也可以为第一网格展示层之下的若干层网格展示层,如,第一网格展示层为场景三维模型的首层网格展示层,而第二网格展示层可以为场景三维模型的第n层网格展示层,n≥2。本申请实施例对此不作限定。It should be noted that the second grid display layer may be the next grid display layer of the first grid display layer, and the second grid display layer may also be several layers of grids below the first grid display layer. The presentation layer, for example, the first grid presentation layer is the first grid presentation layer of the scene 3D model, and the second grid presentation layer may be the nth grid presentation layer of the scene 3D model, where n≥2. This embodiment of the present application does not limit this.
综上,本申请实施例提供的一种建立模型的方法,通过利用第一网格展示层中采样点已有的物理尺寸信息和或偏差信息,来对第一网格展示层中的几何误差进行确定,从而利用几何误差使得第一网格展示层具有了细节程度的度量。本申请实施例中,利用了场景三维重建得到的第一网格展示层中的采样点已有的信息,使得在三维重建场景中,对网格展示层细节程度的度量,结合了相机拍摄过程中在各个场景的区域中的已有特性,更好的吻合了不同区域的细节程度具有差异化的实际情况,提高了对网格面进行网格简化处理时终止简化条件的精度,降低了采用全局hausdorff距离作为该终止简化条件时带来的精度损失,使得在得到多层细节程度递减的网格展示层的过程中,不再依赖一个已知的完美展示层,消除了计算完美展示层的过程,降低了计算压力,且由于采用了更准确的采样点的物理尺寸信息和或偏差信息去确定目标几何误差,解决了采用全局hausdorff距离作为几何误差时,产生的网格展示层的细节程度指标偏大,造成后续渲染精度下降的问题。To sum up, a method for establishing a model provided by an embodiment of the present application uses the existing physical size information and/or deviation information of sampling points in the first grid display layer to determine the geometric error in the first grid display layer. A determination is made such that the first mesh presentation layer has a measure of the level of detail using the geometric error. In the embodiment of the present application, the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process. The existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of The accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer. The process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved. The indicator is too large, which causes the problem of subsequent rendering accuracy decline.
图4是本申请实施例提供的一种建立模型的方法的具体流程图,该方法可以包括:4 is a specific flowchart of a method for establishing a model provided by an embodiment of the present application, and the method may include:
步骤201、获取场景三维模型的第一网格展示层对场景的描述精度信息。Step 201: Acquire the description accuracy information of the scene by the first grid display layer of the three-dimensional model of the scene.
具体的,步骤201具体可以参照上述步骤101,此处不再赘述。Specifically, for step 201, reference may be made to the foregoing step 101, and details are not repeated here.
步骤202、根据所述描述精度信息确定所述场景三维模型的第二网格展示层的目标几何误差。Step 202: Determine the target geometric error of the second mesh display layer of the three-dimensional scene model according to the description accuracy information.
具体的,步骤202具体可以参照上述步骤102,此处不再赘述。Specifically, for step 202, reference may be made to the foregoing step 102, and details are not repeated here.
步骤203、对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面。Step 203: Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain new grid surfaces.
具体的,步骤203具体可以参照上述步骤103,此处不再赘述。Specifically, for step 203, reference may be made to the foregoing step 103, and details are not repeated here.
步骤204、将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储。Step 204: Store the formed new mesh surface as the second mesh display layer of the three-dimensional scene model.
具体的,步骤205具体可以参照上述步骤104,此处不再赘述。Specifically, for step 205, reference may be made to the foregoing step 104, and details are not repeated here.
可选的,所述第一网格展示层包括多个第一网格区块,每个所述第一网格区块包括多个网格面;所述第一网格展示层的目标几何误差包括每个所述第一网格区块的几何误差,所述第一网格展示层的描述精度信息包括每个所述第一网格区块的描述精度值;所述第二网格展示层包括多个第二网格区块,每个所述第二网格区块包括至少一个网格面;所述第二网格展示层的目标几何误差包括每个所述第二网格区块的几何误差,所述第二网格展示层的描述精度信息包括每个所述第二网格区块的描述精度值。Optionally, the first grid display layer includes a plurality of first grid blocks, and each of the first grid blocks includes a plurality of grid surfaces; the target geometry of the first grid display layer The error includes a geometric error of each of the first grid blocks, and the description accuracy information of the first grid display layer includes a description accuracy value of each of the first grid blocks; the second grid The display layer includes a plurality of second grid blocks, each of the second grid blocks includes at least one grid face; the target geometric error of the second grid display layer includes each of the second grids The geometric error of the block, the description precision information of the second grid display layer includes the description precision value of each of the second grid blocks.
在本申请实施例中,在具体实施LOD策略时,可以将整个网格展示层进行分块,变成多个独立的网格区块,参照图5,其示出了本申请实施例提供的一种网格展示层的分块示意图。其中,包括三个网格展示层:网格展示层m0,网格展示层m1,网格展示层m2,且从网格展示层m0至网格展示层m2,细节程度依次递减,格展示层m0具有16个网格区块,网格展示层m1具有4个网格区块,网格展示层m2具有1个网格区块,每个网格区块相当于一个节点,形成一个四叉树结构,不同层之间的节点存在父子关系,如网格展示层m2具有四个子节点,即网格展示层m1的四个网格区块。需要说明的是,四叉树结构只是一种分块操作得到的树形结构,根据不同的需求,树形结构还可以包括:二叉树结构、三叉树结构、八叉树结构等。In the embodiment of the present application, when the LOD strategy is specifically implemented, the entire grid display layer may be divided into multiple independent grid blocks. Referring to FIG. 5 , it shows the A block diagram of a grid display layer. Among them, three grid display layers are included: grid display layer m0, grid display layer m1, grid display layer m2, and from grid display layer m0 to grid display layer m2, the level of detail decreases in order, grid display layer m0 has 16 grid blocks, the grid display layer m1 has 4 grid blocks, and the grid display layer m2 has 1 grid block, each grid block is equivalent to a node, forming a four-fork In a tree structure, the nodes between different layers have a parent-child relationship. For example, the grid display layer m2 has four child nodes, that is, the four grid blocks of the grid display layer m1. It should be noted that the quad-tree structure is only a tree-shaped structure obtained by a block operation. According to different requirements, the tree-shaped structure may also include: a binary tree structure, a ternary tree structure, an octree structure, and the like.
因此,在本申请实施例中,对网格展示层分块有几个好处:一是在场景三维模型的实际显示过程中,多数情况下只需要显示场景的某个局部区域,不需要加载整个模型,分块可以缓解这个问题,减少资源耗用;二是不同区域的细节程度本身就是不一致的,分块可以将不同细节的区域分开,便于后续更加精确化显示。Therefore, in the embodiment of the present application, there are several advantages to dividing the grid display layer: First, in the actual display process of the 3D model of the scene, in most cases, only a certain local area of the scene needs to be displayed, and it is not necessary to load the entire scene. Models and blocks can alleviate this problem and reduce resource consumption; second, the level of detail in different areas is inconsistent, and blocks can separate areas with different details for more accurate subsequent display.
具体的,每一个网格展示层的描述精度信息,具体可以包括该层中每个网格区块的描述精度值,即描述精度信息具体可以为各个网格区块的描述精 度值的集合。每一个网格展示层的目标几何误差,具体可以包括该层中每个网格区块的几何误差,即目标几何误差具体可以为各个网格区块的几何误差的集合。并且,由于每个网格区块可以对应场景中的某个局部区域,因此,每个网格区块的几何误差可以精确反映其对应的局部区域的精度、误差,综合起来,整个网格展示层的目标几何误差则可以包含场景中各个局部区域的已有特性,更好的吻合了不同区域的细节程度具有差异化的实际情况,进一步提高了对网格面进行网格简化处理时终止简化条件的精度。Specifically, the description precision information of each grid display layer may specifically include a description precision value of each grid block in the layer, that is, the description precision information may specifically be a set of description precision values of each grid block. The target geometric error of each grid display layer may specifically include the geometric error of each grid block in the layer, that is, the target geometric error may specifically be a set of geometric errors of each grid block. Moreover, since each grid block can correspond to a certain local area in the scene, the geometric error of each grid block can accurately reflect the accuracy and error of its corresponding local area. Taken together, the entire grid display The target geometric error of the layer can include the existing characteristics of each local area in the scene, which better matches the actual situation that the degree of detail in different areas is different, and further improves the termination of simplification when the mesh surface is simplified. The precision of the condition.
可选的,对所述第一网格展示层中每个第一网格区块的网格面做网格简化处理,得到每个所述第一网格区块中新的网格面。Optionally, grid simplification processing is performed on the grid surface of each first grid block in the first grid display layer to obtain a new grid surface in each of the first grid blocks.
具体的,在进行网格区块的简化处理过程中,需要计算网格区块中边的折合代价,并根据折合代价由小到大的顺序、不断折合网格区块中的边,直至当前得到的新的网格面相对于所述场景三维模型的表面的实际几何误差与目标几何误差的差值小于预设阈值。其中,网格区块的边的折合代价是根据所述网格简化处理后得到的新的网格面的角点,与目标网格面之间的距离计算得到的,所述目标网格面为所述网格简化处理前的网格区块中与所述新的网格面的角点相邻的网格面。Specifically, in the process of simplifying the grid block, it is necessary to calculate the folded cost of the edges in the grid block, and continuously fold the edges in the grid block according to the order of the folded cost from small to large, until the current The difference between the actual geometric error of the obtained new mesh surface relative to the surface of the three-dimensional model of the scene and the target geometric error is smaller than a preset threshold. Wherein, the folded cost of the edge of the grid block is calculated according to the distance between the corner points of the new grid surface obtained after the grid simplification process and the target grid surface, the target grid surface For the mesh face adjacent to the corner point of the new mesh face in the mesh block before the mesh simplification process.
在本申请实施例中,折合代价实际上可以为一种距离性质的值,其能够反映网格简化处理后得到的新的网格面的角点与目标网格面之间的距离,参照图3,假设图3中包括网格区块12和网格区块13,网格区块12简化后得到网格区块13,在一种实现方式中,网格区块13的折合代价可以为新的网格面的角点v3,与目标网格面(网格区块12中的9个网格面)之间的距离的平方和。In this embodiment of the present application, the reduced cost may actually be a value of a distance property, which can reflect the distance between the corner points of the new mesh surface obtained after the mesh simplification process and the target mesh surface. 3. Assuming that the grid block 12 and the grid block 13 are included in FIG. 3, the grid block 12 is simplified to obtain the grid block 13. In an implementation manner, the reduced cost of the grid block 13 can be The sum of the squares of the distances between the corner v3 of the new mesh face and the target mesh face (9 mesh faces in mesh block 12).
进一步的,针对网格简化处理中每个网格区块的迭代终止误差是由同一hausdorff距离得到的值的方案,本申请实施例每个网格区块的迭代终止误差是由每个网格区块的各自的描述精度值得到的,描述精度值又可以为网格区块中最大角点的gsd值、最大角点的gsd值与预设系数的乘积、SFM稀疏点的重建残差中的任意一种。这样使得每个网格区块能够保留其自身的特性,更好的吻合了场景中不同区域的细节程度具有差异化的实际情况,降低了采用hausdorff距离的方案带来的精度损失。Further, for the scheme in which the iteration termination error of each grid block in the grid simplification process is a value obtained by the same hausdorff distance, the iteration termination error of each grid block in the embodiment of the present application is determined by each grid block. Obtained from the respective description precision values of the blocks, and the description precision values can be the gsd value of the largest corner point in the grid block, the product of the gsd value of the largest corner point and the preset coefficient, and the reconstruction residual of the SFM sparse point. any of the . In this way, each grid block can retain its own characteristics, which better matches the actual situation that the details of different areas in the scene are different, and reduces the accuracy loss caused by the hausdorff distance scheme.
需要说明的是,每个网格区块中的纹理部分的纹理分辨率,在进行网格简化处理时,也可以根据网格区块的描述精度值进行对应调整,以实现纹理部分的细节简化。另外,每个网格区块的相关信息,可以具体保存到通用的LOD格式文件中,如开放式场景图(OSG,OpenSceneGraph)格式文件。It should be noted that the texture resolution of the texture part in each grid block can also be adjusted according to the description precision value of the grid block during the grid simplification process, so as to simplify the details of the texture part. . In addition, the relevant information of each grid block can be specifically saved in a general LOD format file, such as an Open Scene Graph (OSG, OpenSceneGraph) format file.
可选的,所述第二网格区块的数量小于所述第一网格区块的数量。Optionally, the number of the second grid blocks is smaller than the number of the first grid blocks.
在本申请实施例中,处于越高层的网格展示模型包括的网格区块的数量,要大于处于越低层的网格展示模型包括的网格区块的数量,即网格区块的数量越小,网格展示层的细节程度越低,通过层层递减的网格区块数量,满足LOD技术要求实现包括多层细节程度递减的网格展示层的场景三维模型的需求。In this embodiment of the present application, the number of grid blocks included in the grid display model at a higher layer is greater than the number of grid blocks included in the grid display model at a lower layer, that is, the number of grid blocks The smaller the number, the lower the level of detail of the grid display layer. The number of grid blocks decreases layer by layer to meet the requirements of LOD technology to realize the 3D model of the scene including the multi-layer grid display layer with decreasing detail.
步骤205、在所述第二网格展示层的所有网格面的数量满足预设条件的情况下,得到包含至少两层网格展示层的场景三维模型。Step 205: Obtain a three-dimensional model of the scene including at least two grid display layers when the number of all grid surfaces of the second grid display layer satisfies a preset condition.
在本申请实施例中,整个LOD架构下的场景三维模型的建立终止条件,可以为最后一层网格展示层的所有网格面的数量小于预设数量值,即网格展示层的所有网格面的数量足够小,使得网格展示层的细节程度足够低,此时,场景三维模型建立完毕。预设数量值可以根据实际需求进行设定,本申请实施例不作限定。In this embodiment of the present application, the termination condition for the establishment of the 3D model of the scene under the entire LOD architecture may be that the number of all mesh faces of the last mesh display layer is less than the preset number, that is, all meshes of the mesh display layer The number of grids is small enough so that the detail level of the grid display layer is low enough. At this point, the 3D model of the scene is established. The preset quantity value may be set according to actual requirements, which is not limited in the embodiment of the present application.
步骤206、将所述场景三维模型中处于屏幕的可视窗口的范围内的目标网格展示层,进行渲染展示。Step 206: Render and display the target mesh display layer in the three-dimensional model of the scene that is within the range of the visible window of the screen.
在本申请实施例中,在得到场景三维模型之后,可以对场景三维模型进行展示,其中,展示设备的屏幕具有可视窗口的范围,为了便于理解,可以将场景三维模型想象成一个范围较大的场景,用户投过屏幕的可视窗口观看场景三维模型,屏幕的可视窗口相较于该场景较小,即屏幕的可视窗口在一个时刻与场景三维模型保持一种相对位置关系,使得屏幕的可视窗口仅能够展示场景三维模型的部分区域,若要展示其他区域,则可以改变屏幕的可视窗口与展示场景三维模型的相对位置关系。In this embodiment of the present application, after obtaining the 3D scene model, the 3D scene model can be displayed, wherein the screen of the display device has a range of visible windows. For ease of understanding, the 3D scene model can be imagined as a larger range The user casts the visual window of the screen to watch the 3D model of the scene, and the visual window of the screen is smaller than the scene, that is, the visual window of the screen maintains a relative positional relationship with the 3D model of the scene at a moment, so that The visible window of the screen can only display a part of the 3D model of the scene. To display other areas, the relative positional relationship between the visible window of the screen and the 3D model of the displayed scene can be changed.
在该步骤中,可以根据当前场景三维模型与屏幕的可视窗口的相对位置关系,确定场景三维模型中处于屏幕的可视窗口的范围内的目标网格展示层,进行渲染展示。需要说明的是,屏幕的可视窗口相当于用户的视点,选取处于屏幕的可视窗口的范围内的目标网格展示层进行展示,可以按照以下规则: 网格展示层对应的场景距离视点越远,则选取细节程度越低的网格展示层来对场景进行展示,从而利用处于远处的场景的网格展示层的较低面数和细节度,减少了对渲染资源的耗用。In this step, according to the relative positional relationship between the current three-dimensional model of the scene and the visible window of the screen, a target mesh display layer in the three-dimensional model of the scene within the range of the visible window of the screen can be determined for rendering display. It should be noted that the visual window of the screen is equivalent to the user's viewpoint, and the target grid display layer within the range of the visual window of the screen is selected for display, and the following rules can be followed: If the scene is far away, the grid display layer with the lower level of detail is selected to display the scene, thereby reducing the consumption of rendering resources by using the lower face count and detail degree of the grid display layer of the distant scene.
可选的,步骤206具体可以包括:Optionally, step 206 may specifically include:
子步骤2061、按照所包含的网格面的数量最小到大的顺序,计算每个所述目标网格展示层在所述可视窗口上的最大像素误差,并在出现所述最大像素误差小于或等于预设误差值的目标网格展示层时,对所述最大像素误差小于或等于预设阈值的目标网格展示层进行渲染展示。Sub-step 2061: Calculate the maximum pixel error of each target grid display layer on the visible window in the order from the smallest to the largest number of grid faces included, and when the maximum pixel error is less than When the target grid display layer is equal to or equal to the preset error value, the target grid display layer whose maximum pixel error is less than or equal to the preset threshold is rendered and displayed.
在对场景三维模型进行展示的过程中,渲染器可以利用网格展示层的目标几何误差δ(L)作为细节程度指标进行选取显示,渲染器具体在实时渲染的时候,可以计算一个网格展示层投影到屏幕的最大像素误差φ(L)。In the process of displaying the 3D model of the scene, the renderer can use the target geometric error δ(L) of the grid display layer as the detail level indicator for selection and display. The renderer can calculate a grid display during real-time rendering. The maximum pixel error φ(L) of the layer's projection to the screen.
φ(L)=(f×δ(L))/D,其中,f为可视窗口的焦距,D为视点到网格展示层的最近距离。渲染器按照LOD进行显示的保真度要求为:φ(L)<τ,τ为常数性质的预设阈值,一般取1,那么选取满足φ(L)<τ条件的目标网格层来进行显示即可。φ(L)=(f×δ(L))/D, where f is the focal length of the visible window, and D is the closest distance from the viewpoint to the grid display layer. The fidelity requirements for the renderer to display according to the LOD are: φ(L)<τ, τ is a preset threshold value of constant nature, generally set to 1, then select the target grid layer that satisfies the condition of φ(L)<τ to carry out Display it.
具体的,参照图5中包括的三个网格展示层:网格展示层m0,网格展示层m1,网格展示层m2,渲染器实时渲染该场景的具体流程为:Specifically, referring to the three grid display layers included in FIG. 5: grid display layer m0, grid display layer m1, grid display layer m2, the specific process of rendering the scene in real time by the renderer is:
首先渲染器加载细节程度最低的网格展示层m2,判断网格展示层m2是否在可视窗口的范围内,如果在可视窗口内则进行计算网格展示层m2投影到屏幕的最大像素误差φ(m2),φ(m2)=(f×δ(m2))/D(m2),其中f为可视窗口的焦距,D(m2)为可视窗口到网格展示层m2的最近距离(网格展示层m2中所有角点和可视窗口的距离的最小值),δ(m2)为网格展示层m2的目标几何误差。First, the renderer loads the grid display layer m2 with the lowest level of detail, determines whether the grid display layer m2 is within the range of the visible window, and if it is within the visible window, calculates the maximum pixel error φ of the grid display layer m2 projected to the screen (m2), φ(m2)=(f×δ(m2))/D(m2), where f is the focal length of the visible window, and D(m2) is the closest distance from the visible window to the grid display layer m2 ( The minimum distance between all corners and the visible window in the grid display layer m2), δ(m2) is the target geometric error of the grid display layer m2.
LOD技术的显示的保真度要求:φ<τ,τ一般取1,也即网格投影到屏幕的最大像素误差要小于一个像素。所以如果φ(m2)<1,那么渲染器会选择网格展示层m2进行渲染,不再遍历其孩子节点;如果φ(m2)>1,那么渲染器会接着依次遍历其孩子节点,也即网格展示层m1中的四个分块网格,并判断网格展示层m1是否在可视窗口内,如果在可视窗口内则进行下一步;计算网格展示层m1投影到屏幕的最大像素误差φ(m1),后续过程和上述对 网格展示层m2的处理一样,直到φ<1或者达到叶子节点为止。通过这种规则,就可以将符合保真度要求的网格展示层选取出来并渲染显示了。The display fidelity requirements of LOD technology: φ<τ, τ is generally taken as 1, that is, the maximum pixel error of the grid projected to the screen is less than one pixel. So if φ(m2)<1, then the renderer will select the grid display layer m2 for rendering, and no longer traverse its child nodes; if φ(m2)>1, then the renderer will then traverse its child nodes in turn, that is, The grid displays the four block grids in the layer m1, and judges whether the grid display layer m1 is in the visible window, and if it is in the visible window, go to the next step; calculate the maximum pixel error of the grid display layer m1 projected to the screen φ(m1), the subsequent process is the same as the above-mentioned processing for the grid display layer m2, until φ<1 or the leaf node is reached. Through this rule, the grid display layer that meets the fidelity requirements can be selected and rendered.
可选的,在步骤203之后,所述方法还包括:Optionally, after step 203, the method further includes:
步骤207、在所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值大于或等于所述预设阈值的情况下,将所有所述新的网格面作为所述第一网格展示层,并进入步骤203。Step 207: Under the condition that the difference between the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene and the target geometric error is greater than or equal to the preset threshold The grid surface is used as the first grid display layer, and the process goes to step 203 .
在本申请实施例中,第一网格展示层通过网格简化处理得到第二网格展示层,整个网格简化处理可以通过多次简化迭代操作实现,如何去确定何时停止迭代,本申请实施例根据步骤203得到的第二网格展示层的目标几何误差,可以在每次或预设次简化迭代操作时,计算当前得到的新的网格面相对于场景三维模型的表面的实际几何误差与所述目标几何误差的差值,是否小于一个预设阈值,若小于,则认为网格简化处理已完成,此时得到的第二网格展示层的实际几何误差已非常接近目标几何误差,符合当前应用场景和LOD技术的要求。若大于,则认为网格简化处理还未完成,则进入步骤203,继续进行下一次简化迭代操作,直至实际几何误差与所述目标几何误差的差值小于预设阈值时停止。In this embodiment of the present application, the first grid presentation layer obtains the second grid presentation layer through grid simplification processing, and the entire grid simplification processing can be implemented through multiple simplified iterative operations. How to determine when to stop the iteration, this application In the embodiment, according to the target geometric error of the second mesh display layer obtained in step 203, the actual geometric error of the currently obtained new mesh surface relative to the surface of the three-dimensional model of the scene may be calculated in each or a preset simplified iterative operation. Whether the difference between the geometric error of the target and the target is less than a preset threshold, if it is less than, it is considered that the grid simplification process has been completed, and the actual geometric error of the second grid display layer obtained at this time is very close to the target geometric error, Meet the requirements of current application scenarios and LOD technology. If it is greater than that, it is considered that the mesh simplification process has not been completed, and the process goes to step 203, and the next simplification iterative operation is continued until the difference between the actual geometric error and the target geometric error is smaller than the preset threshold.
可选的,在步骤201之前,还可以包括:Optionally, before step 201, it may further include:
步骤B1、获取至少一个待重建图像。Step B1: Acquire at least one image to be reconstructed.
步骤B2、根据所述待重建图像,构建得到所述第一网格展示层。Step B2, constructing and obtaining the first grid display layer according to the image to be reconstructed.
在本申请实施例中,若第一网格展示层为场景三维模型中的首层,则建立第一网格展示层的方法可以基于可移动平台在场景中采集的待重建图像,通过三维重建技术,得到该第一网格展示层,以将其作为场景三维模型中细节程度最高的网格展示层。In the embodiment of the present application, if the first grid display layer is the first layer in the 3D model of the scene, the method for establishing the first grid display layer may be based on the images to be reconstructed collected in the scene by the movable platform, technology to obtain the first mesh display layer, so as to use it as the mesh display layer with the highest level of detail in the three-dimensional model of the scene.
一种实现情况下,可以采用运动恢复结构(SFM,structure from motion)技术,实现将可移动平台在场景中采集的图像构建为第一网格展示层,SFM技术可以基于可移动平台的相机拍摄图像时的相机姿态,提取图像的点云数据,并根据点云数据构件的无纹理网格层和图像的纹理,建立带有纹理的网格展示层,该带有纹理的网格展示层即可作为该细节程度最高的第一网格展示层。In one implementation, the structure from motion (SFM, structure from motion) technology can be used to realize the construction of the image collected by the movable platform in the scene as the first grid display layer, and the SFM technology can be captured based on the camera of the movable platform. The camera pose at the time of the image, extract the point cloud data of the image, and establish a textured mesh display layer according to the textureless mesh layer of the point cloud data component and the texture of the image. The textured mesh display layer is Can be used as the first mesh display layer with the highest level of detail.
可选的,步骤B2具体可以包括:Optionally, step B2 may specifically include:
步骤B21、确定每个所述待重建图像对应的相机姿态和纹理图。Step B21: Determine the camera pose and texture map corresponding to each of the to-be-reconstructed images.
在本申请实施例中,对每个待重建图像,基于相机拍摄该待重建图像时 的内外参数,可以得到每个待重建图像对应的相机姿态,通过纹理提取模型(卷积神经网络模型即可)可以得到每个待重建图像对应的纹理图。In the embodiment of the present application, for each image to be reconstructed, the camera pose corresponding to each image to be reconstructed can be obtained based on the internal and external parameters of the image to be reconstructed by the camera, and a texture extraction model (convolutional neural network model is sufficient) ) can obtain the texture map corresponding to each image to be reconstructed.
其中,相机的内、外参数分别指相机的内参数(相机焦距、相机中心点偏移、相机畸变参数等)和外参数(相机在世界坐标系下的旋转矩阵和平移向量)。Among them, the internal and external parameters of the camera refer to the internal parameters of the camera (camera focal length, camera center point offset, camera distortion parameters, etc.) and external parameters (the rotation matrix and translation vector of the camera in the world coordinate system).
步骤B22、根据所述相机姿态,对所述多个待重建图像中的两个目标图像进行点云匹配,得到点云数据,所述两个目标图像的画面中存在重叠部分。Step B22: Perform point cloud matching on two target images in the plurality of images to be reconstructed according to the camera posture to obtain point cloud data, and there are overlapping parts in the frames of the two target images.
在该步骤中,根据已知的相机姿态,对多对待重建图像中的两个存在重叠部分的目标图像进行点云匹配,可以得到点云数据,该过程具体可以通过立体视觉(MVS,Multi-view stereo)技术实现。场景中点云数据是指在逆向工程中通过测量仪器得到的场景中物体外观表面的点数据的集合。In this step, according to the known camera posture, point cloud matching is performed on two target images with overlapping parts in the multi-image to be reconstructed, and point cloud data can be obtained. view stereo) technology implementation. The point cloud data in the scene refers to the collection of point data on the appearance surface of the objects in the scene obtained by the measuring instrument in the reverse engineering.
步骤B23、根据所述点云数据,构建得到无纹理网格展示层。Step B23, constructing a textureless mesh display layer according to the point cloud data.
在该步骤中,点云数据包括了场景中每个点的三维坐标,因此,根据点云数据,可以构建得到反映场景三维结构的无纹理网格展示层。该过程具体可以通过泊松表面重建技术得到。In this step, the point cloud data includes the three-dimensional coordinates of each point in the scene. Therefore, according to the point cloud data, a textureless mesh display layer reflecting the three-dimensional structure of the scene can be constructed. Specifically, this process can be obtained by the Poisson surface reconstruction technique.
步骤B24、将所述无纹理网格展示层映射至所述纹理图,以从所述纹理图中确定所述无纹理网格展示层中的每个网格面对应的纹理区域,并将所述纹理区域添加至对应的网格面,得到所述第一网格展示层。Step B24: Map the textureless mesh display layer to the texture map, so as to determine the texture area corresponding to each mesh surface in the textureless mesh display layer from the texture map, and map the textureless mesh display layer to the texture map. The texture area is added to the corresponding mesh surface to obtain the first mesh display layer.
由于步骤B23得到的是无纹理网格展示层,为了得到最终的具有纹理的第一网格展示层,本申请实施例可以将无纹理网格展示层整体映射至纹理图,以从纹理图中确定无纹理网格展示层中的每个网格面对应的纹理区域,并将纹理区域添加至对应的网格面,得到所述第一网格展示层,此时得到的第一网格展示层具有纹理,可以直接被渲染展示。Since the textureless mesh display layer is obtained in step B23, in order to obtain the final first mesh display layer with texture, the embodiment of the present application may map the textureless mesh display layer to the texture map as a whole, so as to obtain the texture map from the texture map. Determine the texture area corresponding to each mesh surface in the textureless mesh display layer, and add the texture area to the corresponding mesh surface to obtain the first mesh display layer. At this time, the obtained first mesh The presentation layer has textures and can be rendered directly.
综上,本申请实施例提供的一种建立模型的方法,通过利用第一网格展示层中采样点已有的物理尺寸信息和或偏差信息,来对第一网格展示层中的几何误差进行确定,从而利用几何误差使得第一网格展示层具有了细节程度的度量。本申请实施例中,利用了场景三维重建得到的第一网格展示层中的采样点已有的信息,使得在三维重建场景中,对网格展示层细节程度的度量,结合了相机拍摄过程中在各个场景的区域中的已有特性,更好的吻合了不同区域的细节程度具有差异化的实际情况,提高了对网格面进行网格简化处理 时终止简化条件的精度,降低了采用全局hausdorff距离作为该终止简化条件时带来的精度损失,使得在得到多层细节程度递减的网格展示层的过程中,不再依赖一个已知的完美展示层,消除了计算完美展示层的过程,降低了计算压力,且由于采用了更准确的采样点的物理尺寸信息和或偏差信息去确定目标几何误差,解决了采用全局hausdorff距离作为几何误差时,产生的网格展示层的细节程度指标偏大,造成后续渲染精度下降的问题。To sum up, a method for establishing a model provided by an embodiment of the present application uses the existing physical size information and/or deviation information of sampling points in the first grid display layer to determine the geometric error in the first grid display layer. A determination is made such that the first mesh presentation layer has a measure of the level of detail using the geometric error. In the embodiment of the present application, the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process. The existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of The accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer. The process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved. The indicator is too large, which causes the problem of subsequent rendering accuracy decline.
图6是本申请实施例提供的一种建立模型的装置的框图,如图6所示,该建立模型的装置300可以包括:存储器301和处理器302;FIG. 6 is a block diagram of an apparatus for establishing a model provided by an embodiment of the present application. As shown in FIG. 6 , the apparatus 300 for establishing a model may include: a memory 301 and a processor 302;
所述存储器301用于执行:获取场景三维模型的第一网格展示层对场景的描述精度信息,其中,所述第一网格展示层包括用于展示所述场景三维模型的表面的多个网格面,所述描述精度信息包括:所述第一网格展示层中采样点对应的场景的物理尺寸信息,和/或,所述采样点展示的场景的位置点在所述第一网格展示层中的实际投影点与所述采样点之间的偏差信息;将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储;The memory 301 is configured to perform: acquiring description accuracy information of the scene by a first mesh display layer of the three-dimensional model of the scene, wherein the first mesh display layer includes a plurality of surfaces used to display the three-dimensional model of the scene. Grid plane, the description accuracy information includes: physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or, the position of the scene displayed by the sampling point is in the first grid Deviation information between the actual projection point in the grid display layer and the sampling point; storing the formed new grid surface as the second grid display layer of the three-dimensional model of the scene;
所述处理器302用于执行:The processor 302 is configured to execute:
根据所述描述精度信息确定所述场景三维模型的第二网格展示层的目标几何误差,其中,所述目标几何误差用于表征所述第二网格展示层中的网格面相对于所述场景三维模型的表面的几何误差;The target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面,其中,所述网格简化处理包括:折合所述多个网格面的边形成新的点,将形成的新的点作为所述新的网格面的角点,所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值小于预设阈值。Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain a new grid surface, wherein the grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces. The edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error. The difference is less than the preset threshold.
可选的,所述处理器302具体用于:Optionally, the processor 302 is specifically configured to:
根据所述描述精度信息和第一系数,确定所述第一网格展示层的目标几何误差;determining the target geometric error of the first mesh display layer according to the description accuracy information and the first coefficient;
根据所述第一网格展示层的目标几何误差,确定所述第二网格展示层的目标几何误差。A target geometric error of the second grid presentation layer is determined according to the target geometric error of the first grid presentation layer.
可选的,所述处理器302具体用于:Optionally, the processor 302 is specifically configured to:
根据所述第一网格展示层的目标几何误差与第二系数,确定所述第二网格展示层的目标几何误差。The target geometric error of the second grid display layer is determined according to the target geometric error of the first grid display layer and the second coefficient.
可选的,所述第二系数随着所述第二网格展示层在所述场景三维模型中所处层数的增大而增大。Optionally, the second coefficient increases as the number of layers where the second mesh display layer is located in the three-dimensional model of the scene increases.
可选的,所述第一网格展示层包括多个第一网格区块,每个所述第一网格区块包括多个网格面;所述第一网格展示层的目标几何误差包括每个所述第一网格区块的几何误差,所述第一网格展示层的描述精度信息包括每个所述第一网格区块的描述精度值;Optionally, the first grid display layer includes a plurality of first grid blocks, and each of the first grid blocks includes a plurality of grid surfaces; the target geometry of the first grid display layer The error includes a geometric error of each of the first grid blocks, and the description precision information of the first grid display layer includes a description precision value of each of the first grid blocks;
所述第二网格展示层包括多个第二网格区块,每个所述第二网格区块包括至少一个网格面;所述第二网格展示层的目标几何误差包括每个所述第二网格区块的几何误差,所述第二网格展示层的描述精度信息包括每个所述第二网格区块的描述精度值。The second grid display layer includes a plurality of second grid blocks, and each of the second grid blocks includes at least one grid surface; the target geometric error of the second grid display layer includes each The geometric error of the second grid block, and the description precision information of the second grid display layer includes a description precision value of each of the second grid blocks.
可选的,所述第二网格区块的数量小于所述第一网格区块的数量。Optionally, the number of the second grid blocks is smaller than the number of the first grid blocks.
可选的,所述处理器302具体用于:Optionally, the processor 302 is specifically configured to:
对所述第一网格展示层中每个第一网格区块的网格面做网格简化处理,得到每个所述第一网格区块中新的网格面。Perform grid simplification processing on the grid surface of each first grid block in the first grid display layer to obtain a new grid surface in each of the first grid blocks.
可选的,所述处理器302具体用于:Optionally, the processor 302 is specifically configured to:
在所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值大于或等于所述预设阈值的情况下,将所有所述新的网格面作为所述第一网格展示层,并进入所述对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面的步骤。Under the condition that the difference between the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene and the target geometric error is greater than or equal to the preset threshold, all the new mesh surfaces As the first mesh display layer, and enter the step of performing mesh simplification processing on the plurality of mesh surfaces in the first mesh display layer to obtain a new mesh surface.
可选的,所述处理器302具体用于:Optionally, the processor 302 is specifically configured to:
在所述第二网格展示层的所有网格面的数量满足预设条件的情况下,得到包含至少两层网格展示层的场景三维模型;Obtaining a three-dimensional scene model including at least two grid display layers when the number of all grid surfaces of the second grid display layer satisfies a preset condition;
将所述场景三维模型中处于屏幕的可视窗口的范围内的目标网格展示层,进行渲染展示。The target mesh display layer in the three-dimensional model of the scene within the range of the visible window of the screen is rendered and displayed.
可选的,所述处理器402具体用于:Optionally, the processor 402 is specifically configured to:
按照所包含的网格面的数量最小到大的顺序,计算每个所述目标网格展示层在所述可视窗口上的最大像素误差,并在出现所述最大像素误差小于或 等于预设误差值的目标网格展示层时,对所述最大像素误差小于或等于预设阈值的目标网格展示层进行渲染展示。Calculate the maximum pixel error of each target grid display layer on the visible window in the order from the smallest to the largest number of grid faces included, and when the maximum pixel error is less than or equal to a preset value When the error value is the target grid display layer, the target grid display layer whose maximum pixel error is less than or equal to the preset threshold is rendered and displayed.
可选的,所述处理器402具体用于:Optionally, the processor 402 is specifically configured to:
获取至少一个待重建图像;Obtain at least one image to be reconstructed;
根据所述待重建图像,构建得到所述第一网格展示层。The first grid display layer is constructed and obtained according to the to-be-reconstructed image.
可选的,所述处理器402具体用于:Optionally, the processor 402 is specifically configured to:
确定每个所述待重建图像对应的相机姿态和纹理图;Determine the camera pose and texture map corresponding to each of the to-be-reconstructed images;
根据所述相机姿态,对所述多个待重建图像中的两个目标图像进行点云匹配,得到点云数据,所述两个目标图像的画面中存在重叠部分;According to the camera posture, point cloud matching is performed on two target images in the plurality of images to be reconstructed to obtain point cloud data, and there are overlapping parts in the frames of the two target images;
根据所述点云数据,构建得到无纹理网格展示层;According to the point cloud data, construct a textureless mesh display layer;
将所述无纹理网格展示层映射至所述纹理图,以从所述纹理图中确定所述无纹理网格展示层中的每个网格面对应的纹理区域,并将所述纹理区域添加至对应的网格面,得到所述第一网格展示层。The textureless mesh display layer is mapped to the texture map to determine a texture area corresponding to each mesh face in the textureless mesh display layer from the texture map, and the texture The regions are added to the corresponding mesh faces to obtain the first mesh display layer.
综上,本申请实施例提供的建立模型的装置,通过利用第一网格展示层中采样点已有的物理尺寸信息和或偏差信息,来对第一网格展示层中的几何误差进行确定,从而利用几何误差使得第一网格展示层具有了细节程度的度量。本申请实施例中,利用了场景三维重建得到的第一网格展示层中的采样点已有的信息,使得在三维重建场景中,对网格展示层细节程度的度量,结合了相机拍摄过程中在各个场景的区域中的已有特性,更好的吻合了不同区域的细节程度具有差异化的实际情况,提高了对网格面进行网格简化处理时终止简化条件的精度,降低了采用全局hausdorff距离作为该终止简化条件时带来的精度损失,使得在得到多层细节程度递减的网格展示层的过程中,不再依赖一个已知的完美展示层,消除了计算完美展示层的过程,降低了计算压力,且由于采用了更准确的采样点的物理尺寸信息和或偏差信息去确定目标几何误差,解决了采用全局hausdorff距离作为几何误差时,产生的网格展示层的细节程度指标偏大,造成后续渲染精度下降的问题。To sum up, the apparatus for establishing a model provided by the embodiment of the present application determines the geometric error in the first grid display layer by using the existing physical size information and/or deviation information of the sampling points in the first grid display layer , so that the first mesh display layer has a measure of the degree of detail by using the geometric error. In the embodiment of the present application, the existing information of the sampling points in the first grid display layer obtained by the three-dimensional reconstruction of the scene is used, so that in the three-dimensional reconstruction scene, the measurement of the detail degree of the grid display layer is combined with the camera shooting process. The existing characteristics in the regions of each scene better match the actual situation that the degree of detail in different regions is different, improve the accuracy of the termination simplification conditions when the mesh surface is simplified, and reduce the use of The accuracy loss brought by the global hausdorff distance as the termination simplification condition makes it no longer rely on a known perfect display layer in the process of obtaining a multi-layer grid display layer with decreasing level of detail, eliminating the need to calculate the perfect display layer. The process reduces the calculation pressure, and because the more accurate physical size information and/or deviation information of the sampling point is used to determine the target geometric error, the detail level of the grid display layer generated when the global hausdorff distance is used as the geometric error is solved. The indicator is too large, which causes the problem of subsequent rendering accuracy decline.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述建立模型的方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。 其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, each process of the above-mentioned method for establishing a model is implemented, and can achieve the same The technical effect, in order to avoid repetition, will not be repeated here. Wherein, the computer-readable storage medium, such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), magnetic disk or optical disk and so on.
存储器可以为外部控制终端与建立模型的装置连接的接口。例如,外部控制终端可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的控制终端的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。存储器可以用于接收来自外部控制终端的输入(例如,数据信息、电力等等)并且将接收到的输入传输到建立模型的装置内的一个或多个元件或者可以用于在建立模型的装置和外部控制终端之间传输数据。The memory can be an interface for connecting an external control terminal with a model-building device. For example, the external control terminal may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a control terminal with an identification module, an audio input /Output (I/O) ports, video I/O ports, headphone ports, and more. The memory may be used to receive input (eg, data information, power, etc.) from an external control terminal and transmit the received input to one or more elements within the apparatus for modelling or may be used in the apparatus for modelling and Transfer data between external control terminals.
例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。For example at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
处理器是控制终端的控制中心,利用各种接口和线路连接整个控制终端的各个部分,通过运行或执行存储在存储器内的软件程序和/或模块,以及调用存储在存储器内的数据,执行控制终端的各种功能和处理数据,从而对控制终端进行整体监控。处理器可包括一个或多个处理单元;优选的,处理器可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器中。The processor is the control center of the control terminal. It uses various interfaces and lines to connect various parts of the entire control terminal, and executes control by running or executing the software programs and/or modules stored in the memory and calling the data stored in the memory. Various functions of the terminal and processing data, so as to carry out overall monitoring of the control terminal. The processor may include one or more processing units; preferably, the processor may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor Mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.
本领域内的技术人员应明白,本申请的实施例可提供为方法、控制终端、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that the embodiments of the present application may be provided as a method, a control terminal, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中 指定的功能的控制终端。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal equipment to produce a machine that causes the instructions to be executed by the processor of the computer or other programmable data processing terminal equipment A control terminal is generated for implementing the functions specified in a flow or flow of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令控制终端的制造品,该指令控制终端实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising the instruction to control the terminal, The instruction controls the terminal to implement the function specified in one flow or multiple flows of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby executing on the computer or other programmable terminal equipment The instructions executed on the above provide steps for implementing the functions specified in the flowchart or blocks and/or the block or blocks of the block diagrams.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or terminal device comprising a list of elements includes not only those elements, but also a non-exclusive list of elements. other elements, or also include elements inherent to such a process, method, article or terminal equipment. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
以上对本申请进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The application has been introduced in detail above, and specific examples are used to illustrate the principles and implementations of the application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the application; According to the idea of the present application, there will be changes in the specific embodiments and application scope for those skilled in the art. To sum up, the content of this specification should not be construed as a limitation on the present application.

Claims (26)

  1. 一种建立模型的方法,其特征在于,所述方法包括:A method for establishing a model, the method comprising:
    获取场景三维模型的第一网格展示层对场景的描述精度信息,其中,所述第一网格展示层包括用于展示所述场景三维模型的表面的多个网格面,所述描述精度信息包括:所述第一网格展示层中采样点对应的场景的物理尺寸信息,和/或,所述采样点展示的场景的位置点在所述第一网格展示层中的实际投影点与所述采样点之间的偏差信息;Acquiring description accuracy information of the scene by the first grid display layer of the 3D model of the scene, wherein the first grid display layer includes a plurality of grid surfaces used to display the surface of the 3D model of the scene, and the description accuracy The information includes: the physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or the actual projection point of the position point of the scene displayed by the sampling point in the first grid display layer deviation information from the sampling point;
    根据所述描述精度信息确定所述场景三维模型的第二网格展示层的目标几何误差,其中,所述目标几何误差用于表征所述第二网格展示层中的网格面相对于所述场景三维模型的表面的几何误差;The target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
    对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面,其中,所述网格简化处理包括:折合所述多个网格面的边形成新的点,将形成的新的点作为所述新的网格面的角点,所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值小于预设阈值;Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain a new grid surface, wherein the grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces. The edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error. The difference is less than the preset threshold;
    将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储。The new mesh surface formed is stored as the second mesh display layer of the three-dimensional model of the scene.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述描述误差信息确定所述场景三维模型的第二网格展示层的目标几何误差,包括:The method according to claim 1, wherein the determining the target geometric error of the second mesh display layer of the three-dimensional scene model according to the description error information comprises:
    根据所述描述精度信息和第一系数,确定所述第一网格展示层的目标几何误差;determining the target geometric error of the first mesh display layer according to the description accuracy information and the first coefficient;
    根据所述第一网格展示层的目标几何误差,确定所述第二网格展示层的目标几何误差。A target geometric error of the second grid presentation layer is determined according to the target geometric error of the first grid presentation layer.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第一网格展示层的目标几何误差,确定所述第二网格展示层的目标几何误差,包括:The method according to claim 2, wherein the determining the target geometric error of the second grid display layer according to the target geometric error of the first grid display layer comprises:
    根据所述第一网格展示层的目标几何误差与第二系数,确定所述第二网格展示层的目标几何误差。The target geometric error of the second grid display layer is determined according to the target geometric error of the first grid display layer and the second coefficient.
  4. 根据权利要求3所述的方法,其特征在于,所述第二系数随着所述第二网格展示层在所述场景三维模型中所处层数的增大而增大。The method according to claim 3, wherein the second coefficient increases as the number of layers where the second mesh display layer is located in the three-dimensional model of the scene increases.
  5. 根据权利要求2所述的方法,其特征在于,所述第一网格展示层包括多个第一网格区块,每个所述第一网格区块包括多个网格面;所述第一网格展示层的目标几何误差包括每个所述第一网格区块的几何误差,所述第一网格展示层的描述精度信息包括每个所述第一网格区块的描述精度值;The method according to claim 2, wherein the first grid display layer comprises a plurality of first grid blocks, and each of the first grid blocks comprises a plurality of grid surfaces; the The target geometric error of the first grid display layer includes the geometric error of each of the first grid blocks, and the description accuracy information of the first grid display layer includes the description of each of the first grid blocks precision value;
    所述第二网格展示层包括多个第二网格区块,每个所述第二网格区块包括至少一个网格面;所述第二网格展示层的目标几何误差包括每个所述第二网格区块的几何误差,所述第二网格展示层的描述精度信息包括每个所述第二网格区块的描述精度值。The second grid display layer includes a plurality of second grid blocks, and each of the second grid blocks includes at least one grid surface; the target geometric error of the second grid display layer includes each The geometric error of the second grid block, and the description precision information of the second grid display layer includes a description precision value of each of the second grid blocks.
  6. 根据权利要求5所述的方法,其特征在于,所述第二网格区块的数量小于所述第一网格区块的数量。The method of claim 5, wherein the number of the second grid blocks is smaller than the number of the first grid blocks.
  7. 根据权利要求5所述的方法,其特征在于,所述对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面,包括:The method according to claim 5, wherein the performing grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain new grid surfaces, comprising:
    对所述第一网格展示层中每个第一网格区块的网格面做网格简化处理,得到每个所述第一网格区块中新的网格面。Perform grid simplification processing on the grid surface of each first grid block in the first grid display layer to obtain a new grid surface in each of the first grid blocks.
  8. 根据权利要求1所述的方法,其特征在于,在所述将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储之前,所述方法还包括:The method according to claim 1, characterized in that, before storing the new mesh surface formed as the second mesh display layer of the three-dimensional model of the scene, the method further comprises:
    在所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值大于或等于所述预设阈值的情况下,将所有所述新的网格面作为所述第一网格展示层,并进入所述对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面的步骤。Under the condition that the difference between the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene and the target geometric error is greater than or equal to the preset threshold, all the new mesh surfaces As the first mesh display layer, and enter the step of performing mesh simplification processing on the plurality of mesh surfaces in the first mesh display layer to obtain a new mesh surface.
  9. 根据权利要求1所述的方法,其特征在于,在所述将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储之后,所述方法还包括:The method according to claim 1, wherein after storing the new mesh surface formed as the second mesh display layer of the three-dimensional model of the scene, the method further comprises:
    在所述第二网格展示层的所有网格面的数量满足预设条件的情况下,得到包含至少两层网格展示层的场景三维模型;Obtaining a three-dimensional scene model including at least two grid display layers when the number of all grid surfaces of the second grid display layer satisfies a preset condition;
    将所述场景三维模型中处于屏幕的可视窗口的范围内的目标网格展示层,进行渲染展示。The target mesh display layer in the three-dimensional model of the scene within the range of the visible window of the screen is rendered and displayed.
  10. 根据权利要求9所述的方法,其特征在于,所述将所述场景三维模 型中处于屏幕的可视窗口的范围内的目标网格展示层,进行渲染展示,包括:The method according to claim 9, wherein the rendering of the target grid display layer in the three-dimensional model of the scene within the scope of the visible window of the screen is performed, comprising:
    按照所包含的网格面的数量最小到大的顺序,计算每个所述目标网格展示层在所述可视窗口上的最大像素误差,并在出现所述最大像素误差小于或等于预设误差值的目标网格展示层时,对所述最大像素误差小于或等于预设阈值的目标网格展示层进行渲染展示。Calculate the maximum pixel error of each target grid display layer on the visible window in the order from the smallest to the largest number of grid faces included, and when the maximum pixel error is less than or equal to a preset value When the error value is the target grid display layer, the target grid display layer whose maximum pixel error is less than or equal to the preset threshold is rendered and displayed.
  11. 根据权利要求1所述的方法,其特征在于,在所述获取场景三维模型的第一网格展示层对场景的描述精度信息之前,所述方法还包括:The method according to claim 1, characterized in that, before acquiring the description accuracy information of the scene on the first grid display layer of the three-dimensional model of the scene, the method further comprises:
    获取至少一个待重建图像;Obtain at least one image to be reconstructed;
    根据所述待重建图像,构建得到所述第一网格展示层。The first grid display layer is constructed and obtained according to the to-be-reconstructed image.
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述待重建图像,构建得到所述第一网格展示层,包括:The method according to claim 11, wherein the constructing and obtaining the first grid display layer according to the to-be-reconstructed image comprises:
    确定每个所述待重建图像对应的相机姿态和纹理图;Determine the camera pose and texture map corresponding to each of the to-be-reconstructed images;
    根据所述相机姿态,对所述多个待重建图像中的两个目标图像进行点云匹配,得到点云数据,所述两个目标图像的画面中存在重叠部分;According to the camera posture, point cloud matching is performed on two target images in the plurality of images to be reconstructed to obtain point cloud data, and there are overlapping parts in the frames of the two target images;
    根据所述点云数据,构建得到无纹理网格展示层;According to the point cloud data, construct a textureless mesh display layer;
    将所述无纹理网格展示层映射至所述纹理图,以从所述纹理图中确定所述无纹理网格展示层中的每个网格面对应的纹理区域,并将所述纹理区域添加至对应的网格面,得到所述第一网格展示层。The textureless mesh display layer is mapped to the texture map to determine a texture area corresponding to each mesh face in the textureless mesh display layer from the texture map, and the texture The regions are added to the corresponding mesh faces to obtain the first mesh display layer.
  13. 一种建立模型的装置,其特征在于,所述装置包括:存储器和处理器;An apparatus for establishing a model, characterized in that the apparatus comprises: a memory and a processor;
    所述存储器用于,获取场景三维模型的第一网格展示层对场景的描述精度信息,其中,所述第一网格展示层包括用于展示所述场景三维模型的表面的多个网格面,所述描述精度信息包括:所述第一网格展示层中采样点对应的场景的物理尺寸信息,和/或,所述采样点展示的场景的位置点在所述第一网格展示层中的实际投影点与所述采样点之间的偏差信息;The memory is used for acquiring description accuracy information of the scene by a first grid display layer of the scene 3D model, wherein the first grid display layer includes a plurality of grids used to display the surface of the scene 3D model On the other hand, the description accuracy information includes: physical size information of the scene corresponding to the sampling point in the first grid display layer, and/or, the position point of the scene displayed by the sampling point is displayed in the first grid deviation information between the actual projection point in the layer and the sampling point;
    将形成的所述新的网格面作为所述场景三维模型的第二网格展示层存储;storing the formed new mesh surface as the second mesh display layer of the three-dimensional model of the scene;
    所述处理器用于:The processor is used to:
    根据所述描述精度信息确定所述场景三维模型的第二网格展示层的目标几何误差,其中,所述目标几何误差用于表征所述第二网格展示层中的网格面相对于所述场景三维模型的表面的几何误差;The target geometric error of the second mesh display layer of the three-dimensional scene model is determined according to the description accuracy information, wherein the target geometric error is used to characterize the relative relationship between the mesh surfaces in the second mesh display layer and the The geometric error of the surface of the 3D model of the scene;
    对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面,其中,所述网格简化处理包括:折合所述多个网格面的边形成新的点,将形成的新的点作为所述新的网格面的角点,所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值小于预设阈值。Perform grid simplification processing on the plurality of grid surfaces in the first grid display layer to obtain a new grid surface, wherein the grid simplification processing includes: folding the grid surfaces of the plurality of grid surfaces. The edge forms a new point, and the formed new point is used as the corner point of the new mesh surface, and the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene is equal to the target geometric error. The difference is less than the preset threshold.
  14. 根据权利要求13所述的装置,其特征在于,所述处理器具体用于:The apparatus according to claim 13, wherein the processor is specifically configured to:
    根据所述描述精度信息和第一系数,确定所述第一网格展示层的目标几何误差;determining the target geometric error of the first mesh display layer according to the description accuracy information and the first coefficient;
    根据所述第一网格展示层的目标几何误差,确定所述第二网格展示层的目标几何误差。A target geometric error of the second grid presentation layer is determined according to the target geometric error of the first grid presentation layer.
  15. 根据权利要求14所述的装置,其特征在于,所述处理器具体用于:The apparatus according to claim 14, wherein the processor is specifically configured to:
    根据所述第一网格展示层的目标几何误差与第二系数,确定所述第二网格展示层的目标几何误差。The target geometric error of the second grid display layer is determined according to the target geometric error of the first grid display layer and the second coefficient.
  16. 根据权利要求15所述的装置,其特征在于,所述第二系数随着所述第二网格展示层在所述场景三维模型中所处层数的增大而增大。The apparatus according to claim 15, wherein the second coefficient increases as the number of layers where the second mesh display layer is located in the three-dimensional model of the scene increases.
  17. 根据权利要求14所述的装置,其特征在于,所述第一网格展示层包括多个第一网格区块,每个所述第一网格区块包括多个网格面;所述第一网格展示层的目标几何误差包括每个所述第一网格区块的几何误差,所述第一网格展示层的描述精度信息包括每个所述第一网格区块的描述精度值;The device according to claim 14, wherein the first grid display layer comprises a plurality of first grid blocks, and each of the first grid blocks comprises a plurality of grid surfaces; the The target geometric error of the first grid display layer includes the geometric error of each of the first grid blocks, and the description accuracy information of the first grid display layer includes the description of each of the first grid blocks precision value;
    所述第二网格展示层包括多个第二网格区块,每个所述第二网格区块包括至少一个网格面;所述第二网格展示层的目标几何误差包括每个所述第二网格区块的几何误差,所述第二网格展示层的描述精度信息包括每个所述第二网格区块的描述精度值。The second grid display layer includes a plurality of second grid blocks, and each of the second grid blocks includes at least one grid surface; the target geometric error of the second grid display layer includes each The geometric error of the second grid block, and the description precision information of the second grid display layer includes a description precision value of each of the second grid blocks.
  18. 根据权利要求17所述的装置,其特征在于,所述第二网格区块的数量小于所述第一网格区块的数量。18. The apparatus of claim 17, wherein the number of the second grid blocks is smaller than the number of the first grid blocks.
  19. 根据权利要求17所述的装置,其特征在于,所述处理器具体用于:The apparatus according to claim 17, wherein the processor is specifically configured to:
    对所述第一网格展示层中每个第一网格区块的网格面做网格简化处理,得到每个所述第一网格区块中新的网格面。Perform grid simplification processing on the grid surface of each first grid block in the first grid display layer to obtain a new grid surface in each of the first grid blocks.
  20. 根据权利要求13所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 13, wherein the processor is further configured to:
    在所述新的网格面相对于所述场景三维模型的表面的实际几何误差与所述目标几何误差的差值大于或等于所述预设阈值的情况下,将所有所述新的网格面作为所述第一网格展示层,并进入所述对所述第一网格展示层中的所述多个网格面做网格简化处理,得到新的网格面的步骤。Under the condition that the difference between the actual geometric error of the new mesh surface relative to the surface of the three-dimensional model of the scene and the target geometric error is greater than or equal to the preset threshold, all the new mesh surfaces As the first mesh display layer, and enter the step of performing mesh simplification processing on the plurality of mesh surfaces in the first mesh display layer to obtain a new mesh surface.
  21. 根据权利要求13述的装置,其特征在于,所述处理器还用于:The apparatus of claim 13, wherein the processor is further configured to:
    在所述第二网格展示层的所有网格面的数量满足预设条件的情况下,得到包含至少两层网格展示层的场景三维模型;Obtaining a three-dimensional scene model including at least two grid display layers when the number of all grid surfaces of the second grid display layer satisfies a preset condition;
    将所述场景三维模型中处于屏幕的可视窗口的范围内的目标网格展示层,进行渲染展示。The target mesh display layer in the three-dimensional model of the scene within the range of the visible window of the screen is rendered and displayed.
  22. 根据权利要求21的装置,其特征在于,所述处理器具体用于:The apparatus according to claim 21, wherein the processor is specifically configured to:
    按照所包含的网格面的数量最小到大的顺序,计算每个所述目标网格展示层在所述可视窗口上的最大像素误差,并在出现所述最大像素误差小于或等于预设误差值的目标网格展示层时,对所述最大像素误差小于或等于预设阈值的目标网格展示层进行渲染展示。Calculate the maximum pixel error of each target grid display layer on the visible window in the order from the smallest to the largest number of grid faces included, and when the maximum pixel error is less than or equal to a preset value When the error value is the target grid display layer, the target grid display layer whose maximum pixel error is less than or equal to the preset threshold is rendered and displayed.
  23. 根据权利要求13所述的装置,其特征在于,所述处理器还用于:获取至少一个待重建图像;The apparatus according to claim 13, wherein the processor is further configured to: acquire at least one image to be reconstructed;
    根据所述待重建图像,构建得到所述第一网格展示层。The first grid display layer is constructed and obtained according to the to-be-reconstructed image.
  24. 根据权利要求23所述的装置,其特征在于,所述处理器具体用于:The apparatus according to claim 23, wherein the processor is specifically configured to:
    确定每个所述待重建图像对应的相机姿态和纹理图;Determine the camera pose and texture map corresponding to each of the to-be-reconstructed images;
    根据所述相机姿态,对所述多个待重建图像中的两个目标图像进行点云匹配,得到点云数据,所述两个目标图像的画面中存在重叠部分;According to the camera posture, point cloud matching is performed on two target images in the plurality of images to be reconstructed to obtain point cloud data, and there are overlapping parts in the frames of the two target images;
    根据所述点云数据,构建得到无纹理网格展示层;According to the point cloud data, construct a textureless mesh display layer;
    将所述无纹理网格展示层映射至所述纹理图,以从所述纹理图中确定所述无纹理网格展示层中的每个网格面对应的纹理区域,并将所述纹理区域添加至对应的网格面,得到所述第一网格展示层。The textureless mesh display layer is mapped to the texture map to determine a texture area corresponding to each mesh face in the textureless mesh display layer from the texture map, and the texture The regions are added to the corresponding mesh faces to obtain the first mesh display layer.
  25. 一种电子设备,其特征在于,包括处理器、存储器及存储在所述存 储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至12中任一项所述的建立模型的方法。An electronic device, characterized by comprising a processor, a memory, and a computer program stored on the memory and running on the processor, the computer program being executed by the processor to achieve the method as claimed in claim 1 The method for building a model of any one of to 12.
  26. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得所述计算机执行权利要求1至12中任一项所述的建立模型的方法。A computer-readable storage medium, characterized by comprising instructions that, when executed on a computer, cause the computer to perform the method for building a model according to any one of claims 1 to 12.
PCT/CN2020/106167 2020-07-31 2020-07-31 Method and apparatus for establishing model, electronic device, and computer readable storage medium WO2022021309A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/106167 WO2022021309A1 (en) 2020-07-31 2020-07-31 Method and apparatus for establishing model, electronic device, and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/106167 WO2022021309A1 (en) 2020-07-31 2020-07-31 Method and apparatus for establishing model, electronic device, and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2022021309A1 true WO2022021309A1 (en) 2022-02-03

Family

ID=80037327

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/106167 WO2022021309A1 (en) 2020-07-31 2020-07-31 Method and apparatus for establishing model, electronic device, and computer readable storage medium

Country Status (1)

Country Link
WO (1) WO2022021309A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114202634A (en) * 2022-02-17 2022-03-18 深圳消安科技有限公司 Lightweight method applied to urban three-dimensional model data
CN115272618A (en) * 2022-09-20 2022-11-01 深圳市其域创新科技有限公司 Three-dimensional grid optimization method, equipment and storage medium
CN115330971A (en) * 2022-10-13 2022-11-11 数云科际(深圳)技术有限公司 Geometric model lightweight method for rendering performance optimization
CN116449962A (en) * 2023-06-14 2023-07-18 北京水木东方医用机器人技术创新中心有限公司 Internal scene AR visualization method, device and equipment
CN116721104A (en) * 2023-08-10 2023-09-08 武汉大学 Live three-dimensional model defect detection method and device, electronic equipment and storage medium
CN117078890A (en) * 2023-10-13 2023-11-17 芯瑞微(上海)电子科技有限公司 Three-dimensional geometric model mesh subdivision method, system, device and computer readable medium
CN117315196A (en) * 2023-10-08 2023-12-29 广州中望龙腾软件股份有限公司 Model construction method, device, equipment and storage medium
CN117711611A (en) * 2024-02-05 2024-03-15 四川省医学科学院·四川省人民医院 MDT remote consultation system and method based on scene fusion and mr

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5886702A (en) * 1996-10-16 1999-03-23 Real-Time Geometry Corporation System and method for computer modeling of 3D objects or surfaces by mesh constructions having optimal quality characteristics and dynamic resolution capabilities
CN1815507A (en) * 2005-02-03 2006-08-09 三星电子株式会社 Method, apparatus, and medium for transforming graphic data of an object
CN101308579A (en) * 2008-05-12 2008-11-19 中山大学 Adaptive simplifying method for three-dimensional animation model
CN107527384A (en) * 2017-07-14 2017-12-29 中山大学 A kind of lattice simplified method of Three-Dimensional Dynamic based on motion feature and its system
CN108961411A (en) * 2018-07-02 2018-12-07 南京大学 A kind of simplified method of the complex three-dimensional building model keeping external appearance characteristic

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5886702A (en) * 1996-10-16 1999-03-23 Real-Time Geometry Corporation System and method for computer modeling of 3D objects or surfaces by mesh constructions having optimal quality characteristics and dynamic resolution capabilities
CN1815507A (en) * 2005-02-03 2006-08-09 三星电子株式会社 Method, apparatus, and medium for transforming graphic data of an object
CN101308579A (en) * 2008-05-12 2008-11-19 中山大学 Adaptive simplifying method for three-dimensional animation model
CN107527384A (en) * 2017-07-14 2017-12-29 中山大学 A kind of lattice simplified method of Three-Dimensional Dynamic based on motion feature and its system
CN108961411A (en) * 2018-07-02 2018-12-07 南京大学 A kind of simplified method of the complex three-dimensional building model keeping external appearance characteristic

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114202634A (en) * 2022-02-17 2022-03-18 深圳消安科技有限公司 Lightweight method applied to urban three-dimensional model data
CN115272618A (en) * 2022-09-20 2022-11-01 深圳市其域创新科技有限公司 Three-dimensional grid optimization method, equipment and storage medium
CN115272618B (en) * 2022-09-20 2022-12-20 深圳市其域创新科技有限公司 Three-dimensional grid optimization method, equipment and storage medium
CN115330971A (en) * 2022-10-13 2022-11-11 数云科际(深圳)技术有限公司 Geometric model lightweight method for rendering performance optimization
CN116449962B (en) * 2023-06-14 2023-09-29 北京水木东方医用机器人技术创新中心有限公司 Internal scene AR visualization method, device and equipment
CN116449962A (en) * 2023-06-14 2023-07-18 北京水木东方医用机器人技术创新中心有限公司 Internal scene AR visualization method, device and equipment
CN116721104A (en) * 2023-08-10 2023-09-08 武汉大学 Live three-dimensional model defect detection method and device, electronic equipment and storage medium
CN116721104B (en) * 2023-08-10 2023-11-07 武汉大学 Live three-dimensional model defect detection method and device, electronic equipment and storage medium
CN117315196A (en) * 2023-10-08 2023-12-29 广州中望龙腾软件股份有限公司 Model construction method, device, equipment and storage medium
CN117078890A (en) * 2023-10-13 2023-11-17 芯瑞微(上海)电子科技有限公司 Three-dimensional geometric model mesh subdivision method, system, device and computer readable medium
CN117078890B (en) * 2023-10-13 2024-01-12 芯瑞微(上海)电子科技有限公司 Mesh dissection method and system for three-dimensional geometric model of mobile phone
CN117711611A (en) * 2024-02-05 2024-03-15 四川省医学科学院·四川省人民医院 MDT remote consultation system and method based on scene fusion and mr
CN117711611B (en) * 2024-02-05 2024-04-19 四川省医学科学院·四川省人民医院 MDT remote consultation system and method based on scene fusion and mr

Similar Documents

Publication Publication Date Title
WO2022021309A1 (en) Method and apparatus for establishing model, electronic device, and computer readable storage medium
CN110889890B (en) Image processing method and device, processor, electronic equipment and storage medium
CN104637089B (en) Three-dimensional model data processing method and device
WO2020206903A1 (en) Image matching method and device, and computer readable storage medium
US8711143B2 (en) System and method for interactive image-based modeling of curved surfaces using single-view and multi-view feature curves
CN108122277B (en) Modeling method and device
CN107578467B (en) Three-dimensional modeling method and device for medical instrument
US11263356B2 (en) Scalable and precise fitting of NURBS surfaces to large-size mesh representations
JP2012527787A (en) A method for high-speed 3D construction from images
WO2015051624A1 (en) Method and device for rebuilding three-dimensional object and terminal
CN115439607A (en) Three-dimensional reconstruction method and device, electronic equipment and storage medium
JP2022509329A (en) Point cloud fusion methods and devices, electronic devices, computer storage media and programs
WO2023169095A1 (en) Data processing method and apparatus, device, and medium
US20110298801A1 (en) View generation using interpolated values
CN112561788A (en) Two-dimensional expansion method of BIM (building information modeling) model and texture mapping method and device
CN110675323B (en) Three-dimensional map semantic processing method, system, equipment and computer medium
CN111273877B (en) Linkage display platform and linkage method for live-action three-dimensional data and two-dimensional grid picture
CN115222889A (en) 3D reconstruction method and device based on multi-view image and related equipment
CN117132737B (en) Three-dimensional building model construction method, system and equipment
CN109448135B (en) Three-dimensional model repairing method based on multi-source data
EP3906530B1 (en) Method for 3d reconstruction of an object
CN110378948B (en) 3D model reconstruction method and device and electronic equipment
CN115661364A (en) Three-dimensional simulation model reconstruction method for cultural relic and ancient building group restoration
CN115937396A (en) Image rendering method and device, terminal equipment and computer readable storage medium
CN115187736A (en) Target map generation method and device, and AR map generation method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20947513

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20947513

Country of ref document: EP

Kind code of ref document: A1