A method, apparatus, electronic device, and storage medium for extracting character strokes.
By obtaining the character's glyph curve for discrete sampling and selecting key stroke points, and using the A* pathfinding algorithm to obtain closed curves, the problem of accuracy and speed in extracting character strokes of different fonts is solved, achieving fast and accurate stroke extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-03-06
AI Technical Summary
Existing character stroke extraction methods cannot effectively split the same character in different fonts, resulting in insufficient splitting accuracy and speed.
By obtaining the glyph curve of the character to be processed, discrete sampling is performed to obtain a discrete point set. At least two key stroke points are selected from the discrete point set, and the shortest path is searched using the A* pathfinding algorithm to obtain a closed curve, thus forming the stroke curve.
It enables fast and accurate extraction of character strokes, reduces data storage space, and improves the speed and accuracy of character stroke extraction.
Smart Images

Figure CN114359566B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for extracting character strokes. Background Technology
[0002] Currently, character segmentation schemes discretize the character to be segmented and a reference character to obtain a first set of discrete points for the character to be segmented and a second set of discrete points for the reference character. They then establish a correspondence between the first and second sets of discrete points and, based on this correspondence and the reference character, segment the strokes included in the character to be segmented. However, the correspondence between the first and second sets of discrete points has a threshold range. If the difference between the discrete point sets of another font and the second set far exceeds the tolerance threshold, this correspondence no longer holds. Therefore, existing schemes can only segment fonts with similar shapes and cannot perfectly segment the same characters from different fonts. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide a method, apparatus, electronic device, and storage medium for character stroke extraction, which can improve the speed and accuracy of character stroke extraction.
[0004] To solve the above-mentioned technical problems, one technical solution adopted in this application is: to provide a character stroke extraction method, which includes: obtaining the glyph curve of the character to be processed; performing discrete sampling on the glyph curve to obtain a discrete point set; selecting at least two stroke key points from the discrete point set, obtaining a closed curve containing at least two stroke key points, and obtaining the stroke of the character.
[0005] The process involves selecting at least two key stroke points from a set of discrete points to obtain a closed curve containing at least two key stroke points. This includes: selecting a first key stroke point and a second key stroke point from the set of discrete points; searching for the shortest path from the first key stroke point to the second key stroke point to obtain a first stroke curve segment; and searching for the shortest path from the second key stroke point to the first key stroke point to obtain a second stroke curve segment, thus obtaining a stroke curve. The stroke curve is a closed curve formed by the first and second stroke curve segments.
[0006] The steps for obtaining the stroke curve segment include: using the A* pathfinding algorithm to search for the stroke curve segment between the first stroke key point and the second stroke key point.
[0007] The steps for obtaining the stroke curve segment include: determining whether the first stroke key point and the second stroke key point are continuous on the character curve; in response to the first stroke key point and the second stroke key point being continuous on the character curve, using the A* pathfinding algorithm to search for continuous discrete points between the first stroke key point and the second stroke key point on the character curve, and using the continuous discrete points as stroke key points, connecting the stroke key points to form the stroke curve segment.
[0008] The process of using continuous discrete points as stroke key points and connecting these key points to form stroke curve segments includes: determining whether the first stroke key point and the second stroke key point are continuous on the character curve; and responding to the fact that the first stroke key point and the second stroke key point are not continuous on the character curve, simply connecting the first stroke key point and the second stroke key point to form a stroke curve segment, without further searching for discrete points between the first stroke key point and the second stroke key point.
[0009] Among them, the discrete points are not uniformly distributed on the character-shaped curve.
[0010] Among them, the number of discrete points in the first region is greater than the number of discrete points in the second region, and the curve variation amplitude of the character curve in the first region is greater than the curve variation amplitude of the character curve in the second region.
[0011] The process of obtaining the glyph curve of the character to be processed includes: obtaining the glyph key points of the character to be processed; and obtaining the outline of the character to be processed based on the glyph key points using the quadratic Bézier curve equation to obtain the glyph curve of the character to be processed.
[0012] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a character stroke extraction device, which includes: an acquisition module for acquiring the glyph curve of the character to be processed; a sampling module for discretely sampling the glyph curve to obtain a discrete point set; and a generation module for selecting at least two stroke key points from the discrete point set, acquiring a closed curve containing at least two stroke key points, and obtaining the stroke of the character.
[0013] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, including a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the above-mentioned character stroke extraction method.
[0014] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium storing program instructions that can be executed by a processor, the program instructions being used to implement the above-mentioned character stroke extraction method.
[0015] The beneficial effects of this application are as follows: Unlike the prior art, this application provides a character stroke extraction method, which includes: obtaining the glyph curve of the character to be processed; performing discrete sampling on the glyph curve to obtain a discrete point set; selecting at least two stroke key points from the discrete point set to obtain a closed curve containing at least two stroke key points, thereby obtaining the character stroke; therefore, by performing discrete sampling on the glyph curve, it is possible to approximate the original character to be processed to a greater extent and reduce the data storage space; in addition, selecting at least two stroke key points from the discrete point set to generate a closed curve, thereby obtaining the character stroke, achieves fast and accurate character stroke extraction. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an embodiment of the character stroke extraction method provided in this application;
[0017] Figure 2 This is a schematic diagram of an embodiment of the character to be processed provided in this application;
[0018] Figure 3 yes Figure 1 The flowchart of step S11 shown is a schematic diagram of one embodiment.
[0019] Figure 4 yes Figure 1 The flowchart of step S13 shown is a schematic diagram of one embodiment.
[0020] Figure 5 This is a schematic diagram of another embodiment of the character to be processed provided in this application;
[0021] Figure 6 This is a schematic diagram of the framework of an embodiment of the character stroke extraction device provided in this application;
[0022] Figure 7 This is a schematic diagram of the framework of an embodiment of the electronic device provided in this application;
[0023] Figure 8 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0024] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0025] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0026] The terms "system" and "network" are often used interchangeably in this article. The term " / or" in this article is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after. In addition, "multiple" in this article means two or more than two.
[0027] Please refer to Figure 1 , Figure 1 is a schematic flowchart of an embodiment of the character stroke extraction method provided by this application. It should be noted that if there are substantially the same results, this embodiment is not limited to Figure 1 the process sequence shown. As Figure 1 shown, this embodiment includes:
[0028] Step S11: Obtain the glyph curve of the character to be processed.
[0029] The method of this embodiment is used to extract the strokes of the character to be processed. The strokes of the character to be processed described in this article can be obtained by splitting the character to be processed and extracting all the strokes of the character to be processed; or, it can also be to extract some strokes of the character to be processed. For example, as Figure 2 shown, Figure 2 is a schematic diagram of an embodiment of the character to be processed provided by this application. Taking the character to be processed as "wood" as an example, the character to be processed "wood" can be split to obtain all the strokes of the character to be processed, specifically, "one", "vertical", "slash" and or some strokes of the character to be processed "wood" can also be extracted, such as "one" and "slash".
[0030] In one embodiment, the character to be processed can be a Chinese character, for example, oracle bone inscriptions, small seal script or traditional Chinese characters, etc. It can be understood that in other embodiments, the character to be processed can also be Japanese, English, Russian, etc., which can be specifically set according to actual usage needs and will not be specifically limited here. It should be noted that for the convenience of the following description, this application will describe the technical solution with Chinese characters as the character to be processed, but it can be understood that the type of the character to be processed is not limited.
[0031] In one embodiment, the character to be processed and the glyph curve of the character to be processed can be obtained from local storage or cloud storage. It can be understood that in other embodiments, the quadratic Bézier curve equation can also be used to process the character to be processed to obtain the glyph curve of the character to be processed, which will not be limited here and can be specifically set according to actual usage needs.
[0032] Step S12: Discretely sample the character curve to obtain a discrete point set.
[0033] Since the characters to be processed vary in shape, in order to approximate the original shape of the characters as closely as possible and reduce data storage space, this embodiment discretizes the glyph curves of the characters to be processed to obtain a discrete point set.
[0034] In one embodiment, the discrete points are non-uniformly distributed on the character curve. This non-uniform distribution of discrete points preserves the original appearance of the character to be processed while maximizing the use of storage space.
[0035] In one specific implementation, the number of discrete points in the first region is greater than the number of discrete points in the second region, and the curve variation amplitude of the character curve in the first region is greater than that in the second region. That is, more discrete points are set in the region with a larger curve variation amplitude in the character curve outline (the first region), and fewer discrete points are set in the region with a smaller curve variation amplitude (the second region). This increases the number of discrete points that are useful for generating a closed curve later and reduces useless discrete points, resulting in smoother strokes for the character obtained by generating a closed curve later and reducing storage space usage. The number of discrete points in the first region and the second region is not limited and can be set according to actual usage needs.
[0036] Step S13: Select at least two stroke key points from the discrete point set, obtain a closed curve containing at least two stroke key points, and obtain the strokes of the character.
[0037] In this embodiment, at least two stroke key points are selected from the discrete point set, and a closed curve containing at least two stroke key points is obtained, thereby obtaining the strokes of the character. In other words, by using at least two stroke key points from the discrete point set, a closed curve containing two stroke key points can be obtained, thus obtaining the strokes of the character.
[0038] In the above implementation, the character shape curve of the character to be processed is obtained; the character shape curve is discretely sampled to obtain a discrete point set; at least two stroke key points are selected from the discrete point set to obtain a closed curve containing at least two stroke key points, thereby obtaining the strokes of the character; therefore, by discretely sampling the character shape curve, the original character to be processed can be approximated to a greater extent and the data storage space can be reduced; in addition, at least two stroke key points are selected from the discrete point set to generate a closed curve, thereby obtaining the strokes of the character, thus achieving fast and accurate extraction of character strokes.
[0039] Please see Figure 3 , Figure 3 yes Figure 1The flowchart shown is a schematic diagram of one embodiment of step S11. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 3 The illustrated process sequence is limited. For example... Figure 3 As shown, in this embodiment, the character to be processed is processed using the quadratic Bézier curve equation to obtain the glyph curve of the character to be processed, specifically including:
[0040] Step S111: Obtain the glyph key points of the character to be processed.
[0041] Each glyph in a vector font is described by a mathematical equation. A glyph is divided into several key points, and adjacent key points are connected by a smooth curve, which can be determined by a finite number of parameters. Due to the characteristics of vector fonts, in this implementation, the glyph key points of the character to be processed are first obtained. Specifically, the glyph key points of the character to be processed can be obtained from a character library file.
[0042] Step S112: Based on the key points of the character shape, use the quadratic Bézier curve equation to obtain the outline of the character to be processed, and obtain the character shape curve of the character to be processed.
[0043] In this embodiment, the outline of the character to be processed is obtained using a quadratic Bézier curve equation based on the key points of the character's shape, thus obtaining the character's shape curve. In other words, the outline of the character to be processed is drawn along the key points of the character's shape using a quadratic Bézier curve equation, and the drawn outline is the character's shape curve.
[0044] Please see Figure 4 , Figure 4 yes Figure 1 The diagram shows a flowchart of one embodiment of step S13. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow that approach. Figure 4 The illustrated process sequence is limited. For example... Figure 4 As shown, this embodiment includes:
[0045] Step S131: Select the first stroke key point and the second stroke key point from the discrete point set.
[0046] In this embodiment, the first and second stroke key points are selected from a set of discrete points. In one embodiment, the user can manually select the first and second stroke key points from the set of discrete points. Understandably, in other embodiments, algorithms can also be used to select the first and second stroke key points from the set of discrete points, or other existing algorithms can be called to select the first and second stroke key points from the set of discrete points. The specific settings can be configured according to actual usage needs and are not specifically limited here.
[0047] Step S132: Search for the shortest path from the first stroke key point to the second stroke key point to obtain the first stroke curve segment; and search for the shortest path from the second stroke key point to the first stroke key point to obtain the second stroke curve segment, thereby obtaining the stroke curve.
[0048] In this embodiment, search for the shortest path from the first stroke key point to the second stroke key point to obtain the first stroke curve segment; and, search for the shortest path from the second stroke key point to the first stroke key point to obtain the second stroke curve segment. The first stroke curve segment and the second stroke curve segment are directional stroke curve segments and are vectorial. The first stroke curve segment is in the direction from the first stroke key point to the second stroke key point, and the second stroke curve segment is in the direction from the second stroke key point to the first stroke key point. Therefore, the first stroke curve segment and the second stroke curve segment can form a closed curve, that is, the stroke curve is the closed curve formed by the first stroke curve segment and the second stroke curve segment.
[0049] In one embodiment, the A* pathfinding algorithm is used to search for the stroke curve segment between the first stroke key point and the second stroke key point, that is, to search for the shortest path from the first stroke key point to the second stroke key point and the shortest path from the second stroke key point to the first stroke key point. The A* pathfinding algorithm is the most effective direct search algorithm for solving the shortest path in a static road network, which can accelerate the process of selecting the stroke curve segment. The specific formula is as follows:
[0050] f*(n) = g*(n) + h*(n)
[0051] Among them, f*(n) represents the minimum cost estimate from the initial state through state n to the target state; g*(n) represents the minimum estimated cost from the initial state to state n in the state space; h*(n) represents the minimum estimated cost of the path from state n to the target state. For the problem of path search, the state is the stroke key point in the glyph curve data structure, and the cost is the distance; the selection of h(n) must ensure the condition of finding the shortest path (optimal solution). The key lies in the selection of the estimation function f(n) or rather the selection of h(n). Expressing the estimated distance from state n to the target state by h(n), then there are roughly three cases for the selection of h(n): If h(n) < h*(n), in this case, the number of searched points is large, the search range is large, and the efficiency is low, but the optimal solution can be obtained, that is, the shortest path can be obtained; h(n) = h*(n), and the search efficiency is the highest at this time; h(n) > h*(n), in this case, the number of searched points is small, the search range is small, and the efficiency is high, but it cannot be guaranteed to obtain the optimal solution, that is, it cannot be guaranteed to obtain the shortest path.
[0052] In a specific embodiment, as Figure 5 shown Figure 5This is a schematic diagram of another embodiment of the character to be processed provided in this application. It determines whether the first and second stroke key points are continuous on the character curve. If they are continuous, the A* pathfinding algorithm is used to search for continuous discrete points between them on the character curve. These continuous discrete points are then used as stroke key points, and the stroke key points are connected to form a stroke curve segment. In other words, once it is determined that the first and second stroke key points are continuous on the character curve, the A* pathfinding algorithm needs to be activated. This allows all continuous discrete points between the first and second stroke key points to be selected as stroke key points, and connecting these points forms a stroke curve segment. This application emphasizes accelerating the selection process of discrete points, especially using pathfinding algorithms to handle the case of continuous discrete points. Existing methods automatically find the correspondence between existing discrete stroke data and existing discrete data. As mentioned above, such correspondence requires that the two fonts have similar shapes. Therefore, if you want to split characters that are not in the existing discrete stroke data, the existing solution cannot do so.
[0053] In other specific implementations, it is determined whether the first and second key stroke points are continuous on the character curve. If they are discontinuous, only the first and second key stroke points are connected to form a stroke curve segment; discrete points between them are no longer searched. In other words, if it is determined that the first and second key stroke points are discontinuous on the character curve, the A* pathfinding algorithm needs to be turned off. In this case, the first and second key stroke points form a stroke curve segment, and continuous discrete points between them are not considered key stroke points, thus avoiding the selection of incorrect key stroke points.
[0054] In one implementation, when the path between the first stroke key point and the second stroke key point is unique, automatic completion can be used to form a stroke curve segment by treating all consecutive discrete points between the first stroke key point and the second stroke key point as stroke key points.
[0055] Please see Figure 6 , Figure 6 This is a schematic diagram of the framework of an embodiment of the character stroke extraction device provided in this application. The character stroke extraction device 60 includes an acquisition module 61, a sampling module 62, and a generation module 63. The acquisition module 61 is used to acquire the glyph curve of the character to be processed; the sampling module 62 is used to perform discrete sampling on the glyph curve to obtain a discrete point set; the generation module 63 is used to select at least two stroke key points from the discrete point set, acquire a closed curve containing at least two stroke key points, and obtain the strokes of the character.
[0056] The generation module 63 is used to select at least two stroke key points from the discrete point set and obtain a closed curve containing at least two stroke key points. Specifically, it includes: selecting a first stroke key point and a second stroke key point from the discrete point set; searching for the shortest path from the first stroke key point to the second stroke key point to obtain a first stroke curve segment; and searching for the shortest path from the second stroke key point to the first stroke key point to obtain a second stroke curve segment, thus obtaining a stroke curve. The stroke curve is a closed curve formed by the first stroke curve segment and the second stroke curve segment.
[0057] The generation module 63 specifically includes the following steps for obtaining stroke curve segments: using the A* pathfinding algorithm to search for stroke curve segments between the first stroke key point and the second stroke key point.
[0058] The generation module 63 specifically includes the following steps for obtaining stroke curve segments: determining whether the first stroke key point and the second stroke key point are continuous on the character curve; in response to the first stroke key point and the second stroke key point being continuous on the character curve, using the A* pathfinding algorithm to search for continuous discrete points between the first stroke key point and the second stroke key point on the character curve, and using the continuous discrete points as stroke key points, connecting the stroke key points to form stroke curve segments.
[0059] The generation module 63 is used to take continuous discrete points as stroke key points and connect the stroke key points to form stroke curve segments. Specifically, it includes: determining whether the first stroke key point and the second stroke key point are continuous on the character curve; in response to the first stroke key point and the second stroke key point being discontinuous on the character curve, simply connecting the first stroke key point and the second stroke key point to form a stroke curve segment, without searching for discrete points between the first stroke key point and the second stroke key point.
[0060] Among them, the discrete points mentioned above are not uniformly distributed on the character-shaped curve.
[0061] Among them, the number of discrete points in the first region is greater than the number of discrete points in the second region, and the curve variation amplitude of the character curve in the first region is greater than the curve variation amplitude of the character curve in the second region.
[0062] The acquisition module 61 is used to acquire the glyph curve of the character to be processed, specifically including: acquiring the glyph key points of the character to be processed; and based on the glyph key points, acquiring the outline of the character to be processed using the quadratic Bézier curve equation to obtain the glyph curve of the character to be processed.
[0063] Please see Figure 7 , Figure 7This is a schematic diagram of a framework of an embodiment of the electronic device provided in this application. The electronic device 70 includes a memory 71 and a processor 72 coupled to each other. The memory 71 stores program instructions, and the processor 72 is used to execute the program instructions to implement the steps in any of the above-described character stroke extraction method embodiments. Specifically, the electronic device 70 may include, but is not limited to, desktop computers, laptops, servers, mobile phones, tablet computers, etc., and is not limited thereto.
[0064] Specifically, processor 72 controls itself and memory 71 to implement the steps in any of the above-described character stroke extraction method embodiments. Processor 72 can also be referred to as a CPU (Central Processing Unit). Processor 72 may be an integrated circuit chip with signal processing capabilities. Processor 72 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 72 can be implemented using integrated circuit chips.
[0065] Please see Figure 8 , Figure 8 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. The computer-readable storage medium 80 stores program instructions 81 that can be executed by a processor. The program instructions 81 are used to implement the steps in any of the above-described character stroke extraction method embodiments.
[0066] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0067] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0069] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0070] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0071] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0072] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method of extracting strokes of a character, characterized by, The method comprises: acquiring a character curve of a character to be processed; discretely sampling the character curve to obtain a discrete point set; selecting at least two stroke key points from the discrete point set, and acquiring a closed curve containing the at least two stroke key points to obtain a stroke of the character; wherein the selecting at least two stroke key points from the discrete point set and acquiring a closed curve containing the at least two stroke key points comprises: selecting a first stroke key point and a second stroke key point from the discrete point set; in response to the first stroke key point and the second stroke key point being continuous on the character curve, searching for a shortest path from the first stroke key point to the second stroke key point to obtain a first stroke curve segment, and searching for a shortest path from the second stroke key point to the first stroke key point to obtain a second stroke curve segment, to obtain a stroke curve; wherein the stroke curve is the closed curve formed by the first stroke curve segment and the second stroke curve segment.
2. The method of claim 1, wherein, The method comprises: searching for a stroke curve segment between the first stroke key point and the second stroke key point by using an A* pathfinding algorithm.
3. The method of claim 1, wherein, The method comprises: judging whether the first stroke key point and the second stroke key point are continuous on the character curve; in response to the first stroke key point and the second stroke key point being continuous on the character curve, searching for continuous discrete points between the first stroke key point and the second stroke key point on the character curve by using an A* pathfinding algorithm, and connecting the continuous discrete points to form the stroke curve segment.
4. The method of claim 3, wherein, The method comprises: judging whether the first stroke key point and the second stroke key point are continuous on the character curve; in response to the first stroke key point and the second stroke key point being discontinuous on the character curve, connecting only the first stroke key point and the second stroke key point to form the stroke curve segment without searching for discrete points between the first stroke key point and the second stroke key point.
5. The method of claim 1, wherein: the discrete points are non-uniformly distributed on the character curve.
6. The method of claim 5, wherein: the number of the discrete points in a first region is greater than the number of the discrete points in a second region, and the curve variation amplitude of the character curve in the first region is greater than the curve variation amplitude of the character curve in the second region.
7. The method of claim 1, wherein, The method comprises: acquiring a character key point of the character to be processed; based on the character key point, acquiring an outline of the character to be processed by using a quadratic Bezier curve equation to obtain a character curve of the character to be processed.
8. A character stroke extraction apparatus characterized by comprising: The device comprises: an acquisition module configured to acquire a character curve of a character to be processed; a sampling module configured to discretely sample the character curve to obtain a discrete point set; The generating module is configured to select at least two stroke key points from the discrete point set, obtain a closed curve containing at least the two stroke key points, and obtain a stroke of the character. The selecting at least two stroke key points from the discrete point set and obtaining a closed curve containing at least the two stroke key points include: selecting a first stroke key point and a second stroke key point from the discrete point set; in response to the first stroke key point and the second stroke key point being continuous on the glyph curve, searching for a shortest path from the first stroke key point to the second stroke key point to obtain a first stroke curve segment, searching for a shortest path from the second stroke key point to the first stroke key point to obtain a second stroke curve segment, and obtaining a stroke curve; wherein the stroke curve is the closed curve formed by the first stroke curve segment and the second stroke curve segment.
9. An electronic device, comprising: The memory and the processor are coupled to each other, the memory stores program instructions, and the processor is configured to execute the program instructions to implement the character stroke extraction method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The memory stores program instructions capable of being executed by the processor, and the program instructions are configured to implement the character stroke extraction method in any one of claims 1 to 7.