A method for filling holes in a real scene three-dimensional model and optimizing a mesh

By constructing geometric feature rings and multi-viewpoint consistency constraints in the hole filling of real-world 3D models, and extrapolating the vertices of the filling patches layer by layer, and combining improved smoothing operators and adaptive mesh subdivision, the problems of normal field jumps and texture discontinuities in hole filling are solved, and the continuity of geometric normal field and texture color between the filling patches and the original mesh is achieved, thus improving the rendering effect of the model.

CN123181783APending Publication Date: 2026-11-27BI SHENGYUN (WUHAN) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611683365.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-29
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies for filling holes in real-world 3D models suffer from rendering artifacts caused by normal field jumps and texture breaks at the joints between the filling patch and the original mesh. This problem is particularly difficult to solve effectively in areas with image degradation, such as glass curtain walls and water surfaces.

Method used

By detecting the hole boundaries of the real-world 3D mesh, the closed hole boundary rings are extracted and geometric feature rings are constructed. Combined with the photometric consistency constraints of multi-view images, internal sampling vertices are generated by extrapolation layer by layer. Using an improved smoothing operator and adaptive mesh subdivision, a shape-filling patch mesh is generated, and texture coordinates are regenerated to blend seam colors.

Benefits of technology

It eliminates the patch-like visual discontinuities caused by the flatness assumption in traditional methods, ensures the continuity of the patch and the original mesh in terms of geometric normal field and texture color, reduces the occurrence of rendering artifacts, and improves the visual quality of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181783A_ABST
    Figure CN123181783A_ABST
Patent Text Reader

Abstract

The application relates to the field of real scene three-dimensional reconstruction, in particular to a real scene three-dimensional model hole filling and grid optimization method, which comprises the following steps: detecting a hole boundary of a real scene three-dimensional grid to extract a closed hole boundary ring, outwardly expanding an adjacent triangular face to build a geometric feature ring belt, and extracting geometric features and color statistical features; taking a normal field of the geometric feature ring belt as a reference to generate internal sampling vertices by layer-by-layer extrapolation into a hole, combining a luminosity consistency constraint to correct a spatial position and generate an initial filling patch; labeling a noise base and building a confidence factor and an activation factor based on the color statistical features, performing smooth iteration and adaptive grid subdivision through an improved smooth operator to obtain a shaped filling patch grid; regenerating texture coordinates, determining a transition zone width based on a projection pixel span, and performing linear color migration in the transition zone. The application guarantees the double continuity of the filling patch and the original grid in the geometric normal field and the texture color.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of real-scene 3D reconstruction technology, specifically to a method for filling holes and optimizing meshes in a real-scene 3D model. Background Technology

[0002] Real-world 3D modeling technology reconstructs 3D mesh models of real-world scenes such as cities, cultural relics, and terrains through drone oblique photography, laser scanning, or dense matching of multi-view images. It is widely used in smart cities, digital twins, and surveying and mapping. In the reconstruction pipeline, the camera pose and sparse point cloud are usually obtained first by motion reconstruction structure, then dense point cloud is generated by multi-view stereo matching, and finally triangular mesh is generated by Poisson reconstruction or Delaunay triangulation. The image is then projected and mapped as texture to form a real-world 3D model with realistic colors.

[0003] To address the issue of holes in the reconstructed mesh, existing techniques primarily employ two methods: The first is geometric filling, which involves detecting boundary edges adjacent to only one triangular face, extracting closed boundary loops, directly triangulating the region within the loop, and performing Laplacian smoothing to ensure topological closure between the filled patch and the surrounding mesh. The second is global reconstruction, which removes the point cloud data of the hole region and then re-performs Poisson reconstruction, utilizing the closure property of implicit surfaces to forcibly fill in the missing areas. Both methods can eliminate holes at the topological level, ensuring the model's watertightness and meeting the basic requirements for subsequent printing or spatial analysis.

[0004] However, since the core deliverable of a real-world 3D model is a textured visualization model, voids often arise from image degradation or blind spots such as glass curtain walls, water surfaces, and rooftop obstructions. These areas lack reliable geometric observation constraints in the original multi-view imagery. Geometric infilling methods generate flat, smooth surfaces that are purely geometrically extrapolated, creating abrupt changes from the undulating details of the surrounding real ground surface or facade. After texture mapping, these surfaces exhibit obvious patch-like visual discontinuities. While overall reconstruction ensures watertightness, the Poisson implicit function expands and closes at the point of missing observation with maximum curvature. The generated raised pseudo-geometry appears as abrupt bulges from a side view angle. Furthermore, reconstruction disrupts the correspondence between the vertex indices and texture coordinates of the original mesh, causing large-area texture misalignment. A deeper flaw lies in the fact that the continuity between the infill patch and the original mesh at the boundary ring is only guaranteed at the vertex positions. The normal fields of the two triangular faces exhibit directional jumps at the seams, resulting in striped artifacts with abrupt changes in brightness during lighting rendering. These artifacts are continuously amplified during model roaming and multi-scale scaling, becoming one of the most difficult defects to eliminate during the delivery and acceptance of the live-action model. Therefore, ensuring the dual continuity of the infill patch and the original mesh in terms of geometric normal field and texture color while filling holes is a core problem that current technology urgently needs to solve. Summary of the Invention

[0005] To address the existing technical problems of rendering artifacts caused by normal field jumps and texture breaks at the joints between the hole-filling patch and the original mesh, this application provides a method for hole filling and mesh optimization in real-world 3D models.

[0006] This application provides a method for hole filling and mesh optimization in a real-world 3D model, comprising: S1, detecting the hole boundaries of the real-world 3D mesh to extract closed hole boundary rings, expanding adjacent triangular faces outward to construct geometric feature rings, and extracting the geometric features and color statistical features of vertices within the geometric feature rings; S2, using the normal field of the geometric feature rings as a reference, pushing outward layer by layer into the hole to generate internal sampling vertices, and correcting the spatial position of the internal sampling vertices by combining the photometric consistency constraints of multi-view images, thereby generating an initial filling patch; S3, calibrating the noise basis based on color statistical features, and constructing confidence factors and activation factors using the noise basis and photometric residuals, performing smoothing iteration and adaptive mesh subdivision on the initial filling patch through an improved smoothing operator to obtain a finalized filling patch mesh; S4, regenerating texture coordinates for the vertices inside the filling patch mesh, determining the transition band width based on the projected pixel span of the geometric feature rings, performing linear color migration within the transition band to fuse seam colors, and finally outputting an optimized real-world 3D model.

[0007] By extracting multidimensional features through geometric feature rings, hole filling is transformed from blind geometric closure to directional reconstruction guided by surrounding real information. By extrapolating the normal field layer by layer and inverting the internal vertex position through multi-view photometric consistency, the filling patch continues the direction of real ground features rather than assuming flatness, thus eliminating patch-like visual faults. Through an improved smoothing operator with a separate design and a noise base based on statistical calibration, geometric deviations in unconfirmed areas are converged while preserving confirmed details in the image, fundamentally suppressing lighting artifacts caused by normal jumps at seams. The continuity of texture dimensions is ensured by automatically determined transition band width and seam color migration.

[0008] Preferably, the step of detecting the hole boundaries of the real-world 3D mesh to extract closed hole boundary loops includes: traversing the edges of the real-world 3D mesh to extract candidate boundary loops, and calculating the enclosing area of ​​all candidate boundary loops; using the median of the enclosing area as the retention threshold, determining candidate boundary loops with an enclosing area lower than the retention threshold as broken edge noise loops and folding them to eliminate them; determining candidate boundary loops with an enclosing area equal to or higher than the retention threshold as valid hole boundary loops and retaining them, thus finally obtaining closed hole boundary loops.

[0009] By using threshold-driven hole screening, the entire screening process does not require the introduction of any manual coefficients and can adaptively take effect on real-world 3D models of different densities and scales, preventing subsequent processing from being affected by invalid topology interference.

[0010] Preferably, the extraction of geometric features and color statistical features of vertices within the geometric feature ring includes: extracting vertex normal vectors, local principal curvature, mean projected color, and standard deviation of projected color for each vertex; calculating the normal angle between adjacent vertex pairs within the geometric feature ring, and taking the maximum value as the upper limit of the normal change rate; statistically analyzing the number of visible cameras and the back-projected color residuals of each vertex in the entire image to determine the type of hole formation and record the occlusion azimuth range, thus completing the extraction of geometric features and color statistical features.

[0011] Preferably, the step of generating internal sampling vertices by pushing outward layer by layer into the hole based on the normal field of the geometric feature ring includes: connecting the vertices of the hole boundary ring into a closed broken line in ring order; using the normal vector of the innermost vertex of the geometric feature ring as the initial propagation direction, generating internal sampling vertices layer by layer along the radial direction pointing to the center of the hole; setting weights according to the geodesic distance attenuation from the vertex to the hole boundary ring, taking the weighted average of the normals of adjacent outer vertexes as the normal vector of each vertex, and finally obtaining the internal sampling vertices.

[0012] Preferably, the step of combining the photometric consistency constraints of multi-view images to correct the spatial position of the internal sampling vertices and then generating the initial infill patch includes: back-projecting each internal sampling vertex onto the image of its visible camera, calculating the average color difference of the same vertex at different image projection positions; if the average color difference exceeds twice the standard deviation of the projected color, then fine-tuning its spatial position along the current normal direction of the vertex until the average color difference converges to within twice the standard deviation of the projected color; and generating the initial infill patch in the hole using boundary-constrained triangulation.

[0013] By introducing photometric consistency constraints from multi-view images to correct the spatial position of internal vertices, the shape of the patch continues the orientation of the real ground features rather than the flat assumption. This eliminates the cause of patch-like visual faults in existing geometric infilling methods and provides an initial mesh state where the photometric residuals have partially converged for subsequent smoothing iterations.

[0014] Preferably, the step of performing smoothing iteration on the initial infill patch using an improved smoothing operator includes: selecting vertices on the geometric feature ring with at least two visible cameras and whose back-projected color residuals are no greater than twice the standard deviation of the projected color of the corresponding vertex; using the back-projected color residuals of the selected vertices as photometric residuals; and calculating the mean square error of the photometric residuals as a noise basis; constructing a confidence factor to control the contribution of neighborhood traction based on the photometric residuals and noise basis of the neighboring vertices; and constructing an activation factor to control the update step size of the vertex itself based on its own photometric residuals and noise basis; and introducing the confidence factor and activation factor into the Laplacian smoothing operator to update the displacement of the vertices of the initial infill patch until the maximum displacement modulus of all vertices of the initial infill patch in the current smoothing iteration is no greater than 1% of the average side length of each edge within the geometric feature ring, thus completing the smoothing iteration.

[0015] The traction confidence of the neighborhood anchor point and the convergence degree of the vertex to be updated are controlled independently, which is compatible with the overall convergence process of the coche Laplacian operator and will not create isolated fixed points that are out of iteration within the filling patch.

[0016] Preferably, the step of performing smoothing iteration and adaptive mesh subdivision on the initial filling patch using an improved smoothing operator to obtain the finalized filling patch mesh further includes: after the smoothing iteration is completed, traversing all edges of the initial filling patch and calculating the normal angle between the two vertices of each edge; performing midpoint subdivision on edges with normal angles exceeding the upper limit of the normal rate of change, and performing midpoint subdivision on edges with normal angles below the upper limit of the normal rate of change and edge lengths shorter than the average edge length of the annulus. The redundant short sides are folded; the density of the triangular facets is adjusted through the above subdivision and folding operations, and finally the shaped filling mesh is obtained.

[0017] Preferably, the step of regenerating texture coordinates for filling the internal vertices of the mesh includes: for each internal vertex, selecting the image from the visible camera whose projection incident angle is closest to orthogonal and is not occluded as the texture source; writing the projection coordinates into a newly allocated block of the texture atlas; and expanding the pixel margin outside the newly allocated block by the texture pixel size to complete the regeneration of texture coordinates.

[0018] Preferably, the step of determining the transition band width based on the projected pixel span of the geometric feature ring and performing linear color migration within the transition band to fuse the seam colors includes: statistically analyzing the average pixel span along the seam normal direction after the vertices of the geometric feature ring are projected onto the texture atlas, and taking the average pixel span as the transition band width on each side of the seam; within the transition band with a width equal to the transition band width, using the average projected color recorded by the geometric feature ring as the anchor point; performing linear color migration on the pixels within the transition band according to their distance from the seam, so that the brightness and hue of the filling texture gradually approach the original mesh texture, and finally completing the fusion of the seam colors.

[0019] Preferably, the final output of the optimized real-world 3D model includes: after texture fusion is completed, performing an integrity check on the overall optimized mesh; after confirming that all edges are adjacent to two triangular faces, texture coordinates are all within the effective range of the atlas and there are no pixel holes in the seam transition zone, merging the filling mesh with the original mesh into a single watertight model; and outputting the single watertight model together with the updated texture atlas as the optimized real-world 3D model.

[0020] The present invention has the following beneficial effects:

[0021] This invention addresses the issues of normal field abruptness and texture discontinuity at seams in filling holes in realistic 3D models by proposing a multi-dimensional feature-guided directional reconstruction method. It transforms hole filling from pure geometric extrapolation to inversion based on surrounding real-world image information. By combining layer-by-layer normal field extrapolation with multi-viewpoint consistency constraints, the filled patch physically continues the undulating direction of real-world features, eliminating the patch-like visual discontinuities caused by the flatness assumption in traditional methods and ensuring high geometric continuity.

[0022] Furthermore, this invention introduces a separately designed improved Laplacian smoothing operator, which independently controls neighborhood traction and self-update using a statistically calibrated noise basis, accurately converging the geometric deviation of unconfirmed regions while preserving confirmed details. Combined with a transition band width adaptively determined based on the projected pixel span and linear color migration, the patch texture transitions naturally to the original mesh in terms of brightness and hue. Attached Figure Description

[0023] Figure 1 This is a flowchart of a method for filling holes and optimizing meshes in a realistic 3D model; Figure 2 This is a comparison diagram of the spatial distribution of the filling patch vertices in an embodiment of the present invention. Detailed Implementation

[0024] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0025] This invention discloses a method for filling holes and optimizing meshes in a realistic 3D model, referring to... Figure 1 This includes steps S1-S4: S1. Extract the boundary ring of the hole and construct the geometric feature ring band.

[0026] In an optional embodiment, all edges of the real-world 3D mesh are traversed, and edges with one adjacent triangle are marked as boundary edges. Starting from any boundary edge, the chain of edges that connects end to end along the common vertex is traced until the starting point is returned, thereby extracting the closed hole boundary loop.

[0027] For all extracted candidate boundary rings, the enclosing area of ​​each candidate boundary ring is calculated, and the median of the enclosing areas of all candidate boundary rings is used as the retention threshold. Candidate boundary rings with an enclosing area lower than the retention threshold are identified as fragmented noise rings and are folded and eliminated. Candidate boundary rings with an enclosing area not lower than the retention threshold are identified as valid hole boundary rings and are retained. Finally, closed hole boundary rings are obtained for subsequent processing steps. Since the threshold is automatically determined by the candidate ring area distribution of the current model, the entire screening process does not require the introduction of any manual coefficients and can adaptively take effect on real-world 3D models of different densities and scales.

[0028] Next, for each retained valid hole boundary ring, two layers of adjacent triangular faces are extended outward to form a geometric feature ring. Within the geometric feature ring, the vertex normal vector and local principal curvature are extracted vertex by vertex as geometric features. The mean of the projected color of that vertex on all visible camera images, and the standard deviation of the projected color of the same vertex on different visible images are also extracted. As a color statistical feature, the local principal curvature is used to characterize whether the terrain around the hole is flat ground, a gentle slope, or a vertical corner; the vertex normal vector is used to characterize the orientation distribution of the original mesh at the joint; and the projected color mean records the true texture color reference at the boundary. Record the natural fluctuation range of color at this vertex to provide a basis for subsequent steps to determine the convergence of luminosity at internal vertices. Simultaneously, calculate and record the normal angles of all adjacent vertex pairs within the geometric feature ring, taking the maximum value as the upper limit of the normal rate of change. This value is determined automatically by the original mesh data, providing a benchmark for subsequent adaptive mesh subdivision.

[0029] Furthermore, considering the differences in the causes of holes in glass curtain walls, water surfaces, and occlusions, the number of visible cameras and the back-projected color residuals of each vertex of the geometric feature ring in all images are statistically analyzed. If there are sufficient visible cameras at the vertices of the ring but the back-projected color residuals are generally high, the hole is determined to be caused by specular reflection, weak texture, or other photometric matching failure factors, and the hole is marked as an image inversion-restricted hole. For image inversion-restricted holes, the surrounding images do not participate in the subsequent multi-view photometric consistency constraints on the spatial position of the internal sampling vertices and the geometric position iteration based on photometric residuals. If the number of visible cameras drops sharply within a certain viewing angle range, it is determined to be a physically occluded hole, and the range of occlusion azimuth angles is recorded for use in subsequent steps to remove invalid observation directions, thus completing the extraction of geometric features and color statistical features.

[0030] In this way, by using threshold-driven hole screening and multi-dimensional feature ring construction, the cause type of holes, the surrounding geometric orientation and color reference are recorded simultaneously, providing verifiable constraint inputs for the subsequent directional generation of internal geometry, and avoiding orientation distortion caused by blind geometric patching.

[0031] S2. Extrapolate to generate internal sampled vertices and generate initial fill patches.

[0032] In an optional embodiment, when initializing the filling vertices inside the hole, instead of directly performing planar triangulation of the boundary ring, the internal sampling vertices are generated by pushing outward layer by layer from the normal field of the geometric feature ring as a reference. Specifically, the vertices of the hole boundary ring are connected in ring order to form a closed polyline, and the normal vector of the innermost vertex of the geometric feature ring is used as the initial propagation direction to generate internal sampling vertices layer by layer along the radial direction pointing to the center of the hole. The weights are determined according to the reciprocal relationship of the geodesic distance; the farther the vertex is from the hole boundary, the lower the outer normal traction weight it receives. For example, the first vertex... The normal propagation weight of the layer vertex can be taken as The weighted average of the normals of adjacent outer layer vertices is taken as the normal vector of each layer vertex, so that the normal field of the internal sampled vertices smoothly transitions from the boundary orientation to the center of the hole, rather than forcibly assigning a fixed vertical or horizontal orientation. Since this extrapolation takes the undulation of the surrounding real features as the propagation source, the geometric trend inside the patch physically continues the continuity of the original mesh on both sides of the boundary, fundamentally avoiding the surface discontinuity caused by the flatness assumption.

[0033] For holes not identified as image inversion-restricted holes, the spatial position of the internal sampling vertices is corrected by incorporating the photometric consistency constraints of multi-view images. For vertices... The vertex is back-projected onto all visible camera images, and the absolute value of the difference between the projected color of each image and the mean projected color of that vertex is calculated. The mean value of all visible camera images is then taken as the luminosity residual of that vertex. This definition is completely consistent with the photometric residual aperture used in subsequent smoothing iterations. Using the initial triangulated mesh as the occlusion proxy, each camera's optical center is connected to its internal sampling vertex, and it is determined whether the connection intersects with the remaining faces of the initial triangulated mesh; if they do not intersect, the camera is determined to be visible to that vertex and is included in the back projection calculation; at the same time, cameras within the occlusion azimuth angle range are excluded.

[0034] Backproject each internally sampled vertex onto the image of its visible camera, and calculate the mean color difference of the same vertex at different image projection locations. If the mean color difference exceeds twice the standard deviation of the projected color... Then, finely adjust the spatial position of the vertex along the current normal direction until the mean color difference converges to twice the standard deviation of the projected color. Within this range. For cases identified as occluded holes, backprojection is performed only using cameras outside the occlusion azimuth range to avoid color contamination of vertex localization by the edge of the occlusion, ensuring that each projected color involved in the constraint comes from a viewpoint with valid observation conditions. For restricted holes retrieved from images, no spatial position correction of internally sampled vertices based on multi-view image photometric consistency is performed. The positions of the internally sampled vertices are maintained at the initial positions obtained by layer-by-layer extrapolation based on the geometric feature annular normal field, and initial infill patches are generated based on this using boundary-constrained triangulation.

[0035] After the spatial positions of the internal sampling vertices are determined, an initial infill patch is generated within the holes using boundary-constrained triangulation. The vertices of the boundary loops retain their original positions and indices, ensuring seamless topological bonding between the infill patch and the original mesh. The triangular facets of the initial infill patch are aligned with the average side length of the geometric feature loops to prevent excessively sparse or dense triangular faces within the infill patch, thus avoiding visual distortion caused by sampling rate jumps during subsequent texture mapping, which could result in local texture stretching or compression.

[0036] Thus, by combining normal extrapolation with the internal geometric generation process of multi-view photometric consistency inversion, the shape of the patch continues the true orientation of the ground features rather than the flat assumption, eliminating the cause of patch-like visual faults in existing geometric infilling methods, and providing an initial grid state in which the photometric residuals have partially converged for subsequent smoothing iterations.

[0037] S3. Perform smooth iteration and mesh subdivision to obtain the filled patch mesh.

[0038] In an optional embodiment, although the initial patch is continuous at the boundary, the normals of its internal vertices are still obtained by extrapolation, resulting in residual deviations from the true undulations of the original mesh. Directly applying existing coche Laplacian smoothing would treat vertices whose positions have not yet converged equally with those already confirmed by the image, causing unreliable vertices to pull off surrounding confirmed vertices, thus smoothing out the true details inside the boundary ring. Therefore, this application improves the existing coche Laplacian smoothing operator. The existing formula is:

[0039] in For vertices to be smoothed, Let it be the set of vertices in its ring neighborhood. As vertex The area of ​​the Thiessen polygon, and For the edge For the interior angles of the two triangular faces, this operator drives the vertex to move towards the local mean surface through the cotangent weighted difference of the neighborhood positions. The improved formula is:

[0040] The improvement over the existing formula lies in the treatment of each edge. The cotangent weight introduces an additional confidence factor. Its definition is:

[0041] in For the neighboring vertex Multi-view consistency residual The noise basis is the photometric residual. A confidence factor is constructed based on the photometric residual of neighboring vertices and the noise basis to control the contribution of neighborhood traction. This confidence factor is applied to the neighboring vertices. One side: when When it is smaller, it indicates The location has been confirmed by image observation and is reliable. The neighborhood vertex pairs approach one. The traction contribution is fully preserved; when When it is larger, it indicates Its own position has not yet converged. Approaching zero, its pulling effect is suppressed to prevent unreliable neighboring vertices from... Pull to one side.

[0042] For vertices to be smoothed Its own update step size, introducing an activation factor Its definition is:

[0043] in for Its own photometric residual is calculated as follows: Backproject onto all visible camera images, calculate the absolute value of the difference between the projected color of each image and the mean projected color of that vertex, and take the mean value of all visible camera images. An activation factor is constructed to control the update step size of the vertex to be smoothed based on its own photometric residual and noise basis. The actual update volume is .when When the photometric residual is large, it indicates that its position deviates from the true surface. Approaching one, allowing for larger step sizes to converge to the neighborhood mean; when When the residual is small, it indicates that its location has been confirmed by the image. Approaching zero, its own position is protected, and smoothing is suppressed. The above confidence factor is based on multi-apparentity residuals. and activators This applies only to infill vertices that are not identified as restricted apertures in image inversion. For infill vertices with restricted apertures in image inversion, the photometric residuals are not calculated using their surrounding images. and order , Smoothing iterations are performed using the coche Laplacian smoothing operator without introducing photometric residual modulation.

[0044] Furthermore, this two-layer separation design independently controls the traction confidence of the neighborhood anchor points and the convergence degree of the vertex to be updated itself, ensuring compatibility with the overall convergence process of the coche Laplacian operator and preventing the creation of isolated fixed points outside the iteration within the fill patch. (Noise substrate) Instead of being determined by pre-set empirical constants, it is based on color statistical feature calibration: vertices with a sufficient number of visible cameras and convergent residuals are selected on the geometric feature ring, and the root mean square error of their luminance residuals is used as the noise basis. This value represents the lower limit of the natural fluctuation of the residuals of the current image group under geometrically correct conditions.

[0045] Confidence factors and activation factors are introduced into the Laplacian smoothing operator to update the vertices of the initial patch until the vertex displacements converge, completing the smoothing iteration. After the smoothing iteration is complete, adaptive mesh subdivision is performed. All edges of the initial patch are traversed, and the normal angle between the two vertices of each edge is calculated: for normal angles exceeding the upper limit of the rate of change of the normal... The edges are partitioned at midpoints, and the normals of the new vertices are assigned by spherical interpolation based on the normals at both ends; for normals with an angle lower than the upper limit of the rate of change of the normal. And the side length is shorter than the average side length of the ring. Redundant short sides are folded. The triangular facet density is adjusted through the above subdivision and folding operations so that the triangular facet density of the filling patch follows the local geometric complexity distribution. The curved areas are densified to preserve shape, while the flat areas are simplified to reduce the number of faces. The triangular facet density discontinuity on both sides of the joint is eliminated, and finally the shaped filling patch mesh is obtained.

[0046] Thus, by using an improved Laplacian smoothing with a dual-layer separation of neighborhood confidence and self-activation, combined with a noise base based on statistical calibration using annular data and adaptive subdivision, the normal deviation of unconfirmed areas is converged to a state continuous with the original mesh while preserving the confirmed geometric details of the image. This fundamentally suppresses the lighting rendering artifacts caused by normal jumps at the seams.

[0047] S4. Regenerate texture coordinates and blend seam colors.

[0048] In an optional embodiment, after the fill patch mesh is shaped, texture coordinates are regenerated for the vertices inside the fill patch mesh. For each internal vertex, the image with the closest projected incident angle to orthogonal and unoccluded image from the visible camera is selected as the texture source. The projected coordinates are written into a newly allocated block of the texture atlas. The outer edge of the newly allocated block is expanded by the texture pixel size to prevent the texture from sampling colors of neighboring patches outside the boundary and to avoid the appearance of miscolored thin lines at the boundary of the atlas, thus completing the regeneration of texture coordinates.

[0049] Next, to address the color abrupt change at the texture seam, the transition band width is determined based on the projected pixel span of the geometric feature loops. Linear color migration is then performed within the transition band to blend the seam colors. Specifically, the transition band width is not determined by a fixed number of pixels, but rather by the average pixel span along the seam normal direction after the vertices of the geometric feature loops are projected onto the texture atlas. This average pixel span is then used as the transition band width on each side of the seam. .because The value is automatically provided by the actual ratio of the current model texture resolution to the mesh geometry scale, allowing for adaptive scaling across projects with different resolutions without requiring individual parameter adjustments for each project. The width is the transition band width. Within the transition zone, the average projected color recorded by the geometric feature ring is used as the anchor point. The pixels within the transition zone are linearly migrated according to their distance from the seam, so that the brightness and hue of the filling texture gradually approach the original mesh texture, and finally the seam color is integrated.

[0050] Furthermore, the final output is an optimized realistic 3D model. After texture fusion is completed, an integrity check is performed on the overall optimized mesh; after confirming that all edges are adjacent to two triangular faces, texture coordinates fall within the valid range of the atlas, and there are no pixel holes in the seam transition zone, the infill mesh is merged with the original mesh into a single watertight model; the single watertight model, along with the updated texture atlas, is output as the optimized realistic 3D model. It should be noted that there are many ways to achieve texture coordinate generation and atlas packaging in this field, and those skilled in the art can choose different atlas organization methods according to actual needs; this application does not limit this.

[0051] Thus, by automatically determining the transition band width based on the annular projection pixel span and using linear color migration, the texture of the fill patch gradually transitions to the original mesh in both brightness and hue dimensions. Under appropriate image coverage, texture resolution, and viewing conditions, the output watertight model exhibits good continuity in geometry, normal field, and texture junctions, reducing the visibility of seams during multi-scale walkthroughs and thus helping to meet the delivery and acceptance requirements of corresponding real-world 3D results.

[0052] Reference Figure 2The horizontal axis represents the horizontal position of the hole plane, and the vertical axis represents the vertical position of the hole plane. Figure 2 In the diagram, the distribution of infill patch vertices in existing methods is represented by forked scatter points, while the distribution of infill patch vertices in this application is represented by hollow circular scatter points. Solid lines represent the ideal boundary contour, and dashed lines represent the contour trend of existing methods. It can be observed that the vertex distribution dispersion of existing methods is significantly higher and deviates greatly from the ideal contour, while the vertices of the method in this application closely adhere to the ideal boundary. This indicates that this application effectively improves the spatial positioning accuracy of infill patch vertices through layer-by-layer extrapolation of the normal field and photometric consistency constraints.

[0053] In the description of this specification, "multiple" or "several" means at least two, such as two, three or more, unless otherwise expressly and specifically defined.

Claims

1. A method for filling holes and optimizing meshes in a realistic 3D model, characterized in that, include: S1, detect the hole boundaries of the real-world 3D mesh to extract closed hole boundary loops, expand adjacent triangular faces outward to construct geometric feature loops, and extract the geometric features and color statistical features of the vertices within the geometric feature loops; S2, based on the normal field of the geometric feature ring, pushes outward layer by layer into the hole to generate internal sampling vertices, and combines the photometric consistency constraint of multi-view image to correct the spatial position of the internal sampling vertices, thereby generating the initial filling patch; S3, based on color statistical features, calibrates the noise base, and uses the noise base and photometric residual to construct confidence factors and activation factors. Through an improved smoothing operator, smoothing iteration and adaptive mesh subdivision are performed on the initial infill patch to obtain the finalized infill patch mesh. S4 regenerates texture coordinates to fill in the vertices inside the mesh and determines the width of the transition zone based on the projected pixel span of the geometric feature ring. Linear color migration is performed within the transition zone to blend the seam colors, and finally, the optimized realistic 3D model is output.

2. The method according to claim 1, characterized in that, The method of detecting hole boundaries in a real-world 3D mesh to extract closed hole boundary loops includes: Traverse the edges of the real-world 3D mesh to extract candidate boundary loops, and count the enclosed area of ​​all candidate boundary loops; Using the median of the enclosed area as the retention threshold, candidate boundary loops with an enclosed area lower than the retention threshold are identified as fragmented noise loops and are folded and eliminated. Candidate boundary rings with an enclosing area equal to or higher than the retention threshold are identified as valid hole boundary rings and retained, ultimately resulting in closed hole boundary rings.

3. The method according to claim 1, characterized in that, The extraction of geometric features and color statistical features of vertices within the geometric feature ring includes: Extract vertex normals, local principal curvatures, mean projected color, and standard deviation of projected color for each vertex. Calculate the normal angle between adjacent vertex pairs within the geometric feature ring, and take the maximum value as the upper limit of the normal change rate; The number of visible cameras and the back-projected color residuals of each vertex of the geometric feature ring in all images are statistically analyzed to determine the type of hole formation and record the occlusion azimuth range, ultimately completing the extraction of geometric and color statistical features.

4. The method according to claim 1, characterized in that, The process of generating internal sampling vertices by pushing them outward layer by layer into the hole based on the normal field of the geometric feature ring includes: Connect the vertices of the hole boundary ring in the ring sequence to form a closed broken line; Using the normal vector of the innermost vertex of the geometric feature ring as the initial propagation direction, internal sampling vertices are generated layer by layer along the radial direction pointing to the center of the hole; The weights are set according to the geodesic distance attenuation from the vertex to the boundary ring of the hole, and the weighted average of the normals of the adjacent outer layer vertices is taken as the normal vector of each layer vertex, thus obtaining the internal sampled vertices.

5. The method according to claim 3, characterized in that, The step of combining the photometric consistency constraints of multi-view images to correct the spatial position of internal sampling vertices, thereby generating an initial padding patch, includes: Each internally sampled vertex is back-projected onto the image of its visible camera, and the average color difference of the same vertex at different image projection positions is calculated. If the mean color difference exceeds twice the standard deviation of the projected color, then finely adjust its spatial position along the current normal direction of the vertex until the mean color difference converges to within twice the standard deviation of the projected color. Initial filling patches are generated within the holes using boundary-constrained triangulation.

6. The method according to claim 3, characterized in that, The process of performing smoothing iterations on the initial infill patch using an improved smoothing operator includes: selecting vertices on the geometric feature ring with at least two visible cameras and whose back-projected color residuals are no greater than twice the standard deviation of the projected color of the corresponding vertex; using the back-projected color residuals of the selected vertices as photometric residuals; and calculating the mean square error of the photometric residuals as the noise basis; constructing confidence factors to control the contribution of neighborhood traction based on the photometric residuals and noise basis of the neighboring vertices; and constructing activation factors to control the update step size of the vertex itself based on its own photometric residuals and noise basis; and introducing the confidence factors and activation factors into the Laplacian smoothing operator to update the displacement of the vertices of the initial infill patch until the maximum displacement modulus of all vertices of the initial infill patch in the current smoothing iteration is no greater than 1% of the average side length of each edge within the geometric feature ring, thus completing the smoothing iteration.

7. The method according to claim 3, characterized in that, The step of performing smoothing iteration and adaptive mesh subdivision on the initial infill patch using an improved smoothing operator to obtain the finalized infill patch mesh also includes: After the smoothing iteration is completed, traverse all edges of the initial filling patch and calculate the normal angle between the two vertices of each edge; For edges with a normal angle exceeding the upper limit of the normal rate of change, perform midpoint subdivision; for edges with a normal angle below the upper limit of the normal rate of change and a length shorter than the average side length of the annulus, perform midpoint subdivision. Redundant short sides are folded. By adjusting the density of the triangular faces through the above splitting and folding operations, the final filled mesh is obtained.

8. The method according to claim 1, characterized in that, The process of regenerating texture coordinates to fill in the vertices inside the patch mesh includes: For each internal vertex, select the image from the visible camera whose projected incident angle is closest to orthogonal and which is not occluded as the texture source; Write the projected coordinates into the newly allocated block of the texture atlas; Expand the outer edge of the newly allocated block by pixel margins according to the texture pixel size to complete the regeneration of texture coordinates.

9. The method according to claim 1, characterized in that, The projection pixel span based on the geometric feature ring determines the transition band width, and linear color migration is performed within the transition band to blend the seam colors, including: The average pixel span along the seam normal direction after the vertex of the statistical geometric feature ring is projected onto the texture atlas is taken as the width of the transition zone on both sides of the seam. Within the transition zone, which is the width of the transition zone, the average projected color recorded by the geometric feature ring is the anchor point; Linear color migration is performed on the pixels within the transition zone according to their distance from the seam, so that the brightness and hue of the filling texture gradually approach the original mesh texture, and finally the seam color is blended.

10. The method according to claim 9, characterized in that, The final output optimized real-world 3D model includes: After texture blending is complete, an integrity check is performed on the overall optimized mesh; After confirming that all edges are adjacent to two triangular faces, texture coordinates fall within the effective range of the atlas, and there are no pixel holes in the seam transition zone, the filling mesh and the original mesh are merged into a single watertight model. The single watertight model, along with the updated texture atlas, is output as an optimized realistic 3D model.