High-precision digital restoration method for endangered ancient shu brocade patterns

CN116452441BActive Publication Date: 2026-08-28SICHUAN RES INST OF SILK SCI
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310327451.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2026-08-28
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

[0004]本发明的目的在于设计一种濒危古蜀锦纹样的高精度数字化复原方法,解决现有方法生成的矢量图质量参差不齐,存在线条不连续和拓扑结构失真等问题的不足,能够对濒危古蜀锦纹样进行高精度的矢量化建模保护

Benefits of technology

[0035] This invention provides a good preprocessing effect for original images that are low in resolution, unclear, and noisy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452441B_ABST
    Figure CN116452441B_ABST
Patent Text Reader

Abstract

The application discloses a high-precision digital restoration method for endangered ancient Shu brocade patterns, which can protect the endangered ancient Shu brocade patterns through high-precision vectorization modeling, and comprises the following steps: performing resolution expansion processing on an input ancient Shu brocade pattern original image by using a bicubic interpolation algorithm to obtain a large-resolution original image; converting the large-resolution original image into a gray-scale image, stretching the edges of the gray-scale image based on a high-low hat transformation, improving the contrast of the gray-scale image, filtering out image noise and non-perception features, while retaining the structural information of the original image, so as to achieve the effect of highlighting the target area without being affected by the background; performing threshold segmentation on the gray-scale image after the high-low hat transformation by using an OTSU method, converting the gray-scale image into a binary image, highlighting the outline of the image to be vectorized, and obtaining a pretreated original image; and then extracting a pattern cycle unit, setting relevant software parameters before vectorization processing, analyzing the skeleton structure of the pattern unit and sketching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital preservation technology for cultural relics, specifically, a high-precision digital restoration method for endangered ancient Shu brocade patterns. Background Technology

[0002] Silk fabrics are among the most difficult cultural relics to preserve. Due to the damage to silk fibroin caused by bacteria and other microorganisms, silk fabrics gradually lose their original color and pattern characteristics over time. Therefore, the protection and restoration of traditional silk fabrics is a major challenge. The traditional method for protecting silk artifacts involves continuously repairing or replicating fragments. The most crucial technique is using the same materials and weaving techniques as the fragments, while simultaneously employing reverse engineering to accurately reproduce the original fabric's structure and patterns, thus restoring the artifact to its original appearance. Of all these steps, the most easily overlooked is the restoration and reproduction of the original fabric patterns. Inaccurate reproduction of the patterns can easily lead to variations in some precious designs during transmission, thereby compromising the authenticity of the culture.

[0003] Shu brocade, as the foremost of China's three famous brocades, is an important part of Chinese silk culture due to its weaving techniques. However, insufficient protection of ancient Shu brocade fragments has led to the dispersal of some traditional Shu brocade patterns among the people. Over time, some patterns have gradually disappeared, negatively impacting the inheritance of Shu brocade culture. Therefore, digital restoration and organization of existing fragments is crucial. The main forms of protecting traditional patterns are raster graphics and vector graphics. Raster graphics can be captured by imaging devices such as digital cameras, enabling an authentic record of traditional patterns. For example, Huang Nengfu collected and organized ancient Shu brocade in his book "Chengdu, China—Shu Brocade" using photographs and textual descriptions. However, raster images have poor editability and are prone to distortion after magnification, making it impossible to identify the pattern characteristics of ancient Shu brocade and hindering the subsequent dissemination and development of the patterns. Unlike traditional raster graphics, vector format images have advantages such as being resolution-independent, scaling without distortion, user-editable, and having small file size, making them a superior means of digitally protecting traditional patterns. However, due to the different carriers of patterns (mainly including binary images, line drawings, restored decorative patterns, and solid decorative patterns), preprocessing of the pattern carrier images is necessary before vectorization. For the preprocessed pattern images, both manual extraction and computer-generated methods can be used to extract vector graphics. For example, Zhao Feng et al. collected and produced some Shu brocade pattern vector graphics in their book "A Series of Design Materials for Ancient Chinese Silk," but this series focuses on the study of ancient Chinese silk, and the cases involving Shu brocade lack systematicity. Furthermore, the lack of image preprocessing techniques before manually drawing the vector graphics resulted in a loss of detail in the vector patterns, which is detrimental to the authenticity of the pattern's transmission. Mainstream pattern vectorization algorithms are primarily based on curve fitting techniques; however, the quality of vector graphics generated by existing methods varies greatly, exhibiting problems such as discontinuous lines and distorted topological structures. Vectorization of ancient Shu brocade patterns focuses more on restoring the topological structure of the pattern using line drawings; therefore, vectorization generation algorithms cannot adapt to the extraction of complex Shu brocade patterns. Summary of the Invention

[0004] The purpose of this invention is to design a high-precision digital restoration method for endangered ancient Shu brocade patterns, which solves the shortcomings of existing methods such as inconsistent vector image quality, discontinuous lines, and distorted topology. This method can perform high-precision vector modeling and protection of endangered ancient Shu brocade patterns.

[0005] This invention is achieved through the following technical solution: a high-precision digital restoration method for endangered ancient Shu brocade patterns, comprising the following steps:

[0006] S1: Use bicubic interpolation algorithm to perform resolution expansion processing on the input original image of ancient Shu brocade pattern to obtain a high-resolution original image;

[0007] S2: Convert the high-resolution original image into a grayscale image, stretch the edges of the grayscale image based on the high-low hat transformation, improve the contrast of the grayscale image, filter out image noise and non-perceptual features, and at the same time retain the structural information of the original image, so as to achieve the effect of highlighting the target area without being affected by the background.

[0008] S3: The maximum inter-class variance method is used to perform threshold segmentation on the grayscale image after high-low hat transformation, converting the grayscale image into a binary image, highlighting the contour of the image to be vectorized, and obtaining the preprocessed original image.

[0009] S4: After step S3, extract the pattern cycle unit, set the relevant software parameters before vectorization, analyze the skeletal structure of the pattern unit and trace it.

[0010] To further improve the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following settings are adopted: the BiCubic function is used as the interpolation kernel function of the bicubic interpolation algorithm.

[0011] To further improve the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following settings are specifically adopted: During the high-low hat transformation, the high hat transformation uses... To achieve this, the low-hat transformation uses B... hat The expression for enhancing the contrast effect of the high-low hat transformation on the ancient Shu brocade pattern is: f' = f + T. hat (f)-B hat (f); where f represents the original input image; f represents the opening operation of the input original image using the structuring element b; f·b represents the closing operation of the input original image using the structuring element b; T hat (f) represents the original image after top-hat filtering; B hat (f) represents the original image after low-hat filtering; f' represents the original image after contrast enhancement.

[0012] To further improve the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following configuration is specifically adopted: Step S4 includes the following steps:

[0013] S4.1) Identify and extract pattern cycle units:

[0014] The continuity features of the pattern are identified, and the pattern is divided into single pattern, two-dimensional continuous pattern and four-dimensional continuous pattern. For two-dimensional continuous pattern and four-dimensional continuous pattern, the cyclic unit in the pattern is identified and extracted to obtain a preprocessed cyclic unit image.

[0015] S4.2) Settings before vectorization:

[0016] First, create a new artboard in Adobe Illustrator. For individual patterns, import the pre-processed original image directly into the artboard. For continuous patterns, import the pre-processed loop unit image into the artboard. Resize the artboard so that its size is the same as the size of the imported image.

[0017] S4.3) Analyze the skeletal structure of the pattern cycle unit and formulate a tracing strategy:

[0018] Analyze the skeletal structure of the preprocessed original image or the preprocessed cyclic unit image. For repetitive, symmetrical, or other regular skeletal structures, only the basic unit objects are drawn, and then the pattern cyclic units are completed by copying. For irregular skeletal structures, the entire imported image is drawn.

[0019] S4.4) Tracing:

[0020] For simple geometric objects in the basic unit object, use the corresponding geometric tools in the toolbar to draw. For complex geometric objects such as people, animals, plants, or text in the basic unit object, use the pen tool to trace them. After tracing, expand all stroked and filled objects into closed shapes to obtain vectorized cyclic unit patterns.

[0021] S4.5) Establish a quadrangular continuous element:

[0022] Select the vectorized repeating unit pattern, go to Object > Pattern > Create, and switch the canvas to pattern editing mode; select the corresponding pattern collage type, and the overlap type is left in front and top in front; use the "Copy" drop-down menu to control the visibility of the pattern collage, and leave these settings as default; click Finish to save the soon-to-be-created four-sided continuous unit in the color swatch selection box.

[0023] To further improve the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following settings are specifically adopted: The specific steps for extracting the loop units in the pattern and obtaining the preprocessed loop unit image are as follows: First, the shape of the loop units in the original image is adjusted by rotation correction, cropping correction (oblique cutting, perspective) and free deformation correction in sequence; then, the cropping tool is used to crop along the boundary of the loop units; finally, the cropped image is saved as the preprocessed loop unit image.

[0024] To further improve the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following settings are specifically adopted: The settings before vectorization processing in step S4.2) also include adjusting the transparency of the preprocessed original image to facilitate the next step of drawing.

[0025] To further improve the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following settings are specifically adopted: It also includes automatic quantitative evaluation of vector drawing quality, including the following processing methods:

[0026] A) Quantitative analysis of accuracy: The error between the vectorized loop cell pattern saved as a bitmap image with the same resolution as the preprocessed loop cell image and the preprocessed loop cell image is measured using the following formula:

[0027]

[0028]

[0029] In the formula, x, y represent the coordinate positions of image pixels, I′ represents the pixel value of a point in the bitmap image stored in the vectorized loop unit pattern, I represents the pixel value of a point in the preprocessed loop unit image, and tolerance represents the visual tolerance. For binary images such as the preprocessed original image, the value range of tolerance is [50, 100]; f accuracy The error is represented by N, which represents the number of pixels. The error between the reconstructed image and the original image is calculated pixel by pixel in the grayscale space. Points that meet the expectations are marked as 1, and those that do not are marked as 0. Finally, the number of pixels that meet the accuracy requirements is counted.

[0030] B) Quantitative analysis of continuity: Calculated by the angles at the intersections of all curves in the statistical vector diagram, and then processed using a function. Will The obtained values ​​are mapped to [0,1]. If the continuity measure value approaches 1, the curve forms more inflection points, resulting in a worse visual effect. Among these, C... x C y It is the curve connecting the beginning and end of path p. For curve C x With curve C y The included angle at the intersection, l1 is a preset continuity parameter;

[0031] C) Quantitative analysis of simplicity: The number of different nodes is counted by traversing the entire DOM tree of the vector image and mapped to [0,1]. The calculation is performed using the following formula:

[0032] In the formula, e is the curve unit in the vector diagram corresponding to raster image I, E is all the curves in the vector diagram corresponding to raster image I, D(e) is the highest term of curve unit e, and R(r,I) and C(c,I) are the number of colors in the closed region of tree T corresponding to raster image I, respectively.

[0033] To further improve the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following settings are specifically adopted: When performing simplicity quantification analysis, the complexity of the curve is reflected by the degree of the curve. The weight of a straight line is 1, the weight of a quadratic Bézier curve is 2, and the weight of a cubic Bézier curve is 3. The weight of the number of regions is 1, and the weight of the number of colors is 3. The weight of color is higher than that of regions because different regions can have the same color, and a large number of colors in a vector graphic can make people feel visually cluttered. Therefore, the more colors there are, the greater the simplicity metric value will be.

[0034] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0035] This invention provides a good preprocessing effect for original images that are low in resolution, unclear, and noisy.

[0036] The method proposed in this invention helps to realize the vectorized restoration modeling and preservation of ancient Shu brocade patterns.

[0037] The method proposed in this invention helps to achieve objective quantitative evaluation of vector graphics patterns.

[0038] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of this application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The above and other objects, features, and advantages of this application will become clearer through the drawings. The same reference numerals indicate the same parts in all the drawings. The drawings are not intentionally drawn to scale to actual size; the focus is on illustrating the main points of this application.

[0040] Figure 1 The diagram shows the image coordinate representation and interpolation points, where (a) represents the image coordinate representation and (b) represents the interpolation points.

[0041] Figure 2 This is the image of the BiCubic function described in this invention.

[0042] Figure 3This diagram illustrates the multi-stage changes in the restoration of ancient Shu brocade using this invention, where a is the original image of the ancient Shu brocade pattern, b is the image after the height and height of the brocade are changed, c is the image after binarization, and d is the image after vectorization. Detailed Implementation

[0043] The present invention will be further described in detail below with reference to embodiments, but the implementation of the present invention is not limited thereto.

[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention.

[0045] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0046] In the description of this invention, it should be understood that the orientation or positional relationship indicated by terms, etc., is based on the orientation or positional relationship shown in the drawings and is only for the convenience of describing this invention and simplifying the description, and is not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0047] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, and "multiple" means two or more, unless otherwise explicitly specified.

[0048] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can also refer to an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0049] In this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, without necessarily requiring or implying any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, principle, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, principle, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, principle, article, or apparatus that includes said element.

[0050] Example 1:

[0051] A high-precision digital restoration method for endangered ancient Shu brocade patterns includes the following steps:

[0052] S1: Use bicubic interpolation algorithm to perform resolution expansion processing on the input original image of ancient Shu brocade pattern to obtain a high-resolution original image;

[0053] S2: Convert the high-resolution original image into a grayscale image, stretch the edges of the grayscale image based on the high-low hat transformation, improve the contrast of the grayscale image, filter out image noise and non-perceptual features, and at the same time retain the structural information of the original image, so as to achieve the effect of highlighting the target area without being affected by the background.

[0054] S3: The maximum inter-class variance method is used to perform threshold segmentation on the grayscale image after high-low hat transformation, converting the grayscale image into a binary image, highlighting the contour of the image to be vectorized, and obtaining the preprocessed original image.

[0055] S4: After step S3, extract the pattern cycle unit, set the relevant software parameters before vectorization, analyze the skeletal structure of the pattern unit and trace it.

[0056] Example 2:

[0057] This embodiment is a further optimization based on the above embodiment. The similarities with the aforementioned technical solutions will not be repeated here. In order to better realize the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following setting is adopted: the BiCubic function is used as the interpolation kernel function of the bicubic interpolation algorithm.

[0058] Example 3:

[0059] This embodiment is a further optimization based on any of the above embodiments. The similarities with the aforementioned technical solutions will not be repeated here. Furthermore, to better realize the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following setting is specifically adopted: When performing the high / low hat transformation, the high hat transformation uses… To achieve this, the low-hat transformation uses B... hat The expression for enhancing the contrast effect of the high-low hat transformation on the ancient Shu brocade pattern is: f' = f + T. hat (f)-B hat (f); where f represents the original input image; f represents the opening operation of the input original image using the structuring element b; f·b represents the closing operation of the input original image using the structuring element b; T hat (f) represents the original image after top-hat filtering; B hat (f) represents the original image after low-hat filtering; f' represents the original image after contrast enhancement.

[0060] Example 4:

[0061] This embodiment is a further optimization based on any of the above embodiments. The similarities with the aforementioned technical solutions will not be repeated here. Furthermore, to better realize the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following setting is specifically adopted: Step S4 includes the following steps:

[0062] S4.1) Identify and extract pattern cycle units:

[0063] The continuity features of the patterns are identified, and the patterns are divided into single patterns, two-dimensional continuous patterns, and four-dimensional continuous patterns. For two-dimensional and four-dimensional continuous patterns, the repeating units in the patterns are identified and extracted: First, the shape of the repeating units in the original image is adjusted by rotation correction, cropping correction (skew cutting, perspective), and free deformation correction in sequence; then, the cropping tool is used to crop along the boundary of the repeating units; finally, the cropped image is saved as a preprocessed repeating unit image.

[0064] S4.2) Settings before vectorization:

[0065] First, create a new artboard in Adobe Illustrator. For individual patterns, import the pre-processed original image directly into the artboard. For continuous patterns, import the pre-processed loop image into the artboard. Resize the artboard so that its size is the same as the imported image size. Adjust the transparency of the pre-processed original image appropriately to facilitate the next step of drawing.

[0066] S4.3) Analyze the skeletal structure of the pattern cycle unit and formulate a tracing strategy:

[0067] Analyze the skeletal structure of the preprocessed original image or the preprocessed cyclic unit image. For repetitive, symmetrical, or other regular skeletal structures, only the basic unit objects are drawn, and then the pattern cyclic units are completed by copying. For irregular skeletal structures, the entire imported image is drawn.

[0068] S4.4) Tracing:

[0069] For simple geometric objects in the basic unit object, use the corresponding geometric tools in the toolbar to draw. For complex geometric objects such as people, animals, plants, or text in the basic unit object, use the pen tool to trace them. After tracing, expand all stroked and filled objects into closed shapes to obtain vectorized cyclic unit patterns.

[0070] S4.5) Establish a quadrangular continuous element:

[0071] Select the vectorized repeating unit pattern, go to Object > Pattern > Create, and switch the canvas to pattern editing mode; select the corresponding pattern collage type, and the overlap type is left in front and top in front; use the "Copy" drop-down menu to control the visibility of the pattern collage, and leave these settings as default; click Finish to save the soon-to-be-created four-sided continuous unit in the color swatch selection box.

[0072] Example 5:

[0073] This embodiment is a further optimization based on any of the above embodiments. The similarities with the aforementioned technical solutions will not be repeated here. Furthermore, to better realize the high-precision digital restoration method for endangered ancient Shu brocade patterns described in this invention, the following settings are specifically adopted: It also includes automatic quantitative evaluation of vector drawing quality, including the following processing methods:

[0074] A) Quantitative analysis of accuracy: The error between the vectorized loop cell pattern saved as a bitmap image with the same resolution as the preprocessed loop cell image and the preprocessed loop cell image is measured using the following formula:

[0075]

[0076]

[0077] In the formula, x, y represent the coordinate positions of image pixels, I′ represents the pixel value of a point in the bitmap image stored in the vectorized loop unit pattern, I represents the pixel value of a point in the preprocessed loop unit image, and tolerance represents the visual tolerance. For binary images such as the preprocessed original image, the value range of tolerance is [50, 100]; f accuracy The error is represented by , and N represents the number of pixels. The error between the reconstructed image and the original image is calculated pixel by pixel in the grayscale space. Pixels that meet the expectations are marked as 1, and others as 0. Finally, the number of pixels that meet the accuracy requirement is counted.

[0078] B) Quantitative analysis of continuity: Calculated by the angles at the intersections of all curves in the statistical vector diagram, and then processed using a function. Will The obtained values ​​are mapped to [0,1]. If the continuity measure value approaches 1, the curve forms more inflection points, resulting in a worse visual effect. Among these, C... x C y It is the curve connecting the beginning and end of path p. For curve C x With curve C y The included angle at the intersection, l1 is a preset continuity parameter;

[0079] C) Quantitative analysis of simplicity: The number of different nodes is counted by traversing the entire DOM tree of the vector image and mapped to [0,1]. The calculation is performed using the following formula:

[0080] In the formula, e is the curve unit in the vector diagram corresponding to raster image I, E is all the curves in the vector diagram corresponding to raster image I, D(e) is the highest degree of the curve unit e, and R(r,I) and C(c,I) are the number of colors in the closed region of tree T corresponding to raster image I, respectively. The complexity of the curve is reflected by the degree of the curve. The weight of a straight line is 1, the weight of a quadratic Bézier curve is 2, and the weight of a cubic Bézier curve is 3. The weight of the number of regions is 1, and the weight of the number of colors is 3. The weight of color is higher than that of region because different regions can have the same color, and a large number of colors in a vector diagram can make people feel visually cluttered. Therefore, the more colors there are, the greater the measure of simplicity.

[0081] Example 6:

[0082] This embodiment is a further optimization based on any of the above embodiments. The similarities with the aforementioned technical solutions will not be repeated here. A high-precision digital restoration method for endangered ancient Shu brocade patterns requires preprocessing of the original image (i.e., steps one to three) before vectorization because the obtained initial Shu brocade pattern image has problems such as image blurring, missing content and insufficient resolution.

[0083] Step 1, Bicubic Interpolation:

[0084] Because the original image resolution of the ancient Shu brocade pattern is insufficient, the details of the image cannot be clearly discerned after magnification. Therefore, it is necessary to use image super-resolution technology to expand the pixels of the original image. Since bicubic interpolation produces smoother interpolation results than bilinear interpolation, it is used to generate high-quality, high-resolution images. This algorithm uses the gray values ​​of 16 points surrounding the sampling point for cubic interpolation. Through cubic operations, it can reflect not only the gray value influence of the four adjacent points around the interpolation point, but also the influence of the rate of change of gray values ​​between neighboring points on the interpolation point, thus producing better and more accurate interpolation results.

[0085] The coordinates of the original image of ancient Shu brocade can be used Figure 1 (a) represents the position of each pixel, where the position of each pixel is an integer. Before calculating the target interpolation point, the position of the interpolation point B(src_x,src_y) corresponding to the pixel B(dst_x,dst_y) in the target image is first calculated using formulas (1) and (2).

[0086]

[0087]

[0088] In the formula, src_x is the x-coordinate of the interpolation point in the original image, and src_y is the y-coordinate of the interpolation point in the original image. dst_x is the x-coordinate of a pixel in the target image, and dst_y is the y-coordinate of a pixel in the target image. src_H and src_W are the height and width of the original image, respectively, and dst_H and dst_W are the height and width of the target image, respectively.

[0089] Since the values ​​of src_x and src_y are decimals, they can be written in the form src_x = i + u, src_y = j + v. Here, i and j are the integer parts, and u and v are the decimal parts. For example... Figure 1 As shown in (b), the interpolation point P(i+u,j+v) is the corresponding position of the target image point B(dst_x,dst_y) in the original image. Find the 16 points closest to the interpolation point P in the original image. The coordinates of these 16 points can be determined from the interpolation point P. Using a... ijRepresents each neighboring point around the interpolation point, such as Figure 1 As shown in (b).

[0090] The value of the interpolation point P is obtained by weighted summation of the 16 neighboring points in the rectangular network. Here, a cubic function is used for weighting, and common bicubic interpolation kernel functions include Bicubic, Mitchell, and Lanczos. In this embodiment, the Bicubic function is selected as the interpolation kernel function, as shown in equation (3).

[0091]

[0092] In equation (3), a often takes the value -1 or -0.5, and its function waveform is as follows: Figure 2 As shown. Because the Bicubic function is a one-dimensional function, it is necessary to calculate the weight of each point along the X and Y directions separately. The weight of each of the 16 points is denoted as w. ij (w_x, w_y), where each point is l ∈ (w_x, w_y) and its distance from point P is l in the X and Y directions. ij If the coordinates are (l_x, l_y), then the weight of each point is w(w_x, w_y) = w(W(l_x), W(l_y)). Where l... ij (l_x, l_y) can be represented as:

[0093] l_x=[u+1,u,1-u,2-u],x=[0,1,2,3] (4);

[0094] l_y=[v+1,v,1-v,2-v],y=[0,1,2,3] (5);

[0095] Based on the above results, the value of the target point B(dst_x,dst_y) can be calculated using formula (6):

[0096]

[0097] In the formula, f ij Point a in the original graph ij The pixel value, w i This indicates that point (point a in the original figure) ij ) x-axis weight, w j This indicates that point (point a in the original figure) ij ) Vertical axis weight.

[0098] Step 2, changing the hat height:

[0099] The high-low hat algorithm in mathematical morphology is often used to measure edge detection. One of its important uses is to correct the effects of uneven lighting. It increases the gray difference of the image by stretching the edge gray level, thereby improving the image contrast. Moreover, this method can effectively filter out noise and non-perceptual features while preserving the structural information of the original image, achieving the effect of highlighting the target area without being affected by the background.

[0100] The high-hat transform is the difference between the original image and the result of the opening operation, while the low-hat transform is the difference between the original image and the result of the closing operation. Therefore, the definitions of the high-hat transform and the low-hat transform are as shown in formula (12) and formula (13), respectively:

[0101]

[0102] B hat (f)=(f·b)-f (13);

[0103] In the formula, f represents the original input image; f represents the opening operation of the input original image using the structuring element b; f·b represents the closing operation of the input original image using the structuring element b; T hat (f) represents the original image after top-hat filtering; B hat (f) represents the original image after low-hat filtering.

[0104] Therefore, the expression for enhancing the contrast effect of the original image of ancient Shu brocade pattern by using the top hat transformation and bottom hat transformation in mathematical morphology is shown in formula (14).

[0105] f'=f+T hat (f)-B hat (f)(14);

[0106] Where f' represents the original image after the contrast enhancement.

[0107] Step 3: Pattern extraction based on maximum inter-class variance threshold segmentation:

[0108] To distinguish the Shu brocade pattern from the background in the original image after contrast enhancement, an image segmentation method based on the maximum inter-class variance threshold is adopted.

[0109] The basic principle is to divide the gray values ​​of an image into two parts using the optimal threshold, so that the variance between the two parts is maximized, i.e., the greatest separability.

[0110] Let f(x,y) be the image I. M×N Let f(x,y) be the gray value at position (x,y) with gray level L, then f(x,y)∈[0,L-1]. If the number of all pixels with gray level i is f iThe probability of the i-th gray level appearing is:

[0111]

[0112] Where i = 0, 1, ..., L-1, M is the number of pixel rows, N is the number of pixel columns, and

[0113] The pixels in the original image after contrast enhancement are divided into two categories based on gray level using a threshold t: background C0 and target C1. The gray level of background C0 is 0! t-1, and the gray level of target C1 is t~L-1. The pixels corresponding to background C0 and target C1 are {f(x,y)<t} and {f(x,y)≥t}, respectively.

[0114] The probability ω0 of the background C0 portion appearing is:

[0115]

[0116] The probability ω1 of the occurrence of part C1 is:

[0117]

[0118] Where ω0 + ω1 = 1. The average gray value μ0(t) of the background C0 region is:

[0119]

[0120] The average gray value μ1(t) of the target C1 part is:

[0121]

[0122] The overall average gray value μ of the image is:

[0123]

[0124] Between-class variance δ of background and target in an image 2 (k) is:

[0125] δ 2 (k)=ω0(μ-μ0) 2 +ω1(μ-μ1) 2 (twenty one);

[0126] Let the value of k vary from 0 to L-1, and calculate the inter-class variance δ for different values ​​of k. 2 (k) such that δ 2 The value of k that maximizes (k) is the optimal threshold value required.

[0127] Step 4: Vector Graphic Drawing

[0128] The vector drawing process mainly includes: (1) identifying and extracting pattern cycle units; (2) setting up before vectorization; (3) analyzing the skeletal structure of pattern cycle units; (4) tracing; and (5) establishing four-dimensional continuous units.

[0129] (1) Identify and extract pattern cycle units:

[0130] The continuity features of the patterns are identified, categorizing them into single patterns, two-dimensional continuous patterns, and four-dimensional continuous patterns. For two-dimensional and four-dimensional continuous patterns, the recurring units within the patterns are identified and extracted to obtain a preprocessed image of the recurring units. The steps for extracting the recurring units are as follows: First, the shape of the recurring units in the original image is adjusted sequentially using rotation correction, cropping correction (skew cutting, perspective), and free deformation correction. Then, a cropping tool is used to crop along the boundaries of the recurring units. Finally, the cropped image is saved as the preprocessed image of the recurring units.

[0131] (2) Settings before vectorization:

[0132] First, create a new artboard in Adobe Illustrator. For individual patterns, import the pre-processed original image directly into the artboard. For continuous patterns, import the pre-processed loop image into the artboard. Resize the artboard so that its size is the same as the imported image size. Adjust the transparency of the pre-processed original image appropriately to facilitate the next step of the drawing process.

[0133] (3) Analyze the skeletal structure of the pattern cycle unit and formulate a tracing strategy:

[0134] Analyze the skeletal structure of the preprocessed original image or the preprocessed cyclic unit image. For regular skeletal structures such as repetition and symmetry, only the basic unit objects are drawn, and then the pattern cyclic units are completed by copying. For irregular skeletal structures, the entire imported image is drawn.

[0135] (4) Tracing:

[0136] For simple geometric objects within the basic unit object, use the corresponding geometry tools in the toolbar to draw. For complex geometric objects such as figures, animals, plants, or text within the basic unit object, use the pen tool to trace them. After tracing, expand all stroked and filled objects into closed shapes to obtain a vectorized cyclic unit pattern.

[0137] (5) Establish a quadrangular continuous element:

[0138] Select the vectorized repeating unit pattern, go to Object > Pattern > Create, and switch the canvas to pattern editing mode; select the corresponding pattern collage type, and the overlap type is left in front and top in front; use the "Copy" drop-down menu to control the visibility of the pattern collage, and leave these settings as default; click Finish to save the soon-to-be-created four-sided continuous unit in the color swatch selection box.

[0139] Step 5: Automatic quantitative evaluation of vector drawing quality:

[0140] Current automatic vectorization algorithms lack robustness, resulting in inconsistent effects across different image types. Furthermore, the acquisition process for decorative patterns suffers from varying levels of noise and occlusion in the original images obtained due to differences in lighting, equipment, and acquisition standards, significantly interfering with the algorithm. The inherent complexity of the decorative carriers themselves—for example, the intricate textures of clothing or the incompleteness of patterns in murals—also contributes to the problem. Users must spend considerable time filtering and evaluating vector graphics when using resource libraries. Therefore, this embodiment proposes a method that quantifies and analyzes three key visual indicators for vector graphics: accuracy, simplicity, and continuity, thereby improving user efficiency.

[0141] Accuracy reflects the ability to retain information of the original image during vectorization. It is measured by the error between the vectorized loop unit pattern saved as a bitmap image with the same resolution as the preprocessed loop unit image and the preprocessed loop unit image. This is given by equation (22):

[0142]

[0143]

[0144] In the formula, x, y represent the coordinate positions of image pixels, I′ represents the pixel value of a point in the bitmap image stored in the vectorized loop unit pattern, I represents the pixel value of a point in the preprocessed loop unit image, and tolerance represents the visual tolerance. For binary images such as the preprocessed original image, the value range of tolerance is [50, 100]; f accuracy The error is represented by , and N represents the number of pixels. The error between the reconstructed image and the original image is calculated pixel by pixel in grayscale space. Points that meet the expectations are marked as 1, otherwise as 0. Finally, the pixels that meet the accuracy requirements are counted. The visual tolerance must be given because a closed, uniformly colored region is used to represent the discrete pixels of the original image during vectorization. The same region in the original image may contain multiple colors, and the visual tolerance helps balance this relationship. In practice, binary images with values ​​in the range [50, 100] perform well.

[0145] Continuity reflects the fit to the region boundary during the vectorization process.

[0146]

[0147] In the formula, C x C y It is the curve connecting the beginning and end of path p. For curve C x With curve C y The angle at the intersection, l1, is a preset continuity parameter. Continuity is calculated by statistically analyzing the angles at all curve intersections in the vector map. l1 = 135°. The formula indicates that if a large number of angles less than 45° appear in the vector path, it means that there are many inflection points formed by vectorization. Then, the value obtained from the above formula is mapped to [0,1] using the function f(x). This shows that the closer the continuity measure value is to 1, the more inflection points the curve directly forms, and the worse the visual effect.

[0148]

[0149] Simplicity reflects the composition of vector graphics elements. It is calculated by traversing the entire DOM tree of the vector graphics and counting the number of different nodes. For ease of comparison, the values ​​are also mapped to [0,1].

[0150]

[0151] In the formula, e represents the curve unit in the vector image corresponding to raster image I, E represents all curves in the vector image corresponding to raster image I, D(e) is the highest degree of curve unit e, and R(r,I) and C(c,I) are the number of colors in the closed region of tree T corresponding to raster image I, respectively. The complexity of the curve is reflected by the degree of the curve: the weight of a straight line is 1, the weight of a quadratic Bézier curve is 2, and the weight of a cubic Bézier curve is 3. The weight of the number of regions is 1, and the weight of the number of colors is 3. The weight of color is higher than that of region because different regions can have the same color, and a large number of colors in a vector image can make it visually cluttered. Therefore, the more colors there are, the greater the measure of simplicity.

[0152] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles, ideas, spirit, and rules of this application should be included within the scope of protection of this application.

Claims

1. A high-precision digital restoration method for endangered ancient Shu brocade patterns, characterized in that: Includes the following steps: S1: Use bicubic interpolation algorithm to perform resolution expansion processing on the input original image of ancient Shu brocade pattern to obtain a high-resolution original image; S2: Convert the high-resolution original image into a grayscale image, stretch the edges of the grayscale image based on the high-low hat transformation, improve the contrast of the grayscale image, filter out image noise and non-perceptual features, and at the same time retain the structural information of the original image, so as to achieve the effect of highlighting the target area without being affected by the background. S3: The maximum inter-class variance method is used to perform threshold segmentation on the grayscale image after high-low hat transformation, converting the grayscale image into a binary image, highlighting the contour of the image to be vectorized, and obtaining the preprocessed original image. S4: After step S3, extract the pattern cycle unit, set the relevant software parameters before vectorization, analyze the skeletal structure of the pattern unit and trace it. Includes the following steps: S4.1) Identify and extract pattern cycle units: The continuity features of the pattern are identified, and the pattern is divided into single pattern, two-dimensional continuous pattern and four-dimensional continuous pattern. For two-dimensional continuous pattern and four-dimensional continuous pattern, the cyclic unit in the pattern is identified and extracted to obtain a preprocessed cyclic unit image. S4.2) Settings before vectorization: First, create a new artboard in Adobe Illustrator. For individual patterns, import the pre-processed original image directly into the artboard. For continuous patterns, import the pre-processed loop unit image into the artboard. Resize the artboard so that its size is the same as the size of the imported image. S4.3) Analyze the skeletal structure of the pattern cycle unit and formulate a tracing strategy: Analyze the skeletal structure of the preprocessed original image or the preprocessed cyclic unit image. For repetitive and symmetrical regular skeletal structures, only the basic unit objects are drawn, and then the pattern cyclic units are completed by copying. For irregular skeletal structures, the entire image is drawn. S4.4) Tracing: For simple geometric objects in the basic unit object, use the corresponding geometric tools in the toolbar to draw. For complex geometric objects such as people, animals, plants or text in the basic unit object, use the pen tool to trace them. After tracing, expand all stroked and filled objects into closed shapes to obtain vectorized cyclic unit patterns. S4.5) Establish a quadrangular continuous element: Select the vectorized repeating unit pattern, go to Object > Pattern > Create, and switch the canvas to pattern editing mode; select the corresponding pattern collage type, and the overlap type is left in front and top in front; use the "Copy" drop-down menu to control the visibility of the pattern collage, and leave these settings as default; click Finish to save the soon-to-be-created four-sided continuous unit in the color swatch selection box.

2. The high-precision digital restoration method for endangered ancient Shu brocade patterns according to claim 1, characterized in that: The BiCubic function is used as the interpolation kernel function for the bicubic interpolation algorithm.

3. The high-precision digital restoration method for endangered ancient Shu brocade patterns according to claim 1, characterized in that: When performing the high / low hat transformation, the high hat transformation adopts... To achieve this, the low-hat transformation is implemented using... The expression for achieving and enhancing the contrast effect of the high / low hat transformation on the ancient Shu brocade pattern is as follows: In the formula, This represents the original input image; Indicates the use of structural elements Opening operation on the input raw image; Indicates the use of structural elements Closing operation on the input raw image; This represents the original image after top-hat filtering; This represents the original image after low-hat filtering; This represents the original image after the contrast effect has been enhanced.

4. The high-precision digital restoration method for endangered ancient Shu brocade patterns according to claim 1, characterized in that: The specific steps for extracting the repeating units in the pattern to obtain the preprocessed repeating unit image are as follows: First, the shape of the repeating units in the original image is adjusted by rotation correction, cropping correction and free deformation correction in sequence; then, the cropping tool is used to crop along the boundary of the repeating units; finally, the cropped image is saved as the preprocessed repeating unit image.

5. The high-precision digital restoration method for endangered ancient Shu brocade patterns according to claim 1, characterized in that: The S4.2) pre-vectorization settings also include adjusting the transparency of the pre-processed original image.

6. The high-precision digital restoration method for endangered ancient Shu brocade patterns according to claim 1, characterized in that: It also includes automatic quantitative evaluation of vector graphics drawing quality, including the following processing methods: A) Quantitative analysis of accuracy: The error between the vectorized loop cell pattern saved as a bitmap image with the same resolution as the preprocessed loop cell image and the preprocessed loop cell image is measured using the following formula: ; ; In the formula, Represents the coordinate position of an image pixel. This represents the pixel value of a point in the bitmap image stored in the vectorized cyclic unit pattern. This represents the pixel value at a certain point in the preprocessed loop unit image. This represents visual tolerance, for binary images like the preprocessed original image. The value range is [50, 100]; Indicates measurement error, This indicates the number of pixels; the error between the reconstructed image and the original image is calculated pixel by pixel in the grayscale space. Points that meet the expectations are marked as 1, and those that do not are marked as 0. Finally, the number of pixels that meet the accuracy requirements is counted. B) Quantitative analysis of continuity: This is calculated by examining the angles at the intersections of all curves in the statistical vector diagram, and then using a function... Will The obtained values ​​are mapped to [0,1]. If the continuity measure value approaches 1, the curve forms more inflection points, resulting in a worse visual effect. It is a path The curve connecting the beginning and end, For curves With curve The included angle at the intersection, These are preset continuity parameters; C) Quantitative analysis of simplicity: The number of different nodes is counted by traversing the entire DOM tree of the vector image and mapped to [0,1]. The calculation is performed using the following formula: In the formula, raster image Corresponding to the curve unit in the vector diagram, raster image All curves in the corresponding vector diagram, Let e ​​be the highest degree of the curve element. and raster images Correspondence Tree The number of colors in the closed region.

7. The high-precision digital restoration method for endangered ancient Shu brocade patterns according to claim 6, characterized in that: When performing a simplicity quantification analysis, the complexity of a curve is reflected by the degree of the curve. A straight line has a weight of 1, a quadratic Bézier curve has a weight of 2, and a cubic Bézier curve has a weight of 3. The number of regions has a weight of 1, and the number of colors has a weight of 3. The weight of colors is higher than that of regions. The more colors there are, the greater the measure of simplicity will be.

Citation Information

Patent Citations

  • Unity 3D based Tujia brocade virtual design system

    CN106709978A

  • Automatic analysis method for growth fusion degree of adherent cells

    CN107123102A

  • Digital protection technology of minority braid patterns

    CN108573028A

  • Vectorization effect evaluation method based on perception driving

    CN113112570A

  • Image data enhancement method and device, computer equipment and storage medium

    CN115205524A