A method, device, equipment and medium for generating an elliptical seal
By drawing arc ellipse using the four-centric method and determining the position information of the target text, elliptical seal samples are generated, which solves the problem that affects the training of seal text recognition model in the prior art, and improves the accuracy of seal text recognition.
Patent Information
- Application Number
- CN202111294673.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-03
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2041-11-03
AI Technical Summary
In the prior art, if the invoice is directly determined as an elliptical seal sample, it will affect the training of the seal text recognition model, and thus affect the accuracy of seal text recognition.
By drawing an arc ellipse using the four-centric method based on the preset length of the major axis of the ellipse and the minor axis of the ellipse, the arc ellipse is determined based on the target number of target characters contained in the text information to be typed and the target angle distribution range, the first position information of each target text on the arc ellipse is determined, and the second position information on the target ellipse seal is determined, and the angle rotation is performed.
By generating elliptical seal samples, the accuracy of the seal text model to identify seal text is improved.
Smart Images

Figure CN114511614B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of optical character recognition (OCR) of seal images, and in particular to an elliptical seal generation method, device, equipment and medium. Background Art
[0002] In recent years, with the improvement of living standards and the increasing medical level, the demand for purchasing medical insurance has also increased. At the same time, more insurance claims have also appeared. During the insurance claims process, customers need to upload images of various invoices, and insurance companies review them based on the images uploaded by customers.
[0003] In the prior art, insurance companies generally use a pre-trained seal character recognition model to recognize the arc-shaped characters on the elliptical seal on the invoice. Therefore, before recognizing the characters on the elliptical seal based on the pre-trained seal character recognition model, a large number of elliptical seal samples are required to train the seal character recognition model. However, since there are many and confusing invoices, one invoice often contains a lot of information. If the invoice is directly determined as an elliptical seal sample, it will affect the training of the seal character recognition model, and further affect the accuracy of seal character recognition. Summary of the invention
[0004] The present invention provides an ellipse seal generation method, device, equipment and medium, which are used to solve the problem in the prior art that if an invoice is directly determined as an ellipse seal sample, it will affect the training of the seal character recognition model and further affect the accuracy of seal character recognition.
[0005] In a first aspect, the present invention provides a method for generating an elliptical seal, the method comprising:
[0006] According to the preset length of the major axis of the ellipse and the length of the minor axis of the ellipse, the arc ellipse is drawn using the four-center method;
[0007] Determine first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information;
[0008] For each target character, based on the first position information of the target character, determine the target center angle of the target character on the target arc on the arc ellipse, determine the target eccentric angle corresponding to the target center angle based on the pre-saved correspondence between the center angle and the eccentric angle, determine the second position information of the target character on the target ellipse seal based on the target eccentric angle and the pre-saved parametric equation of the ellipse, and perform angular rotation on the target character based on the second position information.
[0009] Further, the determining of the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information includes:
[0010] According to the target angle distribution range, the first center angle corresponding to the first target text at the preset first position on the first arc of the arc ellipse is determined, and based on the first center angle, the first angle between the first position information of the first target text on the arc ellipse and the first preset straight line of the first arc is determined, and based on the first angle and the pre-saved parametric equation corresponding to the first arc, the first position information of the first target text on the arc ellipse is determined.
[0011] Further, the determining of the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information includes:
[0012] The arc interval between each two adjacent target characters is determined according to the target angle distribution range corresponding to the text information and the target number of the target characters; the first position information of the second target character is determined according to the arc interval and the first center angle corresponding to the previous target character.
[0013] Further, the determining the arc interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters comprises:
[0014] Determine at least one arc on the arc ellipse corresponding to the target distribution range according to the target angle distribution range corresponding to the text information and the pre-saved correspondence between the distribution range and the arc;
[0015] Determining a target arc length of the text information on the arc ellipse according to a first sum of the arcs of the at least one arc;
[0016] The arc interval between every two adjacent target characters is determined according to a first quotient of the target arc length and the target number of the target characters.
[0017] Further, the determining, according to the target angle distribution range, a first center angle corresponding to the first target text at the preset first position on the first arc of the arc ellipse includes:
[0018] According to the target angle distribution range, determining a first angle corresponding to the target angle distribution range;
[0019] Determine a second quotient of the first angle and a preset first value, and determine a second sum of the second quotient and a preset second value, and determine a first central angle corresponding to the first target text at a preset first position on the first arc of the arc ellipse.
[0020] Further, the determining of the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information includes:
[0021] Determine the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters;
[0022] For each target character, the first position information of the target character is determined according to the angle interval and a first center angle corresponding to a previous target character adjacent to the target character.
[0023] Further, the determining the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters comprises:
[0024] The angle interval between each two adjacent target characters is determined according to a third quotient of the target angle distribution range corresponding to the text information and the target number of the target characters.
[0025] In a second aspect, the present invention further provides an elliptical seal generating device, the device comprising:
[0026] A drawing module, used for drawing an arc ellipse by using a four-center method according to a preset length of the major axis of the ellipse and the length of the minor axis of the ellipse;
[0027] A determination module is used to determine the first position information of each target text on the arc ellipse according to the target number of target texts contained in the text information to be typeset and the target angle distribution range corresponding to the text information; for each target text, determine the target center angle corresponding to the target text on the target arc on the arc ellipse according to the first position information of the target text, determine the target eccentric angle corresponding to the target center angle according to the pre-saved correspondence between the center angle and the eccentric angle, determine the second position information of the target text on the target ellipse seal according to the target eccentric angle and the pre-saved parametric equation of the ellipse, and perform angle rotation on the target text according to the second position information.
[0028] Furthermore, the determination module is specifically used to determine, based on the target angle distribution range, a first center angle corresponding to a first target text at a preset first position on the first arc of the arc ellipse, and, based on the first center angle, determine a first angle between first position information of the first target text on the arc ellipse and a first preset straight line of the first arc, and determine the first position information of the first target text on the arc ellipse based on the first angle and a pre-saved parametric equation corresponding to the first arc.
[0029] Furthermore, the determination module is specifically used to determine the arc interval between each two adjacent target characters based on the target angle distribution range corresponding to the text information and the target number of the target characters; and determine the first position information of the second target character based on the arc interval and the first center angle corresponding to the previous target character.
[0030] Furthermore, the determination module is specifically used to determine at least one arc on the arc ellipse corresponding to the target distribution range according to the target angle distribution range corresponding to the text information and the pre-saved correspondence between the distribution range and the arc; determine the target arc length of the text information on the arc ellipse according to the first sum of the arcs of the at least one arc; and determine the arc interval between each adjacent two target characters according to the first quotient of the target arc length and the target number of the target characters.
[0031] Furthermore, the determination module is specifically used to determine a first angle corresponding to the target angle distribution range based on the target angle distribution range; determine a second quotient of the first angle and a preset first numerical value, and determine a second sum of the second quotient and a preset second numerical value, and determine a first center angle corresponding to the first target text at a preset first position on the first arc of the arc ellipse.
[0032] Furthermore, the determination module is specifically used to determine the angle interval between each two adjacent target characters based on the target angle distribution range corresponding to the text information and the target number of the target characters; for each target character, the first position information of the target character is determined based on the angle interval and the first center angle corresponding to the previous target character adjacent to the target character.
[0033] Furthermore, the determination module is specifically configured to determine the angle interval between each two adjacent target characters according to a target angle distribution range corresponding to the text information and a third quotient of a target number of the target characters.
[0034] In a third aspect, the present invention further provides an electronic device, which comprises at least a processor and a memory, wherein the processor is configured to implement the steps of any of the above-mentioned elliptical seal generation methods when executing a computer program stored in the memory.
[0035] In a fourth aspect, the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-mentioned methods for generating an elliptical seal.
[0036] In the embodiment of the present invention, the four-center method is used to draw an arc ellipse according to the preset ellipse major axis length and the ellipse minor axis length; the first position information of each target character on the arc ellipse is determined according to the target number of target characters contained in the text information to be typeset and the target angle distribution range corresponding to the text information; for each target character, the target center angle corresponding to the target character on the target arc of the arc ellipse is determined according to the first position information of the target character, the target eccentric angle corresponding to the target center angle is determined according to the correspondence between the center angle and the eccentric angle saved in advance, the second position information of the target character on the target ellipse seal is determined according to the target eccentric angle and the pre-saved parametric equation of the ellipse, and the target character is angularly rotated according to the second position information. In the embodiment of the present invention, the second position information of each target character on the target ellipse seal can be determined based on the first position information corresponding to each target character on the arc ellipse drawn by the four-center method, and the target character is angularly rotated according to the second position information, so that an ellipse seal sample can be generated, thereby improving the accuracy of the seal character recognition by the seal character model. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of 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 labor.
[0038] Figure 1 A schematic diagram of a process of generating an elliptical seal provided by an embodiment of the present invention;
[0039] Figure 2 A display schematic diagram for determining arc intervals provided by an embodiment of the present invention;
[0040] Figure 3 A display schematic diagram of drawing an arc ellipse using a four-center method provided by an embodiment of the present invention;
[0041] Figure 4A display schematic diagram for determining a pre-stored correspondence between an eccentric angle and a center angle provided by an embodiment of the present invention;
[0042] Figure 5 A schematic diagram showing a target elliptical stamp provided by an embodiment of the present invention;
[0043] Figure 6 A schematic diagram of the structure of an elliptical seal generating device provided in some embodiments of the present invention;
[0044] Figure 7 A schematic diagram of the structure of an electronic device provided for some embodiments of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] In order to improve the accuracy of seal character recognition by a seal character model, an embodiment of the present invention provides an elliptical seal generation method, device, equipment and medium.
[0047] Embodiment 1:
[0048] Figure 1 A schematic diagram of a process of generating an elliptical seal provided by an embodiment of the present invention, the process comprising the following steps:
[0049] S101: Draw an arc ellipse using a four-center method according to a preset length of the major axis of the ellipse and a preset length of the minor axis of the ellipse.
[0050] The elliptical seal generation method provided by the embodiment of the present invention is applied to an electronic device, which may be a smart terminal, a PC, a server or other device.
[0051] In an embodiment of the present invention, in order to generate a target ellipse stamp and then use it as an ellipse stamp sample, an arc ellipse can be first drawn using the four-center method according to a preset ellipse major axis length and an ellipse minor axis length, wherein the preset ellipse major axis length and ellipse minor axis length are respectively the ellipse major axis and ellipse minor axis corresponding to the target ellipse stamp. There are eight common intersections between the arc ellipse drawn using the four-center method and the target ellipse corresponding to the target ellipse stamp, and for each two adjacent common intersections, the arc formed between the two common intersections on the arc ellipse is different from the arc formed between the two common intersections on the target ellipse corresponding to the target ellipse stamp, but is particularly close.
[0052] Specifically, the process of drawing an arc ellipse using the four-center method according to the preset major axis length and minor axis length of the ellipse is a prior art and will not be described in detail here.
[0053] S102: Determine first position information of each target character on the arc ellipse according to a target number of target characters included in the text information to be typeset and a target angle distribution range corresponding to the text information.
[0054] In an embodiment of the present invention, in order to determine the position information of the text to be typeset on the target elliptical seal, the first position information of the target text contained in the text information to be typeset on the arc ellipse can be determined first. Specifically, the first position information of each target text on the arc ellipse can be determined according to the target number of target texts contained in the text information to be typeset and the target angle distribution range corresponding to the text information, wherein the target text contained in the text information to be typeset can be the full name of a certain institution or organization, etc. Among them, the target angle distribution range of the text information can be a specific angle, such as 180°, 240°, etc. Generally, for the beauty of text typesetting, the more the number of target texts contained in the text information, the larger the corresponding target angle range. Specifically, the target angle range is set according to actual needs. Among them, the first position information can be coordinate information, and can also be angle information. In an embodiment of the present invention, the coordinate system is predetermined. Specifically, in the process of determining the coordinate system, the center of the arc ellipse is the coordinate origin, the straight line where the major axis of the arc ellipse is located is the x-axis of the coordinate system, and the straight line where the minor axis of the arc ellipse is located is the y-axis of the coordinate system.
[0055] S103: For each target character, determine the target center angle of the target character on the target arc on the arc ellipse according to the first position information of the target character, determine the target eccentric angle corresponding to the target center angle according to the pre-saved correspondence between the center angle and the eccentric angle, determine the second position information of the target character on the target ellipse seal according to the target eccentric angle and the pre-saved parametric equation of the ellipse, and perform angular rotation on the target character according to the second position information.
[0056] In order to determine the position information of each target character on the target elliptical stamp, that is, to determine the second position information, in the embodiment of the present invention, for each target character, according to the first position information of the target character on the arc ellipse, the target center angle of the target character on the target arc on the arc ellipse is determined. Specifically, according to Among them, α is the target center angle, y1 is the y-axis coordinate in the first position information, and x1 is the x-axis coordinate in the first position information. Among them, the target center angle of the target text on the target arc on the arc ellipse is the angle corresponding to the first position information of the target text on the arc ellipse, the origin of the coordinate system, and the positive direction of the x-axis. Since in the process of drawing the arc ellipse based on the four-center method, the arc ellipse is composed of four partial arcs of different circles drawn with different centers and different radii, the target arc of each target text corresponds to one of the four arcs. Specifically, the target arc of each target text is determined based on the center angle corresponding to the previous target text and the arc interval between each two adjacent target texts.
[0057] In order to determine the second position information of the target text on the target ellipse seal, the corresponding relationship between the center angle of the target arc corresponding to the target text on the arc ellipse and the eccentric angle of the target text on the arc ellipse is pre-saved, and the target eccentric angle corresponding to the target center angle is determined according to the pre-saved corresponding relationship between the center angle and the eccentric angle. Since the arc ellipse is very close to the target ellipse corresponding to the target ellipse seal, the target eccentric angle corresponding to the target ellipse of the target text on the arc ellipse can be determined as the target eccentric angle corresponding to the target ellipse of the target text on the target ellipse seal. And according to the target eccentric angle and the pre-saved parametric equation of the ellipse, the second position information of the target text on the target ellipse seal is determined, wherein, according to the target eccentric angle and the pre-saved parametric equation of the ellipse, the process of determining the second position information of the target text on the target ellipse seal is prior art and will not be repeated here.
[0058] After determining the second position information, the target text is rotated according to the second position information. Specifically, the target slope of the target text at the second position information can be determined according to the second position information and the pre-saved tangent parameter equation, and the target text is rotated along the direction of the target slope. The process of determining the target slope according to the second position information and the pre-saved tangent equation is a prior art and will not be described in detail here.
[0059] In the embodiment of the present invention, the second position information of each target character on the target elliptical seal can be determined based on the first position information corresponding to each target character on the arc ellipse drawn by the four-center method, and the target character can be rotated according to the second position information, thereby generating an elliptical seal sample, thereby improving the accuracy of the seal character model in recognizing the seal character.
[0060] Embodiment 2:
[0061] To determine the first position information of each target character on the arc ellipse, based on the above embodiments, in the embodiments of the present invention, determining the first position information of each target character on the arc ellipse according to the target number of the target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information includes:
[0062] According to the target angle distribution range, determine the first central angle corresponding to the first target character at the preset first position on the first arc of the arc ellipse, and according to the first central angle, determine the first angle between the first position information of the first target character on the arc ellipse and the first preset line of the first arc. According to the first angle and the parametric equation corresponding to the first arc saved in advance, determine the first position information of the first target character on the arc ellipse.
[0063] In the embodiments of the present invention, since the target angle distribution range is known and the distribution rule of the target characters is also determined. For example, the target characters are typeset in turn with the y-axis of the coordinate system as the axis of symmetry. Therefore, according to the target angle distribution range, the first central angle corresponding to the first target character at the preset first position on the first arc of the arc ellipse can be determined. Wherein, the preset first position is the position information of the rightmost target character on the ellipse on the arc ellipse, or the position information of the leftmost target character on the ellipse on the arc ellipse. The rightmost target character or the leftmost target character is the first target character. Generally, the rightmost character is the first character among the target characters included in the text information to be typeset, and the leftmost character is the last character among the target characters included in the text information to be typeset.
[0064] If the text information is "Literature Club", then the first target character is "文" or "团", and the preset first position is the position information of "文" on the arc ellipse, or the position information of "团" on the arc ellipse. Wherein, the preset first position is pre-configured. Specifically, the preset first position is related to the target angle distribution range. If the target angle distribution range is determined, then the preset first position is also determined. Wherein, the first central angle corresponding to the first target character on the first arc of the arc ellipse is the angle formed by the target character, the coordinate origin, and the positive direction of the x-axis of the coordinate system.
[0065] In order to determine the first position information of the first target text on the arc ellipse, in an embodiment of the present invention, after determining the first center angle of the circle, the first angle between the first position information of the first target text on the arc ellipse and the first preset straight line of the first arc of the first target text on the arc ellipse is determined according to the first center angle of the circle, wherein the first preset straight line can be a line connecting the intersection of the first arc and other adjacent arcs and the center corresponding to the first arc, and the first preset straight line can also be a line connecting the midpoint of the first arc and the center of the ellipse.
[0066] Since the first position information of the first target text on the arc ellipse is located on the first arc, therefore, in an embodiment of the present invention, in order to determine the first position information of the first target text on the arc ellipse, after determining the first angle between the first position information of the first target text on the arc ellipse and the first preset straight line of the first arc, the first position information of the first target text on the arc ellipse is determined according to the first angle and a pre-saved parametric equation corresponding to the first arc. Specifically, the first position information of the first target text on the arc ellipse is determined according to the first angle, the radius of the first arc and the parametric equation of the circle corresponding to the first arc.
[0067] In order to determine the first position information of each target character on the arc ellipse, based on the above embodiments, in an embodiment of the present invention, the first position information of each target character on the arc ellipse is determined according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information, including:
[0068] The arc interval between each two adjacent target characters is determined according to the target angle distribution range corresponding to the text information and the target number of the target characters; the first position information of the second target character is determined according to the arc interval and the first center angle corresponding to the previous target character.
[0069] In the embodiment of the present invention, each target text can be typeset with equal arc length, that is, each target text can be typeset in the clockwise direction in turn on the target elliptical seal with equal arc length. Specifically, first determine the arc interval between each two adjacent target texts according to the target angle distribution range corresponding to the text information and the target number of target texts, and determine the first position information of the second target text according to the arc interval and the first center angle corresponding to the previous target text. Specifically, since the two adjacent target texts may be on different target arcs or on the same target arc, in order to determine the position information of each target text on the arc ellipse, first determine whether each two adjacent target texts are on the same target arc. Since after the first position information of the first target text is determined, the first position information of other target texts after the first target text can be determined in turn, and the principle of determining the first position information of each other target text is the same, for the convenience of description, the target text whose first position information is currently to be determined among the other target texts is called the second target text, and the target text adjacent to the second target text and whose first position information has been determined is called the previous target text.
[0070] Specifically, first determine the angle between the previous target character and the preset second straight line of the target arc corresponding to the previous target character according to the first center angle of the circle corresponding to the previous target character, and determine the first arc between the preset second straight line of the target arc corresponding to the previous target character and the first position information where the previous target character is located according to the angle and the first radius of the target arc corresponding to the previous target character, and specifically, determine the first arc as the product of the angle and the first radius. The preset second straight line of the target arc corresponding to the previous target character is a line connecting the last point of the target arc corresponding to the previous target character in a clockwise direction and the center of the target arc corresponding to the previous target character, that is, the preset second straight line of the target arc corresponding to the previous target character is a line connecting the intersection of the arcs adjacent to the target arc corresponding to the previous target character in a clockwise direction and the center of the target arc corresponding to the previous target character.
[0071] After determining the first arc, in order to determine whether the previous target character and the second target character are on the same target arc, determine whether the first arc is greater than the arc interval between each two adjacent target characters. If so, it means that the second target character adjacent to the first target character and separated by the arc interval is on the same target arc as the previous target character, then the first angle interval between the previous target character and the second target character can be determined according to the arc interval and the third quotient of the first radius of the target arc corresponding to the previous target character, and the first position information of the second target character can be determined according to the first angle interval, the first radius of the target arc where the previous target character (second target character) is located, and the parameter equation of the target arc corresponding to the previous target character (second target character). Specifically, the process of determining the first position information of the second target character according to the first angle interval, the first radius of the target arc where the previous target character (second target character) is located, and the parameter equation of the target arc corresponding to the previous target character (second target character) is a prior art and will not be described in detail here.
[0072] If the first arc is not greater than the arc interval, it means that the second target text and the previous target text are not located on the same target arc. For the convenience of description, the arc where the previous target text is located is called the first target arc, and the arc where the second target text is located is called the second target arc. In order to determine the first position information of the second target text, in an embodiment of the present invention, the difference between the arc interval between each two adjacent target texts and the first arc is determined, and the fourth quotient of the difference and the second radius corresponding to the second target arc is determined. The fourth quotient is determined as the second angle interval of the second target text and the preset third straight line of the second target arc, wherein the preset third straight line is the line connecting the first point of the second target arc in the clockwise direction and the center of the circle corresponding to the second target arc. In order to determine the first position information of the second target text, the first position information of the second target text can be determined according to the second angle interval, the second radius corresponding to the second target arc, and the parameter equation corresponding to the second target arc. The process of determining the first position information of the second target text according to the second angle interval, the second radius corresponding to the second target arc and the parameter equation corresponding to the second arc is prior art and will not be elaborated here.
[0073] Embodiment 3:
[0074] In order to determine the arc interval between each two adjacent target characters, based on the above embodiments, in an embodiment of the present invention, the arc interval between each two adjacent target characters is determined according to the target angle distribution range corresponding to the text information and the target number of the target characters, including:
[0075] Determine at least one arc on the arc ellipse corresponding to the target distribution range according to the target angle distribution range corresponding to the text information and the pre-saved correspondence between the distribution range and the arc;
[0076] Determining a target arc length of the text information on the arc ellipse according to a first sum of the arcs of the at least one arc;
[0077] The arc interval between every two adjacent target characters is determined according to a first quotient of the target arc length and the target number of the target characters.
[0078] When determining the arc length on the ellipse corresponding to a certain angle, calculus is generally used for calculation, but in the embodiment of the present invention, the arc ellipse is drawn based on the four-center method, that is, the ellipse is composed of four known arcs. Therefore, in order to reduce the workload of the electronic device, the electronic device can determine the target arc length corresponding to a certain target angle distribution range based on the four known arcs. Specifically, the electronic device pre-stores the correspondence between the distribution range and the arc, and can determine at least one arc on the arc ellipse corresponding to the target distribution range based on the target angle distribution range corresponding to the text information and the pre-stored correspondence between the distribution range and the arc, and determine the target arc length of the text information on the arc ellipse based on the first sum of the radians of the at least one arc. The first sum of the radians of the at least one circular arc is obtained by adding the radians of the at least one circular arc. For example, the first sum of radians A and radians B is equal to radians A+radians B. In order to determine the radian interval between each two adjacent target characters, in an embodiment of the present invention, the first quotient of the target arc length and the target number of the target characters is determined. The first quotient is the radian interval between each two adjacent target characters. The first quotient of the target arc length and the target number of the target characters is obtained by dividing the target arc length by the target number of the target characters. That is, the first quotient is equal to the target arc length divided by the target number of the target characters.
[0079] Figure 2 A display schematic diagram of determining arc intervals provided by an embodiment of the present invention is now directed to Figure 2 Provide explanation.
[0080] Point G is the symmetric point of point H about line AB. If the target angle distribution range corresponding to the text information to be typeset is ∠ROS, and if the target text is typeset with CD as the axis of symmetry, the ellipse arc length RS is equal to twice the ellipse arc length RC. When the text starting point R is on arc DK, the target circular arc RC corresponding to the target angle distribution range is approximately equal to the sum of the lengths of the arc RK on circle O4, the arc KH on circle O1, and the arc HC on circle O2. When point R is on arc HK, the target circular arc RC corresponding to the target angle distribution range is approximately equal to the sum of the lengths of the arc RH on circle O1 and the arc HC on circle O2. When point R is on arc HC, the target circular arc RC corresponding to the target angle distribution range is approximately equal to the length of the arc HC on circle O2.
[0081] After the target arc is determined, the arc interval between each two adjacent target characters is determined according to the target arc and a first quotient of the target number of target characters.
[0082] Embodiment 4:
[0083] In order to determine the first center angle corresponding to the first target text at the preset first position on the first arc of the arc ellipse, based on the above embodiments, in an embodiment of the present invention, determining the first center angle corresponding to the first target text at the preset first position on the first arc of the arc ellipse according to the target angle distribution range includes:
[0084] According to the target angle distribution range, determining a first angle corresponding to the target angle distribution range;
[0085] Determine a second quotient of the first angle and a preset first value, and determine a second sum of the second quotient and a preset second value, and determine a first central angle corresponding to the first target text at a preset first position on the first arc of the arc ellipse.
[0086] Since the target text contained in the text information is arranged in sequence with the minor axis of the ellipse as the axis of symmetry, the first angle corresponding to the target angle distribution range can be determined first according to the target angle distribution range, and then the second quotient of the first angle and the preset first value can be determined, wherein the preset first value is 2, and the second quotient is the angle corresponding to half of the target angle distribution range, that is, the angle between the line connecting the rightmost target text and the center of the ellipse and the positive semi-axis of the y-axis. After determining the second quotient, the second sum of the second quotient and the preset second value is determined, wherein the preset second value is 90 degrees, and the second sum is the first center angle corresponding to the first target text at the preset first position on the first arc of the arc ellipse, that is, the first center angle corresponding to the rightmost target text on the first arc of the arc ellipse.
[0087] Figure 3 A display diagram of a circular arc ellipse drawn by a four-center method is provided in an embodiment of the present invention. Figure 3 Provide explanation.
[0088] If the major axis of the preset ellipse is AB, the minor axis is CD, and O is the center point of the ellipse. First connect the line segment AC, draw a circle with O as the center and the length of OA as the radius, intersecting the CD line at point E, then draw a circle with C as the center and the length of CE as the radius, intersecting the AC line at point F, then draw a circle with A as the center and the length of AF as the radius, draw a circle with F as the center and the length of AF as the radius, connect the intersection points of the two arcs to draw the perpendicular bisector of AF, intersecting AF at G, intersecting the AB axis at point O1, intersecting the CD axis at point O2, draw a circle with O as the center and the length of OO1 as the radius, intersecting OB at point O3; draw a circle with O as the center and the length of OO2 as the radius, intersecting OB at point O4.
[0089] After determining O1, O2, O3 and O4, draw a circle with O1 as the center and O1A as the length as the radius, draw a circle with O2 as the center and O2C as the length as the radius, draw a circle with O3 as the center and O3B as the length as the radius, draw a circle with O4 as the center and O4D as the length as the radius. Then connect the four arcs between the four points ACBD to form an approximate ellipse, that is, an arc ellipse.
[0090] After determining the arcs corresponding to circles O1, O2, O3, and O4, calculate the center and radius of each circle. First, calculate the distance from point A to line O1O2. in Since line AC is perpendicular to line O1O2, Therefore, the length of the radius O1A of circle O1 is The radius of circle O1 is AO-AO1.
[0091] Similarly, the radii and centers of the circles O2, O3, and O4 can also be determined, which will not be elaborated here.
[0092] Figure 4 A display schematic diagram for determining a pre-stored correspondence between an eccentric angle and a center angle is provided in an embodiment of the present invention. Figure 4 Provide explanation.
[0093] A circle with O as the center and OA as the radius is called a large circle A; a circle with O as the center and OC as the radius is called a small circle C; an ellipse with O as the center point, AB as the major axis, and CD as the minor axis is called an ellipse O. Assume that there is an arbitrary point P on the large circle A, and PN is perpendicular to OB at point N through point P, intersecting the ellipse at point M; connect OP and intersect the small circle C at point Q. ∠PON is called the eccentric angle of the ellipse. According to the parametric equation of the ellipse, the coordinates of point M can be expressed as The slope of the tangent line through point M is Given point P, therefore, the corresponding relationship between the eccentric angle and the central angle is Among them, CD is the preset minor axis length of the ellipse, and AB is the preset major axis length of the ellipse.
[0094] for example, Corresponding eccentric angle According to the parametric equation of the ellipse, the coordinates of R are The length of arc RA corresponding to ∠A01R is The length of arc AH is The length of arc HC is Assuming that the target number of target characters to be typeset is N, the arc interval between each two adjacent target characters is
[0095] Figure 5 A display schematic diagram of a target elliptical seal provided by an embodiment of the present invention is now directed to Figure 5 Provide explanation.
[0096] If the text information is "Hubei Wuhan Union Hospital", then "Hu", "Bei", "Wu", "Han", "City", "Union", "He", "Medical", and "Hospital" are arranged in sequence with the minor axis of the ellipse as the symmetry axis, and the arc interval between each two adjacent target characters is the same.
[0097] Embodiment 5:
[0098] In order to determine the first position information of each target character on the arc ellipse, based on the above embodiments, in an embodiment of the present invention, the first position information of each target character on the arc ellipse is determined according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information, including:
[0099] Determine the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters;
[0100] For each target character, the first position information of the target character is determined according to the angle interval and a first center angle corresponding to a previous target character adjacent to the target character.
[0101] In the embodiment of the present invention, in addition to typeset each target text at equal arcs, each target text can also be typeset at equal angles, that is, each target text can be typeset in a clockwise direction on the target elliptical stamp at equal angles. Specifically, first, according to the target angle distribution range corresponding to the text information and the target number of target texts, the angle interval between each two adjacent target texts is determined, and then for each target text, according to the angle interval and the first center angle corresponding to the previous target text adjacent to the target text, the first position information of the target text is determined.
[0102] Specifically, since the two adjacent target characters may be on different target arcs or on the same target arc, in order to determine the position information of each target character on the arc ellipse, it is first determined whether every two adjacent target characters are on the same target arc. For the sake of ease of description, the target character whose first position information is currently determined is called the third target character, and the previous target character adjacent to the target character whose first position information is currently determined is called the fourth target character.
[0103] Specifically, first determine the angle between the fourth target character and the preset third straight line of the target arc corresponding to the fourth target character based on the first center angle corresponding to the fourth target character, wherein the preset third straight line of the target arc corresponding to the fourth target character is a line connecting the last point of the target arc corresponding to the fourth target character and the center of the target arc corresponding to the fourth target character in a clockwise direction, that is, the preset third straight line of the target arc corresponding to the fourth target character is a line connecting the intersection of arcs adjacent to the target arc corresponding to the fourth target character in a clockwise direction and the center of the target arc corresponding to the fourth target character.
[0104] In order to determine whether the fourth target character and the third target character are on the same target arc, after determining the angle between the fourth target character and the preset third straight line of the target arc corresponding to the fourth target character, determine whether the angle is greater than the angle interval between each adjacent target characters. If so, it means that the third target character and the fourth target character are on the same target arc, then according to the angle interval between each adjacent target characters, the first radius of the target arc where the third target character (fourth target character) is located, and the parameter equation of the target arc corresponding to the third target character (fourth target character), the first position information of the third target character is determined. Specifically, according to the angle interval between each adjacent target characters, the first radius of the target arc where the third target character (fourth target character) is located, and the parameter equation of the target arc corresponding to the third target character (fourth target character), the process of determining the first position information of the third target character is prior art and will not be described in detail here.
[0105] If the angle is not greater than the determined angular interval between each two adjacent target characters, it means that the third target character and the fourth target character are not located on the same target arc. For the convenience of description, the arc where the third target character is located is called the third target arc, the arc where the fourth target character is located is called the fourth target arc, and the angle between the fourth target character and the preset third straight line of the target arc corresponding to the fourth target character is called the target angle. In order to determine the first position information of the third target character, in an embodiment of the present invention, the difference between the arc interval between each two adjacent target characters and the target angle is determined, and the difference is taken as the angular interval between the third target character and the preset third straight line of the fourth target arc, wherein the preset third straight line is a line connecting the first point of the third target arc in a clockwise direction and the center of the circle corresponding to the third target arc. In order to determine the first position information of the third target character, the first position information of the third target character can be determined according to the angular interval between the third target character and the preset third straight line of the fourth target arc, the third radius corresponding to the third target arc, and the parametric equation corresponding to the third target arc. Among them, the process of determining the first position information of the third target text based on the angular interval of the third target text and the preset third straight line of the fourth target arc, the third radius corresponding to the third target arc and the parametric equation corresponding to the third target arc is the existing technology and will not be elaborated here.
[0106] Embodiment 6:
[0107] In order to determine the angle interval between each two adjacent target characters, based on the above embodiments, in an embodiment of the present invention, the determining the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters includes:
[0108] The angle interval between each two adjacent target characters is determined according to a third quotient of a target angle distribution range corresponding to the text information and a target number of the target characters.
[0109] In the embodiment of the present invention, in order to determine the angular interval between each two adjacent target characters, the third quotient of the target angular distribution range corresponding to the text information and the target number of target characters can be determined first, and then the third quotient is determined as the angular interval between each two adjacent target characters.
[0110] For example, if the target angle range of the text information is 240 degrees and the number of targets is 6, then the angle interval between every two adjacent target characters is determined to be 40 degrees.
[0111] Embodiment 7:
[0112] Figure 6 A schematic diagram of the structure of an elliptical seal generating device provided in some embodiments of the present invention, the device comprising:
[0113] A drawing module 601 is used to draw an arc ellipse using a four-center method according to a preset ellipse major axis length and an ellipse minor axis length;
[0114] Determination module 602 is used to determine the first position information of each target text on the arc ellipse according to the target number of target texts contained in the text information to be typeset and the target angle distribution range corresponding to the text information; for each target text, determine the target center angle corresponding to the target text on the target arc on the arc ellipse according to the first position information of the target text, determine the target eccentric angle corresponding to the target center angle according to the pre-saved correspondence between the center angle and the eccentric angle, determine the second position information of the target text on the target ellipse seal according to the target eccentric angle and the pre-saved parametric equation of the ellipse, and perform angular rotation on the target text according to the second position information.
[0115] In a possible implementation, the determination module 602 is specifically used to determine, based on the target angle distribution range, a first center angle corresponding to a first target text at a preset first position on the first arc of the arc ellipse, and, based on the first center angle, determine a first angle between first position information of the first target text on the arc ellipse and a first preset straight line of the first arc, and determine the first position information of the first target text on the arc ellipse based on the first angle and a pre-saved parametric equation corresponding to the first arc.
[0116] In a possible implementation, the determination module 602 is specifically used to determine the arc interval between each two adjacent target characters based on the target angle distribution range corresponding to the text information and the target number of the target characters; and determine the first position information of the second target character based on the arc interval and the first center angle corresponding to the previous target character.
[0117] In a possible implementation, the determination module 602 is specifically used to determine at least one arc on the arc ellipse corresponding to the target distribution range according to the target angular distribution range corresponding to the text information and a pre-saved correspondence between the distribution range and the arc; determine the target arc length of the text information on the arc ellipse according to a first sum of the arcs of the at least one arc; and determine the arc interval between each two adjacent target characters according to a first quotient of the target arc length and the target number of the target characters.
[0118] In a possible implementation, the determination module 602 is specifically used to determine a first angle corresponding to the target angle distribution range based on the target angle distribution range; determine a second quotient of the first angle and a preset first numerical value, and determine a second sum of the second quotient and a preset second numerical value, and determine a first center angle corresponding to the first target text at a preset first position on the first arc of the arc ellipse.
[0119] In a possible implementation, the determination module 602 is specifically used to determine the angle interval between each two adjacent target characters based on the target angle distribution range corresponding to the text information and the target number of the target characters; for each target character, the first position information of the target character is determined based on the angle interval and the first center angle corresponding to the previous target character adjacent to the target character.
[0120] In a possible implementation, the determination module 602 is specifically configured to determine the angle interval between each two adjacent target characters according to a third quotient of a target angle distribution range corresponding to the text information and a target number of the target characters.
[0121] Embodiment 8:
[0122] Based on the above embodiments, some embodiments of the present invention further provide an electronic device, such as Figure 7 As shown, it includes: a processor 701 , a communication interface 702 , a memory 703 and a communication bus 704 , wherein the processor 701 , the communication interface 702 , and the memory 703 communicate with each other via the communication bus 704 .
[0123] The memory 703 stores a computer program. When the program is executed by the processor 701, the processor 701 performs the following steps:
[0124] According to the preset length of the major axis of the ellipse and the length of the minor axis of the ellipse, the arc ellipse is drawn using the four-center method;
[0125] Determine first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information;
[0126] For each target character, based on the first position information of the target character, determine the target center angle of the target character on the target arc on the arc ellipse, determine the target eccentric angle corresponding to the target center angle based on the pre-saved correspondence between the center angle and the eccentric angle, determine the second position information of the target character on the target ellipse seal based on the target eccentric angle and the pre-saved parametric equation of the ellipse, and perform angular rotation on the target character based on the second position information.
[0127] Furthermore, the processor 701 is also used to determine a first center angle corresponding to a first target text at a preset first position on the first arc of the arc ellipse based on the target angle distribution range, and determine a first angle between first position information of the first target text on the arc ellipse and a first preset straight line of the first arc based on the first center angle, and determine the first position information of the first target text on the arc ellipse based on the first angle and a pre-saved parametric equation corresponding to the first arc.
[0128] Furthermore, the processor 701 is also used to determine the arc interval between each two adjacent target characters based on the target angle distribution range corresponding to the text information and the target number of the target characters; and determine the first position information of the second target character based on the arc interval and the first center angle corresponding to the previous target character.
[0129] Furthermore, the processor 701 is also used to determine at least one arc on the arc ellipse corresponding to the target distribution range based on the target angle distribution range corresponding to the text information and the pre-saved correspondence between the distribution range and the arc; determine the target arc length of the text information on the arc ellipse based on the first sum of the arcs of the at least one arc; and determine the arc interval between each adjacent two target texts based on the first quotient of the target arc length and the target number of the target texts.
[0130] Furthermore, the processor 701 is also used to determine a first angle corresponding to the target angle distribution range based on the target angle distribution range; determine a second quotient of the first angle and a preset first numerical value, and determine a second sum of the second quotient and a preset second numerical value, and determine a first center angle corresponding to the first target text at a preset first position on the first arc of the arc ellipse.
[0131] Furthermore, the processor 701 is also used to determine the angle interval between each two adjacent target characters based on the target angle distribution range corresponding to the text information and the target number of the target characters; for each target character, the first position information of the target character is determined based on the angle interval and the first center angle corresponding to the previous target character adjacent to the target character.
[0132] Furthermore, the processor 701 is further configured to determine an angle interval between every two adjacent target characters according to a third quotient of a target angle distribution range corresponding to the text information and a target number of the target characters.
[0133] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0134] The communication interface 702 is used for communication between the electronic device and other devices.
[0135] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0136] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processing processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0137] Embodiment 9:
[0138] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:
[0139] The memory stores a computer program, and when the program is executed by the processor, the processor performs the following steps:
[0140] According to the preset length of the major axis of the ellipse and the length of the minor axis of the ellipse, the arc ellipse is drawn using the four-center method;
[0141] Determine first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information;
[0142] For each target character, based on the first position information of the target character, determine the target center angle of the target character on the target arc on the arc ellipse, determine the target eccentric angle corresponding to the target center angle based on the pre-saved correspondence between the center angle and the eccentric angle, determine the second position information of the target character on the target ellipse seal based on the target eccentric angle and the pre-saved parametric equation of the ellipse, and perform angular rotation on the target character based on the second position information.
[0143] Further, the determining of the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information includes:
[0144] According to the target angle distribution range, the first center angle corresponding to the first target text at the preset first position on the first arc of the arc ellipse is determined, and based on the first center angle, the first angle between the first position information of the first target text on the arc ellipse and the first preset straight line of the first arc is determined, and based on the first angle and the pre-saved parametric equation corresponding to the first arc, the first position information of the first target text on the arc ellipse is determined.
[0145] Further, the determining of the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information includes:
[0146] The arc interval between each two adjacent target characters is determined according to the target angle distribution range corresponding to the text information and the target number of the target characters; the first position information of the second target character is determined according to the arc interval and the first center angle corresponding to the previous target character.
[0147] Further, the determining the arc interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters comprises:
[0148] Determine at least one arc on the arc ellipse corresponding to the target distribution range according to the target angle distribution range corresponding to the text information and the pre-saved correspondence between the distribution range and the arc;
[0149] Determining a target arc length of the text information on the arc ellipse according to a first sum of the arcs of the at least one arc;
[0150] The arc interval between every two adjacent target characters is determined according to a first quotient of the target arc length and the target number of the target characters.
[0151] Further, the determining, according to the target angle distribution range, a first center angle corresponding to the first target text at the preset first position on the first arc of the arc ellipse includes:
[0152] According to the target angle distribution range, determining a first angle corresponding to the target angle distribution range;
[0153] Determine a second quotient of the first angle and a preset first value, and determine a second sum of the second quotient and a preset second value, and determine a first central angle corresponding to the first target text at a preset first position on the first arc of the arc ellipse.
[0154] Further, the determining of the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information includes:
[0155] Determine the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters;
[0156] For each target character, the first position information of the target character is determined according to the angle interval and a first center angle corresponding to a previous target character adjacent to the target character.
[0157] Further, the determining the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters comprises:
[0158] The angle interval between each two adjacent target characters is determined according to a third quotient of the target angle distribution range corresponding to the text information and the target number of the target characters.
[0159] In the embodiment of the present invention, the second position information of each target character on the target elliptical seal can be determined based on the first position information corresponding to each target character on the arc ellipse drawn by the four-center method, and the target character can be rotated according to the second position information, thereby generating an elliptical seal sample, thereby improving the accuracy of the seal character model in recognizing the seal character.
[0160] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0161] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0164] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for generating an elliptical seal, characterized in that: The method comprises: According to the preset length of the major axis of the ellipse and the length of the minor axis of the ellipse, the arc ellipse is drawn using the four-center method; Determine first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information; For each target character, according to the first position information of the target character, a target center angle corresponding to the target character on the target arc on the arc ellipse is determined, according to the pre-stored correspondence between the center angle and the eccentric angle, a target eccentric angle corresponding to the target center angle is determined, according to the target eccentric angle and a pre-stored parametric equation of the ellipse, a second position information of the target character on the target ellipse seal is determined, and the target character is angularly rotated according to the second position information; The step of determining the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information comprises: Determine, according to the target angle distribution range, a first center angle corresponding to a first target character at a preset first position on a first arc of the arc ellipse, and determine, according to the first center angle, a first angle between first position information of the first target character on the arc ellipse and a first preset straight line of the first arc, and determine, according to the first angle and a pre-stored parametric equation corresponding to the first arc, first position information of the first target character on the arc ellipse; The step of determining the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information comprises: Determine the arc interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters; determine the first position information of the second target character according to the arc interval and the first center angle corresponding to the previous target character; The step of determining the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information comprises: Determine the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters; For each target character, the first position information of the target character is determined according to the angle interval and a first center angle corresponding to a previous target character adjacent to the target character.
2. The method according to claim 1, characterized in that: The step of determining the arc interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters comprises: Determine at least one arc on the arc ellipse corresponding to the target distribution range according to the target angle distribution range corresponding to the text information and the pre-saved correspondence between the distribution range and the arc; Determining a target arc length of the text information on the arc ellipse according to a first sum of the arcs of the at least one arc; The arc interval between every two adjacent target characters is determined according to a first quotient of the target arc length and the target number of the target characters.
3. The method according to claim 1, characterized in that Determining, according to the target angle distribution range, a first center angle corresponding to a first target text at a preset first position on a first arc of the arc ellipse comprises: According to the target angle distribution range, determining a first angle corresponding to the target angle distribution range; Determine a second quotient of the first angle and a preset first value, and determine a second sum of the second quotient and a preset second value, and determine a first central angle corresponding to the first target text at a preset first position on the first arc of the arc ellipse.
4. The method according to claim 1, characterized in that: The step of determining the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters comprises: The angle interval between each two adjacent target characters is determined according to a third quotient of a target angle distribution range corresponding to the text information and a target number of the target characters.
5. An elliptical seal generating device, characterized in that: The device comprises: A drawing module, used for drawing an arc ellipse by using a four-center method according to a preset length of the major axis of the ellipse and the length of the minor axis of the ellipse; A determination module is used to determine the first position information of each target character on the arc ellipse according to the target number of target characters included in the text information to be typeset and the target angle distribution range corresponding to the text information; for each target character, determine the target center angle corresponding to the target character on the target arc on the arc ellipse according to the first position information of the target character, determine the target eccentric angle corresponding to the target center angle according to the pre-stored correspondence between the center angle and the eccentric angle, determine the second position information of the target character on the target ellipse seal according to the target eccentric angle and the pre-stored parametric equation of the ellipse, and perform angle rotation on the target character according to the second position information; The determination module is specifically used to determine, according to the target angle distribution range, a first center angle corresponding to a first target text at a preset first position on a first arc of the arc ellipse, and determine, according to the first center angle, a first angle between first position information of the first target text on the arc ellipse and a first preset straight line of the first arc, and determine, according to the first angle and a pre-stored parametric equation corresponding to the first arc, first position information of the first target text on the arc ellipse; The determination module is specifically configured to determine the arc interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters; and determine the first position information of the second target character according to the arc interval and the first center angle corresponding to the previous target character; The determination module is specifically used to determine the angle interval between each two adjacent target characters according to the target angle distribution range corresponding to the text information and the target number of the target characters; for each target character, the first position information of the target character is determined according to the angle interval and the first center angle corresponding to the previous target character adjacent to the target character.
6. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to implement the steps of the elliptical seal generation method described in any one of claims 1 to 4 when executing the computer program stored in the memory.
7. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the elliptical seal generation method described in any one of claims 1 to 4.
Citation Information
Patent Citations
Circular seal identification method and device
CN109657666A
Method and device for recognizing mixed typesetting characters, chip circuit and computer readable storage medium
CN111062365A