Summary of the invention
The object of the invention is to provide a kind of light source adjusting device and method, the technical problem that can not change because of the variation of extraneous natural environment light with light source that solve to make an inspection tour detection system.
For realizing above-mentioned purpose; According to an aspect of the present invention; A kind of light source adjusting device is provided; This light source adjusting device comprises the host computer of a receiving target image and the adjuster that is connected with host computer, and the light source adjusting device also comprises electric power driving module and the light source that is connected with electric power driving module; Adjuster comprises a control board, and control board comprises A/D modular converter, judge module, counting module, photoelectricity coupling module and the D/A modular converter that connects successively, and wherein, the A/D modular converter is connected with host computer; Judge module is provided with the number range in a plurality of zones; Counting module comprises a plurality of counters; Each counter is connected with judge module respectively; And corresponding each counter of each number range, the photoelectricity coupling module comprises a plurality of photoelectrical couplers that are connected with each counter respectively, each photoelectrical coupler all connects the D/A modular converter; Electric power driving module is connected in the D/A modular converter, and electric power driving module is controlled the brightness regulation of light source according to the signal of D/A modular converter.
Further, the initial value of each counter of counting module is zero, and each counter is provided with set point.
According to another aspect of the present invention; A kind of light source control method is provided; This method provides above-mentioned light source adjusting device, and this light source control method in turn includes the following steps: step S01, and the host computer of light source adjusting device is handled the target image that receives; Thereby obtain the analog image strength signal, and the analog image strength signal is sent to the A/D modular converter of light source adjusting device; Step S02, the A/D modular converter converts the analog image strength signal to the digital picture strength signal, and then obtains the A/D value, and the A/D modular converter sends to judge module with the A/D value; Step S03, judge module judge the A/D value whether in any area relative number range of the number range in a plurality of zones of judge module, if, then carry out step S04, if not, then do not do any processing, proceed step S01; Step S04, the initial value of the counter corresponding with the number range in the zone at A/D value place adds 1 automatically, thereby obtains end value; Step S05, whether the counter judged result value of the correspondence of judge module equals the set point of the counter of correspondence, if not, then turn back to step S01, if then carry out step S06; Step S06; The photoelectrical coupler conducting that connects with corresponding counter in the photoelectricity coupling module of light source adjusting device; Corresponding simultaneously counter automatic clear, this photoelectrical coupler generates digital signal level, and digital signal level is sent to the D/A modular converter; Step S07, D/A modular converter convert the digital signal level that receives to analog voltage signal and analog voltage signal are directly sent to the electric power driving module of light source adjusting device; Step S08, electric power driving module changes according to the brightness of analog voltage signal control light source.
Further, in step S01, host computer obtains the analog image strength signal and comprises the steps: step S011, host computer receiving target image; Step S013, the intensity of light source analytical system in the host computer is carried out check and analysis to the intensity of target image, thereby obtains the analog image strength signal.
The present invention has following beneficial effect:
Through the present invention, can reach the effect that the light source of making an inspection tour detection system can change because of the variation of extraneous natural environment light.
Except top described purpose, feature and advantage, the present invention also has other purpose, feature and advantage.To do further detailed explanation to the present invention with reference to figure below.
Embodiment
Below in conjunction with accompanying drawing embodiments of the invention are elaborated, but the multitude of different ways that the present invention can be defined by the claims and cover is implemented.
Referring to Fig. 1, make an inspection tour detection system and comprise installing rack 8, a plurality of light sources 1 and a plurality of camera 3 that are positioned at object 9 tops are installed on the installing rack 8 symmetrically.Light source 1 and camera 3 all are connected with host computer 7.In the process that installing rack 8 moves along object 9 with certain speed, light source 1 luminous irradiation object 9; 3 pairs of objects of camera 9 carry out the shooting of image, thereby obtain target image.Afterwards, camera 3 sends to host computer 7 with target image, and through the image processing system in the host computer 7 target image of receiving is carried out analyzing and processing.
In other embodiments, do not need installing rack 8, but light source 1 and camera 3 are installed on the bottom of locomotive symmetrically, and make locomotive along object 9 operations.
Preferably, in this execution mode, the target image that camera 3 is absorbed can be stored in earlier in the data collecting card 5, and data collecting card 5 is delivered to host computer 7 with target image again and carries out analyzing and processing.
Make an inspection tour detection system in the process of operation, extraneous natural environment light is always changing.For avoiding of the influence of natural environment light, require light source 1 brightness high, good uniformity, good stability to object 9 testings.In order to improve the whole tour detection system adaptability of natural environment light to external world; To different measurement period (like day or night) and different measurement location (like the tunnel; Complex conditions such as Plain), the brightness of light source 1 is to regulate in the whole service process.The brightness of light source 1 has influenced in shooting quality and the host computer 7 of target image image processing system to the accuracy of target image identification.Therefore, in this execution mode, utilize the light source adjusting device that light source 1 is regulated.
The light source adjusting device comprises host computer 7, the electric power driving module 4 of above-mentioned receiving target image and the adjuster 2 that is connected with host computer 7.
Please combine with reference to Fig. 2, adjuster 2 comprises a control board 21, and control board 21 comprises A/D modular converter 211, judge module 213, counting module 215, photoelectricity coupling module 217 and the D/A modular converter 219 that connects successively.A/D modular converter 211 is connected with judge module 213 with host computer 7 respectively; A/D modular converter 211 is used to accept host computer 7 signals, and the conversion of signals that host computer 7 passes over is become to be delivered to judge module 213 after judge module 213 identified signal and to judge.Judge module 213 is provided with the number range in a plurality of zones.Counting module 215 comprises a plurality of counters.Each counter all is connected with judge module 213, and makes the corresponding counter of each regional number range in the judge module 213.The initial value of each counter is zero, and each counter is provided with set point.Photoelectricity coupling module 217 comprises a plurality of photoelectrical couplers that connect with corresponding counter respectively, and each photoelectrical coupler all connects D/A modular converter 219.D/A modular converter 219 is connected with electric power driving module 4, and electric power driving module 4 is controlled the brightness regulation of light source 1 according to the signal of D/A modular converter.
Please combine with reference to Fig. 3, light source adjusting device of the present invention is following to the detailed process that light source 1 carries out brightness regulation:
Step S01, host computer 7 receives the target image that camera 3 is taken, and the intensity of light source analytical system in the host computer 7 is carried out check and analysis to the intensity of target image, thereby obtains the analog image strength signal.Host computer 7 sends to the analog image strength signal A/D modular converter 211 of light source adjusting device.
Step S02, A/D modular converter 211 converts the analog image strength signal to the digital picture strength signal, and then obtains the A/D value, and A/D modular converter 211 sends to judge module 213 with the A/D value.
Step S03, judge module 213 judge that the A/D value is whether in arbitrary regional number range of the number range in a plurality of zones of judge module 213, if then carry out step S04, if not, then do not do any processing.
Step S04, the initial value of the counter corresponding with the regional number range at A/D value place adds 1 automatically, thereby obtains end value.
Step S05, whether the counter judged result value of the above-mentioned correspondence of judge module 213 equals the set point of this correspondence counter, if not, then turn back to step S01, if then carry out step S06.
Step S06; The photoelectrical coupler conducting that corresponding counter with this connects in the photoelectricity coupling module 217 of light source adjusting device; Simultaneously should correspondence counter automatic clear, this photoelectrical coupler generates digital signal level, and digital signal level is sent to D/A modular converter 219.
Step S07, D/A modular converter 219 convert the digital signal level that receives to analog voltage signal and analog voltage signal are directly sent to the electric power driving module 4 of light source adjusting device.
Step S08, electric power driving module 4 changes according to the brightness of analog voltage signal control light source 1.
Preferably, in this execution mode, the present invention has carried out brightness regulation through the light source adjusting device three times to light source 1, and after regulating each time, control light source 1 is corresponding sends first order intensity light, second level intensity light and third level intensity light.The concise and to the point process that light source adjusting device adjusting light source 1 successively sends first order intensity light, second level intensity light and third level intensity light is asked for an interview as follows:
In the process of making an inspection tour the detection system operation; The light source adjusting device adopts above-mentioned steps S01 to carry out the adjusting of first order intensity light to step S08 to light source 1; After this, if the ambient light of extraneous nature is still changing, then the light source adjusting device is further regulated light source 1; Be that the light source adjusting device repeats the step of above-mentioned steps S01 to step S08 once more, regulate light source 1 and send second level intensity light.Regulate light source 1 in the light source adjusting device and send in the process of second level intensity light, light source 1 is still by first order intensity target illuminated thing 9.The light source adjusting device is after the adjusting of accomplishing second level intensity light, if the ambient light of extraneous nature is still changing, the light source adjusting device repeats the step of above-mentioned steps S01 to step S08 once more, regulates light source 1 and sends third level intensity light.Regulate light source 1 in the light source adjusting device and send in the process of third level intensity light, light source 1 is still by second level intensity target illuminated thing 9.
In other embodiments of the invention, can increase or reduce the number of the number range of judge module 213 according to different natural environment light and geographical environment.Simultaneously, the number of increase or minimizing and the corresponding counter of number range, and the number of the photoelectricity coupling module 217 that is connected with counter of increase or minimizing.Therefore, the light source adjusting device is not limited in three grades of adjustings of the foregoing description to the adjusting rank of the intensity of light source 1, but can carry out the setting of different brackets according to different external condition.
In order to obtain high-quality target image further, need carry out Synchronization Control to the line scan rate of camera 3 and the speed of service of installing rack 8.Because in the process of object 9 operations, its speed is non-homogeneous constant at installing rack 8.Installing rack 8 speeds of service inhomogeneous gathered target images to camera 3 and brings influence, will cause the difference of detection resolution on the two-dimensional directional of each machine machine 3, finally can have influence on the accuracy of detection of making an inspection tour detection system.Therefore, for the line scan rate that can regulate camera 3 according to the change information of the movement velocity of installing rack 8, can control the line scan rate of camera 3 through external trigger module 6.
Please combine referring to Fig. 4, external trigger module 6 comprises a tachogenerator 61, photoelectric encoder 63 and synchronous trigger circuit plate 65.The input of photoelectric encoder 63 is connected on the tachogenerator 61.The output of photoelectric encoder 63 is connected on the synchronous trigger circuit plate 65.Each camera 3 all is connected to the synchronous trigger circuit plate 65 of external trigger module 6.At installing rack 8 in the process of object 9 operation, the speed of service that tachogenerator 61 is gathered installing racks 8, and the speed of service that collects sent to photoelectric encoder 63.Photoelectric encoder 63 produces the different TTL square wave of frequency according to the different speeds of service, and the TTL square wave is sent to synchronous trigger circuit plate 65.Synchronous trigger circuit plate 65 converts the TTL square wave into LVDS or the RS232 signal triggering signal as camera 3, and then regulates camera 3 to gather target image with the corresponding line scan rate of triggering signal.External trigger module 6 is regulated the line scan rate of camera 3 according to the movement velocity of installing rack 8, camera 3 can be taken obtain high-quality target image.
In the present invention, the camera 3 preferred CCD cameras that adopt more preferably adopt line sweep CCD camera.Object 9 can be track, also can be other any object that needs detection.Target image can be orbital elements image (as: rail, railway ballast, images such as fastener and sleeper).
When utilizing tour detection system of the present invention that object 9 is detected, comprise following several steps:
The first step: make an inspection tour detection system and object 9 generation relative motions, make an inspection tour the light source 1 irradiation object 9 of detection system, the image of camera 3 picked-up objects 9, thus obtain target image.Preferably, when carrying out this first step, make an inspection tour the light source adjusting device of detection system and simultaneously the brightness of light source 1 is regulated, process that the light source adjusting device is regulated light source 1 as above step S01 is set forth to step S08, repeats no more at this.More preferably, when carrying out this first step, make an inspection tour the external trigger module 6 of detection system and send triggering signal simultaneously to camera 3, camera 3 is to gather target image with the corresponding line scan rate of triggering signal.
In other execution mode of the present invention, when carrying out the first step, the light source adjusting device can be regulated the brightness of light source 1 simultaneously, and still, external trigger module 6 can not trigger camera 3 simultaneously to gather target image with the corresponding line scan rate of triggering signal.In like manner, when carrying out the first step, external trigger module 6 can trigger camera 3 simultaneously to gather target image with the corresponding line scan rate of triggering signal, and still, the light source adjusting device can not regulated the brightness of light source 1 simultaneously.
Second step: camera 3 sends to the host computer 7 of making an inspection tour detection system with target image, and the image processing system of host computer 7 carries out analyzing and processing to target image, and the output analysis result.
In above-mentioned second step, promptly the image processing system in the host computer 7 in turn includes the following steps to the concrete process that target image carries out analyzing and processing:
The first step, image preliminary treatment: target image is smoothly reached denoising handle, thereby obtain muting target image.
In second step, zone identification: target image all is by rail is regional, sleeper is regional and non-rail zone constitutes.After the various zones of 7 pairs of muting target images of host computer are discerned, with target image be divided into above-mentioned rail zone, sleeper is regional and non-rail zone, and with the input picture of each zone as follow-up defects detection.
In the 3rd step, defects detection: image processing system detects, analyzes input picture, thereby judges, obtains the concrete zone at defective place and the kind of defective.Preferably, there is different defects in the different target area image, uses different algorithms that different area images is detected.To confirm which defective each zone specifically exists.Promptly be: defective is positioned at the rail zone, the sleeper zone also is non-rail zone; Concrete defective is the scratch on rail surface, or crackle.
The 4th step; Defect location: the real-time speed that obtains making an inspection tour the detection system operation according to the tachogenerator 61 of external trigger module 6; Can obtain making an inspection tour the range ability of detection system; The information of range ability is one to one with the sequence number of the target image of being gathered, and according to the corresponding relation of range ability and detected defective, can in motion process, appear at the accurate position on the object 9 by recording defect.
The 5th step, Symptom and classification: from rail zone, sleeper is regional and the corresponding different geometric characteristic of the detected defective in non-rail zone, utilize the different geometric characteristic defective is described and to be classified.Preferably, in the 5th step ground, the defective of the image in different target zone usually shows as various geometric properties.The normal geometric properties that uses has girth, major axis, minor axis and area etc.As: steel rail defect can be with eccentricity, and information such as density and length-width ratio input to the vectorial input of study vector quantization (LVQ) neural net identification.As, tread falls piece according to the identification of LVQ neural net, adopts the key element of area as Symptom; Crackle then returns the key element of length information as Symptom.As: various abrasive characteristics are carried out as much as possible, preferably separate, mutual ind description, so that reflect the characteristics of various defective different aspects, convenient follow-up identification.
The 6th step, report output: the defective of having described in the 5th step and classify is exported as analysis result.Preferably; In the 6th step; The size of the image that different target is regional, the defective locations of every width of cloth image, each defective and grade and relevant information thereof are printed by the form of form and are gathered, and can be output as forms such as Excel form, html web page file or TXT document.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.