Summary of the invention
The invention provides a kind of coding detection method and system, solve manual observation in prior art and detect the poor efficiency of coding, undetected flase drop, the technical matters that detecting reliability is low, achieves increasingly automated detection, improves detection efficiency and reliability.
For solving the problems of the technologies described above, the invention provides a kind of coding detection method, comprising:
Character mother plate is set;
Character zone is split, and obtains coding image to be checked, by the approximate region of template matches determination coding character;
Character key word is located, and by template matches, determines the position of key word, and obtains with this accurate location remaining variable character;
Perspective transform solves, and by the key word of matching template, calculates the affine transformation relationship from template to coding to be checked, and utilizes the affine transformation relationship of trying to achieve to generate variable character region to be analyzed;
Character defect analysis, in conjunction with key word and variable character, calculate the position of whole coding, width and the number of characters comprised, degree of tilt, size, line character identification of going forward side by side, reads the information of coding to be checked;
Wherein, described character defect comprises: character duration is defective, character height is defective, character pitch is defective, character angle is defective, character is smudgy and character is lost;
Described coding comprises: key word and variable character.
Further, described coding to be checked and described template all arrange mark figure, mate described template and described coding to be checked for identifying coding to be checked simultaneously.
Further, described character zone segmentation comprises: the character zone obtaining coding to be checked in conjunction with described mark figure and edge extracting.
Further, described character key word location comprises: determine character consistent with described template in coding to be checked by sift algorithm, be key word.
Further, described key word is the changeless character in coding character.
Further, described coding image to be checked is obtained by high speed camera.
Further, when obtaining described coding image to be checked, at the back of described coding to be checked by area source, promote the brightness of described coding to be checked.
A kind of coding detection system, based on coding detection method according to claim 1, detects the coding on to be checked on connecting gear; Comprise: machine frame and the camera frame be located thereon, sensor frame and light source bracket;
Position transducer, is fixed on described sensor frame, detects the information that puts in place of described to be checked;
High speed camera and the area source coordinated with it, described high speed camera and described area source are oppositely arranged on to be checked both sides, are fixed by described camera frame and described light source bracket;
Industrial computer, is connected with described position transducer and described high speed camera;
Wherein, described area source provides light source background for described to be checked, coordinates described high speed camera to obtain coding information on to be checked;
Described high speed camera, by the image information of shooting, after returning to described industrial computer, performs coding testing process.
Further, described system also comprises: rejecting mechanism;
Described rejecting mechanism is fixed on described machine frame, is connected with described industrial computer;
Wherein, described rejecting mechanism comprises: actuating cylinder and the push rod be attached thereto; Described actuating cylinder is fixed on described machine frame, and described push rod is fixed on described actuating cylinder piston rod front end, pushes away described connecting gear by described actuating cylinder action by described to be checked;
After coding testing process defective to be checked, rejected by described rejecting mechanism.
The one or more technical schemes provided in the embodiment of the present application, at least have following technique effect or advantage:
1, the coding detection method provided in the embodiment of the present application, character locating is exactly achieved by character zone segmentation and key word location, coordinate perspective transform to solve and achieve the reading of accurate character information and character spray printing Quality estimation with character defect analysis, strictly achieve robotization and the intellectuality of coding detection, improve detecting reliability and efficiency.
2, the coding detection method provided in the embodiment of the present application, by arranging mark figure, as the anchor point in figure identification, realizing efficient coding and catching, and promotes recognition efficiency.
3, the coding detection method provided in the embodiment of the present application, obtains the character zone of coding to be checked in conjunction with described mark figure and edge extracting; Realize the collection of high-precision coding information area, promote the efficiency of reliability.
4, the coding detection method provided in the embodiment of the present application, by sift algorithm realization key word location, progressively promotes the efficiency of the precision of location.
5, the coding detection system provided in the embodiment of the present application, the coding testing environment of high brightness is formed by high speed camera mating surface light source, coordinate high speed camera, get more clear coding information accurately, greatly reduce flase drop and undetected probability, by obtaining high brightness coding information clearly, also can promote identification, thus promote detection efficiency.
6, the coding detection system provided in the embodiment of the present application, arranges rejecting mechanism, is coupled to level sensor, can realize effectively bad rejecting, realize automation mechanized operation to a certain extent, promote whole testing process efficiency.
Embodiment
The embodiment of the present application, by providing a kind of coding detection method, solves in prior art, and manual detection poor efficiency and the low technical matters of reliability, achieve lifting detection efficiency, avoid flase drop undetected, promote the technique effect of reliability.
For solving the problems of the technologies described above, the embodiment of the present application provides the general thought of technical scheme as follows:
A kind of coding detection method, comprising:
Character mother plate is set;
Character zone is split, and obtains coding image to be checked, by the approximate region of template matches determination coding character;
Character key word is located, and by template matches, determines the position of key word, and obtains with this accurate location remaining variable character;
Perspective transform solves, and by the key word of matching template, calculates the affine transformation relationship from template to coding to be checked, and utilizes the affine transformation relationship of trying to achieve to generate variable character region to be analyzed;
Character defect analysis, in conjunction with key word and variable character, calculate the position of whole coding, width and the number of characters comprised, degree of tilt, size, line character identification of going forward side by side, reads the information of coding to be checked;
Wherein, described character defect comprises: character duration is defective, character height is defective, character pitch is defective, character angle is defective, character is smudgy and character is lost;
Described coding comprises: key word and variable character.
Can be found out by foregoing, by obtaining the image information of coding to be detected and contrasting with template and tentatively realize approximate region and locate, coordinate key word location to realize definite character zone location; Solve further by perspective transform and obtain character location information accurately, the authentic communication arriving the spray printing quality of character information and character that cooperation character defect analysis procedure can be complete; That is, by progressively refinement, the location of precision and follow-up discriminance analysis process, complete whole coding testing process thus realize robotization coding detect, while efficiency promotes greatly, reliability is also guaranteed.
In order to better understand technique scheme, below in conjunction with Figure of description and concrete embodiment, technique scheme is described in detail, the specific features being to be understood that in the embodiment of the present invention and embodiment is the detailed description to technical scheme, instead of the restriction to technical scheme, when not conflicting, the technical characteristic in the embodiment of the present application and embodiment can combine mutually.
See Fig. 1, oil can is concrete object to be checked, a kind of coding that the embodiment of the present invention provides
Detection method, comprising:
Character mother plate is set;
Character zone is split, and obtains coding image to be checked, by the approximate region of template matches determination coding character;
Character key word is located, and by template matches, determines the position of key word, and obtains with this accurate location remaining variable character;
Perspective transform solves, and by the key word of matching template, calculates the affine transformation relationship from template to coding to be checked, and utilizes the affine transformation relationship of trying to achieve to generate variable character region to be analyzed;
Character defect analysis, in conjunction with key word and variable character, calculate the position of whole coding, width and the number of characters comprised, degree of tilt, size, line character identification of going forward side by side, reads the information of coding to be checked;
Wherein, described character defect comprises: character duration is defective, character height is defective, character pitch is defective, character angle is defective, character is smudgy and character is lost;
Described coding comprises: key word and variable character.
Catch to realize automatic locating information, coding to be checked and described template all arrange mark figure, mate described template and described coding to be checked for identifying coding to be checked simultaneously.When finding mark figure on coding image, just have found the approximate location of coding.
Character zone segmentation is especially by the character zone obtaining coding to be checked in conjunction with described mark figure and edge extracting; Obtain the coding range areas of more body.
In above-mentioned coding range areas, obtained the particular location of character by character key word location, character consistent with described template in coding to be checked can be determined by sift algorithm, be key word.
Generally speaking, for the ease of identifying, key word is the changeless character in coding character.As on oil can, such as " qualified ", markup informations such as " the raw material countries of origin ".
Coding image to be checked is obtained by high speed camera.
When obtaining described coding image to be checked, at the back of described coding to be checked by area source, promote the brightness of described coding to be checked.
Concrete detection said method being applied to oil can is produced on line, and the present embodiment also specifically proposes set of system.
See Fig. 2 and Fig. 3, a kind of coding detection system, based on above-mentioned coding detection method, detects the coding on to be checked on connecting gear; , for detecting the coding on to be checked 3 of connecting gear 2; Comprise:
Machine frame 1 and the camera frame be located thereon, sensor frame and light source bracket;
Position transducer 4, is fixed on described sensor frame, detects the information that puts in place of described to be checked 3;
High speed camera 5 and the area source 6 coordinated with it, described high speed camera 5 is oppositely arranged on to be checked 3 both sides with described area source 6, is fixed by described camera frame and described light source bracket;
Industrial computer, is connected with described position transducer 4 and described high speed camera 5; The coding passback photographed is stored; Meanwhile, receive the information that puts in place, perform shooting action.
Wherein, described area source 6 provides light source background for described to be checked 3, coordinates described high speed camera 5 to obtain coding information on to be checked.
Described device also comprises: rejecting mechanism 7;
Described rejecting mechanism 7 is fixed on described machine frame 1, is connected with described industrial computer; Perform and reject control action
Wherein, described rejecting mechanism 7 comprises: actuating cylinder and the push rod be attached thereto; Described actuating cylinder is fixed on described machine frame, and described push rod is fixed on described actuating cylinder piston rod front end, pushes away described connecting gear by described actuating cylinder action by described to be checked.After coding testing process defective to be checked, rejected by described rejecting mechanism.
The one or more technical schemes provided in the embodiment of the present application, at least have following technique effect or advantage:
1, the coding detection method provided in the embodiment of the present application, character locating is exactly achieved by character zone segmentation and key word location, coordinate perspective transform to solve and achieve the reading of accurate character information and character spray printing Quality estimation with character defect analysis, strictly achieve robotization and the intellectuality of coding detection, improve detecting reliability and efficiency.
2, the coding detection method provided in the embodiment of the present application, by arranging mark figure, as the anchor point in figure identification, realizing efficient coding and catching, and promotes recognition efficiency.
3, the coding detection method provided in the embodiment of the present application, obtains the character zone of coding to be checked in conjunction with described mark figure and edge extracting; Realize the collection of high-precision coding information area, promote the efficiency of reliability.
4, the coding detection method provided in the embodiment of the present application, by sift algorithm realization key word location, progressively promotes the efficiency of the precision of location.
5, the coding detection system provided in the embodiment of the present application, the coding testing environment of high brightness is formed by high speed camera mating surface light source, coordinate high speed camera, get more clear coding information accurately, greatly reduce flase drop and undetected probability, by obtaining high brightness coding information clearly, also can promote identification, thus promote detection efficiency.
6, the coding detection system provided in the embodiment of the present application, arranges rejecting mechanism, is coupled to level sensor, can realize effectively bad rejecting, realize automation mechanized operation to a certain extent, promote whole testing process efficiency.
It should be noted last that, above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, although with reference to example to invention has been detailed description, those of ordinary skill in the art is to be understood that, can modify to technical scheme of the present invention or equivalent replacement, and not departing from the spirit and scope of technical solution of the present invention, it all should be encompassed in the middle of right of the present invention.