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

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

Info

Publication number
CN111523531A
CN111523531A CN202010288580.4A CN202010288580A CN111523531A CN 111523531 A CN111523531 A CN 111523531A CN 202010288580 A CN202010288580 A CN 202010288580A CN 111523531 A CN111523531 A CN 111523531A
Authority
CN
China
Prior art keywords
target
point
contour
value
line
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.)
Granted
Application number
CN202010288580.4A
Other languages
Chinese (zh)
Other versions
CN111523531B (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

Images

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: obtaining a contour line and a plurality of contour points of a character to be processed; determining a normal corresponding to each contour point based on the contour line; respectively determining a first target point on each normal line according to a target edge value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target edge value; and sequentially connecting all points in a target point set to form a target boundary line of the characters 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 of poor effect of character edge adding in the prior art.

Description

Word processing method and device, electronic equipment and computer readable storage medium
Technical Field
The invention relates to the field of word processing, in particular to a word processing method, a word processing device, electronic equipment and a computer readable storage medium.
Background
In the prior art, when a character is subjected to edge-adding processing, the character is generally translated by a certain pixel along four directions, namely, up, down, left and right directions, respectively, so as to determine an edge-adding boundary line of the character, and then the edge-adding of the character is completed by rendering between the boundary line and a contour line of the character. However, when the glyph curve is complicated, the shape of the boundary line determined in this way is greatly different from the shape of the contour line, which leads to a problem of poor effect of edge-adding.
Disclosure of Invention
An embodiment of the present invention provides a method and an apparatus for processing a word, an electronic device, and a computer-readable storage medium, so as to solve the problem that the effect of adding a border to a word is poor in the prior art. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a method for processing a word, including:
obtaining a contour line and a plurality of contour points of a character to be processed;
determining a normal corresponding to each contour point based on the contour line;
respectively determining a first target point on each normal line according to a target edge value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target edge value;
and sequentially connecting all points in a target point set to form a target boundary line of the characters 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 comprising:
the acquisition module is used for acquiring the contour line and a plurality of contour points of the character to be processed;
the first determining module is used for determining a normal corresponding to each contour point based on the contour line;
a second determining module, configured to determine, according to a target bordering value, a first target point on each of the normal lines, 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 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 steps of the word processing method when executing the program stored in the memory.
In a fourth aspect of the embodiments of the present invention, there is also provided a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the word processing method steps.
In the embodiment of the invention, the normals of all contour points on the contour line of the character to be processed are respectively determined, the first target point is respectively determined on each normal line according to the target 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 present invention;
FIG. 2 is a diagram illustrating a structure of a word processing device according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a second determining module according to an embodiment of the present invention;
FIG. 4 is a second schematic structural diagram of a second determining module according to the embodiment of the present invention;
FIG. 5 is a diagram illustrating an exemplary structure of a word processing device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a word processing method according to an embodiment of the present invention, including the following steps:
step S101, obtaining a contour line and a plurality of contour points of the character to be processed.
The font of the character to be processed can be a bitmap font or a vector font. The style of the characters to be processed can be common characters, and also can be artistic characters such as hollow characters and the like.
The above-mentioned obtaining the contour line and the plurality of contour points of the character to be processed may be obtained by analyzing the font file. Specifically, the font file may be a font file designed by a font designer based on a font library, and the font file includes a plurality of contour points and position information of the contour points. The contour points can embody the contour characteristics of the character to be processed. And analyzing the font file to obtain a plurality of contour points of the character to be processed, and determining the contour line of the character to be processed based on the contour points.
In addition, the above-mentioned obtaining of the contour line and the plurality of contour points of the character to be processed may also be obtained by identifying the contour line of the determined character through a contour identification algorithm, so as to implement the bordering on the determined character.
And S102, determining a normal corresponding to each contour point based on the contour line.
In this step, the normal is a straight line which is located on the plane where the contour line is located and perpendicular to the tangent of the contour line, and the normal of each contour point can be determined by respectively passing through the contour points to form the normal of the contour line. Specifically, a tangent of the contour line may be drawn through each contour point, and then a perpendicular of the corresponding tangent through each contour point may be drawn to obtain the normal.
Step S103, respectively determining a first target point on each normal line according to a target edge adding value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target edge adding value;
specifically, a distance calculation formula between two points may be adopted, the contour point is used as a first point, the distance between the first point and the second point is used as the target bordering value, and the second point is determined on the normal of the first point, at this time, if no other normal passes through the determined second point, that is, the second point has and can only make a perpendicular line perpendicular to the contour line, and the perpendicular point is the first point, it is described that the first point is the closest point to the second point among 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, and therefore, in this case, the determined second point may be used as the first target point. However, when the second point is an intersection of at least two normals, that is, the second point may make at least two perpendicular lines perpendicular to the contour line, the first point is only a perpendicular point of one of the normals, and since the distance values of the second point from different normals to the contour line may be different, so that there are a plurality of distance values of the second point relative to the contour line, at this time, it is necessary to calculate the distance values of the second point from other normals to the contour line, and if all the other distance values are greater than or equal to the target added value, it is determined that the first point is still the closest point to the second point among all contour points on the contour line, that is, the distance value between the second point and the contour line is the minimum value of the distance between the second point and the contour line, and in this case, the determined second point may be used 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 bordering value, it means that the minimum distance value between the second point and the contour line is smaller than the target bordering value, so the second point cannot be used as the first target point. If the second point on the normal cannot be used as the first target point, a third point may be determined near the normal, wherein a distance value between the third point and the second point is ensured to be the target bordered value, then, by the above verification method, it is determined whether the distance value between the third point and the first point is a minimum distance value between the third point and the contour line, if so, the third point is used as the first target point corresponding to the first point, if not, according to the step of determining the third point, a fourth point is further determined near the normal, and the above 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.
The target value may be a fixed value or a relative value. For example, when the word to be processed is a bitmap font, the target bordered 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 side line appears thinner when the vector font is enlarged to a relatively large character, and the added side appears thicker when the vector font is reduced to a relatively small character, so that the whole appearance of the font is affected, by setting the target margin value to a relative value, the target margin value can be scaled correspondingly with the scaling of the character, for example, the size of a certain form (hereinafter referred to as "reference form") of the vector font can be used as a margin reference to determine the margin value (hereinafter referred to as "original margin value") of the required margin, when the margin is specifically added, the size of the character to be added can be obtained first, and then the scaling ratio k of the character to be processed with respect to the reference form can be determined, and manually setting the original margin width value D, so as to obtain a target margin value D through k and D, wherein D is k x D.
And S104, 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.
Wherein, the added edge can be an outer edge determined by expanding towards the outside based on the contour line or an inner edge determined by contracting towards the inside based on the contour line; and each normal line passing through the contour point respectively comprises a symmetrical point with the same distance value with the contour point inside and outside the contour line, so that when the outer edge of the character to be processed needs to be added, the target point can be determined outside the contour line; when the inner edge of the character to be processed needs to be added, the target point can be determined in the contour line.
Specifically, as can be seen from step S103, the minimum distances between all the first target points and the contour lines determined in step S103 are the target added edge values, and therefore, all the determined first target points are respectively used as the points in the set of target points, and all the points in the set of target points are sequentially connected through smooth curves, that is, all the first target points are sequentially connected to form the target boundary line, at this time, the minimum distances between all the points on the target boundary line and the contour lines can be regarded as the target added edge values, so that the target boundary line can better embody the shape characteristics of the contour lines, and the problem of poor edge adding effect caused by a large difference between the shape of the determined boundary line and the shape of the contour lines in the prior art is solved.
Optionally, the determining, according to the target bordering value, the first target point on each normal line respectively includes:
determining the maximum boundary line of the characters to be processed according to a preset maximum adding 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 where the normal line is located between the contour line and a maximum boundary line, and the first target distance value is the minimum value of the distance between the point on the normal line and the contour line;
and determining a point on the normal where the first target distance value is equal to the target bordering value as the first target point.
When the function of adding edges of characters is set, a maximum adding edge value capable of adding edges is usually set for the determined characters to be processed, so that the maximum boundary line corresponding to the maximum adding edge value can be determined according to the method provided in the above steps S101 to S104 by the maximum adding edge value.
The preset area is a line segment cut on the normal line, and the line segment is a line segment of which the normal line is positioned 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 actually determined on or near the line segment during the edge-adding process, and therefore, before the actual edge-adding, the minimum distance value (first target distance value) between each point on the line segment and the contour line, that is, the coordinate (hereinafter referred to as "edge-adding coordinate") corresponding to one dimension of each point on the line segment is extended, and the first target distance value of the point is used as the coordinate value of the extended edge-adding coordinate.
When the point in the preset region is an intersection of at least two normal lines, the bordering coordinate value of the intersection may be determined according to the method in step S103, and specifically, the bordering coordinate value of the intersection is the minimum distance between the intersection and the contour line.
Optionally, before all the points in the target point set are sequentially connected to form a target boundary line of the word to be processed, the method further includes:
determining at least one second target point between any two adjacent normals, wherein the minimum distance value of the distance values from the second target point to each contour point is equal to the target adding value;
and taking the second target point as a point in the target point set.
Specifically, the second target point may be further determined between any two adjacent normals, where a minimum distance value among distance values from the second target point to each of the contour points is guaranteed to be equal to the target added value, and since the plurality of contour points are extracted from the contour line and can represent the contour feature of the contour line, and a minimum distance value among distance values from the second target point to each of the contour points is equal to the target added value, the target added value may be used as a minimum distance value between the second target point and the contour line, and the second target point may be used as a point in the target point set, so that the number of points in the target point set may be further increased, and a target boundary line 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 together is a bordered area, and the determining of the at least one second target point between two adjacent normal lines includes:
respectively calculating second target distance values between all points in the edge adding area and the contour lines, wherein the second target distance values are equal to the distance values between the points in the edge adding area and the contour points with the minimum distance in the contour points;
and determining a point in the bordered area at which the second target distance value is equal to the target bordered value as the second target point.
Specifically, in the actual edge adding process, the determined target points are all points between the contour line and the maximum boundary line, and on the basis that the edge adding coordinates of the points on the preset area are determined in the above steps, the edge adding coordinates of all the points in the edge adding area can be further calculated in the present embodiment.
In the text design, since the text is usually arranged in a virtual grid, for example, a grid of 1024 × 1024, all points in the preset area and all points in the bordered area may be the grids covered by the preset area or the bordered area, that is, each grid is regarded as a point, thereby ensuring that all points in the preset area, that is, the bordered area, are limited points.
In addition, since the added edge is usually a very thin line relative to the word to be processed, the first target point and the second target point are actually points near the word to be processed. Therefore, the contour point closest to the point between the two connected normals (hereinafter, the two connected normals are referred to as a "first normal" and a "second normal", respectively) is usually the contour point corresponding to the first normal or the contour point corresponding to the second normal, so that, in order to simplify the calculation of the edge-added coordinate value of the point between the first normal and the second normal, it is only necessary to calculate the distance value between the point and the contour point corresponding to the first normal and the distance value between the point and the contour point corresponding to the second normal, and take the smaller one of the calculated distance values as the edge-added coordinate value of the point between the first normal and the second normal.
In order to facilitate the calculation of the value of the bordered coordinate of all the points in the preset area and the bordered area, a specific calculation method is provided below:
sequentially collecting n contour points on the contour line, wherein the coordinates of each contour point are respectively recorded as (x)c,j,yc,j) Wherein j is more than or equal to 1 and less than or equal to n.
Then, at point (x)c,j,yc,j) Corresponding normal and point (x)c,j+1,yc,j+1) Between the corresponding normal lines, or on the two normal lines, optionally selectingTaking a point (x, y), calculating and calculating the point (x, y) to the point (x) respectivelyc,j,yc,j) And point (x)c,j+1,yc,j+1) The smaller of the two distance values is selected as the value of the bordering coordinate of the point (x, y). And calculating the value of the edge coordinate of all the points in the preset area and the edge area in sequence according to the sequence of j from 1 to n-1. In addition, the value of the edge coordinate of the point located inside the contour line may be set to a negative value, and the value of the coordinate of the point outside the contour line may be set to a positive value, thereby facilitating the distinction between the values of the edge coordinate of the point inside the contour line and the values of the edge coordinate of the point outside the contour line.
Optionally, after the sequentially connecting all the first target points to form the target boundary line of the word to be processed, the method further includes:
filling the area between the target boundary line and the contour line.
The filling of the area between the target boundary line and the contour line may be performed by assigning colors to be filled to all points in the bordered area where the bordered coordinate value is less than or equal to the target bordered value, so that the area between the target boundary line and the contour line can be filled.
In addition, multiple edges can be applied to the same character to be processed by the edge adding method, for example, it is assumed that two outer edges need to be sequentially applied to the character to be processed, wherein the edge adding width of the first outer edge is with1, and the color of the filling is color 1; the width of the added edge of the second outer edge is with2, and the color of the filling is color 2; with the relative bordered widths with respect to the text to be processed, with the lengths of 1 and 2, with1 < with 2. Before the specific edge adding, the target edge adding value d corresponding to the with1 and the with2 respectively needs to be calculatedwith1And dwith2. Specifically, after the characters to be processed are obtained, the characters to be processed are scaled according to the size of the characters to be produced, where the scaling ratio may be k, and at this time, d iswith1=k*with1,dwith2=k*with2。
Then according to dwith1And dwith2Determining a first target boundary line andthe specific determination process of the first target boundary line and the second target boundary line is the same as that in the above embodiment, and is not described herein again to avoid repetition. In the process, the value d of the edge coordinate of all the points between the contour line of the character to be processed and the second target boundary line is respectively determinedi
And finally, performing color assignment on all points between the contour line of the character to be processed and the second target boundary line, wherein the specific assignment rule is as follows:
when 0 < di<dwith1Then assign the color of the point to color 1;
when d iswith1<di<dwith2Then the color of the point is assigned color 2.
Thereby completing the process of adding edges to the characters to be processed.
Compared with the existing edge adding method, the word processing method has relatively less calculation 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 diagram illustrating a word processing apparatus 200 according to an embodiment of the present invention, including:
an obtaining module 201, configured to obtain a contour line of a word to be processed and a plurality of contour points;
a first determining module 202, configured to determine, based on the contour lines, a normal corresponding to each contour point;
a second determining module 203, configured to determine a first target point on each of the normal lines 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;
a generating module 204, configured to sequentially connect all points in a target point set to form a target boundary line of the to-be-processed text, where the target point set includes the first target point, and all points in the target point set are located outside or inside the contour line, respectively.
In the embodiment of the invention, the normals of all contour points on the contour line of the character to be processed are respectively determined, the first target point is respectively determined on each normal line according to the target 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:
the first determining submodule 2031 is configured to determine, according to a preset maximum value of adding a margin, a maximum boundary line of the text to be processed;
a first calculating sub-module 2032, configured to calculate first target distance values between all points in a preset region of each normal and the contour line, where the preset region is a region where the normal 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 and the contour line;
a second determining sub-module 2033 configured to determine, as the first target point, a point on the normal where the first target distance value is equal to the target adding 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 adding value;
and taking the second target point 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 together is a bordered 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 lines, respectively, where the second target distance values are equal to distance values between points in the bordering area and contour points with the smallest distance among the contour points;
the second determining module 203 is further configured to determine, as the second target point, a point in the bordered area where the second target distance value is equal to the target bordered value.
Optionally, referring to fig. 5, the apparatus further includes:
a filling module 205, configured to fill a region between the target boundary line and the contour line.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
obtaining a contour line and a plurality of contour points of a character to be processed;
determining a normal corresponding to each contour point based on the contour line;
respectively determining a first target point on each normal line according to a target edge value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target edge value;
and sequentially connecting all points in a target point set to form a target boundary line of the characters 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 also be a common smart device, such as 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, according to the target bordering value, the first target point on each normal line respectively includes:
determining the maximum boundary line of the characters to be processed according to a preset maximum adding 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 where the normal line is located between the contour line and a maximum boundary line, and the first target distance value is the minimum value of the distance between the point on the normal line and the contour line;
and determining a point on the normal where the first target distance value is equal to the target bordering value as the first target point.
Optionally, before all the points in the target point set are sequentially connected to form a target boundary line of the word to be processed, the method further includes:
determining at least one second target point between any two adjacent normals, wherein the minimum distance value of the distance values from the second target point to each contour point is equal to the target adding value;
and taking the second target point as a point in the target point set.
Optionally, an area formed by the maximum boundary line, the contour line, and the normal line together is a bordered area, and the determining of the at least one second target point between two adjacent normal lines includes:
respectively calculating second target distance values between all points in the edge adding area and the contour lines, wherein the second target distance values are equal to the distance values between the points in the edge adding area and the contour points with the minimum distance in the contour points;
and determining a point in the bordered area at which the second target distance value is equal to the target bordered value as the second target point.
Optionally, after the sequentially connecting all the first target points to form the target boundary line of the word to be processed, the method further includes:
filling the area between the target boundary line and the contour line.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a 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 processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, and when the instructions are executed on a computer, the computer is caused to execute the word processing method described in any one of the above embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the word processing method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized 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, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the 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)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method of word processing, comprising:
obtaining a contour line and a plurality of contour points of a character to be processed;
determining a normal corresponding to each contour point based on the contour line;
respectively determining a first target point on each normal line according to a target edge value, wherein the minimum value of the distance between the first target point and the contour line is equal to the target edge value;
and sequentially connecting all points in a target point set to form a target boundary line of the characters 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.
2. The method of claim 1, wherein determining the first target point on each of the normal lines according to the target bordered value comprises:
determining the maximum boundary line of the characters to be processed according to a preset maximum adding 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 where the normal line is located between the contour line and a maximum boundary line, and the first target distance value is the minimum value of the distance between the point on the normal line and the contour line;
and determining a point on the normal where the first target distance value is equal to the target bordering value as the first target point.
3. The method of claim 2, wherein before the sequentially connecting all points in the target point set to form the target boundary line of the word to be processed, the method further comprises:
determining at least one second target point between any two adjacent normals, wherein the minimum distance value of the distance values from the second target point to each contour point is equal to the target adding value;
and taking the second target point as a point in the target point set.
4. The method of claim 3, wherein an area defined by the maximum boundary line, the contour line and the normal lines together is a bordered area, and the determining at least one second target point between two adjacent normal lines comprises:
respectively calculating second target distance values between all points in the edge adding area and the contour lines, wherein the second target distance values are equal to the distance values between the points in the edge adding area and the contour points with the minimum distance in the contour points;
and determining a point in the bordered area at which the second target distance value is equal to the target bordered value as the second target point.
5. The method according to any one of claims 1-4, wherein after said sequentially connecting all of said first target points to form a target boundary line of said word to be processed, the method further comprises:
filling the area between the target boundary line and the contour line.
6. A word processing device, comprising:
the acquisition module is used for acquiring the contour line and a plurality of contour points of the character to be processed;
the first determining module is used for determining a normal corresponding to each contour point based on the contour line;
a second determining module, configured to determine, according to a target bordering value, a first target point on each of the normal lines, 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 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.
7. The apparatus of claim 6, wherein the second determining module comprises:
the first determining submodule is used for determining the maximum boundary line of the characters to be processed according to a preset maximum adding value;
the calculation submodule is used for calculating first target distance values between all points in a preset area of each normal line and the contour line respectively, wherein 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 the minimum value of distances between the points on the normal line and the contour line;
and the second determining submodule is used for determining a point, on the normal line, of which the first target distance value is equal to the target adding value as the first target point.
8. The apparatus according to claim 7, 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 from the second target point to each of the contour points is equal to the target bordered value;
and taking the second target point as a point in the target point set.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
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 true CN111523531A (en) 2020-08-11
CN111523531B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112116721A (en) * 2020-09-21 2020-12-22 雅客智慧(北京)科技有限公司 Marking method and device of three-dimensional model, electronic equipment and storage medium
CN112528596A (en) * 2020-12-01 2021-03-19 北京达佳互联信息技术有限公司 Rendering method and device for special effect of characters, electronic equipment and storage medium
CN112763513A (en) * 2021-01-26 2021-05-07 广东奥普特科技股份有限公司 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
CN101764936A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming shortest distance of pixel space mask code matrix from pixel to boundary
CN101764937A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming distance of pixel space mask code matrix from pixel to outermost side
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
CN101764936A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming shortest distance of pixel space mask code matrix from pixel to boundary
CN101764937A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for confirming distance of pixel space mask code matrix from pixel to outermost side
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
张骥先等: "一种移动终端笔画字体存储结构及轮廓化算法", 《计算机辅助设计与图形学学报》, no. 12 *

Cited By (5)

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

Also Published As

Publication number Publication date
CN111523531B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
CN111523531B (en) Word processing method, word processing device, electronic equipment and computer readable storage medium
CN108345882B (en) Method, apparatus, device and computer-readable storage medium for image recognition
CN108564645B (en) Rendering method of house model, terminal device and medium
CN108334879B (en) Region extraction method, system and terminal equipment
US11080464B2 (en) Correction techniques of overlapping digital glyphs
CN113657202B (en) Component identification method, training set construction method, device, equipment and storage medium
CN112348836A (en) Method and device for automatically extracting building outline
CN111857704A (en) Code generation method and device for layout relationship
CN113190781A (en) Page layout method, device, equipment and storage medium
CN113538623B (en) Method, device, electronic equipment and storage medium for determining target image
CN109871743B (en) Text data positioning method and device, storage medium and terminal
US11055526B2 (en) Method, system and apparatus for processing a page of a document
CN112598687B (en) Image segmentation method and device, storage medium and electronic equipment
CN114282288A (en) Axle network identification method, device, equipment and storage medium
CN114913216A (en) Method, device, medium and electronic equipment for identifying corner points of graph in image
CN111815748A (en) Animation processing method and device, storage medium and electronic equipment
CN111862343A (en) Three-dimensional reconstruction method, device and equipment and computer readable storage medium
CN111402366A (en) Character rendering method and device, electronic equipment and storage medium
CN108470368B (en) Method and device for determining rendering object in virtual scene and electronic equipment
CN112052647A (en) Document editing method and device, electronic equipment and readable storage medium
CN113743056A (en) Document conversion method based on paragraph shrinkage amount, computing device and storage medium
CN110309127B (en) Data processing method and device and electronic equipment
CN113495700A (en) Batch printing method, system and equipment of drawings and computer readable storage medium
CN117633973A (en) CAD file identification method, device, electronic equipment and storage medium
CN113689443A (en) Building point cloud contour extraction method and device

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