Summary of the invention
In view of above content, be necessary to provide a kind of apparent flaws detection system and method, it can pre-set the side image template that sample to be tested is positioned at each rotational angle, the template record of each side image has the position of side block and side block, when there is flaw in side image sample to be tested being detected, the particular location of this flaw can be determined according to the side image template pre-set.
A kind of apparent flaws detection system, this system comprises: image acquiring module, for obtaining the current image of the sample to be tested of the image unit picked-up of pick-up unit, this current image comprises side image and the projection image of this sample to be tested, and this projection image is the image that sample to be tested projects on the level crossing of pick-up unit; Image analysing computer module, for carrying out Defect Detection operation to the side image of sample to be tested, and the rotational angle of projection image determination sample to be tested according to sample to be tested; Template matching module, for when detecting flaw in the side image of sample to be tested, obtain corresponding side image template according to the rotational angle of this sample to be tested, this side image template record has the side block comprised in the side image of sample to be tested under this rotational angle; Described template matching module, also for the side image template of the side image of sample to be tested and this acquisition being compared, determines the side block occurring flaw in sample to be tested.
A kind of apparent flaws detection method, the method comprises: image capturing step, obtain the current image of the sample to be tested of the image unit picked-up of pick-up unit, this current image comprises side image and the projection image of this sample to be tested, and this projection image is the image that sample to be tested projects on the level crossing of pick-up unit; Image analysing computer step, carries out Defect Detection operation to the side image of sample to be tested, and the rotational angle of projection image determination sample to be tested according to sample to be tested; Template matching step, when detecting flaw in the side image of sample to be tested, obtain corresponding side image template according to the rotational angle of this sample to be tested, this side image template record has the side block comprised in the side image of sample to be tested under this rotational angle; Template matching step 2, compares the side image template of the side image of sample to be tested and this acquisition, determines the side block occurring flaw in sample to be tested.
Compared to prior art, described apparent flaws detection system and method, it can pre-set the side image template that sample to be tested is positioned at each rotational angle, the template record of each side image has the position of side block and side block, when there is flaw in side image sample to be tested being detected, the particular location of this flaw can be determined according to the side image template pre-set, thus improve the accuracy detecting sample to be tested apparent flaws.
Embodiment
As shown in Figure 1, be the applied environment schematic diagram of apparent flaws detection system of the present invention.In the present embodiment, this apparent flaws detection system 24 runs in an electronic installation 2.Described electronic installation 2 is connected with pick-up unit 4 by data line.Described electronic installation 2 also comprises the display device 20, input equipment 22, storer 23 and the processor 25 that are connected with data line by signal wire.In the present embodiment, described electronic installation 2 can be a computer, and described display device 20 can be LCD Panel, and described input equipment 22 can be keyboard and mouse etc.
Consult shown in Fig. 4, described pick-up unit 4 comprise image unit (as video camera) 40, level patrols turntable (or be called horizontally rotate platform, horizontal rotation platform) 42, lighting source 43 and level crossing 45 etc.Described level is patrolled on turntable 42 and is placed with sample to be tested (Testing Sample) 60, and this sample to be tested 60 can be fixed on level by a fixed cell and patrol on turntable 42, prevents level from patrolling turntable 42 sample to be tested 60 when rotating and is moved or drops.Image unit 40 is installed on the side (as right side) that level patrols turntable, and lighting source 43 is installed on directly over sample to be tested 60, and level crossing 45 is installed on the opposite side (as left side) that level patrols turntable 42.In the present embodiment, described sample to be tested 60 is handheld device, as mobile phone.
Wherein, level crossing 45 can patrol turntable 42 by a connecting link and level and is connected.Described level is patrolled turntable 42 inside and is provided with CD-ROM drive motor, level of control can be patrolled turntable 42 and rotate by this CD-ROM drive motor, and the rotational angle of adjustment sample to be tested 60.This CD-ROM drive motor can be step motor or servo motor.Consult shown in Fig. 5, described image unit 40 can obtain side image and the projection image of sample to be tested 60 on level crossing 45 (hereinafter referred to as " the projection image of sample to be tested 60 ") of sample to be tested 60 simultaneously.
Described apparent flaws detection system 24 is positioned at the side image template of each rotational angle for pre-setting sample to be tested 60, the template record of each side image has the position of side block and side block, when there is flaw in side image sample to be tested 60 being detected, the particular location of this flaw can be determined according to the side image template pre-set, describe below detailed process.
In the present embodiment, described apparent flaws detection system 24 can be divided into one or more module, described one or more module to be stored in the storer 23 of electronic installation 2 and to be configured to be performed, to complete the present invention by one or more processor (the present embodiment is a processor 25).Such as, consult shown in Fig. 2, described apparent flaws detection system 24 is divided into template establishment module 240, image acquiring module 241, image analysing computer module 242, template matching module 243 and result output module 244.Module alleged by the present invention has been the program segment of a specific function, and be more suitable for describing software implementation within a processor than program, the function about each module will specifically describe in the flowchart of fig. 3.
As shown in Figure 3, be the process flow diagram of apparent flaws detection method of the present invention preferred embodiment.
Step S10, template establishment module 240 arranges the side image template that sample to be tested 60 is positioned at each rotational angle, wherein, the side image template record of each rotational angle has the position of side block and the side block comprised in the side image of sample to be tested 60 under this rotational angle.Such as, consult shown in Fig. 6, described sample to be tested 60 comprises four side blocks A, B, C, D, and wherein, rotational angle is that the side image template of 0 degree comprises side block A, and rotational angle is that the side image template of 30 degree comprises side block A and B.
Specifically, sample to be tested 60 is first placed in level and patrols on turntable 42 by system maintenance personnel, and starts level and patrol turntable 42 and rotate.The sample to be tested 60 that level patrols projection on image unit 40 pairs of sample to be tested 60 side outward appearances of turntable 42 side and level crossing 45 is taken, image unit 40 is taken the photograph simultaneously the side image of sample to be tested 60 and projection image (consulting shown in Fig. 5).
After the side image obtaining sample to be tested 60 and projection image, utilize image recognition technology, according to the label diagram on sample to be tested 60 and text printout position, determine the situations such as the rotational angle of sample to be tested 60 and position.Such as, image recognition technology can be utilized, label diagram in the projection image of sample to be tested 60 and the label in text printout position and standard video to be illustrated and compare in text printout position, calculate rotational angle and position (the consulting Fig. 7 shown) of sample to be tested 60.Described standard video can be this sample to be tested 60 image that image unit 40 is taken when being in initial position (as horizontality).
According to the information such as rotational angle and position of sample to be tested 60, the position of side block and the side block comprised in the side image of sample to be tested 60 can be determined further.Specifically, according to the label diagram in the projection image of sample to be tested 60 and text printout position, the side block comprised in the side image of sample to be tested 60 can be determined.Then, according to the rotational angle of sample to be tested 60, utilize sine to calculate the incident line length of each side block, according to the position of proportionate relationship determination side block in side image of incident line length.
For example, suppose the projection image of sample to be tested 60 as shown in Figure 8, according to the projection principle of level crossing 45, can determine that the side block comprised in the side image of sample to be tested 60 is A limit and B limit (namely the projecting the A limit on the upside of image and B limit) of sample to be tested.Continue to consult shown in Fig. 9, suppose that the rotational angle of sample to be tested 60 is θ, the length of side block A is a, the length of side block B is b, according to trigonometric function sine: the incident line length x=a × sin (θ) of side block A, the incident line length y=b × sin (θ) of side block B, wherein, sin () represents sine function.According to the proportionate relationship of incident line length x and y, the position of side block A and B in side image can be determined.
According to said method, level of control is patrolled turntable 42 and is rotated 360 degree by 0 degree of initial position, image unit 40 sequentially takes side image and the projection image of sample to be tested 60, set up the side image template of sample to be tested corresponding to each angle 60, and the side image template of sample to be tested 60 corresponding for each angle is stored in storer 23.
Step S11, start apparent flaws and detect operation, when sample to be tested 60 level patrol turntable 42 rotates time, image acquiring module 241 obtains the current image of the sample to be tested 60 that image unit 40 absorbs, and this current image comprises the side image of this sample to be tested 60 and the projection image (hereinafter referred to as " the projection image of sample to be tested 60 ") on level crossing 45.Level patrol turntable 42 rotate time, image unit 40 continues to take for the image of projection on the side of sample to be tested 60 and level crossing 45, and the current image therefore obtained can comprise side image and the projection image of sample to be tested 60.
Before startup apparent flaws detects operation, need level of control to patrol turntable 42 and navigate to zero degree initial position, at this zero degree initial position, sample to be tested 60 is in horizontal positioned state, such as, consults shown in Fig. 4.
Step S12, the side image of image analysing computer module 242 pairs of samples to be tested 60 carries out Defect Detection operation, simultaneously according to situations such as the rotational angle of the projection image determination sample to be tested of sample to be tested 60 and turned positions.Described image analysing computer module 242 can utilize existing various product appearance Defect Detection software, carries out Defect Detection operation to the side image of sample to be tested 60.
Specifically, image analysing computer module 242 utilizes image recognition technology (as feature samples comparison technology, Feature Template Matching), side image and the projection image of sample to be tested 60 is identified from current image, and determine side image and the region (as minimum area-encasing rectangle) projecting image, side image and the image beyond projection imagery zone are deleted, retains side image and projection image (consulting shown in Figure 10).
Then, image analysing computer module 242 utilizes image recognition technology, according to the label diagram on sample to be tested 60 and text printout position, determines the situations such as the rotational angle of sample to be tested 60 and position.Meanwhile, image analysing computer module 242 utilizes product appearance Defect Detection software, carries out apparent flaws detect operation to the side image of sample to be tested 60, whether there is flaw in the side image determining sample to be tested 60.
Step S13, image analysing computer module 242 judges whether occur flaw in the side image of sample to be tested 60.When there is flaw in the side image of sample to be tested 60, perform step S14; When there is not flaw in the side image of sample to be tested 60, return step S11.
Step S14, template matching module 243 obtains corresponding side image template according to the rotational angle of this sample to be tested 60.Such as, the rotational angle of sample to be tested 60 is 15 degree, then side image template when acquisition rotational angle is 15.
Step S15, the side image template of the side image of sample to be tested 60 and this acquisition is compared by template matching module 243, determines the side block occurring flaw in sample to be tested.Such as, consult shown in Figure 11, sample to be tested 60 is occurred the side image of flaw is compared known with corresponding side image template (180 ° of+θ), this flaw appears at the side block D of sample to be tested 60.
Then, the position of the side block occurring flaw recorded in sample to be tested by result output module 244, and will occur that the position display of the side block of flaw is on the display device 20 of electronic installation 2.
In other embodiments, the method also comprises further, and result output module 244, according to testing result, is classified to the complete sample to be tested 60 of detection, and testing result exported on the display device 20 of electronic installation 2.
Specifically, if all not there is flaw in all sides image of sample to be tested 60, then this sample to be tested 60 is categorized as specification product by result output module 244, and on the display device 20 of electronic installation 2, show the information detected by (Pass).If the side image that there is sample to be tested 60 comprises flaw, then this sample to be tested 60 is categorized as substandard product by result output module 244, and on the display device 20 of electronic installation 2, show the information detecting and do not have by (Failed).
In other embodiments, described apparent flaws detection system 24 also can run in the processor of pick-up unit 4, or a part of module runs in electronic installation 2, a part of module runs in pick-up unit 4 in addition, such as, module 240-241 can be run in the processor of pick-up unit 4, module 242-244 be run in the processor 25 of electronic installation 2.
Finally it should be noted that, above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, although with reference to preferred embodiment 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 depart from the spirit and scope of technical solution of the present invention.