Summary of the invention
In view of the foregoing, it is necessary to providing a kind of apparent flaws detecting system and method, it can pre-set and treat test sample
Originally being positioned at the side image template of each rotational angle, each side image template record has side block and the position of side block
Put, when flaw occurs in side image sample to be tested being detected, can determine according to the side image template pre-set
The particular location of this flaw.
A kind of apparent flaws detecting system, this system includes: image acquiring module, for obtaining the shooting list of detection device
The current image of the sample to be tested of unit's picked-up, this current image includes side image and projection image, this throwing of this sample to be tested
Projection picture is sample to be tested image of projection on the plane mirror of detection device;Image analysing computer module, for sample to be tested
Side image carries out Defect Detection operation, and determines the rotational angle of sample to be tested according to the projection image of sample to be tested;Template
Comparing module, for when detecting flaw in the side image of sample to be tested, obtains according to the rotational angle of this sample to be tested
Corresponding side image template, this side image template record has included in the side image of sample to be tested under this rotational angle
Side block;Described template matching module, is additionally operable to the side image template of the side image of sample to be tested Yu this acquisition
Compare, determine the side block that flaw occurs in sample to be tested.
A kind of apparent flaws detection method, the method includes: image capturing step, and the image unit obtaining detection device is taken the photograph
The current image of the sample to be tested taken, this current image includes side image and projection image, this projection shadow of this sample to be tested
As the image projected on the plane mirror of detection device for sample to be tested;Image analysing computer step, the side image to sample to be tested
Carry out Defect Detection operation, and determine the rotational angle of sample to be tested according to the projection image of sample to be tested;Template matching step
One, when the side image of sample to be tested detects flaw, obtain corresponding side according to the rotational angle of this sample to be tested
Image template, this side image template record has the side zones included in the side image of sample to be tested under this rotational angle
Block;Template matching step 2, compares the side image template of the side image of sample to be tested with this acquisition, determines to be measured
Sample occurs the side block of flaw.
Compared to prior art, described apparent flaws detecting system and method, it can pre-set sample to be tested and be positioned at
The side image template of each rotational angle, each side image template record has side block and the position of side block, works as inspection
Measure time flaw occurs in the side image of sample to be tested, this flaw can be determined according to the side image template pre-set
Particular location, thus improve the accuracy of detection sample to be tested apparent flaws.
Detailed description of the invention
As it is shown in figure 1, be the applied environment schematic diagram of apparent flaws detecting system of the present invention.In the present embodiment, this is outer
See Defect Detection system 24 to run in an electronic installation 2.Described electronic installation 2 is connected with detection device 4 by data wire.
Described electronic installation 2 also includes display device 20, input equipment 22, memorizer 23 and the place being connected by holding wire with data wire
Reason device 25.In the present embodiment, described electronic installation 2 can be a computer, and described display device 20 can be liquid crystal display
Screen, described input equipment 22 can be keyboard and mouse etc..
Refering to shown in Fig. 4, described detection device 4 includes that image unit (such as camera) 40, level patrol turntable (or referred to as water
Flat turntable, horizontal rotation platform) 42, lighting source 43 and plane mirror 45 etc..Described level is patrolled to be placed with on turntable 42 and is treated test sample
This (Testing Sample) 60, this sample to be tested 60 can be fixed on level by a fixed cell and patrol on turntable 42, anti-
Flat turntable 42 sample to be tested 60 when rotating that patrols of sealing is moved or drops.Image unit 40 is installed on level and patrols the one of turntable
Side (such as right side), lighting source 43 is installed on the surface of sample to be tested 60, and plane mirror 45 is installed on level and patrols the another of turntable 42
Side (such as left side).In the present embodiment, described sample to be tested 60 is handheld device, such as mobile phone.
Wherein, plane mirror 45 can patrol turntable 42 by a connecting rod with level and is connected.Described level is patrolled in turntable 42
Portion is provided with driving motor, can control level by this driving motor and patrol turntable 42 and rotate, and adjusts sample to be tested 60
Rotational angle.This driving motor can be stepper motor or servo motor.Refering to shown in Fig. 5, described image unit 40 is permissible
The side image and the sample to be tested 60 projection image on plane mirror 45 that obtain sample to be tested 60 (hereinafter referred to as " to be measured simultaneously
The projection image of sample 60 ").
Described apparent flaws detecting system 24 is positioned at the side image of each rotational angle for pre-setting sample to be tested 60
Template, each side image template record has side block and the position of side block, when side sample to be tested 60 being detected
When flaw occurs in image, the particular location of this flaw, detailed process can be determined according to the side image template pre-set
Hereinafter describe.
In the present embodiment, described apparent flaws detecting system 24 can be divided into one or more module, and described one
Individual or multiple modules are stored in the memorizer 23 of electronic installation 2 and are configured to by one or more processor (these enforcements
Example is a processor 25) perform, to complete the present invention.Such as, refering to shown in Fig. 2, described apparent flaws detecting system 24 quilt
It is divided into template creation module 240, image acquiring module 241, image analysing computer module 242, template matching module 243 and result defeated
Go out module 244.Module alleged by the present invention has been the program segment of a specific function, is more suitable for describing software at place than program
Execution process in reason device, the function about each module will specifically describe in the flowchart of fig. 3.
As it is shown on figure 3, be the flow chart of apparent flaws detection method preferred embodiment of the present invention.
Step S10, template creation module 240 arranges sample to be tested 60 and is positioned at the side image template of each rotational angle, its
In, the side image template record of each rotational angle has included in the side image of sample to be tested 60 under this rotational angle
Side block and the position of side block.Such as, refering to shown in Fig. 6, described sample to be tested 60 include four side block A, B,
C, D, wherein, rotational angle is that the side image template of 0 degree includes side block A, and rotational angle is the side image mould of 30 degree
Plate includes 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 start level patrol turn
Platform 42 rotates.Level is patrolled the image unit 40 of turntable 42 side and is projected on sample to be tested 60 side outward appearance and plane mirror 45
Sample to be tested 60 shoot so that image unit 40 take the photograph simultaneously sample to be tested 60 side image and projection image (ginseng
Read shown in Fig. 5).
After obtaining side image and the projection image of sample to be tested 60, utilize image recognition technology, according to sample to be tested 60
On label diagram and text printout position, determine the situation such as rotational angle and position of sample to be tested 60.For example, it is possible to utilize
Image recognition technology, by the mark in the label diagram in the projection image of sample to be tested 60 and text printout position and standard video
Sign diagram and compare in text printout position, calculate rotational angle and the position (refering to shown in Fig. 7) of sample to be tested 60.Institute
Stating standard video can be this sample to be tested 60 image of image unit 40 shooting when being in initial position (such as level).
The information such as rotational angle according to sample to be tested 60 and position, may further determine that the side shadow of sample to be tested 60
Side block included in Xiang and the position of side block.Specifically, can be according in the projection image of sample to be tested 60
Label diagram and text printout position, determine the side block included in the side image of sample to be tested 60.Then, according to
The rotational angle of sample to be tested 60, utilizes sine to calculate the incident line length of each side block, according to projection line length
The proportionate relationship of degree determines side block position in side image.
For example, it is assumed that the projection image of sample to be tested 60 as shown in Figure 8, according to the projection principle of plane mirror 45, can
The side block included in the side image the determining sample to be tested 60 A limit as sample to be tested and B limit are (i.e. on projection image
The A limit of side and B limit).With continued reference to shown in Fig. 9, it is assumed that the rotational angle of sample to be tested 60 is θ, a length of a of side block A,
The a length of b of side block 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 SIN function.According to incident line length x with y's
Proportionate relationship, it may be determined that side block A and B position in side image.
According to said method, control level is patrolled turntable 42 and is rotated 360 degree by 0 degree of initial position, and image unit 40 is sequentially clapped
Take the photograph 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 memorizer 23.
Step S11, starts apparent flaws detection operation, when sample to be tested 60 patrols rotate on turntable 42 in level, and image
Acquisition module 241 obtains the current image of the sample to be tested 60 of image unit 40 picked-up, and this current image includes this sample to be tested
The side image of 60 and the projection image (hereinafter referred to as " the projection image of sample to be tested 60 ") on plane mirror 45.Patrol in level
When turntable 42 rotates, image unit 40 continues the image of projection on the side for sample to be tested 60 and plane mirror 45 and claps
Taking the photograph, the current image therefore obtained can include side image and the projection image of sample to be tested 60.
Before starting apparent flaws detection operation, need control level 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, refering to shown in Fig. 4.
Step S12, image analysing computer module 242 carries out Defect Detection operation, simultaneously root to the side image of sample to be tested 60
Projection image according to sample to be tested 60 determines the situation such as rotational angle and turned position of sample to be tested.Described image analysing computer module
242 can utilize existing various product appearance Defect Detection software, and the side image of sample to be tested 60 is carried out Defect Detection
Operation.
Specifically, image analysing computer module 242 utilizes image recognition technology (such as feature samples comparison technology, Feature
Template Matching), from current image, identify side image and the projection image of sample to be tested 60, and determine side
Limit image and the region of projection image (such as minimum area-encasing rectangle), delete side image with the image projected beyond imagery zone
Remove, retain side image and projection image (refering to shown in Figure 10).
Then, image analysing computer module 242 utilizes image recognition technology, illustrates and word according to the label on sample to be tested 60
Printing position, the situation such as rotational angle and position of determining sample to be tested 60.Meanwhile, image analysing computer module 242 utilizes outside product
See Defect Detection software, the side image of sample to be tested 60 is carried out apparent flaws detection operation, to determine sample to be tested 60
Whether side image there is flaw.
Step S13, image analysing computer module 242 judges whether flaw occur in the side image of sample to be tested 60.When to be measured
When flaw occurs in the side image of sample 60, perform step S14;When the side image of sample to be tested 60 does not occur flaw
Time, return step S11.
Step S14, template matching module 243 obtains corresponding side image mould according to the rotational angle of this sample to be tested 60
Plate.Such as, the rotational angle of sample to be tested 60 is 15 degree, then obtaining rotational angle is side image template when 15.
Step S15, the side image template of the side image of sample to be tested 60 with this acquisition is entered by template matching module 243
Row comparison, determines the side block occurring flaw in sample to be tested.Such as, refering to shown in Figure 11, there is the flaw in sample to be tested 60
The side image of defect is compared with corresponding side image template (180 ° of+θ) and is understood, and this flaw occurs in sample to be tested 60
Side block D.
Then, the position of the side block occurring flaw in sample to be tested recorded by result output module 244, and will appear from
The position display of the side block of flaw is on the display device 20 of electronic installation 2.
In other embodiments, the method still further comprises, and result output module 244 is according to testing result, to detection
Complete sample to be tested 60 is classified, and by testing result output to the display device 20 of electronic installation 2.
Specifically, if all sides image of sample to be tested 60 does not the most occur flaw, then result output module
This sample to be tested 60 is categorized as qualified products by 244, and shows that on the display device 20 of electronic installation 2 detection is by (Pass)
Information.Side image if there is sample to be tested 60 comprises flaw, then result output module 244 is by this sample to be tested
60 are categorized as substandard product, and show the detection prompting not over (Failed) on the display device 20 of electronic installation 2
Information.
In other embodiments, described apparent flaws detecting system 24 can also run in the processor of detection device 4,
Or a part of module runs in electronic installation 2, another part module runs in detection device 4, for example, it is possible to by mould
Block 240-241 runs in the processor of detection device 4, module 242-244 is run in the processor 25 of electronic installation 2.
Finally it should be noted that above example only in order to technical scheme to be described and unrestricted, although reference
The present invention has been described in detail by preferred embodiment, it will be understood by those within the art that, can be to the present invention's
Technical scheme is modified or equivalent, without deviating from the spirit and scope of technical solution of the present invention.