A kind of online image-pickup method and device based on asynchronous reset
Technical field
The invention belongs to and relate to the acquisition technology field, relate to a kind of image-pickup method and harvester, particularly a kind of at the parts in the motion, based on the online image-pickup method and the harvester of asynchronous reset pattern.Purpose is to obtain the accurate positioning of motion object, original image clearly, so that subsequent image processing and analysis.
Background technology
Along with the development of China's advanced manufacturing industry, ensure the parts quality, enhance productivity more and more importantly, the detection of parts quality is also had higher requirement.The detection of component surface quality is as one of main contents of quality testing, mainly at present adopts following three kinds of methods.
1, manual observation and measuring method.This is the method that generally adopts at present, observes or detects by measuring appliance by the artificial vision.Have generally that labour intensity is big, efficient is low, be subjected to human factor to influence shortcomings such as big.Because efficient is low, generally take the mode inspected by random samples, be difficult to realize the full inspection of parts.
2, the automatic testing method under the stationary state.This method parts when detecting remain static, and finish automatically but detect.Can reduce the adverse effect that human factor causes, but since when measuring parts need keep stationary state, detection efficiency is difficult to improve.
3, online automatic detection method.Promptly under motion state, realize the automatic detection of component surface quality.The main employing realize based on the online measuring technique of machine vision, has generally that online, automatic, noncontact, speed are very fast, efficient is than advantages such as height, is one of main developing direction of component surface quality detection technology.But ubiquity is when tested parts movement velocity improves at present, problems such as the original image sharpness of gathering is not enough, the positional precision of measurand in image is not high, influence the raising of detection efficiency, be difficult to adapt to the demand of the online full inspection of extensive parts.
Key issue based on the component surface quality online automatic detection method of machine vision is to improve accuracy of detection and detection efficiency.Under motion state, that controlled motion causes is image blurring, reduce positioning error, thereby guarantees the quality of image acquisition, is prerequisite and the key problem in technology that improves accuracy of detection and detection efficiency.
Summary of the invention
Purpose of the present invention is exactly at the deficiencies in the prior art, and a kind of online image-pickup method based on asynchronous reset is provided, and the image collecting device of this method of realization is provided simultaneously.
Online image-pickup method is when the tested parts in the motion arrive desired location among the present invention, position transducer produces initial triggering signal, this signal is through handling, obtain the asynchronous reset signal of an accurate delay, control supports the CCD of asynchronous reset pattern to collect the picture rich in detail of accurate positioning.This method may further comprise the steps: produce initial triggering signal, handle initial triggering signal, delay circuit time-delay, image acquisition, output image data.Particular content is:
Step (1) produces initial triggering signal: tested parts under conveyer drives with speed V uniform motion, 0<V<1000mm/s, when parts when being used for the photoelectric sensor of position probing, initial triggering signal of photoelectric sensor output.
Step (2) is handled initial triggering signal: will carry out level conversion in the initial triggering signal input signal treatment circuit, initial triggering signal is transformed to the external trigger signal of Transistor-Transistor Logic level, to satisfy the requirement of subsequent conditioning circuit.
The time-delay of step (3) delay circuit: the external trigger signal of Transistor-Transistor Logic level obtains asynchronous reset signal by the delay process of delay circuit, asynchronous reset signal is input to the corresponding port of the CCD (charge-coupled image sensor) that supports the asynchronous reset pattern, and triggering CCD carries out image acquisition when making tested parts move to desired location by regulating delay time; The amplitude of asynchronous reset signal and pulse width and CCD are complementary; The requirement of the concrete equipment of set basis of delay time is the prior art of maturation.
Step (4) image acquisition: CCD is set is operated in the asynchronous reset pattern, when asynchronous reset signal is effective, CCD gathers a frame new images, by setting the motion blur degree of time shutter control parts, to guarantee to collect accurate positioning, original image clearly.
Step (5) output image data: after image acquisition was finished, view data outputed in the computing machine by image pick-up card, finished the asynchronous reset image acquisition process that once triggers at random.
The employed image collecting device of this online image-pickup method comprises that the direction of motion according to conveyer is successively set on photoelectric sensor and the image acquisition units directly over the conveyer; Image acquisition units comprises CCD, imaging lens and light source, and imaging lens is vertically over against conveyer, and light source is arranged between imaging lens and the conveyer, and CCD is fixedlyed connected with imaging lens.Photoelectric sensor is connected with delay circuit by signal processing circuit, and delay circuit is connected with computing machine with CCD respectively, and the input end of image pick-up card is connected with CCD, output terminal is connected with computing machine.CCD and image pick-up card be connected and image pick-up card adopts ripe prior art with being connected of computing machine.
Signal processing circuit comprises electrochemical capacitor C, pull-up resistor R1, output resistance R2, divider resistance R3, NPN type triode Q; The collector of NPN type triode Q is connected with+12V direct supply with the end of the end of electrochemical capacitor C, pull-up resistor R1 respectively, the base stage of NPN type triode Q is connected with the other end of pull-up resistor R1 and the positive output end of photoelectric sensor 2 respectively, and the other end of electrochemical capacitor C is connected with the public output of photoelectric sensor 2; The end of output resistance R2 is connected with the emitter of NPN type triode Q, the other end of output resistance R2 is connected with the end of divider resistance R3 and the gate-control signal positive input terminal of delay circuit 5 respectively, and the other end of divider resistance R3 is connected with the public input end of the gate-control signal of delay circuit 5.
Delay circuit 5 adopts matured product, can obtain by purchase.As adopt ADLINK PCI 8554 Timer cards.
Apparatus of the present invention realize the real-time triggering of parts by photoelectric sensor, image collecting device does not contact with parts in the entire image gatherer process, can not produce wearing and tearing, be easy to safeguard, can real-time online collect accurate positioning, original image clearly.
This method adopts the CCD that supports the asynchronous reset pattern, realizes the image acquisition of parts under the motion state, has solved problems such as the rapid triggering of parts under the motion state, accurate location, motion blur control, image definition.Can be widely used in the online automatic detection of surface quality such as apparent size, surface imperfection of parts.
Description of drawings
Fig. 1 is image collecting device structural representation among the present invention;
Fig. 2 is the circuit diagram of signal processing circuit among Fig. 1;
Fig. 3 is an image acquisition sequential synoptic diagram.
Embodiment
Online image collecting device specifically as shown in Figure 1, the direction of arrow among the figure is the direction of motion of conveyer 1.Photoelectric sensor 2 and image acquisition units are successively set on directly over the conveyer 1 according to the direction of motion of conveyer 1; Image acquisition units comprises CCD 6, imaging lens 7 and light source 8, and imaging lens 7 is vertically over against conveyer 1, and light source 8 is arranged between imaging lens 7 and the conveyer 1, and CCD 6 is fixedlyed connected with imaging lens 7.Photoelectric sensor 2 is connected with delay circuit 5 by signal processing circuit 4, and delay circuit 5 is connected with computing machine 11 with CCD 6 respectively, and the input end of image pick-up card 10 is connected with CCD 6, output terminal is connected with computing machine 11.Tested parts 3 are placed on the conveyer 1.
As Fig. 2, signal processing circuit 4 comprises electrochemical capacitor C, pull-up resistor R1, output resistance R2, divider resistance R3, NPN type triode Q; The collector of NPN type triode Q is connected with+12V direct supply with the end of the end of electrochemical capacitor C, pull-up resistor R1 respectively, the base stage of NPN type triode Q is connected with the other end of pull-up resistor R1 and the positive output end of photoelectric sensor 2 respectively, the other end of electrochemical capacitor C is connected with the public output of photoelectric sensor 2, and ground connection; Output resistance R2-hold to be connected with the emitter of NPN type triode Q, the other end of output resistance R2 is connected with the end of divider resistance R3 and the gate-control signal positive input terminal of delay circuit 5 respectively, and the end in addition of divider resistance R3 is connected with the public input end of the gate-control signal of delay circuit 5.
Delay circuit 5 adopts ADLINK PCI 8554 Timer cards, is installed on the PCI slot of computing machine 11, cooperates software to realize delay function.The corresponding port with the asynchronous reset of CCD of the signal output part of delay circuit 5 connects.
As Fig. 3, concrete online image-pickup method is: in the time of when tested parts 3 pass through photoelectric sensor 2 under conveyer 1 drives below, photoelectric sensor 2 produces an initial triggering signal s1.S1 is input in the signal processing circuit 4, makes s1 be transformed into the external trigger signal s2 of Transistor-Transistor Logic level.S2 is input in the delay circuit 5, produces an asynchronous reset signal s3.S3 is input among the CCD 6 that supports the asynchronous reset pattern.CCD 6 and imaging lens 7 vertically are installed on directly over the conveyer 1 in photoelectric sensor 2 the place aheads, with photoelectric sensor 2 be separated by one section fixing apart from d.One cover light source 8 is installed between CCD 6 and imaging lens 7 and conveyer 1, the illumination in imaging viewing field 9 scopes is provided.CCD 6 gathers a frame new images when asynchronous reset signal s3 is effective, output in the computing machine 11 by image pick-up card 10, finishes the asynchronous reset image acquisition process that photoelectric sensor 2 triggers at random.Embodiment is as follows:
(1) produces initial triggering signal s1
The photoelectric sensor 2 that is used for position sensing adopts OMRON E3X-DA11-S optical fiber photoelectric sensor, focusing optical fiber E32-D32 of the supporting installation of optical fiber front end, and the emergent ray of process focusing optical fiber projects on the conveyer, forms a small luminous point.(uniform motion of 0<V<1000mm/s), the edge contact of parts are during to small luminous point, and photoelectric sensor in time produces an initial triggering signal s1 with speed V under conveyer 1 drives when tested parts 3.This optical fiber photoelectric sensor is with fast mode work, and the response time is controlled in 100 microseconds, to guarantee fast response speed.
(2) handle initial triggering signal
Initial triggering signal s1 is input in the signal processing circuit 4, obtains the external trigger signal s2 of a Transistor-Transistor Logic level.
(3) delay circuit time-delay
The mode of operation that ADLINK PCI 8554 Timer cards are set is a hardware trigger gating mode.S2 is as the gate-control signal of 8554 Timer chips in the card, and begins countdown with the delay time T that sets as the counting initial value.When the countdown clock is kept to zero, export the undersuing s3 that width is a clock period, revert to high level then automatically, and remain unchanged, when the rising edge of gate-control signal s2 next time is effective, just start 8554 Timer once more.The internal clocking of ADLINKPCI 8554 is 8MHz, can realize that width is the delay precision of a clock period Δ T.Δ T is 1.25 * 10
-7Second.
If trigger image acquisition when parts 3 move to 9 centers, CCD visual field, this moment, the distance of parts front end and photoelectric sensor trigger position was d, and the movement velocity of establishing telecontrol equipment is V, and according to Fig. 1, then delay time T satisfies:
T=d/V (1)
When the delay time of delay circuit is set at the T that (1) formula determines, triggering image acquisition when parts just move to center, CCD visual field then, and the bearing accuracy of parts is V Δ T.When V<1000mm/s, bearing accuracy V Δ T<0.125 μ m.The image that bearing accuracy is high helps subsequent image processing, helps guaranteeing accuracy of detection.
(4) image acquisition
Asynchronous reset signal s3 is input among the CCD 6 that supports the asynchronous reset pattern, and sets the negative edge of asynchronous reset signal and trigger image acquisition when effective.Then when the negative edge of s3 arrives, trigger CCD and in time gather a frame new images.S4 is the exposure time series of image acquisition, and establishing the time shutter is t, and then the motion blur value of parts is Vt.
If the enlargement ratio of image is β, then the motion blur value x of correspondence image is:
x=V·t·β (2)
If the motion blur value is controlled within the deviation of 1 Pixel Dimensions, promptly, can get less than the pixel dimension s of CCD:
t=x/(V·β)≤s/(V·β) (3)
The t that determines by (3) formula sets the time shutter, and then motion blur can be controlled within the size s, thereby collects original image clearly.But when t reduces, need to guarantee that light source 8 has enough brightness, make gradation of image keep proper level.
(5) output image data
End exposure, view data is ready, and s5 is effective, and view data outputs in the computing machine 11 by the image pick-up card 10 with CCD coupling, finishes the asynchronous reset image acquisition process that photoelectric sensor 2 triggers at random.