Summary of the invention
The present invention proposes in order to overcome the shortcoming that exists in the prior art, and its objective is provides a kind of open-type visual detection method based on characteristic matching.
Technical scheme of the present invention is: a kind of open-type visual detection method based on characteristic matching may further comprise the steps:
(i) set matching characteristic information (L1)
The characteristic information value of examined object can be effectively distinguished in setting, according to the difference of inspected object, can set a plurality of matching characteristics, the characteristic information of setting as the coupling the masterplate characteristic storage in characteristic matching database 4;
(ii) gather examined object image (L2)
Begin images acquired by IMAQ control interface control optical imaging system,, adjust the brightness of intelligent lighting device automatically, make interested characteristic quantity obviously outstanding according to predefined testing conditions;
(iii) Flame Image Process is extracted same characteristic features information (L3)
Image to collecting is handled, and removes garbage, only extracts the characteristic information of paying close attention to, and remaining characteristic information removes the background denoising with not obvious to the image that collects, and extracts same characteristic features;
(iv) characteristic matching (L4)
Image feature information and the characteristic matching database of step in (iii) compares coupling, if set a plurality of characteristics then mate respectively, like characteristic 1, characteristic 2 ... Characteristic n;
(v) export matching detection result (L5).
The invention has the beneficial effects as follows:
A cover pick-up unit of the present invention can be applied to the online detection of multiple product (object), owing to adopted wide-open structure, the user can require on this platform, to carry out secondary development according to concrete detection.The optical imaging system of the vision-based detection that is adopted among the present invention, embedded hardware processing platform (comprising image processing software bag, input and output control interface and Man Machine Interface) have all adopted modular design; Therefore can make up according to the needs of reality, widened the application of vision-based detection platform.
Embodiment
Below, with reference to accompanying drawing and embodiment the open-type visual detection method based on characteristic matching of the present invention is elaborated:
Like Fig. 1, shown in 2; Equipment of the present invention adopts open vision inspection apparatus; Open vision inspection apparatus comprises optical imaging system 1; The output of optical imaging system 1, input end signal are communicated with output, the input end signal of embedded hardware processing platform 2, and the output of embedded hardware processing platform 2, input end signal are communicated with output, the input end signal of industrial computer or touch-screen 3, characteristic matching database 4 and topworks 5 respectively.
Wherein, optical imaging system 1 is made up of intelligent lighting device 6 and ccd video camera 7.Wherein, intelligent lighting device 6 comprises light source 18 and a background board 19.Loader 16 being set below the feed bin 15, chute 17 is set below loader 16, is that two light sources 18 and a background board 19 are respectively arranged before and after axis of symmetry is provided with respectively below chute 17, with chute 17.Light source 18 uses the multistage led light source of adjustable brightness, by image capture interface 8 controls, can come one section LED illumination of automatic setting or multistage LED illumination to the demand of light intensity according to examined object, thereby regulate light-source brightness.Simultaneously can also select light sources of different colors for use according to the difference of examined object color.
Ccd video camera 7 is made up of high speed linear array CCD sensor chip 20 and pick-up lens 21, can cooperate as required and select the multiple standards camera lens for use.Intelligent lighting device 6 uses the multistage led light source of adjustable brightness, by image capture interface 8 controls, can come one section LED illumination of automatic setting or multistage LED illumination to the demand of light intensity according to examined object, thereby regulate light-source brightness.Simultaneously can also select light sources of different colors for use according to the difference of examined object color.
Optical imaging system 1 is responsible for converting the light signal of material into electric signal, for the successive image collection is prepared.Optics pick-up lens 21 is used for getting into the material optical imagery in the sight line under the irradiation of light source 18.The light that sensor chip 20 detection optical pick-up lenss are assembled, and detect its intensity, gather the image information of testee, the object of different colours produces the signal of varying strength.A sensor chip 20 is respectively established in front and back, and purpose is the double-edged color of material that is used to detect, and guarantees the comprehensive of detection.
Embedded hardware processing platform 2 comprises hardware components and software section.Wherein, core processor system and the relevant peripheral interface mainly formed of hardware components by on-site programmable gate array FPGA (Field Programmable Gate Array), digital signal processor DSP (Digital Signal Processor), synchronous dynamic random access memory SDRAM (Synchronous Dynamic Random Access Memory).Peripheral interface comprises IMAQ control interface 8, input and output control interface 9 and Man Machine Interface 11.Software section mainly is made up of with software programs such as relevant system's control, communication, IO interfaces image processing algorithm module 10.
Wherein, IMAQ control interface 8 is connected with optical imaging system 1 through special-purpose input/output signal connecting line; Send the brightness regulation of instruction control intelligent lighting device 6 according to the requirement of object to be detected; Send pulse command notice ccd video camera 7 images acquired simultaneously, the analog image that ccd video camera 7 collects is sent into image capture interface 8 through coaxial cable.
Wherein, IO interface 9 provides analog current, dc voltage signal input interface in order to connect the external detection device, and pick-up unit is generally various sensors, and the pressure, the position signals that can be used for the outside detect; Also provide the digital signal output interface to be used to export control signal corresponding simultaneously to pick-up unit and topworks 5.
Wherein, image processing algorithm module 10 is kernel software modules of embedded hardware processing platform 2.The image processing software algorithm is handled the image that IMAQ control interface 8 collects, and carries out image and goes the background denoising, extracts useful feature information, matees with template characteristic information then.
Wherein, Man Machine Interface 11 provides VGA, RS232/485, RJ45, the PS2 interface of standard, can connect industrial computer or touch-screen 3 and other peripherals, for the operator provides operation display interface intuitively.
Industrial computer or touch-screen 3 provide user interface intuitively for the operator; The operator can observe the characteristic informations such as associated picture gray scale, RGB component gray-scale value of object to be detected intuitively through display or touch-screen, can also conveniently set detecting pattern surveyed area condition etc. simultaneously.
Industrial computer or touch-screen 3 are connected with embedded hardware processing platform 2 through signal wire as human-computer interaction interface.When testing; Can whether be present in characteristic matching database 4 according to the characteristic matching data of inspected object; Set new matching characteristic data through industrial computer or touch-screen 3, also can call existing feature templates matched data in the database through it.In addition, the status information during on-line detecting system work can show on industrial computer or touch-screen 3 in real time, is convenient to observe.
Characteristic matching database 4 is interested feature description factors of under the mode of off-line, from the examined object image, extracting in advance; These feature description factors are included in acceptable object under particular color light source, the certain luminance and reject the gray-scale value of object, RGB (red, green, blue) component gray-scale value, flaw area etc., and these characteristic information values will be kept in the characteristic matching database 4 as template data.Generally being stored in FLASH (flash memory) or other deposits in all media.
Pick-up unit can selected components according to the different of the concrete application of pick-up unit with execution machine 5.Wherein pick-up unit is generally various industrial sensors, can be used for pressure, position signals outside when detection system worked and detects.Topworks can be a pneumatic actuator, also can be other mechanisms such as industrial machine human arm.Wherein pneumatic actuator is formed (not shown) by nozzle 22 and control gear, and control gear is made up of Drive and Control Circuit, compressed air system and pressure adjustment assembly etc., and nozzle 22 can be designed to the different structure form as required, like the flat structure.
Unacceptable product storehouse 23 and certified products storehouse 24 are set respectively below chute 17.
As shown in Figure 3, visible detection method of the present invention may further comprise the steps:
(i) set matching characteristic information (L1)
At first, set out the characteristic information value that the ability active zone is told examined object, promptly set the matching template characteristic information according to modes such as eye-observation, summaries of experience.Like the gray-scale value of certain component of RGB, flaw point area etc.According to the difference of inspected object, can set a plurality of matching characteristics, the characteristic information of setting will be as the masterplate characteristic storage of mating in characteristic matching database 4.
(ii) gather examined object image (L2)
Then, begin online inspected object image.By IMAQ control interface 8 control optical imaging systems 1 beginning images acquired, according to predefined testing conditions, adjust the brightness of intelligent lighting device automatically, make interested characteristic quantity obviously outstanding.
(iii) Flame Image Process is extracted same characteristic features information (L3)
Secondly, the image that collects is handled, removed garbage, only extract the characteristic information paid close attention to (promptly with matching characteristic database 4 in identical matching characteristic).In the on-line detecting system, collecting its characteristic information of image of object such as gray scale and external light source, the background of RGB component has substantial connection.Under conditions such as specific light source color, brightness, some characteristic information will be given prominence to, and remaining characteristic information is with not obvious.
In the on-line detecting system of the present invention during images acquired, unify light source and background, therefore the image that collects is gone disposal routes such as background denoising, extract same characteristic features owing to use when obtaining the matching template characteristic with step (i).
(iv) characteristic matching (L4)
Image feature information and the characteristic matching database 4 of step in (iii) compares coupling, if set a plurality of characteristics then mate respectively, like characteristic 1, characteristic 2 ... Characteristic n.
(v) export matching detection result (L5).
Be to utilize in the image of object to be detected a certain obvious characteristic to distinguish inspected object as core main points of the present invention; Promptly only obtain certain several characteristic component of examined object; And need not handle its all images information, that is simplified and collect the object general image and handle this process again, thereby make the speed of detection system be able to promote; Satisfy the demand of system real time, and then reduced the system hardware cost.
Utilize the present invention,,, select light sources of different colors for use and pass through control light-source brightness according to the difference of inspected object color, defective flaw through to the control of intelligent lighting device, can be so that the defect characteristic of object be able to give prominence to.The feature matching method that the present invention proposes can adopt different matching ways according to the difference of inspected object, in inspected object RGB coloured image, and the coupling of correlation between the coupling of R component and G component gray-scale value and each component of RGB.
As shown in Figure 4; With the online quality testing of raisins is example, utilizes the open-type visual detection platform, when greenish-yellow raisins on-line sorting; For yellow raisins are sorted out from green raisin; Adopt green light source, the control light-source brightness makes G (green component) characteristic of raisins be able to give prominence to.Employing is following based on the area matched implementation procedure of G (green) component gray feature value and flaw point:
(a) set G (green component) gray feature value T and flaw point area S (P1)
In the man-machine interface that the open-type visual detection platform provides, set and to detect yellow raisins G (green component) gray feature value and be T when thinking yellow raisins on the raisins area size of yellow spotting is S, the characteristic information value is stored in the characteristic matching database 4.
(b) online acquisition is handled the raisins image information, extracts G (green component) gray feature value (P2)
If optical imaging system background gray scale is G1, the G of green raisin (green component) characteristic gray scale is G2, and the G of yellow raisins (green component) characteristic gray scale is G3.
The difference D=G2-G1 of the G of green raisin (green component) characteristic gray scale and background;
G (green component) the characteristic gray scale of yellow raisins and the difference D=G3-G1 of background;
(c) coupling G (green component) gray feature value T (P3)
For yellow and green raisin are separated, difference D and T are compared, then set gray scale during D>T and satisfy the coupling requirement.
(d) flaw point area add up (P4)
When raisins pass through the optical imaging system of vision-based detection platform; Under the high speed instruction control of IMAQ control interface; Same raisins can repeatedly be scanned by ccd video camera and detect; Each scanning all can detect the zones of different area of raisins, when detecting the raisins gray feature and meet coupling and require, then begins area and adds up
When the area that detects for the first time yellow flaw point is S1
The area that detects for the second time yellow flaw point is S2
…
The area that detects flaw point for the n time is Sn
To the area S1+S2+ that adds up ... Sn
(e) coupling flaw point area S (P5)
Add up and work as S1+S2+ ... Judge that then flaw point area meets the coupling requirement during Sn>S.
(f) output matching detection result (P6)
When G (green) component gray feature value and flaw point area satisfy coupling simultaneously and require, then export the matching detection result.
The present invention adopts open vision inspection apparatus; Visible detection method based on characteristic matching has been proposed; Be to preserve in the testing process and processing and detecting object all images information; Only pay close attention to and analyze and to divide the useful feature information that detects object by active zone, improve system handles speed, efficiently solve the real-time requirement of on-line detecting system.