CN106886777A - A kind of character boundary determines method and device - Google Patents

A kind of character boundary determines method and device Download PDF

Info

Publication number
CN106886777A
CN106886777A CN201710233264.5A CN201710233264A CN106886777A CN 106886777 A CN106886777 A CN 106886777A CN 201710233264 A CN201710233264 A CN 201710233264A CN 106886777 A CN106886777 A CN 106886777A
Authority
CN
China
Prior art keywords
character
gray scale
difference value
scale difference
row
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710233264.5A
Other languages
Chinese (zh)
Other versions
CN106886777B (en
Inventor
唐辉平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Original Assignee
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
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 Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd, Shenzhen Yihua Financial Intelligent Research Institute filed Critical Shenzhen Yihua Computer Co Ltd
Priority to CN201710233264.5A priority Critical patent/CN106886777B/en
Publication of CN106886777A publication Critical patent/CN106886777A/en
Application granted granted Critical
Publication of CN106886777B publication Critical patent/CN106886777B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words

Abstract

Determine method and device the embodiment of the invention discloses a kind of character boundary, wherein the method includes:For character grey figure, adjacent rows gray scale difference value and adjacent column gray scale difference value are calculated;Coboundary and the lower boundary of character are highly determined according to adjacent rows gray scale difference value and preset characters;The left margin and right margin of character are determined according to adjacent column gray scale difference value and preset characters width.The technical scheme of the embodiment of the present invention, four borders of character are determined by adjacent rows gray scale difference value, adjacent column gray scale difference value and preset characters size, character boundary can be accurately positioned, solve influence of the fritter stain to boundary alignment, and method is simple, stain need not be removed using additional means, time complexity is low.

Description

A kind of character boundary determines method and device
Technical field
Determine method and device the present embodiments relate to character recognition technologies, more particularly to a kind of character boundary.
Background technology
Character recognition technologies are widely used in daily life, for example, paper money number identification, Car license recognition etc..With paper As a example by coin, bank note may catch different degrees of stain in the process of circulation, when stain is in crown word number region, influence Being accurately positioned for character boundary, may result in identification mistake even None- identified, be that paper money recognition or false distinguishing bring certain It is difficult.Existing paper money number is recognized mainly for seventy percent new bank note above, in order to effectively be carried out to paper money number Identification, in crown word number identification process, is entered using computer vision technique and image processing techniques to the crown word number region polluted Row treatment, for example, removing stain by the simple method such as two Value Operations and medium filtering denoising, obtains the hat that can be recognized Font size, then location character border, is split and is recognized.
But, binaryzation and removal stain are needed in character recognition process so that whole identification process expend the time compared with It is long, and above-mentioned simple method can not effectively remove stain, stain still can influence being accurately positioned for character boundary, Jin Erying Ring Character segmentation and identification.
The content of the invention
The embodiment of the present invention provides a kind of character boundary and determines method and device, can solve stain and character boundary is positioned Influence, character boundary can be accurately positioned, and time complexity is relatively low.
In a first aspect, the embodiment of the invention provides a kind of character boundary determines method, including:
For character grey figure, adjacent rows gray scale difference value and adjacent column gray scale difference value are calculated;
Coboundary and the lower boundary of character are highly determined according to the adjacent rows gray scale difference value and preset characters;
The left margin and right margin of character are determined according to the adjacent column gray scale difference value and preset characters width.
Second aspect, the embodiment of the present invention additionally provides a kind of character boundary determining device, including:
Gray scale difference value computing module, for for character grey figure, calculating adjacent rows gray scale difference value and adjacent column gray scale difference value;
Up-and-down boundary determining module, the top for highly determining character according to the adjacent rows gray scale difference value and preset characters Boundary and lower boundary;
Right boundary determining module, the left side for determining character according to the adjacent column gray scale difference value and preset characters width Boundary and right margin.
The character boundary of the embodiment of the present invention determines method and device, by adjacent rows gray scale difference value, adjacent column gray scale difference value and Preset characters size determines four borders of character, can be accurately positioned character boundary, solves fritter stain to boundary alignment Influence, and method is simple, without removing stain using additional means, time complexity is low.
Brief description of the drawings
Fig. 1 is the flow chart that the character boundary that the embodiment of the present invention one is provided determines method;
Fig. 2 is the schematic diagram of the character grey figure that the embodiment of the present invention one is provided;
Fig. 3 is the structured flowchart of the character boundary determining device that the embodiment of the present invention four is provided.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that, in order to just Part rather than entire infrastructure related to the present invention is illustrate only in description, accompanying drawing.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The treatment described as flow chart or method.Although each step to be described as flow chart the treatment of order, many of which Step can be implemented concurrently, concomitantly or simultaneously.Additionally, the order of each step can be rearranged.When its operation The treatment can be terminated during completion, it is also possible to have the additional step being not included in accompanying drawing.The treatment can be with Corresponding to method, function, code, subroutine, subprogram etc..
Character picture in the embodiment of the present invention refers to the character picture for needing identification, for example, paper money number picture, car Board picture etc..Above-mentioned character picture is if there is fritter stain, and the stain will not cause the character cannot because being blocked by stain Identification, then can carry out character boundary determination using the embodiment of the present invention.Above-mentioned character picture if there is a large amount of stains, completely Block character, it is impossible to carry out character recognition, also need not just carry out character boundary determination, such case is not in the embodiment of the present invention Scope is discussed.
Embodiment one
Fig. 1 is the flow chart that the character boundary that the embodiment of the present invention one is provided determines method, and the present embodiment is applicable to word There is fritter stain on symbol picture and the stain does not influence the situation of character recognition, the method can be next by character boundary determining device Perform, character boundary determining device can be the electronic equipment with computing function and image processing function.As shown in figure 1, should Character boundary determines that method includes steps S110 to step S130.
Step S110, for character grey figure, calculates adjacent rows gray scale difference value and adjacent column gray scale difference value.
In this step, character grey figure can be obtained by the way that coloured image is converted into gray-scale map, for example, the prefix of bank note Number gray-scale map, car plate gray-scale map etc..Character grey figure is as shown in Fig. 2 be a part for paper money number.Wherein, crown word number ash Degree figure refers to the gray level image in the crown word number region on bank note, rather than the gray-scale map of entire paper coin;Car plate gray-scale map refers to It is the gray-scale map of license plate area.
The gray value of gray-scale map is smaller, and color of image is deeper, and the corresponding gray value of black is 0.Typically in character grey figure In, character is black, and the corresponding gray value of its pixel is 0, and the background of character is grey, and corresponding gray value is larger, and fritter is dirty Color of the mark in gray-scale map is general than background color depth.
The width of each row and the height per a line are a length in pixels.Calculate adjacent rows gray scale difference value and adjacent column gray scale Difference, can be by accomplished in many ways.With behavior example, the gray value that can directly calculate each pixel of certain a line is each with its adjacent rows The difference of the gray value of pixel, then the gray scale difference of each pixel is added;Often capable gray value sum (example can also first be calculated Such as, the gray value sum of every row is obtained by way of row projection is done to gray-scale map, it is also possible to directly to each pixel of same a line Gray value be added obtain the gray value sum of the row), then calculate the difference of certain a line and the gray value sum of its adjacent rows.
Step S120, coboundary and the lower boundary of character are highly determined according to adjacent rows gray scale difference value and preset characters.
Step S130, the left margin and right margin of character are determined according to adjacent column gray scale difference value and preset characters width.
The execution sequence of step S120 and step S130 is in no particular order.In step S120 and step S130, single character Image point when gathering of size (including character height and width, i.e., line number and columns shared by single character) and RGB image Resolution is relevant, and image resolution ratio is different, and the size of single character is also different.Because the form size of crown word number or car plate is Unified, therefore preset characters height and preset characters width may each be empirical value, by taking crown word number as an example, for longitudinal resolution Rate is 150 pixels, and lateral resolution is the bank note gray-scale map of 200 pixels, and the width of single prefix sign character (accounts for 20 for 20 pixels Row), be highly 24 pixels (accounting for 24 rows), then for the bank note gray-scale map of same resolution ratio, it is possible to made using above-mentioned data It is preset characters height and preset characters width.In addition, preset characters height and preset characters width can also be according to current The resolution ratio and character format size of character grey figure are calculated, for example, according to the resolution ratio of car plate gray-scale map, can calculate Draw the size of single character in license plate number.
In the present embodiment, at character boundary, it may appear that the saltus step of gray value, for example, the gray scale between background is expert at Difference very little, even 0;Gray value can reduce at character coboundary, calculate the ash that coboundary next line is expert at coboundary Degree difference, then can obtain a negative value;Can there is the pixel of black in each row where character, each row pixel where character Gray scale difference value can be on the occasion of or negative value, but its absolute value can be less than border saltus step gray scale difference absolute value;Character lower boundary Place's gray value can increase, and calculate the gray scale difference value that lower boundary next line and lower boundary are expert at, can obtain one on the occasion of.Therefore, Can determine that the corresponding row of minimal difference (the corresponding row of subtrahend i.e. in mathematic interpolation) is the coboundary of character, maximum difference pair The row (the corresponding row of subtrahend i.e. in mathematic interpolation) answered is the lower boundary of character.Certainly, according to above-mentioned principle, it is also possible to calculate Lastrow subtracts the gray scale difference value of next line, and now, (minuend i.e. in mathematic interpolation is corresponding for the corresponding row of minimal difference OK) be character lower boundary, the corresponding row of maximum difference (the corresponding row of minuend i.e. in mathematic interpolation) is the top of character Boundary.Determine the principle of character right boundary and determine that up-and-down boundary principle is similar, be not repeated to illustrate, but it is noted that by There is right boundary in each character, it is therefore desirable to determine the right boundary of each character respectively within a preset range.
For the fritter stain for not influenceing character recognition, compared with the row or column of pure background, stain can reduce be expert at or The gray value sum of row, it is contemplated that stain may therefore, it can combine on determining that character boundary produces influence using gray scale difference value Whether preset characters width and preset characters highly judge reasonable according to the border of gray scale difference value determination, and are adjusted, from And carry out accurate character boundary positioning.
The character boundary of the present embodiment determines method, big by adjacent rows gray scale difference value, adjacent column gray scale difference value and preset characters Small four borders for determining character, can be accurately positioned character boundary, solve influence of the fritter stain to boundary alignment, and method Simply, without removing stain using additional means, time complexity is low.
Embodiment two
On the basis of above-described embodiment one, calculating adjacent rows gray scale difference value is present embodiments provided, according to adjacent rows gray scale difference Value and preset characters highly determine the coboundary of character and the preferred embodiment of lower boundary.
In the present embodiment, adjacent rows gray scale difference value can be calculated by following several ways:
(1) gray scale difference value of next line and current line is calculated line by line.Wherein it is possible to calculate gray scale difference line by line from top to bottom Value.Next line refers to that next line gray value subtracts current line gray value with the gray scale difference value of current line.
(2) gray scale difference value of current line and next line is calculated line by line.Wherein it is possible to calculate gray scale difference line by line from top to bottom Value.Current line refers to that current line gray value subtracts next line gray value with the gray scale difference value of next line.
(3) (R is calculatedi+1-Ri)+(Ri+2-Ri), the first result of calculation is obtained, wherein, Ri+1-RiRepresent i+1 row and i-th Capable gray scale difference value, Ri+2-RiRepresent the gray scale difference value of the i-th+2 row and the i-th row.It is related to the gray scale difference value of three rows in the manner, this Sample ensure that the border of determination is more accurate.
(4) (R is calculatedi-Ri+1)+(Ri-Ri+2), the second result of calculation is obtained, wherein, Ri-Ri+1Represent the i-th row and i+1 Capable gray scale difference value, Ri-Ri+2Represent the gray scale difference value of the i-th row and the i-th+2 row.It is related to the gray scale difference value of three rows in the manner, this Sample ensure that the border of determination is more accurate.
Preferably, the up-and-down boundary of character is highly determined according to adjacent rows gray scale difference value and preset characters, can be by following Step is realized:According to adjacent rows gray scale difference value, it is determined that being most worth coboundary or lower boundary of the corresponding current line as character;Detection Whether the coboundary of determination is separated by a distance with lower boundary is equal to preset characters highly;If it is, boundary alignment is accurate;If It is no, then according to the coboundary and/or lower boundary of adjacent rows gray scale difference value and preset characters Height Adjustment character, until it is determined that top Boundary is separated by a distance equal to preset characters highly with lower boundary.Wherein, adjacent rows gray scale difference value is calculated in different ways, according to According to the gray scale difference value, most value is also different from the corresponding relation on border, can be minimum value correspondence coboundary, or maximum Correspondence coboundary, rear extended meeting is illustrated.
Specifically, originally determined coboundary is not equal to preset characters highly with lower boundary is separated by a distance, it may be possible on Border and/or lower boundary determine inaccurate.Can be with reference to preset characters height, gray scale difference value and the border having determined in ash Position adjustment border in degree figure, for example, character is in the centre position of picture, if it is determined that border near image edge, Then boundary alignment mistake.Due to being influenceed by stain, may there is multiple equal minimum values (or multiple equal maximums Value), now one of them can be chosen for determining border according to preset rules, the preset rules can be optional one, Can be the uppermost minimum value of selection (or selecting nethermost maximum), can also be a certain fixed row of selection (for example, choosing Take the 2nd row in multiple equal minimum values).The up-and-down boundary determined then in conjunction with preset characters height pair is adjusted.Tool , for example, minimum value corresponds to coboundary, there are multiple equal minimum values, it is necessary to be carried out according to actual conditions in the adjustment process of body, Determine the corresponding row of one of value as coboundary according to preset rules, and uniquely determined lower boundary, up-and-down boundary away from From being 10, less than preset characters height 24, it is clear that the possible Wrong localization in coboundary is, it is necessary to change the corresponding row of other minimum values As coboundary, after replacing, reuse preset characters and highly detected, until it is determined that up-and-down boundary meet distance and be equal to The condition of preset characters height;Or can directly find with lower boundary at a distance of 24 rows that gray scale difference value, if the value It is minimum value, then corresponding row is defined as new coboundary.
In addition, if only exist unique minimum value or maximum, but to be not equal to preset characters high for up-and-down boundary distance Degree, at this point it is possible to first combine position of the border having determined in gray-scale map, determines which boundary alignment is accurate, for example, under Boundary accurate, then highly determine new coboundary with reference to preset characters, if the corresponding gray scale difference value in the coboundary is reciprocal the Two small gray scale difference values, then can determine that boundary alignment is accurate.
For above-mentioned four kinds of calculations, the specific method of respective determination most value and border corresponding relation is respectively present, Illustrate separately below.
In the case of the gray scale difference value that mode (1) calculates next line and current line line by line, compare all gray scales for obtaining Difference, determines coboundary of the current line corresponding to minimal difference as character, determines that the current line corresponding to maximum difference is made It is the lower boundary of character.
In the case of the gray scale difference value that mode (2) calculates current line and next line line by line, compare all gray scales for obtaining Difference, determines coboundary of the current line corresponding to maximum difference as character, determines that the current line corresponding to minimal difference is made It is the lower boundary of character.
In the case where mode (3) is calculated the first result of calculation, the value correspondence of minimum in the first result of calculation is determined The i-th row as the coboundary of character, determine maximum corresponding i-th row of value in the first result of calculation as the following of character Boundary.
In the case where mode (4) is calculated the second result of calculation, the value correspondence of maximum in the first result of calculation is determined The i-th row as the coboundary of character, determine minimum corresponding i-th row of value in the first result of calculation as the following of character Boundary.
The present embodiment provides the up-and-down boundary that various concrete modes determine character, mode flexibly, in actual applications, can be with Certain mode is selected to use according to actual conditions.
Embodiment three
On the basis of above-described embodiment one and embodiment two, calculating adjacent column gray scale difference value, basis are present embodiments provided Adjacent column gray scale difference value and preset characters width determine the left margin of character and the preferred embodiment of right margin.
In the present embodiment, adjacent column gray scale difference value can be calculated by following several ways:
(1) next column and the gray scale difference value when prostatitis are calculated by column.Wherein it is possible to calculate gray scale difference by column from front to back Value.Next column refers to that next column gray value is subtracted when prostatitis gray value with the gray scale difference value when prostatitis.
(2) gray scale difference value when prostatitis with next column is calculated by column.Wherein it is possible to calculate gray scale difference by column from front to back Value.When the gray scale difference value of prostatitis and next column refers to when prostatitis gray value subtracts next column gray value.
(3) (C is calculatedj+1-Cj)+(Cj+2-Cj), the 3rd result of calculation is obtained, wherein, Cj+1-CjRepresent the row of jth+1 and jth The gray scale difference value of row, Cj+2-CjRepresent the gray scale difference value of the current row of jth+2 and jth row.It is related to the gray scale difference of three row in the manner Value, so ensure that the border of determination is more accurate.
(4) (C is calculatedj-Cj+1)+(Cj-Cj+2), the 4th result of calculation is obtained, wherein, Cj-Cj+1Represent jth row and jth+1 The gray scale difference value of row, Cj-Cj+2Represent the gray scale difference value of current jth row and the row of jth+2.It is related to the gray scale difference of three row in the manner Value, so ensure that the border of determination is more accurate.
Preferably, the left margin and right margin of character, Ke Yitong are determined according to adjacent column gray scale difference value and preset characters width Cross following steps realization:
Step A1, compares the adjacent column gray scale difference value in the range of the first default columns, it is determined that being most worth corresponding when prostatitis is made It is the left margin or right margin of current character;Wherein, adjacent column gray scale difference value is calculated in different ways, according to the gray scale difference Value, most value are also different from the corresponding relation on border, can be minimum value correspondence left margin, or the maximum correspondence left side Boundary, rear extended meeting is illustrated.
Whether step A2, detects that the left margin for determining is separated by a distance with right margin and is equal to preset characters width.
Step A3, if it is, boundary alignment is accurate.
Step A4, if it is not, then left margin according to adjacent column gray scale difference value and the preset characters width adjustment character and/or Right margin, until it is determined that left margin and right margin it is separated by a distance equal to preset characters width.
Step A5, it is pre- at a distance of second with the adjacent character for having determined border for other characters in character grey figure If after columns scope, comparing the difference in the range of the 3rd default columns, it is determined that being most worth corresponding when prostatitis is used as correspondence character Left margin or right margin, perform step A2 to step A4 detection border whether accurate positioning, until it is determined that a left side for each character Border and right margin.
The right boundary of any character can be first determined in the present embodiment, after detecting that its boundary alignment is accurate, with the word On the basis of symbol, since adjacent character, the border of other characters is determined one by one.For example, can be according to the character of user input Stain information determines the character for having stain, then optional one in the character without stain, first determines the border of selected character; Border can also be determined since first character.
First default columns scope, the second default columns scope and the 3rd preset the value of columns scope and determine side at first The character position on boundary is relevant.For example, first determining first character, then there is blank, the first default row in view of gray-scale map left side Count and may range from 60 row, first character is normally only included in the range of this.Second default columns scope also with the benchmark of setting It is relevant, for example, on the basis of the left margin of left side adjacent character, the second default columns may range from 25 row;With left side phase The right margin of adjacent character is defined, and the second default columns may range from 5 row.3rd default columns scope may be greater than single The data of character duration.
It is similar, it is necessary to consider single word with according to preset characters Height Adjustment border according to preset characters width adjustment border The shared columns of symbol, here is omitted.
For above-mentioned four kinds of calculations, the specific method of respective determination most value and border corresponding relation is respectively present, Illustrate separately below.
Next column is calculated by column in mode (1) and in the case of the gray scale difference value in prostatitis, determines the first default columns model Corresponding to minimal difference in enclosing when prostatitis is used as the left margin of current character, determine the maximum in the range of the first default columns Corresponding to difference when prostatitis is used as the right margin of current character;
Calculated by column in the case of gray scale difference value of the prostatitis with next column in mode (2), determine the first default columns model Corresponding to maximum difference in enclosing when prostatitis is used as the left margin of current character, determine the minimum in the range of the first default columns Corresponding to difference when prostatitis is used as the right margin of current character;
In the case where mode (3) is calculated the 3rd result of calculation, the minimum value in the range of the first default columns is determined Corresponding jth is arranged as the left margin of character, determines the jth row conduct corresponding to the maximum in the range of the first default columns The right margin of character;
In the case where mode (4) is calculated the 4th result of calculation, the maximum in the range of the first default columns is determined Corresponding jth is arranged as the left margin of character, determines the jth row conduct corresponding to the minimum value in the range of the first default columns The right margin of character.
In the present embodiment, the character that first never can be influenceed by stain starts, and determines the right boundary of character, reduces dirt Influence of the mark to boundary alignment, increased the accuracy of boundary alignment.The present embodiment provides various concrete modes and determines character Right boundary, mode flexibly, in actual applications, can select certain mode to use according to actual conditions.
It should be noted that in above-described embodiment two and embodiment three, up-and-down boundary can with the localization method of right boundary To be used in mixed way, for example, determine up-and-down boundary using the calculation (1) of embodiment two and its corresponding method, using implementation The calculation (2) of example three and its corresponding method determine right boundary.
Example IV
Fig. 3 is the structured flowchart of the character boundary determining device that the embodiment of the present invention four is provided, and the present embodiment is applicable to There is fritter stain on character picture and the stain does not influence the situation of character recognition, as shown in figure 3, the device includes:Gray scale difference Value computing module 31, up-and-down boundary determining module 32 and right boundary determining module 33.
Wherein, gray scale difference value computing module 31, for for character grey figure, calculating adjacent rows gray scale difference value and adjacent column gray scale Difference;Up-and-down boundary determining module 32, for highly determined according to adjacent rows gray scale difference value and preset characters character coboundary and Lower boundary;Right boundary determining module 33, the left margin for determining character according to adjacent column gray scale difference value and preset characters width And right margin.
The character boundary determining device of the present embodiment is big by adjacent rows gray scale difference value, adjacent column gray scale difference value and preset characters Small four borders for determining character, can be accurately positioned character boundary, solve influence of the fritter stain to boundary alignment, and method Simply, without removing stain using additional means, time complexity is low.
Preferably, up-and-down boundary determining module 32 includes:Up-and-down boundary determining unit and height detection unit.Wherein, on Lower boundary determining unit, for according to adjacent rows gray scale difference value, it is determined that be most worth corresponding current line as the coboundary of character or Lower boundary;Whether height detection unit is separated by a distance with lower boundary high equal to preset characters for detecting the coboundary for determining Degree;If it is, boundary alignment is accurate;If it is not, then according to the upper of adjacent rows gray scale difference value and preset characters Height Adjustment character Border and/or lower boundary, until it is determined that coboundary and lower boundary it is separated by a distance equal to preset characters highly.
Gray scale difference value computing module 31 specifically for:The gray scale difference value of next line and current line is calculated line by line;Or, line by line Calculate the gray scale difference value of current line and next line;Or, calculate (Ri+1-Ri)+(Ri+2-Ri), the first result of calculation is obtained, wherein, Ri+1-RiRepresent the gray scale difference value of i+1 row and the i-th row, Ri+2-RiRepresent the gray scale difference value of the i-th+2 row and the i-th row;Or, meter Calculate (Ri-Ri+1)+(Ri-Ri+2), the second result of calculation is obtained, wherein, Ri-Ri+1The gray scale difference value of the i-th row and i+1 row is represented, Ri-Ri+2Represent the gray scale difference value of the i-th row and the i-th+2 row.
Up-and-down boundary determining unit specifically for:
In the case of the gray scale difference value for calculating next line and current line line by line, compare all gray scale difference values for obtaining, really Determine coboundary of the current line corresponding to minimal difference as character, determine the current line corresponding to maximum difference as character Lower boundary;
In the case of the gray scale difference value for calculating current line and next line line by line, compare all gray scale difference values for obtaining, really Determine coboundary of the current line corresponding to maximum difference as character, determine the current line corresponding to minimal difference as character Lower boundary;
In the case where the first result of calculation is calculated, corresponding i-th row of value of minimum in the first result of calculation is determined As the coboundary of character, determine corresponding i-th row of value of maximum in the first result of calculation as the lower boundary of character;
In the case where the second result of calculation is calculated, corresponding i-th row of value of maximum in the first result of calculation is determined As the coboundary of character, determine corresponding i-th row of value of minimum in the first result of calculation as the lower boundary of character.
Preferably, right boundary determining module 33 includes:Right boundary determining unit, width detection unit and boundary adjustment Unit.Wherein, right boundary determining unit, for comparing the adjacent column gray scale difference value in the range of the first default columns, it is determined that being most worth It is corresponding when prostatitis is used as the left margin or right margin of current character;Width detection unit, for detecting the left margin for determining It is separated by a distance with right margin whether to be equal to preset characters width;If it is, boundary alignment is accurate;If it is not, then according to neighbour The left margin and/or right margin of row gray scale difference value and the preset characters width adjustment character, until it is determined that left margin and the right Boundary is separated by a distance equal to preset characters width;Boundary adjustment unit, for for other characters in character grey figure, and After adjacent character through determining border presets columns scope at a distance of second, compare the difference in the range of the 3rd default columns, it is determined that Most it is worth corresponding when prostatitis is used as the left margin or right margin of correspondence character, is negative using width detection unit detection border Level is true, until it is determined that the left margin and right margin of each character.
Gray scale difference value computing module 31 specifically for:Next column and the gray scale difference value when prostatitis are calculated by column;Or, line by line Calculate the gray scale difference value with next column when prostatitis;Or, calculate (Cj+1-Cj)+(Cj+2-Cj), the 3rd result of calculation is obtained, wherein, Cj+1-CjRepresent the gray scale difference value of the row of jth+1 and jth row, Cj+2-CjRepresent the gray scale difference value of the current row of jth+2 and jth row;Or Person, calculates (Cj-Cj+1)+(Cj-Cj+2), the 4th result of calculation is obtained, wherein, Cj-Cj+1Represent the gray scale of jth row and the row of jth+1 Difference, Cj-Cj+2Represent the gray scale difference value of current jth row and the row of jth+2.
Right boundary determining unit specifically for:
Next column is being calculated by column and in the case of the gray scale difference value in prostatitis, is being determined in the range of the first default columns most Corresponding to small difference when prostatitis is used as the left margin of current character, determine that the maximum difference institute in the range of the first default columns is right Answer when prostatitis is used as the right margin of current character;
Calculating by column in the case of gray scale difference value of the prostatitis with next column, determining in the range of the first default columns most Corresponding to big difference when prostatitis is used as the left margin of current character, determine that the minimal difference institute in the range of the first default columns is right Answer when prostatitis is used as the right margin of current character;
In the case where the 3rd result of calculation is calculated, determine corresponding to the minimum value in the range of the first default columns Jth is arranged as the left margin of character, determines that the jth corresponding to the maximum in the range of the first default columns is arranged as the right side of character Border;
In the case where the 4th result of calculation is calculated, determine corresponding to the maximum in the range of the first default columns Jth is arranged as the left margin of character, determines that the jth corresponding to the minimum value in the range of the first default columns is arranged as the right side of character Border.
The character boundary that the executable any embodiment of the present invention of above-mentioned character boundary determining device is provided determines method, has It is standby to perform the corresponding functional module of the method and beneficial effect.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes, Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also More other Equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (10)

1. a kind of character boundary determines method, it is characterised in that including:
For character grey figure, adjacent rows gray scale difference value and adjacent column gray scale difference value are calculated;
Coboundary and the lower boundary of character are highly determined according to the adjacent rows gray scale difference value and preset characters;
The left margin and right margin of character are determined according to the adjacent column gray scale difference value and preset characters width.
2. method according to claim 1, it is characterised in that according to the adjacent rows gray scale difference value and preset characters height really Determine coboundary and the lower boundary of character, including:
According to the adjacent rows gray scale difference value, it is determined that being most worth coboundary or lower boundary of the corresponding current line as character;
Detect that the coboundary for determining is separated by a distance with lower boundary and whether be equal to the preset characters highly;
If it is, boundary alignment is accurate;
If it is not, then according to the adjacent rows gray scale difference value and the preset characters Height Adjustment coboundary of character and/or Lower boundary, until it is determined that coboundary and lower boundary it is separated by a distance equal to the preset characters highly.
3. method according to claim 2, it is characterised in that calculate adjacent rows gray scale difference value, including:
The gray scale difference value of next line and current line is calculated line by line;Or,
The gray scale difference value of current line and next line is calculated line by line;Or,
Calculate (Ri+1-Ri)+(Ri+2-Ri), the first result of calculation is obtained, wherein, Ri+1-RiRepresent the gray scale of i+1 row and the i-th row Difference, Ri+2-RiRepresent the gray scale difference value of the i-th+2 row and the i-th row;Or,
Calculate (Ri-Ri+1)+(Ri-Ri+2), the second result of calculation is obtained, wherein, Ri-Ri+1Represent the gray scale of the i-th row and i+1 row Difference, Ri-Ri+2Represent the gray scale difference value of the i-th row and the i-th+2 row.
4. method according to claim 3, it is characterised in that according to the adjacent rows gray scale difference value, it is determined that being most worth corresponding Coboundary or lower boundary of the current line as character, including:
In the case of the gray scale difference value for calculating next line and current line line by line, compare all gray scale difference values for obtaining, it is determined that most Current line corresponding to small difference determines the current line corresponding to maximum difference as the following of character as the coboundary of character Boundary;
In the case of the gray scale difference value for calculating current line and next line line by line, compare all gray scale difference values for obtaining, it is determined that most Current line corresponding to big difference determines the current line corresponding to minimal difference as the following of character as the coboundary of character Boundary;
In the case where the first result of calculation is calculated, corresponding i-th row of value of minimum in first result of calculation is determined As the coboundary of character, determine corresponding i-th row of value of maximum in first result of calculation as the lower boundary of character;
In the case where the second result of calculation is calculated, corresponding i-th row of value of maximum in first result of calculation is determined As the coboundary of character, determine corresponding i-th row of value of minimum in first result of calculation as the lower boundary of character.
5. method according to claim 1, it is characterised in that true according to the adjacent column gray scale difference value and preset characters width Determine the left margin and right margin of character, including:
Step A1, compares the adjacent column gray scale difference value in the range of the first default columns, it is determined that being most worth corresponding when prostatitis is used as working as The left margin or right margin of preceding character;
Whether step A2, detects that the left margin for determining is separated by a distance with right margin and is equal to the preset characters width;
Step A3, if it is, boundary alignment is accurate;
Step A4, if it is not, then according to the adjacent column gray scale difference value and the left margin of the preset characters width adjustment character And/or right margin, until it is determined that left margin and right margin it is separated by a distance equal to the preset characters width;
Step A5, it is pre- at a distance of second with the adjacent character for having determined border for other characters in the character grey figure If after columns scope, comparing the difference in the range of the 3rd default columns, it is determined that being most worth corresponding when prostatitis is used as correspondence character Left margin or right margin, perform the step A2 to step A4 detection border whether accurate positioning, until it is determined that each character Left margin and right margin.
6. method according to claim 5, it is characterised in that calculate adjacent column gray scale difference value, including:
Next column and the gray scale difference value when prostatitis are calculated by column;Or,
The gray scale difference value when prostatitis with next column is calculated by column;Or,
Calculate (Cj+1-Cj)+(Cj+2-Cj), the 3rd result of calculation is obtained, wherein, Cj+1-CjRepresent the gray scale of the row of jth+1 and jth row Difference, Cj+2-CjRepresent the gray scale difference value of the current row of jth+2 and jth row;Or,
Calculate (Cj-Cj+1)+(Cj-Cj+2), the 4th result of calculation is obtained, wherein, Cj-Cj+1Represent the gray scale of jth row and the row of jth+1 Difference, Cj-Cj+2Represent the gray scale difference value of current jth row and the row of jth+2.
7. method according to claim 6, it is characterised in that it is determined that being most worth corresponding when prostatitis is used as current character Left margin or right margin, including:
Next column is being calculated by column and in the case of the gray scale difference value in prostatitis, is being determined in the range of the described first default columns most Corresponding to small difference when prostatitis is used as the left margin of current character, determine the maximum difference in the range of the described first default columns It is corresponding when prostatitis is used as the right margin of current character;
Calculating by column in the case of gray scale difference value of the prostatitis with next column, determining in the range of the described first default columns most Corresponding to big difference when prostatitis is used as the left margin of current character, determine the minimal difference in the range of the described first default columns It is corresponding when prostatitis is used as the right margin of current character;
In the case where the 3rd result of calculation is calculated, determine corresponding to the minimum value in the range of the described first default columns Jth is arranged as the left margin of character, determines that the jth corresponding to the maximum in the range of the described first default columns is arranged as character Right margin;
In the case where the 4th result of calculation is calculated, determine corresponding to the maximum in the range of the described first default columns Jth is arranged as the left margin of character, determines that the jth corresponding to the minimum value in the range of the described first default columns is arranged as character Right margin.
8. a kind of character boundary determining device, it is characterised in that including:
Gray scale difference value computing module, for for character grey figure, calculating adjacent rows gray scale difference value and adjacent column gray scale difference value;
Up-and-down boundary determining module, for highly determined according to the adjacent rows gray scale difference value and preset characters character coboundary and Lower boundary;
Right boundary determining module, for determined according to the adjacent column gray scale difference value and preset characters width character left margin and Right margin.
9. device according to claim 8, it is characterised in that the up-and-down boundary determining module includes:
Up-and-down boundary determining unit, for according to the adjacent rows gray scale difference value, it is determined that being most worth corresponding current line as character Coboundary or lower boundary;
Whether height detection unit is separated by a distance with lower boundary high equal to the preset characters for detecting the coboundary for determining Degree;If it is, boundary alignment is accurate;If it is not, then according to the adjacent rows gray scale difference value and the preset characters Height Adjustment The coboundary of the character and/or lower boundary, until it is determined that coboundary and lower boundary it is separated by a distance equal to the predetermined word Symbol height.
10. device according to claim 9, it is characterised in that the gray scale difference value computing module specifically for:
The gray scale difference value of next line and current line is calculated line by line;Or,
The gray scale difference value of current line and next line is calculated line by line;Or,
Calculate (Ri+1-Ri)+(Ri+2-Ri), the first result of calculation is obtained, wherein, Ri+1-RiRepresent the gray scale of i+1 row and the i-th row Difference, Ri+2-RiRepresent the gray scale difference value of the i-th+2 row and the i-th row;Or,
Calculate (Ri-Ri+1)+(Ri-Ri+2), the second result of calculation is obtained, wherein, Ri-Ri+1Represent the gray scale of the i-th row and i+1 row Difference, Ri-Ri+2Represent the gray scale difference value of the i-th row and the i-th+2 row.
CN201710233264.5A 2017-04-11 2017-04-11 Character boundary determining method and device Active CN106886777B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710233264.5A CN106886777B (en) 2017-04-11 2017-04-11 Character boundary determining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710233264.5A CN106886777B (en) 2017-04-11 2017-04-11 Character boundary determining method and device

Publications (2)

Publication Number Publication Date
CN106886777A true CN106886777A (en) 2017-06-23
CN106886777B CN106886777B (en) 2020-06-09

Family

ID=59182810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710233264.5A Active CN106886777B (en) 2017-04-11 2017-04-11 Character boundary determining method and device

Country Status (1)

Country Link
CN (1) CN106886777B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321895A (en) * 2019-04-30 2019-10-11 北京市商汤科技开发有限公司 Certificate recognition methods and device, electronic equipment, computer readable storage medium
CN110533019A (en) * 2018-05-23 2019-12-03 杭州海康威视数字技术股份有限公司 License plate locating method, device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1920849A (en) * 2005-08-26 2007-02-28 电子科技大学 Vehicle license plate extraction method based on high-hat switch and wavelet switch
CN101711398A (en) * 2007-02-22 2010-05-19 三星电子株式会社 Extraction method of an interest region for multimedia mobile users
CN101751785A (en) * 2010-01-12 2010-06-23 杭州电子科技大学 Automatic license plate recognition method based on image processing
CN102054169A (en) * 2010-12-28 2011-05-11 青岛海信网络科技股份有限公司 License plate positioning method
CN102722711A (en) * 2012-05-31 2012-10-10 信帧电子技术(北京)有限公司 License plate character sequence identification method and device in license plate type identification
CN104463209A (en) * 2014-12-08 2015-03-25 厦门理工学院 Method for recognizing digital code on PCB based on BP neural network
CN105243730A (en) * 2015-10-28 2016-01-13 深圳怡化电脑股份有限公司 Banknote identification method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1920849A (en) * 2005-08-26 2007-02-28 电子科技大学 Vehicle license plate extraction method based on high-hat switch and wavelet switch
CN101711398A (en) * 2007-02-22 2010-05-19 三星电子株式会社 Extraction method of an interest region for multimedia mobile users
CN101751785A (en) * 2010-01-12 2010-06-23 杭州电子科技大学 Automatic license plate recognition method based on image processing
CN102054169A (en) * 2010-12-28 2011-05-11 青岛海信网络科技股份有限公司 License plate positioning method
CN102722711A (en) * 2012-05-31 2012-10-10 信帧电子技术(北京)有限公司 License plate character sequence identification method and device in license plate type identification
CN104463209A (en) * 2014-12-08 2015-03-25 厦门理工学院 Method for recognizing digital code on PCB based on BP neural network
CN105243730A (en) * 2015-10-28 2016-01-13 深圳怡化电脑股份有限公司 Banknote identification method and system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
孙强: "低质量印刷体字符分割与识别研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
江海燕: "液晶显示仪表示值机器视觉检测系统研制", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
王静娇 等: "基于TMS320DM642的人民币图像特征识别系统", 《数据采集与处理》 *
苑玮琦, 江海燕: "基于 ACSS 角点定位的液晶显示仪表示值识别算法", 《计算机系统应用》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110533019A (en) * 2018-05-23 2019-12-03 杭州海康威视数字技术股份有限公司 License plate locating method, device and storage medium
CN110321895A (en) * 2019-04-30 2019-10-11 北京市商汤科技开发有限公司 Certificate recognition methods and device, electronic equipment, computer readable storage medium

Also Published As

Publication number Publication date
CN106886777B (en) 2020-06-09

Similar Documents

Publication Publication Date Title
CN109740469B (en) Lane line detection method, lane line detection device, computer device, and storage medium
JPWO2008026286A1 (en) Paper sheet identification apparatus and paper sheet identification method
CN107067536B (en) A kind of image boundary determines method, apparatus, equipment and storage medium
CN106599896A (en) Character segmentation method, character segmentation device, element detection method, and element detection device
CN105069900A (en) Method and device for processing banknote information
CN104504717A (en) Method and device for detection of image information
CN104331695A (en) Robust round identifier shape quality detection method
CN104598907A (en) Stroke width figure based method for extracting Chinese character data from image
JP2013101616A (en) Method and system for dividing characters of text row having various character widths
CN112446262A (en) Text analysis method, text analysis device, text analysis terminal and computer-readable storage medium
CN105761256B (en) The sub-pixel edge straight line acquisition methods and device of image
JPH077256B2 (en) How to generate a gray scale pattern
CN106886777A (en) A kind of character boundary determines method and device
CN108734161B (en) Method, device and equipment for identifying prefix number area and storage medium
CN107358718B (en) A kind of crown word number identification method, device, equipment and storage medium
EP2256691B1 (en) Image processing device for vehicle and image processing program
CN109003257B (en) Optical character verification method
CN106846610B (en) A kind of bank note version recognition methods and device
CN110059695B (en) Character segmentation method based on vertical projection and terminal
CN104573656B (en) A kind of car plate color determination methods based on connected region information
CN106951902A (en) A kind of image binaryzation processing method and processing device
CN107798355B (en) Automatic analysis and judgment method based on document image format
CN112528895B (en) Calculation method for detecting change of financial bill image and bill number
CN116168192A (en) Image detection area determination method and device, electronic equipment and storage medium
JP2011248415A (en) Image processing apparatus and image processing program

Legal Events

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