Plane reduction method and device applied to modeling process, storage medium and electronic device
By using a virtual camera in image space to obtain a set of depth values and compare the visibility of triangles, the problem of existing technologies that cannot remove internal triangular faces of the model based on visibility is solved, and accurate face reduction of the three-dimensional model is achieved, improving rendering performance and visual effects.
Patent Information
- Application Number
- CN202510819182.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-09-05
Smart Images

Figure CN120599192A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a face reduction method, device, storage medium, and electronic device applied to a modeling process. Background Art
[0002] 3D models are the core of almost all 3D software, such as games and 3D home design. The quality and performance of the models fundamentally determine the visual effects and rendering performance of the 3D software. Among them, model surface reduction is an important task that concerns both quality and performance. However, the surface reduction of 3D models requires a lot of manpower costs. Usually, the surface reduction work of a model costs 0.5 to 1 person / day depending on the complexity of the model. If the model is particularly complex, this time will increase. The existing surface reduction technology based on the QEM (Quadric Error Metrics, QEM for short) algorithm can only select the triangles to be subtracted based on the degree of impact on the topological structure, and cannot further remove the internal triangles of the model based on the visibility of the triangles.
[0003] Therefore, in the related art, it is impossible to remove the internal triangular faces of the model according to the visibility of the triangular faces, and no effective solution has been proposed yet. Summary of the Invention
[0004] The embodiments of the present application provide a face reduction method, device, storage medium and electronic device applied to a modeling process, so as to at least solve the problem in the related art that the internal triangular faces of the model cannot be removed according to the visibility of the triangular faces.
[0005] According to one embodiment of the embodiments of the present application, a face reduction method applied to a modeling process is provided, including: when the three-dimensional modeling data corresponding to the target object is loaded in the image space, obtaining images of the target object at different perspectives to obtain one or more plane images; identifying the partial image area corresponding to the target object in the multiple plane images, performing a first depth processing on the partial image area to obtain a first depth value set, wherein the first depth processing refers to performing a depth value analysis on each pixel point in the partial image area; performing a second depth processing based on multiple triangles decomposed from the target object in the plane image to obtain a second depth value set, wherein the second depth processing refers to performing a depth calculation on each triangle inside the model; and performing face reduction processing on the modeling triangles contained in the three-dimensional modeling data according to the first depth value set and the second depth value set.
[0006] In an exemplary embodiment, surface reduction processing is performed on modeling triangles contained in three-dimensional modeling data according to a first depth value set and a second depth value set, including: determining the first depth value and the second depth value at corresponding positions of the same modeling triangle from the first depth value set and the second depth value set; comparing the size relationship between the first depth value and the second depth value to obtain a comparison result; determining the triangles to be reduced according to the comparison result, so as to perform surface reduction processing on the modeling triangles contained in the three-dimensional modeling data.
[0007] In an exemplary embodiment, determining the triangle of the surface to be reduced based on the comparison result includes: when the first depth value indicated by the comparison result is less than the second depth value, determining the modeling triangle as the triangle of the surface to be reduced; when the first depth value indicated by the comparison result is greater than or equal to the second depth value, determining the modeling triangle as a triangle not of the surface to be reduced.
[0008] In an exemplary embodiment, after determining that the modeling triangle is the triangle to be reduced, the above method also includes: obtaining the set of triangles to be reduced corresponding to the perspective of each virtual camera to obtain multiple sets of triangles to be reduced; deduplicating the multiple sets of triangles to be reduced to obtain the target set of triangles to be reduced for reducing the three-dimensional modeling data.
[0009] In an exemplary embodiment, a partial image area corresponding to a target object in multiple planar images is identified, and a first depth processing is performed on the partial image area to obtain a first depth value set, including: identifying a target position of the target object on each planar image in the multiple planar images; determining depth values of multiple pixel points that constitute the image area according to the target position to obtain the first depth value set.
[0010] In an exemplary embodiment, a second depth processing is performed based on multiple triangles decomposed from a target object in multiple planar images to obtain a second depth value set, including: obtaining parameter information of multiple preset virtual cameras; and calculating depth values corresponding to the multiple triangles based on the parameter information to obtain the second depth value set.
[0011] In an exemplary embodiment, after the modeling triangles contained in the three-dimensional modeling data are reduced in surface area according to the first depth value set and the second depth value set, the above method further includes: verifying the three-dimensional modeling data after the surface reduction processing and generating a verification result; when the verification result indicates that there are other sets of triangles to be reduced other than the target set of triangles to be reduced among the determined multiple preset virtual cameras, determining to perform secondary surface reduction processing on the three-dimensional modeling data after the surface reduction processing.
[0012] According to another aspect of an embodiment of the present application, a face reduction device applied to a modeling process is also provided, including: an acquisition module, used to acquire images of the target object at different perspectives when the loading of the three-dimensional modeling data corresponding to the target object is completed in the image space, so as to obtain one or more plane images; an identification module, used to identify the partial image area corresponding to the target object in the one or more plane images, perform a first depth processing on the partial image area, and obtain a first depth value set, wherein the first depth processing refers to performing a depth value analysis on each pixel point in the partial image area; a first processing module, used to perform a second depth processing based on multiple triangles decomposed from the target object in the plane image, and obtain a second depth value set, wherein the second depth processing refers to performing a depth calculation on each triangle inside the model; a second processing module, used to perform face reduction processing on the modeling triangles contained in the three-dimensional modeling data according to the first depth value set and the second depth value set.
[0013] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned face reduction method applied to the modeling process through the computer program.
[0014] In an embodiment of the present application, when the three-dimensional modeling data corresponding to the target object is loaded in the image space, multiple preset virtual cameras in the image space are used to respectively obtain images of the target object at different perspectives to obtain multiple plane images; the partial image area corresponding to the target object in the multiple plane images is identified, and the first depth processing is performed on the partial image area to obtain a first depth value set; when the triangle modeling display function is started, a second depth processing is performed based on the multiple triangles decomposed from the target object in the multiple plane images to obtain a second depth value set; and the modeling triangles contained in the three-dimensional modeling data are subjected to face reduction processing according to the first depth value set and the second depth value set. The above technical solution solves the problem of being unable to remove the internal triangular faces of the model based on the visibility of the triangular faces. Furthermore, by comparing and analyzing the depth value of the triangle with the depth value of the model surface, the invisible triangular faces inside the model are identified and eliminated, thereby achieving accurate face reduction of the three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] In order to more clearly illustrate the embodiments of the present application 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.
[0017] Figure 1 1 is a schematic diagram of a hardware environment for a face reduction method applied to a modeling process according to an embodiment of the present application;
[0018] Figure 2 is a flow chart of a face reduction method applied to a modeling process according to an embodiment of the present application;
[0019] Figure 3 is a schematic diagram of a virtual camera array layout according to an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of depth map comparison based on multiple virtual camera perspectives according to an embodiment of the present application;
[0021] Figure 5 is a schematic diagram of a comparison between a model triangle and a depth map of a corresponding position according to an embodiment of the present application;
[0022] Figure 6 is a schematic diagram of automatically removing objects from a model according to an embodiment of the present application;
[0023] Figure 7 is a schematic diagram of automatically removing the inner surface of a model object according to an embodiment of the present application;
[0024] Figure 8 This is a schematic diagram of a process for automatically removing triangular faces inside a model according to an embodiment of the present application;
[0025] Figure 9 This is a structural block diagram of a data visualization device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, device or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, apparatus or apparatus.
[0028] According to one aspect of an embodiment of the present application, a face reduction method for a modeling process is provided. The face reduction method for a modeling process is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the face reduction method for a modeling process can be applied to Figure 1 The hardware environment shown is composed of a terminal device 102 and a server 104. Figure 1 FIG. 1 is a schematic diagram of a hardware environment for a face reduction method applied to a modeling process according to an embodiment of the present application. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0029] The aforementioned network may include, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: WIFI (Wireless Fidelity) and Bluetooth. The terminal device 102 may be, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing machine, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, smart curtains, smart audio and video, a smart socket, a smart speaker, a smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purifier, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0030] In this embodiment, a face reduction method applied to a modeling process is provided, which is applied to the above-mentioned terminal device. Figure 2 : is a flowchart of a face reduction method applied to a modeling process according to an embodiment of the present application, the process including the following steps:
[0031] Step S202: When the three-dimensional modeling data corresponding to the target object is loaded in the image space, images of the target object at different viewing angles are acquired to obtain one or more planar images.
[0032] Step S204: identifying a partial image region corresponding to the target object in the multiple planar images, and performing a first depth processing on the partial image region to obtain a first depth value set, wherein the first depth processing includes performing a depth value analysis on each pixel in the partial image region;
[0033] Step S206, performing a second depth processing based on the multiple triangles decomposed from the target object in the planar image to obtain a second depth value set, wherein the second depth processing refers to performing a depth calculation on each triangle inside the model;
[0034] Step S208 : performing face reduction processing on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set.
[0035] Through the above steps, when the three-dimensional modeling data corresponding to the target object is loaded in the image space, the images of the target object at different perspectives are obtained to obtain one or more plane images; the partial image area corresponding to the target object in the one or more plane images is identified, and the first depth processing is performed on the partial image area to obtain a first depth value set, wherein the first depth processing refers to depth value analysis of each pixel point in the partial image area; a second depth processing is performed based on the multiple triangles decomposed from the target object in the plane image to obtain a second depth value set, wherein the second depth processing refers to depth calculation of each triangle inside the model; and the modeling triangles contained in the three-dimensional modeling data are reduced in face value according to the first depth value set and the second depth value set. The above technical solution solves the problem of being unable to remove the internal triangular faces of the model according to the visibility of the triangular faces. Furthermore, by comparing and analyzing the depth values of the triangles with the depth values of the model surface, the invisible triangular faces inside the model are identified and eliminated, thereby achieving accurate face reduction of the three-dimensional model.
[0036] In an exemplary embodiment, surface reduction processing is performed on modeling triangles contained in three-dimensional modeling data according to a first depth value set and a second depth value set, including: determining the first depth value and the second depth value at corresponding positions of the same modeling triangle from the first depth value set and the second depth value set; comparing the size relationship between the first depth value and the second depth value to obtain a comparison result; determining the triangles to be reduced according to the comparison result, so as to perform surface reduction processing on the modeling triangles contained in the three-dimensional modeling data.
[0037] Optionally, the 3D modeling data of the faucet is loaded into the image processing software, and multiple virtual cameras (for example, 8 looking downward and 8 looking upward) are set around the faucet model to capture depth maps of the model surface from various angles to generate a first depth value set. The triangle modeling display function of the software is started, and the depth value of each triangle in the model under the perspective of each virtual camera is calculated to form a second depth value set. Select any triangle, and find the first depth value and the second depth value of the corresponding position of the triangle from the first depth value set and the second depth value set. The triangle to be reduced is determined by comparing these two depth values, so as to perform face reduction processing on the modeling triangles contained in the 3D modeling data. The above implementation steps can intelligently identify the triangles inside the model, maintain the quality of the outer surface and the integrity of the details of the model even in complex structures, and help maintain the visual effect and rendering performance of the 3D model.
[0038] In an exemplary embodiment, determining the triangle of the surface to be reduced based on the comparison result includes: when the first depth value indicated by the comparison result is less than the second depth value, determining the modeling triangle as the triangle of the surface to be reduced; when the first depth value indicated by the comparison result is greater than or equal to the second depth value, determining the modeling triangle as a triangle not of the surface to be reduced.
[0039] Optionally, for each triangle in the three-dimensional model, the depth values of the corresponding positions in the second depth value set and the first depth value set are compared. If the depth of the model surface (the first depth value) is less than the depth of the triangle (the second depth value), the triangle is considered invisible from the current viewing angle and is an internal triangle, and is marked as a triangle to be reduced. Conversely, if the first depth value is greater than or equal to the second depth value, the triangle is considered visible at least at certain angles and is marked as a triangle not to be reduced, thereby ensuring the integrity and visual effect of the model surface.
[0040] In an exemplary embodiment, after determining that the modeling triangle is the triangle to be reduced, the above method also includes: obtaining the set of triangles to be reduced corresponding to the perspective of each virtual camera to obtain multiple sets of triangles to be reduced; deduplicating the multiple sets of triangles to be reduced to obtain the target set of triangles to be reduced for reducing the three-dimensional modeling data.
[0041] Optionally, multiple preset virtual cameras are used to capture the depth information of the faucet from different angles. After the triangles to be reduced are determined by comparing the depth values, all sets of triangles to be reduced are collected for each virtual camera's viewing angle. Assuming that 16 virtual cameras are set (8 looking down and 8 looking up), there will be 16 sets of triangles to be reduced, each of which contains internal invisible triangles identified from a specific viewing angle. These 16 sets of triangles to be reduced are deduplicated to remove duplicated triangles to obtain the final target set of triangles to be reduced. This set contains the only internal invisible triangles identified from all viewing angles, ensuring the accuracy of the surface reduction process. Through the above specific embodiments, the accidental deletion of visible triangles outside the model can be effectively avoided, ensuring the visual effect and functional performance of the model.
[0042] In an exemplary embodiment, a partial image area corresponding to a target object in multiple planar images is identified, and a first depth processing is performed on the partial image area to obtain a first depth value set, including: identifying a target position of the target object on each planar image in the multiple planar images; determining depth values of multiple pixel points that constitute the image area according to the target position to obtain the first depth value set.
[0043] Optionally, a virtual camera at different preset angles is used to capture multiple two-dimensional images of the faucet. In each image, the location of the faucet (i.e., the target object) is identified. This can be achieved using image processing algorithms such as contour detection or feature point matching. Once the target location is determined, depth values are extracted for multiple pixels within this image region. This depth value reflects the distance of each pixel in three-dimensional space, i.e., the depth of the model surface corresponding to that point. For example, depth buffering techniques can be used, or depth map generation can be incorporated into the 3D rendering pipeline to obtain depth information for each pixel. The depth values extracted from all two-dimensional images are aggregated to form a first depth value set. This set contains the depth information for all pixels of the faucet from all viewing angles. In summary, by identifying the partial image regions corresponding to the target object in multiple two-dimensional images and meticulously processing the depth information in these regions, internal triangular facets of the model can be effectively identified and eliminated, significantly improving model performance and user experience. This technique is applicable not only to faucet models but also to the optimization of various 3D objects.
[0044] In an exemplary embodiment, a second depth processing is performed based on multiple triangles decomposed from a target object in multiple planar images to obtain a second depth value set, including: obtaining parameter information of multiple preset virtual cameras; and calculating depth values corresponding to the multiple triangles based on the parameter information to obtain the second depth value set.
[0045] Optionally, multiple virtual cameras are pre-set, positioned above, below, in front of, behind, to the left, and right of the faucet model, as well as at several other specific angles, to ensure that every corner of the model has at least one camera viewpoint for depth calculation. For each pre-set virtual camera, its parameters are obtained, including its precise position, orientation angle, and focal length. Using the triangle display function of the modeling software, the faucet model is decomposed into multiple triangles, with each triangle representing a small facet of the model. For each triangle, based on the obtained virtual camera parameters, 3D rendering and depth buffering techniques are used to calculate the depth value of each triangle at different viewpoints. This process involves converting the 3D coordinates of each triangle into the camera coordinate system, calculating its projection onto the image plane through perspective projection, and finally querying the depth map based on the projection point position to obtain the depth information for that triangle. The calculated depth values for each triangle from all virtual camera viewpoints are aggregated to form a second depth value set. This set contains the depth information for all triangles in the model from multiple viewpoints. Through these steps, a set of depth information accurately reflects the real-world spatial position of each triangle in the faucet model. When performing subsequent triangle visibility analysis and culling, decisions can be made based on these depth values to identify and remove internal triangles that are invisible from all perspectives, effectively reducing the surface of the model without affecting its external visual effects and structural integrity.
[0046] In an exemplary embodiment, after the modeling triangles contained in the three-dimensional modeling data are reduced in surface area according to the first depth value set and the second depth value set, the above method further includes: verifying the three-dimensional modeling data after the surface reduction processing and generating a verification result; when the verification result indicates that there are other sets of triangles to be reduced other than the target set of triangles to be reduced among the determined multiple preset virtual cameras, determining to perform secondary surface reduction processing on the three-dimensional modeling data after the surface reduction processing.
[0047] Optionally, a primary face reduction process is performed based on the first and second depth value sets to remove all triangles marked as invisible. After the primary face reduction process is completed, the model is verified. This verification process may include, but is not limited to, visual inspection, functional testing, and performance benchmarking to confirm that the model maintains its original visual quality while achieving the expected performance optimization results. Suppose that during verification, it is discovered that although the model's face count has been significantly reduced, some triangles that are not visible from certain angles have not been removed, such as some triangles from the internal piping structure of a faucet. This indicates that the primary face reduction process was not fully optimized and that "other triangle sets to be reduced" exist. Based on the verification results, the presence of other invisible triangle sets beyond the target face reduction set is confirmed, and a secondary face reduction process is then performed on the reduced 3D model data. Through the verification and secondary face reduction process described above, the faucet model can be optimized to maintain its appearance details and functional characteristics while significantly reducing its face count, improving rendering speed and reducing storage requirements.
[0048] In order to better understand the process of the above-mentioned surface reduction method applied to the modeling process, the process of the above-mentioned surface reduction method applied to the modeling process is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of this application.
[0049] In related technologies, face reduction algorithms used in 3D modeling processes can only select triangles to be subtracted based on their impact on the topological structure. Without the visual system, they cannot determine whether a triangle is inside or outside the model. Consequently, they cannot further remove internal triangles based on their visibility.
[0050] To address the aforementioned issues, an optional embodiment of this application proposes a method for automatically culling triangular faces within a model. This method involves introducing a virtual camera array surrounding the model to obtain multi-view depth information from the model to form a depth map. The method then calculates the theoretical depth of the model's internal triangular faces and compares the theoretical depth value with the actual depth value in the depth map to determine the visibility of the triangular faces. Finally, the method identifies and culls the set of triangular faces that are invisible from all viewpoints.
[0051] Optional, Figure 3 is a schematic diagram of a virtual camera array layout according to an embodiment of the present application, such as Figure 3 As shown in the figure, several virtual cameras are introduced and placed around the model to simulate the effect of human observation. The camera placement can be flexibly set according to the actual use of the model. Generally, 8 downward-looking and 8 upward-looking cameras are sufficient for most situations.
[0052] Optional, Figure 4This is a schematic diagram of depth map comparison based on multiple virtual camera perspectives according to an embodiment of the present application. Each camera will shoot, and the content of the shooting is the depth value of the triangle surface of the "entire model" after rasterization, such as Figure 4 As shown, Figure 4 The image shows the images captured by three of the cameras. The depth value of each pixel in the image is obtained, which corresponds to the depth of the model surface at that pixel, recorded as d1.
[0053] Optional, Figure 5 This is a schematic diagram of a depth map comparison based on a model triangle and a corresponding position according to an embodiment of the present application. Figure 5 As shown in the figure, through spatial calculation, the depth value of each triangle under each of the above cameras is obtained, recorded as d2. Each triangle of the model is traversed in turn, and the size relationship between d2 and d1 of each triangle is calculated. If d2>d1, it means that the depth of this triangle is deeper than the surface of the model, which means that this triangle is invisible under the current camera position. Then, each camera repeats the above operation, and the set of invisible triangles of each camera is recorded. Finally, all these sets are subjected to an "intersection" operation to obtain triangles that are invisible to all cameras, so that the internal triangles can be eliminated.
[0054] Optional, Figure 6 This is a schematic diagram of automatic removal of internal objects in a model according to an embodiment of the present application. In the specific implementation process, considering the efficiency of the operation, the automatic surface reduction will be divided into two stages, namely internal object removal and object inner surface removal. Internal object removal is to remove the entire object at the object granularity. Figure 6 As shown, the object inside the tee pipe in the left picture (middle picture) is completely hidden inside the pipe. This object will be directly deleted. The result after removal is shown in the right picture, and no difference can be seen from the outside.
[0055] Optional, Figure 7 This is a schematic diagram of automatically removing the inner surface of a model object according to an embodiment of the present application. In fact, most objects are partially visible and partially invisible, so further inner surface removal is required. Figure 7 As shown, the interior of the object is filled with a large number of grid details (left picture). The method of the present application can identify the inner surface grid (middle picture) and remove the inner surface grid (right picture).
[0056] Optional, Figure 8 The following is a flow chart of automatically removing internal triangular faces of a model according to an embodiment of the present application, which specifically includes the following steps:
[0057] Step 1: Original model input and object set generation: Input the original 3D model, which contains a set of multiple objects; generate an object set composed of 3D models.
[0058] Step 2: Depth map generation: Through rasterization processing, a depth image of the 3D model is generated from multiple virtual camera perspectives. The depth image records the surface depth value of the model at each perspective.
[0059] Step 3: Internal object removal. For each object in the object collection, read the depth value of its corresponding position in the depth image. Traverse each object and compare its theoretical depth value (d1) with the actual depth value (d2) obtained from the depth image to determine whether the object is invisible from all camera perspectives. Remove objects that are invisible from all camera perspectives to obtain the model after the first stage of processing.
[0060] Step 4: Eliminate the inner surface of the object. Traverse each triangle in the model after the first stage of processing and calculate its theoretical depth value under each virtual camera perspective; compare the theoretical depth value of each triangle with the depth value of the corresponding position in the depth image to determine whether the triangle is invisible under each virtual camera perspective; perform intersection operation on the set of invisible triangles under all perspectives to obtain a set of triangles that are invisible under all perspectives; based on the set of triangles that are invisible under all perspectives, automatically eliminate the corresponding internal triangles in the model.
[0061] It should be noted that when calculating the theoretical depth value of a triangle, the model's material properties and lighting conditions need to be further considered to more accurately assess the visibility of the triangle under different lighting environments. At the same time, the number and position of virtual cameras should be determined based on the complexity of the model and the required accuracy. Too many cameras will increase the computational effort, while too few may result in the omission of internal triangles. Furthermore, the generation of the depth map directly affects the accuracy of visibility judgments. It is also necessary to pay attention to parameters such as the depth map's resolution and sampling rate to ensure the accuracy of the depth information.
[0062] In summary, this application uses a strategy of surrounding the model with a virtual camera array to capture depth information from multiple perspectives and form a depth map, thereby simulating the human visual system to achieve accurate judgment of the visibility of triangular faces inside the three-dimensional model. By calculating the theoretical depth value of the internal triangular face of the model and comparing it with the actual depth value on the depth map, it is possible to effectively identify those triangular faces that are invisible at all observation angles and eliminate them. This method is not only highly versatile and can be applied to object models of any shape and structure, from simple geometric shapes to complex CAD export models, it can achieve automatic elimination of internal triangular faces; it also shows significant advantages in efficiency, especially for highly complex CAD three-dimensional models, the face reduction effect is significant.
[0063] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software device, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0064] Figure 9 is a structural block diagram of a transmission power adjustment device according to an embodiment of the present application; Figure 9 As shown, including:
[0065] An acquisition module 92 is configured to acquire images of the target object at different viewing angles to obtain one or more planar images after loading the three-dimensional modeling data corresponding to the target object in the image space;
[0066] an identification module 94 configured to identify a partial image region corresponding to the target object in the one or more planar images, and perform a first depth processing on the partial image region to obtain a first set of depth values, wherein the first depth processing comprises performing a depth value analysis on each pixel in the partial image region;
[0067] A first processing module 96 is configured to perform a second depth processing based on the plurality of triangles decomposed from the target object in the planar image to obtain a second depth value set, wherein the second depth processing comprises performing a depth calculation on each triangle inside the model;
[0068] The second processing module 98 is configured to perform surface reduction processing on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set.
[0069] By means of the above-mentioned device, when the three-dimensional modeling data corresponding to the target object is loaded in the image space, images of the target object at different perspectives are obtained to obtain one or more plane images; the partial image area corresponding to the target object in the multiple plane images is identified, and the first depth processing is performed on the partial image area to obtain a first depth value set, wherein the first depth processing refers to depth value analysis of each pixel point in the partial image area; a second depth processing is performed based on the multiple triangles decomposed from the target object in the plane image to obtain a second depth value set, wherein the second depth processing refers to depth calculation of each triangle inside the model; and face reduction processing is performed on the modeling triangles contained in the three-dimensional modeling data according to the first depth value set and the second depth value set. The above-mentioned technical solution solves the problem of being unable to remove the internal triangular faces of the model according to the visibility of the triangular faces. Furthermore, by comparing and analyzing the depth values of the triangles with the depth values of the model surface, the invisible triangular faces inside the model are identified and eliminated, thereby achieving accurate face reduction of the three-dimensional model.
[0070] In an exemplary embodiment, the above-mentioned second processing module is also used to determine the first depth value and the second depth value of the corresponding position of the same modeling triangle from the first depth value set and the second depth value set; compare the size relationship between the first depth value and the second depth value to obtain a comparison result; determine the triangle to be reduced based on the comparison result, so as to perform surface reduction processing on the modeling triangles contained in the three-dimensional modeling data.
[0071] In an exemplary embodiment, the above-mentioned second processing module is also used to determine the triangle of the surface to be reduced based on the comparison result, including: when the first depth value indicated by the comparison result is less than the second depth value, determining the modeling triangle as a triangle of the surface to be reduced; when the first depth value indicated by the comparison result is greater than or equal to the second depth value, determining the modeling triangle as a triangle not of the surface to be reduced.
[0072] In an exemplary embodiment, the above-mentioned second processing module also includes: an acquisition unit, which is used to determine that the modeling triangle is a triangle to be reduced, and then obtain the set of triangles to be reduced corresponding to the perspective of each virtual camera to obtain multiple sets of triangles to be reduced; deduplicate the multiple sets of triangles to be reduced to obtain the target set of triangles to be reduced for reducing the three-dimensional modeling data.
[0073] In an exemplary embodiment, the recognition module is further configured to recognize a target position of the target object on each of the plurality of planar images; and determine depth values of a plurality of pixels constituting the image area according to the target position to obtain a first depth value set.
[0074] In an exemplary embodiment, the first processing module is further configured to obtain parameter information of a plurality of preset virtual cameras; and calculate depth values corresponding to a plurality of triangles based on the parameter information to obtain a second depth value set.
[0075] In an exemplary embodiment, the above-mentioned device also includes: a verification module, which is used to verify the three-dimensional modeling data after the surface reduction processing after the modeling triangles contained in the three-dimensional modeling data are reduced according to the first depth value set and the second depth value set, and generate a verification result; when the verification result indicates that there are other sets of triangles to be reduced other than the target set of triangles to be reduced among the determined multiple preset virtual cameras, it is determined to perform secondary surface reduction processing on the three-dimensional modeling data after the surface reduction processing.
[0076] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0077] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0078] S1, when the three-dimensional modeling data corresponding to the target object is loaded in the image space, acquiring images of the target object at different viewing angles to obtain one or more planar images;
[0079] S2, identifying a partial image area corresponding to the target object in the multiple planar images, performing a first depth processing on the partial image area to obtain a first depth value set, wherein the first depth processing refers to performing a depth value analysis on each pixel in the partial image area;
[0080] S3, performing a second depth processing based on the multiple triangles decomposed from the target object in the planar image to obtain a second depth value set, wherein the second depth processing refers to performing a depth calculation on each triangle inside the model;
[0081] S4: Perform surface reduction processing on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set.
[0082] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0083] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0084] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0085] S1, when the three-dimensional modeling data corresponding to the target object is loaded in the image space, acquiring images of the target object at different viewing angles to obtain one or more planar images;
[0086] S2, identifying a partial image area corresponding to the target object in the multiple planar images, performing a first depth processing on the partial image area to obtain a first depth value set, wherein the first depth processing refers to performing a depth value analysis on each pixel in the partial image area;
[0087] S3, performing a second depth processing based on the multiple triangles decomposed from the target object in the planar image to obtain a second depth value set, wherein the second depth processing refers to performing a depth calculation on each triangle inside the model;
[0088] S4: Perform surface reduction processing on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set.
[0089] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0090] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0091] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Alternatively, they can be implemented using program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into separate integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0092] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A face reduction method applied to a modeling process, characterized in that: include: When the three-dimensional modeling data corresponding to the target object is loaded in the image space, images of the target object at different viewing angles are acquired to obtain one or more planar images; Identifying a partial image area corresponding to the target object in the multiple planar images, and performing a first depth processing on the partial image area to obtain a first depth value set, wherein the first depth processing includes performing a depth value analysis on each pixel in the partial image area; performing a second depth processing based on the plurality of triangles decomposed from the target object in the planar image to obtain a second depth value set, wherein the second depth processing refers to performing a depth calculation on each triangle inside the model; A surface reduction process is performed on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set.
2. The face reduction method applied to a modeling process according to claim 1, characterized in that: Performing face reduction processing on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set, comprising: Determine a first depth value and a second depth value at a corresponding position of the same modeling triangle from the first depth value set and the second depth value set; Comparing the first depth value and the second depth value to obtain a comparison result; The triangles to be reduced are determined according to the comparison result, so as to perform surface reduction processing on the modeling triangles contained in the three-dimensional modeling data.
3. The face reduction method applied to the modeling process according to claim 2, characterized in that: Determining the triangle to be reduced according to the comparison result includes: If the first depth value indicated by the comparison result is less than the second depth value, determining that the modeling triangle is a triangle to be reduced; If the first depth value indicated by the comparison result is greater than or equal to the second depth value, the modeling triangle is determined to be a triangle that is not a face to be reduced.
4. The face reduction method applied to a modeling process according to claim 3, characterized in that: After determining that the modeling triangle is a triangle of a to-be-reduced face, the method further includes: Obtain a set of triangles to be reduced corresponding to the viewing angle of each virtual camera, and obtain multiple sets of triangles to be reduced; Deduplication processing is performed on the multiple triangle sets to be reduced to obtain a target triangle set to be reduced for performing surface reduction processing on the three-dimensional modeling data.
5. The face reduction method applied to a modeling process according to claim 1, characterized in that: Identifying a partial image area corresponding to the target object in the multiple planar images, and performing a first depth processing on the partial image area to obtain a first depth value set, including: identifying a target position of the target object on each of the plurality of planar images; Determine depth values of a plurality of pixels constituting the partial image area according to the target position to obtain the first depth value set.
6. The face reduction method applied to a modeling process according to claim 1, characterized in that: Performing a second depth processing based on multiple triangles decomposed from the target object in the planar image to obtain a second depth value set includes: Get parameter information of multiple preset virtual cameras; Depth values corresponding to the plurality of triangles are calculated based on the parameter information to obtain the second depth value set.
7. The face reduction method applied to a modeling process according to claim 1, characterized in that: After performing face reduction processing on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set, the method further includes: Verify the 3D modeling data after surface reduction processing and generate verification results; When the verification result indicates that the determined multiple preset virtual cameras have other triangle sets to be reduced except the target triangle set to be reduced, it is determined to perform secondary surface reduction processing on the three-dimensional modeling data after the surface reduction processing.
8. A face reduction device used in a modeling process, characterized in that: include: An acquisition module is configured to acquire images of the target object at different viewing angles to obtain one or more planar images after loading the three-dimensional modeling data corresponding to the target object in the image space; an identification module, configured to identify a partial image area corresponding to the target object in the one or more planar images, and perform a first depth processing on the partial image area to obtain a first set of depth values, wherein the first depth processing comprises performing a depth value analysis on each pixel in the partial image area; a first processing module, configured to perform a second depth processing based on a plurality of triangles decomposed from the target object in the planar image to obtain a second depth value set, wherein the second depth processing comprises performing a depth calculation on each triangle inside the model; The second processing module is configured to perform surface reduction processing on the modeling triangles included in the three-dimensional modeling data according to the first depth value set and the second depth value set.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.