A method for vectorization of sub-graphs of traditional cultural memory symbols

By calculating the weighted sum of image pixel points and feature components, dixtra algorithm and color gradient fusion and other technologies, local sub-elements in traditional cultural images are extracted and vectorized, which solves the problem of low extraction efficiency and poor quality in the existing technology. The problem of this paper realizes the vectorization of high-quality sub-elements and improves the efficiency and creative value of cultural materials.

CN114461829BActive Publication Date: 2024-11-26BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210105751.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2024-11-26
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively extract and vectorize local sub-elements in traditional cultural images, resulting in low efficiency in material library use and unsatisfactory image quality, and the inability to fully exert cultural value.

Method used

By calculating image pixel points, determining element outlines and extracting complete sub-elements, using feature component weighted summation and dixtra algorithm to obtain closed contours, fusing color gradient features to improve fit, clustering processing to divide regions, and using multi-level edges Detection and Bezier curve fitting are converted into smooth vector contours to achieve accurate vectorization of sub-elements.

Benefits of technology

It achieves accurate and complete vector images of sub-elements with less interaction, improves the quality of material library materials, reduces the difficulty of secondary creation of cultural materials, and allows cultural materials to maximize their creative value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114461829B_ABST
    Figure CN114461829B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for vectorizing sub-images of traditional cultural memory symbols, which includes the following steps: S1, calculating pixel points in an image, determining element outlines and extracting complete sub-elements; S2, performing image processing on the sub-elements and dividing them into different regions; S3, approximating the edges of each region and converting them into smooth vector region outlines; S4, integrating the data information in each region, obtaining and saving the regional vectorization results, and outputting the vector graph of the sub-element. Accurate and complete sub-elements are obtained through less interaction, and local element vectorization is achieved through vectorization technology to obtain the corresponding vector material, thereby completing the entire process of sub-element vectorization in traditional cultural images and obtaining the vector graph of local elements in the image; thereby quickly obtaining the local sub-element vector graph in the image, improving the material quality, and greatly reducing the difficulty of secondary creation of cultural materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer image processing, and in particular to a method for vectorizing sub-graphs of traditional cultural memory symbols. Background Art

[0002] In today's era, digitizing and reusing cultural heritage is an effective way to protect and inherit culture. The "Chinese Cultural Material Library" is a cultural "gold mine" spawned by the digitization of cultural resources. Discovering this cultural "gold mine" is of epoch-making significance for inheriting and spreading Chinese culture, changing the way of cultural production, and developing cultural productivity. Image vectorization technology is the core tool for building the "Chinese Cultural Material Library".

[0003] Vector images have many advantages over raster images, such as image quality is independent of resolution, can be scaled without distortion, compact storage, small file size, efficient storage and transmission, and support for editing and modifying geometric primitives. Image vectorization is the process of converting raster images into vector images.

[0004] At present, the materials in the Chinese cultural material library are still mainly whole vector graphics. An image with cultural connotations usually contains one or more sub-elements with rich connotations. The vector graphics of such elements are particularly important in cultural creation. Usually, users need certain post-processing operations to obtain partial vector graphics from the complete vector graphics, which greatly reduces the efficiency of using the materials in the material library. In addition, affected by the image acquisition environment, the image quality is uneven. For images with unsatisfactory effects, if the whole image is directly vectorized, the effect of the obtained vector graphics will also be unsatisfactory, and its cultural value cannot be fully exerted, which reduces the use value of the materials in the material library.

[0005] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention

[0006] In view of the problems in the related art, the present invention proposes a method for vectorizing sub-graphs of traditional cultural memory symbols to overcome the above-mentioned technical problems existing in the existing related art.

[0007] To this end, the specific technical solution adopted by the present invention is as follows:

[0008] A method for vectorizing sub-graphs of traditional cultural memory symbols, the method comprising the following steps:

[0009] S1, calculate the pixels in the image, determine the element outline and extract the complete sub-elements;

[0010] S2, performing image processing on the sub-elements and dividing them into different areas;

[0011] S3, approximate the edges of each region and convert them into smooth vector region contours;

[0012] S4. Integrate the data information in each area, obtain the regional vectorization result and save it, and output the vector diagram of the sub-element.

[0013] Furthermore, the step of calculating pixel points in the image, determining element contours and extracting complete sub-elements includes the following steps:

[0014] S11, selecting feature components representing the edge of the target element, and performing weighted summation on the cost of the feature components to calculate the local cost from each pixel to the adjacent pixel;

[0015] S12, by fusing color gradient features, calculating the channel difference between adjacent pixels, and improving the fit of the element extraction contour;

[0016] S13. Use Dijkstra algorithm to search for the minimum cost path and obtain a complete closed element contour.

[0017] Furthermore, the characteristic components include Laplace zero points, gradient magnitude and gradient direction.

[0018] Furthermore, the calculation formula for calculating the local cost of each pixel to the adjacent pixel by weighted summing of the feature component costs is:

[0019] C(p,q)=w G ·f G (q)+w Z ·f Z (q)+w D ·f D (p,q);

[0020] Where C(p,q) represents the local cost of the directed link from pixel p to the adjacent pixel q, and f Z represents the Laplace zero, f G represents the gradient size, f D represents the gradient direction, w G =0.43, w Z =0.43, w D =0.14.

[0021] Furthermore, the method of fusing color gradient features, calculating channel differences between adjacent pixels, and improving the fit of element extraction contours includes the following steps:

[0022] S121, integrating color gradient features, converting the image into a colorimetric system (CIE-Lab) space, and performing Lab channel separation;

[0023] S122, calculate the difference between the L channel and the ab fusion channel between adjacent pixels, and the calculation formula is as follows:

[0024] f C (q)=(C r ⊙C l ,C t ⊙C b );

[0025]

[0026] Among them, f C (q) represents the color gradient, △L ij =△L i -△L j , △a ij =△a i -△a j , △b ij =△b i -△b j , C r , C l , C t and C b They are the weighted average values ​​of the pixels in the right, left, upper and lower neighborhoods in the color space.

[0027] S123, substituting the difference value into the calculation process of the local cost to improve the fit of the element extraction contour and reduce the number of interactions.

[0028] Furthermore, the formula for substituting the difference value into the calculation process of the local cost is:

[0029] C(p,q)=w G ·[βf G (q)+(1-β)f Z (q)]+w Z ·f Z (q)+w D ·f D (p,q);

[0030] Where C(p,q) represents the local cost of the directed link from pixel p to the adjacent pixel q, and f Z represents the Laplace zero, f G represents the gradient size, f D represents the gradient direction, w G =0.43, w Z=0.43, w D =0.14.

[0031] Furthermore, the method of searching for the minimum cost path using the Dijkstra algorithm to obtain a completely closed element outline includes the following steps:

[0032] S131, select any point on the element boundary for expansion, and then add the local cost of the point to its adjacent nodes;

[0033] S132, select the adjacent node with the minimum cumulative cost to continue expanding;

[0034] S133, repeatedly expand the nodes to form a sequence until they coincide with the initial point, thereby obtaining a completely closed element outline.

[0035] Furthermore, the performing image processing on the sub-elements and dividing them into different areas comprises the following steps:

[0036] S21, using a clustering algorithm to perform clustering processing on the regions in the image, and setting a certain spatial distance and color distance;

[0037] S22, performing multiple iterations, replacing the original pixel values ​​with the converged pixel values, and merging locally similar pixel points to obtain different color regions;

[0038] S23, extracting the edge structure of each region, using a multi-level edge detection (canny) operator to detect the edge of the region, calculating the image gradient size and direction, performing non-maximum suppression and double threshold screening, and obtaining the region edge.

[0039] Furthermore, the approximation of the edges of each region to convert them into smooth vector region contours includes the following steps:

[0040] S31, simplifying the obtained edge curve by using Douglas-Peucker algorithm;

[0041] S32, iteratively selecting points on the curve whose farthest distance from the corresponding straight line segment is greater than a set threshold as polygon vertices, and connecting them to obtain a fitting polygon;

[0042] S33, fitting and smoothing the polygon using a Bezier curve, and converting it into an accurate and smooth vector contour.

[0043] Furthermore, the data information includes vector contour information and color information.

[0044] The beneficial effects of the present invention are: accurate and complete sub-elements are obtained through less interaction, and through vectorization technology, local elements are vectorized to obtain their corresponding vector materials, thereby completing the entire process of sub-element vectorization in traditional cultural images and obtaining vector graphics of local elements in the image. Compared with general image extraction methods, the present invention not only ensures the fit of the extracted contour when extracting elements, but also greatly reduces the number of interactions. At the same time, the two-stage process proposed by the present invention enables users to quickly obtain local sub-element vector graphics in the image through less interaction, improves the quality of materials in the material library, greatly reduces the difficulty of secondary creation of cultural materials, and enables cultural materials to play their maximum creative value. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 It is a flowchart of a method for vectorizing sub-graphs of traditional cultural memory symbols according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] According to an embodiment of the present invention, a method for vectorizing sub-graphs of traditional cultural memory symbols is provided.

[0048] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to the method for vectorizing sub-graphs of traditional cultural memory symbols according to an embodiment of the present invention, the method comprises the following steps:

[0049] S1, calculate the pixels in the image, determine the element outline and extract the complete sub-elements;

[0050] In this step, the problem of finding the edge contour of the element is regarded as the optimal path search problem in the graph search process. The optimal path must be a path that fits the boundary of the element. Therefore, the connection between pixels with strong edge features and other pixels should have a lower local cost.

[0051] Wherein, S1 comprises the following steps:

[0052] S11, select the characteristic components representing the edge of the target element (the characteristic components include Laplace zero point, gradient magnitude and gradient direction), and perform weighted summation on the characteristic component costs to calculate the local cost from each pixel to the adjacent pixel. The calculation formula is:

[0053] C(p,q)=w G ·f G (q)+w Z ·f Z (q)+w D ·f D (p,q);

[0054] Where C(p,q) represents the local cost of the directed link from pixel p to the adjacent pixel q, and f Z represents the Laplace zero, f G represents the gradient size, f D represents the gradient direction, w G =0.43, w Z =0.43, w D =0.14.

[0055] The gradient size cost term mainly describes the edge strength. Positions with strong edge strength should pay a smaller cost. The image is convolved with the Sobel operator to obtain the gradient size.

[0056] The Laplace zero-point cost term is mainly used to describe the boundary positioning. The image is convolved with the Laplace operator to obtain Out L , if Out L When (q) = 0 or there is a neighbor with a different sign, let f Z (q)=0, otherwise f Z (q)=1.

[0057] The gradient direction cost term is mainly used to add smooth constraints to the positions where the boundary direction changes, and to assign a larger cost to the positions where the direction changes sharply. Let D(p) be the unit vector perpendicular to the gradient direction at point p, then the gradient direction cost calculation formula is as follows:

[0058]

[0059] d p (p,q)=D(p)·L(p,q);

[0060] d q (p,q)=L(p,q)·D(q);

[0061]

[0062] Where L(p,q) represents the link direction between two points, so that the difference between p and the final determined link direction is less than 90 degrees. When the gradient directions of two pixels are similar to each other and the link direction between them is also similar, the cost of the gradient direction feature is very low.

[0063] Considering the problem of inconsistent grayscale and color change areas in the image, the grayscale gradient penalty term is further optimized. Given an input image, it is first converted into a perceptually uniform CIE-Lab color space, and then the color gradient fusion of the following color image is performed.

[0064] S12, by fusing color gradient features, calculating the channel difference between adjacent pixels, and improving the fit of the element extraction contour;

[0065] Wherein, S12 comprises the following steps:

[0066] S121, integrating color gradient features, converting the image into a colorimetric system (CIE-Lab) space, and performing Lab channel separation;

[0067] S122, calculate the difference between the L channel and the ab fusion channel between adjacent pixels, and the calculation formula is as follows:

[0068] f C (q)=(C r ⊙C l ,C t ⊙C b );

[0069]

[0070] Among them, f C (q) represents the color gradient, △L ij =△L i -△L j , △a ij =△a i -△a j , △b ij =△b i -△b j , C r , C l , C t and C b are the weighted averages of the pixels in the right, left, upper, and lower neighborhoods in the colorimetric system (CIE-Lab) space, and their expressions are:

[0071] C r =(2c(x+1,y)+c(x+1,y-1)+c(x+1,y+1)) / 4;

[0072] C l =(2c(x-1,y)+c(x-1,y-1)+c(x-1,y+1)) / 4;

[0073] C t =(2c(x,y+1)+c(x-1,y+1)+c(x+1,y+1)) / 4;

[0074] C d =(2c(x,y-1)+c(x-1,y-1)+c(x+1,y-1)) / 4;

[0075] c(x,y) is the CIE-Lab value at the position (x,y) in the image.

[0076] When searching for edges, the location with a greater color gradient change is more likely to be the target boundary, which is consistent with the grayscale gradient change.

[0077] S123, substituting the difference value into the calculation process of the local cost to improve the fit of the element extraction contour and reduce the number of interactions.

[0078] The formula for substituting the difference value into the calculation process of the local cost is:

[0079] C(p,q)=w G ·[βf G (q)+(1-β)f Z (q)]+w Z ·f Z (q)+w D ·f D (p,q);

[0080] Where C(p,q) represents the local cost of the directed link from pixel p to the adjacent pixel q, and f Z represents the Laplace zero, f G represents the gradient size, f D represents the gradient direction, w G =0.43, w Z =0.43, w D =0.14.

[0081] S13. Use Dijkstra algorithm to search for the minimum cost path and obtain a complete closed element contour.

[0082] Wherein, S13 comprises the following steps:

[0083] S131, select any point on the element boundary for expansion, and then add the local cost of the point to its adjacent nodes;

[0084] S132, select the adjacent node with the minimum cumulative cost to continue expanding;

[0085] S133, repeatedly expand the nodes to form a sequence until they coincide with the initial point, thereby obtaining a completely closed element outline.

[0086] S2, performing image processing on the sub-elements and dividing them into different areas;

[0087] Wherein, S2 includes the following steps:

[0088] S21, using a clustering algorithm to perform clustering processing on the regions in the image, and setting a certain spatial distance and color distance;

[0089] S22, performing multiple iterations, replacing the original pixel values ​​with the converged pixel values, and merging locally similar pixel points to obtain different color regions;

[0090] Among them, the specific steps of color clustering and edge detection of elements to obtain different areas in the elements are: first, select a feature point in the feature space at random, define a circular area with a radius of R around the feature point, calculate the offset vector from the center point to other feature points in the area, and stipulate that the feature points closer to the center point have a greater estimated weight for the offset vector. The calculation formula is as follows:

[0091]

[0092] The center point is moved according to the obtained vector, and then it is solved iteratively. When the mean drift is less than the set error, the movement is stopped and a clustered image is obtained. The image is divided into different color areas. The color of each area is replaced by the color of the feature point, and the color information of each area is stored to facilitate subsequent color filling.

[0093] S23, extracting the edge structure of each region, using a multi-level edge detection (canny) operator to detect the edge of the region, calculating the image gradient size and direction, performing non-maximum suppression and double threshold screening, and obtaining the region edge.

[0094] For each continuous edge, connect a straight line AB between the first and last points A and B of the curve. This straight line is the chord of the curve. Calculate the point C on the curve that is the longest distance from the straight line segment, and calculate its distance d from AB. Compare the distance with the pre-given threshold threshold. If it is less than the threshold, the straight line segment is used as an approximation of the curve, and the processing of the curve segment is completed. If the distance is greater than the threshold, use C to divide the curve into two segments AC and BC, and perform the above calculations on the two curves respectively. When all curves are processed, connect the broken lines formed by each segmentation point in sequence, which can be used as an approximation of the curve.

[0095] S3, approximate the edges of each region and convert them into smooth vector region contours;

[0096] Among them, S3 includes the following steps:

[0097] S31, simplifying the obtained edge curve by using Douglas-Peucker algorithm;

[0098] S32, iteratively selecting points on the curve whose farthest distance from the corresponding straight line segment is greater than a set threshold as polygon vertices, and connecting them to obtain a fitting polygon;

[0099] S33, fitting and smoothing the polygon using a Bezier curve, and converting it into an accurate and smooth vector contour.

[0100] Among them, the cubic Bezier curve is defined as follows:

[0101] B n (t) = P0(1-t) 3 +3P1t(1-t) 2 +3P2t 2 (1-t)+P3t 3 ,t∈[0,1];

[0102] The first two points are the starting point and the midpoint of the curve segment, and the two points in the middle need to be calculated. i The tangent direction of the point is related to P i-1 P i+1 The direction is the same, and the control point in front of the point and the control point behind it are all on this tangent line, so the coordinates of the two control points are as follows:

[0103] A i (x i +a(x i+1 -x i-1 ),y i +a(y i+1 -y i-1 ));

[0104] B i (x i+1 +b(x i+2 -x i ),y i+1 +b(y i+2 -y i ));

[0105] According to the starting and ending points of each edge of the polygon and the coordinates of the control points, the polygon is converted into a vector outline.

[0106] S4. Integrate the data information in each area, obtain the regional vectorization result and save it, and output the vector diagram of the sub-element.

[0107] The data information includes vector contour information and color information, and the result is written into svg format for storage.

[0108] In summary, with the help of the above technical solution of the present invention, accurate and complete sub-elements are obtained through less interaction, and through vectorization technology, local elements are vectorized to obtain their corresponding vector materials, thereby completing the entire process of sub-element vectorization in traditional cultural images and obtaining the vector map of local elements in the image. Compared with general image extraction methods, the present invention not only ensures the fit of the extracted contour during element extraction, but also greatly reduces the number of interactions. At the same time, the two-stage process proposed by the present invention enables users to quickly obtain local sub-element vector maps in the image through less interaction, thereby improving the quality of materials in the material library, greatly reducing the difficulty of secondary creation of cultural materials, and enabling cultural materials to play their maximum creative value.

[0109] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for vectorizing sub-graphs of traditional cultural memory symbols, characterized in that: The method comprises the following steps: S1, calculate the pixels in the image, determine the element outline and extract the complete sub-elements; S2, performing image processing on the sub-elements and dividing them into different areas; S3, approximate the edges of each region and convert them into smooth vector region contours; S4, integrating the data information in each area, obtaining and saving the regional vectorization results, and outputting the vector diagram of the sub-element; The method of calculating pixel points in the image, determining element contours and extracting complete sub-elements includes the following steps: S11, selecting feature components representing the edge of the target element, and performing weighted summation on the cost of the feature components to calculate the local cost from each pixel to the adjacent pixel; S12, by fusing color gradient features, calculating the channel difference between adjacent pixels, and improving the fit of the element extraction contour; S13, using Dijkstra algorithm to search for the minimum cost path and obtain a complete closed element contour; The process of approximating the edges of each region and converting them into smooth vector region contours comprises the following steps: S31, simplifying the obtained edge curve by using Douglas-Peucker algorithm; S32, iteratively selecting points on the curve whose farthest distance from the corresponding straight line segment is greater than a set threshold as polygon vertices, and connecting them to obtain a fitting polygon; S33, fitting and smoothing the polygon using a Bezier curve, and converting it into an accurate and smooth vector contour.

2. The method for vectorizing sub-graphs of traditional cultural memory symbols according to claim 1, characterized in that: The characteristic components include Laplace zero points, gradient magnitude and gradient direction.

3. The method for vectorizing sub-graphs of traditional cultural memory symbols according to claim 2, characterized in that: The calculation formula for calculating the local cost from each pixel to the adjacent pixel by weighted summing of the feature component costs is: C(p,q)=w G ·f G (q)+w Z ·f Z (q)+w D ·f D (p,q); Where C(p,q) represents the local cost of the directed link from pixel p to the adjacent pixel q, and f Z represents the Laplace zero, f G represents the gradient size, f D represents the gradient direction, w G =0.43, w Z =0.43, w D =0.

14.

4. The method for vectorizing sub-graphs of traditional cultural memory symbols according to claim 3, characterized in that: The method of fusing color gradient features, calculating channel differences between adjacent pixels, and improving the fit of element extraction contours includes the following steps: S121, integrating color gradient features, converting the image into a colorimetric system space, and performing Lab channel separation; S122, calculate the difference between the L channel and the ab fusion channel between adjacent pixels, and the calculation formula is as follows: f C (q)=(C r ⊙C l ,C t ⊙⊙C b ); Among them, f C (q) represents the color gradient, ΔL ij =ΔL i -ΔL j , Δa ij =Δa i -Δa j , Δb ij =Δb i -Δb j , C r , C l , C t and C b are the weighted average values ​​of the pixels in the right, left, upper and lower neighborhoods in the color space; S123, substituting the difference value into the calculation process of the local cost to improve the fit of the element extraction contour and reduce the number of interactions.

5. The method for vectorizing sub-graphs of traditional cultural memory symbols according to claim 4, characterized in that: The formula for substituting the difference value into the calculation process of the local cost is: C(p,q)=w G ·[βf G (q)+(1-β)f Z (q)]+w Z ·f Z (q)+w D ·f D (p,q); Where C(p,q) represents the local cost of the directed link from pixel p to the adjacent pixel q, and f Z represents the Laplace zero, f G represents the gradient size, f D represents the gradient direction, w G =0.43, w Z =0.43, w D =0.

14.

6. The method for vectorizing sub-graphs of traditional cultural memory symbols according to claim 5, characterized in that: The method of using the Dijkstra algorithm to search for the minimum cost path and obtain a completely closed element contour includes the following steps: S131, select any point on the element boundary for expansion, and then add the local cost of the point to its adjacent nodes; S132, select the adjacent node with the minimum cumulative cost to continue expanding; S133, repeatedly expand the nodes to form a sequence until they coincide with the initial point, thereby obtaining a completely closed element outline.

7. The method for vectorizing sub-graphs of traditional cultural memory symbols according to claim 1, characterized in that: The performing image processing on the sub-element and dividing it into different areas comprises the following steps: S21, using a clustering algorithm to perform clustering processing on the regions in the image, and setting a certain spatial distance and color distance; S22, performing multiple iterations, replacing the original pixel values ​​with the converged pixel values, and merging locally similar pixel points to obtain different color regions; S23, extracting the edge structure of each region, performing edge detection on the region using a multi-level edge detection operator, calculating the size and direction of the image gradient, performing non-maximum suppression and double threshold screening, and obtaining the region edge.

8. The method for vectorizing sub-graphs of traditional cultural memory symbols according to claim 1, characterized in that: The data information includes vector contour information and color information.

Citation Information

Patent Citations

  • Method for predicting traffic flow extracted by improved C-V model-based remote sensing image road network

    CN101980317A

  • Method for vectorization of reservoir geological section map

    CN107273608A

  • Thangka element vectorization method based on diffusion curve

    CN113706648A

  • Construction method and device of retinal vessel vectorization model and storage medium

    CN113963006A

  • Outline extracting device and outline extracting method

    JP1998143654A