CN110009065A - A kind of calligraphy comparison method based on image binaryzation - Google Patents

A kind of calligraphy comparison method based on image binaryzation Download PDF

Info

Publication number
CN110009065A
CN110009065A CN201910029749.1A CN201910029749A CN110009065A CN 110009065 A CN110009065 A CN 110009065A CN 201910029749 A CN201910029749 A CN 201910029749A CN 110009065 A CN110009065 A CN 110009065A
Authority
CN
China
Prior art keywords
picture
image
calligraphy
size
processing
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
CN201910029749.1A
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.)
Lingnan Normal University
Original Assignee
Lingnan Normal University
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 Lingnan Normal University filed Critical Lingnan Normal University
Priority to CN201910029749.1A priority Critical patent/CN110009065A/en
Publication of CN110009065A publication Critical patent/CN110009065A/en
Pending 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/24Character recognition characterised by the processing or recognition method
    • G06V30/242Division of the character sequences into groups prior to recognition; Selection of dictionaries
    • G06V30/244Division of the character sequences into groups prior to recognition; Selection of dictionaries using graphical properties, e.g. alphabet type or font
    • G06V30/245Font recognition

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 kind of calligraphy comparison method based on image binaryzation, which is characterized in that this method comprises: step 1 is to handle the calligraphy picture image binaryzation principle of drills to improve one's handwriting person for binary picture, be set as figure a;Step 2 is to handle the picture image binaryzation principle of copybook as binary picture, is set as figure b;Step 3 is that the figure a that step 1 processing obtains and the figure b that step 2 processing obtains are carried out picture size processing, and the size of two figures is adjusted to consistent;Step 4 is comparative selection direction, judges that selection emphasizes Hanzi structure comparison or emphasizes that Chinese-character stroke compares;Step 5 is to compare effect to show;Step 6 is the advisory opinion that practitioner's practice is provided by deep learning.The comparing result of image, text or number that calligraphy comparison method of the invention provides is very intuitive, can be convenient practitioner and realizes the font of oneself and the difference of copybook, provides the advisory opinion that practitioner practices calligraphy.

Description

A kind of calligraphy comparison method based on image binaryzation
Technical field
The present invention relates to calligraphy education field, specifically a kind of calligraphy comparison method based on image binaryzation.
Background technique
Chinese character is one of text most ancient in the world, at least thousands of years of history, and the original character of earliest extant is The stone inscription character of ancient times, the mature hanzi system that can be known are the inscriptions on bones or tortoise shells of Shang dynasty.Chinese character is physically gradually being become by figure For stroke, pictograph becomes signifying, complexity becomes simple;In coinage in principle from table shape, express the meaning to ideophone.The other example of depolarization It outside, is all one syllable of a Chinese character.
The calligraphy art of China starts from the generation stage of Chinese character, and " sound cannot be passed in strange land, be stayed in the different time, as a result literary Word is raw.Text person, so for the mark of meaning and sound." therefore, produce text.First works of calligraphy art are not texts, But some portray symbol -- pictograph or picture writing;Chinese character portrays symbol, primarily occur ins on pottery.Initial Portraying symbol only indicates the concept of a general chaos, without exact meaning.
Retrieval is for the available following nearlyr search result of method that calligraphy compares:
State Intellectual Property Office discloses the patent document of Publication No. CN 102147867A, a kind of state based on main body The recognition methods of picture picture and handwriting image comprising following steps: (1) the pervious state of scanner scanning China modern is utilized Paintings product and the calligraphy work occurred in history, obtain the sample image of traditional Chinese Painting works and calligraphy work;(2) to sample graph As carrying out the image preprocessing based on Top-down comprising following steps: 1. converting sample image from RGB color To hsv color space;2. doing the edge detection of Canny operator to the sample image in 1. hsv color space that step obtains;③ The processing of edge swell is done to the sample image of 2. edge detection that step obtains;4. the edge swell 3. obtained to step Sample image does the processing of area filling;5. other than the filling region of the sample image of the area filling 4. obtained to step The statistics that background area carries out colouring information obtains each point including counting to each component in hsv color space Average value Ave_H, Ave_S, Ave_V of amount;6. carrying out time of full figure individual element to the sample image that preliminary sweep obtains Go through, the value of each component of H, S, V of the HSV color space of each pixel of sample image respectively with it is each in hsv color space Average value Ave_H, Ave_S, Ave_V of component do difference operation, difference operation result are compared with threshold value, in threshold value Pixel in range is considered to be left white region, sets it to uniform color;(3) from the obtained sample image of scanning with Machine chooses training sample image and test sample image;(4) main body that training sample image is extracted from training sample image is special Levy vector, and training classifier comprising following steps: 1. obtain training sample image by step (2) image preprocessing Grey level histogram, gray scale are 256 ranks;2. being counted for each color interval bin in training sample image grey level histogram The number summation Total occurred in training sample image, each training sample image ultimately produce the main body of one 256 dimension Feature vector completes the extraction of the body feature vector of training sample image, it is contemplated that the size of different training sample images, It is calculated using the following equation: Total_bin=Total Wide × High, wherein Wide, High respectively indicate training sample figure The width and height of picture;(5) training sample image classifier extracts body feature vector, using training from test sample image Sample image classifier identified comprising following steps: 1. to the body feature for the training sample image extracted to Amount, is trained based on machine learning model, obtains trained sample image classifier;2. extracting test sample image Body feature vector;3. the body feature vector of the test sample image for extraction is classified with trained sample image Device is identified, obtains the result of identification.
State Intellectual Property Office discloses the patent document of Publication No. CN107491543A for another example, and one kind being based on client The calligraphy auxiliary exercise method at end characterized by comprising when the search information that client monitors to user input, send Searching request;Described search information includes keyword or the pass of word content, the font of the word content and the word or poetic prose Key sentence;Receive based on described search request be the word content return the evolution of the word, the comparison between multiple fonts and The difference of order of writing strokes between the multiple fonts;Receive the word based on described search request for the word content and the word The order of strokes observed in calligraphy path animation of the word that body returns, stroke split after each stroke picture and/or the word knowledge point;It connects Receive the pen and ink picture and/or the poetic prose of the calligraphist returned based on the keyword or critical sentence that described search request is poetic prose In each word search link, described search be linked as be with the font of the word content and the word search information search, Or with the word content be search for information search;The content of aforementioned return is shown in the client.
By retrieving existing open source literature it can be found that existing calligraphy auxiliary exercise method is in the prevalence of system Structure is complicated, safety is low, and the not mature enough stabilization of the core algorithm used, reliability are low, and comparing result is not intuitive enough, practice Person cannot obtain clear direct practice advisory opinion.
Summary of the invention
A kind of utilization image binaryzation principle processing binaryzation that in order to overcome above-mentioned deficiency, present invention aims at providing Figure come reach calligraphy compare purpose method.
To achieve the goals above, the technical solution adopted by the present invention is that:
Include: step 1 it is to handle the calligraphy picture image binaryzation principle of drills to improve one's handwriting person as binary picture, is set as Scheme a;Step 2 is to handle the picture image binaryzation principle of copybook as binary picture, is set as figure b;Step 3 is by step 1 It handles obtained figure a and step 2 handles obtained figure b and carries out picture size processing, the size of two figures is adjusted to one It causes;Step 4 is comparative selection direction, judges that selection emphasizes Hanzi structure comparison or emphasizes that Chinese-character stroke compares;Step 5 be than Effect is shown;Step 6 is the advisory opinion that practitioner's practice is provided by deep learning;
Step 1: the calligraphy picture image binaryzation principle of drills to improve one's handwriting person being handled as binary picture, figure a is set as
The calligraphy picture of drills to improve one's handwriting person image binaryzation principle is handled, which uses OTSU algorithm, if Image includes L gray level, L 0,1 ..., L-1;The pixel points that gray value is i are Ni, and total pixel points of image are N =N0+N1+...+N (L-1);
Gray value is the point of i are as follows:
P (i)=N (i)/N;
Entire image is divided into two class of dark space c1 and clear zone c2 by thresholding t, and inter-class variance σ is the function of t:
σ=a1*a2 (u1-u2) ^2 (2);
In formula, aj is the ratio between area and total image area of class cj, a1=sum (P (i));I- > t, a2=1-a1;Uj is The mean value of class cj, u1=sum (i*P (i))/a1;0->t;
U2=sum (i*P (i))/a2, t+1- > L-1;
Method selection optimum thresholding t^ keeps inter-class variance maximum, it may be assumed that enables Δ u=u1-u2, σ b=max { a1 (t) * a2 (t) Δu^2};
Obtain a result Px;
Step 2: the picture image binaryzation principle of copybook being handled as binary picture, figure b is set as
The picture of copybook image binaryzation principle is handled, which obtains knot with step 1 for OTSU algorithm Fruit is set as P;
Step 3: the figure a that step 1 processing obtains and the figure b that step 2 processing obtains being subjected to picture size processing, by two figures Gear size be adjusted to consistent
The figure a that step 1 processing obtains and the figure b that step 2 processing obtains are subjected to picture size processing, by the size of two figures Size is adjusted to unanimously, to adjust so that Size (A)=Size (B);
Step 4: comparative selection/comparison direction judges that selection emphasizes Hanzi structure comparison or emphasizes that Chinese-character stroke compares
The stroke number of current Chinese character is set as e;
When the comparison process selection emphasize Hanzi structure compare, then the knot of main stroke is selected in picture a and picture b Structure position is chosen e point and is compared, and finds out Px the and P value of the position to compare;
When the stroke contrast of Chinese character is emphasized in comparison process selection, then each stroke is selected in picture a and picture b The receipts position at initial position and stroke end compares, and finds out Px the and P value of the position to compare;
Step 5: comparing effect and show
Px obtained in step 3 and step 4 and P are made comparisons, the difference of the two is obtained using ghost image control methods, will Differential disply out comes out;
Step 6: the advisory opinion of practitioner's practice is provided by deep learning
The advisory opinion of practitioner's practice is provided by deep learning.
Further, step 5 compares effect and both of shows that difference can be directly displayed out or be used by image Data either character express comes out.
Beneficial effects of the present invention:
Since comparing result can intuitively be shown with image, text or number, practitioner is facilitated to realize oneself Font and font specific difference, and based on deep learning can provide practitioner practice advisory opinion;
Due to mature and stable, the of the invention high reliablity of the core algorithm Image binarizing algorithm used;
Since system structure is simple, safety is good.
Detailed description of the invention
The present invention is described in further detail with reference to the accompanying drawing.
Fig. 1 is main-process stream schematic diagram of the invention.
Specific embodiment
Present invention is described in the following with reference to the drawings and specific embodiments, to better understand the present invention.
As shown in Figure 1, being preceding 5 steps of a total of six step of the present invention in figure, step 1 is by the book of drills to improve one's handwriting person The processing of method picture image binaryzation principle is binary picture, is set as figure a;Step 2 is by the picture image binaryzation of copybook Principle processing is binary picture, is set as figure b;Step 3 be the step 1 obtained figure a of processing and step 2 are handled obtained figure b into The processing of row picture size, is adjusted to consistent for the size of two figures;Step 4 is comparative selection direction, judges that the Chinese is emphasized in selection Word Structure Comparison emphasizes that Chinese-character stroke compares;Step 5 is to compare effect to show;Step 6 is to provide practice by deep learning The advisory opinion of person's practice;Wherein step 1 is to handle the calligraphy picture image binaryzation principle of drills to improve one's handwriting person for two-value Change figure, be set as figure a, which handles the calligraphy picture of drills to improve one's handwriting person image binaryzation principle, which uses OTSU algorithm, if image includes L gray level, L 0,1 ..., L-1;Pixel that gray value is i points are Ni, image always as Vegetarian refreshments number is N=N0+N1+...+N (L-1);Gray value is the point of i are as follows: P (i)=N (i)/N;Entire image is divided by thresholding t Two class of dark space c1 and clear zone c2, inter-class variance σ are the functions of t: σ=a1*a2 (u1-u2) ^2 (2);In formula, aj is class cj's The ratio between area and total image area, a1=sum (P (i));I- > t, a2=1-a1;Uj is the mean value of class cj, u1=sum (i*P (i))/a1;0->t;U2=sum (i*P (i))/a2, t+1- > L-1;Method selection optimum thresholding t^ keeps inter-class variance maximum, That is: Δ u=u1-u2, σ b=max { a1 (t) * a2 (t) Δ u^2 } are enabled;Obtain a result Px;Step 2 is to scheme the picture of copybook It is binary picture as binaryzation principle is handled, is set as figure b;The step handles the picture of copybook image binaryzation principle, should Processing method is that OTSU algorithm obtains a result with step 1 and is set as P;Step 3 is the figure a for obtaining step 1 processing and step 2 It handles obtained figure b and carries out picture size processing, the gear size of two figures is adjusted to consistent;The step handles step 1 To figure a and the obtained figure b of step 2 processing carry out picture size processing, the size of two figures is adjusted to unanimously, to adjust So that Size (A)=Size (B);Step 4 is comparative selection/comparison direction, judges that selection is emphasized Hanzi structure comparison or emphasized Chinese-character stroke compares the step and the stroke number of current Chinese character is set as e;User can choose way of contrast, user's selection at this time Way of contrast will determine the emphasis of the comparison process;When comparison process selection emphasizes that Hanzi structure compares, then in picture It selects the locations of structures of main stroke to choose e point in a and picture b to compare, finds out Px the and P value of the position to compare;When The comparison process selects to emphasize the stroke contrast of Chinese character, then the initial position of each stroke is selected in picture a and picture b It is compared with the receipts position at stroke end, finds out Px the and P value of the position to compare;Step 5 is to compare effect to show; The step makes comparisons Px obtained in step 3 and step 4 and P, and the difference of the two is obtained using ghost image control methods, will Differential disply out comes out;Effect is compared at this time both of shows that difference can be directly displayed out or be used by image Data either character express comes out.
Step 6 is the advisory opinion that practitioner's practice is provided by deep learning;The step provides white silk by deep learning The advisory opinion of habit person's practice, since current deep learning theory is very abundant, deep learning is led in natural language processing etc. Domain is mainly used in machine translation and semantic excavation, and is used to can be used when the practising Chinese character calligraphy in China and for example pass through Pytorch or tensorflow deep learning framework builds a Chinese character calligraphy writing Character Font Recognition and the font, and some is specific The automatic recommended models of the literary style of word provide most appropriate practice suggestion to help the final step of the calligraphy comparison method;Than The Chinese character calligraphy established such as the deep learning framework using pytorch writes font identification model and recognizes certain user Some Chinese-character writing be Ouyang Xun Ouyang Style word in " hut " word, then according to user in step 3 and step 4 of the invention Specific difference caused by middle comparison Px and P provides in Ouyang Style the suggestion of this kind of mistake about this kind of word: " should keep away just keep away it is close just Dredge, hedging is just easy, keep away it is remote nearby, be intended to its enhance each other's beauty each other it is proper ", " hut word, upper one skims both sharp, and next slash is improper identical, should keep away Overlapping and just simple diameter ", then by the current mistake of record user, this mistake is combined in the similar font of lower secondary design Degree provides picture, number and the text importing and further suggest whether the corresponding similar mistake of user is promoted.

Claims (2)

1. a kind of calligraphy comparison method based on image binaryzation, which is characterized in that this method comprises: step 1 is to practice calligraphy The calligraphy picture image binaryzation principle processing of habit person is binary picture, is set as figure a;Step 2 is to scheme the picture of copybook It is binary picture as binaryzation principle is handled, is set as figure b;Step 3 is to obtain the figure a that step 1 processing obtains with step 2 processing Figure b carry out picture size processing, the size of two figures is adjusted to consistent;Step 4 is comparative selection direction, judges to select It emphasizes Hanzi structure comparison or emphasizes that Chinese-character stroke compares;Step 5 is to compare effect to show;Step 6 is to be given by deep learning The advisory opinion of practitioner's practice out;
Step 1: the calligraphy picture image binaryzation principle of drills to improve one's handwriting person being handled as binary picture, figure a is set as
The calligraphy picture of drills to improve one's handwriting person image binaryzation principle is handled, which uses OTSU algorithm, if image Include L gray level, L 0,1 ..., L-1;The pixel points that gray value is i are Ni, and total pixel points of image are N=N0+N1 +...+N(L-1);
Gray value is the point of i are as follows:
P (i)=N (i)/N;
Entire image is divided into two class of dark space c1 and clear zone c2 by thresholding t, and inter-class variance σ is the function of t:
σ=a1*a2 (u1-u2) ^2 (2);
In formula, aj is the ratio between area and total image area of class cj, a1=sum (P (i));I- > t, a2=1-a1;Uj is class cj Mean value, u1=sum (i*P (i))/a1;0->t;
U2=sum (i*P (i))/a2, t+1- > L-1;
Method selection optimum thresholding t^ keeps inter-class variance maximum, it may be assumed that enables Δ u=u1-u2, σ b=max { a1 (t) * a2 (t) Δ u^ 2};
Obtain a result Px;
Step 2: the picture image binaryzation principle of copybook being handled as binary picture, figure b is set as
The picture of copybook image binaryzation principle is handled, which is that OTSU algorithm is obtained a result and set with step 1 For P;
Step 3: the figure a that step 1 processing obtains and the figure b that step 2 processing obtains being subjected to picture size processing, by the tooth of two figures Wheel size is adjusted to consistent
The figure a that step 1 processing obtains and the figure b that step 2 processing obtains are subjected to picture size processing, by the size of two figures It is adjusted to consistent, adjusts so that Size (A)=Size (B);
Step 4: comparative selection/comparison direction judges that selection emphasizes Hanzi structure comparison or emphasizes that Chinese-character stroke compares
The stroke number of current Chinese character is set as e;
When the comparison process selection emphasize Hanzi structure compare, then the structure bit of main stroke is selected in picture a and picture b It sets selection e point to compare, finds out Px the and P value of the position to compare;
When the stroke contrast of Chinese character is emphasized in comparison process selection, then the starting of each stroke is selected in picture a and picture b The receipts position at position and stroke end compares, and finds out Px the and P value of the position to compare;
Step 5: comparing effect and show
Px obtained in step 3 and step 4 and P are made comparisons, the difference of the two is obtained using ghost image control methods, by what is obtained Differential disply comes out;
Step 6: the advisory opinion of practitioner's practice is provided by deep learning
The advisory opinion of practitioner's practice is provided by deep learning.
2. the calligraphy comparison method according to claim 1 based on image binaryzation, it is characterised in that: step 5 compares effect Fruit both of shows that difference can be by including that image, data, text are directly stated and come out.
CN201910029749.1A 2019-01-14 2019-01-14 A kind of calligraphy comparison method based on image binaryzation Pending CN110009065A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910029749.1A CN110009065A (en) 2019-01-14 2019-01-14 A kind of calligraphy comparison method based on image binaryzation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910029749.1A CN110009065A (en) 2019-01-14 2019-01-14 A kind of calligraphy comparison method based on image binaryzation

Publications (1)

Publication Number Publication Date
CN110009065A true CN110009065A (en) 2019-07-12

Family

ID=67165386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910029749.1A Pending CN110009065A (en) 2019-01-14 2019-01-14 A kind of calligraphy comparison method based on image binaryzation

Country Status (1)

Country Link
CN (1) CN110009065A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800936A (en) * 2021-01-25 2021-05-14 中南大学 Calligraphy copy intelligent evaluation and guidance method based on computer vision

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004133404A (en) * 2002-07-22 2004-04-30 Feng Mei Computer font for kanji learning and method of forming computer font
US20070218430A1 (en) * 2005-11-03 2007-09-20 Tamkang University Calligraphy practicing system
CN103093240A (en) * 2013-01-18 2013-05-08 浙江大学 Calligraphy character identifying method
CN104485035A (en) * 2014-11-17 2015-04-01 潘滟 Calligraphy practicing system and method
CN106127198A (en) * 2016-06-20 2016-11-16 华南师范大学 A kind of image character recognition method based on Multi-classifers integrated

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004133404A (en) * 2002-07-22 2004-04-30 Feng Mei Computer font for kanji learning and method of forming computer font
US20070218430A1 (en) * 2005-11-03 2007-09-20 Tamkang University Calligraphy practicing system
CN103093240A (en) * 2013-01-18 2013-05-08 浙江大学 Calligraphy character identifying method
CN104485035A (en) * 2014-11-17 2015-04-01 潘滟 Calligraphy practicing system and method
CN106127198A (en) * 2016-06-20 2016-11-16 华南师范大学 A kind of image character recognition method based on Multi-classifers integrated

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邓学雄等: "毛笔书法临帖的计算机评价", 《图学学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800936A (en) * 2021-01-25 2021-05-14 中南大学 Calligraphy copy intelligent evaluation and guidance method based on computer vision
CN112800936B (en) * 2021-01-25 2022-03-08 中南大学 Calligraphy copy intelligent evaluation and guidance method based on computer vision

Similar Documents

Publication Publication Date Title
CN103942550B (en) A kind of scene text recognition methods based on sparse coding feature
CN103488711B (en) A kind of method and system of quick Fabrication vector font library
Wilkinson et al. Neural Ctrl-F: segmentation-free query-by-string word spotting in handwritten manuscript collections
Pacha et al. Towards self-learning optical music recognition
CN112069900A (en) Bill character recognition method and system based on convolutional neural network
CN110956167A (en) Classification discrimination and strengthened separation method based on positioning characters
CN113901952A (en) Print form and handwritten form separated character recognition method based on deep learning
CN103632387A (en) Method and system for generation of brush writing copybook
Ramesh et al. Offline Kannada handwritten character recognition using convolutional neural networks
CN108052955B (en) High-precision Braille identification method and system
CN101655911B (en) Mode identification method based on immune antibody network
CN108052936B (en) Automatic inclination correction method and system for Braille image
Nikitha et al. Handwritten text recognition using deep learning
CN111985184A (en) Auxiliary writing font copying method, system and device based on AI vision
CN109147002B (en) Image processing method and device
Suresh et al. Telugu Optical Character Recognition Using Deep Learning
CN107958261B (en) Braille point detection method and system
Sarkar et al. Suppression of non-text components in handwritten document images
CN110009065A (en) A kind of calligraphy comparison method based on image binaryzation
Rodrigues et al. Cursive character recognition–a character segmentation method using projection profile-based technique
Raj et al. Grantha script recognition from ancient palm leaves using histogram of orientation shape context
Zhang et al. Computational method for calligraphic style representation and classification
CN112036330A (en) Text recognition method, text recognition device and readable storage medium
CN108062548B (en) Braille square self-adaptive positioning method and system
Ibrahim et al. Braille image recognition for beginners

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190712

RJ01 Rejection of invention patent application after publication