Multi-camera synchronism measuring method and device based on nanosecond LED (light-emitting diode) running water lamp
Technical Field
The invention belongs to the technical field of precision measurement and the field of optical engineering, and particularly relates to a method and a device for measuring the multi-camera synchronism of an LED (light-emitting diode) running light based on nanoseconds.
Background
With the continuous improvement of the computing capability of hardware in recent years, the computer vision technology also has rapid development, and the computer vision technology is widely applied to various industrial fields, so that the production efficiency is improved, and the labor input cost is reduced. The original manual detection is gradually replaced by automatic and intelligent industrial camera detection, and the development is proceeding to the directions of high speed, high precision, large visual field detection and the like, so that a plurality of cameras are required to perform cooperative operation according to a certain rule, and synchronously acquire images. In the case where the object to be measured is a high-speed object, the camera needs to have a high frame rate, and the synchronization of a plurality of cameras having high frame rates will affect the final detection accuracy. At present, under a low-speed scene, the camera acquires the same trigger signal by default as the camera acquires images at the same moment at the same time, and the problems of difference of response characteristics of intermediate hardware and time errors caused by different conversion modes of the trigger signals are ignored. Therefore, in the high-speed acquisition scene of multiple cameras, particularly when different types of trigger signals or different types of cameras are used, the synchronization verification work among the multiple cameras has very important practical significance.
The currently commonly used method for verifying the synchronism of the area array camera is simple and effective, usually, a millisecond timer is placed in a common field of view of a plurality of cameras, then the cameras receive synchronous trigger signals, and the synchronism measurement of the area array camera can be completed by directly observing the time difference of the timers in the acquired images of different cameras.
However, the above method of placing the timer in the common field of view of the multiple cameras is affected by the refresh rate of the timer display device, and the refresh rate of the conventional display device is only about one hundred, so that the method can only be used when the synchronization of the low-speed acquisition of the multiple cameras is verified, and it is difficult to ensure that a theoretical accurate image can be obtained during the high-speed acquisition. Currently, no universal measuring method and a corresponding device are available for the synchronization verification between the area array high-speed cameras.
Disclosure of Invention
The invention aims to provide a multi-camera synchronism measuring device and a measuring method capable of realizing accurate measurement of synchronism of multi-camera acquisition. The invention realizes the nanosecond LED running light based on the sequential logic circuit, compares and analyzes nanosecond time stamps obtained by different cameras to be tested, realizes the image acquisition synchronism test among multiple cameras, can eliminate the influence of the insufficient refresh rate of the conventional digital display device on the synchronism measurement, and improves the measurement precision and the measurement range. The technical scheme adopted is as follows:
the multi-camera synchronism measuring device based on the nanosecond LED running light comprises a time sequence logic unit, a running light module and a computer, wherein the time sequence logic unit is connected with the running light module, the running light module comprises a plurality of LED (light emitting diode) lamp beads and a digital display array, the time sequence logic unit outputs control signals to the running light module in parallel through a plurality of IO ports, the control signals drive each LED lamp bead in the running light module, each LED lamp bead has nanosecond ascending response time, the response time of the LED lamp bead is set to be smaller than T nanoseconds, the LED lamp beads emit light within the T nanoseconds when an electric signal arrives, the time sequence logic unit generates nanosecond accurate timing through time sequence logic control, the adjacent next lamp bead emits light within a time interval of T nanoseconds, and the luminous state of the lamp bead which emits light in the preamble can be kept;
the numerical value displayed by the digital display array represents the number of times that all LED lamp beads in the running water lamp module are lightened;
The shooting image of the high-speed camera comprises LED lamp beads and a digital display array in the running water lamp module;
And the computer is used for analyzing and comparing the photographed images of the plurality of high-speed cameras, converting the light-emitting numbers of the LED lamp beads of the running light lamp module and the numerical values of the digital display array of the photographed images of the different high-speed cameras into corresponding time differences, further obtaining the nanoscale time differences of the actual collecting moments of the different high-speed cameras, and comparing and analyzing the light-emitting conditions of the LED lamp beads in the running light lamp module and the numerical values of the digital display array obtained by photographing the to-be-detected high-speed cameras to realize the synchronicity measurement among the to-be-detected high-speed cameras.
Further, the sequential logic unit changes the crystal oscillator clock signal through clock frequency division, and then controls the logic circuit through the clock signal after frequency division
The working state of the running light module is selected, and the sequential logic control method of the running light module comprises the following steps:
a. setting a crystal oscillator clock signal of the sequential logic unit, and dividing the frequency of the crystal oscillator clock signal through a counter register;
b. The running light state selection register stores decimal serial numbers representing different lighting conditions of the running light module, the output register of the running light state selection register provides selection signals for the lighting states of the running light module to control the lighting states of the LED lamp beads in the running light module, the running light state register is in a set fixed signal mode, a plurality of different binary numbers in the running light state register represent different lighting states of the running light module, the adjacent latter working state is always brighter than the former working state by one LED lamp bead, the time interval between the adjacent two working states is the time represented by a clock after the frequency division of a crystal oscillator clock signal, the time represented by a single clock signal after the frequency division is T nanoseconds, and in each cycle process of the running light module, the last running light state signal in the running light state register represents the state that all running light LEDs of the running light are lighted;
c. The system reset signal is valid when 0, i.e. valid when low level; the reset signal input end of the register is effective when in high level; the system reset signal is connected with the reset signal input ends of the counter register and the running light state selection register, and controls the reset operation of the counter register and the running light state selection register; when the system reset signal acts on the running light state selection register, the system reset signal is directly connected with a reset signal input port of the running light state selection register, when the system reset signal is effective, the reset zero state of the running light state selection register is kept, at the moment, the running light state selection register does not receive the result of an adder at the input end of the state selection register, the adder at the input end of the state selection register is equivalent to failure of the adder at the input end of the state selection register, and the system reset signal is waited for failure;
The invention also provides a multi-camera synchronism measuring method realized by the device, which comprises the following steps:
(1) The running light module is arranged in a common view field of a plurality of high-speed cameras, and focusing adjustment is carried out on the high-speed cameras, so that the running light module forms clear images in the view field;
(2) The synchronous trigger signal of the nanosecond synchronous trigger is transmitted to the high-speed cameras through the trigger signal transmission line, the high-speed cameras synchronously shoot the LED running light module of the synchronous testing device under the control of the synchronous trigger signal, and the images shot by the high-speed cameras are transmitted to the computer;
(3) The computer analyzes and compares the photographed images of the high-speed cameras, converts the light-emitting numbers of the LED lamp beads of the running light lamp modules and the numerical values of the digital display arrays of the photographed images of the different high-speed cameras into corresponding time differences, further can obtain the nanoscale time differences of the actual collecting moments of the different high-speed cameras, compares and analyzes the light-emitting conditions of the LED lamp beads in the running light lamp modules and the numerical values of the numerical display arrays of the photographed images of the high-speed cameras, and achieves synchronous measurement among the high-speed cameras.
Further, in the step (3), the method for obtaining the nanoscale time difference of the actual acquisition time of the different high-speed cameras is as follows:
a. after the positions of the high-speed camera and the running light module are fixed, before the running light module is lightened, the high-speed camera is triggered to shoot the running light module which does not emit light, and the high-speed camera is used as a reference image. So that the running water lamp module works normally. The nanosecond synchronous trigger transmits the synchronous trigger signal to the external trigger signal receiving ends of the plurality of high-speed cameras, so that each high-speed camera receiving the external trigger signal performs synchronous shooting. The method comprises the steps of obtaining the light-emitting states of LED lamp beads and the numerical values of a digital display array in images of the running water lamp modules synchronously collected by different high-speed cameras, comparing the light-emitting states with the numerical values of the digital display array of the LED lamp beads of the corresponding collected images with reference images of the unpowered running water lamp modules shot before, and obtaining the numerical values of the light-emitting numbers of the LED lamp beads and the numerical values of the digital display array of the corresponding collected images.
B. And calculating nanosecond time stamps at the acquisition time of the high-speed cameras, wherein the nanosecond time stamps refer to accumulated results of the lighting time intervals of the LED lamp beads, N is the total number of the LED lamp beads in the running light module, if the difference value of the lighting number of the LED lamp beads displayed in the running light module acquired by the different high-speed cameras is N and the digital difference value of the digital display array is k, the synchronous acquisition time differences of the different high-speed cameras are added from 0 nanosecond to Txk+Txn+TxN+1 nanosecond, and the corresponding time measurement interval is increased along with the increase of the numerical value of the digital display array.
The invention has the following beneficial effects:
(1) The nanosecond LED running light multi-camera synchronism measuring device based on the sequential logic circuit is flexible in arrangement, suitable for accurate measurement of camera acquisition synchronism under different fields of view and angles, and wide in application scene;
(2) The invention provides a time sequence logic circuit-based nanosecond LED running light multi-camera synchronism measurement method, which is used for comparing and analyzing nanosecond time stamps obtained by different cameras to be tested, realizing image acquisition synchronism measurement among multiple cameras and being suitable for accurate measurement of acquisition synchronism among various high-speed cameras;
(3) The invention provides a method for measuring the synchronization of a plurality of cameras by a running light, which eliminates the influence of the insufficient refresh rate of a common digital display device on the synchronization measurement and improves the measurement precision and the measurement range.
Drawings
FIG. 1 is a schematic diagram of a multi-camera synchronous test of a running light of the present invention.
FIG. 2 is a schematic diagram of the sequential logic control of the flow lamp FPGA of the present invention.
In the figure 1, 1 is a power supply, 2 is a time sequence logic unit, 3 is a pipeline lamp module, 4 is a high-speed camera, 5 is a nanosecond synchronous trigger, 6 is a network switch, and 7 is a PC storage unit.
In fig. 2, 8 is a system reset signal, 9 is a crystal oscillator clock signal, 10 is a counter register, 11 is an output signal of the counter register, 12 is an adder of an input end of the counter register, 13 is an and gate, 14 is an or gate, 15 is a reset signal end of the counter register, 16 is an output signal of the and gate, 17 is an adder of an input end of a state selection register, 18 is a running light state selection register, 19 is an output register of the running light state selection register, 20 is a running light state register, and 21 is a multiplexer.
Detailed Description
The invention is described in detail below with reference to the drawings and the detailed description. The best mode consists of the following parts:
The first part provides a nanosecond LED running light multi-camera synchronism measuring device based on a sequential logic circuit;
The invention discloses a nanosecond LED (light-emitting diode) running light multi-camera synchronism measuring device based on a sequential logic circuit, which comprises a power supply 1, a sequential logic unit 2 and a running light module 3. The sequential logic unit of the embodiment is realized by an FPGA development board. The sequential logic unit 2 is connected with the running light module 3, the power supply 1 supplies power to the sequential logic unit 2 through a power supply transmission line, the running light module 3 comprises a plurality of LED (light-emitting diode) lamp beads and a digital display array, the sequential logic unit 2 outputs control signals to the running light module 3 in parallel through a plurality of IO ports, the control signals drive each LED lamp bead of the running light module 3, each LED lamp bead has rising response time smaller than 30 nanoseconds, the sequential logic unit emits light within 30 nanoseconds when an electric signal arrives, the sequential logic unit generates nanosecond accurate timing through sequential logic control, the light-emitting of the next adjacent lamp bead can be realized within a time interval of 30 nanoseconds, the light-emitting state of the lamp bead is kept by the preamble, the influence of the overlong response time of the LED lamp beads on the light-emitting condition of the whole running light is avoided, the numerical value displayed by the digital display array indicates the number of times that all the LED lamp beads in the running light module are on, and the synchronism test of the running light module in a longer time range can be realized.
A second part for providing a multi-camera synchronization measurement method for the measurement device structure of the first part;
As shown in fig. 1, a multi-camera synchronous measurement schematic diagram of the running water lamp is provided. The power supply 1, the sequential logic unit 2 and the running light module 3 form a synchronous testing device, the whole synchronous testing device is placed in a common view field of a plurality of high-speed cameras 4, and focusing adjustment is carried out on the high-speed cameras 4, so that the high-speed cameras 4 can clearly image in the view field. The synchronous trigger signal of the nanosecond synchronous trigger 5 is transmitted to the high-speed cameras 4, and the synchronous trigger signals of the plurality of high-speed cameras 4 synchronously shoot the LED running light module 3 of the synchronous testing device under the control of the multichannel synchronous trigger signal, and meanwhile, shot images are transmitted to the network switch 6 through the tera-mega network cable and then transmitted to the PC storage unit 7 through the tera-mega network cable by the network switch 6. The shooting images of the plurality of high-speed cameras 4 in the PC storage unit 7 are analyzed and compared, the number of the LED lamp beads in the running light module 3 for shooting the images of the different high-speed cameras 4 is converted into a corresponding time difference value, and then the nanoscale time difference of the actual acquisition moments of the different high-speed cameras 4 can be obtained, the LED lamp beads in the running light module 3 shot by the to-be-detected high-speed cameras 4 are compared and analyzed, and the synchronicity measurement among the to-be-detected high-speed cameras 4 is realized.
The multi-camera synchronicity measurement comprises synchronous shooting acquisition of nanosecond LED running lamps and calculation of camera acquisition time stamps, and is realized by the following steps:
a. After the positions of the high-speed camera 4 and the running light module 3 are fixed, before the running light module 3 is lighted, the high-speed camera 4 is triggered to shoot the running light module 3 which does not emit light, and the running light module 3 is used as a reference image. And then the power supply of the synchronous testing device is turned on, so that the running water lamp module 3 works normally. The nanosecond synchronous trigger 5 transmits synchronous trigger signals to the external trigger signal receiving ends of the plurality of high-speed cameras 4 through the trigger signal transmission line, so that each high-speed camera 4 receiving the external trigger signals performs synchronous shooting. The method comprises the steps of obtaining the light emitting states of LED lamp beads and the numerical values of a digital display array in images of the running water lamp module 3, which are synchronously collected by different high-speed cameras 4, and comparing the light emitting states with the numerical values of the digital display array of the LED lamp beads corresponding to the collected images with reference images of the unpowered running water lamp module 3, which are shot before.
B. And calculating a time stamp of the acquisition time of the high-speed camera 4, wherein the nanosecond time stamp is an accumulated result of the lighting time intervals of the LED lamp beads, is a problem of different time intervals represented by different numbers of luminous LED lamp beads, N is the total number of the LED lamp beads in the running water lamp module 3, and if the difference value of the luminous numbers of the LED lamp beads displayed in the running water lamp module 3 acquired by the different high-speed cameras 4 is N and the digital difference value of the digital display array is k, the nanosecond time stamp of the synchronous delay time is accumulated from 0 nanosecond to 30 x k (n+1) +30 x (n+1) nanoseconds. In addition, as the number of the digital display array increases, the corresponding time measurement interval also increases.
The third part provides a time sequence logic control method aiming at the flowing water lamp module group of the first part;
The sequential logic unit changes the crystal oscillator clock signal through clock frequency division, and then controls the logic circuit to select the working state of the flowing lamp module through the clock signal after frequency division, as shown in fig. 2, a sequential logic control schematic diagram of the flowing lamp. The sequential logic control method is realized by the following steps:
a. The crystal oscillator clock signal 9 of the sequential logic unit 2 is set to 100MHz. The crystal oscillator clock signal 9 is divided by three by the counter register 10, the counter register 10 is composed of two binary numbers of timer_cnt [0] and timer_cnt [1], only when timer_cnt [0] =0 and timer_cnt [1] =1, the output signal 16 of the AND gate 13 is high level 1, the output signal 16 of the AND gate 13 is low level 0 in the rest, the initial value of the counter register 10 is 01 due to the adding 1 operation of the adder 12, and the zero setting operation of the counter register 10 is performed when the value is 10, the state is returned to 00, namely the counter register 10 keeps a cyclic numerical value of 01- >10- >00- >01- >10...
B. The running light state selection register 18 stores decimal serial numbers representing different lighting conditions of the running light module 3, and the output register 19 of the running light state selection register provides selection signals for the lighting states of the running light module 3 to control the on-off states of the LED lamp beads in the running light module 3. The running light status register 20 is in a fixed signal mode, the different binary values of the multiple bits in the running light status register 20 represent different light-emitting states of the running light module 3, the adjacent latter working state is always brighter than the former working state by one LED lamp bead, the time interval between the two adjacent working states is represented by a clock after the frequency division of the crystal oscillator clock signal 9, namely, in the case that the crystal oscillator clock signal 9 is 100M, the time represented by a single clock signal after the frequency division is 30 nanoseconds when the frequency division is carried out by the counter register 10. In order to eliminate the influence of the response time of the extinction of the LED lamp beads, the lights which are already lighted in the sequence of the LED lamp beads of the running water lamp are kept from being extinguished during each cycle of the running water lamp module 3, that is, the last running water lamp state signal in the running water lamp state register 20 represents the state that all the LEDs of the running water lamp emit light.
C. The system reset signal 8 is active at 0, i.e. low. The reset signal input of the register is active at 1, i.e. at high level. The system reset signal 8 is connected to the reset signal inputs of the counter register 10 and the running light status selection register 18, and controls the reset operation of the counter register 10 and the running light status selection register 18. When the system reset signal 8 acts on the counter register 10, the system reset signal 8 inverts the lower two-bit output signal of the counter register 10, and the lower two-bit output signal of the counter register 10 is output to the reset signal input end of the counter register 10 through the or gate 14 through the and gate output signal 16 after the and gate 13, when the system reset signal 8 acts on the running light state selection register 18, the system reset signal 8 is directly connected with the reset signal input port of the running light state selection register 18, when the system reset signal 8 is effective, the reset zero state of the running light state selection register 18 is kept, at this time, the running light state selection register 18 does not receive the result of the adder 17 at the input end of the state selection register, which is equivalent to the failure of the adder 17 at the input end of the state selection register, and waits for the failure of the system reset signal 8. When the system reset signal 8 fails, the adder 21 at the input end of the state selection register starts to work, and outputs a signal to the output register of the running light state selection register, wherein the output signal is the final LED state selection signal, and the LED state selection signal selects and outputs the state signal of the running light module 3 in the running light state register 20 through the multiplexer 21, so that the working state of the running light module 3 is changed.