CN109003257A - A kind of optical character verification method - Google Patents

A kind of optical character verification method Download PDF

Info

Publication number
CN109003257A
CN109003257A CN201810619854.6A CN201810619854A CN109003257A CN 109003257 A CN109003257 A CN 109003257A CN 201810619854 A CN201810619854 A CN 201810619854A CN 109003257 A CN109003257 A CN 109003257A
Authority
CN
China
Prior art keywords
text
character
information
characteristic
index
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
CN201810619854.6A
Other languages
Chinese (zh)
Other versions
CN109003257B (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 Huahan Weiye Technology Co Ltd
Original Assignee
Shenzhen Huahan Weiye Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huahan Weiye Technology Co Ltd filed Critical Shenzhen Huahan Weiye Technology Co Ltd
Priority to CN201810619854.6A priority Critical patent/CN109003257B/en
Publication of CN109003257A publication Critical patent/CN109003257A/en
Application granted granted Critical
Publication of CN109003257B publication Critical patent/CN109003257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0006Industrial image inspection using a design-rule based approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30144Printing quality
    • 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

Abstract

A kind of optical character verification method, including obtaining image to be detected, acquisition text information to be detected and character information to be detected, determining the defect type of text information and determining the defect type of character information.Text information and character information to be detected are obtained due to default tree structure template, conducive to text information and character information are quickly identified and obtained according to template, so that system enhances the information extraction ability of image to be detected.Moreover, the coarse positioning of defect type has been respectively adopted to text information to be detected and character information and better defect location effect can be achieved in pinpoint mode, this strategy.Further, since using text posture index, text quality's index, the Multiple range test mechanism of character posture index and character qualities index, the determination range of defect type is improved, conducive to more accurate judging result is obtained.

Description

A kind of optical character verification method
Technical field
The present invention relates to field of optical detection, and in particular to a kind of optical character verification method.
Background technique
Optical character verifies (Optical Character Verification, abbreviation OCV), is to utilize optical visual skill Art specially identifies the character for printing or carving on various electronic components, computor-keyboard, printed matter and other items surface And detection, for checking the print quality and its easy identification of character, common character include number, English alphabet, symbol, Chinese character etc..The technology can also check quality, the comparison of character string in addition to that can check whether presented character content is correct Degree and clarity, and the underproof sample of quality is marked or is rejected, for guaranteeing quality when unlike material printing.
Optical character verifying is usually applied to various printing industry, laser laser carving industry, and detectable defect kind is various, Mainly there are bad, fuzzy printing, silk-screen offset and crooked, suety, character missing, partially dark, partially bright, point/white point, burr, company Ink/spanishing, silk-screen are slightly heterochromatic etc., specific visible Fig. 1-8.
Currently, the technical way of optical character verifying is that will have the printing image of qualified printing information as template Image, determine include measurement information to be checked image to be detected relative to template image shift position and deflection direction, calculate to The transformation parameter for the rigid transformation that detection image is aligned with template image, according to transformation parameter to image to be detected converted with Make it in alignment with template image, at this point, compared with image to be detected put pixel-by-pixel with template image, to treat detection information Similarities and differences between qualified printing information are verified.This optical character verification method has following defects that (1) to be checked When altimetric image is converted, need to guarantee higher positioning accuracy, if positional shift occurs, to image to be detected and Prototype drawing The probability of erroneous detection will be greatly increased when the comparison that picture is put pixel-by-pixel;(2) due to being to carry out comparing one by one pixel-by-pixel to image Compared with not only comparing measurement information to be checked, also compare the pixel in image other than measurement information to be checked, in this way, increasing additional Comparison workload, be unfavorable for achieving the effect that quickly comparing;It (3), can not since the comparison procedure of image is confined to pixel Effectively check the defect of single character among character string, and detectable defect kind is less, can only detect that silk-screen is inclined The simple defect of shifting, skew etc, it is helpless to other defect types, cause in practical applications, existing optics word Symbol verification method be unable to reach comprehensively, accurately verification the verifying results.
Summary of the invention
The present invention solves the technical problem of how to overcome the shortcomings of existing optical character verification method, to reach complete Face, accurately verification the verifying results.In order to solve the above technical problems, this application provides a kind of optical character verification methods.
According in a first aspect, providing a kind of optical character verification method in a kind of embodiment, comprising the following steps:
Image to be detected is obtained, described image to be detected includes text information to be detected, and the text information includes one A or multiple character informations;
Obtain the characteristic information of the text information to be detected and the text information in described image to be detected;
The characteristic information of the text information is compared with preset text index, according to comparison result determination The defect type of text information;
The characteristic information for obtaining each character information and each character information in the text information, according to each word The characteristic information of symbol information determines the defect type of the character information.
The characteristic information for obtaining the text information, comprising:
The text information is obtained from described image to be detected according to preset tree structure template;
The characteristic information for obtaining the text information is calculated, the characteristic information of the text information includes text posture feature Information and/or text quality's characteristic information;Wherein, the text posture feature information includes X to translational movement, Y-direction translational movement, X It is special to one of amount of zoom, Y-direction amount of zoom, rotation angular amount, shear angular amount these characteristic quantities or more persons, the text quality Reference breath includes contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, vertical throwing One of these characteristic quantities of shadow similarity or more persons.
The tree structure template includes the text filed of preset number, each text filed character including preset number Region, each character zone include the monomer character zone of preset number;
It is described text filed for determining that text information, the character zone are used for according to certainly according to the regional scope of itself The regional scope of body determines each character information in text information, and the monomer character zone is for determining in character information Each monomer character, the monomer character are any one of number, letter, symbol, Chinese character.
The optical character verification method, further includes: preset the tree structure template;It is described to preset the tree-like knot Structure template, comprising the following steps:
Obtain the template image with received text;
Binary conversion treatment is carried out to the template image, obtains the foreground image with the received text;
Connection processing is carried out to the foreground image, each monomer character in the received text is obtained, by each list The boundary rectangle of body character is formed by monomer character zone of the region as each monomer character;
The monomer character of instruction selection preset number constructs character depending on the user's operation, by the external of the character of the building Rectangle is formed by character zone of the region as the character of the building;
The character of instruction selection preset number constructs text, shape described in the boundary rectangle by the text depending on the user's operation At prime area of the region as text, contour offset setting is carried out to the prime area of text or ROI is arranged, after setting Prime area as the text filed of the text.
It is described that the text information is obtained from described image to be detected according to preset tree structure template, comprising: will With the text filed text to match of the tree structure template as the text information in described image to be detected.
The characteristic information by the text information is compared with preset text index, is determined according to comparison result The defect type of the text information, comprising:
Preset text index includes text posture index and/or text quality's index;The text posture index includes X To translational movement, Y-direction translational movement, X to amount of zoom, Y-direction amount of zoom, rotate angular amount, the corresponding error of shear angular amount institute One of range or more persons, text quality's index include contrast, cross-correlation coefficient, gamma, area coefficient, positioning One of score, floor projection similarity, the corresponding numberical range of upright projection similarity institute or more persons;
By each characteristic quantity in the text posture feature information respectively with corresponding characteristic quantity in the text posture index Corresponding error range is compared, when a characteristic quantity is more than in the text posture index in the text posture feature information When the corresponding error range of this feature amount, then by the text information labeled as defect type corresponding to this feature amount;
Each characteristic quantity in text quality's characteristic information is corresponding with corresponding characteristic quantity in the quality index respectively Error range be compared, when in text quality's characteristic information a characteristic quantity be more than text quality's index in the spy When the corresponding numberical range of sign amount, then by the text information labeled as defect type corresponding to this feature amount.
The optical character verification method, further includes: preset the text index;It is described to preset the text index, packet Include following steps:
At least obtain the non-defective unit image that two frames all have qualified text;
According to the text filed every frame non-defective unit figure of determination corresponding with the qualification text in the tree structure template Qualified text as in;
The text posture feature information and/or text quality's characteristic information of qualified text in every frame non-defective unit image are obtained, often The text posture feature information of a qualification text includes X to translational movement, Y-direction translational movement, X to amount of zoom, Y-direction amount of zoom, rotation Text quality's characteristic information of one of angular amount, shear angular amount these characteristic quantities or more persons, each qualification text include pair Than degree, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, upright projection similarity these One of characteristic quantity or more persons;
Identical characteristic quantity in the text posture feature information of each qualified text is compared, each feature is respectively obtained The maximum value and minimum value of amount determine the corresponding error range of this feature amount according to the maximum value of each characteristic quantity and minimum value, Using the error range of each characteristic quantity as the text posture index in the text index;
Identical characteristic quantity in text quality's characteristic information of each qualified text is compared, each feature is respectively obtained The average and standard deviation of amount determines the corresponding numberical range of this feature amount according to the average and standard deviation of each characteristic quantity, Using the numberical range of each characteristic quantity as text quality's index in the text index.
It is described to be compared identical characteristic quantity in the text posture feature information of each qualified text, it respectively obtains each The maximum value and minimum value of characteristic quantity determine the corresponding error model of this feature amount according to the maximum value of each characteristic quantity and minimum value It encloses, comprising:
For each characteristic quantity in the text posture feature information of each qualified text, the maximum value of this feature amount is obtained And minimum value;
The maximum value of this feature amount and the average value of minimum value are calculated, the maximum value of this feature amount and the difference of minimum value are calculated Difference and preset first coefficient are carried out quadrature and obtain the first value by value;
The corresponding average value of this feature amount and the first value are made the difference to obtain under the corresponding error range of this feature amount The corresponding average value of this feature amount and the first value are done and are obtained the upper limit of the corresponding error range of this feature amount by limit value Value.
It is described to be compared identical characteristic quantity in text quality's characteristic information of each qualified text, it respectively obtains each The average and standard deviation of characteristic quantity determines the corresponding numerical value model of this feature amount according to the average and standard deviation of each characteristic quantity It encloses, comprising:
For each characteristic quantity in text quality's characteristic information of each qualified text, the average value of this feature amount is obtained And standard deviation;
The standard deviation of this feature amount and preset second coefficient are subjected to quadrature and obtain second value, by being averaged for this feature amount Value and second value make the difference to obtain the lower limit value of the corresponding numberical range of this feature amount, and the average value of this feature amount and second value are done The upper limit value of numberical range corresponding with this feature amount is obtained.
The characteristic information of each character information obtained in the text information and each character information, according to every The characteristic information of a character information determines the defect type of the character information, comprising: according to the tree structure template to described Text information is decomposed, and one or more character informations are obtained;Obtain the characteristic information of each character information;For each word Information is accorded with, the characteristic information of the character information is compared with preset character index, the word is determined according to comparison result Accord with the defect type of information.
It is described that the text information is decomposed according to preset tree structure template, obtain one or more character letters Breath, comprising: according to the text filed determination text envelope corresponding with the text information in the tree structure template Breath;According to the text information it is corresponding it is text filed in multiple character zones the text information is decomposed, will With all monomer characters that each character zone matches as the corresponding character information of the character zone.
The characteristic information for obtaining each character information, comprising: for each character information, calculate and obtain character letter The characteristic information of breath, the characteristic information of the character information include character posture feature information and/or character qualities characteristic information;Its In, the character posture feature information includes X to one of translational movement, Y-direction translational movement these characteristic quantities or more persons, the character Qualitative character information include contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, One of these characteristic quantities of upright projection similarity or more persons.
It is described that the characteristic information of the character information is compared by each character information with preset character index, The defect type of the character information is determined according to comparison result, comprising:
Preset character index includes character position index and/or character qualities index;The character position index includes X It include pair to one of translational movement, the corresponding error range of Y-direction translational movement institute or more persons, the character qualities characteristic information Divide than degree, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, upright projection similarity One of not corresponding numberical range or more persons;
For each character information, by each characteristic quantity in the character posture feature information respectively with the character position index In the corresponding corresponding error range of characteristic quantity be compared, when a characteristic quantity is more than the text in the character posture feature information In this posture index when the corresponding error range of this feature amount, then by the character information labeled as defect corresponding to this feature amount Type;
For each character information, by each characteristic quantity in the character qualities characteristic information respectively with phase in the quality index The corresponding numberical range of the characteristic quantity answered is compared, when a characteristic quantity is more than the character matter in the character qualities characteristic information In figureofmerit when the corresponding numberical range of this feature amount, then by the character information labeled as defect class corresponding to this feature amount Type.
Preset the character index the following steps are included:
At least obtain the non-defective unit image that two frames all have qualified text;
According to the text filed every frame non-defective unit figure of determination corresponding with the qualification text in the tree structure template Qualified text as in;
According in the tree structure template it is corresponding with the qualified text it is text filed in multiple character areas Domain decomposes the qualified text, using all monomer characters fallen into each character zone as the character zone pair The qualified character answered, the qualification character are the character information of in the qualified text and each monomer character qualification;
Obtain the character posture feature information and/or character qualities characteristic information in each qualified character, each qualification word The character posture feature information of symbol includes X to one of translational movement, Y-direction translational movement these characteristic quantities or more persons, each qualification word The character qualities characteristic information of symbol includes contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection One of similarity, upright projection similarity these characteristic quantities or more persons;
Identical characteristic quantity in the character posture feature information of each qualified character is compared, each feature is respectively obtained The maximum value and minimum value of amount determine the corresponding error range of this feature amount according to the maximum value of each characteristic quantity and minimum value, Using the error range of each characteristic quantity as the character posture index in the character index;
Identical characteristic quantity in the character qualities characteristic information of each qualified character is compared, each feature is respectively obtained The average and standard deviation of amount determines the corresponding numberical range of this feature amount according to the average and standard deviation of each characteristic quantity, Using the numberical range of each characteristic quantity as the character qualities index in the character index.
According to second aspect, a kind of computer readable storage medium, including program, described program are provided in a kind of embodiment It can be executed by processor to realize method as described in relation to the first aspect.
According to a kind of optical character verification method of above-described embodiment, including obtains image to be detected, obtains text to be detected This information and character information to be detected determine the defect type of text information and determine the defect type of character information.First Aspect obtains text information and character information to be detected due to default tree structure template, quickly knows conducive to according to template Not and text information and character information are obtained, so that system enhances the information extraction ability of image to be detected.Second party Face carries out defect type judgement to text information to be detected, and can quickly determine current text information whether there is defect, It realizes the coarse positioning effect of defect, and then defect type is carried out to each character information in the text information of existing defects and is sentenced Disconnected, to realize the accurate positioning effect of defect, this coarse positioning and pinpoint strategy realize better defect location effect. The third aspect, due to using the multiple of text posture index, text quality's index, character posture index and character qualities index Comparison mechanism, so that the defect about posture feature can be obtained when judging the defect type of text information and character information Type also can be obtained the defect type about qualitative character, improve the determination range of defect type, more accurate conducive to obtaining Judging result.Fourth aspect, since text index and character index are as obtained from learning to non-defective unit image Numberical range, so that system provides more reasonable serious forgiveness to text information to be detected and character information, conducive to comforming The optical character for meeting user's requirement is filtered out in more measurement informations to be checked.5th aspect, due in pre-set text index and word By means of tree structure template when according with index, so that robustness when systems for optical character is verified is improved, enhancing The stability of system.
Detailed description of the invention
Fig. 1 is the schematic diagram of template image;
Fig. 2 is the schematic diagram for printing bad image;
Fig. 3 is the schematic diagram of blurred picture;
Fig. 4 is the schematic diagram of silk-screen offset and skewed image;
Fig. 5 is the schematic diagram of suety image;
Fig. 6 is the schematic diagram of character missing image;
Fig. 7 is the schematic diagram of partially dark image;
Fig. 8 is the schematic diagram of partially bright image;
Fig. 9 is the flow chart of optical character verification method;
Figure 10 is the flow chart of default tree structure template;
Figure 11 is the structure chart of tree structure template;
Figure 12 is the flow chart for determining the defect type of text information;
Figure 13 is the flow chart for obtaining text index;
Figure 14 is the flow chart for determining the defect type of character information;
Figure 15 is the flow chart for obtaining character index;
Figure 16 is the overall flow figure of optical character verification method;
Figure 17 is the structure chart that optical character verifies system;
Figure 18 is the schematic diagram of registered images;
Figure 19 is the schematic diagram of foreground image;
Figure 20 is the schematic diagram of monomer character zone;
Figure 21 is the schematic diagram of character zone;
Figure 22 is text filed schematic diagram.
Specific embodiment
Below by specific embodiment combination attached drawing, invention is further described in detail.Wherein different embodiments Middle similar component uses associated similar element numbers.In the following embodiments, many datail descriptions be in order to The application is better understood.However, those skilled in the art can recognize without lifting an eyebrow, part of feature It is dispensed, or can be substituted by other elements, material, method in varied situations.In some cases, this Shen Please it is relevant it is some operation there is no in the description show or describe, this is the core in order to avoid the application by mistake More descriptions are flooded, and to those skilled in the art, these relevant operations, which are described in detail, not to be necessary, they Relevant operation can be completely understood according to the general technology knowledge of description and this field in specification.
It is formed respectively in addition, feature described in this description, operation or feature can combine in any suitable way Kind embodiment.Meanwhile each step in method description or movement can also can be aobvious and easy according to those skilled in the art institute The mode carry out sequence exchange or adjustment seen.Therefore, the various sequences in the description and the appended drawings are intended merely to clearly describe a certain A embodiment is not meant to be necessary sequence, and wherein some sequentially must comply with unless otherwise indicated.
It is herein component institute serialization number itself, such as " first ", " second " etc., is only used for distinguishing described object, Without any sequence or art-recognized meanings.And " connection ", " connection " described in the application, unless otherwise instructed, include directly and It is indirectly connected with (connection).
Referring to FIG. 9, this application discloses a kind of optical character verification method, for according to text envelope in image to be detected The characteristic information of breath and the characteristic information of character information determine the defect type of text information and the defect class of character information respectively Type, the method comprising the steps of S100-S400 illustrate separately below.
Step S100 obtains image to be detected, and image to be detected includes text information to be detected, and text information includes one A or multiple character informations.
Here image to be detected can shoot for any type of photographic device, text information and character information clearly may be used The image seen, text information are the identification information of number, letter, symbol and/or Chinese character composition, wherein single number, word Female, symbol or Chinese character are known as monomer character, and the character that one or more monomer characters are constituted is known as character information, one or more The text that character information is constituted is known as text information, and text information is also all characters or portion present in image to be detected Divide the general designation of character (partial character can be indicated with a line character, a column character).
Step S200 obtains the characteristic information of the text information and text information to be detected in image to be detected.
In one embodiment, firstly, presetting a tree structure template, according to preset tree structure template to be detected Text information is obtained in image.The process of default tree structure template will be illustrated below, the step being detailed in Figure 10 A01-A05。
Step A01 obtains the template image (also referred to as registered images can refer to Figure 18) with received text, received text The text information being used to form in step S100, i.e. text information in image to be detected are using received text as template and to pass through What the modes such as printing, laser carving, etching, photocopy were formed.
Step A02 carries out image dividing processing to template image and (it is specific, unique to divide the image into several The region of matter and the process that identical number is assigned to the pixel of the same area), preferably by the way of binary conversion treatment, obtain To the foreground image with received text.In one embodiment, the mode that automatic threshold or manual threshold value can be used is set Binarization threshold is set, for example, binarization threshold can be set as 70, then, the received text in foreground image will form such as white Such highlight regions more easily are extracted to form foreground image, can refer to Figure 19 by the highlight color of color.
Step A03 carries out connection processing to foreground image, to avoid brought by the remaining image information in addition to foreground image Interference, can speed connection processing speed, and can optimize connection processing result.In one embodiment, connection processing can be used Existing " image cutting " and " image mending " technology, the connected region between monomer character is mainly carried out cutting by the former to be made Formation monomer character and monomer character isolation effect, the region of designated position mainly carries out color filling and is allowed to shape by the latter At the connection effect between each stroke of monomer character.
Each monomer character in received text is obtained after connection processing, the boundary rectangle of each monomer character is formed Monomer character zone of the region as each monomer character, can refer to Figure 20.
Step A04, the monomer character of instruction selection preset number constructs character depending on the user's operation, by the word of the building The boundary rectangle of symbol is formed by character zone of the region as the character of the building, can refer to Figure 21.For example, user can select Adjacent two capitalization English letters building character is selected, and using the circumscribed rectangular region of the two capitalization English letters as one Character zone.
Step A05, the character of instruction selection preset number constructs text depending on the user's operation, by the external square of the text Prime area of the region of formation described in shape as text carries out contour offset setting to the prime area of text or ROI is arranged, Using the prime area after setting as the text filed of the text, Figure 22 can refer to.Here contour offset setting refers to profile The diminution or widened process that line is carried out according to offset parameter, ROI setting refer to contour line according to irregular geometric figure The process migrated, the purpose for carrying out contour offset setting or ROI setting is the text filed of further review text, is mentioned High text filed resolution.
It is learnt by the explanation of step A01-A05, the character of each monomer character, building in received text and building Text all has specific display area, text filed can carry out with monomer character zone, character zone and one by one position respectively Set restriction, then tree structure template can be built up for these monomer character zones, character zone and text filed group, come determine by The position for the text information in other images that received text is formed.It can be seen that by the obtained tree structure of template image Template can be structure shown in Figure 11 comprising preset number m's is text filed, each text filed including preset number n Character zone, each character zone include the monomer character zone of preset number x;Wherein, it is text filed for according to itself Regional scope determines that text information, character zone are used to determine that each character in text information is believed according to the regional scope of itself Breath, monomer character zone are used to determine that each monomer character in character information, monomer character to be number, letter, symbol, Chinese character Any one of.It should be noted that in each template image, about text filed preset number m, about character zone Preset number n, about monomer character zone preset number x all in accordance with the content of text of received text or the randomness of user It operates related, is not specifically limited here.For example, Figure 21 is to be obtained according to registered images (visible Figure 18) about character zone Image, using the content of text of every a line as a text information, then for text information " ISE ASSEMBLY ", Boundary rectangle be formed by region be it is text filed, " I ", " SE ", " ASSEMBLY " each boundary rectangle be formed by region point Not Wei character zone, it is respectively monomer word that the boundary rectangle of each English alphabet in " SE ", " ASSEMBLY ", which is formed by region, Region is accorded with, and the text filed of three lines of text content present position, character zone and monomer character zone are collectively formed in Figure 21 One tree structure template.
In one embodiment, when obtaining text information to be detected from image to be detected, according to preset tree structure Template obtains the text information from described image to be detected, in one embodiment: by image to be detected with it is tree-like The text filed text to match of stay in place form is as text information, i.e., by the relative position of this paper each in image to be detected It is compared with the text filed corresponding search range of some of tree structure template, if the relative position of one of text accords with Together in the search range of this article one's respective area, then it is assumed that the text and this article one's respective area match, and realize the coarse positioning mistake of the text Journey, and then using the text as text information to be detected.It should be appreciated by those skilled in the art that in order to look in the picture To the target object for rotating, scaling and/or shearing, the template of different positions and pose and text filed can be created, that is, It says and search space is subjected to discretization, this discretization is similar to carry out in the case where translation using pixel discrete;With translation The difference is that the discretization in template direction, scaling depends on the size of template, this is because the template the big more can distinguish smaller The variation of angle, for example, the template-setup angle step of size for being 200 for diameter is 1 °, scaling step-length is 0.1, then Bigger template is needed using smaller angle step, and vice versa.By in the discretized space of template information with it is to be matched Image carries out Similarity measures, obtains the highest pose of similitude as final matching result.It, can in order to accelerate matching process To carry out acceleration processing using Pyramidal search technology, it is similar that the matching of text can choose Gray-scale Matching or characteristic matching etc. Matching process.Here example 1 will be enumerated to be illustrated the similarity calculation process of characteristic matching, enumerate example 2 to Gray-scale Matching Calculating process be illustrated.
Example 1, the token state of cross-correlation coefficient similarity degree between text information to be detected and received text, uses formula It is expressed as
Wherein, n indicates the quantity of the edge pixel point of received text, and subscript i indicates the serial number of edge pixel point, (t', It u' is) gradient value of the edge pixel point of received text,For the corresponding image to be matched position of received text The gradient value set.
Example 2, the token state between Gray-scale Matching coefficient image to be detected and template image can be according to the correlometer in line face It calculates, is formulated as
Wherein, mtFor the average gray value of template image,For the variance of template image all pixels point gray value, mf(r, C) andRespectively in image to be detected with tree structure template ROI range (range of i.e. text filed expression) phase The average gray and variance of corresponding image slices vegetarian refreshments.
In one embodiment, it during carrying out coarse positioning for text information, calculates and obtains text envelope to be detected The characteristic information of breath, including text posture feature information and/or text quality's characteristic information.Wherein, text posture feature information Including X to translational movement, Y-direction translational movement, X to amount of zoom, Y-direction amount of zoom, rotation angular amount, shear angular amount these characteristic quantities One or more, text quality's characteristic information include contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, One of floor projection similarity, upright projection similarity these characteristic quantities or more persons.Each characteristic quantity is respectively described below.
X-Y coordinate is established to text filed in tree structure template, established standards text is relative to tree structure mould Text filed translational movement, rotation angular amount, shear angular amount in plate are zero, set text filed amount of zoom as 1.That , X to translational movement be text information to be detected relative to the text filed movement in the X direction in tree structure template Value, Y-direction translational movement are text information to be detected relative to the text filed movement in the Y direction in tree structure template Value;X to amount of zoom be text information to be detected relative to the text filed diminution in the X direction in tree structure template/ Value of magnification, Y-direction amount of zoom are text information to be detected relative to the text filed contracting in the Y direction in tree structure template Small/value of magnification (scales, then X is equal to amount of zoom and Y-direction amount of zoom) if isotropism;Rotation angular amount is text to be detected For this information relative to the text filed rotational value around central point in tree structure template, shear angular amount is text to be detected This information is relative to the text filed torsional deformation value in tree structure template.
Contrast is the fiducial value of the prospect gray scale a and background gray scale b of foreground image where text information to be detected, is used FormulaIt indicates, value range is [0,1].Cross-correlation coefficient is text information to be detected and received text Similarity degree uses formulaIt indicates, n indicates the edge pixel point of received text Quantity, i indicate the serial number of edge pixel point, and (t', u') is the gradient value of the edge pixel point of received text,For the gradient value of the corresponding image to be matched position of received text.Gamma is text envelope to be detected The prospect gray scale normalization value (i.e. prospect gamma) of foreground image, uses formula where breathIt indicates,σforeThe average and standard deviation of foreground pixel gray scale is respectively indicated, alternatively, gamma is text information to be detected The background gray scale normalization value (i.e. background gamma) of place background image, uses formulaIt indicates,σbackRespectively indicate the average and standard deviation of background pixel gray scale.Before area coefficient is text information place to be detected The average and standard deviation (i.e. foreground area coefficient) of the number of pixels of scape image, alternatively, area coefficient is text to be detected The average and standard deviation (i.e. background area coefficient) of the number of pixels of background image where information.It is to be detected for positioning score The normalized value of the wire-frame image vegetarian refreshments of text information, uses formulaIt indicates, g is the gray scale of wire-frame image vegetarian refreshments Value, n is the total number of wire-frame image vegetarian refreshments, alternatively, using formulaIt is indicated.Floor projection similarity is to be checked The vector normalized value (or normalization cosine similarity) of the row pixel of the text information of survey, uses formulaTable Show, vt=[v1,v2……vn] it is that each column pixel corresponds to the one-component (v in the set of vector in received text1、v2…vn For the average gray of each column pixel), vi=[x1,x2……xn] it is that each column pixel is corresponding in text information to be detected Set (the x of vector1、x2…xnFor the average gray of each column pixel), subscript i is column serial number, and subscript n is total columns.Vertically The vector normalized value (or normalization cosine similarity) for projecting the column pixel that similarity is text information to be detected, with public affairs FormulaIt indicates, ht=[h1,h2,……hm] be received text in each row pixel correspond in the set of vector one A component (h1、h2…hmFor the average gray of every row pixel), hi=[y1,y2……ym] it is in text information to be detected Each row pixel corresponds to the set (y of vector1、y2…ymFor the average gray of every row pixel), subscript i is row serial number, subscript M is total line number.
The characteristic information of text information is compared by step S300 with preset text index, true according to comparison result Determine the defect type of text information.In one embodiment, see that Figure 12, step S300 may include step S310-S340, illustrate respectively It is as follows.
Step S310, obtains preset text index, the preset text index include text posture index and/or Text quality's index.Wherein, text posture index includes X to translational movement, Y-direction translational movement, X to amount of zoom, Y-direction amount of zoom, rotation One of corner measurement, the corresponding error range of shear angular amount institute or more persons, text quality's index include contrast, mutually Related coefficient, gamma, area coefficient, positioning score, floor projection similarity, upright projection similarity institute are corresponding One of numberical range or more persons.The process of pre-set text index can refer to Figure 13, including step S311-S315, illustrate respectively It is as follows.
Step S311 at least obtains the non-defective unit image that two frames all have qualified text, and qualified text here is by standard Text is template and text formed by modes such as printing, laser carving, etching, photocopy and each monomer character qualification.
Step S312, according to the text area corresponding with qualified text in tree structure template preset in step S200 Domain determines the qualified text in every frame non-defective unit image, specifically: it will be text filed with tree structure template in frame non-defective unit image Text information of the text to match as qualified text.
Step S313 calculates the text posture feature information and/or text matter for obtaining qualified text in every frame non-defective unit image Measure feature information.The text posture feature information of each qualification text includes X to translational movement, Y-direction translational movement, X to amount of zoom, Y To one of amount of zoom, rotation angular amount, shear angular amount these characteristic quantities or more persons, the text quality of each qualification text is special Reference breath includes contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, vertical throwing One of these characteristic quantities of shadow similarity or more persons.
It should be noted that the illustrating for each characteristic quantity in the text posture feature information of qualified text can refer to Step S200, the illustrating for each characteristic quantity in text quality's characteristic information of qualified text equally can refer to step S200, which is not described herein again.
Identical characteristic quantity in the text posture feature information of each qualified text is compared, respectively by step S314 The maximum value and minimum value of each characteristic quantity are obtained, determines that this feature amount is corresponding according to the maximum value of each characteristic quantity and minimum value Error range, using the error range of each characteristic quantity as the text posture index in the text index.
In one embodiment, (1) for each characteristic quantity in the text posture feature information of each qualified text, Obtain the maximum value max and minimum value min of this feature amount;(2) the flat of the maximum value max and minimum value min of this feature amount is calculated Mean value Cbias, use formulaIndicate, calculate this feature amount maximum value and minimum value difference, by difference with Preset first coefficient k1/2(k1For a preset parameter value, 1.2) progress quadrature can be defaulted as and obtain the first value Ctolerance, Use formulaIt indicates;(3) by the corresponding average value C of this feature amountbiasWith the first value CtoleranceInto Row makes the difference to obtain the lower limit value of the corresponding error range of this feature amount, and the corresponding average value of this feature amount and the first value are done The upper limit value of error range corresponding with this feature amount is obtained, i.e. the corresponding error range of this feature amount is [Cbias-Ctolerance, Cbias+Ctolerance]。
Obtaining each characteristic quantity according to the embodiment of top, (X is scaled to translational movement, Y-direction translational movement, X to amount of zoom, Y-direction Amount, rotation angular amount, one or more of shear angular amount) corresponding error range, by the error range of each characteristic quantity As the text posture index in text index.
Identical characteristic quantity in text quality's characteristic information of each qualified text is compared, respectively by step S315 The average and standard deviation of each characteristic quantity is obtained, determines that this feature amount is corresponding according to the average and standard deviation of each characteristic quantity Numberical range, using the numberical range of each characteristic quantity as text quality's index in the text index.
In one embodiment, text quality's index meets normal distribution standard, can be obtained according to normal distribution each The corresponding numerical value orientation of characteristic quantity, specifically: (1) for each feature in the text quality characteristic information of each qualified text Amount obtains the average value of this feature amountAnd standard deviation sigma;(2) by the standard deviation sigma of this feature amount and preset second coefficient k2(root According to 3 σ criterion, k2Minimum value be 3, can be defaulted as 3.3) carry out quadrature obtain second value σ * k2, the average value of this feature amount is put down Mean valueWith second value σ * k2It makes the difference to obtain the lower limit value of the corresponding numberical range of this feature amount, the average value of this feature amount is put down Mean valueWith second value σ * k2Do and obtain the upper limit value of the corresponding numberical range of this feature amount, the i.e. corresponding numerical value of this feature amount Range is
Obtaining each characteristic quantity according to the embodiment of top, (contrast, gamma, area coefficient, is determined cross-correlation coefficient Position score, floor projection similarity, one or more of upright projection similarity) corresponding numberical range, by each feature The numberical range of amount is as text quality's index in text index.
Step S320 relatively determines defect type of the text information about posture feature, sees Figure 12, step S320 can be wrapped Include step S321-S323.
Step S321, by each characteristic quantity in text posture feature information respectively with corresponding characteristic quantity in text posture index Corresponding error range is compared.For example, obtaining the text posture feature information of text information to be detected in step S200 In X to offset, X in text posture index is obtained in step S314 to the corresponding error range [C of offsetbias- Ctolerance,Cbias+Ctolerance], then judge X offset whether in error range.
Whether step S322, judging characteristic amount are more than error range, if being more than, S323 are entered step, conversely, then entering Step S340.
Step S323, by text information labeled as defect type corresponding to this feature amount.In one embodiment, when When the numerical value of any feature amount in text posture feature information is more than its corresponding error range, it is determined that text information has The defect type of " offset/skew ".
Step S330 relatively determines defect type of the text information about qualitative character, sees Figure 12, step S330 can be wrapped Include step S331-S333.
Step S331, by characteristic quantity each in text quality's characteristic information respectively with corresponding characteristic quantity in text quality's index Corresponding numberical range is compared.For example, obtaining text quality's characteristic information of text information to be detected in step S200 In contrast, obtain the corresponding numberical range of contrast in text quality's index in step S314Then judge contrast whether in numberical range.
Whether step S332, judging characteristic amount are more than numberical range, if being more than, S333 are entered step, conversely, then entering Step S340.
Step S333, a characteristic quantity is more than the corresponding number of this feature amount in text quality's index in text quality's characteristic information When being worth range, by text information labeled as defect type corresponding to this feature amount.In one embodiment, about quality spy The defect type of sign includes:
1) cross-correlation coefficient s is more than its corresponding numberical range, determines that text information has the defect type of " not finding ";
2) the foreground area coefficient in area coefficient is more than its corresponding numberical range, alternatively, the prospect in gamma Gamma is more than its corresponding numberical range, determines that text information has the defect type of " suety ";
3) the background area coefficient in area coefficient is more than its corresponding numberical range, alternatively, the background in gamma Gamma is more than its corresponding numberical range, determines that text information has the defect type of " biting ";
4) contrast is more than its corresponding numberical range, determines that text information has the defect type of " heterochromatic ".
5) positioning score is more than its corresponding numberical range, determines that text information has the defect type of " not finding ";
6) floor projection similarity is more than its corresponding numberical range, determines that text information has " not finding " and/or " leakage The defect type of print ";
7) upright projection similarity is more than its corresponding numberical range, determines that text information has " not finding " and/or " leakage The defect type of print ".
Step S340 is considered as characteristic quantity qualification, i.e. the corresponding defect type of this feature amount is not present in text information.
It is lacked it will be understood by those of skill in the art that can primarily determine which text information exists by step S300 It falls into, and which kind of defect type there is.When determining a text information existing defects, to further determine text information In the presence of defect specific location, that is, which character information existing defects determined, it is necessary to verify to character information And judgement, detailed process refer to step S400, will be described in detail below.
Step S400 obtains the characteristic information of each character information and each character information in text information, according to The characteristic information of each character information determines the defect type of the character information.In one embodiment, see Figure 14, step S400 can Including step S410-S460, it is respectively described below.
Step S410 decomposes text information according to tree structure template preset in step S200, obtains one Or multiple character informations.In one embodiment, according to the text area corresponding with text information in tree structure template Domain determines text information;According to text information it is corresponding it is text filed in multiple character zones text information is divided Solution, using character information corresponding as the character zone with all monomer characters that each character zone matches, monomer character The related description that can refer to text and text filed matching process with the matching process of character zone, is not discussed here.
Step S420 obtains the characteristic information of each character information.In one embodiment, each character is believed Breath, calculate obtain the character information characteristic information, the characteristic information of the character information include character posture feature information and/or Character qualities characteristic information;Wherein, character posture feature information includes X to one of translational movement, Y-direction translational movement these characteristic quantities Or more persons, character qualities characteristic information include contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, level Project one of similarity, upright projection similarity these characteristic quantities or more persons.
It should be noted that in character posture feature information each characteristic quantity (including X to translational movement, Y-direction translational movement one Person or more persons) explanation can refer to the description in step S200 for text posture feature information, in character posture feature information Each characteristic quantity be changing value relative to character zone in tree structure template.Each characteristic quantity in character qualities characteristic information (including contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, upright projection are similar One or more of degree) explanation can refer to the description in step S200 for text quality's characteristic information, character qualities spy Each characteristic quantity in reference breath is the calculated value relative to character each in received text.
For each character information, the characteristic information of the character information is compared with preset character index, according to Comparison result determines the defect type of the character information.It so, below will be by step S430-S460 to determining character information The process of defect type be described in detail.
Step S430, obtains preset character index, the preset character index include character posture index and/or Character qualities index.Wherein, character posture index include X to translational movement, Y-direction translational movement corresponding error range one Person or more persons, character qualities index include contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, horizontal throwing One of shadow similarity, the corresponding numberical range of upright projection similarity institute or more persons.The process of preset characters index can With reference to Figure 15, including step S431-S436, it is respectively described below.
Step S431 at least obtains the non-defective unit image that two frames all have qualified text, specifically please refers to step in Figure 13 S311。
Step S432, according to the text filed every frame non-defective unit figure of determination corresponding with qualified text in tree structure template Qualified text as in, specifically please refers to step S312 in Figure 13.
Step S433, according in tree structure template it is corresponding with qualified text it is text filed in multiple character areas Qualified text is decomposed in domain, and all monomer characters fallen into each character zone are corresponding as the character zone Qualified character, qualified character are the character information of in qualified text and each monomer character qualification.
Step S434 calculates the character posture feature information and/or character matter for obtaining qualified text in every frame non-defective unit image Measure feature information.The character posture feature information of each qualification character includes X to translational movement, Y-direction translational movement these characteristic quantities One or more, the character qualities characteristic information of each qualification character includes contrast, cross-correlation coefficient, gamma, area One of coefficient, positioning score, floor projection similarity, upright projection similarity these characteristic quantities or more persons.
Identical characteristic quantity in the character posture feature information of each qualified character is compared, respectively by step S435 The maximum value and minimum value of each characteristic quantity are obtained, determines that this feature amount is corresponding according to the maximum value of each characteristic quantity and minimum value Error range, using the error range of each characteristic quantity as the character posture index in the character index.
In one embodiment, (1) for each characteristic quantity in the character posture feature information of each qualified character, Obtain the maximum value max and minimum value min of this feature amount;(2) the flat of the maximum value max and minimum value min of this feature amount is calculated Mean value Cbias, use formulaIndicate, calculate this feature amount maximum value and minimum value difference, by difference with Preset first coefficient k1/2(k1For a preset parameter value, 1.2) progress quadrature can be defaulted as and obtain the first value Ctolerance, Use formulaIt indicates;(3) by the corresponding average value C of this feature amountbiasWith the first value CtoleranceInto Row makes the difference to obtain the lower limit value of the corresponding error range of this feature amount, and the corresponding average value of this feature amount and the first value are done The upper limit value of error range corresponding with this feature amount is obtained, i.e. the corresponding error range of this feature amount is [Cbias-Ctolerance, Cbias+Ctolerance]。
It is corresponding that each characteristic quantity (X to one or more of translational movement, Y-direction translational movement) is obtained according to the embodiment of top Error range, using the error range of each characteristic quantity as the character posture index in character index.
Identical characteristic quantity in the character qualities characteristic information of each qualified character is compared, respectively by step S436 The average and standard deviation of each characteristic quantity is obtained, determines that this feature amount is corresponding according to the average and standard deviation of each characteristic quantity Numberical range, using the numberical range of each characteristic quantity as the character qualities index in the character index.
In one embodiment, character qualities index meets normal distribution standard, can be obtained according to normal distribution each The corresponding numerical value orientation of characteristic quantity, specifically: (1) for each feature in the character qualities characteristic information of each qualified character Amount obtains the average value of this feature amountAnd standard deviation sigma;(2) by the standard deviation sigma of this feature amount and preset second coefficient k2(root According to 3 σ criterion, k2Minimum value be 3, can be defaulted as 3.3) carry out quadrature obtain second value σ * k2, the average value of this feature amount is put down Mean valueWith second value σ * k2It makes the difference to obtain the lower limit value of the corresponding numberical range of this feature amount, the average value of this feature amount is put down Mean valueWith second value σ * k2Do and obtain the upper limit value of the corresponding numberical range of this feature amount, the i.e. corresponding numerical value of this feature amount Range is
Obtaining each characteristic quantity according to the embodiment of top, (contrast, gamma, area coefficient, is determined cross-correlation coefficient Position score, floor projection similarity, one or more of upright projection similarity) corresponding numberical range, by each feature The numberical range of amount is as the character qualities index in character index.
Step S440 relatively determines defect type of the character information about posture feature, sees Figure 14, step S440 can be wrapped Include step S441-S443.
Step S441, by each characteristic quantity in character posture feature information respectively with corresponding characteristic quantity in character posture index Corresponding error range is compared.
Whether step S442, judging characteristic amount are more than error range, if being more than, S443 are entered step, conversely, then entering Step S460.
Step S443, by character information labeled as defect type corresponding to this feature amount.In one embodiment, when When the numerical value of any feature amount in character posture feature information is more than its corresponding error range, it is determined that character information has The defect type of " offset/skew ".
Step S450 relatively determines defect type of the character information about qualitative character, sees Figure 14, step S450 can be wrapped Include step S451-S453.
Step S451, by characteristic quantity each in character qualities characteristic information respectively with corresponding characteristic quantity in character qualities index Corresponding numberical range is compared.
Whether step S452, judging characteristic amount are more than numberical range, if being more than, S453 are entered step, conversely, then entering Step S460.
Step S453, a characteristic quantity is more than the corresponding number of this feature amount in character qualities index in character qualities characteristic information When being worth range, by character information labeled as defect type corresponding to this feature amount.Defect type about character qualities feature Explanation can refer to step S333 in Figure 12.
Step S460 is considered as characteristic quantity qualification, i.e. the corresponding defect type of this feature amount is not present in character information.
It will be understood by those of skill in the art that S100-S400 can determine this paper to be detected through the above steps The defect type of information and the defect type of character information, to realize that optical character is verified.For convenience of understanding that the application mentions Optical character verification method out, provides the overall flow figure of the optical character verification method, please refers to Figure 16, each in figure The detailed process of step can refer to above description corresponding with the step number, and which is not described herein again.It can by Figure 16 Know, which mainly includes three parts, and first part is that the treatment process of template image (is detailed in step A01-A05), tree structure template can be preset by this process, image to be detected and non-defective unit image is handled with facilitating;The Two parts are the treatment process (being detailed in step S311-S315 and step S433-S436) of non-defective unit image, can by this process Text index and character index are obtained, to facilitate the defect characteristic for determining text information and/or character information;Part III be for The treatment process (referring to step S100, S200, S320, S330, S410, S420, S440 and S450) of detection image, wherein step Rapid S320-S330 is the process for determining the defect type of text information, convenient to carry out coarse positioning to defect type, further, Step S440-S450 is the process for determining the defect type of character information, to be accurately positioned to defect type.It is this right Defect type, which carries out coarse positioning and pinpoint strategy, can be better achieved the effect of defect location, be conducive to quickly, accurately Ground finds the defective character of tool, is a kind of preferably optical character verification method, has application value.
It will be understood by those of skill in the art that disclosed herein as well is a kind of optical characters to verify system, it is detailed in Figure 17, Optical character verifying system includes tree structure template-setup unit 51, non-defective unit image study unit 52 and optical character verifying Unit 53.Illustrate separately below.
Tree structure template-setup unit 51 is mainly used for default tree structure template, and presets the side of tree structure template Method can refer to step A01-A05, be not discussed here.
Non-defective unit image study unit 52 and tree structure template-setup unit 51 communicate to connect, and are mainly used for pre-set text and refer to Mark and/or character index.Wherein, pre-set text refers to that calibration method can refer to the step S311-S315 in Figure 13, and preset characters refer to Calibration method can refer to step S431-S436 in Figure 15, be not discussed here.
Optical character authentication unit 53 and tree structure template-setup unit 51,52 communication link of non-defective unit image study unit Connect, be mainly used for in image to be detected text information and character information carry out optical character verifying, to determine text information With the defect type of character information.And the method for optical character verifying can refer to the step S100-S400 in Fig. 9, here no longer It is repeated.
It will be understood by those skilled in the art that all or part of function of various methods can pass through in above embodiment The mode of hardware is realized, can also be realized by way of computer program.When function all or part of in above embodiment When being realized by way of computer program, which be can be stored in a computer readable storage medium, and storage medium can To include: read-only memory, random access memory, disk, CD, hard disk etc., it is above-mentioned to realize which is executed by computer Function.For example, program is stored in the memory of equipment, when executing program in memory by processor, can be realized State all or part of function.In addition, when function all or part of in above embodiment is realized by way of computer program When, which also can store in storage mediums such as server, another computer, disk, CD, flash disk or mobile hard disks In, through downloading or copying and saving into the memory of local device, or version updating is carried out to the system of local device, when logical When crossing the program in processor execution memory, all or part of function in above embodiment can be realized.
Use above specific case is illustrated the present invention, is merely used to help understand the present invention, not to limit The system present invention.For those skilled in the art, according to the thought of the present invention, can also make several simple It deduces, deform or replaces.

Claims (15)

1. a kind of optical character verification method, which comprises the following steps:
Obtain image to be detected, described image to be detected includes text information to be detected, the text information include one or Multiple character informations;
Obtain the characteristic information of the text information to be detected and the text information in described image to be detected;
The characteristic information of the text information is compared with preset text index, the text is determined according to comparison result The defect type of information;
The characteristic information for obtaining each character information and each character information in the text information is believed according to each character The characteristic information of breath determines the defect type of the character information.
2. optical character verification method as described in claim 1, which is characterized in that the feature for obtaining the text information Information, comprising:
The text information is obtained from described image to be detected according to preset tree structure template;
The characteristic information for obtaining the text information is calculated, the characteristic information of the text information includes text posture feature information And/or text quality's characteristic information;Wherein, the text posture feature information includes X to translational movement, Y-direction translational movement, X to contracting High-volume, one of Y-direction amount of zoom, rotation angular amount, shear angular amount these characteristic quantities or more persons, text quality's feature letter Breath includes contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, upright projection phase Like spending one of these characteristic quantities or more persons.
3. optical character verification method as claimed in claim 2, which is characterized in that
The tree structure template includes the text filed of preset number, each text filed character area including preset number Domain, each character zone include the monomer character zone of preset number;
It is described text filed for determining text information according to the regional scope of itself, the character zone be used for according to itself Regional scope determines that each character information in text information, the monomer character zone are each in character information for determining Monomer character, the monomer character are any one of number, letter, symbol, Chinese character.
4. optical character verification method as claimed in claim 3, which is characterized in that further include: preset the tree structure mould Plate;It is described to preset the tree structure template, comprising the following steps:
Obtain the template image with received text;
Binary conversion treatment is carried out to the template image, obtains the foreground image with the received text;
Connection processing is carried out to the foreground image, obtains each monomer character in the received text, by each monomer word The boundary rectangle of symbol is formed by monomer character zone of the region as each monomer character;
The monomer character of instruction selection preset number constructs character depending on the user's operation, by the boundary rectangle of the character of the building It is formed by character zone of the region as the character of the building;
The character of instruction selection preset number constructs text depending on the user's operation, formation described in the boundary rectangle by the text Prime area of the region as text carries out contour offset setting to the prime area of text or RO I is arranged, after setting Prime area is as the text filed of the text.
5. optical character verification method as claimed in claim 4, which is characterized in that described according to preset tree structure template The text information is obtained from described image to be detected, comprising:
Using in described image to be detected with the text filed text to match of the tree structure template as the text envelope Breath.
6. optical character verification method as claimed in claim 4, which is characterized in that the feature by the text information is believed Breath is compared with preset text index, and the defect type of the text information is determined according to comparison result, comprising:
Preset text index includes text posture index and/or text quality's index;The text posture index includes X to flat Shifting amount, Y-direction translational movement, X are to amount of zoom, Y-direction amount of zoom, rotation angular amount, the corresponding error range of shear angular amount institute One of or more persons, text quality's index include contrast, cross-correlation coefficient, gamma, area coefficient, positioning point One of number, floor projection similarity, the corresponding numberical range of upright projection similarity institute or more persons;
Each characteristic quantity in the text posture feature information is corresponding with corresponding characteristic quantity in the text posture index respectively Error range be compared, when in the text posture feature information characteristic quantity be more than the text posture index in the spy When the corresponding error range of sign amount, then by the text information labeled as defect type corresponding to this feature amount;
By the mistake corresponding with characteristic quantity corresponding in the quality index respectively of each characteristic quantity in text quality's characteristic information Poor range is compared, when a characteristic quantity is more than this feature amount in text quality's index in text quality's characteristic information When corresponding numberical range, then by the text information labeled as defect type corresponding to this feature amount.
7. optical character verification method as claimed in claim 6, which is characterized in that further include: preset the text index;Institute It states and presets the text index, comprising the following steps:
At least obtain the non-defective unit image that two frames all have qualified text;
According in the text filed every frame non-defective unit image of determination corresponding with the qualification text in the tree structure template Qualified text;
Obtain the text posture feature information and/or text quality's characteristic information of qualified text in every frame non-defective unit image, Mei Gehe The text posture feature information of lattice text includes X to translational movement, Y-direction translational movement, X to amount of zoom, Y-direction amount of zoom, rotation angle One of amount, shear angular amount these characteristic quantities or more persons, text quality's characteristic information of each qualification text include contrast, Cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, upright projection similarity these characteristic quantities One of or more persons;
Identical characteristic quantity in the text posture feature information of each qualified text is compared, each characteristic quantity is respectively obtained Maximum value and minimum value determine the corresponding error range of this feature amount according to the maximum value of each characteristic quantity and minimum value, will be each The error range of a characteristic quantity is as the text posture index in the text index;
Identical characteristic quantity in text quality's characteristic information of each qualified text is compared, each characteristic quantity is respectively obtained Average and standard deviation determines the corresponding numberical range of this feature amount according to the average and standard deviation of each characteristic quantity, will be each The numberical range of a characteristic quantity is as text quality's index in the text index.
8. optical character verification method as claimed in claim 7, which is characterized in that the text appearance by each qualified text Identical characteristic quantity is compared in state characteristic information, the maximum value and minimum value of each characteristic quantity is respectively obtained, according to each spy The maximum value and minimum value of sign amount determine the corresponding error range of this feature amount, comprising:
For each characteristic quantity in the text posture feature information of each qualified text, the maximum value and most of this feature amount is obtained Small value;
The maximum value of this feature amount and the average value of minimum value are calculated, the maximum value of this feature amount and the difference of minimum value are calculated, Difference and preset first coefficient are subjected to quadrature and obtain the first value;
It is made the difference the corresponding average value of this feature amount and the first value to obtain the lower limit value of the corresponding error range of this feature amount, The corresponding average value of this feature amount and the first value are done and are obtained the upper limit value of the corresponding error range of this feature amount.
9. optical character verification method as claimed in claim 7, which is characterized in that the text matter by each qualified text Identical characteristic quantity is compared in measure feature information, respectively obtains the average and standard deviation of each characteristic quantity, according to each spy The average and standard deviation of sign amount determines the corresponding numberical range of this feature amount, comprising:
For each characteristic quantity in text quality's characteristic information of each qualified text, the average value and mark of this feature amount are obtained It is quasi- poor;
The standard deviation of this feature amount and preset second coefficient are subjected to quadrature and obtain second value, by the average value of this feature amount with Second value makes the difference to obtain the lower limit value of the corresponding numberical range of this feature amount, and the average value of this feature amount and second value are done and obtained To the upper limit value of the corresponding numberical range of this feature amount.
10. optical character verification method as claimed in claim 4, which is characterized in that described to obtain in the text information The characteristic information of each character information and each character information determines that the character is believed according to the characteristic information of each character information The defect type of breath, comprising:
The text information is decomposed according to the tree structure template, obtains one or more character informations;
Obtain the characteristic information of each character information;
For each character information, the characteristic information of the character information is compared with preset character index, according to comparing As a result the defect type of the character information is determined.
11. optical character verification method as claimed in claim 10, which is characterized in that described according to preset tree structure mould Plate decomposes the text information, obtains one or more character informations, comprising:
According to the text filed determination text information corresponding with the text information in the tree structure template;
According to the text information it is corresponding it is text filed in multiple character zones the text information is decomposed, will With all monomer characters that each character zone matches as the corresponding character information of the character zone.
12. optical character verification method as claimed in claim 10, which is characterized in that the spy for obtaining each character information Reference breath, comprising:
For each character information, the characteristic information for obtaining the character information is calculated, the characteristic information of the character information includes word Accord with posture feature information and/or character qualities characteristic information;Wherein, the character posture feature information includes X to translational movement, Y It include contrast, cross-correlation coefficient, gray scale to one of translational movement these characteristic quantities or more persons, the character qualities characteristic information One of coefficient, area coefficient, positioning score, floor projection similarity, upright projection similarity these characteristic quantities or more persons.
13. optical character verification method as claimed in claim 12, which is characterized in that it is described for each character information, it will The characteristic information of the character information is compared with preset character index, determines lacking for the character information according to comparison result Fall into type, comprising:
Preset character index includes character position index and/or character qualities index;The character position index includes X to flat One of shifting amount, the corresponding error range of Y-direction translational movement institute or more persons, the character qualities characteristic information include comparison Degree, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection similarity, upright projection similarity institute difference One of corresponding numberical range or more persons;
For each character information, by each characteristic quantity in the character posture feature information respectively with phase in the character position index The corresponding error range of the characteristic quantity answered is compared, when a characteristic quantity is more than the text appearance in the character posture feature information In state index when the corresponding error range of this feature amount, then by the character information labeled as defect class corresponding to this feature amount Type;
It is for each character information, each characteristic quantity in the character qualities characteristic information is corresponding with the quality index respectively The corresponding numberical range of characteristic quantity is compared, when a characteristic quantity is more than that the character qualities refer in the character qualities characteristic information In mark when the corresponding numberical range of this feature amount, then by the character information labeled as defect type corresponding to this feature amount.
14. optical character verification method as claimed in claim 13, which is characterized in that it includes following for presetting the character index Step:
At least obtain the non-defective unit image that two frames all have qualified text;
According in the text filed every frame non-defective unit image of determination corresponding with the qualification text in the tree structure template Qualified text;
According in the tree structure template it is corresponding with the qualified text it is text filed in multiple character zones, it is right The qualification text is decomposed, using all monomer characters fallen into each character zone as the corresponding conjunction of the character zone Lattice character, the qualification character are the character information of in the qualified text and each monomer character qualification;
The character posture feature information and/or character qualities characteristic information in each qualified character are obtained, each qualification character Character posture feature information includes X to one of translational movement, Y-direction translational movement these characteristic quantities or more persons, each qualification character Character qualities characteristic information includes that contrast, cross-correlation coefficient, gamma, area coefficient, positioning score, floor projection are similar One of degree, upright projection similarity these characteristic quantities or more persons;
Identical characteristic quantity in the character posture feature information of each qualified character is compared, each characteristic quantity is respectively obtained Maximum value and minimum value determine the corresponding error range of this feature amount according to the maximum value of each characteristic quantity and minimum value, will be each The error range of a characteristic quantity is as the character posture index in the character index;
Identical characteristic quantity in the character qualities characteristic information of each qualified character is compared, each characteristic quantity is respectively obtained Average and standard deviation determines the corresponding numberical range of this feature amount according to the average and standard deviation of each characteristic quantity, will be each The numberical range of a characteristic quantity is as the character qualities index in the character index.
15. a kind of computer readable storage medium, which is characterized in that including program, described program can be executed by processor with Realize the method as described in any one of claim 1-14.
CN201810619854.6A 2018-06-14 2018-06-14 Optical character verification method Active CN109003257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810619854.6A CN109003257B (en) 2018-06-14 2018-06-14 Optical character verification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810619854.6A CN109003257B (en) 2018-06-14 2018-06-14 Optical character verification method

Publications (2)

Publication Number Publication Date
CN109003257A true CN109003257A (en) 2018-12-14
CN109003257B CN109003257B (en) 2020-09-01

Family

ID=64600789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810619854.6A Active CN109003257B (en) 2018-06-14 2018-06-14 Optical character verification method

Country Status (1)

Country Link
CN (1) CN109003257B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109872310A (en) * 2019-02-01 2019-06-11 东莞中科蓝海智能视觉科技有限公司 Workpiece thread cast-off and face character angle detecting recognition methods
CN110222753A (en) * 2019-05-28 2019-09-10 北京金山数字娱乐科技有限公司 Character recognition verification method, system, computer equipment, storage medium and chip
CN113111868A (en) * 2021-03-16 2021-07-13 广州大学 Character defect detection method, system, device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130065472A1 (en) * 2007-10-05 2013-03-14 Nikon Corporation Defect detection method of display device and defect detection apparatus of display device
CN103544475A (en) * 2013-09-23 2014-01-29 方正国际软件有限公司 Method and system for recognizing layout types
CN103868935A (en) * 2014-02-14 2014-06-18 中国科学院合肥物质科学研究院 Cigarette appearance quality detection method based on computer vision
CN105717477A (en) * 2015-03-08 2016-06-29 石梦媛 Intelligent detection equipment for defects of ammeter
CN106251341A (en) * 2016-07-22 2016-12-21 凌云光技术集团有限责任公司 A kind of press quality quantity measuring method
CN106803244A (en) * 2016-11-24 2017-06-06 深圳市华汉伟业科技有限公司 Defect identification method and system
CN107516085A (en) * 2017-09-01 2017-12-26 山西同方知网数字出版技术有限公司 A kind of method that black surround is automatically removed based on file and picture

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130065472A1 (en) * 2007-10-05 2013-03-14 Nikon Corporation Defect detection method of display device and defect detection apparatus of display device
CN103544475A (en) * 2013-09-23 2014-01-29 方正国际软件有限公司 Method and system for recognizing layout types
CN103868935A (en) * 2014-02-14 2014-06-18 中国科学院合肥物质科学研究院 Cigarette appearance quality detection method based on computer vision
CN105717477A (en) * 2015-03-08 2016-06-29 石梦媛 Intelligent detection equipment for defects of ammeter
CN106251341A (en) * 2016-07-22 2016-12-21 凌云光技术集团有限责任公司 A kind of press quality quantity measuring method
CN106803244A (en) * 2016-11-24 2017-06-06 深圳市华汉伟业科技有限公司 Defect identification method and system
CN107516085A (en) * 2017-09-01 2017-12-26 山西同方知网数字出版技术有限公司 A kind of method that black surround is automatically removed based on file and picture

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
付芦静: "《基于视觉特性的印刷质量在线检测技术研究》", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》 *
刘海娟: "《基于图像处理的印刷品缺陷检测技术研究》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
梁坤: "《基于机器视觉罐装食品瓶盖字符识别与缺陷检测》", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》 *
黄丽华等: "《汽车音响面板印刷字符缺陷快速检测算法》", 《计算机与数字工程》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109872310A (en) * 2019-02-01 2019-06-11 东莞中科蓝海智能视觉科技有限公司 Workpiece thread cast-off and face character angle detecting recognition methods
CN110222753A (en) * 2019-05-28 2019-09-10 北京金山数字娱乐科技有限公司 Character recognition verification method, system, computer equipment, storage medium and chip
CN113111868A (en) * 2021-03-16 2021-07-13 广州大学 Character defect detection method, system, device and storage medium
CN113111868B (en) * 2021-03-16 2023-08-18 广州大学 Character defect detection method, system, device and storage medium

Also Published As

Publication number Publication date
CN109003257B (en) 2020-09-01

Similar Documents

Publication Publication Date Title
CN110008933B (en) Universal intelligent marking system and method
CN111243032B (en) Full-automatic detection method for checkerboard corner points
CN111507251B (en) Method and device for positioning answering area in test question image, electronic equipment and computer storage medium
US6774889B1 (en) System and method for transforming an ordinary computer monitor screen into a touch screen
US8019164B2 (en) Apparatus, method and program product for matching with a template
US11321598B2 (en) Multicolor barcode and color calibration method thereof
CN110287854B (en) Table extraction method and device, computer equipment and storage medium
US20040165786A1 (en) System and method for converting whiteboard content into an electronic document
US9092697B2 (en) Image recognition system and method for identifying similarities in different images
US9239952B2 (en) Methods and systems for extraction of data from electronic images of documents
US20120230592A1 (en) Pattern recognition apparatus
CN109003257A (en) A kind of optical character verification method
CN106778996A (en) It is embedded with the generation system and method and reading system of the Quick Response Code of visual pattern
JPWO2014103297A1 (en) Object identification device, method and program
CN111872544B (en) Calibration method and device for laser light-emitting indication point and galvanometer coaxial vision system
WO2017050088A1 (en) Method and device for locating electronic component
CN114627089A (en) Defect identification method, defect identification device, computer equipment and computer readable storage medium
CN108992033B (en) Grading device, equipment and storage medium for vision test
CN112991410A (en) Text image registration method, electronic equipment and storage medium thereof
KR100808536B1 (en) Method for calibration using by pattern image
CN116824607A (en) High-precision answer sheet identification method
CN112308842B (en) Positioning core automatic extraction method based on printed matter image
WO2014020820A1 (en) Mark reading device and mark reading method
CN109685074B (en) Bank card number row positioning method based on Scharr operator
JP2008219800A (en) Writing extraction method, writing extracting device, and writing extracting 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