Geometric normal image generation method, reconstruction method, device, equipment and medium
By constructing a relaxation function and rasterization to generate geometric normal images, the problem of low generation efficiency in existing technologies is solved, and efficient and reliable image generation and reconstruction are achieved.
Patent Information
- Application Number
- CN202510116495.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-01-24
AI Technical Summary
The existing process for generating geometric normal images is cumbersome, resulting in low generation efficiency and susceptibility to human intervention.
By acquiring the 3D surface mesh of the 3D model, a relaxation function is constructed, relaxation operations are performed round by round and the number of iterations is recorded, and a geometric normal image is generated after rasterization. Image reconstruction is then performed using Gaussian convolution kernels and least squares optimization methods.
It improves the efficiency of geometric normal image generation, reduces generation time, enhances image reliability and quality, and avoids the impact of human intervention.
Smart Images

Figure CN120047526B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information technology, and in particular to a geometric normal image generation method, a reconstruction method, a device, equipment and a medium. BACKGROUND
[0002] Geometric normal images play an important role in scene rendering of three-dimensional games, production of film special effects, and experience optimization of virtual reality. Because geometric normal images can improve rendering effects by simulating surface details without increasing geometric complexity, rendering quality can be ensured and the demand for computing resources can be reduced.
[0003] However, the existing geometric normal image generation process is cumbersome, which is not conducive to improving the generation efficiency of geometric normal images. The reason is that the existing technology mainly adopts a manual operation method to generate geometric normal images, and the manual generation method consumes a large amount of human resources and time resources, increases the generation time of geometric normal images, and is easily affected by human intervention, thus being not conducive to improving the generation efficiency of geometric normal images. SUMMARY
[0004] The present application provides a geometric normal image generation method, device, computer equipment and storage medium to solve the technical problem that the existing geometric normal image generation process is cumbersome and not conducive to improving the generation efficiency of geometric normal images.
[0005] In a first aspect, the present application provides a geometric normal image generation method, comprising:
[0006] obtaining a three-dimensional surface mesh of a three-dimensional model, and obtaining normal information corresponding to each mesh surface in the three-dimensional surface mesh;
[0007] constructing a relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction method;
[0008] applying the relaxation function to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, performing relaxation operation round by round and recording the number of iterations;
[0009] stopping the relaxation operation when the number of iterations meets a preset condition, and obtaining a relaxed three-dimensional surface mesh;
[0010] performing rasterization processing on the relaxed three-dimensional surface mesh, and obtaining a two-dimensional image;
[0011] generating a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image.
[0012] Further, the constructing a relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction method comprises:
[0013] obtaining a configuration file, reading a Gaussian kernel in the configuration file;
[0014] constructing a relaxation function according to the normal information corresponding to each mesh surface in the three-dimensional surface mesh and the Gaussian kernel.
[0015] Further, the relaxation function is applied to the three-dimensional surface mesh according to the set iteration interval and iteration amplitude, and the relaxation operation is performed round by round and the iteration number is recorded, including:
[0016] obtaining a relaxation factor and an update amount, and selecting a product of the relaxation factor and the update amount as the iteration amplitude;
[0017] The relaxation function is applied to the three-dimensional surface mesh according to the set iteration interval and iteration amplitude, and the relaxation operation is performed round by round and the iteration number is recorded.
[0018] Further, when the iteration number meets a preset condition, the relaxation operation is stopped, and a relaxed three-dimensional surface mesh is obtained, including:
[0019] When the iteration number is a target number, a stop instruction is obtained;
[0020] The stop instruction is executed to stop the relaxation operation, and a three-dimensional surface mesh after relaxation processing is obtained.
[0021] Further, the relaxed three-dimensional surface mesh is rasterized to obtain a two-dimensional image, including:
[0022] The relaxed three-dimensional surface mesh is rasterized by a preset rasterization algorithm to obtain a plurality of pixel segments;
[0023] The plurality of pixel segments are saved, a synthesis instruction is obtained, and the plurality of pixel segments are synthesized into a two-dimensional image by executing the synthesis instruction.
[0024] Further, the geometric normal image is generated based on the normal information corresponding to each mesh surface and the two-dimensional image, including:
[0025] The normal information corresponding to each mesh surface is written into the pixel information of the two-dimensional image to obtain modified pixel information of the two-dimensional image;
[0026] The geometric normal image is generated according to the modified pixel information of the two-dimensional image.
[0027] In a second aspect, the application provides a reconstruction method, including:
[0028] The geometric normal image is acquired, data information in the geometric normal image is read, normal information corresponding to each mesh surface and vertex information corresponding to each mesh surface are acquired from the data information, center coordinate information corresponding to each mesh surface is determined according to the vertex information corresponding to each mesh surface, the center coordinate information corresponding to each mesh surface and the normal information corresponding to each mesh surface are processed by using a preset projection position data generation model, and projection position data of each vertex on a target plane is obtained. The adjusted projection position data of each vertex on the target plane is subjected to a global fusion operation by using a least square optimization method, and a reconstruction result is generated.
[0029] In a third aspect, the present application provides a geometric normal image generation device, comprising:
[0030] A first acquisition module is configured to acquire a three-dimensional surface mesh of a three-dimensional model and acquire normal information corresponding to each mesh surface in the three-dimensional surface mesh.
[0031] A construction module is configured to construct a relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction manner.
[0032] An iteration module is configured to apply the relaxation function to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, perform relaxation operation round by round, and record an iteration number.
[0033] A reading module is configured to stop the relaxation operation when the iteration number meets a preset condition and obtain a relaxed three-dimensional surface mesh.
[0034] A processing module is configured to perform rasterization processing on the relaxed three-dimensional surface mesh and obtain a two-dimensional image.
[0035] A generation module is configured to generate a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image.
[0036] In a fourth aspect, the present application provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above geometric normal image generation method are implemented.
[0037] In a fifth aspect, the present application provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the above geometric normal image generation method are implemented.
[0038] This application provides a method, apparatus, computer device, and storage medium for generating geometric normal images. The method involves acquiring a 3D surface mesh of a 3D model and obtaining the normal information corresponding to each mesh face. Based on the normal information of each mesh face and a predefined construction method, a relaxation function is constructed. The relaxation function is applied to the 3D surface mesh according to a set iteration interval and iteration range, performing relaxation operations round by round and recording the number of iterations. When the number of iterations meets a preset condition, the relaxation operation is stopped, resulting in a relaxed 3D surface mesh. The relaxed 3D surface mesh is then rasterized to obtain a 2D image. Based on the normal information and the 2D image corresponding to each mesh face, a geometric normal image is generated. The advantages are twofold: firstly, rasterizing the relaxed 3D surface mesh to obtain a 2D image and generating a geometric normal image based on the normal information and the 2D image reduces the generation time of the geometric normal image, thus improving its generation efficiency; secondly, since the geometric normal image is automatically generated, it is not affected by human intervention, thus improving the reliability of the geometric normal image. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a schematic diagram illustrating the application environment of the geometric normal image generation method in one embodiment of the present invention;
[0041] Figure 2 This is a schematic flowchart of a geometric normal image generation method provided in an embodiment of the present invention;
[0042] Figure 3 yes Figure 2 A flowchart illustrating step S23;
[0043] Figure 4 yes Figure 2 A flowchart illustrating step S25;
[0044] Figure 5 This is a schematic flowchart of a reconstruction method provided in an embodiment of the present invention;
[0045] Figure 6 This is a schematic diagram of the structure of a geometric normal image generation device in one embodiment of the present invention;
[0046] Figure 7is a structural schematic diagram of a computer device in an embodiment of the present application;
[0047] Figure 8 is a segmentation map of a three-dimensional surface network provided by an embodiment of the present application;
[0048] Figure 9 is an example diagram of a geometric normal image provided by an embodiment of the present application;
[0049] Figure 10 is an example diagram of a reconstruction result provided by an embodiment of the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0051] Please refer to Figure 1 , Figure 1 is an application environment schematic diagram of a geometric normal image generation method in an embodiment of the present application. The geometric normal image generation method provided by the embodiment of the present application can be applied in an application environment as Figure 1 , wherein the client communicates with the server through the network.
[0052] The server obtains a three-dimensional surface mesh of a three-dimensional model through the client, and obtains normal information corresponding to each mesh surface in the three-dimensional surface mesh;
[0053] Based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction mode, a relaxation function is constructed;
[0054] According to a set iteration interval and iteration amplitude, the relaxation function is applied to the three-dimensional surface mesh, and a relaxation operation is performed round by round and the iteration number is recorded;
[0055] When the iteration number meets a preset condition, the relaxation operation is stopped, and a relaxed three-dimensional surface mesh is obtained;
[0056] The relaxed three-dimensional surface mesh is rasterized to obtain a two-dimensional image;
[0057] Based on the normal information corresponding to each mesh surface and the two-dimensional image, a geometric normal image is generated.
[0058] In the scheme implemented by the above geometric normal image generation method, device, equipment and medium, the beneficial effects are in two aspects. On the one hand, the relaxed three-dimensional surface grid is rasterized to obtain a two-dimensional image; based on the normal information corresponding to each grid surface and the two-dimensional image, a geometric normal image is generated. Since no manual operation is required, the generation time of the geometric normal image is reduced, and the generation efficiency of the geometric normal image is improved. On the other hand, since the geometric normal image is automatically generated and is not affected by manual intervention, the reliability of the geometric normal image is improved.
[0059] Among them, the device running the client is referred to as: client device.
[0060] Among them, the device running the server is referred to as: server device.
[0061] Among them, the client device includes but is not limited to a smart phone, a personal computer, a vehicle Internet of Things terminal, a tablet computer and a portable wearable device.
[0062] Among them, the server device can be implemented by an independent server or a server cluster composed of multiple servers.
[0063] The application will be described in detail below through specific embodiments.
[0064] Please refer to Figure 2 , Figure 2 is a flowchart of a geometric normal image generation method provided by an embodiment of the application, including the following steps:
[0065] S21, obtaining a three-dimensional surface grid of a three-dimensional model, and obtaining normal information corresponding to each grid surface in the three-dimensional surface grid;
[0066] Among them, the three-dimensional surface grid of the three-dimensional model is an important component of the three-dimensional model, and the three-dimensional surface grid is composed of a large number of basic geometric units. These units are usually triangles or quadrilaterals, and the triangles or quadrilaterals are connected to form a network structure covering the surface of a three-dimensional object.
[0067] S22, constructing a relaxation function based on the normal information corresponding to each grid surface in the three-dimensional surface grid and a predefined construction method;
[0068] Among them, the relaxation function is constructed based on the normal information corresponding to each grid surface in the three-dimensional surface grid and the predefined construction method, including:
[0069] Obtaining a configuration file and reading a Gaussian convolution kernel in the configuration file;
[0070] According to the normal information corresponding to each grid surface in the three-dimensional surface grid and the Gaussian convolution kernel, the relaxation function is constructed.
[0071] Exemplarily, the relaxation function is:
[0072] G(N)=conv(N,type);
[0073] wherein G(N) is the relaxation function, conv is a convolution operation, type is a Gaussian kernel, and N is a serial number representing normal information corresponding to an Nth mesh surface in a three-dimensional mesh.
[0074] The Gaussian kernel is a filter. The Gaussian kernel defines the weights of the convolution kernel using a Gaussian function. The Gaussian function has the characteristic that the weight of the center point is the largest, and the weight gradually decreases as the distance from the center point increases, until it approaches zero. This weight distribution enables the Gaussian kernel to effectively smooth the image and reduce noise while preserving the main features of the image when performing image convolution operations.
[0075] S23, applying the relaxation function to the three-dimensional surface mesh according to the set iteration interval and iteration amplitude, performing relaxation operation round by round and recording the number of iterations;
[0076] Exemplarily, applying the relaxation function to the three-dimensional surface mesh according to the set iteration interval and iteration amplitude, performing relaxation operation round by round and recording the number of iterations, comprises:
[0077] wherein the relaxation function is applied to the three-dimensional surface mesh according to the set iteration interval and iteration amplitude, and in each round, the three-dimensional surface mesh is relaxed by the relaxation function, and the number of iterations of the relaxation operation is recorded.
[0078] The iteration interval refers to the interval between each iteration in terms of time or steps, and determines the frequency of algorithm updates.
[0079] The iteration amplitude refers to the amplitude of parameter or state update at each iteration, reflecting the step size of the algorithm in the search space.
[0080] S24, when the number of iterations meets the preset condition, stopping the relaxation operation to obtain the relaxed three-dimensional surface mesh;
[0081] wherein the relaxation operation is stopped when the number of iterations meets the preset condition to obtain the relaxed three-dimensional surface mesh, comprising:
[0082] When the number of iterations is the target number, a stop instruction is obtained;
[0083] The stop instruction is executed to stop the relaxation operation and obtain the three-dimensional surface mesh after relaxation.
[0084] Exemplarily, the stop instruction is executed, the relaxation operation is stopped, and the three-dimensional surface mesh after the relaxation processing is obtained, including:
[0085] The stop instruction is executed, the relaxation operation is stopped, the relaxation result obtained by each round of execution of the relaxation operation is obtained, the relaxation results obtained by each round of execution of the relaxation operation are combined, and the three-dimensional surface mesh after the relaxation operation is obtained.
[0086] The three-dimensional surface mesh after the relaxation processing is the combination of all rounds of relaxation operations.
[0087] When the iteration number is the target number, the stop instruction is obtained. Since the relaxation operation is stopped after reaching the predetermined target number, unnecessary calculation is avoided, and the calculation amount of the relaxation operation is reduced.
[0088] S25, rasterizing the three-dimensional surface mesh after the relaxation to obtain a two-dimensional image;
[0089] The three-dimensional surface mesh after the relaxation processing becomes smoother and more continuous, and the two-dimensional image projected or rendered to the two-dimensional plane from the three-dimensional surface mesh after the relaxation processing also exhibits higher visual quality, so that the two-dimensional image looks more natural and delicate.
[0090] In addition, the three-dimensional surface mesh after the relaxation processing has undergone multiple relaxation processes, which can reduce unnecessary distortion or deformation. Therefore, the two-dimensional image projected to the two-dimensional plane from the three-dimensional surface mesh after the relaxation processing is beneficial to reduce the geometric distortion generated in the three-dimensional to two-dimensional conversion process, thereby maintaining the accuracy of the shape and proportion of the object in the two-dimensional image.
[0091] S26, generating a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image.
[0092] The generation of the geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image includes:
[0093] The normal information corresponding to each mesh surface is written into the pixel information of the two-dimensional image to obtain the pixel information of the modified two-dimensional image;
[0094] The geometric normal image is generated according to the pixel information of the modified two-dimensional image.
[0095] Exemplarily, the generation of the geometric normal image according to the pixel information of the modified two-dimensional image includes:
[0096] The pixel information of the modified two-dimensional image is input into a rendering engine, the pixel information of the modified two-dimensional image is processed by the rendering engine, and the geometric normal image is generated.
[0097] In the embodiment of the present application, the beneficial effects are in two aspects. On the one hand, the relaxed three-dimensional surface grid is rasterized to obtain a two-dimensional image, and based on the normal information corresponding to each grid surface and the two-dimensional image, a geometric normal image is generated. Since no manual operation is required, the generation time of the geometric normal image is reduced, and the generation efficiency of the geometric normal image is improved. On the other hand, since the geometric normal image is automatically generated and is not affected by manual intervention, the reliability of the geometric normal image is improved.
[0098] Please refer to Figure 3 , Figure 3 is Figure 2 The flowchart of step S23 in
[0099] S31, obtain the relaxation factor and the update amount, and select the product of the relaxation factor and the update amount as the iteration amplitude;
[0100] The relaxation factor is a value between 0 and 1, which is used to adjust the iteration amplitude. When the relaxation factor is close to 0, it means that the iteration amplitude in each iteration is small, and the relaxation function tends to converge slowly.
[0101] When the relaxation factor is close to 1, the iteration amplitude in each iteration is large, and the convergence speed of the relaxation function may be accelerated.
[0102] S32, apply the relaxation function to the three-dimensional surface grid according to the set iteration interval and iteration amplitude, and perform relaxation operation round by round and record the iteration number. Exemplarily, the relaxation function is applied to the three-dimensional surface grid according to the set iteration interval and iteration amplitude, and the relaxation operation is performed round by round and the iteration number is recorded, including:
[0103] The relaxation function is applied to the three-dimensional surface grid according to the set iteration interval and iteration amplitude, and in each round, the relaxation function is used to perform relaxation operation on the three-dimensional surface grid, and the iteration number of the relaxation operation is recorded.
[0104] The iteration interval is such that in each iteration, each point in the input space can be uniquely transformed into a point in the output space, and this transformation process is reversible, that is, each point in the output space can be uniquely transformed back to a point in the input space, so the entire iteration process is reversible. This means that no matter how many iterations are performed, it can be accurately traced back to any point in the iteration sequence by inversely applying the same iteration rule and interval.
[0105] In the embodiment of the present application, in combination with the optimization of the iteration interval and amplitude, the error accumulation and computational complexity in the iteration process can also be better controlled, so that the iteration method is more efficient and reliable when processing three-dimensional surface grids.
[0106] Referring to Figure 4 , Figure 4 is Figure 2 a flowchart of step S25 in the method, which is described as follows:
[0107] S41, rasterize the relaxed three-dimensional surface mesh through a preset rasterization algorithm to obtain a plurality of pixel segments;
[0108] The relaxation processing can optimize the mesh structure of the three-dimensional surface mesh, reduce redundancy and complexity, and make the rasterization process more smooth and efficient. Through the rasterization processing, the three-dimensional surface mesh after the relaxation processing can be converted into a series of pixel segments, each of which contains the projection information of the three-dimensional surface mesh after the relaxation processing on a two-dimensional plane and the corresponding depth.
[0109] S42, save the plurality of pixel segments, obtain a synthesis instruction, execute the synthesis instruction, and synthesize the plurality of pixel segments into a two-dimensional image.
[0110] In the embodiment of the application, the synthesis instruction is obtained, the synthesis instruction is executed, and the plurality of pixel segments are synthesized into a two-dimensional image. The two-dimensional image serves as a carrier of the three-dimensional surface mesh and has the advantages of convenient storage, transmission and processing. Compared with the three-dimensional surface mesh, the two-dimensional image occupies less storage space, has a faster transmission speed, and has a higher processing efficiency. In this way, efficient data exchange and information sharing can be realized under limited resource conditions.
[0111] Referring to Figure 5 , Figure 5 is a flowchart of the reconstruction method provided by an embodiment of the application, which is described as follows:
[0112] S51, obtain a geometric normal image, read data information in the geometric normal image, and obtain normal information corresponding to each mesh surface and vertex information corresponding to each mesh surface from the data information;
[0113] The normal information corresponding to the mesh surface is a vector, and the vector is perpendicular to the mesh surface.
[0114] S52, determine center coordinate information corresponding to each mesh surface according to the vertex information corresponding to each mesh surface;
[0115] S53, process the center coordinate information corresponding to each mesh surface and the normal information corresponding to each mesh surface through a preset projection position data generation model to obtain projection position data of each vertex on a target plane;
[0116] Exemplarily, the projection position data generation model is:
[0117]
[0118] wherein p i,i (v k,L ) represents the projection position data of vertex v k,k on the target plane, vertex v k,k has a row index k, and vertex v k,k has a column index L;
[0119] wherein c(i,j) is the center point of the plane with normal n(i,j);
[0120] wherein c(i,j) is the center coordinate information corresponding to the mesh surface with row index i and column index j, is the z coordinate of the center coordinate information;
[0121] wherein n(i,j) is the normal information corresponding to the mesh surface with row index i and column index j;
[0122] wherein is the x component in the normal n(i,j); is the y component in the normal n(i,j); and
[0123] wherein the projection position data generation model is a generation model of the projection position data.
[0124] wherein the projection position data of each vertex on the target plane reflects the projection of the vertex on a two-dimensional plane, and through the projection position data of each vertex on the target plane, the shape profile of the three-dimensional surface mesh under a specific viewing angle can be preliminarily understood. The specific viewing angle is the observation position and observation direction when observing the three-dimensional surface mesh.
[0125] S54, using a least squares optimization method, performing a global fusion operation on the adjusted projection position data of each vertex on the target plane to generate a reconstruction result.
[0126] Exemplarily, using a least squares optimization method, performing a global fusion operation on the adjusted projection position data of each vertex on the target plane to generate a reconstruction result, comprising:
[0127] using a smoothing algorithm to adjust the projection position data of each vertex on the target plane to obtain the adjusted projection position data of each vertex on the target plane;
[0128] using a least squares optimization method, performing a global fusion operation on the adjusted projection position data of each vertex on the target plane to generate a reconstruction result.
[0129] Wherein, by adopting the smoothing algorithm, the projection position data of each vertex on the target plane is adjusted, so that the surface of the reconstruction result is smoother, local sharp protrusions or depressions are avoided, and the reconstruction result is more in line with the geometric characteristics of the actual object.
[0130] For the sake of illustration, the following examples are given:
[0131] Reference Figure 8 , Figure 8 is a segmentation map of a three-dimensional surface network provided by an embodiment of the present application.
[0132] As Figure 8 shown, the closed three-dimensional surface mesh is segmented into two front and back parts.
[0133] Reference Figure 9 , Figure 9 is an example of a geometric normal image provided by an embodiment of the present application.
[0134] As Figure 9 shown, in the geometric normal image construction stage, the geometric normal image is divided into two front and back parts.
[0135] Reference Figure 10 , Figure 10 is an example of a reconstruction result provided by an embodiment of the present application.
[0136] Figure 10 The reconstruction result is a three-dimensional surface mesh of a three-dimensional model, which has important uses in many aspects. For the sake of illustration, the following examples are given:
[0137] For example, in game development, character roles, buildings, props and other elements can be constructed by three-dimensional surface meshes, and by giving different textures and lighting conditions, players can be immersed in a virtual world full of details and realism.
[0138] For example, in industrial design and manufacturing, three-dimensional surface meshes can assist designers in product design evaluation and modification. Designers can check whether the shape of the product meets the design requirements, whether there are interferences or unsmooth surfaces, and can easily measure and modify the size to ensure the design optimization of the product before actual manufacturing, avoiding problems in the subsequent manufacturing process.
[0139] In the embodiments of the present application, since the bijectivity is guaranteed by each round of relaxation of the three-dimensional surface mesh when constructing the geometric normal image, this process is reversible, and the reconstruction result, which is a three-dimensional surface mesh of a three-dimensional model, can be obtained by combining all rounds of reconstruction, so the present application can reconstruct a three-dimensional surface mesh from a geometric normal image.
[0140] Please refer toFigure 6 , Figure 6 is a structural schematic diagram of a geometric normal image generation device in an embodiment of the present application, as shown in the figure, the geometric normal image generation device comprises a first acquisition module 101, a construction module 102, an iteration module 103, a reading module 104, a processing module 105, and a generation module 106. The detailed description of each functional module is as follows: Figure 6
[0141] The first acquisition module 101 is configured to acquire a three-dimensional surface mesh of a three-dimensional model and acquire normal information corresponding to each mesh surface in the three-dimensional surface mesh.
[0142] The construction module 102 is configured to construct a relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction method.
[0143] The iteration module 103 is configured to apply the relaxation function to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, perform relaxation operation round by round, and record the number of iterations.
[0144] The reading module 104 is configured to stop the relaxation operation when the number of iterations meets a preset condition and obtain a relaxed three-dimensional surface mesh.
[0145] The processing module 105 is configured to perform rasterization processing on the relaxed three-dimensional surface mesh and obtain a two-dimensional image.
[0146] The generation module 106 is configured to generate a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image.
[0147] In the embodiment of the present application, the beneficial effects are in two aspects. On the one hand, the rasterization processing is performed on the relaxed three-dimensional surface mesh to obtain a two-dimensional image, and the geometric normal image is generated based on the normal information corresponding to each mesh surface and the two-dimensional image. Since no manual operation is required, the generation time of the geometric normal image is reduced, and the generation efficiency of the geometric normal image is improved. On the other hand, since the geometric normal image is automatically generated, it is not affected by manual intervention, and the reliability of the geometric normal image is improved.
[0148] The specific limitations of the geometric normal image generation device can be referred to the limitations of the geometric normal image generation method in the foregoing, which will not be repeated here.
[0149] Each module in the geometric normal image generation device described above can be realized by software, hardware, and a combination thereof in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above modules.
[0150] Referring to Figure 7 , Figure 7 is a structural schematic diagram of a computer device in an embodiment of the present application. In an embodiment, a computer device is provided, which is a server device or a client device, and its internal structure diagram can be as shown in Figure 7 . The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is used to communicate with external devices. The computer program, when executed by the processor, can implement the functions or steps of a geometric normal image generation method.
[0151] In an embodiment, a computer device is provided, including a memory, a processor and a computer program stored on the memory and executable on the processor. The processor implements the following steps when executing the computer program:
[0152] obtaining a three-dimensional surface mesh of a three-dimensional model, and obtaining normal information corresponding to each mesh surface in the three-dimensional surface mesh;
[0153] constructing a relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction method;
[0154] applying the relaxation function to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, performing relaxation operation round by round and recording the number of iterations;
[0155] stopping the relaxation operation when the number of iterations meets a preset condition, and obtaining a relaxed three-dimensional surface mesh;
[0156] performing rasterization processing on the relaxed three-dimensional surface mesh, and obtaining a two-dimensional image;
[0157] generating a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image.
[0158] In some embodiments, the processor is configured to implement:
[0159] obtain a configuration file, and read a Gaussian convolution kernel in the configuration file;
[0160] construct a relaxation function according to the normal information corresponding to each mesh surface in the three-dimensional surface mesh and the Gaussian convolution kernel.
[0161] In some embodiments, the processor is configured to implement:
[0162] obtain the relaxation factor and the update amount, and select a product of the relaxation factor and the update amount as an iteration amplitude;
[0163] apply the relaxation function to the three-dimensional surface grid according to the set iteration interval and the iteration amplitude, perform the relaxation operation round by round, and record the iteration number.
[0164] In some embodiments, the processor is configured to implement:
[0165] obtain a stop instruction when the iteration number is a target number;
[0166] execute the stop instruction to stop the relaxation operation, and obtain the three-dimensional surface grid after the relaxation processing.
[0167] In some embodiments, the processor is configured to implement:
[0168] perform rasterization processing on the three-dimensional surface grid after the relaxation by using a preset rasterization algorithm to obtain a plurality of pixel segments;
[0169] save the plurality of pixel segments, obtain a synthesis instruction, and execute the synthesis instruction to synthesize the plurality of pixel segments into one two-dimensional image.
[0170] In some embodiments, the processor is configured to implement:
[0171] write the normal information corresponding to each grid face into the pixel information of the two-dimensional image to obtain modified pixel information of the two-dimensional image;
[0172] generate a geometric normal image according to the modified pixel information of the two-dimensional image.
[0173] In some embodiments, the processor is configured to implement:
[0174] obtain the geometric normal image, read data information in the geometric normal image, and obtain the normal information corresponding to each grid face and the vertex information corresponding to each grid face from the data information;
[0175] determine the center coordinate information corresponding to each grid face according to the vertex information corresponding to each grid face;
[0176] process the center coordinate information corresponding to each grid face and the normal information corresponding to each grid face by using a preset projection position data generation model to obtain projection position data of each vertex on a target plane;
[0177] perform global fusion operation on the adjusted projection position data of each vertex on the target plane by using a least square optimization method to generate a reconstruction result.
[0178] The processor described above can be a general processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP); can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0179] The embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps in each method embodiment described above.
[0180] The computer readable storage medium stores program codes, and the program codes can be called and executed by the processor to execute the geometric normal image generation method in the method embodiments.
[0181] The computer readable storage medium has a storage space of the program codes.
[0182] The program codes include codes of any steps in the geometric normal image generation method described in the method embodiments. For example, the program codes are called by the processor, and the following steps can be executed:
[0183] Obtaining a three-dimensional surface mesh of a three-dimensional model, and obtaining normal information corresponding to each mesh surface in the three-dimensional surface mesh;
[0184] Based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction mode, a relaxation function is constructed;
[0185] According to a set iteration interval and iteration amplitude, the relaxation function is applied to the three-dimensional surface mesh, the relaxation operation is performed round by round, and the iteration number is recorded;
[0186] When the iteration number meets a preset condition, the relaxation operation is stopped, and a relaxed three-dimensional surface mesh is obtained;
[0187] The relaxed three-dimensional surface mesh is rasterized to obtain a two-dimensional image;
[0188] Based on the normal information corresponding to each mesh surface and the two-dimensional image, a geometric normal image is generated.
[0189] The program code also includes code for any of the steps in the reconstruction method described in the method embodiments above. For example, the program code is invoked by a processor and can perform the following steps:
[0190] obtaining a geometry normal image, reading data information in the geometry normal image, from the data information, obtaining normal information corresponding to each mesh surface and vertex information corresponding to each mesh surface;
[0191] determining center coordinate information corresponding to each mesh surface according to the vertex information corresponding to each mesh surface;
[0192] processing the center coordinate information corresponding to each mesh surface and the normal information corresponding to each mesh surface by using a preset projection position data generation model to obtain projection position data of each vertex on a target plane;
[0193] using a least square optimization method to perform global fusion operation on the adjusted projection position data of each vertex on the target plane to generate a reconstruction result.
[0194] The above description and drawings sufficiently illustrate the embodiments of the present disclosure to enable one skilled in the art to practice them. In this document, each embodiment can focus on the differences from other embodiments, and the same or similar parts between embodiments can refer to each other. For the method, product disclosed by the embodiments, if it corresponds to the method part disclosed by the embodiments, the relevant part can refer to the description of the method part.
[0195] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of the present disclosure. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0196] In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses) can be implemented in other manners. For example, the described device embodiments are merely schematic. For example, the division of the units is merely a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some of the components can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms. The unit illustrated as a separate component can or can not be physically separate, and can or can not be a physical component. Some or all of the units can be selected according to actual needs to implement the embodiments. In addition, the units in the embodiments disclosed herein can be integrated into one processing unit, or each unit can exist physically as a separate entity, or two or more units can be integrated into one unit.
[0197] The flowcharts and block diagrams in the drawings show the possible implementation architectures, functions and operations of the system, method and computer program product according to the embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks can occur in different orders than those noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the drawings, the operations or steps corresponding to different blocks can also occur in different orders from those disclosed in the descriptions, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. Each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for generating a geometry normal image, characterized by, The method comprises the following steps: obtaining a three-dimensional surface mesh of a three-dimensional model, and obtaining normal information corresponding to each mesh surface in the three-dimensional surface mesh; constructing a relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction mode; applying the relaxation function to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, performing relaxation operation round by round and recording the number of iterations; stopping the relaxation operation when the number of iterations meets a preset condition, and obtaining a relaxed three-dimensional surface mesh; performing rasterization processing on the relaxed three-dimensional surface mesh to obtain a two-dimensional image; generating a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image; the method of constructing the relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and the predefined construction mode comprises the following steps: obtaining a configuration file, reading a Gaussian convolution kernel in the configuration file, and constructing the relaxation function according to the normal information corresponding to each mesh surface in the three-dimensional surface mesh and the Gaussian convolution kernel; the method of applying the relaxation function to the three-dimensional surface mesh according to the set iteration interval and iteration amplitude, performing relaxation operation round by round and recording the number of iterations comprises the following steps: obtaining a relaxation factor and an update amount, and selecting the product of the relaxation factor and the update amount as the iteration amplitude; applying the relaxation function to the three-dimensional surface mesh according to the set iteration interval and iteration amplitude, performing relaxation operation round by round and recording the number of iterations.
2. The geometry normal image generation method according to claim 1, characterized in that, the method of stopping the relaxation operation when the number of iterations meets the preset condition, and obtaining the relaxed three-dimensional surface mesh comprises the following steps: when the number of iterations is a target number, obtaining a stop instruction; executing the stop instruction to stop the relaxation operation, and obtaining the three-dimensional surface mesh after relaxation processing.
3. The method of generating a geometry normal image according to claim 1, wherein, the method of performing rasterization processing on the relaxed three-dimensional surface mesh to obtain a two-dimensional image comprises the following steps: performing rasterization processing on the relaxed three-dimensional surface mesh by using a preset rasterization algorithm to obtain a plurality of pixel segments; saving the plurality of pixel segments, obtaining a synthesis instruction, executing the synthesis instruction, and synthesizing the plurality of pixel segments into one two-dimensional image.
4. The method of claim 1, wherein, the method of generating a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image comprises the following steps: writing the normal information corresponding to each mesh surface into pixel information of the two-dimensional image to obtain modified pixel information of the two-dimensional image; generating a geometric normal image according to the modified pixel information of the two-dimensional image.
5. A reconstruction method characterized by, The reconstruction method comprises the following steps: obtaining a geometric normal image, reading data information in the geometric normal image, obtaining normal information corresponding to each mesh surface and vertex information corresponding to each mesh surface from the data information, and the geometric normal image is obtained by using the geometric normal image generation method in any one of claims 1 to 4; determining center coordinate information corresponding to each mesh surface according to the vertex information corresponding to each mesh surface; processing the center coordinate information corresponding to each mesh surface and the normal information corresponding to each mesh surface by using a preset projection position data generation model to obtain projection position data of each vertex on a target plane; using a least square optimization method to perform global fusion operation on the adjusted projection position data of each vertex on the target plane to generate a reconstruction result.
6. A geometry normal image generating apparatus characterized by comprising: The method comprises the following steps: The first obtaining module is configured to obtain a three-dimensional surface mesh of a three-dimensional model and obtain normal information corresponding to each mesh surface in the three-dimensional surface mesh; The constructing module is configured to construct a relaxation function based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction manner; The iteration module is configured to apply the relaxation function to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, perform relaxation operation round by round, and record the number of iterations; The reading module is configured to stop the relaxation operation and obtain a relaxed three-dimensional surface mesh when the number of iterations meets a preset condition; The processing module is configured to perform rasterization processing on the relaxed three-dimensional surface mesh and obtain a two-dimensional image; The generating module is configured to generate a geometric normal image based on the normal information corresponding to each mesh surface and the two-dimensional image; The relaxation function is constructed based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and a predefined construction manner, and the method comprises the following steps: The configuration file is obtained, and a Gaussian convolution kernel in the configuration file is read; the relaxation function is constructed based on the normal information corresponding to each mesh surface in the three-dimensional surface mesh and the Gaussian convolution kernel; The relaxation function is applied to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, relaxation operation is performed round by round, and the number of iterations is recorded, and the method comprises the following steps: The relaxation factor and the update amount are obtained, and the product of the relaxation factor and the update amount is selected as the iteration amplitude; The relaxation function is applied to the three-dimensional surface mesh according to a set iteration interval and iteration amplitude, relaxation operation is performed round by round, and the number of iterations is recorded.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the geometric normal image generation method according to any one of claims 1 to 4 or the steps of the reconstruction method according to claim 5.
8. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 7. The computer program is executed by the processor to implement the steps of the geometric normal image generation method according to any one of claims 1 to 4 or the steps of the reconstruction method according to claim 5.
Citation Information
Patent Citations
Three-dimensional surface construction method and device, computer equipment and storage medium
CN114842168A
Use of normal meshes in three-dimensional imaging
US7129947B1