Graphic Processing Method, Apparatus, Storage Medium, and Electronic Device
By parameterizing the curved closed graph and Fourier series expansion, and generating its Fourier coefficients as features, the problems of high complexity and unstable hashing algorithms in the prior art are solved, and more efficient and stable hashing calculations are achieved.
Patent Information
- Application Number
- CN202510483666.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-04-17
AI Technical Summary
When processing curved closed graphics, the existing graph hash algorithm has high computational complexity, the hash value is susceptible to parameter selection, and needs to be recalculated after mirroring, resulting in reduced efficiency and possible error introduction.
By parameterizing the boundary of the curved edge closed figure, the curved edge function is generated, and Fourier series expansion is performed. The Fourier coefficient of the preset series is selected as the target feature, and a standard hash algorithm is used to generate a unique hash value.
Improve the stability of the hash value of curved closed graphics, reduce the computational complexity, avoid the recomputation overhead caused by mirror processing, and enhance the consistency of processing efficiency and hash value.
Smart Images

Figure CN119992118B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of graphics processing, and particularly to a graphics processing method, device, storage medium, and electronic device. Background Art
[0002] In the fields of computer vision, pattern recognition, and information security, how to efficiently and stably represent a curvilinear closed figure and calculate its unique hash value is an important technical issue.
[0003] When existing graphics hash algorithms process curvilinear closed figures, they mainly rely on boundary point sampling, shape feature extraction, or Fourier descriptors, with high computational complexity and the hash value being easily affected by parameter selection. Especially after a curvilinear closed figure is mirrored, traditional graphics hash algorithms need to recalculate the points on the figure boundary, resulting in increased computational complexity, reduced processing efficiency, and possible introduction of errors. Summary of the Invention
[0004] The embodiments of the present application provide a graphics processing method, device, storage medium, and electronic device, which can improve the stability of the hash value of a curvilinear closed figure.
[0005] In a first aspect, the embodiments of the present application provide a graphics processing method, including:
[0006] Obtain a curvilinear closed figure to be processed;
[0007] Parameterize the boundary of the curvilinear closed figure to generate a curvilinear function;
[0008] Perform Fourier series expansion on the curvilinear function to generate the Fourier series of the curvilinear closed figure;
[0009] Select Fourier coefficients of a preset series from the Fourier series as the first target feature of the curvilinear closed figure;
[0010] Perform a hash operation on the first target feature using a standard hash algorithm to generate the unique hash value of the curvilinear closed figure.
[0011] In the graphics processing method provided by the embodiments of the present application, the performing Fourier series expansion on the curvilinear function to generate the Fourier series of the curvilinear closed figure includes:
[0012] Calculate the Fourier coefficients of the curvilinear function through Fourier transform;
[0013] Perform Fourier series expansion on the curvilinear function based on the Fourier coefficients of the curvilinear function to obtain the Fourier series of the curvilinear closed figure.
[0014] In the graphic processing method provided by the embodiments of the present application, it further includes:
[0015] Based on the Fourier coefficients of the curvilinear function, obtain the second target feature of the mirror image of the curvilinear closed figure;
[0016] Perform a hashing operation on the second target feature by using a standard hashing algorithm to generate a unique hash value of the mirror image of the curvilinear closed figure.
[0017] In the graphic processing method provided by the embodiments of the present application, the step of obtaining the second target feature of the mirror image of the curvilinear closed figure based on the Fourier coefficients of the curvilinear function includes:
[0018] Obtain the mirror image relationship between the curvilinear closed figure and its mirror image;
[0019] Calculate the second target feature of the mirror image according to the Fourier coefficients of the curvilinear function and the mirror image relationship.
[0020] In the graphic processing method provided by the embodiments of the present application, the step of calculating the second target feature of the mirror image according to the Fourier coefficients of the curvilinear function and the mirror image relationship includes:
[0021] Determine the linear transformation relationship between the Fourier coefficients of the curvilinear function and the Fourier coefficients of the mirror image according to the mirror image relationship;
[0022] Calculate the Fourier coefficients of the mirror image according to the linear transformation relationship and the Fourier coefficients of the curvilinear function;
[0023] Generate the second target feature based on the Fourier coefficients of the mirror image.
[0024] In the graphic processing method provided by the embodiments of the present application, the step of parameterizing the boundary of the curvilinear closed figure to generate a curvilinear function includes:
[0025] Select a parameterization starting point on the boundary of the curvilinear closed figure according to a preset method;
[0026] Starting from the parameterization starting point, perform parameterization along the boundary in the way of arc length accumulation, and calculate the normalized arc length parameter of each point on the boundary;
[0027] Perform interpolation processing based on the normalized arc length parameter to generate a curvilinear function.
[0028] In the graphic processing method provided by the embodiments of the present application, the step of selecting a parameterization starting point on the boundary of the curvilinear closed figure according to a preset method includes:
[0029] Calculate the centroid of the curvilinear closed figure;
[0030] Select the boundary point closest to the centroid as the parameterization starting point.
[0031] In a second aspect, an embodiment of the present application provides a graphics processing device, including:
[0032] A graphics acquisition unit, configured to acquire a curvilinear closed graph to be processed;
[0033] A first generation unit, configured to parameterize the boundary of the curvilinear closed graph to generate a curvilinear function;
[0034] A second generation unit, configured to perform a Fourier series expansion on the curvilinear function to generate a Fourier series of the curvilinear closed graph;
[0035] A feature acquisition unit, configured to select Fourier coefficients of a preset series from the Fourier series as the first target feature of the curvilinear closed graph;
[0036] A hash operation unit, configured to perform a hash operation on the first target feature by using a standard hash algorithm to generate a unique hash value of the curvilinear closed graph.
[0037] In a third aspect, the present application provides a storage medium, which stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the graphics processing method described in any one of the above.
[0038] In a fourth aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the graphics processing method described in any one of the above is implemented.
[0039] In summary, the graphics processing method provided by the embodiment of the present application includes acquiring a curvilinear closed graph to be processed; parameterizing the boundary of the curvilinear closed graph to generate a curvilinear function; performing a Fourier series expansion on the curvilinear function to generate a Fourier series of the curvilinear closed graph; selecting Fourier coefficients of a preset series from the Fourier series as the first target feature of the curvilinear closed graph; performing a hash operation on the first target feature by using a standard hash algorithm to generate a unique hash value of the curvilinear closed graph. This solution uses the Fourier series to represent the closed curvilinear graph as a series of Fourier coefficients, so that the main features of the curvilinear closed graph can be stably represented. Even if there is a small amount of noise interference, the stability of the hash value can be ensured. That is, this solution can improve the stability of the hash value of the curvilinear closed graph. Description of the Drawings
[0040] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0041] Figure 1 It is a schematic diagram of the application scenario of the graphic processing method provided by the embodiment of the present application.
[0042] Figure 2 It is a schematic flowchart of the graphic processing method provided by the embodiment of the present application.
[0043] Figure 3 It is a schematic structural diagram of the graphic processing device provided by the embodiment of the present application.
[0044] Figure 4 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application. Detailed Embodiments
[0045] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0046] It should be noted that in this document, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another same element in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanations in the specific embodiments or further in combination with the context of the specific embodiments.
[0047] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] In the following description, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of describing the present application, and have no specific meaning in themselves. Therefore, "module", "component", or "unit" can be used interchangeably.
[0049] In the description of the present application, it should be noted that the orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be construed as a limitation to the present application. In addition, terms such as "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0050] Existing graphic hashing algorithms mainly rely on boundary point sampling, shape feature extraction, or Fourier descriptors when dealing with curved-edge closed graphics, resulting in high computational complexity and hash values being easily affected by parameter selection. Especially after a curved-edge closed graphic is mirrored, traditional graphic hashing algorithms need to recalculate the points on the graphic boundary, leading to increased computational complexity, reduced processing efficiency, and possible introduction of errors.
[0051] Based on this, embodiments of the present application provide a graphic processing method, device, storage medium, and electronic device. Specifically, the graphic processing device can be integrated in an electronic device, which can be a server or a terminal device, etc.; among them, the terminal can include a mobile phone, a wearable intelligent device, a tablet computer, a laptop computer, and a personal computer (PC), etc.; the server can be a single server or a server cluster composed of multiple servers, and can be a physical server or a virtual server.
[0052] For example, as Figure 1 shown, after the electronic device obtains a curved-edge closed graphic to be processed, it can parameterize the boundary of the curved-edge closed graphic to generate a curved-edge function; then perform a Fourier series expansion on the curved-edge function to generate the Fourier series of the curved-edge closed graphic; then select the Fourier coefficients of a preset series from the Fourier series as the first target feature of the curved-edge closed graphic; finally, perform a hashing operation on the first target feature using a standard hashing algorithm to generate the unique hash value of the curved-edge closed graphic.
[0053] The technical solutions shown in the present application will be described in detail below through specific embodiments. It should be noted that the description order of the following embodiments does not limit the priority order of the embodiments.
[0054] Please refer to Figure 2 ,Figure 2 It is a schematic flowchart of the graphic processing method provided by an embodiment of this application. The specific process of this graphic processing method can be as follows:
[0055] 101. Obtain a curvilinear closed graphic to be processed.
[0056] Among them, a curvilinear closed graphic refers to a closed shape whose boundary is composed of smooth curves.
[0057] In the actual application process, this curvilinear closed graphic can be extracted from an image, imported from a CAD or vector graphic file, and generated through mathematical formulas or curve fitting.
[0058] For example, through image processing technologies such as edge detection and contour extraction, a curvilinear closed graphic can be extracted from a digital image. For CAD design files (such as DXF or SVG), the path data in the file can be directly parsed to obtain the curvilinear closed graphic. If there is no ready-made graphic data, curves can be generated through mathematical functions (such as Bezier curves, spline curves, etc.) to create a curvilinear closed graphic, or a curvilinear closed graphic can be generated through fitting and simulation according to actual requirements.
[0059] 102. Parameterize the boundary of the curvilinear closed graphic to generate a curvilinear function.
[0060] A curvilinear closed graphic in a two-dimensional plane can be represented as a parameterized curvilinear function f(t) in the complex plane, where t ∈ [0, 1], representing the normalized arc length parameter. Specifically, arc-length parameterization can be used to parameterize the closed curvilinear graphic, so that the boundary points of the curvilinear closed graphic can be uniquely represented by a normalized arc length parameter t ∈ [0, 1], thereby ensuring the consistency and stability of Fourier transform calculations.
[0061] In some embodiments, a parameterization starting point can be selected on the boundary of the curvilinear closed graphic according to a preset method; then starting from the parameterization starting point, parameterization is performed along the boundary in the way of arc length accumulation, and the normalized arc length parameter of each point on the boundary is calculated; finally, interpolation processing is performed based on the normalized arc length parameter to generate a curvilinear function.
[0062] For example, assume that the boundary of the curvilinear closed graphic is composed of M discrete points P0, P1,..., P M−1 where P M = P0, P i =(x i , y i ) represents a boundary point. The coordinates of the boundary points can be obtained through edge detection or contour extraction methods (such as the Canny algorithm or contour tracking).
[0063] Then, calculate the Euclidean distance d between adjacent boundary points i :
[0064] , where i = 1, 2,..., M.
[0065] After that, based on the Euclidean distance d between adjacent boundary points i the arc length L of the entire curved edge can be calculated:
[0066] .
[0067] Then, the cumulative arc length s from the parameterized starting point P0 to point P i can be calculated: i :
[0068] .
[0069] Thus, the normalized arc length parameter t of each point can be calculated according to the cumulative arc length s i : i :
[0070] , where t i ∈[0, 1].
[0071] In this way, each point P i corresponds to a unique normalized arc length parameter t i , that is, the parameterized representation of the closed curved edge figure: P(t) = (x(t), y(t)), t ∈ [0, 1].
[0072] Since the discretely sampled points may be uneven, in order to ensure the smoothness of the Fourier transform calculation, interpolation methods (such as spline interpolation or Lagrange interpolation) need to be used to reconstruct the continuous functions x(t) and y(t). That is, through {t i , x i} and {t i , y i} for interpolation to obtain the continuous functions: x(t) = S x (t), y(t) = S y (t), t ∈ [0, 1]. Thus, a parameterized curved edge function f(t) that can be input into the Fourier transform can be obtained: f(t) = x(t) + iy(t), t ∈ [0, 1].
[0073] In some embodiments, the boundary point closest to the centroid can be selected as the parameterized starting point. That is, the step "select a parameterized starting point on the boundary of the closed curved edge figure according to a preset method" can be: calculate the centroid of the closed curved edge figure; select the boundary point closest to the centroid as the parameterized starting point.
[0074] Among them, the calculation method of the centroid and the calculation method of selecting the boundary point closest to the centroid can refer to the common knowledge in the field and will not be elaborated here one by one.
[0075] 103. Perform a Fourier series expansion on the curvilinear function to generate the Fourier series of the curvilinear closed figure.
[0076] Specifically, the Fourier coefficients C of the curvilinear function can be calculated through Fourier transform k :
[0077] .
[0078] The Fourier coefficients can fully express the geometric characteristics of the curvilinear closed figure, so the obtained hash value has high uniqueness and stability.
[0079] Then, based on the Fourier coefficients of the curvilinear function, perform a Fourier series expansion on the curvilinear function to obtain the Fourier series of the curvilinear closed figure:
[0080] .
[0081] After adopting the Fourier series expansion, the main features of the curvilinear closed figure can be stably represented, and the stability of the hash value can be ensured even in the presence of small-amplitude noise interference.
[0082] 104. Select the Fourier coefficients of the preset series from the Fourier series as the first target feature of the curvilinear closed figure.
[0083] Due to the limitation of calculation accuracy, only the first N + 1 Fourier coefficients can be retained as the first target feature of the curvilinear closed figure. For example, the first 10 Fourier coefficients can be retained as the first target feature of the curvilinear closed figure.
[0084] That is, the first target feature f t can be as follows:
[0085] .
[0086] Through this embodiment, only a finite number of Fourier coefficients need to be stored to describe the curvilinear figure, greatly reducing the calculation and storage requirements. In addition, by retaining the first N-level Fourier coefficients, the uniqueness of the hash value can be improved while ensuring the calculation efficiency, making the hash values of different curvilinear closed figures not easily collide.
[0087] 105. Perform a hash operation on the first target feature using a standard hash algorithm to generate the unique hash value of the curvilinear closed figure.
[0088] Among them, the standard hash algorithm can be a hash algorithm such as SHA-256, MD5, or Boost::hash. The first target feature can be expressed as {C −N , C −N+1 , …, C0, …, C N−1 , C N}. The unique hash value of the curvilinear closed figure can be directly calculated based on the first target feature.
[0089] It can be understood that the Fourier coefficient C k can also be expressed as: . Among them, i is the imaginary unit, corresponds to the cosine component (representing the symmetric component of the curvilinear function), corresponds to the sine component (representing the anti-symmetric component of the curvilinear function).
[0090] In some embodiments, when it is necessary to calculate the unique hash value of the mirror image of the curvilinear closed curve, the second target feature of the mirror image of the curvilinear closed figure can be obtained based on the Fourier coefficients of the curvilinear closed curve; then the standard hash algorithm is used to perform a hash operation on the second target feature to generate the unique hash value of the mirror image of the curvilinear closed figure.
[0091] Among them, based on the mathematical properties of the Fourier series, when the curvilinear closed figure undergoes a mirror transformation, there is a linear transformation relationship between the Fourier coefficients of the curvilinear closed figure and the Fourier coefficients of its mirror image. Therefore, when it is necessary to calculate the unique hash value of the mirror image, it can be directly calculated based on the Fourier coefficients of the curvilinear closed figure without resampling or performing complex operations.
[0092] It can be understood that the mirror image relationship includes mirroring about the X-axis, mirroring about the Y-axis, and mirroring about the origin. Different mirror image relationships correspond to different linear transformation relationships. Therefore, in the specific implementation process, the step of "obtaining the second target feature of the mirror image of the curvilinear closed figure based on the Fourier coefficients of the curvilinear function" can be to obtain the mirror image relationship between the curvilinear closed figure and its mirror image; calculate the second target feature of the mirror image according to the Fourier coefficients of the curvilinear closed figure and the mirror image relationship.
[0093] Among them, the step of "calculating the second target feature of the mirror image according to the Fourier coefficients of the curvilinear closed figure and the mirror image relationship" can be to determine the linear transformation relationship between the Fourier coefficients of the curvilinear closed figure and the Fourier coefficients of the mirror image according to the mirror image relationship; calculate the Fourier coefficients of the mirror image according to the linear transformation relationship and the Fourier coefficients of the curvilinear closed figure; generate the second target feature based on the Fourier coefficients of the mirror image.
[0094] For example, when the curvilinear closed figure and the mirror image figure are mirror-symmetrical about the X-axis, according to the properties of Fourier transform, the Fourier coefficients of the mirror image figure can be expressed as: . Therefore, the second target feature is: .
[0095] When the curvilinear closed figure and the mirror image figure are mirror-symmetrical about the Y-axis, according to the properties of Fourier transform, the Fourier coefficients of the mirror image figure can be expressed as: . Therefore, the second target feature is: .
[0096] When the curvilinear closed figure and the mirror image figure are mirror-symmetrical about the Y-axis, according to the properties of Fourier transform, the Fourier coefficients of the mirror image figure can be expressed as: . Therefore, the second target feature is: .
[0097] After obtaining the second target feature, the second target feature can be hashed using the hashing algorithm when calculating the unique hash value of the curvilinear closed figure to generate the unique hash value of the mirror image figure.
[0098] In summary, the graphic processing method provided by the embodiments of the present application includes obtaining a curvilinear closed figure to be processed; parameterizing the boundary of the curvilinear closed figure to generate a curvilinear function; performing Fourier series expansion on the curvilinear function to generate the Fourier series of the curvilinear closed figure; selecting the Fourier coefficients of a preset series from the Fourier series as the first target feature of the curvilinear closed figure; and performing hashing operation on the first target feature using a standard hashing algorithm to generate the unique hash value of the curvilinear closed figure.
[0099] This solution uses Fourier series to represent a closed curvilinear figure as a series of Fourier coefficients, so that the main features of the curvilinear closed figure can be stably represented. Even if there is small-amplitude noise interference, the stability of the hash value can be ensured. That is, this solution can improve the stability of the hash value of the curvilinear closed figure.
[0100] This solution optimizes the hash calculation method of the curvilinear closed figure through Fourier transform and normalized arc length parameterization. When calculating the hash value of the mirror image figure using the traditional method, it is necessary to re-perform Fourier transform, with high computational complexity and sensitivity to the starting point and noise, resulting in unstable hash values. This solution uses Fourier series expansion to extract low-order Fourier coefficients and utilizes the linear transformation relationship of Fourier coefficients, so that the Fourier coefficients of the mirror image figure can be directly calculated from the Fourier coefficients of the original curvilinear closed figure, thereby reducing the computational overhead and improving the consistency and stability of the hash value.
[0101] In order to better implement the graphics processing method provided in the embodiment of the present application, the embodiment of the present application also provides a graphics processing device, wherein the meanings of the terms are the same as those in the above-mentioned graphics processing method, and the specific implementation details can refer to the description in the method embodiment.
[0102] See also Figure 3 , Figure 3 2 is a schematic diagram of the structure of the graphics processing device provided in the embodiment of the present application. The graphics processing device may include a graphics acquisition unit 201, a first generation unit 202, a second generation unit 203, a feature acquisition unit 204 and a hash operation unit 205.
[0103] A graphics acquisition unit 201 is used to acquire a curved edge closed graphics to be processed;
[0104] A first generating unit 202 is used to parameterize the boundary of the curved edge closed figure to generate a curved edge function;
[0105] The second generating unit 203 is used to perform Fourier series expansion on the curved edge function to generate the Fourier series of the curved edge closed figure;
[0106] A feature acquisition unit 204 is used to select a preset series of Fourier coefficients from the Fourier series as a first target feature of the curved edge closed figure;
[0107] The hash operation unit 205 is used to perform a hash operation on the first target feature using a standard hash algorithm to generate a unique hash value of the curved edge closed graph.
[0108] The specific implementation of each of the above units can refer to the above-mentioned embodiment of the graphics processing method, which will not be described one by one here.
[0109] In summary, the graphics processing device provided by the embodiment of the present application obtains the curved edge closed figure to be processed by the graphics acquisition unit 201; the first generation unit 202 parameterizes the boundary of the curved edge closed figure to generate a curved edge function; the second generation unit 203 performs Fourier series expansion on the curved edge function to generate the Fourier series of the curved edge closed figure; the feature acquisition unit 204 selects the Fourier coefficients of a preset series from the Fourier series as the first target feature of the curved edge closed figure; the hash operation unit 205 uses a standard hash algorithm to perform a hash operation on the first target feature to generate a unique hash value of the curved edge closed figure. This scheme uses the Fourier series to characterize the closed curved edge figure as a series of Fourier coefficients, so that the main features of the curved edge closed figure can be stably represented, and the stability of the hash value can be guaranteed even if there is a small amount of noise interference. That is, this scheme can improve the stability of the hash value of the curved edge closed figure.
[0110] An embodiment of the present application further provides an electronic device, which may integrate the graphics processing device of the embodiment of the present application, such as Figure 4 shown, which shows a schematic structural diagram of the electronic device involved in the embodiment of the present application. Specifically:
[0111] The electronic device may include components such as a processor 301 with one or more processing cores and a memory 302 with one or more computer-readable storage media. Those skilled in the art can understand that Figure 4 the structure of the electronic device shown in
[0112] does not limit the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements. Among them:
[0113] The processor 301 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing the software programs and / or the present application stored in the memory 302, and calling the data stored in the memory 302, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operation of the storage medium, the user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 301.
[0114] Although not shown, the electronic device may further include a display unit, an input unit, a power supply, etc., which will not be elaborated here. Specifically in this embodiment, the processor 301 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application programs stored in the memory 302 to implement various functions as follows:
[0115] Obtain a curvilinear closed figure to be processed;
[0116] Parameterize the boundary of the curvilinear closed figure to generate a curvilinear function;
[0117] Perform a Fourier series expansion on the curvilinear function to generate the Fourier series of the curvilinear closed figure;
[0118] Select the Fourier coefficients of a preset series from the Fourier series as the first target feature of the curvilinear closed figure;
[0119] Perform a hashing operation on the first target feature using a standard hashing algorithm to generate a unique hash value of the curvilinear closed figure.
[0120] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0121] For this reason, an embodiment of the present application provides a storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps in any one of the methods provided by the embodiments of the present application. For example, the instructions can perform the following steps:
[0122] Obtain a curvilinear closed figure to be processed;
[0123] Parameterize the boundary of the curvilinear closed figure to generate a curvilinear function;
[0124] Perform a Fourier series expansion on the curvilinear function to generate the Fourier series of the curvilinear closed figure;
[0125] Select the Fourier coefficients of a preset series from the Fourier series as the first target feature of the curvilinear closed figure;
[0126] Perform a hashing operation on the first target feature using a standard hashing algorithm to generate a unique hash value of the curvilinear closed figure.
[0127] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, which will not be elaborated here.
[0128] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0129] Since the instructions stored in the storage medium can execute the steps in any of the methods provided in the embodiments of the present application, the beneficial effects achievable by any of the methods provided in the embodiments of the present application can be realized. For details, refer to the previous embodiments and will not be elaborated herein.
[0130] The above has respectively introduced in detail the graphics processing method, device, storage medium and electronic device provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A graphics processing method, characterized in that: include: Get the curved edge closed figure to be processed; Parameterizing the boundary of the curved-edge closed figure to generate a curved-edge function; Calculate the Fourier coefficients of the curved edge function by Fourier transform; Performing Fourier series expansion on the curved edge function based on the Fourier coefficients of the curved edge function to obtain the Fourier series of the curved edge closed figure; Selecting a preset series of Fourier coefficients from the Fourier series as a first target feature of the curved edge closed figure; Performing a hash operation on the first target feature using a standard hash algorithm to generate a unique hash value for the curved-edge closed figure; Based on the Fourier coefficient of the curved edge function, obtaining a second target feature of a mirror image of the curved edge closed figure; A standard hash algorithm is used to perform a hash operation on the second target feature to generate a unique hash value of the mirror image of the curved-edge closed figure.
2. The graphics processing method according to claim 1, characterized in that: The step of obtaining a second target feature of a mirror image of the curved edge closed figure based on the Fourier coefficient of the curved edge function comprises: Obtaining a mirror image relationship between the curved-edge closed figure and its mirror image figure; A second target feature of the mirror image is calculated based on the Fourier coefficient of the curved edge function and the mirror relationship.
3. The graphics processing method according to claim 2, characterized in that: The calculating the second target feature of the mirror image according to the Fourier coefficient of the curved edge function and the mirror relationship comprises: According to the mirror image relationship, determining a linear transformation relationship between the Fourier coefficients of the curved edge function and the Fourier coefficients of the mirror image; Calculating the Fourier coefficients of the mirror image according to the linear transformation relationship and the Fourier coefficients of the curved edge function; A second target feature is generated based on the Fourier coefficients of the mirror image.
4. The graphics processing method according to claim 1, characterized in that: The parameterizing the boundary of the curved-edge closed figure to generate a curved-edge function comprises: According to a preset method, a parameterized starting point is selected on the boundary of the curved edge closed figure; Starting from the parameterization starting point, parameterization is performed along the boundary in an arc length accumulation manner, and a normalized arc length parameter of each point on the boundary is calculated; Interpolation processing is performed based on the normalized arc length parameter to generate a curved edge function.
5. The graphics processing method according to claim 4, characterized in that: The step of selecting a parameterized starting point on the boundary of the curved edge closed figure according to a preset method includes: Calculating the centroid of the curved-edge closed figure; The boundary point closest to the centroid is selected as the parameterization starting point.
6. A graphics processing device, characterized in that: include: A graphics acquisition unit, used for acquiring a curved edge closed graphics to be processed; A first generating unit, configured to parameterize the boundary of the curved-edge closed figure to generate a curved-edge function; A second generating unit, used for calculating the Fourier coefficients of the curved edge function by Fourier transform; Performing Fourier series expansion on the curved edge function based on the Fourier coefficients of the curved edge function to obtain the Fourier series of the curved edge closed figure; A feature acquisition unit, configured to select a preset series of Fourier coefficients from the Fourier series as a first target feature of the curved edge closed figure; A hash operation unit, configured to perform a hash operation on the first target feature using a standard hash algorithm to generate a unique hash value for the curved-edge closed graph; Based on the Fourier coefficient of the curved edge function, obtaining a second target feature of a mirror image of the curved edge closed figure; A standard hash algorithm is used to perform a hash operation on the second target feature to generate a unique hash value of the mirror image of the curved-edge closed figure.
7. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the graphics processing method according to any one of claims 1 to 5.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the graphics processing method according to any one of claims 1 to 5 when executing the computer program.