A method, apparatus, storage medium, and device for adjusting a three-dimensional model
By selecting sparse points based on texture edge sampling, the three-dimensional model is sparsely processed, which solves the problems of long rendering time and cumbersome adjustment process of high-density point cloud models, and realizes automatic adjustment and rendering efficiency improvement.
Patent Information
- Application Number
- CN202111574371.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-12-21
AI Technical Summary
In the prior art, the generated high-density point cloud model requires a lot of calculations during rendering, resulting in a long rendering time for the device, and the manual point cloud sparseness and polygon mesh adjustment process is cumbersome and uncontrollable results are prone to occur, which affects the online business. .
By obtaining the texture image of the three-dimensional model, sampling and selecting sparse points based on the texture edges, sparse the initial three-dimensional model, and building a polygon mesh based on the sparse vertices to achieve automatic adjustments, avoiding uncontrollable results caused by interpolation generation result.
The automated adjustment of three-dimensional models is realized, which reduces the workload of professional and technical personnel, converts it into two-dimensional problems for sampling and averages, reduces the occurrence of uncontrollable results, and improves rendering efficiency and the regularity of polygon mesh.
Smart Images

Figure CN114283266B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a three-dimensional model adjustment method, device, storage medium and equipment. Background Art
[0002] The point cloud model generated by scanning the object has a denser point cloud. Correspondingly, the point cloud density of the mesh model constructed by generating the topological structure of such a point cloud model is relatively high. The device needs to perform a lot of calculations when rendering such a mesh model, which takes a long time. Therefore, before being put into business use, it is often necessary to manually thin out the point cloud of such a mesh model and adjust the polygonal mesh according to the thinned point cloud. This process is repetitive and time-consuming, which can easily affect the launch of the business. There are also solutions in the related art that implement point cloud thinning through software, which is generally based on the center of gravity point in the original point cloud, and generates a new point cloud as the thinned point cloud by interpolation. However, this solution is prone to uncontrollable results. For example, the triangular facets adjusted according to the thinned point cloud are prone to irregularity, which in turn causes the problem of inconsistent reflection. Summary of the invention
[0003] In a first aspect, a three-dimensional model adjustment method is provided, comprising: obtaining a texture image of an initial three-dimensional model, the texture image comprising a plurality of texture points; obtaining a texture edge of the texture image, sampling on the texture edge according to preset sampling conditions, and thinning the vertices of the initial three-dimensional model using the sampled texture points; constructing a polygonal mesh based on the thinned vertices to obtain a target three-dimensional model.
[0004] In some embodiments, the texture edge is selected based on the curvature of each texture point; the curvature of a texture point is determined based on the angle between the texture point and an adjacent point.
[0005] In some embodiments, the above-mentioned acquisition of the texture edge of the texture image includes: acquiring the target point on the texture edge that was most recently determined; selecting a target adjacent point whose curvature is less than a preset curvature threshold and whose curvature is the smallest from the adjacent points of the target point; determining the target adjacent point as the target point on the texture edge until there is no target adjacent point whose curvature is less than the preset curvature threshold; wherein the target point on the texture edge determined for the first time is a point that has not yet been determined as a point on any texture edge and has the smallest curvature.
[0006] In some embodiments, the preset sampling condition includes a preset sampling interval.
[0007] In some embodiments, the preset sampling conditions further include preset sampling marks, and the texture points selected for sampling include texture points sampled at preset sampling intervals and texture points with preset sampling marks.
[0008] In some embodiments, the above-mentioned thinning processing of the vertices of the three-dimensional model using the sampled texture points includes: obtaining a sparse point cloud according to each vertex corresponding to the sampled texture points.
[0009] In some embodiments, the above-mentioned construction of a polygonal mesh based on sparsed vertices includes: in the process of constructing a polygonal network, if there are two vertices that belong to preset constraint points, the polygon is constructed based on the edge formed by the two vertices; the preset constraint point is a vertex carrying a constraint identifier.
[0010] In a second aspect, a three-dimensional model adjustment device is provided, comprising: an acquisition module, used to acquire a texture image of an initial three-dimensional model, wherein the texture image comprises a plurality of texture points; a sparse module, used to acquire a texture edge of the texture image, perform sampling on the texture edge according to preset sampling conditions, and perform sparse processing on the vertices of the initial three-dimensional model using the sampled texture points; and a construction module, used to construct a polygonal mesh based on the sparsely-sampled vertices to obtain a target three-dimensional model.
[0011] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, any method in the embodiments of the specification is implemented.
[0012] In a fourth aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the methods in the embodiments of the specification is implemented.
[0013] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0014] In the embodiments of this specification, a three-dimensional model adjustment method, device, storage medium and equipment are disclosed. In this method, sampling points are selected based on the texture edges of the texture image of the initial three-dimensional model, and the point cloud is thinned according to the sampling points, and then the target three-dimensional model is constructed according to the thinned vertices. In this way, the automatic adjustment of the initial three-dimensional model is realized, and the workload of professional and technical personnel is effectively reduced. At the same time, the three-dimensional problem is converted into a two-dimensional problem, and the sampling is averaged. Moreover, the thinned vertices are the vertices in the original point cloud, which effectively reduces the occurrence of uncontrollable results.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0017] Figure 1 is a schematic diagram of a grid model with a dense point cloud according to an exemplary embodiment of the present specification;
[0018] Figure 2 is a flow chart of a three-dimensional model adjustment method according to an exemplary embodiment of the present specification;
[0019] Figure 3 is a schematic diagram of a texture image shown in this specification according to an exemplary embodiment;
[0020] Figure 4A is a schematic diagram of a local effect after automatically constructing a triangular facet using a triangulation algorithm according to an exemplary embodiment of this specification;
[0021] Figure 4B is a schematic diagram of a local effect of automatically constructing a triangular facet after adding a preset mark according to an exemplary embodiment of this specification;
[0022] Figure 5A is a schematic diagram of a point cloud and triangular facets of a three-dimensional face model according to an exemplary embodiment of the present specification;
[0023] Figure 5B is a schematic diagram of a texture image of a three-dimensional face model according to an exemplary embodiment of this specification;
[0024] Figure 6 It is a hardware structure diagram of a computer device where a three-dimensional model adjustment device is located according to an exemplary embodiment of this specification;
[0025] Figure 7 It is a block diagram of a three-dimensional model adjustment device shown in this specification according to an exemplary embodiment. DETAILED DESCRIPTION
[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.
[0027] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0028] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0029] In 3D technology, the point cloud data obtained by the optical 3D scanner is used as the basic input. After pre-processing such as registration, denoising, and repair of the point cloud data, the point cloud model can be established. After the point cloud model is meshed by drawing tools, a mesh model with a topological structure can be generated. The mesh model generated based on this method is as follows: Figure 1 As shown, due to the high density of point clouds and the large number of triangular facets, the device needs to perform a lot of calculations when rendering such a mesh model, which takes a long time. Therefore, before being put into business use, it is often necessary to manually thin out the point clouds of such mesh models and adjust the polygonal mesh according to the thinned point cloud. This process is repetitive and time-consuming, which can easily affect the launch of the business. There are also solutions in the related art that implement point cloud thinning through software, which are generally based on the center of gravity points in the original point cloud, and generate a new point cloud by interpolation as the thinned point cloud. However, this solution is prone to uncontrollable results. For example, the triangular facets adjusted according to the thinned point cloud are prone to irregularity, which in turn causes problems with inconsistent reflections.
[0030] Based on this, the embodiment of this specification provides a three-dimensional model adjustment solution to solve the above problem. Next, the embodiment of this specification is described in detail.
[0031] like Figure 2 As shown, Figure 2 is a flowchart of a three-dimensional model adjustment method according to an exemplary embodiment of the present specification, the method comprising:
[0032] Step 201: Acquire a texture image of an initial three-dimensional model, wherein the texture image includes a plurality of texture points;
[0033] The solution of this embodiment can realize the automatic adjustment of the initial three-dimensional model, and the adjustment here includes point cloud sparseness. The point cloud data of the initial three-dimensional model can be obtained by scanning the target object based on an optical three-dimensional scanner. The topological structure of the initial three-dimensional model represents the point, line and surface layout, structure and connection of the initial three-dimensional model. The topological structure can be manually drawn by professional technicians, or obtained by reconstructing the grid of the point cloud model through a deep learning algorithm. Optionally, the target object can be a person, animal, plant, furniture, electrical appliance or other object, or it can be a part of an object, such as a face or a hand.
[0034] The points in the point cloud data of the initial three-dimensional model are called vertices, and the coordinates of the vertices in the point cloud space are called geometric coordinates, which are generally represented by three dimensions of x, y, and z. The geometric coordinates determine the drawing position of the vertex. When drawing a texture mapping scene, it is also necessary to specify texture coordinates for the vertices, which are generally represented by two dimensions of U and V. The texture coordinates determine the texture element assigned to the vertex. The texture image of the initial three-dimensional model is also called a texture coordinate map, which can be obtained by unfolding the initial three-dimensional model and mapping it to the texture coordinate space. The points in the texture image are called texture points, which can also be called texture coordinate points. There is a one-to-one mapping relationship between texture points and vertices, that is, each texture point corresponds to a vertex; the connection between texture points is determined according to the topological structure of the initial three-dimensional model. For example, the first point, the second point, and the fourth point in the point cloud of the initial three-dimensional model constitute a triangular face, and the texture points corresponding to the three vertices of the first point, the second point, and the fourth point can have a connection relationship between each other.
[0035] Step 202: Acquire the texture edge of the texture image, perform sampling on the texture edge according to a preset sampling condition, and perform sparse processing on the vertices of the initial three-dimensional model using the texture points selected by sampling;
[0036] The texture edge mentioned in this embodiment is an edge formed by at least two connecting lines in the texture image, and the texture edge can be a straight line or a curve. Different from the method of selecting sparse points in the point cloud space in the related art, this embodiment selects sparse points based on the texture image, thus converting the three-dimensional problem into a two-dimensional problem, making it easier to achieve sampling averaging, and being able to process the edges of the polygonal mesh more intuitively. At the same time, this embodiment selects sparse points on the texture edge, that is, the selection is made based on the original points, and no additional interpolation is performed, thereby minimizing the occurrence of uncontrollable results.
[0037] In an optional embodiment, the texture edge can be selected based on the curvature of each texture point. For a target point among the texture points, the adjacent points of the target point refer to the texture points with which there are edges connected to the target point. For example, the target point is the 100th point in the point cloud corresponding to the initial three-dimensional model, and the target point, the 80th point and the 90th point form a triangular facet, and the target point, the 90th point and the 120th point form another triangular facet, then the adjacent points of the target point include at least the 80th point, the 90th point and the 120th point. In this embodiment, the curvature of the texture point can be determined based on the angle between the texture point and the adjacent points. Optionally, the curvature of a texture point can be the minimum angle corresponding to the texture point. For example, a texture point and the adjacent points form three triangular facets in the texture image, and the corresponding angles of the texture point in these three triangular facets are 25°, 35°, and 60°, respectively, then the curvature of the texture point can be 25°. In this way, each texture point in the texture image has a corresponding curvature, and a relatively smooth edge can be selected through the curvature of each texture point, that is, a continuous line close to a straight line on the texture image can form a texture edge, and a continuous line close to a circular arc can also form a texture edge. In this way, after sampling, a relatively average and reasonable sampling point can be obtained.
[0038] In some examples, the texture edge can be obtained based on the following method: obtain the target point on the texture edge determined most recently; select the target adjacent point with a curvature less than a preset curvature threshold and the smallest curvature from the adjacent points of the target point; determine the target adjacent point as the target point on the texture edge until there is no target adjacent point with a curvature less than the preset curvature threshold; wherein the target point on the texture edge determined for the first time is a point that has not been determined as a point on any texture edge and has the smallest curvature. Optionally, the preset curvature threshold can be 20°. Of course, in other embodiments, the preset curvature threshold can be set according to the needs of the specific scene. This method means that all texture points are first globally traversed, and the texture point with the smallest curvature is determined as the starting point of the texture edge, and then the texture point with the smallest curvature among the adjacent points of the target point is determined as the point on the texture edge, and so on, until the curvature of all adjacent points of a certain point is greater than or equal to the preset curvature threshold, then the end is completed, so that the first texture edge is obtained, and then the global traversal can be continued in the remaining points, and the edges are selected in the same way. After traversing all texture points, several texture edges can be obtained. For example, a texture image of a three-dimensional model has 10,000 texture points. Through global traversal, it is determined that the 20th point is the texture point with the smallest curvature among the 10,000 texture points. Then, the 20th point is first used as the starting point of the first texture edge. The adjacent points of the 20th point include the 21st point, the 22nd point, and the 23rd point. The texture point with the smallest curvature among these three adjacent points is the 22nd point, and the curvature of the 22nd point is less than the preset curvature threshold of 20°. Then, the 22nd point is determined as the point on the first texture edge. The adjacent points of the 22nd point include the 34th point, the 35th point, and the 36th point. The texture point with the smallest curvature among these three adjacent points is the 34th point, and the 34th point If the curvature of is less than the preset curvature threshold of 20°, the 34th point is determined as a point on the first texture edge, and the curvatures of the adjacent points of the 34th point are all greater than the preset curvature threshold of 20°, so the adjacent point search for the first texture edge is exited, and the 20th, 22nd, and 34th points are determined as points on the first texture edge, that is, the first texture edge is the edge formed by the line between the 20th and 22nd points and the line between the 22nd and 34th points; after excluding the 20th, 22nd, and 34th points from these 10,000 texture points, the remaining points are globally traversed, and the edges are selected in the same way until all texture points are globally traversed. Figure 3 As shown, Figure 3 is a schematic diagram of a texture image of a three-dimensional model. Figure 3 The texture edge 31 and the texture edge 32 in are two of the texture edges selected according to the above method. Figure 3 It can be seen that through this method, the device can automatically select the texture edge in the smoothest direction, thereby ensuring the rationality of subsequent sampling.
[0039] It should be noted that, in the process of searching for adjacent points, although texture points with a curvature greater than or equal to a preset curvature threshold value will not be selected, when searching for the starting point of a new texture edge, i.e., when globally traversing, these texture points with a curvature greater than or equal to a preset curvature threshold value can be selected and form a new texture edge with other texture points with a curvature less than the preset curvature threshold value, so that the smoothness of the texture edge is ensured while the integrity of the sampling sample is ensured. In addition, when selecting edges, texture points that have been determined as points on the texture edge will no longer participate in the subsequent edge selection process. For example, a Flag flag with a value of "True" can be set for texture points that have been determined as points on the texture edge, indicating that they have been searched. In this way, when searching for adjacent points and the starting point of a new texture edge, texture points with a Flag flag with a value of "True" can be automatically ignored, thereby avoiding an infinite loop. In other embodiments, other edge selection methods can also be selected according to the needs of specific scenarios, such as through a tree structure.
[0040] The preset sampling conditions mentioned in this step may include a preset sampling interval, which can be considered as a sampling step. In this embodiment, the edge between any two adjacent texture points in the texture image is considered as a step. For example, the points on a texture edge correspond to the 1st point, the 10th point, the 20th point, the 30th point, the 60th point, the 80th point and the 100th point in the point cloud of the initial three-dimensional model. If the preset sampling interval is 3 steps, the texture points selected by sampling are the texture points corresponding to the three vertices of the 1st point, the 30th point and the 100th point. In this way, the averaging of the selected points can be achieved. Further, in order to avoid some important vertices in the point cloud topology, such as the corner of the eye and the tip of the nose, being excluded during the sampling process, in some examples, the above-mentioned preset sampling conditions may also include a preset sampling mark, and the texture points selected by sampling include texture points sampled according to the preset sampling interval and texture points with preset sampling marks. The preset sampling mark can be manually added to the data of the initial network model for important vertices, or it can be automatically added to the data of the initial network model after the important vertices are identified by the neural network algorithm. Continuing with the previous example, if the 20th point has a preset sampling mark, the sampled texture points include the texture points corresponding to the 20th vertex in addition to the texture points corresponding to the 1st, 30th and 100th vertices. In this way, important vertices in the point cloud can be effectively retained.
[0041] After sampling and selecting texture points, these texture points can be used to perform sparse processing on the vertices of the initial three-dimensional model. Each vertex of the initial three-dimensional model has an index, and the vertex coordinates and texture coordinates of the vertex can be packaged into an array for storage, and the information in the array can be quickly retrieved through the index. Therefore, in some examples, the sparse processing performed can be based on the index corresponding to the sampled texture point, extracting each vertex corresponding to the sampled texture point from the original point cloud of the initial three-dimensional model to form a sparse point cloud. Of course, in other embodiments, the sparse processing performed can also be to determine each vertex corresponding to the sampled texture point as a sparse point, and delete vertices other than the sparse points from the original point cloud of the initial three-dimensional model.
[0042] Step 203: construct a polygon mesh based on the sparsed vertices to obtain a target three-dimensional model.
[0043] After the point cloud is thinned, the thinned vertices can be connected to generate a series of non-intersecting and non-overlapping polygons, that is, a polygonal mesh is constructed to obtain the target three-dimensional model. Optionally, the polygon can be a Delaunay triangle, that is, this step can be achieved by automatically constructing a Delaunay triangle for the thinned vertices using the Delaunay triangulation algorithm. The Delaunay triangulation algorithm is a triangulation algorithm that follows the empty circumscribed circle criterion and the maximum and minimum angle criteria. Since most of the texture images of the initial three-dimensional model satisfy the left-right symmetric characteristics, the constructed Delaunay triangle can also satisfy the left-right symmetric characteristics, thereby achieving the symmetry of the constructed polygonal network. Among them, the specific calculation process of constructing the Delaunay triangle can be referred to the description in the relevant technology, and this specification will not be repeated here. It should be noted that, since the Delaunay triangulation algorithm has a large amount of calculation when implemented in three-dimensional space, in some examples, Delaunay triangles can be constructed based on the texture points corresponding to the sparse vertices, and finally the point cloud topology structure can be obtained based on the constructed texture topology structure, which can reduce the amount of calculation and improve efficiency. In addition, in other embodiments, the polygonal mesh can also be other types, such as four-corner facets, five-corner facets, etc., which are not limited in this specification.
[0044] Furthermore, in practical applications, the regularity of the constructed polygonal network is very important for business use, such as Figure 4A As shown, Figure 4A FIG. 4 is a schematic diagram of the local effect of automatically constructing triangular facets using a triangulation algorithm. The position shown in area 41 in the figure belongs to the outer contour of the eye. When used in business, the points at this position are often required to be in a ring shape. Therefore, professional technicians need to Figure 4AIn this case, it is undoubtedly very cumbersome to make secondary adjustments. Based on this, in some examples, for the vertices in such key positions, constraint marks can be set for these vertices in advance to form preset constraint points. The constraint marks can be recorded manually by professional technicians or automatically identified and recorded by neural network algorithms. In this way, in the process of constructing polygonal meshes, if there are two vertices that belong to the preset constraint points, the edge formed by the two vertices can be used as the reference for polygon construction. Figure 4B As shown, Figure 4B It is a schematic diagram of the local effect of automatically constructing a triangular facet after adding preset marks. The position shown in area 42 in the figure belongs to the outer contour of the eye point, wherein texture point 43 and texture point 44 belong to the preset constraint points (texture points and vertices are in a one-to-one correspondence, therefore, when a vertex belongs to a preset constraint point, the texture point corresponding to the vertex also belongs to the preset constraint point). Therefore, when constructing the polygon of area 42 based on the Delaunay triangulation algorithm, it is determined whether two of the three texture points appearing in the currently constructed Delaunay triangle belong to the preset constraint points. Since texture point 43 and texture point 44 belong to the preset constraint points, the edge formed by texture point 43 and texture point 44 is used as a reference to calculate the optimal Delaunay triangle, so that the topological structure of the constructed target three-dimensional model meets the art requirements and has symmetry, effectively reducing the workload of professional and technical personnel due to secondary adjustments.
[0045] The solution of this embodiment selects sampling points based on the texture edges of the texture image of the initial 3D model, and performs point cloud thinning based on the sampling points, and then constructs the target 3D model based on the thinned vertices. In this way, the automatic adjustment of the initial 3D model is achieved, effectively reducing the workload of professional technicians. At the same time, the 3D problem is converted into a 2D problem, the sampling is averaged, and the thinned vertices are the vertices in the original point cloud, effectively reducing the occurrence of uncontrollable results.
[0046] In order to explain the solution of this specification in more detail, a specific embodiment is introduced below:
[0047] The solution of this embodiment is applied to a drawing software. In one process, the drawing software automatically adjusts a 3D face model. The 3D face model is a 3D mesh model obtained by an artist reconstructing a mesh of a point cloud model generated by scanning a real person with a 3D scanner. Figure 5A As shown, Figure 5A It is a schematic diagram of the point cloud and triangular face of the 3D face model. The process of automatic adjustment of the 3D face model by the drawing software is as follows:
[0048] S501, obtaining a texture image of the 3D face model, the texture image being Figure 5B As shown, the texture image includes a plurality of texture points, each texture point corresponding to a vertex in the point cloud;
[0049] S502, obtaining a texture edge in the texture image by performing a minimum curvature calculation, wherein the method of the minimum curvature calculation includes: first determining a texture point with the minimum curvature from all texture points as a starting point of the texture edge, then determining a texture point with the minimum curvature from the adjacent points of the target point as a point on the texture edge, and so on, until the curvatures of all adjacent points of a certain point are greater than or equal to a preset curvature threshold, thereby obtaining the first texture edge, and then continuing to select edges from the remaining points in the same manner, and obtaining a plurality of texture edges after traversing all texture points;
[0050] S503, sampling is performed on each texture edge with a step length of 3, that is, one sampling point is selected for every three texture points;
[0051] S504, determining the vertices corresponding to the sampling points as sparse points, extracting the sparse points and vertices with preset sampling marks from the original point cloud of the initial three-dimensional model to form a sparse point cloud;
[0052] S505. Delaunay triangulation algorithm is used to construct a Drone triangle for each texture point corresponding to the sparse point cloud. When all texture points are cyclically calculated to construct the Drone triangle, it is determined whether two of the three texture points appearing in the currently constructed Drone triangle belong to the preset constraint points. If so, the edge formed by the two texture points is used as a reference requirement to calculate the optimal Drone triangle. After traversing all points, the texture topology structure is obtained, and the point cloud topology structure is determined based on the texture topology structure, thereby constructing the target model.
[0053] The solution of this embodiment can realize the automatic generation of point cloud sparse topology, effectively reducing the workload of artists, and the topological structure of the adjusted target model has symmetry and regularity that meet the design requirements. In addition, the solution of this embodiment is not only applicable to the automatic adjustment of face models, but also to the automatic adjustment of mesh models of other objects, such as animals, electronic devices, virtual images, etc.
[0054] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of a three-dimensional model adjustment device and a terminal to which it is applied.
[0055] The embodiments of the three-dimensional model adjustment device of this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented through software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the file processing in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 6 The figure is a hardware structure diagram of the computer device where the three-dimensional model adjustment device of the embodiment of this specification is located. Figure 6 In addition to the processor 610, memory 630, network interface 620, and non-volatile memory 640 shown, the server or electronic device where the device 631 is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.
[0056] Accordingly, an embodiment of the present specification further provides a computer storage medium, in which a program is stored. When the program is executed by a processor, the method in any of the above embodiments is implemented.
[0057] The embodiments of this specification may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0058] like Figure 7 As shown, Figure 7 is a block diagram of a three-dimensional model adjustment device according to an exemplary embodiment of the present specification, the device comprising:
[0059] An acquisition module 71 is used to acquire a texture image of an initial three-dimensional model, wherein the texture image includes a plurality of texture points;
[0060] A sparse module 72, used for acquiring a texture edge of the texture image, sampling on the texture edge according to a preset sampling condition, and performing sparse processing on the vertices of the initial three-dimensional model using the texture points selected by the sampling;
[0061] The construction module 73 is used to construct a polygon mesh according to the sparse vertices to obtain a target three-dimensional model.
[0062] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0063] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0064] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0065] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.
[0066] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
[0067] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A three-dimensional model adjustment method, characterized in that: include: Acquire a texture image of an initial three-dimensional model, wherein the texture image includes a plurality of texture points; Acquire a texture edge of the texture image, perform sampling on the texture edge according to a preset sampling condition, and perform sparse processing on the vertices of the initial three-dimensional model using the texture points selected by sampling; Construct a polygonal mesh based on the sparse vertices to obtain a target three-dimensional model; The obtaining of the texture edge of the texture image comprises: Obtaining the most recently determined target point on the texture edge; Selecting a target adjacent point whose curvature is less than a preset curvature threshold and whose curvature is the smallest from the adjacent points of the target point; Determine the target adjacent point as the target point on the texture edge until there is no target adjacent point whose curvature is less than a preset curvature threshold; The target point on the texture edge determined for the first time is a point that has not been determined as a point on any texture edge and has the smallest curvature; the curvature of a texture point is determined according to the angle between the texture point and an adjacent point.
2. The method according to claim 1, characterized in that The preset sampling condition includes a preset sampling interval.
3. The method according to claim 2, characterized in that The preset sampling condition also includes a preset sampling mark, and the texture points selected by sampling include texture points sampled according to a preset sampling interval and texture points with a preset sampling mark.
4. The method according to claim 1, characterized in that: The sparse processing of the vertices of the three-dimensional model by using the texture points selected by sampling includes: A sparse point cloud is obtained based on the vertices corresponding to the texture points selected by sampling.
5. The method according to claim 1, characterized in that The step of constructing a polygonal mesh according to the sparsely-divided vertices includes: In the process of constructing a polygonal network, if there are two vertices that belong to preset constraint points, the polygon is constructed based on the edge formed by the two vertices; the preset constraint point is a vertex carrying a constraint identifier.
6. A three-dimensional model adjustment device, characterized in that: include: An acquisition module, used for acquiring a texture image of an initial three-dimensional model, wherein the texture image includes a plurality of texture points; A sparse module, used for acquiring the texture edge of the texture image, sampling on the texture edge according to a preset sampling condition, and performing sparse processing on the vertices of the initial three-dimensional model using the texture points selected by sampling; A construction module is used to construct a polygon mesh according to the sparse vertices to obtain a target three-dimensional model; The obtaining of the texture edge of the texture image comprises: Obtaining the most recently determined target point on the texture edge; Selecting a target adjacent point whose curvature is less than a preset curvature threshold and whose curvature is the smallest from the adjacent points of the target point; Determine the target adjacent point as the target point on the texture edge until there is no target adjacent point whose curvature is less than a preset curvature threshold; The target point on the texture edge determined for the first time is a point that has not been determined as a point on any texture edge and has the smallest curvature; the curvature of a texture point is determined according to the angle between the texture point and an adjacent point.
7. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the program.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the method described in any one of claims 1 to 5 is implemented.
