CN110858291A - Character segmentation method and device - Google Patents

Character segmentation method and device Download PDF

Info

Publication number
CN110858291A
CN110858291A CN201810975715.7A CN201810975715A CN110858291A CN 110858291 A CN110858291 A CN 110858291A CN 201810975715 A CN201810975715 A CN 201810975715A CN 110858291 A CN110858291 A CN 110858291A
Authority
CN
China
Prior art keywords
character
segmentation
determining
handwriting
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.)
Pending
Application number
CN201810975715.7A
Other languages
Chinese (zh)
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 Sogou Technology Development Co Ltd
Sogou Hangzhou Intelligent Technology Co Ltd
Original Assignee
Beijing Sogou Technology Development Co Ltd
Sogou Hangzhou Intelligent 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 Sogou Technology Development Co Ltd, Sogou Hangzhou Intelligent Technology Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN201810975715.7A priority Critical patent/CN110858291A/en
Publication of CN110858291A publication Critical patent/CN110858291A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/32Digital ink
    • G06V30/333Preprocessing; Feature extraction
    • G06V30/347Sampling; Contour coding; Stroke extraction
    • 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/32Digital ink

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Discrimination (AREA)

Abstract

The invention discloses a character segmentation method and a device, wherein the method comprises the following steps: acquiring character handwriting; determining characteristic information of the character handwriting, wherein the characteristic information comprises: a baseline of the character script; determining an intersection point of the character track and a base line of the character track, and taking the intersection point as pre-estimated segmentation information; determining an actual segmentation point according to the estimated segmentation information and a pre-constructed segmentation model; and segmenting the character handwriting according to the actual segmentation point to obtain a segmentation result. The invention can be used for accurately segmenting the continuous stroke characters in the handwritten text.

Description

Character segmentation method and device
Technical Field
The invention relates to the field of handwriting recognition, in particular to a character segmentation method and a character segmentation device.
Background
The handwriting recognition technology is a process of converting ordered track information generated during writing on a handwriting device into a character internal code, is actually a mapping process from a coordinate sequence of a handwriting track to the character internal code, and is one of the most natural and convenient means of man-machine interaction. With the popularization of intelligent terminals such as smart phones and palm computers, handwriting recognition technology also enters the era of scale application.
Because text line input has higher input efficiency than single character input, and a user can write according to daily handwriting style and habit, a common key technology for automatic recognition of handwriting input based on text lines is how to correctly segment single characters in the text lines so as to perform character recognition processing by using a single character recognition technology.
The traditional segmentation model is to perform segmentation judgment based on the end position of each stroke, and because languages of different countries have different writing characteristics, for example, when arabic is written, each letter has a single-writing and continuous-writing score, in a handwritten form, a word can be written by only one stroke from beginning to end, as shown in fig. 1. For the handwritten text, when the handwritten text is cut, the word cannot enter a traditional cutting model for judgment, and a cutting block based on a single character cannot be obtained.
Disclosure of Invention
The embodiment of the invention provides a character segmentation method and device, which can be used for accurately segmenting continuous stroke characters in a handwritten text.
Therefore, the invention provides the following technical scheme:
a method of character segmentation, the method comprising:
acquiring character handwriting;
determining characteristic information of the character handwriting, wherein the characteristic information comprises: a baseline of the character script;
determining an intersection point of the character track and a base line of the character track, and taking the intersection point as pre-estimated segmentation information;
determining an actual segmentation point according to the estimated segmentation information and a pre-constructed segmentation model;
and segmenting the character handwriting according to the actual segmentation point to obtain a segmentation result.
Optionally, the character script is a character script input line-sequentially; and the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the Y axis.
Optionally, determining the baseline of the character script comprises:
projecting the character handwriting to a Y axis, and obtaining a statistical histogram according to the projection, wherein the statistical histogram records the number of coordinate points in each interval of the Y axis;
and determining the interval with the maximum number of coordinate points on the Y axis according to the statistical histogram, and taking the mean line of the interval as the baseline of the character handwriting.
Optionally, the character scripts are character scripts input in a column sequence; the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the X axis.
Optionally, determining the baseline of the character script comprises:
projecting the character handwriting to an X axis, and obtaining a statistical histogram according to the projection, wherein the statistical histogram records the number of coordinate points in each interval of the X axis;
and determining the interval with the maximum number of coordinate points on the X axis according to the statistical histogram, and taking the average line of the interval as the baseline of the character handwriting.
Optionally, the feature information further includes: the lowest line and the highest line of the character handwriting; the lowest line of the character handwriting is a fitting straight line connecting the local minimum coordinate points of the Y value or the X value in the character handwriting; the highest line of the character handwriting is a fitting straight line which is connected with the local maximum coordinate point of the Y value or the X value in the character handwriting;
and determining the interval with the maximum number of coordinate points on the Y axis or the X axis according to the lowest line, the highest line and the statistical histogram.
Optionally, the method further comprises: pre-constructing the segmentation model by:
collecting continuous handwriting data as a training sample, and labeling segmentation points of the training sample;
determining characteristic information of each training sample; the characteristic information includes: a baseline of the training sample;
determining the intersection point of the training sample and the base line of the training sample, and taking the intersection point as pre-estimated segmentation information;
and training by using the pre-estimated segmentation information and the labeling information to obtain the segmentation model.
Optionally, the segmentation model is a regression model or a classification model.
Optionally, the method further comprises:
pre-constructing cutting models aiming at different language categories;
determining the current language category before acquiring the character handwriting;
and acquiring a cutting model corresponding to the current language category.
Optionally, the user input language category is arabic; the pre-estimated segmentation information further comprises: and each local lowest point of the character handwriting is a certain step range along the X-axis or Y-axis direction.
A character segmentation apparatus, the apparatus comprising:
the receiving module is used for acquiring character handwriting;
a characteristic information determination module, configured to determine characteristic information of the character script, where the characteristic information includes: a baseline of the character script;
the pre-estimation module is used for determining an intersection point of the character track and a base line thereof and taking the intersection point as pre-estimation segmentation information;
the segmentation point determining module is used for determining an actual segmentation point according to the estimated information and a pre-constructed segmentation model;
and the output module is used for segmenting the character handwriting according to the actual segmentation point to obtain a segmentation result.
Optionally, the character script is a character script input line-sequentially; and the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the Y axis.
Optionally, the characteristic information determining module includes:
a baseline determining unit, configured to determine a baseline of the character script; the baseline determination unit includes:
the histogram generation unit is used for projecting the character handwriting to a Y axis and obtaining a statistical histogram according to the projection, and the statistical histogram records the number of coordinate points in each interval of the Y axis;
and the statistical unit is used for determining the interval with the maximum number of coordinate points on the Y axis according to the statistical histogram and taking the mean line of the interval as the base line of the character handwriting.
Optionally, the character scripts are character scripts input in a column sequence; the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the X axis.
Optionally, the characteristic information determining module includes:
a baseline determining unit, configured to determine a baseline of the character script; the baseline determination unit includes:
the histogram generation unit is used for projecting the character handwriting to an X axis and obtaining a statistical histogram according to the projection, and the statistical histogram records the number of coordinate points in each interval of the X axis;
and the statistical unit is used for determining the interval with the maximum number of coordinate points on the X axis according to the statistical histogram and taking the mean line of the interval as the base line of the character handwriting.
Optionally, the feature information further includes: the lowest line and the highest line of the character handwriting; the lowest line of the character handwriting is a fitting straight line connecting the local minimum coordinate points of the Y value or the X value in the character handwriting; the highest line of the character handwriting is a fitting straight line which is connected with the local maximum coordinate point of the Y value or the X value in the character handwriting;
and the statistical unit determines the interval with the maximum number of coordinate points on the Y axis or the X axis according to the lowest line, the highest line and the statistical histogram.
Optionally, the apparatus further comprises: the model construction module is used for constructing the segmentation model in advance; the model building module comprises:
the data acquisition unit is used for acquiring continuous handwriting data as a training sample and marking the segmentation points of the training sample;
the characteristic determining unit is used for determining the characteristic information of each training sample; the characteristic information includes: a baseline of the training sample;
the pre-estimation unit is used for determining the intersection point of the training sample and the base line of the training sample, and taking the intersection point as pre-estimation segmentation information;
and the training unit is used for training by utilizing the pre-estimated segmentation information and the labeling information to obtain the segmentation model.
Optionally, the segmentation model is a regression model or a classification model.
Optionally, the model building module pre-builds segmentation models for different language categories; the device further comprises:
the language type determining module is used for determining the current language type before the receiving module acquires the character handwriting;
and the segmentation model acquisition module is used for acquiring the segmentation model corresponding to the current language category.
Optionally, the user input language category is arabic;
the pre-estimation module is further configured to obtain each local lowest point of the character handwriting, and use each local lowest point as pre-estimation segmentation information, where the local minimum point is a certain step length range along an X-axis or a Y-axis direction.
A computer device, comprising: one or more processors, memory;
the memory is configured to store computer-executable instructions and the processor is configured to execute the computer-executable instructions to implement the method described above.
A readable storage medium having stored thereon instructions which are executed to implement the foregoing method.
The character segmentation method and the device provided by the embodiment of the invention determine the characteristic information of the character handwriting for the obtained character handwriting aiming at the writing characteristics of a plurality of character continuous writings in a word when some languages write, the characteristic information comprises the base line of the character handwriting, then determine the intersection point of the character track and the base line, take the intersection point as the pre-estimated segmentation information, determine the actual segmentation point, namely the optimal segmentation position in each continuous character string by utilizing the pre-constructed segmentation model and the pre-estimated segmentation information, and segment the character handwriting according to the actual segmentation point to obtain the segmentation result. The scheme of the invention can obtain a better segmentation model even under the condition of lacking of continuous data samples, has simple and convenient determination of characteristic information, can meet the segmentation requirements of various different languages, and provides accurate and effective segmentation results for handwriting recognition of different languages.
Drawings
In order to more clearly illustrate the embodiments of the present application or technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is an example of word-stroke written text;
FIG. 2 is a flow chart of a character segmentation method according to an embodiment of the present invention;
FIG. 3 is a flow chart of the construction of a segmentation model in an embodiment of the present invention;
FIG. 4 is another flow chart of a character segmentation method according to an embodiment of the present invention;
FIG. 5 is a block diagram of a character segmentation apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a model building module in an embodiment of the invention;
FIG. 7 is another block diagram of the character segmentation apparatus according to the embodiment of the present invention;
FIG. 8 is a block diagram illustrating an apparatus for a character segmentation method in accordance with an exemplary embodiment;
fig. 9 is a schematic structural diagram of a server in an embodiment of the present invention.
Detailed Description
In order to make the technical field of the invention better understand the scheme of the embodiment of the invention, the embodiment of the invention is further described in detail with reference to the drawings and the implementation mode.
Aiming at the writing characteristics of a plurality of characters in a word in writing of some languages, the embodiment of the invention provides a character segmentation method and a character segmentation device, for the obtained character handwriting, determining the characteristic information of the character handwriting, wherein the characteristic information comprises the base line of the character handwriting, then determining the intersection point of the character trajectory and the base line, and taking the intersection point as the pre-estimated segmentation information; and determining actual segmentation points by utilizing a pre-constructed segmentation model and the pre-estimated segmentation information, and segmenting the character handwriting according to the actual segmentation points to obtain segmentation results, namely segmentation blocks corresponding to the single character.
As shown in fig. 2, it is a flowchart of a character segmentation method according to an embodiment of the present invention, and the method includes the following steps:
step 201, acquiring character handwriting.
The character handwriting can be acquired online in real time, or acquired offline through an image recognition technology, and the embodiment of the invention is not limited.
In addition, the character handwriting can be character handwriting input in a row-by-row mode, such as western language, or character handwriting input in a column-by-column mode, such as Mongolian, the writing habit is vertically written from top to bottom and from left to right, and all letters in each word are continuously written to form a vertical trunk line.
It should be noted that, because the character handwriting contains some noises, the jitter of the strokes, the writing speed, etc., may interfere with the subsequent segmentation process. Therefore, in practical application, the collected data sequence corresponding to the character handwriting can be subjected to denoising processing, for example, the existing denoising technologies such as gaussian filtering are adopted. In addition, considering the balance of the distribution of the sampling points of the character handwriting and the free writing of a user during writing, the data sequence can be subjected to resampling, inclination correction and other processing, for example, a proximity interpolation method, a bilinear interpolation method and the like can be specifically adopted in the resampling technology, and a Hough transformation method can be specifically utilized in the inclination correction technology, so that the obliquely written character segmentation is realized.
And step 202, determining characteristic information of the character handwriting.
The characteristic information includes: the baseline of the character script may further include: the lowest line and the highest line of the character script.
As mentioned above, the character scripts may be character scripts that are input in series in rows or columns.
For character handwriting input continuously in rows, the lowest line is a fitting straight line connecting local minimum coordinate points of Y values in the character handwriting; the highest line is a fitting straight line connecting local maximum coordinate points of Y values in the character handwriting; and the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the Y axis. When the baseline is determined, the character handwriting can be projected to the Y axis, a statistical histogram is obtained according to the projection, and the statistical histogram records the number of coordinate points in each interval of the Y axis; and then determining an interval with the maximum number of coordinate points on the Y axis according to the statistical histogram, and taking the mean line of the interval as the baseline of the character handwriting.
For character handwriting input continuously in columns, the lowest line is a straight line connecting local minimum coordinate points of X values in the character handwriting; the highest line is a straight line connecting the local maximum coordinate points of the X value in the character handwriting; the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the X axis. When the baseline is determined, the character handwriting can be projected to an X axis, a statistical histogram is obtained according to the projection, and the statistical histogram records the number of coordinate points in each interval of the X axis; and then determining an interval with the maximum number of X-axis projection coordinate points according to the statistical histogram, and taking the interval as a baseline of the character handwriting.
It should be noted that there may be a plurality of local lowest points and a plurality of local highest points in the writing track, and the local is a set step length along the X-axis or Y-axis direction. When determining the highest line and the lowest line, the highest line and the lowest line can be obtained by straight line fitting through local lowest points and highest points in the writing track.
In addition, when determining the projection interval of the character handwriting on the Y axis or the X axis, the position of the base line can be determined more accurately by means of the highest line and the lowest line.
Step 203, determining the intersection point of the character track and the base line thereof, and using the intersection point as the pre-estimated segmentation information.
And 204, determining an actual segmentation point according to the estimated segmentation information and a pre-constructed segmentation model.
The segmentation model needs to be constructed in advance, a regression model or a classification model can be adopted, and the topological structure of the segmentation model can be a neural network, such as a convolutional neural network. The specific construction process of the segmentation model will be described in detail later.
Taking a regression model as an example, when determining an actual segmentation point by using the segmentation model, the coordinates of each point in the estimated segmentation information may be sequentially input into the segmentation model, the probability of each point is obtained according to the output of the segmentation model, and if the probability is greater than a set threshold, the point is determined to be the actual segmentation point.
And step 205, segmenting the character handwriting according to the actual segmentation point to obtain a segmentation result.
And the segmentation result is the segmentation block corresponding to the single character.
The character segmentation method provided by the embodiment of the invention is used for determining the characteristic information of the character handwriting for the obtained character handwriting aiming at the writing characteristics of a plurality of characters in a word in writing of some languages, wherein the characteristic information comprises the base line of the character handwriting, then determining the intersection point of the character track and the base line thereof, and taking the intersection point as the pre-estimated segmentation information; and determining actual segmentation points, namely the optimal segmentation positions in each continuous stroke character string, by utilizing a pre-constructed segmentation model and the pre-estimated segmentation information, and segmenting the character handwriting according to the actual segmentation points to obtain segmentation results. The scheme of the invention can obtain a better segmentation model even under the condition of lacking of continuous data samples, has simple and convenient determination of the pre-estimated segmentation information, can be suitable for the segmentation requirements of various different languages, and provides accurate and effective segmentation results for the handwriting recognition of different languages.
The character segmentation method provided by the embodiment of the invention can be applied to segmentation processing of various different languages, such as English, French, Italian, Spanish, Arabic and the like.
It should be noted that, in practical application, corresponding segmentation models can be constructed for language types having common writing characteristics, and also can be constructed for different languages.
As shown in fig. 3, it is a flow chart of constructing a segmentation model in the embodiment of the present invention, and the flow chart includes the following steps:
step 301, collecting continuous handwriting data as a training sample, and labeling the segmentation points of the training sample.
Step 302, determining characteristic information of each training sample; the characteristic information includes: the base line of the training sample may further include: the lowest line and the highest line of the training sample.
The meanings of the lowest line, the highest line, and the baseline are described in detail above and will not be repeated herein.
Step 303, determining an intersection point of the training sample and the baseline thereof, and using the intersection point as pre-estimated segmentation information.
And 304, training by using the estimated segmentation information and the labeling information to obtain a segmentation model.
During training, the output of the segmentation model, namely the intersection point of the continuous stroke connecting two characters and the base line, is compared with the marked actual segmentation point, and the objective function of the model is argmin (abs (intersection point coordinate-real segmentation coordinate)), so that the segmentation model is obtained.
It should be noted that, during the training of the segmentation model, information of the lowest line and the highest line of the training sample may also be added, or line height information calculated by using the lowest line and the highest line may be calculated, and the information may be used to assist the determination of the segmentation.
In addition, because different languages have the characteristic of being unique to some languages besides the common characteristic of continuous writing among different characters, the estimated segmentation information can also be added with the characteristic of being unique to the language in the training process of the segmentation model, so that the segmentation model obtained by training can have better segmentation effect.
For example, when arabic is written, the ending stroke of arabic generally has a downward-stroke trend, so each local lowest point of the character handwriting can be used as one of the pre-estimated segmentation information, and the segmentation model is obtained by training together with the aforementioned intersection point of the character track and the baseline thereof. For character handwriting input continuously in lines, the local part is a certain step range along the X-axis direction; for character scripts that are input consecutively in columns, the local part is a certain step range along the Y-axis direction.
By using the construction mode, the segmentation model with good effect can be obtained even under the condition of little training sample data.
In addition, there are some languages with special lexical rules, such as french, in which a few monosyllabic words ending with vowel letters, such as ce, la, le, ne, etc., when encountering a word beginning with vowel or mute h, the monosyllabic word is combined with the initial vowel of the following word to read a syllable, and the reason letter of the monosyllabic word end is replaced by a syllable apostrophe "'", such as ce encountering est to become c' est; le encounters tudiant and becomes l' tudiant. For the situation, the syllable apostrophe "'" needs to be cut apart from the preceding letter, and therefore, after the collected character handwriting is cut by the scheme of the invention in a continuous stroke manner, the character handwriting is cut by a conventional cutting method, and a final cutting result can be obtained.
As mentioned above, in practical applications, corresponding segmentation models can be respectively constructed for different languages, and accordingly, when the obtained character handwriting is segmented, which language the character handwriting corresponds to needs to be known, and then the segmentation model corresponding to the language category is selected, so as to obtain a better segmentation effect. If the segmentation is online, determining the current input language category of the user according to the trigger signal of the user to the corresponding key; if the character handwriting is cut off line, the language category corresponding to the character handwriting can be determined manually.
The following description will be given by taking an on-line cut as an example.
As shown in fig. 4, another flowchart of the character segmentation method according to the embodiment of the present invention includes the following steps:
step 401, determining the current input language category of the user.
In the user input device, selection keys for different languages, which may be physical keys or virtual keys, may be set, and the current input language category of the user may be determined according to the trigger signal of the corresponding key.
Step 402, acquiring a character script input by a user.
The character handwriting input by the user can be character handwriting input in a row-by-row mode, such as western language, or character handwriting input in a column-by-column mode, such as Mongolian, the writing habit is that the character handwriting is vertically written from top to bottom and from left to right, and all letters in each word are continuously written to form a vertical trunk line.
Step 403, determining characteristic information of the character handwriting, where the characteristic information includes: the base line of the character script can also comprise the lowest line and the highest line of the character script.
The meanings of the lowest line, the highest line, and the baseline are described in detail above and will not be repeated herein.
And step 404, determining an intersection point of the character track and the baseline thereof, and taking the intersection point as pre-estimated segmentation information.
Step 405, obtaining a segmentation model corresponding to the current input language category of the user.
And 406, determining an actual segmentation point according to the estimated segmentation information and the segmentation model.
And 407, segmenting the character handwriting according to the actual segmentation point to obtain a segmentation result.
It should be noted that, the operation of obtaining the segmentation model corresponding to the language category currently input by the user in step 405 may be performed before or after step 403, which is not limited in this embodiment of the present invention.
In addition, it should be noted that, in practical applications, the method of the embodiment of the present invention may be applied to a system for performing segmentation on one or more languages, and the embodiment of the present invention is not limited thereto.
Correspondingly, an embodiment of the present invention further provides a character segmentation apparatus, as shown in fig. 5, which is a structural block diagram of the apparatus.
In this embodiment, the apparatus includes the following modules:
a receiving module 501, configured to obtain a character script; specifically, the receiving module 501 may collect the character handwriting input by the user online in real time, or may obtain the character handwriting through an offline image recognition technology;
a characteristic information determining module 502, configured to determine characteristic information of the character script, where the characteristic information includes: the base line of the character handwriting further comprises a high-low line and a highest line of the character handwriting;
the pre-estimation module 503 is configured to determine an intersection point of the character trajectory and a baseline thereof, and use the intersection point as pre-estimation segmentation information;
a segmentation point determination module 504, configured to determine an actual segmentation point according to the pre-estimated segmentation information and a pre-constructed segmentation model;
and the output module 505 is configured to segment the character handwriting according to the actual segmentation point to obtain a segmentation result.
In the embodiment of the invention, the character scripts may be character scripts which are input in line or column series.
For character handwriting input continuously in rows, the lowest line is a fitting straight line connecting local minimum coordinate points of Y values in the character handwriting; the highest line is a fitting straight line connecting local maximum coordinate points of Y values in the character handwriting; and the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the Y axis.
Accordingly, the characteristic information determination module may include a baseline determination unit, and further may further include: a lowest line determination unit and a highest line determination unit. Wherein:
the lowest line determining unit is used for determining the lowest line of the character handwriting; specifically, the straight line fitting can be carried out by utilizing the local lowest point in the writing track;
the top line determining unit is used for determining the top line of the character handwriting; specifically, the writing track can be obtained by performing straight line fitting by using the local highest point in the writing track;
the base line determining unit is used for determining a base line of the character handwriting; the baseline determination unit includes:
the histogram generation unit is used for projecting the character handwriting to a Y axis and obtaining a statistical histogram according to the projection, and the statistical histogram records the number of coordinate points in each interval of the Y axis;
and the statistical unit is used for determining the interval with the maximum number of coordinate points on the Y axis according to the statistical histogram and taking the mean line of the interval as the base line of the character handwriting.
For character handwriting input continuously in columns, the lowest line is a straight line connecting local minimum coordinate points of X values in the character handwriting; the highest line is a straight line connecting the local maximum coordinate points of the X value in the character handwriting; the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the X axis.
Accordingly, the characteristic information determination module may include a baseline determination unit, and further may further include: a lowest line determination unit and a highest line determination unit. Wherein:
the lowest line determining unit is used for determining the lowest line of the character handwriting; specifically, the straight line fitting can be carried out by utilizing the local lowest point in the writing track;
the top line determining unit is used for determining the top line of the character handwriting; specifically, the writing track can be obtained by performing straight line fitting by using the local highest point in the writing track;
the base line determining unit is used for determining a base line of the character handwriting; the baseline determination unit includes:
the histogram generation unit is used for projecting the character handwriting to an X axis and obtaining a statistical histogram according to the projection, and the statistical histogram records the number of coordinate points in each interval of the X axis;
and the statistical unit is used for determining the interval with the maximum number of projection coordinate points on the X axis according to the statistical histogram and taking the mean line of the interval as the base line of the character handwriting.
The segmentation model can be obtained by training the corresponding model building module according to the acquired training data in advance. The model building module may be a part of the apparatus of the present invention, or may be set as an independent entity independently from the apparatus of the present invention, which is not limited to this embodiment of the present invention.
The segmentation model may be a regression model or a classification model, and the topology may be a neural network, such as a convolutional neural network. Moreover, in practical application, the model building module can build corresponding segmentation models for language types with common writing characteristics, and can also build corresponding segmentation models for different languages respectively.
As shown in fig. 6, it is a schematic structural diagram of a model building module in the embodiment of the present invention, and includes the following units:
the data acquisition unit 61 is used for acquiring continuous handwriting data as a training sample and marking the segmentation points of the training sample;
a feature determination unit 62 for determining feature information of each training sample; the characteristic information includes: the training sample baseline can further comprise the lowest line and the highest line of the training sample;
the pre-estimation unit 63 is configured to determine an intersection point of the training sample and the baseline thereof, and use the intersection point as pre-estimation segmentation information;
and the training unit 64 is used for training by using the pre-estimated segmentation information and the labeling information to obtain the segmentation model.
Because different languages have the characteristic of being unique per se besides the common characteristic of continuous writing among different characters, in the practical application, in the process of training the segmentation model, the estimated segmentation information can be added with the characteristic of being unique per se of the language, so that the segmentation model obtained by training can have a better segmentation effect.
For example, when arabic is written, the ending stroke of arabic generally has a downward-stroke trend, so each local lowest point of the training sample can also be used as one of the pre-estimated segmentation information, and the segmentation model is obtained by training together with the aforementioned intersection point of the training sample and its baseline. For character handwriting input continuously in lines, the local part is a certain step range along the X-axis direction; for character scripts that are input consecutively in columns, the local part is a certain step range along the Y-axis direction.
Correspondingly, when the arabic character handwriting is sliced, the pre-estimation module 503 not only needs to obtain the intersection point of the character trajectory and the baseline thereof, but also can obtain each local lowest point of the character handwriting, and uses the intersection points and each local lowest point as pre-estimation segmentation information, i.e. predicted segmentation points, and uses the segmentation model to sequentially check whether each pre-estimation segmentation point is a real segmentation point, so as to obtain an actual segmentation point.
The character segmentation device provided by the embodiment of the invention determines the characteristic information of the character handwriting for the obtained character handwriting aiming at the writing characteristics of a plurality of characters in a word in writing of some languages, wherein the characteristic information comprises the base line of the character handwriting, then determines the intersection point of the character track and the base line thereof, and takes the intersection point as the pre-estimated segmentation information; and determining actual segmentation points, namely the optimal segmentation positions in each continuous stroke character string, by utilizing a pre-constructed segmentation model and the pre-estimated segmentation information, and segmenting the character handwriting according to the actual segmentation points to obtain segmentation results. The scheme of the invention can obtain a better segmentation model even under the condition of lacking of continuous data samples, has simple and convenient determination of the pre-estimated segmentation information, can be suitable for the segmentation requirements of various different languages, and provides accurate and effective segmentation results for the handwriting recognition of different languages.
The character segmentation device provided by the embodiment of the invention can be applied to segmentation processing of a plurality of different languages, such as English, French, Italian, Spanish and Arabic.
Fig. 7 is a block diagram of another structure of the character segmentation apparatus according to the embodiment of the present invention.
Unlike the embodiment shown in fig. 5, in this embodiment, the apparatus further includes: a language category determination module 506 and a segmentation model acquisition module 507. Wherein:
the language type determining module 506 is configured to determine a current input language type of the user before the receiving module 501 obtains the character handwriting;
the segmentation model obtaining module 507 is configured to obtain a segmentation model corresponding to the current input language category of the user. The segmentation model may be obtained before or after the receiving module 501 obtains the character handwriting, which is not limited in this embodiment of the present invention.
It should be noted that, in practical applications, selection keys for different languages may be set in the user input device, specifically, the selection keys may be physical keys or virtual keys, and the language category determining module 505 may sense a trigger signal of a corresponding key, and determine a current input language category of the user according to the trigger signal. Further, the key may also be part of the device of the present invention.
The character segmentation device provided by the embodiment of the invention respectively constructs the segmentation models corresponding to the languages based on the characteristics of the bookends of different languages, and correspondingly selects the segmentation models corresponding to the currently input language categories according to the different currently input language categories of the user during segmentation, so that a better segmentation effect can be obtained. The device can be suitable for the segmentation requirements of various different languages, and provides accurate and effective segmentation results for handwriting recognition of different languages.
By utilizing the method and the device provided by the embodiment of the invention, a user can continuously write in one line or one column in one handwriting area and can also write in multiple lines or multiple columns, the next character can be written without waiting after one character is written, and continuous writing can be performed among different characters, so that the handwriting input speed of the user can be greatly improved.
Fig. 8 is a block diagram illustrating an apparatus 800 for a character segmentation method in accordance with an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 806 provides power to the various components of device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the key press false touch correction method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present invention further provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a mobile terminal, enable the mobile terminal to perform some or all of the steps in the foregoing method embodiments of the present invention.
Fig. 9 is a schematic structural diagram of a server in an embodiment of the present invention. The server 1900, which may vary widely in configuration or performance, may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) that store applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
Embodiments of the present invention also provide a non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an apparatus, enable the apparatus to perform some or all of the steps in the above-described method embodiments.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A character segmentation method is characterized by comprising the following steps:
acquiring character handwriting;
determining characteristic information of the character handwriting, wherein the characteristic information comprises: a baseline of the character script;
determining an intersection point of the character track and a base line of the character track, and taking the intersection point as pre-estimated segmentation information;
determining an actual segmentation point according to the estimated segmentation information and a pre-constructed segmentation model;
and segmenting the character handwriting according to the actual segmentation point to obtain a segmentation result.
2. The method according to claim 1, wherein the character script is a character script that is input line-sequentially; and the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the Y axis.
3. The method of claim 2, wherein determining the baseline for the character script comprises:
projecting the character handwriting to a Y axis, and obtaining a statistical histogram according to the projection, wherein the statistical histogram records the number of coordinate points in each interval of the Y axis;
and determining the interval with the maximum number of coordinate points on the Y axis according to the statistical histogram, and taking the mean line of the interval as the baseline of the character handwriting.
4. The method according to claim 1, wherein the character script is a character script that is input consecutively in columns; the base line is the average line of the interval with the maximum number of the projection coordinate points of the character handwriting on the X axis.
5. The method of claim 4, wherein determining the baseline for the character script comprises:
projecting the character handwriting to an X axis, and obtaining a statistical histogram according to the projection, wherein the statistical histogram records the number of coordinate points in each interval of the X axis;
and determining the interval with the maximum number of coordinate points on the X axis according to the statistical histogram, and taking the average line of the interval as the baseline of the character handwriting.
6. The method of claim 1, further comprising: pre-constructing the segmentation model by:
collecting continuous handwriting data as a training sample, and labeling segmentation points of the training sample;
determining characteristic information of each training sample; the characteristic information includes: a baseline of the training sample;
determining the intersection point of the training sample and the base line of the training sample, and taking the intersection point as pre-estimated segmentation information;
and training by using the pre-estimated segmentation information and the labeling information to obtain the segmentation model.
7. The method of claim 6, further comprising:
pre-constructing cutting models aiming at different language categories;
determining the current language category before acquiring the character handwriting;
and acquiring a cutting model corresponding to the current language category.
8. A character segmentation apparatus, characterized in that the apparatus comprises:
the receiving module is used for acquiring character handwriting;
a characteristic information determination module, configured to determine characteristic information of the character script, where the characteristic information includes: a baseline of the character script;
the pre-estimation module is used for determining an intersection point of the character track and a base line thereof and taking the intersection point as pre-estimation segmentation information;
the segmentation point determining module is used for determining an actual segmentation point according to the estimated information and a pre-constructed segmentation model;
and the output module is used for segmenting the character handwriting according to the actual segmentation point to obtain a segmentation result.
9. A computer device, comprising: one or more processors, memory;
the memory is for storing computer-executable instructions, and the processor is for executing the computer-executable instructions to implement the method of any one of claims 1 to 7.
10. A readable storage medium having stored thereon instructions that are executed to implement the method of any one of claims 1 to 7.
CN201810975715.7A 2018-08-24 2018-08-24 Character segmentation method and device Pending CN110858291A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810975715.7A CN110858291A (en) 2018-08-24 2018-08-24 Character segmentation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810975715.7A CN110858291A (en) 2018-08-24 2018-08-24 Character segmentation method and device

Publications (1)

Publication Number Publication Date
CN110858291A true CN110858291A (en) 2020-03-03

Family

ID=69635733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810975715.7A Pending CN110858291A (en) 2018-08-24 2018-08-24 Character segmentation method and device

Country Status (1)

Country Link
CN (1) CN110858291A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563450A (en) * 2020-04-30 2020-08-21 北京百度网讯科技有限公司 Data processing method, device, equipment and storage medium
CN113095171A (en) * 2021-03-29 2021-07-09 Oppo广东移动通信有限公司 Method and device for recognizing written characters, electronic equipment and storage medium
WO2022087847A1 (en) * 2020-10-27 2022-05-05 京东方科技集团股份有限公司 Handwritten text recognition method, apparatus and system, handwritten text search method and system, and computer-readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563450A (en) * 2020-04-30 2020-08-21 北京百度网讯科技有限公司 Data processing method, device, equipment and storage medium
CN111563450B (en) * 2020-04-30 2023-09-26 北京百度网讯科技有限公司 Data processing method, device, equipment and storage medium
WO2022087847A1 (en) * 2020-10-27 2022-05-05 京东方科技集团股份有限公司 Handwritten text recognition method, apparatus and system, handwritten text search method and system, and computer-readable storage medium
US11823474B2 (en) 2020-10-27 2023-11-21 Boe Technology Group Co., Ltd. Handwritten text recognition method, apparatus and system, handwritten text search method and system, and computer-readable storage medium
CN113095171A (en) * 2021-03-29 2021-07-09 Oppo广东移动通信有限公司 Method and device for recognizing written characters, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11455491B2 (en) Method and device for training image recognition model, and storage medium
CN107291704B (en) Processing method and device for processing
CN104808794A (en) Method and system for inputting lip language
CN107564526B (en) Processing method, apparatus and machine-readable medium
CN109471919B (en) Zero pronoun resolution method and device
EP4273742A1 (en) Handwriting recognition method and apparatus, electronic device, and medium
CN109992124B (en) Input method, apparatus and machine readable medium
CN110968246A (en) Intelligent Chinese handwriting input recognition method and device
CN110858291A (en) Character segmentation method and device
CN113918030B (en) Handwriting input method and device for handwriting input
CN113936697B (en) Voice processing method and device for voice processing
CN110554780A (en) sliding input method and device
CN111382598B (en) Identification method and device and electronic equipment
CN112381091A (en) Video content identification method and device, electronic equipment and storage medium
CN114067334B (en) Handwriting track recognition method and device, electronic equipment and storage medium
CN110858317B (en) Handwriting recognition method and device
CN114154467B (en) Structure picture restoration method, device, electronic equipment, medium and program product
CN110931013B (en) Voice data processing method and device
CN113885713A (en) Method and device for generating handwriting formula
CN111722727B (en) Model training method applied to handwriting input, handwriting input method and device
CN107643821B (en) Input control method and device and electronic equipment
CN113220208B (en) Data processing method and device and electronic equipment
CN113869303B (en) Image processing method, device and medium
CN115543099A (en) Input method, device and device for input
CN114241488A (en) Data labeling method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200303