CN111523531B - Word processing method, word processing device, electronic equipment and computer readable storage medium - Google Patents

Word processing method, word processing device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN111523531B
CN111523531B CN202010288580.4A CN202010288580A CN111523531B CN 111523531 B CN111523531 B CN 111523531B CN 202010288580 A CN202010288580 A CN 202010288580A CN 111523531 B CN111523531 B CN 111523531B
Authority
CN
China
Prior art keywords
target
point
contour
line
points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010288580.4A
Other languages
Chinese (zh)
Other versions
CN111523531A (en
Inventor
韩忠涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202010288580.4A priority Critical patent/CN111523531B/en
Publication of CN111523531A publication Critical patent/CN111523531A/en
Application granted granted Critical
Publication of CN111523531B publication Critical patent/CN111523531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the invention provides a word processing method, a word processing device, electronic equipment and a computer readable storage medium, wherein the word processing method comprises the following steps: acquiring contour lines and a plurality of contour points of characters to be processed; determining a normal corresponding to each contour point based on the contour line; according to a target bordering value, a first target point is respectively determined on each normal, wherein the minimum value of the distance between the first target point and the contour line is equal to the target bordering value; and sequentially connecting all points in a target point set to form a target boundary line of the character to be processed, wherein the target point set comprises the first target point, and all points in the target point set are respectively positioned outside or inside the contour line. The word processing method, the word processing device, the electronic equipment and the computer readable storage medium provided by the embodiment of the invention can solve the problem that the conventional word adding effect is poor.

Description

Word processing method, word processing device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of word processing, and in particular, to a word processing method, a word processing device, an electronic device, and a computer readable storage medium.
Background
In the prior art, when the text is subjected to the edge adding process, the text is generally translated by a certain pixel along the upper direction, the lower direction, the left direction and the right direction respectively so as to determine the edge adding boundary line of the text, and then the edge adding of the text is completed by rendering between the boundary line and the contour line of the text. However, when the font curve is complex, there is a large difference between the shape of the boundary line determined in this way and the shape of the contour line, which results in a problem of poor bordering effect.
Disclosure of Invention
The embodiment of the invention aims to provide a word processing method, a word processing device, electronic equipment and a computer readable storage medium, so as to solve the problem that the conventional word edge adding effect is poor. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a word processing method, including:
acquiring contour lines and a plurality of contour points of characters to be processed;
determining a normal corresponding to each contour point based on the contour line;
according to a target bordering value, a first target point is respectively determined on each normal, wherein the minimum value of the distance between the first target point and the contour line is equal to the target bordering value;
and sequentially connecting all points in a target point set to form a target boundary line of the character to be processed, wherein the target point set comprises the first target point, and all points in the target point set are respectively positioned outside or inside the contour line.
In a second aspect of the present invention, there is also provided a word processing apparatus, including:
the acquisition module is used for acquiring the contour line and a plurality of contour points of the characters to be processed;
the first determining module is used for determining a normal corresponding to each contour point based on the contour line;
the second determining module is used for determining a first target point on each normal according to a target bordering value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target bordering value;
and the generating module is used for sequentially connecting all points in a target point set to form a target boundary line of the character to be processed, wherein the target point set comprises the first target point, and all points in the target point set are respectively positioned outside or inside the contour line.
In a third aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the word processing method steps when executing the programs stored in the memory.
In a fourth aspect of the present invention, there is also provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the word processing method steps.
In the embodiment of the invention, the normal line of each contour point on the contour line of the character to be processed is respectively determined, the first target point is respectively determined on each normal line according to the target edge adding value, and then all the determined first target points are connected to form the target boundary line of the character to be processed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flow chart of a word processing method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a word processing device according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a second determining module according to an embodiment of the present invention;
FIG. 4 is a second schematic diagram of a second determining module according to an embodiment of the invention;
FIG. 5 is a schematic diagram of a word processing device according to an embodiment of the invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a text processing method according to an embodiment of the present invention, which includes the following steps:
step S101, acquiring contour lines and a plurality of contour points of characters to be processed.
The fonts of the characters to be processed can be bitmap fonts or vector fonts. The pattern of the word to be processed can be common words or artistic words such as hollow words.
The obtaining the outline and the plurality of outline points of the text to be processed may be obtained by analyzing a font file. In particular, the font file may be a font file designed by a font designer based on a font library, the font file including a plurality of contour points and position information of the plurality of contour points. The plurality of contour points may embody contour features of the text to be processed. And analyzing the font file to obtain a plurality of contour points of the word to be processed, and determining the contour line of the word to be processed based on the plurality of contour points.
In addition, the obtaining the contour line and the plurality of contour points of the text to be processed may also be obtained by identifying the contour line of the determined text by a contour identification algorithm, so as to implement edge adding of the determined text.
And step S102, determining the normal corresponding to each contour point based on the contour line.
In this step, the normal line refers to a line that is located on a plane where the contour line is located and is perpendicular to a tangent line of the contour line, where the normal line of each contour point may be determined by taking the normal line of the contour line through each contour point. Specifically, the normal line may be obtained by first making a tangent to the contour line by each contour point and then making the corresponding tangent to each contour point perpendicular.
Step S103, determining a first target point on each normal according to a target bordering value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target bordering value;
specifically, a distance calculation formula between two points may be adopted, a contour point is taken as a first point, a distance between the first point and a second point is taken as the target adding value as a constraint condition, a second point is determined on a normal line passing through the first point, at this time, if no other normal line passes through the determined second point, that is, if there is only one perpendicular line perpendicular to the contour line passing through the second point, and the perpendicular point is the first point, it is stated that the first point is a point closest to the second point in all contour points on the contour line, that is, a distance value between the second point and the first point is a minimum value between the second point and the contour line, and therefore, in this case, the determined second point may be taken as the first target point. However, when the second point is the intersection point of at least two normals, that is, at least two perpendicular lines perpendicular to the contour line can be made through the second point, the first point is only a perpendicular point of one normal line, and since the distance values from the second point to the contour line along different normals may be different, the second point has a plurality of distance values relative to the contour line, at this time, the distance values from the second point to the contour line along other normals need to be calculated, and if all other distance values are equal to or greater than the target addition value, it is indicated that the first point is still the closest point to the second point in all contour points on the contour line, that is, the distance value between the second point and the first point is the minimum distance value between the second point and the contour line, so in this case, the determined second point can be regarded as the first target point. However, when the distance value between the second point and the contour line along the other normal lines is smaller than the target borderline, the determined minimum distance value between the second point and the contour line is smaller than the target borderline, so the second point cannot be used as the first target point. And if the second point on the normal line cannot be used as the first target point, a third point can be determined near the normal line, wherein the distance value between the third point and the second point is ensured to be the target bordering value, then, through the verification method, whether the distance value between the third point and the first point is the minimum distance value between the third point and the contour line is judged, if so, the third point is used as the first target point corresponding to the first point, if not, a fourth point is further determined near the normal line according to the step of determining the third point, and the steps are repeated until the first target point corresponding to the first point is determined. And according to the method the first target point is determined on or near each normal line.
The target edge value may be a fixed value or a relative value. For example, when the text to be processed is a bitmap font, the target bordering value may be a fixed pixel value. When the character to be processed is a vector font, since the vector font is usually scaled, if a fixed pixel value is still applied, the added edge appears thinner when the vector font is enlarged to a relatively larger character, and when the vector font is reduced to a relatively smaller character, the added edge appears thicker again, so that the overall appearance of the character is affected.
Step S104, all points in a target point set are sequentially connected to form a target boundary line of the character to be processed, wherein the target point set comprises the first target point, and all points in the target point set are respectively positioned outside or inside the contour line.
Wherein, the added edge is an outer edge determined by expanding outwards based on the contour line or an inner edge determined by contracting inwards based on the contour line; and each normal line crossing the contour point comprises a symmetrical point with the same distance value as the contour point at the inner part and the outer part of the contour line, so that when the outer edge of the character to be processed is needed to be added, the target point can be determined at the outer part of the contour line; when the inner edge of the word to be processed needs to be added, the target point can be determined in the outline.
Specifically, as can be seen from the above step S103, the minimum distance between all the first target points and the contour line determined in step S103 is the target borderline, so that the determined first target points are respectively used as points in the target point set, and all the points in the target point set are sequentially connected through a smooth curve, that is, all the first target points are sequentially connected, to form a target borderline, at this time, the minimum distance between all the points on the target borderline and the contour line is regarded as the target borderline, so that the shape feature of the contour line can be better reflected by the target borderline, and the problem of poor borderline effect caused by a large difference between the shape of the determined borderline and the shape of the contour line in the prior art is solved.
Optionally, the determining the first target point on each normal according to the target edge value includes:
determining the maximum boundary line of the character to be processed according to the preset maximum edge value;
respectively calculating first target distance values between all points in a preset area of each normal line and the contour line, wherein the preset area is an area of the normal line between the contour line and a maximum boundary line, and the first target distance values are minimum values of distances between points on the normal line and the contour line;
and determining a point on the normal line, the first target distance value of which is equal to the target edge value, as the first target point.
When setting the bordering function of the text, a maximum bordering value capable of bordering is generally set for the determined text to be processed, so that a maximum borderline corresponding to the maximum bordering value can be determined by the maximum bordering value according to the method provided in the steps S101 to S104.
The preset area is a line segment which is cut on the normal line, and the line segment is a line segment of the normal line between the contour line and the maximum boundary line. Since the line segment is located between the contour line and the maximum boundary line, the first target point is determined on or near the line segment in the process of edge adding, therefore, before the edge adding, the minimum distance value (first target distance value) between each point on the line segment and the contour line can be determined first, that is, the coordinate (hereinafter referred to as "edge adding coordinate") of extending one dimension to each point on the line segment is equivalent, and the first target distance value of the point is used as the coordinate value of the extended edge adding coordinate, so that when the text to be processed needs to be added, only the points with the edge adding coordinate values equal to the target edge adding value in the preset area of all normals need to be respectively used as the first target points, and then all the first target points are sequentially connected to obtain the target boundary line.
When the point in the preset area is the intersection point of at least two normals, the coordinate value of the intersection point may be determined according to the method in step S103, and specifically, the coordinate value of the intersection point is the minimum distance between the intersection point and the contour line.
Optionally, before all points in the target point set are sequentially connected to form the target boundary line of the text to be processed, the method further includes:
determining at least one second target point between any two adjacent normals, wherein the minimum distance value in the distance values from the second target point to each contour point is equal to the target bordering value;
the second target point is taken as a point in the target point set.
Specifically, the second target point may be further determined between any two adjacent normals, where the minimum distance value of the distance value from the second target point to each of the contour points is guaranteed to be equal to the target borderline value, and since the plurality of contour points are a plurality of points extracted from the contour line and capable of representing the contour feature of the contour line, and the minimum distance value of the distance value from the second target point to each of the contour points is guaranteed to be equal to the target borderline value, the target borderline value may be regarded as the minimum distance value from the second target point to the contour line, and the second target point may be regarded as the point in which the target points are concentrated, and thus the number of points in which the target points are concentrated may be further increased, so that the target borderline formed by connecting the target points may better represent the shape feature of the contour line.
Optionally, an area formed by the maximum boundary line, the contour line and the normal line in a common surrounding mode is a bordered area, and the determining at least one second target point between two adjacent normal lines includes:
respectively calculating second target distance values between all points in the bordering area and the contour line, wherein the second target distance values are equal to the distance values between the points in the bordering area and the contour point with the smallest distance in the contour points;
and determining a point with a second target distance value equal to the target bordering value in the bordering area as the second target point.
Specifically, since the determined target points are all points between the contour line and the maximum boundary line in the actual edging process, and the edging coordinates of all points in the edging area can be further calculated on the basis that the edging coordinates of the points on the preset area have been determined in the above steps, when the second target point needs to be determined, all the second target points can be determined only by taking the point in the edging area, where the edging coordinate value is equal to the target edging value, as the second target point.
Since the text is usually set in a virtual grid, for example, a 1024 x 1024 grid, all the points in the preset area and all the points in the bordering area may be the respective grids covered by the preset area or the bordering area, i.e. each grid is regarded as a point, so as to ensure that all the points in the preset area, i.e. the bordering area, are limited points.
In addition, since the added edge is usually a very thin line with respect to the text to be processed, the first target point and the second target point are actually points near the text to be processed. Therefore, the contour point closest to the point between the two connected normals (hereinafter, referred to as "first normal line" and "second normal line" respectively) is usually the contour point corresponding to the first normal line or the contour point corresponding to the second normal line, so, in order to simplify the calculation process of the addition coordinate value of the point between the first normal line and the second normal line, only the distance value between the point and the contour point corresponding to the first normal line and the distance value between the point and the contour point corresponding to the second normal line need to be calculated, and a smaller value is taken as the addition coordinate value of the point between the first normal line and the second normal line from the calculated two distance values.
In order to facilitate calculation of the above-mentioned preset region and the bordering coordinate values of all points in the bordering region, a specific calculation manner is provided below:
n contour points are sequentially acquired on the contour line, wherein the coordinates of each contour point are respectively marked as (x) c,j ,y c,j ) Wherein j is more than or equal to 1 and n is more than or equal to n.
Then, at point (x c,j ,y c,j ) Corresponding normal and point (x c,j+1 ,y c,j+1 ) Between the corresponding normals or on two normals, arbitrarily selecting one point (x, y), and calculating the point (x, y) to the point (x c,j ,y c,j ) And point (x) c,j+1 ,y c,j+1 ) The smaller of the two distance values is selected as the bordering coordinate value of the point (x, y). Thus, the bordering coordinate values of all points in the preset area and the bordering area are calculated in sequence according to the sequence from 1 to n-1 of j. In addition, the coordinate value of the point inside the contour line may be set to a negative value and the coordinate value of the point outside the contour line may be set to a positive value, thereby facilitating the distinction between the coordinate value of the point inside the contour line and the coordinate value of the point outside the contour line.
Optionally, after the target boundary lines of the text to be processed are formed by sequentially connecting all the first target points, the method further includes:
and filling the area between the target boundary line and the contour line.
The filling of the region between the target boundary line and the contour line may be performed by assigning the colors to be filled to points in the bordering region where all bordering coordinate values are smaller than or equal to the target bordering value, so that the region between the target boundary line and the contour line may be filled.
In addition, a plurality of edges can be applied to the same word to be processed by the edge adding method, for example, it is assumed that two outer edges are required to be applied to the word to be processed in sequence, wherein the edge adding width of the first outer edge is width 1, and the color is color1; the width of the added edge of the outer edge of the second strip is with2, and the color of filling is color2; and the width 1 and the width 2 are relative edge widths relative to the characters to be processed, and the width 1 is less than the width 2. Before the edge is specifically added, the target edge adding value d corresponding to each of the width 1 and the width 2 needs to be calculated with1 And d with2 . Specifically, after the text to be processed is obtained, the text to be processed is scaled according to the size of the text to be produced, where the scaling ratio may be k, and at this time, d with1 =k*with1,d with2 =k*with2。
Then according to d with1 And d with2 The specific determination process of the first target boundary line and the second target boundary line is the same as that of the above embodiment, and for avoiding repetition, a detailed description is omitted herein. In the process, the addition coordinate value d of all points between the outline of the character to be processed and the second target boundary line is respectively determined i
And finally, carrying out color assignment on all points between the outline of the character to be processed and the second target boundary line, wherein the specific assignment rule is as follows:
when 0 < d i <d with1 Assigning the color of the point as color1;
when d with1 <d i <d with2 When the color of the dot is assigned color2.
Thus completing the bordering process of the word to be processed.
Compared with the existing edge method, the word processing method has relatively small calculated amount and can be operated and realized on the mobile terminal, so that the method can be applied to a PC system and a system of the mobile terminal.
Referring to fig. 2, fig. 2 is a schematic diagram of a word processing device 200 according to an embodiment of the invention, including:
an obtaining module 201, configured to obtain a contour line and a plurality of contour points of a word to be processed;
a first determining module 202, configured to determine a normal line corresponding to each contour point based on the contour line;
a second determining module 203, configured to determine a first target point on each normal according to a target bordering value, where a minimum value of a distance between the first target point and the contour line is equal to the target bordering value;
and the generating module 204 is configured to sequentially connect all points in a target point set to form a target boundary line of the text to be processed, where the target point set includes the first target point, and all points in the target point set are respectively located outside or inside the contour line.
In the embodiment of the invention, the normal line of each contour point on the contour line of the character to be processed is respectively determined, the first target point is respectively determined on each normal line according to the target edge adding value, and then all the determined first target points are connected to form the target boundary line of the character to be processed.
Optionally, referring to fig. 3, the second determining module 203 includes:
a first determining submodule 2031, configured to determine a maximum boundary line of the text to be processed according to a preset maximum edge value;
a first calculating submodule 2032, configured to calculate first target distance values between all points in a preset area of each normal line and the contour line, where the preset area is an area where the normal line is located between the contour line and a maximum boundary line, and the first target distance value is a minimum value of distances between points on the normal line and the contour line;
a second determining submodule 2033 is configured to determine, as the first target point, a point on the normal where the first target distance value is equal to the target bordering value.
Optionally, the second determining module 203 is further configured to determine at least one second target point between any two adjacent normals, where a minimum distance value of distance values from the second target point to each contour point is equal to the target bordering value;
the second target point is taken as a point in the target point set.
Optionally, referring to fig. 4, an area formed by the maximum boundary line, the contour line and the normal line in a surrounding manner is an edge area, and the second determining module 203 further includes:
a second calculating submodule 2034, configured to calculate second target distance values between all points in the bordering area and the contour line, where the second target distance values are equal to distance values between points in the bordering area and contour points with the smallest distance between the points in the bordering area and the contour points;
the second determining module 203 is further configured to determine, as the second target point, a point in the bordering area where a second target distance value is equal to the target bordering value.
Optionally, referring to fig. 5, the apparatus further includes:
and a filling module 205, configured to fill a region between the target boundary line and the contour line.
The embodiment of the invention also provides an electronic device, as shown in fig. 6, which comprises a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory 603 complete communication with each other through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to execute the program stored in the memory 603, and implement the following steps:
acquiring contour lines and a plurality of contour points of characters to be processed;
determining a normal corresponding to each contour point based on the contour line;
according to a target bordering value, a first target point is respectively determined on each normal, wherein the minimum value of the distance between the first target point and the contour line is equal to the target bordering value;
and sequentially connecting all points in a target point set to form a target boundary line of the character to be processed, wherein the target point set comprises the first target point, and all points in the target point set are respectively positioned outside or inside the contour line.
In addition, the electronic device may be a common smart device, for example, a smart television, a smart watch, a vr\ar device, and the like. The word processing method can be applied to the electronic equipment provided with various common operating systems, wherein the common operating systems can be android systems, iOS systems, windows systems, macOS systems, linux systems and the like.
Optionally, the determining the first target point on each normal according to the target edge value includes:
determining the maximum boundary line of the character to be processed according to the preset maximum edge value;
respectively calculating first target distance values between all points in a preset area of each normal line and the contour line, wherein the preset area is an area of the normal line between the contour line and a maximum boundary line, and the first target distance values are minimum values of distances between points on the normal line and the contour line;
and determining a point on the normal line, the first target distance value of which is equal to the target edge value, as the first target point.
Optionally, before all points in the target point set are sequentially connected to form the target boundary line of the text to be processed, the method further includes:
determining at least one second target point between any two adjacent normals, wherein the minimum distance value in the distance values from the second target point to each contour point is equal to the target bordering value;
the second target point is taken as a point in the target point set.
Optionally, an area formed by the maximum boundary line, the contour line and the normal line in a common surrounding mode is a bordered area, and the determining at least one second target point between two adjacent normal lines includes:
respectively calculating second target distance values between all points in the bordering area and the contour line, wherein the second target distance values are equal to the distance values between the points in the bordering area and the contour point with the smallest distance in the contour points;
and determining a point with a second target distance value equal to the target bordering value in the bordering area as the second target point.
Optionally, after the target boundary lines of the text to be processed are formed by sequentially connecting all the first target points, the method further includes:
and filling the area between the target boundary line and the contour line.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the word processing method of any of the above embodiments.
In yet another embodiment of the present invention, a computer program product containing instructions that, when run on a computer, cause the computer to perform the word processing method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (8)

1. A word processing method, comprising:
acquiring contour lines and a plurality of contour points of characters to be processed;
determining a normal corresponding to each contour point based on the contour line;
according to a target bordering value, a first target point is respectively determined on each normal, wherein the minimum value of the distance between the first target point and the contour line is equal to the target bordering value;
sequentially connecting all points in a target point set to form a target boundary line of the character to be processed, wherein the target point set comprises the first target point, and all points in the target point set are respectively positioned outside or inside the contour line;
the determining a first target point on each normal according to the target edge value comprises the following steps:
determining the maximum boundary line of the character to be processed according to the preset maximum edge value;
respectively calculating first target distance values between all points in a preset area of each normal line and the contour line, wherein the preset area is an area of the normal line between the contour line and a maximum boundary line, and the first target distance values are minimum values of distances between points on the normal line and the contour line;
and determining a point on the normal line, the first target distance value of which is equal to the target edge value, as the first target point.
2. The method according to claim 1, wherein the sequentially connecting all points in the target point set, before forming the target boundary line of the text to be processed, further comprises:
determining at least one second target point between any two adjacent normals, wherein the minimum distance value in the distance values from the second target point to each contour point is equal to the target bordering value;
the second target point is taken as a point in the target point set.
3. The method according to claim 2, wherein the area formed by the maximum boundary line, the contour line and the normal line together is a bordered area, and determining at least one second target point between two adjacent normal lines comprises:
respectively calculating second target distance values between all points in the bordering area and the contour line, wherein the second target distance values are equal to the distance values between the points in the bordering area and the contour point with the smallest distance in the contour points;
and determining a point with a second target distance value equal to the target bordering value in the bordering area as the second target point.
4. A method according to any one of claims 1-3, characterized in that after said sequentially connecting all said first target points to form a target boundary line of said text to be processed, the method further comprises:
and filling the area between the target boundary line and the contour line.
5. A word processing apparatus, comprising:
the acquisition module is used for acquiring the contour line and a plurality of contour points of the characters to be processed;
the first determining module is used for determining a normal corresponding to each contour point based on the contour line;
the second determining module is used for determining a first target point on each normal according to a target bordering value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target bordering value;
the generating module is used for sequentially connecting all points in a target point set to form a target boundary line of the character to be processed, wherein the target point set comprises the first target point, and all points in the target point set are respectively positioned outside or inside the contour line;
the second determining module includes:
the first determining submodule is used for determining the maximum boundary line of the characters to be processed according to the preset maximum edge value;
a calculating sub-module, configured to calculate first target distance values between all points in a preset area of each normal line and the contour line, where the preset area is an area where the normal line is located between the contour line and a maximum boundary line, and the first target distance value is a minimum value of distances between points on the normal line and the contour line;
and the second determining submodule is used for determining a point, on the normal, of which the first target distance value is equal to the target bordering value as the first target point.
6. The apparatus of claim 5, wherein the second determining module is further configured to determine at least one second target point between any two adjacent normals, wherein a minimum distance value of distance values of the second target point to each contour point is equal to the target bordering value;
the second target point is taken as a point in the target point set.
7. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1-4 when executing a program stored on a memory.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-4.
CN202010288580.4A 2020-04-14 2020-04-14 Word processing method, word processing device, electronic equipment and computer readable storage medium Active CN111523531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010288580.4A CN111523531B (en) 2020-04-14 2020-04-14 Word processing method, word processing device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010288580.4A CN111523531B (en) 2020-04-14 2020-04-14 Word processing method, word processing device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111523531A CN111523531A (en) 2020-08-11
CN111523531B true CN111523531B (en) 2023-09-29

Family

ID=71902171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010288580.4A Active CN111523531B (en) 2020-04-14 2020-04-14 Word processing method, word processing device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111523531B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112116721B (en) * 2020-09-21 2023-11-28 雅客智慧(北京)科技有限公司 Three-dimensional model marking method, device, electronic equipment and storage medium
CN112528596B (en) * 2020-12-01 2024-07-30 北京达佳互联信息技术有限公司 Rendering method and device of text special effects, electronic equipment and storage medium
CN112763513B (en) * 2021-01-26 2022-08-12 广东奥普特科技股份有限公司 Character defect detection method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0627927A (en) * 1992-07-09 1994-02-04 Oki Electric Ind Co Ltd Outline character plotting method
JPH1055163A (en) * 1996-06-06 1998-02-24 Fujitsu Ltd Font generating device
CN1457481A (en) * 2001-03-23 2003-11-19 瑞资有限公司 Character processing method based on outline font information and computer software program product for allowing computer system to execute the method
CN101764937A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming distance of pixel space mask code matrix from pixel to outermost side
CN101764936A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming shortest distance of pixel space mask code matrix from pixel to boundary
CN102063419A (en) * 2009-11-12 2011-05-18 方正国际软件(北京)有限公司 Method and device for processing words
CN105513006A (en) * 2014-10-16 2016-04-20 北京汉仪科印信息技术有限公司 Outline thickness adjusting method and device of TrueType font
CN109064932A (en) * 2018-09-03 2018-12-21 辽宁三维蚂蚁科技有限公司 Stereo luminous character and preparation method thereof with bevel edge

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0627927A (en) * 1992-07-09 1994-02-04 Oki Electric Ind Co Ltd Outline character plotting method
JPH1055163A (en) * 1996-06-06 1998-02-24 Fujitsu Ltd Font generating device
CN1457481A (en) * 2001-03-23 2003-11-19 瑞资有限公司 Character processing method based on outline font information and computer software program product for allowing computer system to execute the method
CN101764937A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming distance of pixel space mask code matrix from pixel to outermost side
CN101764936A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming shortest distance of pixel space mask code matrix from pixel to boundary
CN102063419A (en) * 2009-11-12 2011-05-18 方正国际软件(北京)有限公司 Method and device for processing words
CN105513006A (en) * 2014-10-16 2016-04-20 北京汉仪科印信息技术有限公司 Outline thickness adjusting method and device of TrueType font
CN109064932A (en) * 2018-09-03 2018-12-21 辽宁三维蚂蚁科技有限公司 Stereo luminous character and preparation method thereof with bevel edge

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种移动终端笔画字体存储结构及轮廓化算法;张骥先等;《计算机辅助设计与图形学学报》(12);全文 *

Also Published As

Publication number Publication date
CN111523531A (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN111523531B (en) Word processing method, word processing device, electronic equipment and computer readable storage medium
CN110502985B (en) Form identification method and device and form identification equipment
CN113657202B (en) Component identification method, training set construction method, device, equipment and storage medium
CN109753641B (en) Method and device for changing object position, electronic equipment and storage medium
CN112348836A (en) Method and device for automatically extracting building outline
CN108197567B (en) Method, apparatus and computer readable medium for image processing
CN111857704A (en) Code generation method and device for layout relationship
CN112801888A (en) Image processing method, image processing device, computer equipment and storage medium
CN114913216A (en) Method, device, medium and electronic equipment for identifying corner points of graph in image
CN109871743B (en) Text data positioning method and device, storage medium and terminal
CN114445844A (en) Plate member identification method, device, equipment and storage medium
CN108470368B (en) Method and device for determining rendering object in virtual scene and electronic equipment
CN112598687B (en) Image segmentation method and device, storage medium and electronic equipment
CN109949421B (en) Triangular net cutting method and device
CN111191090A (en) Method, device, equipment and storage medium for determining service data presentation graph type
CN114898119B (en) Building outline drawing method, device, equipment and medium
CN113808192B (en) House pattern generation method, device, equipment and storage medium
CN112286785B (en) Abnormality detection method and device for user interface
CN113902933A (en) Ground segmentation network model training method, device, equipment and medium
CN109410304B (en) Projection determination method, device and equipment
CN111243058A (en) Object simulation image generation method and computer-readable storage medium
CN111738116B (en) Method, device, computer equipment and readable storage medium for identifying plate hole area
CN112487769B (en) Cell background generation method and device
CN113971738B (en) Image detection method, device, electronic equipment and storage medium
CN113495700B (en) Batch printing method, system and equipment for drawing and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant