Method and system for digital restoration of cultural relic pattern shape based on generative model
The digital restoration method for cultural relic patterns using generative models solves the problem of aligning multi-view information of patterns on complex curved surfaces, achieves structural continuity and consistency in pattern restoration, and improves the restoration effect of cultural relic patterns.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN NORMAL UNIV
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-26
Smart Images

Figure CN122023200B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital cultural relic restoration technology, and more specifically, this application relates to a method and system for digital restoration of cultural relic patterns based on generative models. Background Technology
[0002] The surface patterns of cultural relics carry the aesthetic and technological information of a specific era. To meet the needs of preservation, recording, digital display, and resource utilization of these patterns, it is typically necessary to digitize the morphology of the collected surface patterns and reconstruct damaged areas. Current digital restoration methods for cultural relic patterns generally rely on image acquisition and 3D digitization. This involves obtaining pattern information through multi-view imaging or scanning of the artifact's surface, and then extracting, aligning, and fusing the patterns on the 2D image or 3D model surface. Based on this, missing areas caused by damage, abrasion, or occlusion are often filled using methods such as patch filling based on similar textures, copying repeated units, image repair, or learning generation. The restoration results are then adjusted by manual verification to obtain a continuous and complete pattern representation. However, as applications demand higher precision, consistency, and reusability of patterns, the problems exposed by the above process when handling complex curved surfaces, multi-view information, and structured pattern patterns are becoming increasingly apparent.
[0003] In the digital restoration of existing cultural relic patterns, common challenges include: patterns are attached to complex curved surfaces and are affected by occlusion, reflection, and changes in viewing angle, making it difficult to stably align and reliably integrate multi-view pattern information, which leads to easy drift in key geometric relationships such as the main direction and bandwidth of the pattern; at the same time, patterns themselves have structural regularities such as repetition, symmetry, and closure / convergence, but traditional completion methods rely more on local texture similarity or direct generation, lacking verifiable structural constraints and localizable error feedback mechanisms, thus easily causing misalignment in pitch, phase, and closure relationships, resulting in results that appear reasonable locally but distort the overall structure, making it difficult to directly use as highly consistent pattern materials that can be reused in clothing design, decoration, and other scenarios. Therefore, a digital restoration method and system for cultural relic patterns based on generative models is proposed to solve this problem. Summary of the Invention
[0004] To address the aforementioned technical problems, this technical solution provides a method and system for digital restoration of cultural relic patterns based on generative models, thus resolving the issues raised in the background section.
[0005] To achieve the above objectives, the technical solution of the present invention is as follows:
[0006] Firstly, this application provides a method for digital restoration of cultural relic patterns based on generative models, the method comprising:
[0007] A set of surface images of the target artifact is acquired, and a base mesh is obtained through 3D reconstruction and standardization. The registration and projection of the surface image set onto the base mesh are then fused to form mesh pattern evidence and multiple views. Figure 1 Consistency measurement;
[0008] Based on grid pattern evidence and multiple views Figure 1 Consistency measurement: On the base grid, determine the pattern band with the main direction of the pattern as the major axis and the lateral width limited, and extract its center line and lateral width distribution to form the band geometric parameters;
[0009] Using strip geometric parameters, the pattern strip body is parameterized and unfolded into a two-dimensional strip restoration domain. Its mapping relationship with the base mesh is recorded, and the mesh pattern evidence is resampled into strip pattern according to the mapping relationship.
[0010] Based on the strip pattern, the two-dimensional strip repair domain is divided into intact regions and defect masks. Repeated pattern units are extracted from the intact regions to construct a pattern unit library. Structural event points that characterize symmetry benchmarks, adjacency relationship bifurcation, and closure or convergence are detected from the library. Event sequences and pitches are generated by sorting the pattern main direction.
[0011] Under the constraints of event sequence, pitch and pattern unit library, pattern unit assembly and completion are performed on the defective mask to obtain candidate repair patterns, and the event closure error is calculated from the closure consistency of event sequence and pitch consistency deviation.
[0012] When the event closed-loop error exceeds the preset error threshold, the event closed-loop error is back-projected to the base grid positioning error segment according to the mapping relationship. The center line or lateral width distribution is adjusted along the error segment to update the strip geometric parameters and regenerate the candidate repair pattern until the stopping condition is met.
[0013] The candidate repair patterns are input into the generative model, and the event sequence and pitch are encoded as conditional constraints, outputting a planar repair pattern with enhanced details.
[0014] Secondly, this application provides a digital restoration system for cultural relic patterns based on generative models, used to implement the digital restoration method for cultural relic patterns based on generative models described in any of the above claims, including:
[0015] The 3D reconstruction and fusion module is used to acquire a set of surface images of the target artifact. After 3D reconstruction and standardization, a base mesh is obtained. The registration and projection of the surface image set onto the base mesh are then fused to form mesh pattern evidence and multiple views. Figure 1 Consistency measurement;
[0016] The band body parameter extraction module is used for evidence based on grid patterns and multiple views. Figure 1Consistency measurement: On the base grid, determine the pattern band with the main direction of the pattern as the major axis and the lateral width limited, and extract its center line and lateral width distribution to form the band geometric parameters;
[0017] The two-dimensional unfolding and resampling module is used to parameterize and unfold the pattern strip body into a two-dimensional strip restoration domain using strip geometric parameters, record its mapping relationship with the base mesh, and resample the mesh pattern evidence into strip patterns according to the mapping relationship.
[0018] The event sequence generation module is used to divide the two-dimensional strip repair domain into intact regions and defect masks based on strip patterns. It extracts repeated pattern units in the intact regions to construct a pattern unit library, and detects structural event points that characterize symmetry benchmarks, adjacency relationship bifurcation, and closure or convergence from the library. The event sequence and pitch are generated by sorting the pattern main direction.
[0019] The repair error calculation module is used to perform pattern unit assembly and completion on the defective mask under the constraints of event sequence, pitch and pattern unit library to obtain candidate repair patterns, and calculate the event closure error from the closure consistency and pitch consistency deviation of the event sequence.
[0020] The iterative optimization and adjustment module is used to back-project the event closed-loop error to the base grid positioning error segment according to the mapping relationship when the event closed-loop error exceeds the preset error threshold. The module then adjusts the center line or lateral width distribution along the error segment to update the strip geometric parameters and regenerate candidate repair patterns until the stopping condition is met.
[0021] The model enhancement output module is used to input candidate repair patterns into the generative model, encode event sequences and pitches as conditional constraints, and output detailed planar repair patterns.
[0022] Thirdly, this application provides a computer device, which includes a memory and a processor. The memory stores code, and the processor is configured to acquire the code and execute the above-described method for digital restoration of cultural relic patterns based on generative models.
[0023] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for digital restoration of cultural relic patterns based on generative models.
[0024] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0025] This application constructs a pattern unit library from intact regions within a two-dimensional strip repair domain, identifies symmetry reference switching, bifurcation merging, and closure convergence structural event points, and forms event sequences and pitch constraints. This constraint mechanism overcomes the defects of traditional completion methods, such as unverifiable structural rules, pitch phase misalignment, and closure misalignment, which are caused by reliance on local texture similarity or generative models. It achieves verifiable structural continuity maintenance and periodic consistency constraints, transforming pattern repair from appearance similarity to structural correctness.
[0026] This application constructs an event closed-loop error and backfeeds it to the three-dimensional base mesh to locate the error segment. It iteratively optimizes the centerline and lateral width distribution along the segment to update the geometric parameters of the strip. This overcomes the difficulty in tracing the source of structural mismatch and the defects of local correction causing global offset due to divergence. It establishes a self-correcting closed-loop control mechanism from structural error to geometric parameters, so that the repair process has a convergent optimization path and stable global structural consistency. Attached Figure Description
[0027] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Wherein:
[0028] Figure 1 This is a flowchart of the digital restoration method for cultural relic patterns based on generative models proposed in this invention;
[0029] Figure 2 This is a structural block diagram of the digital restoration system for cultural relic patterns based on generative models proposed in this invention. Detailed Implementation
[0030] It is readily understood that, based on the technical solution of this invention, those skilled in the art can propose various interchangeable structural methods and implementations without altering the essential spirit of the invention. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this invention and should not be considered as the entirety of the invention or as limitations or restrictions on the technical solution of this invention.
[0031] Reference Figure 1 As shown, this application proposes a digital restoration method for cultural relic patterns based on generative models, including:
[0032] A set of surface images of the target artifact is acquired, and a base mesh is obtained through 3D reconstruction and standardization. The registration and projection of the surface image set onto the base mesh are then fused to form mesh pattern evidence and multiple views. Figure 1 Consistency measurement;
[0033] It should be noted that the mesh pattern evidence obtained through registration and projection fusion is the pattern intensity or texture response (such as normalized quantities like grayscale / color, gradient magnitude, or filter response) defined on the mesh sampling points / patterns (denoted as mesh points). (Multi-view) Figure 1 Consistency measures characterize the degree of consistency of the same point under multiple view projections; both provide evidence and a basis of credibility for subsequent pattern band extraction and error correction.
[0034] Based on grid pattern evidence and multiple views Figure 1 Consistency measurement involves identifying a pattern band on the base grid with the main direction of the pattern as its major axis and a limited lateral width, and extracting its centerline and lateral width distribution to form band geometric parameters; wherein, the pattern band refers to a band-shaped region extending along the main direction of the pattern and having its boundary defined by the lateral width distribution in a lateral direction orthogonal to the main direction of the pattern.
[0035] The pattern strip body is parameterized and unfolded into a two-dimensional strip restoration domain using strip geometric parameters. The mapping relationship between the strip and the base mesh is recorded. The mesh pattern evidence is then resampled into strip patterns according to the mapping relationship. The mapping relationship is used for the correspondence and resampling between the three-dimensional base mesh and the two-dimensional strip restoration domain, and supports subsequent mapping and back-projection operations.
[0036] Based on the strip pattern, the two-dimensional strip repair domain is divided into intact regions and defect masks. Repeated pattern units are extracted from the intact regions to construct a pattern unit library. Structural event points that characterize symmetry benchmarks, adjacency relationship bifurcation, and closure or convergence are detected from the library. Event sequences and pitches are generated by sorting the pattern main direction.
[0037] Under the constraints of event sequence, pitch and pattern unit library, pattern unit assembly and completion are performed on the defective mask to obtain candidate repair patterns, and the event closure error is calculated from the closure consistency of event sequence and pitch consistency deviation.
[0038] When the event loop closure error exceeds a preset error threshold, the event loop closure error is back-projected to the base grid positioning error segment according to the mapping relationship. The center line or lateral width distribution along the error segment is adjusted to update the strip geometric parameters, and candidate repair patterns are regenerated until the stopping condition is met. The stopping condition is that the number of iterations reaches a preset number or the decrease in the event loop closure error is lower than a preset decrease threshold. For example, the preset number of iterations ranges from [3, 20], and a typical value is 8; the preset decrease threshold ranges from [0.01, 0.05], and a typical value is 0.02.
[0039] The candidate repair patterns are input into the generative model, and the event sequence and pitch are encoded as conditional constraints, and the output is a planar repair pattern with enhanced details.
[0040] It should be noted that the generative model in this scheme is used to enhance the details of the candidate repair patterns. It can be any of the diffusion model, conditional generative adversarial network or autoregressive generative model. Typically, it generates texture details in the defect mask in a repair manner and achieves a natural transition with the intact area at the boundary.
[0041] To ensure that the generated results do not violate the established structural constraints, this embodiment encodes the event sequence and pitch as conditional constraint inputs to participate in the generative model inference process: On the one hand, the type of structural event points and their positions along the main direction of the pattern are encoded as conditional sequences and mapped to conditional channels on the two-dimensional strip repair domain (e.g., event point position map / type embedding map), which are used to indicate that structural positions such as symmetry switching, bifurcation merging, and closure convergence remain unchanged during the generation process; on the other hand, the pitch is encoded as periodic conditions (e.g., phase position encoding or periodic prior channel), which are used to constrain the repetition period and alignment relationship of the generated texture in the main direction; thus, the generative model mainly generates high-frequency textures and local texture details within the defect mask, while the event sequence and the structural skeleton described by the pitch remain consistent, resulting in a planar repair pattern with enhanced details;
[0042] The final output of this invention is a strip repair pattern image defined on a two-dimensional strip repair domain (covering the intact area and the defect mask), wherein the pixels of the defect mask are refined by a generative model, the intact area retains the original strip pattern or is locally updated in the transition zone according to the boundary fusion strategy; when it is necessary to back-project to the base mesh, the strip repair pattern can be back-projected as a mesh texture according to the mapping relationship between the two-dimensional strip repair domain and the base mesh;
[0043] Through the above technical solution, this embodiment unifies the projection and fusion of multi-view pattern evidence onto the base mesh and extracts the geometric parameters of the pattern strip. This allows distortions, occlusions, and local defects caused by multiple perspectives to be constrained and filtered by consistency measurement under the same three-dimensional geometric reference system, and narrows the repair range to a strip along the main direction to reduce the search space and drift risk. A pattern unit library is constructed within the two-dimensional strip repair domain, and event sequences and pitches are generated as structural constraints. This elevates pattern continuity from pixel similarity to verifiable repetitive cycles and topological structure rules, avoiding periodic misalignment and closure failure. By backfeeding event closure errors to the three-dimensional mesh to locate error segments and iteratively correcting the centerline and width distribution, structural inconsistencies are transformed into locatable and convergently optimized geometric root cause corrections, rather than simply patching in the two-dimensional domain. Finally, under the constraints of event sequences and pitches, a generative model is used for detail enhancement. This allows the generative model to handle texture naturalization and detail compensation without dominating structural inference. With the structural skeleton verified, this improves texture continuity and visual consistency, thereby enhancing the structural correctness and cross-viewability of cultural relic pattern defect repair. Figure 1 Consistency and visual continuity.
[0044] In an optional embodiment, a pattern band is defined on the base grid, with the main direction of the pattern as its major axis and a limited lateral width, specifically including:
[0045] On the base grid, based on grid pattern evidence and multiple views Figure 1 Consistency measures generate a consistency weight map, and high confidence regions are selected by combining it with pre-set confidence criteria;
[0046] It should be noted that the consistency weight map assigns a weight [0,1] to each grid point in the base grid. The larger the weight value, the more consistent the images are from multiple viewpoints, and the more credible the grid pattern evidence is.
[0047] For example, the weights of each point in the consistency weight graph are: ,in, For consistency weight, For multiple views Figure 1 Consistency measurement The scaling parameter is typically 0.10; the preset confidence criterion is: using... As a high-confidence region screening criterion, after multi-view registration and fusion of surface image sets, low consistency metrics are more likely to be caused by occlusion / reflection / registration bias. Eliminating these first can reduce false detections of texture orientation fields and structural event points. The threshold for the consistency weighting graph is [0.5, 0.8], with a typical value of 0.6.
[0048] Local gradient vectors of the grid pattern evidence in the base grid are extracted to construct the pattern orientation field. The distribution of the pattern orientation field is statistically analyzed in the high confidence region to determine the main orientation of the pattern, and local grid segments are extracted along the main orientation of the pattern.
[0049] It should be noted that after projecting the grid pattern evidence onto the local tangent plane, the gradient of the grayscale / color of the strip pattern is calculated in the local tangent plane. Its direction points to the normal direction where the pattern intensity changes the fastest, while the pattern tangent is taken as the direction orthogonal to the gradient. Then, statistics are performed on all pattern tangents in the high confidence region to obtain the main direction of the pattern.
[0050] Local parametric expansion is performed on the tangent plane of local mesh fragments, and the mesh pattern evidence is resampled into local strip patterns. Geometric event points are detected in the local strip patterns and written back to the base mesh according to the local parametric expansion relationship to form a candidate point set. Among them, the geometric event points are: anchor points with significant structural responses along the main direction (such as gradient extrema, symmetric response peaks, significant boundary responses within the strip, etc.) detected in the local strip patterns, which are used for subsequent centerline main chain tracing; the geometric event points detected in the local strip patterns can be used as a candidate set for structural event point detection, and the points that meet the conditions of topology switching, bifurcation merging, or closure convergence are further confirmed as structural event points on the cell adjacency graph.
[0051] An event adjacency graph is constructed using the candidate point set, and edge weights are calculated. The event main chain with the largest cumulative edge weight and the highest consistency between the main direction and the main direction of the pattern is selected as the center line, and the tangent and normal of the center line are calculated. The edge weight is used to measure the rationality of candidate point pairs as adjacent nodes of the center line. It is determined by the consistency between the connection direction and the main direction of the pattern, the confidence of the evidence in the region where the candidate point pair is located (given by the consistency weight graph), and the distance between candidate point pairs or the penalty for crossing low confidence zones. The larger the edge weight, the more likely it is to be connected in the event adjacency graph to form an event main chain.
[0052] For each sampling point of the centerline, multiple sets of boundary point pairs are generated in the normal direction to form a candidate width set. Each candidate width set is resampled into a local strip pattern according to the local parameterized expansion relationship.
[0053] Local pitches are calculated on each local strip pattern to obtain pitch stability, which is obtained by combining the dispersion of adjacent local pitches with the consistency of rhythm peaks; wherein, the local pitch is a local estimate of the repetition period along the main direction of the pattern.
[0054] It should be noted that rhythm peak consistency is: when performing periodic response calculations (such as sliding autocorrelation) on local strip patterns along the main direction of the pattern, the degree to which the obtained main peak position (corresponding to local pitch) and the main peak significance remain stable and consistent between adjacent windows / adjacent sampling points. The less the main peak position drifts and the more consistently prominent the main peak is, the higher the rhythm peak consistency is.
[0055] Furthermore, for each centerline point, different lateral widths were tried and the rhythmic stability of the strip pattern after resampling was observed to determine the most suitable lateral width; the local pitch is the repetition period estimated along the main direction on the local strip pattern, which has the same dimension as the pitch and is its application in the local strip pattern.
[0056] For example, the pitch stability is: ,in, For pitch stability, It is an adjacent local interval sequence. For rhythm peak consistency and the range of values is [0,1]; using pitch stability to inversely deduce bandwidth is to use the periodic structure of the pattern as the criterion for geometric extraction.
[0057] For each sampling point, the boundary point pair with the largest pitch stability is selected as the boundary of that point and spliced together to form a transverse width distribution. Based on the center line and the transverse width distribution, a patterned band is constructed on the base grid.
[0058] Through the above technical solution, this embodiment filters high confidence regions and constructs orientation field and event adjacency graphs by using a consistency weight graph, and then determines the center line and lateral width distribution by width selection based on local pitch stability, thereby extracting the geometric parameters of the strip more robustly under complex patterns and multi-view noise conditions.
[0059] In an optional embodiment, repeating pattern units are extracted from intact regions to construct a pattern unit library, and structural event points representing symmetry benchmarks, adjacency relationship bifurcation, and closure or convergence are detected from it. Event sequences and pitches are generated by sorting the pattern's main direction, specifically including:
[0060] The pattern's main direction is mapped to a two-dimensional strip restoration domain using a mapping relationship. Within the intact region, sliding autocorrelation calculations are performed on the strip pattern along the mapped pattern's main direction, and the correlation peak positions are used to generate a rhythm candidate point sequence. Specifically, within the two-dimensional strip restoration domain, periodic repetition positions are found along the main direction through sliding autocorrelation calculations to form a candidate rhythm candidate point sequence.
[0061] Based on the rhythmic candidate point sequence, the repeated segments in the strip pattern are segmented and the segment boundary curves are extracted. The boundary curves are normalized and written into the pattern unit library and the unit outline is recorded. Among them, the repeated segments of the pattern are obtained by segmenting the rhythmic candidate point sequence, and their boundary curves are standardized and stored in the unit library. The unit outline is recorded for subsequent matching and assembly.
[0062] Mirror matching and registration are performed on the unit contour to obtain the mirror registration axis and its registration error. The mirror registration axis with the registration error lower than the preset registration threshold is recorded as the symmetry reference. For example, mirror symmetry belongs to strong geometric constraints. If the threshold is too large, it will misjudge the asymmetric structure as symmetric, which will destroy the reliability of the event sequence. If the threshold is too small, it will miss the detection. Therefore, the preset registration threshold range is [0.05, 0.20], and the typical value can be 0.10.
[0063] A unit adjacency graph is constructed based on the relative pose and adjacency relationship of the unit contour in the strip pattern. The positions of symmetry reference switching, adjacency relationship bifurcation or merging, and boundary curve closure or convergence are detected on the unit adjacency graph and recorded as structural event points.
[0064] The event sequence is obtained by sorting the structural event points according to the main direction of the pattern, and robust statistics are performed on the spacing between adjacent structural event points of the same type to generate pitch.
[0065] To facilitate understanding of the above embodiments, a specific application scenario of the above embodiments will be used as an example for illustration below:
[0066] The application scenario is: continuous decorative patterns commonly found on the surface of Sanxingdui artifacts. The pattern unit is composed of "eye-shaped outline (closed) + feather wing forked line + end vortex (closed or converging)", which repeats periodically along the main direction of the pattern.
[0067] S1. Pattern unit extraction and pattern unit library establishment:
[0068] Within the intact region of the two-dimensional strip restoration domain, sliding autocorrelation is performed on the strip pattern along the main direction of the mapped pattern. The positions of the correlation peaks are used to generate a sequence of rhythmic candidate points. The distance between adjacent rhythmic candidate points is used as the initial interval estimate and denoted as... In this example Based on this, 10 repeating segments were obtained from the striped pattern and denoted as pattern units. The boundary curves of each unit are extracted. The boundary curves are normalized (scale normalized to unit length, aligned to a uniform direction according to the main pattern direction), written into the pattern unit library, and the center position of each unit within the strip domain is recorded and denoted as... , The coordinates are the arc length along the main direction of the pattern, in units of... ;
[0069] S2. Symmetrical reference and "symmetrical reference switching" structural event points:
[0070] Perform mirror matching and registration on each unit contour to obtain the mirror registration axis and normalized registration error, denoted as . and will Normalize to the interval [0,1] according to the unit scale; when At that time, it was assumed that the unit profile had a symmetrical datum. To preset the registration threshold, and simultaneously record the symmetry axis direction category (e.g., clustering by axis direction into "approximately vertical" and "tilted"), in this example, The axis of symmetry is vertical (corresponding to the main symmetry of the "eye" unit). The axis of symmetry is inclined (corresponding to the overall inclined symmetry of the combination of wings and vortex), therefore exist The intersection of and is denoted as a structural event point of a "symmetric reference switch", and its event location is taken as . ;
[0071] S3. Cell Adjacency Graph Construction and "Bifurcation / Merger, Closure / Convergence" Structural Event Points:
[0072] Construct a unit adjacency graph using pattern units as nodes: If and It satisfies the condition of being adjacent to each other along the main direction of the pattern, i.e. Furthermore, if the lateral projections overlap, then there are connecting edges. and put The horizontal relative offset is used as an edge attribute for subsequent forking / merging determination;
[0073] Among them, structural event points were detected on the adjacency graph:
[0074] Adjacency-based fork: If a node If there are two or more forward-connectable successors (e.g., a "feather" pattern splits into two, creating two continuous branches), then at this node position... This is denoted as the fork event point; in this example, at A fork appears nearby, approximately ;
[0075] Adjacency merging: If a node If there are two or more forerunners (two wing markings re-converging into the same "vortex / eye socket" area), then at that node position... This is denoted as the merged event point; in this example, at A merger occurred nearby, approximately ;
[0076] (Boundary curve) Closure or convergence: Perform a closure check on the endpoints of each unit boundary curve. If the normalized distance between the endpoints is less than 1 / 3, the boundary curve will be closed. Then it is denoted as a closed event point; if the boundary endpoints of adjacent cells are close to each other within the strip domain and the normalized distance between the endpoints is also less than 1 / 3, then the closed event point is considered a closed event point. These are then recorded as convergence event points. In this example, the "eye-shaped profile / vortex end" generally satisfies the closed feature, so the closed event points are relatively dense and can be used for subsequent pitch estimation.
[0077] S4. Event Sequence Generation and Pitch Robust Statistics:
[0078] The detected structural event points are uniformly represented as binary tuples. ,in ,according to The event sequence is obtained by sorting the events from smallest to largest, and the interval is obtained by robustly statistically analyzing the distance between adjacent events of the same structure.
[0079] In this example, the position of the closing event point (corresponding to the closing of the eye shape outline or the closing of the spiral) on the main direction coordinate of the pattern is selected as follows.
[0080] The adjacent spacing is approximately
[0081] In robust statistical analysis, the median is first used as the initial value. Then, outliers deviating from the median by more than 20% are removed (there are no outliers in this example). The average of the remaining intervals is then taken to obtain the pitch. This yields the "event sequence + pitch", which serves as the conditional constraint input for subsequent defect assembly and generative modeling.
[0082] Through the above technical solution, this embodiment extracts rhythmic candidate points and constructs a pattern unit library by sliding autocorrelation, then determines the symmetry reference and the adjacency graph by mirror registration to detect structural event points and obtains the pitch by robust statistics, thereby explicitly transforming the pattern repetition structure into a structural constraint of "event sequence + pitch", improving the structural consistency of defect completion.
[0083] In an optional embodiment, the event closed-loop error is back-projected onto the base grid positioning error segment according to the mapping relationship, and the centerline or lateral width distribution is adjusted along the error segment to update the strip geometry parameters, specifically including:
[0084] The event closed-loop error is back-projected onto the base grid according to the mapping relationship to generate an error weight field, and connected component analysis is performed in the neighborhood of the center line to extract the error segment;
[0085] It should be noted that the event loop error generated during the assembly and completion of pattern units in the defective mask is located back to the base mesh to form an operable correction region. Connectivity analysis is used to aggregate the event loop error into segments by backfeeding the corresponding mesh points.
[0086] Lateral displacement search is performed along the centerline normal within the error range, and mesh pattern evidence and multiple views are collected. Figure 1 The centerline is updated by using the weighted cumulative value of the consistency metric to satisfy the preset cumulative criterion for displacement.
[0087] It should be noted that updating the center line essentially involves: within the error segment around the center line, tentatively shifting the center line slightly to the left or right in the normal direction and recording this shift as the displacement; then determining whether the pattern evidence near the center line is strong and multi-faceted after the shift. Figure 1 If the overall degree of uniformity has improved, and if it has improved to the point of meeting the preset cumulative criteria, then the center line is updated according to that displacement.
[0088] For example, the process of updating the center line is as follows:
[0089] Let the point on the center line be denoted as The three-dimensional coordinates of the centerline on the base grid are: Its normal unit vector is Candidate displacements are used ( (To maximize the lateral search amplitude) the centerline sampling points within the error range are translated along the normal direction to obtain the candidate centerline. If the preset accumulation criterion is met, the candidate centerline is used as the updated centerline.
[0090] The candidate point corresponding to the candidate displacement is defined as: , The three-dimensional coordinates of the candidate points;
[0091] Mesh pattern evidence refers to the evidence obtained by registering, projecting, and fusing multi-view surface images onto a base mesh, and then sampling the mesh at the center of the mesh sampling point / patch (i.e., the mesh point, denoted as ). The pattern intensity or texture response obtained at point ) can be used as evidence of the mesh pattern using the gradient magnitude of the mesh points.
[0092] ;
[0093] In the formula, The measure of grid pattern evidence and , The intensity of the pattern (pixel grayscale / brightness or brightness obtained from color conversion). The gradient is calculated in a local tangent plane of the mesh or in locally parameterized coordinates. This is the normalization function;
[0094] Use consistency weight As a multi-view Figure 1 The calculated value of the consistency metric is substituted into the weighted cumulative objective function to calculate the weighted cumulative value:
[0095] ;
[0096] In the formula, This is the weighted cumulative value. Let be the set of centerline sampling points within the error range, and be the candidate points corresponding to the sampling points. A set;
[0097] The preset cumulative criterion is: ,in, This is the weighted cumulative value of the current centerline position, i.e., the baseline score when the centerline is not moved. The preset cumulative threshold can be 0.05;
[0098] Within the error range, perform bilateral step correction on the boundary point pairs of the lateral width distribution. Take the correction amount that is consistent with the gradient sign of the mesh pattern evidence at the boundary point and satisfies the preset smoothness constraint to update the lateral width distribution. Write the updated centerline and lateral width distribution into the strip geometry parameters.
[0099] It should be noted that for each centerline sampling point, the left and right boundary points are corrected by two-sided step correction along their outward normal vectors. The correction amount is taken within the normal range and used to update the left and right boundary points respectively. If the updated boundary satisfies the double judgment, the horizontal width distribution is updated accordingly.
[0100] For example, the double determination for updating the horizontal width distribution is as follows:
[0101] Let the left and right boundary points corresponding to the i-th centerline sampling point be... , Then the width at that sampling point is: ;
[0102] The boundary update formula can be: , ,in, For the updated left boundary point, For the updated right boundary point, , This is a correction amount;
[0103] The consistent gradient sign indicates that the direction of pattern intensity change along their respective outward normals at the left and right boundaries should be consistent, indicating that both boundaries are located at the true edge of the pattern band.
[0104] Let the outward normal unit vectors of the left and right boundaries be denoted as follows: , The directional derivative at the boundary is defined as , ;
[0105] The gradient signs are considered to be consistent when the following equation is satisfied: It indicates that the intensity change direction of the left and right boundaries is consistent, thus avoiding boundary drift caused by one side of the boundary falling into the pattern and the other side of the boundary falling into the background.
[0106] The preset smoothing constraints adopt the following two levels of smoothing constraints:
[0107] Relative change constraints between adjacent points:
[0108] ;
[0109] In the formula, The relative change threshold is set to [0.10, 0.35], with a typical value of 0.20. The actual pattern bandwidth usually changes slowly along the main direction, and excessively large adjacent abrupt changes are mostly caused by noise, projection error, or boundary misselection.
[0110] Second-order difference smoothing constraint:
[0111] ;
[0112] In the formula, For local average width, The threshold value is a second-order difference and can be 0.1; the preset smoothing constraint is used to limit unreasonable high-frequency oscillations in the width distribution, making the boundary line corresponding to the lateral width distribution more stable and interpretable.
[0113] Through the above technical solution, this embodiment uses error back-projection and connected domain positioning to locate error segments, and performs centerline normal displacement update and width distribution smoothing constraint correction within the error segments, thereby transforming structural errors into operable geometric parameter updates and improving the consistency and convergence stability of candidate repair patterns and original pattern evidence.
[0114] In an optional embodiment, before performing pattern unit assembly and completion on the defective mask to obtain candidate repair patterns, the method further includes constructing structural phase coordinates and strip repair weight field, specifically including:
[0115] Within the two-dimensional strip repair domain, structural phase coordinates along the main trend of the pattern are established using the pitch, and structural event points are projected onto these coordinates to form a phase event index table. The position along the main trend of the pattern is represented by phase for easy cross-position alignment.
[0116] Within the intact area, the strip pattern is phase-aligned and sampled according to the structural phase coordinates, and the phase texture profile is extracted. Robust statistics are then performed based on the phase texture profile to obtain the phase reference template. Specifically, the texture profiles at different positions are aligned in the phase coordinate system, and the phase reference template is obtained using robust statistics to reduce the impact of local damage / noise. Robust statistics can use the median or Huber mean.
[0117] The consistency weight map is projected onto the two-dimensional strip restoration domain according to the mapping relationship to obtain the strip consistency weight map. This map is then fused with the normalized gradient magnitude of the phase reference template to generate the strip restoration weight field. The weighted fusion ratio of the consistency weights to the normalized gradient magnitudes in the consistency weight map is: , This is a weighting coefficient with a value range of [0.3, 0.7], and a typical value is 0.5;
[0118] Through the above technical solution, this embodiment establishes structural phase coordinates and constructs a phase reference template, and then integrates the consistency weight and template gradient importance into a strip repair weight field, thereby providing position alignment and weight guidance for subsequent pattern unit retrieval and assembly, and improving the structural consistency and boundary naturalness of the repair results.
[0119] In an optional embodiment, pattern unit assembly and completion are performed on the defective mask to obtain candidate repair patterns, specifically including:
[0120] Within the defect mask, phase strips are divided according to structural phase coordinates and a set of defect blocks is generated. Structural neighborhood identifiers are then labeled for each defect block according to the phase event index table.
[0121] For example, the structural neighborhood is identified as ,in, It is a missing block. The event type is the nearest structural event point to the left of the main direction of the pattern for the missing block. The type of the nearest structural event point on the right. These are the phase coordinates of the corresponding left and right structural event points;
[0122] When there are no structural event points on either the left or right side, the event type on that side can be recorded as an empty event, and only the phase interval constraint is retained. The event type is taken from... ;
[0123] Retrieve candidate pattern elements from the pattern element library that are consistent with the structural neighborhood identifier and match the phase reference template, perform phase alignment and lateral scale normalization on them along the main direction of the pattern, and generate aligned elements.
[0124] For example, the structural neighborhood identifiers are consistent as follows: the event types are consistent and the phase intervals are consistent (a preset tolerance is allowed, with a value range of [0.05, 0.15], typically 0.10).
[0125] The matching phase reference template is:
[0126] Let the phase reference template be denoted as , For structural phase coordinates, Let be the lateral coordinate orthogonal to the main direction of the pattern within the 2D strip restoration domain; let be the phase texture block obtained after phase alignment and scale normalization of the candidate unit. The determination of the matching phase reference template is as follows: ;in, The phase matching threshold is set to [0.55, 0.80], with a typical value of 0.65, which ensures sufficient candidate coverage of the defect area while maintaining structural similarity.
[0127] The process of performing phase alignment and lateral scale normalization is as follows:
[0128] Candidate elements that satisfy the conditions of consistent structural neighborhood identifiers and matching phase reference templates Perform phase alignment along the main pattern direction: using the phase center of defective block B as the reference point. (or the midpoint of its phase interval) as the target, will Translate it in the phase coordinate system so that its reference structural point (such as the nearest event point or the center phase of the pattern unit) is aligned with... Alignment yields the phase shift amount. and will Resampling ;
[0129] Lateral scale normalization: based on the target bandwidth corresponding to the missing block B. Bandwidth corresponding to candidate units in the intact region The horizontal scaling ratio is calculated using the following formula: , The horizontal scaling ratio; and for In the horizontal coordinate Perform a scaling transformation (using either bilinear or bicubic interpolation) to obtain the final aligned unit;
[0130] Based on the strip repair weight field, the boundary gradient consistency score and pitch consistency score of the alignment unit are calculated. The alignment unit with the largest weight is selected and written into the corresponding defect block, and the candidate repair pattern is obtained by splicing. Among them, the continuity at the boundary directly determines whether the splicing artifact is significant. Therefore, the boundary gradient consistency score is given a slightly higher weight in the final writing selection, while the pitch consistency score is retained to prevent the local seam from being good but the period from deviating. Therefore, the weighting ratio of the boundary gradient consistency score and the pitch consistency score can be taken as 6:4.
[0131] For example, the boundary gradient consistency score is:
[0132] The boundary neighborhood of the defective block B (e.g., the narrow band formed by pixels extending outward from the defective boundary) is denoted as After writing the alignment unit, the pattern in the boundary neighborhood is The original striped pattern was Then the expression for calculating the boundary gradient consistency score is:
[0133] ;
[0134] In the formula, For boundary gradient consistency score, For strip repair weight field at position The weight value, , These are the pixel values at position x of the candidate repair pattern obtained after writing the alignment unit into the defective block B. This is the two-dimensional gradient vector corresponding to the pixel value. This is an angle function that outputs the angle value, where x is... The pixel position (or sampling point within the two-dimensional strip restoration domain) belongs to two-dimensional coordinates;
[0135] Pitch consistency score: ,in, For pitch consistency score, For pitch, The local pitch of the alignment unit (which can be obtained from the autocorrelation main peak of its phase texture profile);
[0136] Through the above technical solution, this embodiment improves the structural alignment accuracy and natural boundary transition of defect repair by using phase segmentation and structural neighborhood identification constraint unit retrieval, combined with the boundary gradient consistency and pitch consistency comprehensive scoring guided by the strip repair weight field to select and assemble pattern units.
[0137] In an optional embodiment, before inputting the candidate repair pattern into the generative model, the method further includes boundary fusion updating of the candidate repair pattern, specifically including:
[0138] A transition band is obtained by equidistantly expanding a preset bandwidth along the boundary of the defect mask within the two-dimensional strip repair domain. The distance field from the transition band to the boundary of the defect mask is calculated and normalized to obtain a distance weight map.
[0139] It should be noted that a strip coordinate system is established within the two-dimensional strip repair domain. ,in, The coordinates are along the main direction of the pattern. For the horizontal coordinates orthogonal to the main direction of the pattern, both use the same length scale (pixels or physical length);
[0140] Furthermore, the preset bandwidth is denoted as... Its value is related to the pitch. Related, satisfying ,in, Furthermore, a typical value of 0.6 can be taken; the transition zone is obtained by equidistantly expanding the preset bandwidth along the boundary of the defective mask. The minimum distance from any point to the boundary of the defective mask is calculated using the Euclidean distance in the strip coordinate system as the metric. and will satisfy The region is used as a transition zone, and the distance field is normalized to obtain a distance weight map.
[0141] Within the transition zone, backtrack along the distance field gradient direction to the boundary point of the defect mask, and translate in the opposite direction by a distance equal to the distance field value of that point to locate the inward sampling point. Extract the pixel value of the candidate repair pattern at the inward sampling point and write it into the corresponding position of the transition zone to construct the candidate pattern of the transition zone.
[0142] Within the transition zone, the pixel difference map of the candidate pattern and the strip pattern in the transition zone is calculated. The normalization result of the pixel difference map, the distance weight map and the strip consistency weight map are fused to generate the transition zone fusion weight field.
[0143] For example, the fusion formula for the transition band fusion weight field is:
[0144]
[0145] In the formula, For transition zone fusion weights, This is the normalized result of the pixel difference image. Distance weights For stripe consistency weights, , , This is the fusion coefficient, and it can take values of 0.4, 0.3, and 0.3.
[0146] The transition zone candidate pattern and the strip pattern are weighted and fused pixel by pixel using the transition zone fusion weight field to generate the transition zone fused pattern;
[0147] The transition zone fusion pattern is stitched into the corresponding position of the transition zone and the candidate repair pattern in the defect mask is retained to obtain the stitched and updated candidate repair pattern; wherein, the transition zone area uses the transition zone fusion pattern, and the candidate repair pattern is retained inside the defect mask. The two are stitched together to obtain a new candidate repair pattern with natural boundaries and preserved internal structure.
[0148] Through the above technical solution, this embodiment constructs a transition zone and distance weight based on a preset bandwidth of pitch scale, and generates a fusion weight field by fusing differential consistency, distance weight and strip consistency weight map to perform boundary weighted fusion, thereby reducing the splicing abrupt changes between candidate repair patterns and observed strip patterns and improving the naturalness of boundary transition.
[0149] See Figure 2 As shown, this solution proposes a digital restoration system for cultural relic patterns based on generative models, used to implement the aforementioned digital restoration method for cultural relic patterns based on generative models, including:
[0150] The 3D reconstruction and fusion module is used to acquire a set of surface images of the target artifact. After 3D reconstruction and standardization, a base mesh is obtained. The registration and projection of the surface image set onto the base mesh are then fused to form mesh pattern evidence and multiple views. Figure 1 Consistency measurement;
[0151] The band body parameter extraction module is used for evidence based on grid patterns and multiple views. Figure 1 Consistency measurement: On the base grid, determine the pattern band with the main direction of the pattern as the major axis and the lateral width limited, and extract its center line and lateral width distribution to form the band geometric parameters;
[0152] The two-dimensional unfolding and resampling module is used to parameterize and unfold the pattern strip body into a two-dimensional strip restoration domain using strip geometric parameters, record its mapping relationship with the base mesh, and resample the mesh pattern evidence into strip patterns according to the mapping relationship.
[0153] The event sequence generation module is used to divide the two-dimensional strip repair domain into intact regions and defect masks based on strip patterns. It extracts repeated pattern units in the intact regions to construct a pattern unit library, and detects structural event points that characterize symmetry benchmarks, adjacency relationship bifurcation, and closure or convergence from the library. The event sequence and pitch are generated by sorting the pattern main direction.
[0154] The repair error calculation module is used to perform pattern unit assembly and completion on the defective mask under the constraints of event sequence, pitch and pattern unit library to obtain candidate repair patterns, and calculate the event closure error from the closure consistency and pitch consistency deviation of the event sequence.
[0155] The iterative optimization and adjustment module is used to back-project the event closed-loop error to the base grid positioning error segment according to the mapping relationship when the event closed-loop error exceeds the preset error threshold. The module then adjusts the center line or lateral width distribution along the error segment to update the strip geometric parameters and regenerate candidate repair patterns until the stopping condition is met.
[0156] The model enhancement output module is used to input candidate repair patterns into the generative model, encode event sequences and pitches as conditional constraints, and output detailed planar repair patterns.
[0157] In another embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above embodiments.
[0158] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps described above.
[0159] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps described above.
[0160] The technical scope of this invention is not limited to the content described above. Those skilled in the art can make various modifications and variations to the above embodiments without departing from the technical concept of this invention, and all such modifications and variations should fall within the protection scope of this invention.
Claims
1. A method for digital restoration of cultural relic patterns based on generative models, characterized in that, The method includes: The surface image set of the target cultural relic is acquired, and the base grid is obtained through three-dimensional reconstruction and standardization. The registration and projection of the surface image set in the base grid are fused to form grid pattern evidence and multi-view consistency measurement. Based on grid pattern evidence and multi-view consistency measurement, a pattern band with the main direction of the pattern as the major axis and a limited lateral width is determined on the base grid, and its center line and lateral width distribution are extracted to form band geometric parameters. Using strip geometric parameters, the pattern strip body is parameterized and unfolded into a two-dimensional strip restoration domain. Its mapping relationship with the base mesh is recorded, and the mesh pattern evidence is resampled into strip pattern according to the mapping relationship. Based on the strip pattern, the two-dimensional strip repair domain is divided into intact regions and defect masks. Repeated pattern units are extracted from the intact regions to construct a pattern unit library. Structural event points that characterize symmetry benchmarks, adjacency relationship bifurcation, and closure or convergence are detected from the library. Event sequences and pitches are generated by sorting the pattern main direction. Under the constraints of event sequence, pitch and pattern unit library, pattern unit assembly and completion are performed on the defective mask to obtain candidate repair patterns, and the event closure error is calculated from the closure consistency of event sequence and pitch consistency deviation. When the event closed-loop error exceeds the preset error threshold, the event closed-loop error is back-projected to the base grid positioning error segment according to the mapping relationship. The center line or lateral width distribution is adjusted along the error segment to update the strip geometric parameters and regenerate the candidate repair pattern until the stopping condition is met. The candidate repair patterns are input into the generative model, and the event sequence and pitch are encoded as conditional constraints, outputting a planar repair pattern with enhanced details.
2. The method according to claim 1, characterized in that, On the base grid, define pattern bands with the main pattern direction as the major axis and limited lateral width, specifically including: On the base grid, a consistency weight map is generated based on grid pattern evidence and multi-view consistency measures, and high confidence regions are screened in combination with pre-set confidence criteria; Local gradient vectors of the grid pattern evidence in the base grid are extracted to construct the pattern orientation field. The distribution of the pattern orientation field is statistically analyzed in the high confidence region to determine the main orientation of the pattern, and local grid segments are extracted along the main orientation of the pattern. Local parametric expansion is performed based on the tangent plane of the local mesh fragment, and the mesh pattern evidence is resampled into local strip patterns. Geometric event points are detected in the local strip patterns and written back to the base mesh according to the local parametric expansion relationship to form a candidate point set. Construct an event adjacency graph using the candidate point set and calculate the edge weights. Take the event main chain with the largest cumulative edge weight and the highest consistency between the main direction and the main direction of the pattern as the center line, and calculate the tangent and normal of the center line. For each sampling point of the centerline, multiple sets of boundary point pairs are generated in the normal direction to form a candidate width set. Each candidate width set is resampled into a local strip pattern according to the local parameterized expansion relationship. Local pitches are calculated on each local strip pattern, and pitch stability is obtained. The pitch stability is obtained by combining the dispersion of adjacent local pitches with the consistency of rhythm peaks. For each sampling point, the boundary point pair with the largest pitch stability is selected as the boundary of that point and spliced together to form a horizontal width distribution. Based on the center line and the horizontal width distribution, a patterned band is constructed on the base grid.
3. The method according to claim 1, characterized in that, A pattern unit library is constructed by extracting repeating pattern units from intact regions. Structural event points representing symmetry benchmarks, adjacency relationships, bifurcation, and closure or convergence are then detected from this library. Event sequences and intervals are generated by sorting the patterns according to their main orientation. Specifically, this includes: The main direction of the pattern is mapped to the two-dimensional strip restoration domain using the mapping relationship. Within the intact area, the sliding autocorrelation of the strip pattern is calculated along the mapped main direction of the pattern, and the position of the correlation peak is taken to generate a rhythm candidate point column. Based on the rhythmic candidate point list, repeating segments are segmented in the strip pattern and the segment boundary curves are extracted. After the boundary curves are normalized, they are written into the pattern unit library and the unit outlines are recorded. Perform mirror matching and registration on the unit contour to obtain the mirror registration axis and its registration error. The mirror registration axis with the registration error lower than the preset registration threshold is recorded as the symmetry reference. A unit adjacency graph is constructed based on the relative pose and adjacency relationship of the unit contour in the strip pattern. The positions of symmetry reference switching, adjacency relationship bifurcation or merging, and boundary curve closure or convergence are detected on the unit adjacency graph and recorded as structural event points. The event sequence is obtained by sorting the structural event points according to the main direction of the pattern, and robust statistics are performed on the spacing between adjacent structural event points of the same type to generate pitch.
4. The method according to claim 1, characterized in that, The closed-loop error of this event is back-projected onto the base grid positioning error segment according to the mapping relationship. The centerline or lateral width distribution is adjusted along the error segment to update the strip geometry parameters. Specifically, this includes: The event closed-loop error is back-projected onto the base grid according to the mapping relationship to generate an error weight field, and connected component analysis is performed in the neighborhood of the center line to extract the error segment; The centerline is updated by searching for lateral displacement along the centerline normal within the error range and taking the displacement amount that satisfies the weighted cumulative value of the mesh pattern evidence and the multi-view consistency metric. Within the error range, perform bilateral step correction on the boundary point pairs of the lateral width distribution. Take the correction amount that is consistent with the gradient sign of the mesh pattern evidence at the boundary point and satisfies the preset smoothness constraint to update the lateral width distribution. Write the updated centerline and lateral width distribution into the strip geometry parameters.
5. The method according to claim 2, characterized in that, Before performing pattern unit assembly and completion on the defective mask to obtain candidate repair patterns, the process also includes constructing structural phase coordinates and strip repair weight field, specifically including: Within the two-dimensional strip repair domain, structural phase coordinates along the main direction of the pattern are established using the pitch, and structural event points are projected onto the structural phase coordinates to form a phase event index table. Within the intact region, the strip pattern is phase-aligned and sampled according to the structural phase coordinates, and the phase texture profile is extracted. Robust statistics are then performed based on the phase texture profile to obtain the phase reference template. The consistency weight map is projected onto the two-dimensional strip repair domain according to the mapping relationship to obtain the strip consistency weight map. It is then fused with the normalized gradient magnitude of the phase reference template to generate the strip repair weight field.
6. The method according to claim 5, characterized in that, The defective mask is assembled and completed using pattern units to obtain candidate repair patterns, specifically including: Within the defect mask, phase strips are divided according to structural phase coordinates and a set of defect blocks is generated. Structural neighborhood identifiers are then labeled for each defect block according to the phase event index table. Retrieve candidate pattern elements from the pattern element library that are consistent with the structural neighborhood identifier and match the phase reference template, perform phase alignment and lateral scale normalization on them along the main direction of the pattern, and generate aligned elements. Based on the strip repair weight field, the boundary gradient consistency score and pitch consistency score of the alignment unit are calculated. The alignment unit with the largest weight is selected and written into the corresponding defect block. The candidate repair pattern is then obtained by splicing them together.
7. The method according to claim 6, characterized in that, Before inputting candidate repair patterns into the generative model, the process also includes boundary fusion and updating of the candidate repair patterns, specifically including: A transition band is obtained by equidistantly expanding a preset bandwidth along the boundary of the defect mask within the two-dimensional strip repair domain. The distance field from the transition band to the boundary of the defect mask is calculated and normalized to obtain a distance weight map. Within the transition zone, backtrack along the distance field gradient direction to the boundary point of the defect mask, and translate in the opposite direction by a distance equal to the distance field value of that point to locate the inward sampling point. Extract the pixel value of the candidate repair pattern at the inward sampling point and write it into the corresponding position of the transition zone to construct the candidate pattern of the transition zone. Within the transition zone, the pixel difference map of the candidate pattern and the strip pattern in the transition zone is calculated. The normalization result of the pixel difference map, the distance weight map and the strip consistency weight map are fused to generate the transition zone fusion weight field. The transition zone candidate pattern and the strip pattern are weighted and fused pixel by pixel using the transition zone fusion weight field to generate the transition zone fused pattern; The transition zone fusion pattern is stitched into the corresponding position of the transition zone and the candidate repair pattern in the defect mask is retained to obtain the stitched and updated candidate repair pattern.
8. A digital restoration system for cultural relic patterns based on generative models, characterized in that, The method for digital restoration of cultural relic patterns based on generative models as described in any one of claims 1-7 includes: The 3D reconstruction and fusion module is used to acquire the surface image set of the target cultural relic. After 3D reconstruction and standardization, a base grid is obtained. The registration and projection of the surface image set in the base grid are fused to form grid pattern evidence and multi-view consistency measurement. The strip body parameter extraction module is used to determine the strip body with the main direction of the pattern as the major axis and the lateral width limited on the base grid based on the grid pattern evidence and the multi-view consistency measurement, and extract its center line and lateral width distribution to form strip geometric parameters. The two-dimensional unfolding and resampling module is used to parameterize and unfold the pattern strip body into a two-dimensional strip restoration domain using strip geometric parameters, record its mapping relationship with the base mesh, and resample the mesh pattern evidence into strip patterns according to the mapping relationship. The event sequence generation module is used to divide the two-dimensional strip repair domain into intact regions and defect masks based on strip patterns. It extracts repeated pattern units in the intact regions to construct a pattern unit library, and detects structural event points that characterize symmetry benchmarks, adjacency relationship bifurcation, and closure or convergence from the library. The event sequence and pitch are generated by sorting the pattern main direction. The repair error calculation module is used to perform pattern unit assembly and completion on the defective mask under the constraints of event sequence, pitch and pattern unit library to obtain candidate repair patterns, and calculate the event closure error from the closure consistency and pitch consistency deviation of the event sequence. The iterative optimization and adjustment module is used to back-project the event closed-loop error to the base grid positioning error segment according to the mapping relationship when the event closed-loop error exceeds the preset error threshold. The module then adjusts the center line or lateral width distribution along the error segment to update the strip geometric parameters and regenerate candidate repair patterns until the stopping condition is met. The model enhancement output module is used to input candidate repair patterns into the generative model, encode event sequences and pitches as conditional constraints, and output detailed planar repair patterns.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.