Mesh model processing method and apparatus, and device and storage medium
By segmenting and chunking the mesh model, the risk of handling abnormalities caused by memory peak limit is solved, and more effective memory usage and processing pressure management is achieved.
Patent Information
- Application Number
- PCT/CN2024/134127
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-11
- Filing Date
- 2024-11-25
- Publication Date
- 2025-06-19
AI Technical Summary
When processing the mesh model, due to memory peak limits, the memory pressure of the processing algorithm is high, which increases the risk of processing exceptions.
By segmenting the target mesh model, multiple first sub-regions are obtained, and target processing operations are performed on each sub-region in turn to optimize memory usage and processing pressure.
Through zone processing, the memory peak required for each processing operation is reduced, the algorithm memory pressure is reduced, and the risk of handling exceptions is reduced.
Smart Images

Figure CN2024134127_19062025_PF_FP_ABST
Abstract
Description
Grid model processing method, device, equipment and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 11, 2023, with application number 202311695086.X, and invention name “Method, device, equipment and storage medium for processing grid models”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for processing a grid model. Background Art
[0003] Currently, after a scanner is used to perform a three-dimensional scan on an object to obtain scan data, the scan data is usually triangulated to obtain a mesh model corresponding to the scanned object, and then the mesh model is processed and visualized.
[0004] However, in the process of processing the mesh model, due to the peak memory limit, the memory pressure of the processing algorithm is often high, which increases the risk of processing exceptions. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide a method, apparatus, device and storage medium for processing a grid model.
[0006] A first aspect of an embodiment of the present disclosure provides a method for processing a grid model, the method comprising:
[0007] Obtaining a target mesh model including a plurality of triangular facets;
[0008] Segmenting the target grid model to obtain a plurality of first sub-regions;
[0009] For the plurality of first sub-regions, the first target processing operation is performed on the first sub-regions in sequence.
[0010] A second aspect of an embodiment of the present disclosure provides a grid model processing device, the device comprising:
[0011] A first acquisition module is configured to acquire a target mesh model including a plurality of triangular facets;
[0012] A first segmentation module is configured to segment the target grid model to obtain a plurality of first sub-regions;
[0013] The first processing module is configured to perform a first target processing operation on the plurality of first sub-regions in sequence.
[0014] A third aspect of an embodiment of the present disclosure provides an electronic device, comprising: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method of the first aspect above.
[0015] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect described above can be implemented.
[0016] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:
[0017] The disclosed embodiment can obtain a target mesh model including multiple triangular facets; segment the target mesh model to obtain multiple first sub-regions; and perform first target processing operations on the multiple first sub-regions in sequence. By adopting the above technical solution, the first target processing operation can be performed on the target mesh model in regions (or blocks), so that each time the first target processing operation is performed, the target object is the first sub-region with a smaller amount of data, rather than the complete target mesh model with a larger amount of data. In this way, the memory peak when performing the first target processing operation on the target mesh model can be optimized, the algorithm memory pressure for performing the first target processing operation on the target mesh model can be reduced, and the risk of processing anomalies can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] FIG1 is a flowchart of a method for processing a grid model provided by an embodiment of the present disclosure.
[0021] FIG2 is a flowchart of another grid model processing method provided by an embodiment of the present disclosure.
[0022] FIG3 is a flowchart of another method for processing a grid model provided by an embodiment of the present disclosure.
[0023] FIG4 is a flowchart of another method for processing a grid model provided by an embodiment of the present disclosure.
[0024] FIG5 is a schematic structural diagram of a grid model processing device provided by an embodiment of the present disclosure.
[0025] FIG6 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0028] FIG1 is a flowchart of a method for processing a grid model provided by an embodiment of the present disclosure. The method can be performed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, tablet computer, laptop computer, desktop computer, smart TV, etc. As shown in FIG1 , the method provided by this embodiment includes the following steps:
[0029] S110: Acquire a target mesh model including a plurality of triangular facets.
[0030] Specifically, the target mesh model can be any mesh model (i.e., Mesh). For example, it can be a mesh model corresponding to any scanned object (such as a human body, furniture, a building, etc.), or it can be any virtually created mesh model, but is not limited thereto.
[0031] In some embodiments, S110 may include: performing triangulation on the scan data corresponding to the scanned object to obtain a target mesh model.
[0032] Of course, in other embodiments, S110 may also include: reading the target grid model from a storage device (U disk, local disk, etc.), or receiving the target grid model sent by other electronic devices.
[0033] S120 : Segment the target grid model to obtain a plurality of first sub-regions.
[0034] Specifically, the first sub-region is obtained by segmenting (or dividing) the triangular facets included in the target mesh model, and is a part of the target mesh model.
[0035] Specifically, the number of the first sub-regions divided, the number of triangular facets included in the first sub-region, and the specific value of the first preset threshold can be set by those skilled in the art according to actual conditions and are not limited here.
[0036] Optionally, a difference in the number of triangular facets included in different first sub-regions is smaller than a first preset threshold.
[0037] It can be understood that by setting the difference in the number of triangular facets included in different first sub-regions to be less than the first preset threshold, the data volume of each first sub-region can be made similar, avoiding the problem of large differences in data volume in different first sub-regions. In this way, the memory peak value can be similar when performing the first target processing operation on each first sub-region, and the algorithm memory pressure can be similar and relatively small, which is conducive to making full use of the memory of the electronic device.
[0038] Optionally, the target mesh model is composed of multiple components, and the triangles within the same first sub-region belong to the same component. For example, the target mesh model is a human mesh model, which includes six components: head, torso, left upper arm, left and right arms, left leg, and right leg. The triangles within the same first sub-region belong to the same component.
[0039] Of course, the correspondence between the triangular facets in the first sub-region and the triangular facets on the target mesh model may also be recorded.
[0040] S130 : performing a first target processing operation on the plurality of first sub-regions in sequence.
[0041] Specifically, the first target processing operation may include: simplification processing operation, denoising processing operation, re-gridding processing operation, hole filling processing operation, smoothing processing operation, de-spike processing operation, or other processing operations known to those skilled in the art, but are not limited thereto.
[0042] Specifically, the order of performing the first target processing operation on the multiple first sub-regions in sequence can be set by those skilled in the art according to actual conditions and is not limited here.
[0043] It is understandable that in the related art, the target grid model is usually simplified as a whole to reduce the amount of data, reduce the memory peak, and thus reduce the algorithm memory pressure when other processing operations are performed on the simplified target grid model. However, when simplifying the target grid model, there are still problems of large memory peak and large algorithm memory pressure, and over-simplification of the target grid model will also cause the problem of loss of data details. However, in the disclosed embodiment, the task of "performing a first target processing operation on the target grid model", which has a large memory peak and requires a large algorithm memory, can be decomposed into multiple subtasks with smaller memory peaks and smaller algorithm memory requirements (i.e., "performing a first target processing operation on the first sub-area"), and each subtask is executed sequentially (or serially). In this way, the effect of performing the first target processing operation on the target grid model can be achieved, and the memory peak and algorithm memory pressure can be reduced.
[0044] Optionally, after S130, it may also include: segmenting the target grid model after the first target processing operation to obtain multiple second sub-regions, or using the multiple first sub-regions after the first target processing operation as multiple second sub-regions; for the multiple second sub-regions, performing the second target processing operation on the second sub-regions in turn.
[0045] In some embodiments, the second sub-region is obtained by segmenting (or blocking) the triangular facets included in the "target mesh model after the first target processing operation", and is part of the "target mesh model after the first target processing operation".
[0046] Specifically, the number of the divided second sub-regions, the number of triangular facets included in the second sub-region, and the specific value of the second preset threshold can be set by those skilled in the art according to actual conditions and are not limited here.
[0047] Of course, in other embodiments, the first sub-region after the first target processing operation is performed may also be directly used as the second sub-region.
[0048] Optionally, a difference in the number of triangular facets included in different second sub-regions is smaller than a second preset threshold.
[0049] It can be understood that by setting the difference in the number of triangular facets included in different second sub-regions to be less than the second preset threshold, the data volume of each second sub-region can be made similar, avoiding the problem of large differences in data volume in different second sub-regions. In this way, the memory peak value can be similar when performing the second target processing operation on each second sub-region, and the algorithm memory pressure can be similar and relatively small.
[0050] Specifically, the second target processing operation is different from the first target processing operation, and the second target processing operation may include: simplification processing operation, denoising processing operation, re-gridding processing operation, hole filling processing operation, smoothing processing operation, de-spike processing operation, or other processing operations known to those skilled in the art, but is not limited to these.
[0051] It can be understood that compared with performing the first target processing operation and the second target processing operation on the target grid model in parallel, in the implementation of the present disclosure, the first target processing operation and the second target processing operation are performed on the target grid model sequentially (or serially). This is beneficial in that the memory peak is smaller and the algorithm memory pressure is smaller in each stage of the entire processing of the target grid model.
[0052] Further optionally, a difference between the number of triangular facets included in the first sub-region and the number of triangular facets included in the second sub-region is smaller than a third preset threshold.
[0053] Specifically, the specific value of the third preset threshold can be set by those skilled in the art according to actual conditions and is not limited here.
[0054] In this way, the memory peak values at each stage of the entire processing of the target mesh model are similar and small, and the algorithm memory pressure is similar and small, which is conducive to making full use of the memory of the electronic device.
[0055] Of course, the correspondence between the triangular facets in the second sub-region and the triangular facets on the target mesh model after the first target processing operation is performed may also be recorded.
[0056] The disclosed embodiment can perform the first target processing operation on the target grid model in regions (or blocks), so that each time the first target processing operation is performed, the object targeted is the first sub-region with a smaller amount of data, rather than the complete target grid model with a huge amount of data. In this way, the memory peak when the first target processing operation is performed on the target grid model can be optimized, the algorithm memory pressure when performing the first target processing operation on the target grid model can be reduced, and the risk of processing exceptions can be reduced.
[0057] Figure 2 is a flow chart of another method for processing a grid model provided by an embodiment of the present disclosure. The present disclosure embodiment is optimized based on the above embodiment, and the present disclosure embodiment can be combined with various optional solutions in one or more of the above embodiments.
[0058] As shown in FIG2 , the method for processing the grid model may include the following steps.
[0059] S210: Obtain a target mesh model including a plurality of triangular facets.
[0060] Specifically, S210 is similar to S110 and will not be described again here.
[0061] S220 , segmenting the target grid model to obtain a plurality of first sub-regions.
[0062] Specifically, S210 is similar to S120 and will not be described again here.
[0063] S230 : For the plurality of first sub-regions, sequentially perform a simplification operation on the inner regions of the first sub-regions.
[0064] Specifically, the first sub-region includes an inner region and an outer region surrounding (or encircling) the inner region. In other words, the outer region is the region that expands outward from the inner region. The number of triangular facets included in the outer region along the width direction (or the outward expansion direction) (e.g., 1 or 2) can be set by those skilled in the art based on actual conditions and is not limited here.
[0065] Specifically, any possible simplification algorithm (such as the QEM grid simplification algorithm, etc.) may be used to perform a simplification operation on the inner region of the first sub-region, which is not limited here.
[0066] S240: Perform a simplification process on the connection area.
[0067] Specifically, a connected region is a region formed by connecting adjacent external regions. Adjacent here means that the two connected regions have a common vertex (i.e., a vertex shared by at least two triangular facets) and / or a common edge (i.e., an edge shared by at least two triangular facets).
[0068] Specifically, any possible simplification algorithm (such as the QEM mesh simplification algorithm, etc.) may be used to perform simplification processing operations on the connected area, which is not limited here.
[0069] It can be understood that by performing the simplification operation on the inner area and the connection area separately, it is possible to ensure that the original boundaries of adjacent components are not affected.
[0070] In some embodiments, S240 may include: performing simplification processing operations on the connected regions in sequence, so that when performing simplification processing operations on the connected regions, the memory peak is reduced and the algorithm memory pressure is reduced.
[0071] In some other embodiments, S240 may include: grouping all the connection areas to obtain at least one connection area group; and sequentially performing simplification processing operations on the at least one connection area group.
[0072] Optionally, the difference in the number of triangular facets included in different connected region groups is smaller than a fourth preset threshold.
[0073] Specifically, the number of connected area groups, the number of triangular facets included in the connected area groups, and the specific value of the fourth preset threshold can be set by those skilled in the art according to actual conditions and are not limited here.
[0074] It can be understood that the number of triangles included in each connected area is usually small, so the number of triangles included in the connected area group is also relatively small. In this way, even if the connected areas in the same connected area group are simplified in parallel, not only can the memory peak be reduced and the algorithm memory pressure be reduced, but the simplified processing operation of the connected areas can also be completed quickly.
[0075] Optionally, after S240 , the following may be further included: S250 , merging the first sub-regions after the simplification operation, so as to obtain a target mesh model after the simplification operation.
[0076] Further optionally, after S250, it also includes: segmenting the target mesh model after the simplification processing operation to obtain multiple second sub-regions, wherein the difference in the number of triangular facets included in different second sub-regions is less than a second preset threshold; for multiple second sub-regions, performing the second target processing operation on the second sub-regions in turn.
[0077] The disclosed embodiment can perform simplification processing operations on the target grid model in different regions (or blocks), so that each time the simplification processing operation is performed, the object targeted is the first sub-region with a smaller amount of data, rather than the complete target grid model with a larger amount of data. In this way, the memory peak when the simplification processing operation is performed on the target grid model can be optimized, the algorithm memory pressure of the simplification processing operation on the target grid model can be reduced, and the risk of processing exceptions can be reduced.
[0078] Figure 3 is a flow chart of another method for processing a grid model provided by an embodiment of the present disclosure. The present disclosure embodiment is optimized based on the above embodiment, and the present disclosure embodiment can be combined with various optional solutions in one or more of the above embodiments.
[0079] As shown in FIG3 , the method for processing the grid model may include the following steps.
[0080] S310: Acquire a target mesh model including a plurality of triangular facets.
[0081] Specifically, S310 is similar to S110 and will not be described again here.
[0082] S320: Segment the target grid model to obtain a plurality of first sub-regions.
[0083] Specifically, S310 is similar to S120 and will not be described in detail here.
[0084] S330. For multiple first sub-regions, perform the following steps on the first sub-regions in sequence to perform denoising operations: expand the first sub-region by a preset number of triangles to obtain a third sub-region, and iteratively update the normal vectors and vertex coordinates of the triangles in the first sub-region based on the normal vectors and vertex coordinates of the triangles in the third sub-region.
[0085] Specifically, the surrounding area outside (or outer ring of) the first sub-area on the target mesh model and the first sub-area are determined as the third sub-area corresponding to the first sub-area, wherein the surrounding area includes a preset number of triangular facets along the width direction.
[0086] Specifically, the specific value of the preset number can be set by those skilled in the art according to actual conditions and is not limited here.
[0087] Specifically, any possible denoising algorithm (such as a bilateral filtering grid denoising algorithm) may be used to iteratively update the normal vectors and vertex coordinates of the triangles in the first sub-region, but the invention is not limited thereto.
[0088] S340 . For common vertices belonging to different first sub-regions, perform weighted sum processing on vertex coordinates of the common vertex in each first sub-region to which it belongs, to obtain vertex coordinates corresponding to the common vertex.
[0089] Specifically, the weight value of each vertex coordinate of the common vertex can be set by those skilled in the art according to actual conditions and is not limited here.
[0090] Specifically, the vertex coordinates obtained through the weighted summation process are the final vertex coordinates of the common vertex.
[0091] In some embodiments, S340 may include: sequentially performing weighted summation processing on vertex coordinates corresponding to the common vertices. In this way, when determining the final vertex coordinates of the common vertices, the memory peak is reduced and the algorithm memory pressure is reduced.
[0092] In some embodiments, S340 may include: grouping all common vertices to obtain at least one common vertex group; and sequentially performing simplification operations on the at least one common vertex group. Optionally, the difference in the number of common vertices included in different common vertex groups is less than a fifth preset threshold.
[0093] Specifically, the number of common vertex groups, the number of common vertices included in the common vertex groups, and the specific value of the fifth preset threshold can be set by those skilled in the art according to actual conditions and are not limited here.
[0094] Optionally, after S340 , the method may further include: S350 merging the first sub-regions after the denoising operation, so as to obtain a target mesh model after the denoising operation.
[0095] Further optionally, after S350, it also includes: segmenting the target mesh model after the denoising operation to obtain multiple second sub-regions, wherein the difference in the number of triangular facets included in different second sub-regions is less than a second preset threshold; for the multiple second sub-regions, performing the second target processing operation on the second sub-regions in turn.
[0096] The disclosed embodiment can perform denoising operations on the target grid model in different regions (or blocks), so that each time the denoising operation is performed, the target object is the first sub-region with a smaller amount of data, rather than the complete target grid model with a huge amount of data. In this way, the memory peak when the denoising operation is performed on the target grid model can be optimized, the algorithm memory pressure of the denoising operation on the target grid model can be reduced, and the risk of processing abnormalities can be reduced.
[0097] Figure 4 is a flow chart of another method for processing a grid model provided by an embodiment of the present disclosure. The present disclosure embodiment is optimized based on the above embodiment, and the present disclosure embodiment can be combined with various optional solutions in one or more of the above embodiments.
[0098] As shown in FIG4 , the method for processing the grid model may include the following steps.
[0099] S410: Obtain a target mesh model including a plurality of triangular facets.
[0100] Specifically, S410 is similar to S110 and will not be described in detail here.
[0101] S420: Segment the target grid model to obtain a plurality of first sub-regions.
[0102] Specifically, S410 is similar to S120 and will not be described in detail here.
[0103] S430. For multiple first sub-regions, perform the following steps on the first sub-regions in sequence to perform a remeshing operation: initialize the measurement values of the vertices of the triangular facets in the first sub-region, and update the topological structure and vertex coordinates of the triangular facets in the first sub-region based on the measurement values.
[0104] The metric value includes at least one of the following: curvature, average side length, and the number of sides connected to the vertex.
[0105] Specifically, the curvature magnitude is the surface curvature value at the vertex location, the average side length is the average side length of the sides to which the vertex belongs, and the number of sides connected to the vertex is the number of sides to which the vertex belongs.
[0106] Specifically, any re-meshing algorithm (such as edge folding, edge flipping, edge splitting, etc.) may be used to update the topological structure and vertex coordinates of the triangular facets in the first sub-region, which is not limited here.
[0107] Specifically, after S410 and S420, a re-gridding operation is performed on the target grid model.
[0108] S440: If the preset conditions are met, it is determined that the re-meshing operation for the target mesh model is completed.
[0109] Specifically, the preset conditions may include, but are not limited to, the number of times the target mesh model is re-meshed reaches a preset number threshold, or the time taken to re-mesh the target mesh reaches a preset time threshold.
[0110] Optionally, the method also includes: S450, if the preset condition is not met, performing the next re-meshing operation on the target grid model until the preset condition is met, wherein the next re-meshing operation includes the following steps: S451, merging the first sub-regions after the last re-meshing operation to obtain a new target grid model; S452, segmenting the new target grid model in different segmentation methods to obtain multiple new first sub-regions; S453, for multiple new first sub-regions, performing re-meshing operations on the new first sub-regions in turn.
[0111] Specifically, S453 is similar to S430 and will not be repeated here.
[0112] Specifically, when a preset condition is met, it is determined that the re-meshing operation on the target mesh model is ended. Thus, the re-meshing operation on the target mesh model is completed.
[0113] It is understandable that by setting different segmentation modes in different remeshing processes, the first sub-regions in different remeshing processes can be made more different, thereby more fully remeshing the target mesh model.
[0114] It can also be understood that by setting the target mesh model to be re-meshed multiple times, the adequacy of the re-meshing operation on the target mesh model can be improved.
[0115] Optionally, after S450, the following may be further included: S450, merging the first sub-region after the last remeshing operation, so as to obtain a target mesh model after the remeshing operation (or the target mesh model after the remeshing operation is completed).
[0116] Further optionally, after S450, it also includes: segmenting the target mesh model after the re-meshing operation to obtain multiple second sub-regions, wherein the difference in the number of triangular facets included in different second sub-regions is less than a second preset threshold; for the multiple second sub-regions, performing the second target processing operation on the second sub-regions in turn.
[0117] The disclosed embodiment can perform re-meshing operations on the target grid model in different regions (or blocks), so that each time the re-meshing operation is performed, the object targeted is the first sub-region with a smaller amount of data, rather than the complete target grid model with a larger amount of data. In this way, the memory peak when the re-meshing operation is performed on the target grid model can be optimized, the algorithm memory pressure of the re-meshing operation on the target grid model can be reduced, and the risk of processing exceptions can be reduced.
[0118] FIG5 is a schematic diagram of a grid model processing device provided by an embodiment of the present disclosure. The grid model processing device can be understood as the above-mentioned electronic device or a portion of the functional modules in the above-mentioned electronic device. As shown in FIG5 , the grid model processing device 500 includes:
[0119] A first acquisition module 510 is configured to acquire a target mesh model including a plurality of triangular facets;
[0120] A first segmentation module 520 is configured to segment the target grid model to obtain a plurality of first sub-regions;
[0121] The first processing module 530 is configured to perform a first target processing operation on the plurality of first sub-regions in sequence.
[0122] In another embodiment of the present disclosure, the device further includes:
[0123] A second segmentation module is configured to segment the target grid model after the first target processing operation to obtain a plurality of second sub-regions, or to use the plurality of first sub-regions after the first target processing operation as a plurality of second sub-regions;
[0124] The second processing module is configured to perform a second target processing operation on the plurality of second sub-regions in sequence.
[0125] In another embodiment of the present disclosure, a difference in the number of triangular facets included in different first sub-areas is less than a first preset threshold; and / or a difference in the number of triangular facets included in different second sub-areas is less than a second preset threshold;
[0126] In another embodiment of the present disclosure, the first target processing operation is one of the following processing operations, and the second target processing operation is one of the following processing operations that is different from the first target processing operation: a simplification processing operation, a denoising processing operation, a re-gridding processing operation, a hole filling processing operation, a smoothing processing operation, and a de-spike processing operation.
[0127] In another embodiment of the present disclosure, the first processing module 530 may include:
[0128] a first processing submodule configured to perform a simplification processing operation on the inner areas of the first sub-areas in sequence for the plurality of the first sub-areas;
[0129] The second processing submodule is configured to perform a simplification processing operation on the connection area, wherein the first sub-area includes an outer area surrounding the inner area, and the connection area is an area formed by connecting adjacent outer areas.
[0130] In another embodiment of the present disclosure, the first processing module 530 may include:
[0131] The third processing submodule is configured to perform the following steps on the first subregions in sequence for denoising the plurality of the first subregions: expanding the first subregion by a preset number of triangles to obtain a third subregion, and iteratively updating the normal vectors and vertex coordinates of the triangles in the first subregion based on the normal vectors and vertex coordinates of the triangles in the third subregion;
[0132] The fourth processing submodule is configured to perform weighted sum processing on the vertex coordinates of common vertices belonging to different first sub-regions, to obtain vertex coordinates corresponding to the common vertices.
[0133] In another embodiment of the present disclosure, the first processing module 530 may include:
[0134] a fourth processing submodule configured to, for each of the plurality of first subregions, sequentially perform the following steps on the first subregions to perform a remeshing operation: initializing metric values of vertices of triangular facets within the first subregions, and updating the topological structure and vertex coordinates of the triangular facets within the first subregions based on the metric values, wherein the metric values include at least one of the following: curvature magnitude, average edge length, and number of edges connected to the vertex;
[0135] The first processing submodule is configured to determine that the re-gridding operation on the target grid model is completed if a preset condition is met.
[0136] In another embodiment of the present disclosure, the first processing module 530 may further include:
[0137] The first processing submodule is configured to, if the preset condition is not met, perform a next re-gridding operation until the preset condition is met, wherein the next re-gridding operation includes the following steps:
[0138] Merge the first sub-region after the last re-gridding operation to obtain a new target grid model;
[0139] Segmenting the new target grid model in different segmentation modes to obtain a plurality of new first sub-regions;
[0140] For the multiple new first sub-regions, re-gridding operations are performed on the new first sub-regions in sequence.
[0141] The device provided in this embodiment can execute the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.
[0142] An embodiment of the present disclosure further provides an electronic device, comprising: a memory storing a computer program; and a processor for executing the computer program. When the computer program is executed by the processor, the method of any of the above embodiments can be implemented.
[0143] For example, FIG6 is a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. Specific reference is made below to FIG6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing an embodiment of the present disclosure. The electronic device 600 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG6 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0144] As shown in Figure 6, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0145] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 shows the electronic device 600 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0146] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0147] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0148] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0149] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0150] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is enabled to: obtain a target mesh model including multiple triangular facets; divide the target mesh model to obtain multiple first sub-regions; and perform first target processing operations on the multiple first sub-regions in sequence.
[0151] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0152] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0153] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.
[0154] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0155] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0156] The embodiments of the present disclosure further provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.
[0157] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0158] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein. Industrial Applicability
[0159] In the mesh model processing method provided in the present disclosure, a target mesh model including multiple triangular facets is obtained; the target mesh model is segmented to obtain multiple first sub-regions; and the first target processing operation is performed on the multiple first sub-regions in turn. The first target processing operation can be performed on the target mesh model in regions (or blocks), so that each time the first target processing operation is performed, the object targeted is the first sub-region with a smaller amount of data, rather than the complete target mesh model with a huge amount of data. In this way, the memory peak when the first target processing operation is performed on the target mesh model can be optimized, the algorithm memory pressure when the first target processing operation is performed on the target mesh model can be reduced, and the risk of processing exceptions can be reduced, which has strong industrial practicality.
Claims
1. A method for processing a grid model, wherein: include: Acquire a target mesh model including a plurality of triangular facets; Segmenting the target grid model to obtain a plurality of first sub-regions; For the plurality of first sub-regions, the first target processing operation is performed on the first sub-regions in sequence.
2. The method according to claim 1, wherein: Also includes: Segmenting the target grid model after the first target processing operation to obtain a plurality of second sub-regions, or using the plurality of first sub-regions after the first target processing operation as a plurality of second sub-regions; For the plurality of second sub-regions, the second target processing operation is performed on the second sub-regions in sequence.
3. The method according to claim 2, wherein: The difference in the number of triangular facets included in different first sub-areas is less than a first preset threshold; and / or; A difference in the number of triangular facets included in different second sub-regions is smaller than a second preset threshold.
4. The method according to claim 2, wherein: The first target processing operation is one of the following processing operations, and the second target processing operation is one of the following processing operations that is different from the first target processing operation: Simplification processing operation, denoising processing operation, re-meshing processing operation, hole filling processing operation, smoothing processing operation, and spike removal processing operation.
5. The method according to claim 1, wherein: The step of sequentially performing a first target processing operation on the first sub-regions includes: For the plurality of first sub-regions, sequentially perform a simplification processing operation on the inner regions of the first sub-regions; For the connection area, a simplification operation is performed on the connection area, wherein the first sub-area includes an external area surrounding the internal area, and the connection area is an area formed by connecting adjacent external areas.
6. The method according to claim 1, wherein: The step of sequentially performing a first target processing operation on the first sub-regions includes: For the plurality of first sub-regions, the following steps are sequentially performed on the first sub-regions to perform a denoising operation: the first sub-region is expanded by a preset number of triangular facets to obtain a third sub-region, and the normal vectors and vertex coordinates of the triangular facets in the first sub-region are iteratively updated based on the normal vectors and vertex coordinates of the triangular facets in the third sub-region; For common vertices belonging to different first sub-regions, weighted sum processing is performed on vertex coordinates of the common vertex in each of the first sub-regions to which the common vertex belongs, so as to obtain vertex coordinates corresponding to the common vertex.
7. The method according to claim 1, wherein: The step of performing a first target processing operation on each of the first sub-regions in sequence for the plurality of the first sub-regions includes: For the plurality of first sub-regions, the following steps are sequentially performed on the first sub-regions to perform a remeshing operation: initializing the metric values of the vertices of the triangular facets in the first sub-regions, and updating the topological structure and vertex coordinates of the triangular facets in the first sub-regions based on the metric values, wherein the metric values include at least one of the following: curvature magnitude, average side length, and number of sides connected to the vertices; If the preset conditions are met, it is determined that the re-meshing operation for the target mesh model is completed.
8. The method according to claim 7, wherein: Also includes: If the preset condition is not met, the next re-gridding process is performed until the preset condition is met, wherein the next re-gridding process comprises the following steps: Merge the first sub-region after the last re-gridding operation to obtain a new target grid model; Segmenting the new target grid model in different segmentation modes to obtain a plurality of new first sub-regions; For the multiple new first sub-regions, re-gridding operations are performed on the new first sub-regions in sequence.
9. A processing device for a grid model, wherein: include: A first acquisition module is configured to acquire a target mesh model including a plurality of triangular facets; A first segmentation module is configured to segment the target grid model to obtain a plurality of first sub-regions; The first processing module is configured to perform a first target processing operation on the first sub-regions in sequence.
10. An electronic device, wherein: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Triangular mesh segmentation and denoising method
CN112085750A
Three-dimensional model data processing method and system, storage medium and electronic equipment
CN116188721A
Three-dimensional model processing method and device, electronic equipment and medium
CN116977530A
Mesh model processing method and device, electronic equipment and medium
CN116977604A
Mesh model processing method and device, equipment and storage medium
CN117765166A
Cited By
Data vectorization operation method and device, equipment, storage medium and program
CN121564358A
Cross-Tile three-dimensional model water area restoration method and electronic equipment
CN121746627A