CN109002756A - Handwritten Chinese character image recognition methods, device, computer equipment and storage medium - Google Patents

Handwritten Chinese character image recognition methods, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109002756A
CN109002756A CN201810564691.6A CN201810564691A CN109002756A CN 109002756 A CN109002756 A CN 109002756A CN 201810564691 A CN201810564691 A CN 201810564691A CN 109002756 A CN109002756 A CN 109002756A
Authority
CN
China
Prior art keywords
image
chinese character
obtains
handwritten
handwritten chinese
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.)
Withdrawn
Application number
CN201810564691.6A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810564691.6A priority Critical patent/CN109002756A/en
Priority to PCT/CN2018/094222 priority patent/WO2019232850A1/en
Publication of CN109002756A publication Critical patent/CN109002756A/en
Withdrawn legal-status Critical Current

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • 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
    • 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/36Matching; Classification
    • 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/28Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet
    • G06V30/287Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet of Kanji, Hiragana or Katakana characters

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Character Discrimination (AREA)

Abstract

It includes: acquisition original image that the present invention, which discloses a kind of handwritten Chinese character image recognition methods, device, computer equipment and storage medium, the handwritten Chinese character image recognition methods, and the original image includes handwritten Chinese character and background picture;The original image is pre-processed, effective image is obtained;The effective image is handled using Density Estimator algorithm, removes background picture, obtains the target image including the handwritten Chinese character;Single font cutting is carried out to the target image using vertical projection method, obtains single font image to be identified;It is input to the single font image carry out sequence mark to be identified, and by the single font image to be identified marked based on being identified in the long target handwritten word identification model of Memory Neural Networks in short-term, obtains the corresponding handwritten Chinese character of single font image to be identified.The handwritten word image recognition processes can effectively identify similar and complicated Chinese character, improve the recognition accuracy of handwritten word image.

Description

Handwritten Chinese character image recognition methods, device, computer equipment and storage medium
Technical field
The present invention relates to field of image recognition more particularly to a kind of handwritten Chinese character image recognition methods, device, computers to set Standby and storage medium.
Background technique
Since the classification of Chinese character is various, such as " Song typeface, regular script, Yao's body and imitation Song-Dynasty-style typeface ".Wherein, the structure of some Chinese characters compares Complexity, such as " Chi, evil spirit ", and there is the similar words of more structure in Chinese character, such as " by and love ".To standard, book Simple and specification sentence is write, can be identified using OCR (optical character identification) technology, but for the sentence of hand-written word composition Son, due to everyone writing style is not identical and not be standard Philosophy composition Chinese character, identified using OCR technique When, can there is a situation where identification inaccuracy, for Chinese character that is some similar and not being made of simple stroke, it may appear that know The case where other accuracy rate reduces, influences the recognition effect of handwritten Chinese character.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of handwritten Chinese character image recognition methods, device, calculating Machine equipment and storage medium.
A kind of handwritten Chinese character image recognition methods, comprising:
Original image is obtained, the original image includes handwritten Chinese character and background picture;
The original image is pre-processed, effective image is obtained;
It is handled using Density Estimator algorithm and to the effective image, removes the background picture, acquisition includes The target image of the handwritten Chinese character;
Single font cutting is carried out to the target image using vertical projection method, obtains single font image to be identified;
The single font image to be identified is input to the target handwritten word based on long Memory Neural Networks in short-term and identifies mould It is identified in type, obtains the corresponding handwritten Chinese character of single font image to be identified.
A kind of handwritten Chinese character image identification device, comprising:
Original image obtains module, and for obtaining original image, the original image includes handwritten Chinese character and background picture;
Effective image obtains module, for pre-processing to the original image, obtains effective image;
Target image obtains module, for being handled using Density Estimator algorithm the effective image, obtains and protects Stay the target image of the handwritten Chinese character;
Single font image collection module to be identified, at using Density Estimator algorithm and to the effective image Reason removes the background picture, obtains the target image including the handwritten Chinese character;
Handwritten Chinese character obtains module, for being input to the single font image to be identified based on long short-term memory nerve net It is identified in the target handwritten word identification model of network, obtains the corresponding handwritten Chinese character of single font image to be identified.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing The computer program run on device, the processor realize above-mentioned handwritten Chinese character image identification side when executing the computer program The step of method.
A kind of non-volatile memory medium, the non-volatile memory medium are stored with computer program, the computer The step of above-mentioned handwritten Chinese character image recognition methods is realized when program is executed by processor.
Above-mentioned handwritten Chinese character image recognition methods, device, computer equipment and storage medium, first obtain original image, with Just original image is pre-processed, obtains effective image.Effective image is handled using Density Estimator algorithm, is removed Background picture obtains image only comprising handwritten Chinese character, further exclusive PCR.Target image is carried out using vertical projection method Single font cutting, obtains single font image to be identified, easy to accomplish.Then, single font image to be identified is input to based on length It is identified in the target handwritten word identification model of short-term memory neural network, so that single font image has timing, so that Target handwritten word identification model from the context can be identified, the corresponding handwritten Chinese character of single font image to be identified is obtained, The identification for improving handwritten word image is accurate.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is an application scenario diagram of handwritten Chinese character image recognition methods in one embodiment of the invention;
Fig. 2 is a flow chart of handwritten Chinese character image recognition methods in one embodiment of the invention;
Fig. 3 is a specific flow chart of step S20 in Fig. 2;
Fig. 4 is a specific flow chart of step S30 in Fig. 2;
Fig. 5 is a specific flow chart of step S34 in Fig. 4;
Fig. 6 is another flow chart of handwritten Chinese character image recognition methods in one embodiment of the invention;
Fig. 7 is a specific flow chart of step S63 in Fig. 6;
Fig. 8 is a schematic diagram of handwritten Chinese character image identification device in one embodiment of the invention;
Fig. 9 is a schematic diagram of computer equipment in one embodiment of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
Handwritten Chinese character image recognition methods provided in an embodiment of the present invention, can be applicable in the application environment such as Fig. 1.The hand The application environment of writing of Chinese characters image-recognizing method includes server and computer equipment, wherein computer equipment by network with Server is communicated, and computer equipment is the equipment that can carry out human-computer interaction with user, including but not limited to computer, intelligent hand The equipment such as machine and plate.Handwritten Chinese character image recognition methods provided in an embodiment of the present invention is applied to server.
In one embodiment, it as shown in Fig. 2, providing a kind of handwritten Chinese character image recognition methods, is applied in this way in Fig. 1 In server for be illustrated, include the following steps:
S10: original image is obtained, original image includes handwritten Chinese character and background picture.
Wherein, original image is collected untreated comprising handwritten Chinese character by the acquisition module in computer equipment Image.The original image includes handwritten Chinese character and background picture.Background picture be in original image in addition to handwritten Chinese character Noise picture.Noise picture is the picture interfered to handwritten Chinese character.In the present embodiment, user can be by computer equipment Acquisition module acquisition upload onto the server comprising the original image of handwritten Chinese character so that server obtains original image.This is adopted Collection module includes but is not limited to camera shooting and local upload.
S20: pre-processing original image, obtains effective image.
Wherein, effective image is the image of the exclusive PCR factor obtained after pre-processing to original image.Specifically, Since in original image subsequent identification may be unfavorable for if color is various comprising a variety of disturbing factors.Therefore it needs to original Image is pre-processed, and to obtain the effective image of exclusive PCR factor, which can be understood as original image exclusion The picture obtained after background picture.
In one embodiment, as shown in figure 3, pre-processing to original image in step S20, effective image is obtained, Specifically comprise the following steps:
S21: amplifying original image and gray processing processing, obtains gray level image.
Wherein, gray level image be original image is amplified and gray processing processing after the gray level image that obtains.It should Gray level image includes a pixel matrix.Pixel matrix refers to comprising the corresponding pixel value of pixel each in original image Matrix.In the present embodiment, server reads the pixel value of each pixel in original image using imread function, and to original graph As amplifying and gray processing processing, acquisition gray level image.Imread function is the function that machine word calls the turn, and is used for Read the pixel value in image file.Pixel value is the value assigned when original image is digitized by computer.
Due to that may include multiple color in original image, and color itself, it is highly susceptible to the shadow of the factors such as illumination Ring, similar object color has many variations, so color itself is difficult to provide key message, it is therefore desirable to original image into The processing of row gray processing, with exclusive PCR, reduces the complexity and information processing capacity of image.But due to the hand-written Chinese in original image When the size of word is smaller, if directly carrying out gray processing processing, the thickness that will lead to the stroke of handwritten Chinese character is too small, can be treated as doing Item exclusion is disturbed, therefore in order to increase the thickness of strokes of characters, needs that original image is first amplified processing, then carry out at gray processing Reason causes the thickness of the stroke of handwritten Chinese character is too small to be treated as asking for distracter exclusion to avoid gray processing processing is directly carried out Topic.
Specifically, server amplifies processing: x → x to original image according to following formular, wherein x represents matrix M In element, r is number, by the element x after variationrX in replacement pixel value matrix M.
Gray processing processing is the processing that original image is showed to apparent black and white effect.Specifically, to amplified figure As the color that progress gray processing processing includes: each pixel in original image is by R (red), G (green) and B (indigo plant) three What component determined, and each component has this 256 kinds of values of 0-255 desirable (0 most secretly indicates black, 255 most bright expression whites).And it is grey Degreeization image is the special color image of the identical one kind of tri- components of R, G and B.In the present embodiment, server can be directlyed adopt Imread function reads original image, can obtain the specific of corresponding tri- components of R, G and B of each pixel in gray level image Numerical value.
S22: being standardized gray level image, obtains effective image.
Wherein, standardization refers to the conversion process that standard is carried out to gray level image, is allowed to be transformed to a fixed mark The processing of quasi- form.Specifically, since the pixel value of pixel each in gray level image is more dispersed, lead to the order of magnitude of data Disunity will affect the accuracy rate of following model identification, it is therefore desirable to be standardized gray level image, with unified number According to the order of magnitude.
Specifically, the formula of services use standardization processing is standardized gray level image, to avoid ash Pixel value relatively disperses in degreeization image, leads to the skimble-scamble problem of the order of magnitude of data.Wherein, the formula of standardization isX is the pixel value of gray level image M, and X is the pixel value of effective image, MminIt is gray processing figure As the smallest pixel value in M, MmaxIt is maximum pixel value in gray level image M.
S30: being handled effective image using Density Estimator algorithm, removes background picture, and obtaining includes the hand-written Chinese The target image of word.
Wherein, Density Estimator algorithm (kernel density estimation) is that one kind goes out from data sample itself Send out data distribution characteristics, the nonparametric technique for estimated probability density function.Target image refers to be estimated using cuclear density Calculating method carries out processing to effective image and obtains the image for including handwritten Chinese character.Specifically, server uses Density Estimator Algorithm handles effective image, to exclude background picture interference, obtains the target image including handwritten Chinese character.
Specifically, the calculation formula of Density Estimator algorithm is Wherein, K () is kernel function, and h is pixel value range, and x is the pixel value for wanting the pixel of estimated probability density, xiFor within the scope of h Ith pixel value, n are the number of the pixel value x within the scope of h,Indicate the estimated probability density of pixel.
In one embodiment, as shown in figure 4, in step S30, i.e., using Density Estimator algorithm to effective image at Reason obtains the target image including handwritten Chinese character, specifically comprises the following steps:
S31: counting the pixel value in effective image, obtains effective image histogram.
Wherein, effective image histogram is count acquired histogram to the pixel value in effective image.Histogram Figure (Histogram) is a series of a kind of statistics report for the case where longitudinal stripe or line segment form not waited by height show data distribution Accuse figure.In the present embodiment, the horizontal axis of effective image histogram indicates that pixel value, the longitudinal axis indicate the corresponding frequency of occurrences of pixel value. Server obtains effective image histogram, so as to intuitively see by counting to the pixel value in effective image The distribution situation of pixel value in effective image carries out estimation for subsequent Gaussian Kernel Density algorithm for estimating and provides technical support.
S32: being handled effective image histogram using Gaussian Kernel Density algorithm for estimating, is obtained and effective image histogram Scheme at least one corresponding frequency maximum and at least one frequency minimum.
Wherein, Gaussian Kernel Density algorithm for estimating refers to that the core that the kernel function in Density Estimator algorithm is gaussian kernel function is close Spend estimation method.The formula of gaussian kernel function isWherein, K(x)Refer to that pixel (independent variable) is the height of x This kernel function, x refer to that the pixel value in effective image, e and π are constant.Frequency maximum refers in histogram frequency distribution diagram, different Maximum on frequency separation.Frequency minimum refers in histogram frequency distribution diagram, very big with frequency on same frequency section It is worth corresponding minimum.
Specifically, the corresponding histogram frequency distribution diagram of effective image is carried out using Gaussian Kernel Density function evaluation method high This smoothing processing obtains the corresponding Gaussian smoothing curve of the histogram frequency distribution diagram.Based on the frequency on the Gaussian smoothing curve Maximum and frequency minimum, obtain frequency maximum and frequency minimum corresponds to the pixel value on horizontal axis, are based on so as to subsequent The frequency maximum and the corresponding pixel value of frequency minimum got is convenient for carrying out effective image layering cutting processing, obtains Layered image.
S33: layering cutting processing is carried out to effective image based on frequency maximum and frequency minimum, obtains hierarchical diagram Picture.
Wherein, layered image is to carry out the acquired figure of layering cutting processing to effective image based on maximum and minimum Picture.Server first obtains frequency maximum and the corresponding pixel value of frequency minimum, according to the corresponding pixel value of frequency maximum Layered shaping is carried out to effective image, how many frequency maximum in effective image, then the pixel value of corresponding effective image How many class be just divided into;Then using the corresponding pixel value of frequency minimum as the boundary value between class, according to class and class it Between boundary, to the effective image carry out layered shaping, to obtain layered image.
If the corresponding pixel value of frequency maximum in effective image is respectively 18,59,95,118 and 153, frequency is minimum Being worth corresponding pixel value is respectively 27,65,105 and 133.This can be determined according to the number of the frequency maximum in effective image The pixel value of effective image is divided into 5 classes, which is divided into 5 layers, the corresponding pixel value of frequency minimum As the boundary value between class, since the smallest pixel value is 0, maximum pixel value is 255, therefore, according to the side between class Dividing value can then determine with pixel value be 18 layered image, the corresponding pixel value of the layered image be [0,27);With pixel value For 59 layered image, the corresponding pixel value of the layered image be [27,65);The layered image for being 95 with pixel value, the layering [65,105) the corresponding pixel value of image is;The layered image for being 118 with pixel value, the corresponding pixel value of the layered image are [105,133);The layered image for being 153 with pixel value, the corresponding pixel value of the layered image are [133,255].
S34: being based on layered image, obtains the target image including handwritten Chinese character.
Server carries out binaryzation, corrosion and superposition processing after obtaining layered image, to layered image, includes to obtain The target image of handwritten Chinese character.Wherein, it is (black to refer to that the pixel value by the pixel on layered image is set as 0 for binary conversion treatment Color) or 1 (white), entire layered image is showed to the processing of apparent black and white effect.Layered image is carried out at binaryzation After reason, corrosion treatment is carried out to the layered image after binary conversion treatment, removes background picture part, retains the hand on layered image Writing of Chinese characters part.Since the pixel value on each layered image is the pixel value for belonging to different range, to layered image into After row corrosion treatment, it is also necessary to be superimposed each layered image, generate only containing the target image of handwritten Chinese character.Wherein, it is superimposed Processing refers to the treatment process by the image superposition for only remaining with hand-written character segment after layering at an image, to realize acquisition The only purpose of the target image comprising handwritten Chinese character.In the present embodiment, place is overlapped to layered image using imadd function Reason, to obtain the target image for only including handwritten Chinese character.Imadd function is the function that machine word calls the turn, for point Tomographic image is overlapped.
In one embodiment, as shown in figure 5, in step S34, that is, it is based on layered image, obtaining includes handwritten Chinese character Target image specifically comprises the following steps:
S341: binary conversion treatment is carried out to layered image, obtains binary image.
Binary image refers to the image that binary conversion treatment acquisition is carried out to partial image.Specifically, server obtains hierarchical diagram As after, sampled pixel values based on layered image and the threshold value chosen in advance are compared, and sampled pixel values are greater than or equal to The pixel value of threshold value is set as 1, less than the process that the pixel value of threshold value is set as 0.Sampled pixel values are each in layered image The corresponding pixel value of pixel.The size of threshold value will affect the effect of layered image binary conversion treatment, right when threshold value chooses suitable The effect that layered image carries out binary conversion treatment is preferable;When threshold value chooses improper, layered image binary conversion treatment will affect Effect.Simplify calculating process for operating easily, the threshold value in the present embodiment is empirically determined by developer.To point Tomographic image carries out binary conversion treatment, facilitates subsequent carry out corrosion treatment.
S342: carrying out detection label to the pixel in binary image, obtains the corresponding connected region of binary image.
Wherein, connected region refers to the adjacent pixels area defined around a certain specific pixel.In binary image Middle connected region refers to that surrounding adjacent pixels are 0, and a certain specific pixel and adjacent pixels are 1, such as certain specific pixel It is 0, surrounding adjacent pixels are 1, then will abut against pixel area defined as connected region.
Specifically, the corresponding picture element matrix of binary image, wherein including row and column.To the pixel in binary image into Row detection label specifically includes following process: (1) progressively scanning to picture element matrix, white pixel continuous in every a line It forms a sequence and is known as a group, and write down its starting point, terminal and the line number at place.(2) for other than the first row All rows in group, if all groups in it and previous row give its new label all without overlapping region;If It only has overlapping region with a group in lastrow, then the label of that group of lastrow is assigned to it;If it and lastrow 2 or more groups have overlapping region, then assign the minimum label of an associated group to current group, and by lastrow these Label write-in in group is of equal value right, illustrates that they belong to one kind.For example, if thering are 2 groups (1 and 2) to have with lastrow in the second row Overlapping region, then assign minimum label i.e. 1 in 2 groups of this lastrow, and by the label in these groups of lastrow Write-in it is of equal value to will (1,2) be denoted as it is of equal value right.Equivalence indicates the label for referring to two groups interconnected, such as (1,2) The group of label 1 and the group of label 2 interconnect as a connected region.It is specific with some in picture element matrix in the present embodiment Connected region of the 8 adjacent adjacent pixels of pixel as the element.
S343: carrying out corrosion and superposition processing to the corresponding connected region of binary image, and obtaining includes handwritten Chinese character Target image.
Wherein, corrosion treatment is the operation for removing some portion of content of image in morphology.Using in MATLAB Built-in imerode function carries out corrosion treatment to the connected region of binary image.Specifically, corresponding to binary image Connected region carries out corrosion treatment and includes the following steps: firstly, choose the structural element of a n × n, is with picture in the present embodiment The connected region of 8 adjacent element values of each element as the element in prime matrix, therefore, the structural element of selection are 3 × 3 picture element matrix.Structural element is the picture element matrix of a n × n, and matrix element therein includes 0 or 1.To layering two-value The picture element matrix for changing image is scanned, and is obtained the pixel that pixel value is 1, is compared 8 adjacent adjacent pixels of the pixel Whether it is all 1, if being all 1, remained unchanged;If being not all 1,8 adjacent adjacent pixels of the pixel in picture element matrix All become 0 (black).It is the part for being layered binary image and being corroded that this, which becomes 0 part then,.Matlab is answered in mathematics science and technology The application software of aspect is calculated with numerical value in field.
Binary image is screened based on pre-set handwritten word region resistance to corrosion range, for not in hand The binary image part write within the scope of the resistance to corrosion of region is deleted, and is obtained in binary image in the anti-corruption in handwritten word region Lose the part in limit of power.To each binary image part for meeting handwritten word region resistance to corrosion range filtered out Corresponding picture element matrix is overlapped, so that it may get target image only containing handwritten Chinese character.Wherein, handwritten word region is anti- Corrosive power can use formula:It calculates, s1Indicate the gross area after being corroded in binary image, s2Indicate two-value Change the gross area before being corroded in image, p is handwritten word region resistance to corrosion.
For example, pre-set handwritten word region resistance to corrosion range is [0.05,0.8], according to formulaMeter Calculate the gross area after each binary image is corroded and binary image be corroded before the gross area ratio p.Pass through calculating The ratio p of the gross area before the gross area and corrosion in binary image after certain zonal corrosion is not or not pre-set hand-written block Within the scope of the resistance to corrosion of domain, then it represents that the binary picture in the region seems background image rather than handwritten word, need to be corroded Processing, to remove the background image.If the gross area after certain zonal corrosion in binary image and the gross area before corrosion Ratio p is in [0.05,0.8] range, then it represents that the binary picture in the region seems handwritten Chinese character, needs to retain.To what is retained The corresponding picture element matrix of binary image is overlapped processing, obtains the target image containing handwritten Chinese character.
In step S341-S343, binary conversion treatment is carried out to layered image, binary image is obtained, then to binaryzation Pixel in image carries out detection label, the corresponding connected region of binary image is obtained, to not quite identical with structural element Picture element matrix in element all become 0, the binary image that element is 0 is black, which is then binary image The part that is corroded, the gross area and binary image after being corroded by calculating binary image be corroded before the gross area Ratio p, judge the ratio whether in pre-set handwritten word region resistance to corrosion range, each layered image to remove In background image, retain handwritten Chinese character, finally each layered image is overlapped, achieve the purpose that obtain target image.
S40: single font cutting is carried out to target image using vertical projection method, obtains single font image to be identified.
Wherein, vertical projection method refers to the projection that a line handwritten Chinese character every in target image is carried out to vertical direction, obtains The method of vertical projective histogram.Vertical projective histogram refers to the number of pixels of reflection target image in vertical direction.
Specifically, single font cutting is carried out to target image using vertical projection method and specifically comprises the following steps: server At least a line handwritten Chinese character in target image is scanned line by line, obtains the corresponding pixel value of every a line handwritten Chinese character, root According to the corresponding vertical projective histogram of each pixel value, the corresponding pixel quantity of different pixel values is obtained, it is straight according to upright projection Minimum in square figure carries out circulation cutting to target image, obtains single font image to be identified.It is to be appreciated that each The corresponding pixel value of handwritten Chinese character compares concentration, and the corresponding pixel value in the gap between Chinese character and Chinese character is than sparse , the concentration of corresponding pixel value is reacted in corresponding vertical projective histogram, then is had in vertical projective histogram The corresponding pixel quantity of the pixel value of Chinese character is relatively high, and the corresponding pixel quantity of the pixel value of Chinese character is not relatively low, by hanging down Straight sciagraphy effectively can carry out single font cutting to target image, obtain single font image to be identified, realize simply, be subsequent It carries out handwritten word identification and technical support is provided.
S50: single font image to be identified is input to the target handwritten word based on long Memory Neural Networks in short-term and identifies mould It is identified in type, obtains the corresponding handwritten Chinese character of single font image to be identified.
Wherein, target handwritten word identification model is to be in advance based on to grow the hand-written for identification of Memory Neural Networks training in short-term The model of word.Neural (long-short term memory, the abbreviation LSTM) network of long short-term memory is a kind of time recurrence mind Through network, it is suitable for handling and predicting that there is time series, and the critical event that time series interval is relatively long with delay.Tool Body, individual character image to be identified is input in target handwritten word identification model and identifies by server, so that target handwritten word Identification model from the context can be identified, obtained the corresponding handwritten Chinese character of each individual character image to be identified, improved identification Accuracy rate.
In the present embodiment, user can be acquired the acquisition module in computer equipment on the original image comprising handwritten Chinese character Server is passed to, so that server obtains original image.Then, server pre-processes original image, obtains and excludes to do Disturb the effective image of factor.Effective image is handled using Density Estimator algorithm, removes background picture, acquisition only includes The target image of handwritten Chinese character, further exclusive PCR.Single font cutting is carried out to target image using vertical projection method, is obtained Single font image to be identified, it is easy to accomplish.Single font image to be identified is input to the mesh based on long Memory Neural Networks in short-term It is identified in mark handwritten word identification model, so that single font image to be identified has timing, so that target handwritten word identifies Model from the context can be identified, obtained the corresponding handwritten Chinese character of each single font image, improved the accuracy rate of identification.
In one embodiment, handwritten Chinese character image recognition methods further include: preparatory training objective handwritten word identification model. Specifically, as shown in fig. 6, training objective handwritten word identification model includes the following steps: in advance
S61: training handwritten Chinese character image is obtained.
Wherein, training handwritten Chinese character image is acquired from open source library in advance for carrying out the sample graph of model training Picture.The training handwritten Chinese character image includes the hand-written printed words of each corresponding N (N is positive integer) of Chinese in Chinese second level character library This.Chinese second level character library is the non-common Chinese character base encoded by the radical order of strokes of Chinese character.Specifically, in acquisition open source library The hand-written N of different people handwritten word sample images are as training handwritten Chinese character image, so that server obtains training handwritten Chinese character Image is carried out since the writing style of different user is different using N handwritten word samples (training handwritten Chinese character image) Training, greatly improves the generalization of model.
S62: single font cutting is carried out to training handwritten Chinese character image using vertical projection method, obtains training single font figure Picture.
Wherein, vertical projection method carries out the cutting process and step S40 phase of single font cutting to training handwritten Chinese character image Together, to avoid repeating, details are not described herein.Training single font image is the single font image being trained for input model.
S63: to training single font image carry out sequence mark, and the training single font image marked is input to length When Memory Neural Networks in be trained, using stochastic gradient descent algorithm to the network parameters of long Memory Neural Networks in short-term into Row updates, and obtains target handwritten word identification model.
Wherein, stochastic gradient descent algorithm is every time when updating network parameter, using a sample (instruction randomly selected Practice single font image) it is updated, rather than be updated using all samples, accelerate training rate.Network parameter is long Weight and biasing between each layer of short-term memory neural network.Long Memory Neural Networks in short-term have the function of time memory, because And it is used to handle the training single font image for carrying time sequence status.
Long Memory Neural Networks in short-term have the network structure an of input layer, at least one hidden layer and an output layer.Its In, input layer is the first layer of long Memory Neural Networks in short-term, for receiving outer signals, that is, is responsible for receiving training single font figure Picture.Output layer is the last layer of long Memory Neural Networks in short-term, for outputing signal to the outside, that is, is responsible for output length and remembers in short-term Recall the calculated result of neural network.Hidden layer is each layer in long Memory Neural Networks in short-term in addition to input layer and output layer, For handling training single font image, the calculated result of long Memory Neural Networks in short-term is obtained.It is to be appreciated that using Long Memory Neural Networks in short-term carry out the timing that model training increases trained single font image, so as to based on context to instruction Practice single font image to be trained, to improve the accuracy rate of target handwritten word identification model.In the present embodiment, length is remembered in short-term The output layer for recalling neural network carries out recurrence processing using Softmax (regression model), for output weight matrix of classifying. Softmax (regression model) is a kind of classification function for being usually used in neural network, and the output of multiple neurons is mapped to by it In [0,1] section, it is possible to understand that at probability, calculate it is simple and convenient, to make its export result to carry out outputs of classifying more It is more acurrate.
In the present embodiment, first obtain training handwritten Chinese character image, using vertical projection method to training handwritten Chinese character image into Row single font cutting, obtain training single font image, so as to training single font image carry out sequence mark so that training individual character Body image has timing, and the training single font image marked is input in long Memory Neural Networks in short-term and is trained, According to the timing of training single font image, so as to long Memory Neural Networks in short-term based on context to training single font image into Row training, to improve the accuracy rate of target handwritten word identification model.
In one embodiment, as shown in fig. 7, in step S63, i.e., to training single font image carry out sequence mark, and will The training single font image marked is input in long Memory Neural Networks in short-term and is trained, using stochastic gradient descent algorithm The network parameter of long Memory Neural Networks in short-term is updated, target handwritten word identification model is obtained, specifically includes following step It is rapid:
S631: training single font image is carried out using the first activation primitive in the hidden layer of long Memory Neural Networks in short-term Processing obtains the neuron for carrying state of activation mark.
Wherein, each neuron in the long hidden layer of Memory Neural Networks in short-term includes three doors, is respectively to input Door forgets door and out gate.Forget door and determines the past information to be abandoned in neuron.Input gate is determined in mind Through wanting increased information in member.Out gate determines the information to be output in neuron.First activation primitive is to be used for Activate the function of neuron state.Neuron state determines the discarding of each door (i.e. input gate, forgetting door and out gate), increases Sum it up the information of output.State of activation mark includes by mark and not passing through mark.Input gate, forgetting door in the present embodiment Mark corresponding with out gate is respectively i, f and o.
In the present embodiment, specifically select Sigmoid (S sigmoid growth curve) function as the first activation primitive, Sigmoid letter Number is the function of a common S type in biology, in information science, due to property such as its list increasing and the increasings of inverse function list Matter, Sigmoid function are often used as the threshold function table of neural network, by variable mappings to 0, between 1.The calculating of its activation primitive Formula isWherein, z indicates to forget the output valve of door.
Specifically, forgeing includes forgeing thresholding in door, by the activation for calculating each neuron (training single font image) State is identified as the neuron by mark to obtain carrying state of activation.Wherein, using the calculation formula f for forgeing doort=σ (Wf·[ht-1,xt]+bf) calculate forget which information of door be received (i.e. only receive carry state of activation be identified as through mark Neuron), ftIt indicates to forget thresholding (i.e. state of activation), WfIndicate the weight matrix of forgetting door, bfIndicate that the weight for forgeing door is inclined Set item, ht-1Indicate the output of last moment neuron, xtIndicate the input data (training single font image) at current time, t Indicate current time, t-1 indicates last moment.Forgeing further includes forgeing thresholding in door, by forgeing the calculation formula of door to instruction The scalar in a section 0-1 can be obtained by practicing single font image and calculate, this scalar determine neuron according to current state and The ratio of the comprehensive descision information of receiving over of past state reduces calculation amount to reach the dimensionality reduction of data, improves training effect Rate.
S632: carrying state of activation is identified using the second activation primitive in the hidden layer of long Memory Neural Networks in short-term Neuron is handled, and the output valve of long Memory Neural Networks hidden layer in short-term is obtained.
Wherein, the output valve of long Memory Neural Networks hidden layer in short-term includes the output of the output valve of input gate, out gate Value and neuron state.Specifically, in the input gate in the long hidden layer of Memory Neural Networks in short-term, using the second activation letter Number carrying state of activation is identified as to be calculated by the neuron of mark, obtains the output valve of hidden layer.In the present embodiment, by It is inadequate in the ability to express of linear model, therefore the activation primitive (i.e. the using tanh (tanh) function as input gate Two activation primitives), non-linear factor can be added, the target handwritten word identification model trained is made to be able to solve more complicated ask Topic.Also, activation primitive tanh (tanh) has the advantages that fast convergence rate, can save the training time, increases training Efficiency.
Specifically, the output valve of input gate is calculated by the calculation formula of input gate.It wherein, further include input in input gate Thresholding, the calculation formula of input gate are it=σ (Wi·[ht-1,xt]+bi), WiFor the weight matrix of input gate, itIndicate input gate Limit, biThe bias term for indicating input gate, one can be obtained by being calculated by the calculation formula of input gate training single font image The scalar (i.e. input threshold) in a section 0-1, this scalar control neuron and are sentenced according to the synthesis of current state and past state The ratio of disconnected received current information, that is, receive the ratio of the information newly inputted, to reduce calculation amount, improves training effectiveness.
Using the calculation formula of neuron stateWith Calculate Current neural member state;Wherein, WcIndicate the weight matrix of neuron state, bcIndicate the bias term of neuron state,Indicate the neuron state of last moment, CtIndicate current time neuron state.By by neuron state and forget door Limit (input threshold) carries out dot product operation and improves the efficiency of model learning so that model only exports required information.
Finally, using the calculation formula o of out gatet=σ (Wo[ht-1,xt]+bo) calculate out gate in which information it is defeated Out, then using formula ht=ot*tanh(Ct) calculate current time neuron output valve, wherein otIndicate output thresholding, WoTable Show the weight matrix of out gate, boIndicate the bias term of out gate, htIndicate the output valve of Current neural member.
S633: according to the output valve of long Memory Neural Networks hidden layer in short-term, using stochastic gradient descent algorithm to length When Memory Neural Networks network parameter be updated, obtain target handwritten word identification model.
The calculation formula of stochastic gradient descent algorithm is speciallyWithWherein, J (θ) is loss function, and m indicates the quantity and m=1, θ for the training single font image chosenj Indicate the network parameter of the long Memory Neural Networks in short-term of jth layer, hθ(x) output of long Memory Neural Networks hidden layer in short-term is indicated Value, (xi, yi) indicate i-th of trained single font image.
Firstly, constructing formula according to loss functionLoss function is constructed, In, in, J (θ) is loss function, and m indicates the quantity and m=1, θ for the training single font image chosenjIndicate that jth layer is long in short-term The network parameter of Memory Neural Networks, such as WiOr bi, hθ(x) output valve of long Memory Neural Networks hidden layer in short-term, (x are indicatedi (training single font image), yi(legitimate reading)) indicate i-th of trained single font image.Due to using stochastic gradient in this case Descent algorithm is to be carried out more every time when updating network parameter using the sample (training single font image) randomly selected Newly, therefore, m=1 in loss function formula.Pass through formulaLoss function is carried out to seek derivative operation, Weight and biasing between each layer, the weight for the updated each layer that will acquire and biasing are updated to update network parameter, is answered Target handwritten word identification model can be obtained by using in long Memory Neural Networks in short-term.
Further, each weight in the target handwritten word identification model realizes the decision of target handwritten word identification model and loses The function of abandoning which old information, increase which new information and export which information.In the output of target handwritten word identification model Eventually output probability value, the probability value refer to that trained single font image recognition goes out the probability of corresponding Chinese character, can answer extensively layer Aspect is identified for handwritten word, to achieve the purpose that accurately identify handwritten word image.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
In one embodiment, Fig. 8 is shown and the one-to-one hand of handwritten Chinese character image recognition methods in above-described embodiment The schematic diagram of writing of Chinese characters pattern recognition device.As shown in figure 8, the handwritten Chinese character image identification device includes that original image obtains mould Block 10, effective image obtain module 20, target image obtains module 30, single font image collection module 40 to be identified and the hand-written Chinese Word obtains module 50, and detailed description are as follows for each functional module:
Original image obtains module 10, and for obtaining original image, original image includes handwritten Chinese character and background picture.
Effective image obtains module 20, for pre-processing to original image, obtains effective image.
Target image obtains module 30, for handling using Density Estimator algorithm effective image, removes background Picture obtains the target image including handwritten Chinese character.
Single font image collection module 40 to be identified is cut for carrying out single font to target image using vertical projection method It cuts, obtains single font image to be identified.
Handwritten Chinese character obtains module 50, for being input to single font image to be identified based on long Memory Neural Networks in short-term Target handwritten word identification model in identified, obtain the corresponding handwritten Chinese character of single font image to be identified.
Specifically, it includes gray level image acquiring unit 21 and effective image acquiring unit that effective image, which obtains module 20, 22。
Gray level image acquiring unit 21, for original image is amplified and gray processing processing, obtain gray processing figure Picture.
Effective image acquiring unit 22 obtains effective image for being standardized to gray level image, wherein The formula of standardization isX is the pixel value of gray level image M, and X ' is the picture of effective image Element value, MminIt is the smallest pixel value, M in gray level image MmaxIt is maximum pixel value in gray level image M.
Specifically, it includes effective image histogram acquiring unit 31, frequency extremes acquisition list that target image, which obtains module 30, Member 32, layered image acquiring unit 33 and target image acquiring unit 34.
Effective image histogram acquiring unit 31 obtains effectively figure for counting to the pixel value in effective image As histogram.
Frequency extremes acquiring unit 32, for using Gaussian Kernel Density algorithm for estimating to effective image histogram at Reason obtains at least one frequency maximum corresponding with effective image histogram and at least one frequency extremes acquiring unit, uses In frequency minimum.
Layered image acquiring unit 33 is cut for carrying out layering to effective image based on frequency maximum and frequency minimum Divide processing, obtains layered image.
Target image acquiring unit 34 obtains the target image including handwritten Chinese character for being based on layered image.
Specifically, target image acquiring unit 34 includes that binary image obtains subelement 341, connected region obtains son list Member 342 and target image obtain subelement 343.
Binary image obtains subelement 341, for carrying out binary conversion treatment to layered image, obtains binary image.
Connected region obtains subelement 342, for carrying out detection label to the pixel in binary image, obtains binaryzation The corresponding connected region of image.
Target image obtains subelement 343, for carrying out at corrosion and superposition to the corresponding connected region of binary image Reason obtains the target image including handwritten Chinese character.
Specifically, which further includes handwritten word identification model training module 60, for pre- First training objective handwritten word identification model.
Handwritten word identification model training module 60 includes training handwritten Chinese character image acquiring unit 61, training single font image Acquiring unit 62 and target handwritten word identification model acquiring unit 63.
Training handwritten Chinese character image acquiring unit 61, for obtaining trained handwritten Chinese character image.
Training single font image acquisition unit 62, for carrying out individual character to training handwritten Chinese character image using vertical projection method Body cutting obtains training single font image.
Target handwritten word identification model acquiring unit 63 is used for training single font image carry out sequence mark, and will mark The training single font image being poured in is input in long Memory Neural Networks in short-term and is trained, using stochastic gradient descent algorithm pair The network parameter of long Memory Neural Networks in short-term is updated, and obtains target handwritten word identification model.
Specifically, target handwritten word identification model acquiring unit 63 includes that state of activation neuron obtains subelement 631, net Network output valve obtains subelement 632 and Model of Target Recognition obtains subelement 633.
State of activation neuron obtains subelement 631, for using first in the hidden layer of long Memory Neural Networks in short-term Activation primitive handles single font image, obtains the neuron for carrying state of activation mark.
Network output valve obtains subelement 632, for the hidden layer in long Memory Neural Networks in short-term using the second activation Function handles the neuron for carrying state of activation mark, obtains the output valve of long Memory Neural Networks hidden layer in short-term.
Model of Target Recognition obtains subelement 633, for the output valve according to long Memory Neural Networks hidden layer in short-term, adopts It is updated with network parameter of the stochastic gradient descent algorithm to long Memory Neural Networks in short-term, obtains target handwritten word and identify mould Type;The calculation formula of stochastic gradient descent algorithm is speciallyWith Wherein, J (θ) is loss function, and m indicates the quantity and m=1, θ for the training single font image chosenjIt indicates that jth layer is long to remember in short-term Recall the network parameter of neural network, hθ(x) output valve of long Memory Neural Networks hidden layer in short-term, (x are indicatedi, yi) indicate i-th A trained single font image.
Specific restriction about handwritten Chinese character image identification device may refer to identify above for handwritten Chinese character image The restriction of method, details are not described herein.Modules in above-mentioned handwritten Chinese character image identification device can be fully or partially through Software, hardware and combinations thereof are realized.Above-mentioned each module can be embedded in the form of hardware or independently of the place in computer equipment It manages in device, can also be stored in a software form in the memory in computer equipment, in order to which processor calls execution or more The corresponding operation of modules.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 9.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The database of machine equipment is used for for storing the data for executing handwritten Chinese character image recognition methods and generating or obtain in the process, such as hand Writing of Chinese characters.The network interface of the computer equipment is used to communicate with external terminal by network connection.The computer program quilt To realize a kind of handwritten Chinese character image recognition methods when processor executes.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor perform the steps of acquisition original graph when executing computer program Picture, original image include handwritten Chinese character and background picture;Original image is pre-processed, effective image is obtained;It is close using core Degree algorithm for estimating handles effective image, removes background picture, obtains the target image including handwritten Chinese character;Using vertical Sciagraphy carries out single font cutting to target image, obtains single font image to be identified;Single font image to be identified is input to Based on being identified in the long target handwritten word identification model of Memory Neural Networks in short-term, it is corresponding to obtain single font image to be identified Handwritten Chinese character.
In one embodiment, it is also performed the steps of when processor executes computer program and original image is put The processing of big and gray processing, obtains gray level image;Gray level image is standardized, effective image is obtained, wherein mark Standardization processing formula beX is the pixel value of gray level image M, and X ' is the pixel of effective image Value, MminIt is the smallest pixel value, M in gray level image MmaxIt is maximum pixel value in gray level image M.
In one embodiment, it also performs the steps of when processor executes computer program to the picture in effective image Plain value is counted, and effective image histogram is obtained;Using Gaussian Kernel Density algorithm for estimating to effective image histogram at Reason obtains at least one frequency maximum corresponding with effective image histogram and at least one frequency minimum;Based on frequency Maximum and frequency minimum carry out layering cutting processing to effective image, obtain layered image;Based on layered image, packet is obtained Include the target image of handwritten Chinese character.
In one embodiment, it is also performed the steps of when processor executes computer program and two is carried out to layered image Value processing, obtains binary image;Detection label is carried out to the pixel in binary image, it is corresponding to obtain binary image Connected region;Corrosion and superposition processing are carried out to the corresponding connected region of binary image, obtain the target including handwritten Chinese character Image.
In one embodiment, acquisition training handwritten Chinese character is also performed the steps of when processor executes computer program Image;Single font cutting is carried out to training handwritten Chinese character image using vertical projection method, obtains training single font image;To training Single font image carry out sequence mark, and by the training single font image marked be input in long Memory Neural Networks in short-term into Row training is updated using network parameter of the stochastic gradient descent algorithm to long Memory Neural Networks in short-term, obtains target hand It writes identification model;The calculation formula of stochastic gradient descent algorithm is speciallyWithWherein, J (θ) is loss function, and m indicates the quantity and m=1, θ for the training single font image chosenj Indicate the network parameter of the long Memory Neural Networks in short-term of jth layer, hθ(x) output of long Memory Neural Networks hidden layer in short-term is indicated Value, (xi, yi) indicate i-th of trained single font image.
In one embodiment, it is also performed the steps of when processor executes computer program in long short-term memory nerve The hidden layer of network is handled single font image using the first activation primitive, obtains the nerve for carrying state of activation mark Member;The neuron for carrying state of activation mark is carried out using the second activation primitive in the hidden layer of long Memory Neural Networks in short-term Processing obtains the output valve of long Memory Neural Networks hidden layer in short-term;According to the output of long Memory Neural Networks hidden layer in short-term Value is updated using network parameter of the stochastic gradient descent algorithm to long Memory Neural Networks in short-term, obtains target handwritten word Identification model.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of acquisition original image when being executed by processor, original image includes handwritten Chinese character and background picture; Original image is pre-processed, effective image is obtained;Effective image is handled using Density Estimator algorithm, removal back Scape picture obtains the target image including handwritten Chinese character;Single font cutting is carried out to target image using vertical projection method, is obtained Single font image to be identified;Single font image to be identified is input to the target handwritten word based on long Memory Neural Networks in short-term to know It is identified in other model, obtains the corresponding handwritten Chinese character of single font image to be identified.
In one embodiment, it is also performed the steps of when computer program is executed by processor and original image is carried out Amplification and gray processing processing, obtain gray level image;Gray level image is standardized, effective image is obtained, wherein The formula of standardization isX is the pixel value of gray level image M, and X ' is the picture of effective image Element value, MminIt is the smallest pixel value, M in gray level image MmaxIt is maximum pixel value in gray level image M.
In one embodiment, it also performs the steps of when computer program is executed by processor in effective image Pixel value is counted, and effective image histogram is obtained;Effective image histogram is carried out using Gaussian Kernel Density algorithm for estimating Processing obtains at least one frequency maximum corresponding with effective image histogram and at least one frequency minimum;Based on frequency Rate maximum and frequency minimum carry out layering cutting processing to effective image, obtain layered image;Based on layered image, obtain Target image including handwritten Chinese character.
In one embodiment, it is also performed the steps of when computer program is executed by processor and layered image is carried out Binary conversion treatment obtains binary image;Detection label is carried out to the pixel in binary image, it is corresponding to obtain binary image Connected region;Corrosion and superposition processing are carried out to the corresponding connected region of binary image, obtain the mesh including handwritten Chinese character Logo image.
In one embodiment, the acquisition training hand-written Chinese is also performed the steps of when computer program is executed by processor Word image;Single font cutting is carried out to training handwritten Chinese character image using vertical projection method, obtains training single font image;To instruction Practice single font image carry out sequence mark, and the training single font image marked is input in long Memory Neural Networks in short-term It is trained, is updated using network parameter of the stochastic gradient descent algorithm to long Memory Neural Networks in short-term, obtains target Handwritten word identification model;The calculation formula of stochastic gradient descent algorithm is speciallyWithWherein, J (θ) is loss function, and m indicates the quantity and m=1, θ for the training single font image chosenj Indicate the network parameter of the long Memory Neural Networks in short-term of jth layer, hθ(x) output of long Memory Neural Networks hidden layer in short-term is indicated Value, (xi, yi) indicate i-th of trained single font image.
In one embodiment, it is also performed the steps of when computer program is executed by processor in long short-term memory mind Hidden layer through network is handled single font image using the first activation primitive, obtains the nerve for carrying state of activation mark Member;The neuron for carrying state of activation mark is carried out using the second activation primitive in the hidden layer of long Memory Neural Networks in short-term Processing obtains the output valve of long Memory Neural Networks hidden layer in short-term;According to the output of long Memory Neural Networks hidden layer in short-term Value is updated using network parameter of the stochastic gradient descent algorithm to long Memory Neural Networks in short-term, obtains target handwritten word Identification model.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of handwritten Chinese character image recognition methods characterized by comprising
Original image is obtained, the original image includes handwritten Chinese character and background picture;
The original image is pre-processed, effective image is obtained;
It is handled using Density Estimator algorithm and to the effective image, removes the background picture, it includes described for obtaining The target image of handwritten Chinese character;
Single font cutting is carried out to the target image using vertical projection method, obtains single font image to be identified;
The single font image to be identified is input to based in the long target handwritten word identification model of Memory Neural Networks in short-term It is identified, obtains the corresponding handwritten Chinese character of single font image to be identified.
2. handwritten Chinese character image recognition methods as described in claim 1, which is characterized in that located in advance to the original image Reason obtains effective image, comprising:
The original image is amplified and gray processing is handled, obtains gray level image;
The gray level image is standardized, the effective image is obtained, wherein the formula of the standardization ForX is the pixel value of the gray level image M, and X ' is the pixel value of the effective image, Mmin It is the smallest pixel value, M in gray level image MmaxIt is maximum pixel value in gray level image M.
3. handwritten Chinese character image recognition methods as described in claim 1, which is characterized in that described to use Density Estimator algorithm It is handled with to the effective image, removes the background picture, obtain the target image including the handwritten Chinese character, packet It includes:
Pixel value in the effective image is counted, effective image histogram is obtained;
The effective image histogram is handled using Gaussian Kernel Density evaluation method, is obtained and effective image histogram pair At least one the frequency maximum and at least one frequency minimum answered;
Layering cutting processing is carried out to the effective image based on the frequency maximum and frequency minimum, obtains hierarchical diagram Picture;
Based on the layered image, the target image including the handwritten Chinese character is obtained.
4. handwritten Chinese character image recognition methods as claimed in claim 3, which is characterized in that it is described to be based on the layered image, Obtain the target image including the handwritten Chinese character, comprising:
Binary conversion treatment is carried out to the layered image, obtains binary image;
Detection label is carried out to the pixel in the binary image, obtains the corresponding connected region of the binary image;
Corrosion and superposition processing are carried out to the corresponding connected region of the binary image, obtain the mesh including handwritten Chinese character Logo image.
5. handwritten Chinese character image recognition methods as described in claim 1, which is characterized in that the handwritten word sample acquiring method Further include: the target handwritten word identification model is trained in advance;
The preparatory training objective handwritten word identification model, comprising:
Obtain training handwritten Chinese character image;
Single font cutting is carried out to the trained handwritten Chinese character image using vertical projection method, obtains training single font image;
To the trained single font image carry out sequence mark, and the training single font image marked is input to length and is remembered in short-term Recall in neural network and be trained, using stochastic gradient descent algorithm to the length in short-term Memory Neural Networks network parameter into Row updates, and obtains the target handwritten word identification model.
6. handwritten Chinese character image recognition methods as claimed in claim 5, which is characterized in that the training individual character that will have been marked Body image is input in long Memory Neural Networks in short-term and is trained, using stochastic gradient descent algorithm to the long short-term memory The network parameter of neural network is updated, and obtains the target handwritten word identification model, comprising:
The single font image is handled using the first activation primitive in the hidden layer of long Memory Neural Networks in short-term, is obtained Carry the neuron of state of activation mark;
The length in short-term Memory Neural Networks hidden layer using the second activation primitive to it is described carrying state of activation mark Neuron is handled, and the output valve of long Memory Neural Networks hidden layer in short-term is obtained;
According to the output valve of length Memory Neural Networks hidden layer in short-term, using stochastic gradient descent algorithm to the length in short-term The network parameter of Memory Neural Networks is updated, and obtains the target handwritten word identification model;The stochastic gradient descent is calculated The calculation formula of method is speciallyWithWherein, J (θ) is damage Function is lost, m indicates the quantity and m=1, θ for the training single font image chosenjIndicate the jth layer long short-term memory nerve net The network parameter of network, hθ(x) output valve of length Memory Neural Networks hidden layer in short-term, (x are indicatedi, yi) indicate i-th of institute State trained single font image.
7. a kind of handwritten Chinese character image identification device characterized by comprising
Original image obtains module, and for obtaining original image, the original image includes handwritten Chinese character and background picture;
Effective image obtains module, for pre-processing to the original image, obtains effective image;
Target image obtains module, for handling using Density Estimator algorithm and to the effective image, described in removal Background picture obtains the target image including the handwritten Chinese character;
Single font image collection module to be identified, for carrying out single font cutting to the target image using vertical projection method, Obtain single font image to be identified;
Handwritten Chinese character obtains module, for being input to the single font image to be identified based on long Memory Neural Networks in short-term It is identified in target handwritten word identification model, obtains the corresponding handwritten Chinese character of single font image to be identified.
8. handwritten Chinese character image identification device as claimed in claim 7, which is characterized in that the target image obtains module packet It includes:
Effective image histogram acquiring unit obtains effective image for counting to the pixel value in the effective image Histogram;
Frequency extremes acquiring unit, for being handled using Gaussian Kernel Density algorithm for estimating the effective image histogram, Obtain at least one frequency maximum corresponding with effective image histogram and at least one frequency minimum;
Layered image acquiring unit, for being layered based on the frequency maximum and frequency minimum to the effective image Cutting processing, obtains layered image;
Target image acquiring unit obtains the target image including the handwritten Chinese character for being based on the layered image.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of any one of 6 handwritten Chinese character image recognition methods.
10. a kind of non-volatile memory medium, the non-volatile memory medium is stored with computer program, which is characterized in that The handwritten Chinese character image recognition methods as described in any one of claim 1 to 6 is realized when the computer program is executed by processor The step of.
CN201810564691.6A 2018-06-04 2018-06-04 Handwritten Chinese character image recognition methods, device, computer equipment and storage medium Withdrawn CN109002756A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810564691.6A CN109002756A (en) 2018-06-04 2018-06-04 Handwritten Chinese character image recognition methods, device, computer equipment and storage medium
PCT/CN2018/094222 WO2019232850A1 (en) 2018-06-04 2018-07-03 Method and apparatus for recognizing handwritten chinese character image, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810564691.6A CN109002756A (en) 2018-06-04 2018-06-04 Handwritten Chinese character image recognition methods, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109002756A true CN109002756A (en) 2018-12-14

Family

ID=64574205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810564691.6A Withdrawn CN109002756A (en) 2018-06-04 2018-06-04 Handwritten Chinese character image recognition methods, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109002756A (en)
WO (1) WO2019232850A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110751024A (en) * 2019-09-06 2020-02-04 平安科技(深圳)有限公司 User identity identification method and device based on handwritten signature and terminal equipment
CN111626284A (en) * 2020-05-26 2020-09-04 广东小天才科技有限公司 Method and device for removing handwritten fonts, electronic equipment and storage medium
CN113128470A (en) * 2021-05-13 2021-07-16 北京有竹居网络技术有限公司 Stroke recognition method and device, readable medium and electronic equipment

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111160369B (en) * 2019-12-25 2024-03-05 携程旅游信息技术(上海)有限公司 Method, system, electronic equipment and storage medium for cracking Chinese character verification code
CN112131834B (en) * 2020-09-24 2023-12-29 云南民族大学 West wave font generating and identifying method
CN112634262A (en) * 2020-12-31 2021-04-09 浙江优学智能科技有限公司 Writing quality evaluation method based on Internet
CN113343814B (en) * 2021-05-31 2022-06-14 太原理工大学 Handwritten digital image recognition method based on single-node photon reserve pool calculation

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103207997B (en) * 2013-04-15 2017-02-08 浙江捷尚视觉科技股份有限公司 Kernel density estimation-based license plate character segmentation method
CN105184292B (en) * 2015-08-26 2018-08-03 海南云江科技有限公司 The structural analysis of handwritten form mathematical formulae and recognition methods in natural scene image
CN105512692B (en) * 2015-11-30 2019-04-09 华南理工大学 Hand script Chinese input equipment mathematical formulae Symbol Recognition based on BLSTM
CN106022273A (en) * 2016-05-24 2016-10-12 华东理工大学 Handwritten form identification system of BP neural network based on dynamic sample selection strategy

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110751024A (en) * 2019-09-06 2020-02-04 平安科技(深圳)有限公司 User identity identification method and device based on handwritten signature and terminal equipment
WO2021042562A1 (en) * 2019-09-06 2021-03-11 平安科技(深圳)有限公司 User identity recognition method and apparatus based on handwritten signature, and terminal device
CN111626284A (en) * 2020-05-26 2020-09-04 广东小天才科技有限公司 Method and device for removing handwritten fonts, electronic equipment and storage medium
CN111626284B (en) * 2020-05-26 2023-10-03 广东小天才科技有限公司 Method and device for removing handwriting fonts, electronic equipment and storage medium
CN113128470A (en) * 2021-05-13 2021-07-16 北京有竹居网络技术有限公司 Stroke recognition method and device, readable medium and electronic equipment

Also Published As

Publication number Publication date
WO2019232850A1 (en) 2019-12-12

Similar Documents

Publication Publication Date Title
CN108985297A (en) Handwriting model training, hand-written image recognition methods, device, equipment and medium
CN109102037A (en) Chinese model training, Chinese image-recognizing method, device, equipment and medium
CN109002756A (en) Handwritten Chinese character image recognition methods, device, computer equipment and storage medium
CN108985324A (en) Handwritten word training sample acquisition methods, device, equipment and medium
CN109063706A (en) Verbal model training method, character recognition method, device, equipment and medium
CN109766898A (en) Image character recognition method, device, computer equipment and storage medium
CN110619274A (en) Identity verification method and device based on seal and signature and computer equipment
CN108345880A (en) Invoice recognition methods, device, computer equipment and storage medium
CN108710866A (en) Chinese mold training method, Chinese characters recognition method, device, equipment and medium
CN104915972A (en) Image processing apparatus, image processing method and program
CN109086652A (en) Handwritten word model training method, Chinese characters recognition method, device, equipment and medium
CN108764358A (en) A kind of Terahertz image-recognizing method, device, equipment and readable storage medium storing program for executing
CN109784153A (en) Emotion identification method, apparatus, computer equipment and storage medium
CN110070115B (en) Single-pixel attack sample generation method, device, equipment and storage medium
CN109063720A (en) Handwritten word training sample acquisition methods, device, computer equipment and storage medium
CN109657582A (en) Recognition methods, device, computer equipment and the storage medium of face mood
CN108108751A (en) A kind of scene recognition method based on convolution multiple features and depth random forest
CN108921031A (en) Chinese mold training method, hand-written character recognizing method, device, equipment and medium
CN111627080A (en) Gray level image coloring method based on convolution nerve and condition generation antagonistic network
CN108805125A (en) Vehicle License Plate Recognition System based on particle cluster algorithm optimization neural network and method
CN111899247A (en) Method, device, equipment and medium for identifying lumen region of choroidal blood vessel
CN110363103B (en) Insect pest identification method and device, computer equipment and storage medium
CN108875639A (en) A kind of optimization and recognition methods based on genetic algorithm recognition of face
Schirrmeister et al. When less is more: Simplifying inputs aids neural network understanding
Ebanesar et al. Human Ear Recognition Using Convolutional Neural Network

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20181214

WW01 Invention patent application withdrawn after publication