Three-dimensional model automatic mapping optimization method
By analyzing the surface characteristics of the 3D model and automatically generating texture coordinates, combined with texture mapping and lighting simulation optimization, the problem of long time consumption and low quality of 3D model mapping is solved, efficient and low-cost mapping effects are achieved, and the realism and depth of the scene are improved. feel.
Patent Information
- Application Number
- CN202410735081.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-10
AI Technical Summary
Existing 3D model mapping methods are time-consuming and of low quality. Traditional automatic mapping methods cannot meet the requirements for non-contact operation and high texture map quality, and fail to effectively reduce rendering computing resources and storage costs, and improve compatibility and scalability.
By analyzing the surface characteristics of the 3D model, automatically generate or adjust texture coordinates, apply texture mapping algorithms for optimization, including texture resampling, compression and anti-aliasing processing, implement lighting simulation and viewpoint optimization, dynamically adjust texture brightness and transparency, and combine real-time or Offline quality assessment and iterative optimization until preset visual standards are reached.
It improves the efficiency and quality of 3D model mapping, reduces storage and operating costs, expands compatibility and scalability, and enhances the realism and depth of the scene.
Smart Images

Figure CN118628630A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image optimization processing, and in particular to a three-dimensional model automatic mapping optimization method. Background Art
[0002] With the rapid development of computer technology, the demand for digitalization in all walks of life is also increasing day by day. For some industries, the digitalization process is to digitize objects in the real world into computers using computer graphics technology and store and display them, and the mapping process is an important part of digitization. The mapping process refers to processing the existing original texture image and mapping the color of the texture image to the coordinates of the 3D model, so that the 3D model is closer to the appearance of the real world when rendered.
[0003] Existing texture mapping methods mainly rely on artists and technical personnel with certain mapping experience to use professional mapping software for manual mapping, such as mudbox, 3dmax, etc. Due to the accuracy requirements for texture mapping, the mapping process of a three-dimensional object may require the use of multiple images from different angles. The most time-consuming step in the manual mapping process is to accurately align the required part of the collected image with the three-dimensional model. The problem in this process is that the professional software and the camera parameters used to shoot the image are not the same, so the degree of distortion of the image and the perspective in the professional software are different, resulting in a misalignment. Therefore, the disadvantage of the manual mapping method is that it takes a long time and has low quality.
[0004] The automatic mapping method can solve the above problems well. An important step in the automatic mapping process is to obtain the internal and external parameters of the camera. However, the existing automatic mapping methods mainly manually calibrate the feature points of the model with the screen coordinates in the corresponding texture map, and then obtain the external parameters of the camera through the coordinate pairs. When manually calibrating the model, many methods add sharp objects as feature points to the model during the scanning process for the convenience of calibration. However, this method is not applicable to some industries because these industries require non-contact operations during the scanning process, so adding sharp objects is not feasible. It is also not applicable to industries that require texture map quality because a model may have dozens of texture maps, and manually selecting coordinate pairs for each picture is still a very time-consuming task.
[0005] Moreover, traditional automatic mapping methods are mostly concerned with improving mapping efficiency, but do not consider reducing the computing resources required for rendering in the later stage, speeding up the loading speed of models and scenes, improving the overall image quality, reducing storage and bandwidth requirements, and improving compatibility and scalability. As a result, when using three-dimensional models in the later stage, there are disadvantages such as reduced work efficiency, increased storage and operating costs, and poor compatibility. Summary of the invention
[0006] In view of this, the technical problem to be solved by the present invention is: to provide a three-dimensional model automatic mapping optimization method, which can automatically map and optimize the three-dimensional model to enhance the realism and depth of the scene.
[0007] In order to solve the above technical problems, the technical solution of the present invention is:
[0008] The three-dimensional model automatic mapping optimization method comprises the following steps:
[0009] S1. Receive a three-dimensional model and obtain three-dimensional model data, where the three-dimensional model data includes geometric structure information and texture coordinate information of the three-dimensional model;
[0010] S2, analyzing the surface features of the three-dimensional model, identifying the flat area, curved area and detailed feature area on the model surface;
[0011] S3. According to the analysis results, the texture coordinates are automatically generated or adjusted so that the texture is more evenly distributed in the flat area, maintains a natural transition in the curved area, and ensures the texture clarity in the detail feature area;
[0012] S4. Applying a texture mapping algorithm to optimize the texture and fit it to the surface of the three-dimensional model according to the adjusted texture coordinates. The optimization method includes texture resampling, texture compression and anti-aliasing processing to reduce texture distortion and improve visual quality.
[0013] S5. Implement lighting simulation and viewpoint optimization, dynamically adjust texture brightness, contrast and transparency according to the direction of virtual light source and expected viewing angle, and enhance the realism and depth of the scene;
[0014] S6 conducts real-time or offline quality assessment, and automatically detects mapping effects through algorithms, including texture gaps, color discontinuities and other issues, and feeds back to S2 for iterative optimization until the preset visual standards are met.
[0015] Preferably, S2 comprises the following steps:
[0016] S21, meshing; dividing the surface of the three-dimensional model into a plurality of small facets or triangular meshes; obtaining a normal vector of each facet or mesh;
[0017] S22, normal analysis: analyzing each normal vector, calculating the difference between them, setting a threshold and comparing with the threshold to distinguish between flat areas and curved areas;
[0018] S23, curvature calculation; calculating the average curvature of each grid, a high curvature indicates that the area belongs to a curved surface or a detail feature area, and a low curvature corresponds to a flat area;
[0019] S24, feature extraction: using edge detection algorithm to identify detail features on the model, detail features include edges, sharp corners or small structures;
[0020] S25, region marking: marking the surface of the entire model, marking flat areas, curved areas and detail feature areas;
[0021] S26, data collation: integrating the information of different identified areas together to form one or more data structures.
[0022] Preferably, S3 comprises the following steps:
[0023] S31, flat area processing steps:
[0024] S311, UV unfolding optimization; for flat areas, UV unfolding algorithm is used to reduce stretching and distortion;
[0025] S312, texture tiling and alignment; adjust the number and alignment of texture tiling to achieve a continuous pattern on a large flat surface without obvious repetitive traces.
[0026] S32, surface area processing steps:
[0027] S321, conformal mapping: using conformal mapping technology to keep the local shape unchanged;
[0028] S322, local UV adjustment: local refinement adjustment of UV coordinates of the surface area, by increasing the density of UV coordinates or adopting a specific mapping strategy to adapt to the complex shape of the surface;
[0029] S33, detail feature area processing steps:
[0030] S331, high-precision UV mapping: For detailed feature areas, high-precision UV mapping is used to accurately match texture details to the fine structure of the model, including accurately capturing edges and corners by subdividing the grid or using wrapping algorithms;
[0031] S332, texture sharpening and magnification: in the detail feature area, the texture map is magnified and sharpened to enhance the visibility and clarity of the texture details;
[0032] S34, Global Texture Coordination:
[0033] S341, seam processing; using automatic seam cutting algorithm to optimize UV seams;
[0034] S342, smoothing the transition area; using feathering or gradient technology to smoothly transition the boundaries between the flat area and the curved area, and between the curved area and the detail feature area.
[0035] Preferably, S4 comprises the following steps:
[0036] S41. Texture coordinate adjustment; ensure that the UV coordinates are correctly mapped to each surface of the 3D model; adjust the position and size of the UV island according to the geometry and surface characteristics of the model to ensure that the texture details adapt to the model features.
[0037] S42 Texture resampling: When the texture size needs to be adjusted to match the actual needs of the model, a high-quality resampling algorithm (such as bilinear, trilinear, or nearest neighbor interpolation) is used to scale the texture image;
[0038] S43, texture compression;
[0039] S44, anti-aliasing processing; anti-aliasing technology, including FXAA or MSAA, is used on texture edges to eliminate or reduce aliasing caused by texture pixelation;
[0040] S45, Mipmap generation; create multi-level detail textures (Mipmaps), automatically switch textures of different resolutions at different distances, and optimize rendering performance;
[0041] S46. Integrate into the rendering pipeline: Integrate the adjusted texture and optimization settings into the rendering pipeline to ensure that the texture is correctly mapped to the model surface, and that texture resampling, texture compression, and anti-aliasing are effective during real-time rendering.
[0042] S47. Visual verification and adjustment; render the model and carefully check the quality of the texture map; make fine-tuning based on visual feedback, including re-adjusting texture coordinates, optimizing texture compression settings, or enhancing anti-aliasing.
[0043] Preferably, S5 comprises the following steps:
[0044] S51, Environment setup and light source definition; determine the lighting environment of the virtual scene, including the position, intensity, color of the main light source and the contribution of ambient light; define the time of day (such as sunrise, noon, dusk) or specific atmosphere (such as indoor lighting) to guide the direction and intensity of lighting simulation;
[0045] S52, texture attribute adjustment preparation; analyzing the response characteristics of each texture element to light, including base color, reflectivity, specular reflection intensity, transparency, and bump map; preparing adjustment parameters, such as the adjustable range of brightness, contrast, and transparency, so as to dynamically adjust according to lighting conditions later;
[0046] S53, lighting simulation and texture response; use real-time rendering engine or pre-calculated global illumination technology to simulate lighting effects, calculate direct lighting, indirect lighting and shadows of each surface; dynamically adjust the brightness and contrast of the texture according to the light source information to ensure good visual effects under different lighting conditions;
[0047] S54, viewpoint optimization; analyze the expected viewing angle; implement frustum culling, detail level management and other technologies to optimize rendering efficiency; adjust the rendering order of transparency and semi-transparent materials;
[0048] S55, post-processing and effect enhancement; apply tone mapping, depth of field, and glow for post-processing; adjust exposure compensation, color correction, and HDR processing as needed;
[0049] S56, Iteration and feedback; preview and evaluate the effects of lighting and viewpoint adjustments, collect user feedback or test visual quality through automated testing tools; based on the feedback results, adjust lighting parameters, texture properties and post-processing settings until the best visual effect is achieved.
[0050] After adopting the above technical solution, the beneficial effects of the present invention are:
[0051] In the present invention, the automatic mapping optimization method of a three-dimensional model includes: S1, receiving a three-dimensional model, obtaining three-dimensional model data, the three-dimensional model data including geometric structure information and texture coordinate information of the three-dimensional model; S2, analyzing the surface features of the three-dimensional model, identifying the flat area, curved area and detail feature area of the model surface; S3, automatically generating or adjusting the texture coordinates according to the analysis results, so that the texture is more evenly distributed in the flat area, maintains a natural transition in the curved area, and ensures the texture clarity of the detail feature area; S4, applying a texture mapping algorithm, optimizing the texture and fitting it to the surface of the three-dimensional model according to the adjusted texture coordinates, the optimization method includes texture resampling, texture compression and anti-aliasing processing to reduce texture distortion and improve visual quality; S5, implementing lighting simulation and viewpoint optimization, dynamically adjusting the texture brightness, contrast and transparency according to the direction of the virtual light source and the expected observation angle, and enhancing the realism and depth of the scene; S6, performing real-time or offline quality evaluation, automatically detecting the mapping effect through the algorithm, including problems such as texture splicing gaps and color discontinuity, and feeding back to S2 for iterative optimization until the preset visual standard is reached. In the present invention, surface features are analyzed to identify flat areas, curved areas and detail feature areas, and based on the analysis results, texture coordinates are generated or adjusted, texture resampling, texture compression and anti-aliasing processing methods are used to optimize the texture, and lighting simulation and viewpoint optimization are performed to enhance the realism and depth of the scene, improve work efficiency, reduce storage and operating costs, and expand compatibility and scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0053] Figure 1 It is a flow chart of a method for automatic mapping optimization of a three-dimensional model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0055] like Figure 1 As shown, the three-dimensional model automatic mapping optimization method of the present invention comprises the following steps:
[0056] S1. Receive a three-dimensional model and obtain three-dimensional model data, where the three-dimensional model data includes geometric structure information and texture coordinate information of the three-dimensional model;
[0057] S2, analyzing the surface features of the three-dimensional model, identifying the flat area, curved area and detailed feature area on the model surface;
[0058] S3. According to the analysis results, the texture coordinates are automatically generated or adjusted so that the texture is more evenly distributed in the flat area, maintains a natural transition in the curved area, and ensures the texture clarity in the detail feature area;
[0059] S4. Applying a texture mapping algorithm to optimize the texture and fit it to the surface of the three-dimensional model according to the adjusted texture coordinates. The optimization method includes texture resampling, texture compression and anti-aliasing processing to reduce texture distortion and improve visual quality.
[0060] S5. Implement lighting simulation and viewpoint optimization, dynamically adjust texture brightness, contrast and transparency according to the direction of virtual light source and expected viewing angle, and enhance the realism and depth of the scene;
[0061] S6 conducts real-time or offline quality assessment, and automatically detects mapping effects through algorithms, including texture gaps, color discontinuities and other issues, and feeds back to S2 for iterative optimization until the preset visual standards are met.
[0062] In this application, S2 includes the following steps:
[0063] S21, meshing; dividing the surface of the three-dimensional model into a plurality of small facets or triangular meshes; obtaining a normal vector of each facet or mesh;
[0064] S22, normal analysis: analyzing each normal vector, calculating the difference between them, setting a threshold and comparing with the threshold to distinguish between flat areas and curved areas;
[0065] S23, curvature calculation; calculating the average curvature of each grid, a high curvature indicates that the area belongs to a curved surface or a detail feature area, and a low curvature corresponds to a flat area;
[0066] S24, feature extraction: using edge detection algorithm to identify detail features on the model, detail features include edges, sharp corners or small structures;
[0067] S25, region marking: marking the surface of the entire model, marking flat areas, curved areas and detail feature areas;
[0068] S26, data collation: integrating the information of different identified areas together to form one or more data structures.
[0069] In this application, S3 includes the following steps:
[0070] S31, flat area processing steps:
[0071] S311, UV unfolding optimization; for flat areas, UV unfolding algorithm is used to reduce stretching and distortion;
[0072] S312, texture tiling and alignment; adjust the number and alignment of texture tiling to achieve a continuous pattern on a large flat surface without obvious repetitive traces.
[0073] S32, surface area processing steps:
[0074] S321, conformal mapping: using conformal mapping technology to keep the local shape unchanged;
[0075] S322, local UV adjustment: local refinement adjustment of UV coordinates of the surface area, by increasing the density of UV coordinates or adopting a specific mapping strategy to adapt to the complex shape of the surface;
[0076] S33, detail feature area processing steps:
[0077] S331, high-precision UV mapping: For detailed feature areas, high-precision UV mapping is used to accurately match texture details to the fine structure of the model, including accurately capturing edges and corners by subdividing the grid or using wrapping algorithms;
[0078] S332, texture sharpening and magnification: in the detail feature area, the texture map is magnified and sharpened to enhance the visibility and clarity of the texture details;
[0079] S34, Global Texture Coordination:
[0080] S341, seam processing; using automatic seam cutting algorithm to optimize UV seams;
[0081] S342, smoothing the transition area; using feathering or gradient technology to smoothly transition the boundaries between the flat area and the curved area, and between the curved area and the detail feature area.
[0082] In this application, S4 includes the following steps:
[0083] S41. Texture coordinate adjustment; ensure that the UV coordinates are correctly mapped to each surface of the 3D model; adjust the position and size of the UV island according to the geometry and surface characteristics of the model to ensure that the texture details adapt to the model features.
[0084] S42 Texture resampling: When the texture size needs to be adjusted to match the actual needs of the model, a high-quality resampling algorithm (such as bilinear, trilinear, or nearest neighbor interpolation) is used to scale the texture image;
[0085] S43, texture compression;
[0086] S44, anti-aliasing processing; anti-aliasing technology, including FXAA or MSAA, is used on texture edges to eliminate or reduce aliasing caused by texture pixelation;
[0087] S45, Mipmap generation; create multi-level detail textures (Mipmaps), automatically switch textures of different resolutions at different distances, and optimize rendering performance;
[0088] S46. Integrate into the rendering pipeline: Integrate the adjusted texture and optimization settings into the rendering pipeline to ensure that the texture is correctly mapped to the model surface, and that texture resampling, texture compression, and anti-aliasing are effective during real-time rendering.
[0089] S47. Visual verification and adjustment; render the model and carefully check the quality of the texture map; make fine-tuning based on visual feedback, including re-adjusting texture coordinates, optimizing texture compression settings, or enhancing anti-aliasing.
[0090] In this application, S5 includes the following steps:
[0091] S51, Environment setup and light source definition; determine the lighting environment of the virtual scene, including the position, intensity, color of the main light source and the contribution of ambient light; define the time of day (such as sunrise, noon, dusk) or specific atmosphere (such as indoor lighting) to guide the direction and intensity of lighting simulation;
[0092] S52, texture attribute adjustment preparation; analyzing the response characteristics of each texture element to light, including base color, reflectivity, specular reflection intensity, transparency, and bump map; preparing adjustment parameters, such as the adjustable range of brightness, contrast, and transparency, so as to dynamically adjust according to lighting conditions later;
[0093] S53, lighting simulation and texture response; use real-time rendering engine or pre-calculated global illumination technology to simulate lighting effects, calculate direct lighting, indirect lighting and shadows of each surface; dynamically adjust the brightness and contrast of the texture according to the light source information to ensure good visual effects under different lighting conditions;
[0094] S54, viewpoint optimization; analyze the expected viewing angle; implement frustum culling, detail level management and other technologies to optimize rendering efficiency; adjust the rendering order of transparency and semi-transparent materials;
[0095] S55, post-processing and effect enhancement; apply tone mapping, depth of field, and glow for post-processing; adjust exposure compensation, color correction, and HDR processing as needed;
[0096] S56, Iteration and feedback; preview and evaluate the effects of lighting and viewpoint adjustments, collect user feedback or test visual quality through automated testing tools; based on the feedback results, adjust lighting parameters, texture properties and post-processing settings until the best visual effect is achieved.
[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A three-dimensional model automatic mapping optimization method, characterized in that: The steps include: S1. Receive a three-dimensional model and obtain three-dimensional model data, where the three-dimensional model data includes geometric structure information and texture coordinate information of the three-dimensional model; S2, analyzing the surface features of the three-dimensional model, identifying the flat area, curved area and detailed feature area on the model surface; S3. According to the analysis results, the texture coordinates are automatically generated or adjusted so that the texture is more evenly distributed in the flat area, maintains a natural transition in the curved area, and ensures the texture clarity in the detail feature area; S4. Applying a texture mapping algorithm to optimize the texture and fit it to the surface of the three-dimensional model according to the adjusted texture coordinates. The optimization method includes texture resampling, texture compression and anti-aliasing processing to reduce texture distortion and improve visual quality. S5. Implement lighting simulation and viewpoint optimization, dynamically adjust texture brightness, contrast and transparency according to the direction of virtual light source and expected viewing angle, and enhance the realism and depth of the scene; S6 conducts real-time or offline quality assessment, and automatically detects mapping effects through algorithms, including texture gaps, color discontinuities and other issues, and feeds back to S2 for iterative optimization until the preset visual standards are met.
2. The three-dimensional model automatic mapping optimization method according to claim 1, characterized in that: S2 includes the following steps: S21, meshing; dividing the surface of the three-dimensional model into a plurality of small facets or triangular meshes; obtaining a normal vector of each facet or mesh; S22, normal analysis: analyzing each normal vector, calculating the difference between them, setting a threshold and comparing with the threshold to distinguish between flat areas and curved areas; S23, curvature calculation; calculating the average curvature of each grid, a high curvature indicates that the area belongs to a curved surface or a detail feature area, and a low curvature corresponds to a flat area; S24, feature extraction; Use edge detection algorithms to identify detailed features on the model, including edges, sharp corners or small structures; S25, region marking: marking the surface of the entire model, marking flat areas, curved areas and detail feature areas; S26, data collation: integrating the information of different identified areas together to form one or more data structures.
3. The three-dimensional model automatic mapping optimization method according to claim 1, characterized in that: S3 includes the following steps: S31, flat area processing steps: S311, UV unfolding optimization; for flat areas, UV unfolding algorithm is used to reduce stretching and distortion; S312, texture tiling and alignment; adjust the number and alignment of texture tiling to achieve a continuous pattern on a large flat surface without obvious repetitive traces. S32, surface area processing steps: S321, conformal mapping: using conformal mapping technology to keep the local shape unchanged; S322, local UV adjustment: local refinement adjustment of UV coordinates of the surface area, by increasing the density of UV coordinates or adopting a specific mapping strategy to adapt to the complex shape of the surface; S33, detail feature area processing steps: S331, high-precision UV mapping: For detailed feature areas, high-precision UV mapping is used to accurately match texture details to the fine structure of the model, including accurately capturing edges and corners by subdividing the grid or using wrapping algorithms; S332, texture sharpening and magnification: in the detail feature area, the texture map is magnified and sharpened to enhance the visibility and clarity of the texture details; S34, Global Texture Coordination: S341, seam processing; using automatic seam cutting algorithm to optimize UV seams; S342, smoothing the transition area; using feathering or gradient technology to smoothly transition the boundaries between the flat area and the curved area, and between the curved area and the detail feature area.
4. The three-dimensional model automatic mapping optimization method according to claim 1, characterized in that: S4 includes the following steps: S41. Texture coordinate adjustment; ensure that the UV coordinates are correctly mapped to each surface of the 3D model; adjust the position and size of the UV island according to the geometry and surface characteristics of the model to ensure that the texture details adapt to the model features. S42 Texture resampling: When the texture size needs to be adjusted to match the actual needs of the model, a high-quality resampling algorithm (such as bilinear, trilinear, or nearest neighbor interpolation) is used to scale the texture image; S43, texture compression; S44, anti-aliasing processing; anti-aliasing technology, including FXAA or MSAA, is used on texture edges to eliminate or reduce aliasing caused by texture pixelation; S45, Mipmap generation; create multi-level detail textures (Mipmaps), automatically switch textures of different resolutions at different distances, and optimize rendering performance; S46. Integrate into the rendering pipeline: Integrate the adjusted texture and optimization settings into the rendering pipeline to ensure that the texture is correctly mapped to the model surface, and that texture resampling, texture compression, and anti-aliasing are effective during real-time rendering. S47. Visual verification and adjustment; render the model and carefully check the quality of the texture map; make fine-tuning based on visual feedback, including re-adjusting texture coordinates, optimizing texture compression settings, or enhancing anti-aliasing.
5. The three-dimensional model automatic mapping optimization method according to claim 1, characterized in that: S5 includes the following steps: S51, Environment setup and light source definition; determine the lighting environment of the virtual scene, including the position, intensity, color of the main light source and the contribution of ambient light; define the time of day (such as sunrise, noon, dusk) or specific atmosphere (such as indoor lighting) to guide the direction and intensity of lighting simulation; S52, texture attribute adjustment preparation; Analyze each texture element's response to lighting, including base color, reflectivity, specular intensity, transparency, and bump mapping; Prepare adjustable parameters such as brightness, contrast, and transparency ranges to allow for dynamic adjustments based on lighting conditions; S53, lighting simulation and texture response; use real-time rendering engine or pre-calculated global illumination technology to simulate lighting effects, calculate direct lighting, indirect lighting and shadows of each surface; dynamically adjust the brightness and contrast of the texture according to the light source information to ensure good visual effects under different lighting conditions; S54, viewpoint optimization; analyze the expected viewing angle; implement frustum culling, detail level management and other technologies to optimize rendering efficiency; adjust the rendering order of transparency and semi-transparent materials; S55, post-processing and effect enhancement; apply tone mapping, depth of field, and glow for post-processing; adjust exposure compensation, color correction, and HDR processing as needed; S56, Iteration and feedback; preview and evaluate the effects of lighting and viewpoint adjustments, collect user feedback or test visual quality through automated testing tools; based on the feedback results, adjust lighting parameters, texture properties and post-processing settings until the best visual effect is achieved.
Citation Information
Cited By
System, storage medium and equipment for digital three-dimensional model surface reflection effect simulation visual enhancement
CN119206029A
