Image synchronous acquisition control method and system and medium

By using the acquisition card instead of the control board in the multi-camera time-sharing strobe system, the camera with the smallest row frequency/frame rate is selected to receive the trigger signal, ensuring that the camera and light source are synchronized, the image disorder caused by the instantaneous rate fluctuation of the platform motion is solved, and efficient image acquisition is achieved.

CN120475253APending Publication Date: 2025-08-12HEFEI I TEK OPTOELECTRONICS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510639355.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In multi-camera time-sharing strobe applications, the synchronization relationship between the camera and the light source is destroyed due to the instantaneous rate fluctuation of the platform motion, resulting in image disorder, which is difficult to effectively solve the problem of the existing technology.

Method used

By selecting the camera with the lowest line frequency/frame rate to receive the trigger signal, a trigger command is formed to send it to the camera and the optical controller to determine whether the feedback signal is received. If so, the trigger command is sent to other acquisition cards and optical controllers simultaneously to ensure that the camera and the light source are exposed simultaneously. If otherwise, the exposure is delayed or no response is made, the acquisition card is used to replace the traditional control board for control.

Benefits of technology

It realizes accurate synchronization between the camera and the light source, reduces system costs, improves system operation efficiency, avoids image disorder, ensures that the system operating frequency reaches the maximum frequency that the camera can support, and reduces system operation risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120475253A_ABST
    Figure CN120475253A_ABST
Patent Text Reader

Abstract

The invention discloses an image synchronous acquisition control method and system and a medium, and the control method comprises the steps: selecting a main acquisition card to receive a trigger signal, forming a trigger instruction, and transmitting the trigger instruction to a corresponding camera, so as to judge whether a trigger confirmation signal fed back by the camera is received or not; if yes, a trigger instruction is synchronously sent to other acquisition cards and one of the light-operated devices, so that all the cameras perform exposure after receiving the trigger instruction of the corresponding acquisition card, and one of the light-operated devices lightens the corresponding light source after receiving the trigger instruction from the acquisition card. According to the invention, under the basic system architecture of multiple light sources, multiple cameras and multiple acquisition cards, the system architecture is simplified; a distributed light source driving mode is adopted, so that layout and wiring are more convenient; according to the method, the system cost is reduced, meanwhile, the problem of image dislocation abnormity possibly caused by instantaneous speed fluctuation of platform movement is solved, the system working frequency can reach the maximum frequency capable of being supported by a camera, the system operation efficiency is improved, and the system operation risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of machine vision, and in particular relates to an image synchronous acquisition control method, system and medium. Background Art

[0002] Multi-camera stitching is a common method for inspecting large-field-of-view objects such as PCBs and batteries. To improve inspection accuracy, multi-angle or multi-spectral lighting, or time-sharing stroboscopic methods, are currently widely used. The multi-camera combined with multiple light sources requires good synchronization between cameras and between the cameras and light sources. This means that each camera must capture the target at a specific location and be bound to a specific light source. This ensures accurate alignment between images from different cameras with different light sources during subsequent image extraction. A loss of synchronization can lead to confusion in the subsequent extracted images, resulting in target detection failure.

[0003] Therefore, multi-camera time-sharing strobe applications require a well-designed synchronous trigger system. Current implementations mostly use independent control boards to control multiple cameras and multiple light sources. For line scan cameras, for example, encoder signals and photoelectric signals are typically used to generate trigger signals that are input to the control board. After processing, the control board generates trigger commands for each line scan camera and, according to a preset light source strobe sequence, generates light control signals that are sent to the light controller, thereby controlling the light source on and off. However, due to the instability of the encoder output, this instability can arise from issues with the encoder installation and, more importantly, from unstable platform motion. Due to system design cost constraints, most motion platforms have poor instantaneous motion rate control accuracy, resulting in large fluctuations in the instantaneous rate, which in turn causes large fluctuations in the output line signal frequency. This can easily cause the trigger command frequency to exceed the maximum frequency supported by the line scan camera, leading to line drop in the line scan camera. This means the line data corresponding to the current trigger command is lost, disrupting the synchronization between the line scan camera and the light source, ultimately resulting in image distortion.

[0004] Therefore, in order to solve the problem of abnormal image output that may be caused by large fluctuations in the instantaneous rate of platform movement, the present invention provides an image synchronous acquisition control method, system and medium. Summary of the Invention

[0005] The purpose of the present invention is to overcome the above problems existing in the prior art and provide an image synchronization acquisition control method, system and medium. For the technical problem that the synchronization relationship between the camera and the light source is destroyed, the camera is used to prioritize whether to discard the trigger signal, and the acquisition card is used to complete the control of all cameras and light sources to achieve synchronization between the camera and the light source.

[0006] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions: A method for synchronous image acquisition control receives a trigger signal to control the synchronous triggering of multiple cameras and multiple light sources. The control method includes: Install several cameras, acquisition cards, light controllers, and light sources so that each acquisition card corresponds to each camera, and each light controller corresponds to each light source; Select the acquisition card corresponding to the camera with the smallest line frequency / frame rate to receive the trigger signal, and generate a trigger instruction to send to the corresponding camera to determine whether the trigger confirmation signal fed back by the camera is received: If so, a trigger instruction is synchronously sent to other acquisition cards and one of the light controllers, so that all cameras perform exposure after receiving the trigger instruction from the corresponding acquisition card, and one of the light controllers lights up the corresponding light source after receiving the trigger instruction from the acquisition card; If not, no response is made; Among them, after receiving the trigger command, all cameras delay exposure according to the corresponding preset time, so that the corresponding light sources have been completely lit when all cameras are exposed; the sum of the number of output interfaces for connecting to light controllers on all acquisition cards is greater than the total number of light sources.

[0007] Furthermore, after receiving the trigger command, the camera determines whether to feedback a trigger confirmation signal: If yes, continue to receive the next trigger instruction; If not, the current trigger instruction is retained, and after a preset time interval with the last trigger instruction is reached, the current trigger instruction is received again to determine whether a trigger confirmation signal is fed back.

[0008] Furthermore, the acquisition card is controlled to count each received trigger confirmation signal so that the count value corresponds to a different light source until the current count value reaches the total number of light sources and then counts again.

[0009] Furthermore, the control methods of the light controller include: Set the numbers of all light controllers, capture cards, and capture card output interfaces in sequence; A mapping relationship between the number of the acquisition card connected to the light controller corresponding to the current trigger confirmation signal and the current count value, and a mapping relationship between the output interface number of the acquisition card connected to the light controller corresponding to the current trigger confirmation signal and the current count value are respectively established; The current count value is obtained, and the position of the acquisition card output interface to which the light controller corresponding to the current trigger confirmation signal is connected is analyzed to send a trigger instruction to the corresponding light controller.

[0010] Furthermore, the mapping relationship between the acquisition card number connected to the light controller corresponding to the current trigger confirmation signal and the current count value satisfies: ; Among them, Sq is the total number of output interfaces of the first q acquisition cards, P i is the number of output interfaces of the i-th acquisition card, n is the acquisition card number to which the light controller corresponding to the current trigger confirmation signal is connected, q is the index variable of the acquisition card number, N is the number of acquisition cards, and m is the current count value; The mapping relationship between the acquisition card output interface number connected to the light controller corresponding to the current trigger confirmation signal and the current count value satisfies: k=mS n-1 ; Among them, k is the output interface number of the acquisition card to which the light controller corresponding to the current trigger confirmation signal is connected, S n-1 The total number of output interfaces of the first n-1 capture cards.

[0011] Furthermore, delayed exposure includes: The calibration obtains the transmission time t1 of the main camera feedback trigger confirmation signal to the main acquisition card, the detection time t2 of the main acquisition card for the trigger confirmation signal, and the sending time t α,u And the delay time t of each light source from starting to completing lighting β,v ; Analyze the total delay time t of each slave camera cam,u And the total delay time t for each light source to complete lighting light,v : t cam,u =t1+t2+t α,u ;t light,v =t1+t2+t β,v ; Calculate the delayed exposure time TD of the main camera master and the delayed exposure time TD of each slave camera slave,u : TD master =t light,v TD slave,u =t light,v -t cam,u =t β,v -t α,u ; Among them, the camera with the smallest line frequency / frame rate is the master camera, and the remaining cameras are slave cameras. The acquisition card corresponding to the master camera is the master acquisition card, and the acquisition card corresponding to the slave cameras is the slave acquisition card.

[0012] Furthermore, it also includes: Construct a fitting model of the delay time and temperature of each light source from startup to completion of lighting: t β,v =a v T 2 +b v T+c v ; Among them, a v 、b v 、c v are the fitting coefficients of the corresponding light sources, and T is the temperature; Count the delay time of each light source from start-up to complete lighting at different temperatures; The fitting parameters of the fitting model corresponding to each light source are obtained through analysis.

[0013] Furthermore, statistics on the delay time from start-up to complete lighting of each light source at different temperatures include: Install the line scan camera so that it is controlled by the same trigger source as the current light source; the line scan camera is set to expose and scan immediately after being triggered; Obtain several lines of data collected by the line scan camera within a preset time; Calculate the average grayscale value of each row of data in the order of acquisition to determine the row number corresponding to when the average grayscale value first reaches the threshold; The product of the row number and the row interval time is calculated as the delay time from starting to completing lighting of the current light source at the current temperature.

[0014] The present invention also provides an image synchronization acquisition and control system, comprising: Several cameras, consisting of a master camera and several slave cameras. The master camera has the lowest line frequency / frame rate and is used to feedback a trigger confirmation signal after receiving a trigger command. Several light sources for providing different lighting environments; A plurality of light controllers, corresponding one to each light source, for controlling the switching of the corresponding light source; Several acquisition cards, corresponding to each camera one by one, consist of a master acquisition card and several slave acquisition cards. The master acquisition card is connected to the master camera, used to receive trigger signals, generate trigger instructions and send them to the master camera to determine whether it has received the trigger confirmation signal fed back by the master camera: If so, synchronously send a trigger instruction to all slave acquisition cards and one of the light controllers, so that all slave cameras perform exposure after receiving the trigger instruction from the corresponding slave acquisition card, and make one of the light controllers light up the corresponding light source after receiving the trigger instruction from the master acquisition card or the slave acquisition card; If not, no response is made; Among them, after receiving the trigger command, all cameras delay exposure according to the corresponding preset time, so that the corresponding light sources have been completely lit when all cameras are exposed; the sum of the number of output interfaces for connecting to light controllers on all acquisition cards is greater than the total number of light sources.

[0015] The present invention also provides a computer-readable storage medium, comprising a computer program, wherein the computer program implements the above control method when executed by a processor.

[0016] The beneficial effects of the present invention are: (1) The control method of the present invention solves the problem of abnormal image output caused by large fluctuations in the instantaneous rate of platform movement as a whole, and ensures the synchronization between camera exposure and light source lighting. The specific effects of each step are as follows: By ensuring a one-to-one correspondence between each acquisition card and each camera, and between each light controller and each light source, each camera and light source can be accurately and effectively controlled independently. Parameters can be set individually for each camera and light source to suit different scene requirements, improving the flexibility and reliability of the system.

[0017] By selecting the acquisition card corresponding to the camera with the smallest line frequency / frame rate to receive the trigger signal, multiple cameras and multiple acquisition cards are reasonably distinguished to form master cameras and slave cameras, master acquisition cards and slave acquisition cards. The master camera only needs to determine whether to discard the trigger instruction to ensure that other slave cameras make the same response action. Even when the line frequency / frame rate of all cameras is the same, it is only necessary to arbitrarily select the master camera and master acquisition card to complete the corresponding operation. Secondly, the trigger instruction is generated by the master acquisition card and sent to the corresponding camera, eliminating the traditional independent control board's trigger control of the camera, effectively reducing system costs, while making full use of the mature functional characteristics of the acquisition card itself, effectively improving its practicality and reliability.

[0018] After determining that the trigger confirmation signal fed back by the camera is received, the trigger command is synchronously sent to other acquisition cards and one of the light controllers, so that all cameras are exposed after receiving the trigger command from the corresponding acquisition card, and one of the light controllers lights up the corresponding light source after receiving the trigger command from the acquisition card. This not only avoids the situation where the camera discards the trigger command after the light source is lit, but also ensures the synchronous response of camera exposure and light source lighting. Since there is no need to worry about the camera discarding the trigger command when the light source is lit, the system operating frequency can reach the maximum frequency supported by the camera, which improves the system operation efficiency and reduces the system operation risk.

[0019] After all cameras receive the trigger command, they delay exposure according to the corresponding preset time, so that the corresponding light source is fully lit when all cameras are exposed. This can accurately guarantee the delayed impact of data transmission and data processing on the final result, and effectively control the synchronization difference between camera exposure and light source lighting to the sub-microsecond level, avoiding the light source not being lit or not fully lit during image acquisition, thereby improving the image acquisition quality.

[0020] By ensuring that the sum of the number of output interfaces on all acquisition cards used to connect to light controllers is greater than the total number of light sources, the acquisition cards can effectively control all light controllers. Moreover, when the number of light controllers is less than the number of output interfaces on a single acquisition card, only the master acquisition card is needed to complete the control of all light controllers. In actual operation, the situation where the number of light sources used for time-sharing strobe exceeds the number of output interfaces on a single acquisition card generally does not occur. Therefore, the system architecture can be further streamlined, the system operation efficiency can be improved, and the system operation risk can be reduced.

[0021] (2) The control system of the present invention makes full use of the mature functions of existing modules under the basic system architecture of multiple light sources, multiple cameras and multiple acquisition cards, and designs a multi-camera, multi-light source time-sharing strobe synchronization triggering system, which simplifies the system architecture; adopts a distributed driving light source method, which is more convenient for layout and wiring; deletes the independent control board function module, reduces the system cost, and solves the problem of image misalignment abnormality caused by the instantaneous rate fluctuation of the platform movement in the time-sharing strobe application scenario, so that the system operating frequency can reach the maximum frequency supported by the camera, improves the system operation efficiency, and reduces the system operation risk. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 This is a schematic diagram of the principle of common triggering scenarios of time-sharing strobe in the prior art; Figure 2 This is a schematic diagram of the principle of image distortion caused by camera line loss in the prior art; Figure 3 It is a schematic diagram of the principle of the present invention; Figure 4 It is a schematic diagram of the principle of the camera losing line in the present invention. DETAILED DESCRIPTION

[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0024] like Figure 1As shown, in the prior art, the multi-camera combined with multi-light source working mode mostly uses an independent control board to control the multiple cameras and multiple light sources. The encoder signal and the photoelectric signal generate a trigger signal which is input to the control board. After processing, the control board generates a trigger instruction to each line scan camera on the one hand, and generates a light control signal to the light controller according to the preset light source strobe sequence on the other hand, thereby controlling the switching of the light source. Figure 1 The figure shows a star connection method, which is also the most commonly used method. The control board uniformly controls the synchronous acquisition of the entire system, including the synchronization between the camera and the light source. There are also some variant systems under this architecture. For example, the trigger of the camera can be given by the light controller, that is, at this time the control board only needs to send a strobe signal to the light controller. The light controller generates a light source control signal on the one hand and a camera line trigger signal on the other hand. This is commonly used when the number of cameras is 1 or the camera is designed with an independent external trigger interface. In most cases, due to camera cost or interface design limitations (the camera does not have an independent external trigger interface), the camera trigger signal usually comes from the acquisition card. For example, the CameraLink camera receives the trigger command through the CC1 link, and the CoaxPress camera receives the trigger command through the CXP protocol command channel, that is, the connection channel between the acquisition card and the camera is used to transmit the trigger command, such as Figure 1 As shown by the dotted line in the middle, the trigger command generated by the control board is forwarded to the camera through the acquisition card.

[0025] Whether providing trigger instructions directly to the camera or forwarding them to the camera through an acquisition card, the current trigger system can easily cause image distortion in multi-camera and multi-light source scenarios. The main reason is the instability of the encoder output. Figure 2 As shown in the figure, taking a line scan camera and a three-light strobe scene as an example, under normal circumstances, rows 1, 4, and 7 correspond to light source 1, rows 2, 5, and 8 correspond to light source 2, and rows 3, 6, and 9 correspond to light source 3. Therefore, after extracting rows from the three light sources on the PC, images corresponding to light sources 1, 2, and 3 are obtained. However, if the interval between trigger signals 2 and 3 is too small, causing the trigger instruction corresponding to trigger signal 3 to be discarded, and thus causing the camera to drop rows, the PC's row extraction logic will still be completed according to the logic that 1, 4, and 7 correspond to light source 1. However, row 4 actually corresponds to light source 2. The synchronization between the camera output rows and the light sources is disrupted due to the row drop (actually, the camera discards the trigger pulse that does not meet the conditions), resulting in a distorted image after the row extraction. Therefore, it is usually necessary to reduce the camera speed. For example, in a certain scenario, the camera can support a maximum line frequency of 54kHz, but the maximum line frequency available during actual debugging is only 42kHz. If the platform operating rate is further increased to exceed 42kHz, the camera will drop lines. It can be seen that due to the instantaneous fluctuations in the platform's motion rate, the efficiency of the entire system is greatly limited, and the system cannot reach its maximum performance, which effectively increases the system cost. To achieve the expected work efficiency, a higher line frequency and more expensive camera must be selected.

[0026] Therefore, in order to reduce hardware costs as much as possible under the current basic architecture of multiple light sources, multiple cameras and multiple acquisition cards, a multi-camera and multi-light source time-sharing strobe synchronization triggering system is designed by utilizing the industry's mature interface protocols. This system solves the problem of image misalignment caused by large fluctuations in the instantaneous rate of platform motion in time-sharing strobe application scenarios, and makes the system operating frequency reach the maximum frequency supported by the camera as much as possible, thereby improving system operation efficiency and reducing system operation risks.

[0027] like Figure 3 As shown, this embodiment first provides an image synchronous acquisition control method, which receives a trigger signal to control the synchronous triggering of multiple cameras and multiple light sources, specifically including the following steps: Install several cameras, acquisition cards, light controllers, and light sources so that each acquisition card corresponds to each camera, and each light controller corresponds to each light source; Select the acquisition card corresponding to the camera with the smallest line frequency / frame rate to receive the trigger signal, and generate a trigger instruction to send to the corresponding camera to determine whether the trigger confirmation signal fed back by the camera is received: If so, a trigger instruction is synchronously sent to other acquisition cards and one of the light controllers, so that all cameras perform exposure after receiving the trigger instruction from the corresponding acquisition card, and one of the light controllers lights up the corresponding light source after receiving the trigger instruction from the acquisition card; If not, no response is made; Among them, after receiving the trigger command, all cameras delay exposure according to the corresponding preset time, so that the corresponding light sources have been completely lit when all cameras are exposed; the sum of the number of output interfaces for connecting to light controllers on all acquisition cards is greater than the total number of light sources.

[0028] Based on the diverse functionality of acquisition cards, this invention integrates various input / output interfaces. The acquisition card replaces the traditional control board to reduce system costs. Specifically, the acquisition card parses and processes encoder and photoelectric switch signals, and sends the processed trigger instructions to the light controller and camera, respectively. This fully utilizes the acquisition card's inherent functional characteristics without adding additional costs. Due to the volatility of the platform's instantaneous motion rate, if the acquisition card directly sends trigger instructions to the camera and light controller without screening, the camera may discard the trigger instructions due to the camera's maximum operating line frequency / frame rate, disrupting the synchronization between the camera output and the light source. Therefore, the trigger instructions are distributed to other acquisition cards, cameras, and light controllers by obtaining information about whether the camera discards the trigger instructions.

[0029] Before selecting the camera with the lowest line frequency / frame rate, the present invention requires obtaining the line frequency / frame rate of all cameras in advance. If it is a line scan camera, the line scan camera with the lowest line frequency is selected; if it is an area array camera, the area array camera with the lowest frame rate is selected. The selected camera becomes the master camera, and the corresponding acquisition card becomes the master acquisition card. The remaining acquisition cards and cameras become slave acquisition cards and cameras. As long as the master camera can feedback a trigger confirmation signal, it means that the other slave cameras can ensure that the trigger command is not discarded, achieving stable synchronization with the light source. The master acquisition card completes the access and analysis of the encoder signal and the photoelectric signal to generate the trigger command.

[0030] The present invention takes the line scan camera with CXP interface as an example. The main acquisition card first sends the trigger instruction to the main camera connected to it through the CXP command channel ( Figure 3 In the example above, camera 1 receives a trigger command and responds with an ACK signal according to the CXP protocol. (This means the camera determines that the currently input trigger command is valid and starts exposure, and the exposure start time corresponds to the ACK signal response time.) The master capture card forwards the trigger command to the other slave capture cards based on the ACK signal from the master camera and drives the light controller to illuminate the light source. If the master camera does not receive an ACK signal, the trigger command is not forwarded to the other slave capture cards and light controller, meaning the current trigger command is discarded. The light controller and light source do not poll to maintain synchronization between the camera line output and the light source strobe.

[0031] In order to significantly reduce the forwarding time of trigger instructions from the master acquisition card to the slave acquisition card, the master acquisition card and the slave acquisition card are connected in a star-shaped manner, that is, 1 drives N (in this case, they can be accessed through any high-speed input interface of the slave acquisition card), or in a daisy-chain connection, that is, transmission is completed through the inter-board synchronization interface between the acquisition cards.

[0032] For the driving of light controllers, the main acquisition card can be used to drive all light controllers separately. If there are a large number of light controllers, that is, the number of light sources used by the time-sharing strobe exceeds the number of output interfaces of a single acquisition card (which generally does not happen), the output interface of the slave acquisition card needs to be used. In this case, the driving can be completed by numbering the acquisition card output interface and the light controller and defining the matching relationship between the interface and the light controller.

[0033] The core of the present invention is to detect the validity of the trigger command by the main camera in advance. Once the trigger command exceeds the minimum working interval of the camera, it will be discarded. At this time, since no valid ACK signal is received from the camera, no trigger command is issued to the light controller. That is, the camera does not output line data at this time, and the light source also stops strobing. Figure 4 As shown, the interval between trigger signal 2 and trigger signal 3 is too small, resulting in the trigger instruction corresponding to trigger signal 3 being discarded, which in turn causes the camera to drop lines. At this time, the corresponding light source does not flicker, and the synchronization relationship between camera exposure and light source lighting is guaranteed.

[0034] As a specific embodiment of the control method, if there are at least two cameras with the lowest line frequency / frame rate, the capture card corresponding to any one of these cameras is selected to receive the trigger signal. In actual use scenarios, it is possible that all cameras have the same line frequency / frame rate. In this case, any capture card and camera can be selected as the master capture card and camera, and the remaining capture cards and cameras can be selected as slave capture cards and cameras. As long as the master camera can send back a trigger confirmation signal, it means that the other cameras can ensure that the trigger command is not discarded, achieving stable synchronization with the light source.

[0035] like Figure 4 As shown, the interval between trigger signal 2 and trigger signal 3 is too small, causing the trigger instruction corresponding to trigger signal 3 to be discarded. Although the synchronization between camera exposure and light source lighting is guaranteed, the image information of the object under test at the position corresponding to trigger signal 3 cannot be collected, resulting in loss, which to a certain extent affects the final image quality. Although the platform's instantaneous rate fluctuates greatly, in the long run, the average time interval corresponding to all trigger signals is usually greater than the camera's minimum line / frame period (the camera system will adaptively adjust the platform according to camera parameters before shooting). In other words, in the long run, if the trigger instructions corresponding to the same number of trigger signals are given to the camera at a uniform speed, the corresponding ACK signal will be fed back, thus preventing any trigger instructions from being discarded and affecting the final image quality. Based on this, the camera determines whether to feed back a trigger confirmation signal after receiving the trigger instruction: If yes, continue to receive the next trigger instruction; this means that the time interval between the current trigger instruction and the previous trigger instruction is greater than the minimum line / frame period of the camera, which meets the camera shooting requirements.

[0036] If not, the current trigger instruction is retained and after the preset time interval with the previous trigger instruction is reached, the current trigger instruction is received again to determine whether a trigger confirmation signal is fed back. Usually, the preset time interval can be set to the minimum line / frame period of the camera. For example, the maximum line frequency of a line scan camera is F line , the preset time interval is set to 1 / F line , so as to ensure that all trigger commands can be effectively responded to in the long term. If the time interval between the arrival of the next trigger command and the confirmation of the current trigger command after the current trigger command is delayed is less than the minimum line / frame period of the camera, the next trigger command will be retained and the above steps will be repeated.

[0037] By retaining discarded trigger instructions and judging them after a preset time interval, all trigger instructions can be confirmed and executed, ensuring the synchronization of camera exposure and light source lighting, while improving the overall imaging quality.

[0038] To precisely control the stroboscopic sequence of each light source, the acquisition card can be controlled to count each received trigger confirmation signal, so that the count value corresponds to a different light source, and then reset the count until the current count reaches the total number of light sources. For example, the main acquisition card will increment the counter by 1 each time it receives an ACK signal, and loop back to 1 when the count reaches M. That is, the counter count range is 1 to M, corresponding to M light sources.

[0039] When the number of light controllers is large and exceeds the number of output interfaces of a single capture card, the light controller control method can be implemented through the following steps: Set the numbers of all light controllers, capture cards, and capture card output ports in sequence. For example, let the number of light controllers be M, numbered 1, 2, 3...M, let the number of capture cards be N, numbered 1, 2, 3...N, let the number of capture card output ports be P, numbered 1, 2, 3...P.

[0040] A mapping relationship between the acquisition card number connected to the light controller corresponding to the current trigger confirmation signal and the current count value, and a mapping relationship between the acquisition card output interface number connected to the light controller corresponding to the current trigger confirmation signal and the current count value are respectively established.

[0041] The mapping relationship between the acquisition card number connected to the light controller corresponding to the current trigger confirmation signal and the current count value satisfies: ; Among them, S q is the total number of output interfaces of the first q acquisition cards, P i is the number of output interfaces on the i-th capture card, n is the capture card number to which the light controller corresponding to the current trigger confirmation signal is connected, q is the index variable for the capture card number, N is the number of capture cards, and m is the current count value. This mapping relationship allows you to quickly determine the capture card number to which the light controller corresponding to the current trigger confirmation signal is connected based on the current count value m, that is, accurately determine which capture card the current light controller's trigger instruction came from.

[0042] The mapping relationship between the acquisition card output interface number connected to the light controller corresponding to the current trigger confirmation signal and the current count value satisfies: k=mS n-1 ; Among them, k is the output interface number of the acquisition card to which the light controller corresponding to the current trigger confirmation signal is connected, S n-1 = is the total number of output interfaces of the first n-1 acquisition cards. This mapping relationship can quickly determine the acquisition card output interface number to which the light controller corresponding to the current trigger confirmation signal is connected based on the current count value m, that is, accurately determine which acquisition card output interface the current light controller trigger instruction comes from.

[0043] The current count value is obtained and analyzed to determine the output interface position of the acquisition card to which the light controller corresponding to the current trigger confirmation signal is connected, so as to send a trigger instruction to the corresponding light controller. Based on the above two mapping relationships, the mapping relationship between the light controller and the corresponding acquisition card output interface can be accurately configured.

[0044] In actual use, it is often the case that all capture cards have the same number P of output interfaces. In this case, when M≤P, a single capture card can drive all light controllers, and k=m can be set at this time. When M>P, the master capture card drives P light controllers, that is, the master capture card sets k=m (m≤P), and the remaining MP light controllers are driven by other slave capture cards. At this time, for slave capture card 1, its output interface k=mP (m>P and m≤2P), for slave capture card 2, there is interface k=m-2P (m>2P), and so on. The maximum number of light controllers supported is N×P.

[0045] As can be seen from the above, after receiving the trigger command, all cameras perform delayed exposure according to the corresponding preset time, so that the corresponding light source has been completely lit when all cameras are exposed. In order to further improve the synchronization performance of the corresponding system of the above control method, the delayed exposure specifically includes the following steps: The calibration obtains the transmission time t1 of the main camera feedback trigger confirmation signal to the main acquisition card, the detection time t2 of the main acquisition card for the trigger confirmation signal, and the sending time t α,u And the delay time t of each light source from starting to completing lighting β,v , subscript u represents the serial number of the camera, and subscript v represents the serial number of the light source.

[0046] Analyze the total delay time t of each slave camera cam,u And the total delay time t for each light source to complete lighting light,v : t cam,u =t1+t2+t α,u ;t light,v =t1+t2+t β,v ; Calculate the delayed exposure time TD of the main camera master and the delayed exposure time TD of each slave camera slave,u : TD master =t light,v TD slave,u =t light,v -t cam,u =t β,v -t α,u ; Among them, the camera with the smallest line frequency / frame rate is the master camera, and the remaining cameras are slave cameras. The acquisition card corresponding to the master camera is the master acquisition card, and the acquisition card corresponding to the slave cameras is the slave acquisition card.

[0047] The following uses a 1.25G high-speed data link and a 20.833M low-speed command link as examples. Assuming there are no significant differences between cameras, capture cards, or cameras and capture cards, the master camera's ACK signal response is used as the starting point (this is the start of the master camera's exposure). The time differences between the other slave cameras' ACK signal responses (i.e., the start of the slave camera's exposure) are calculated.

[0048] 1) The main camera responds with an ACK signal via the 1.25G high-speed link. The protocol transmission time is 3 parallel clock cycles, and the parallel clock frequency is 31.25MHz. At this time, the transmission time t1 of the main camera's feedback trigger confirmation signal to the main acquisition card is 3 / 31.25, in microseconds.

[0049] 2) After detecting the ACK signal, the master acquisition card forwards the trigger instruction to the slave acquisition card. If the detection clock frequency is 50MHz, the detection time is 3 50MHz clock cycles. The acquisition cards are directly connected and do not use the protocol, so the forwarding time can be ignored. At this time, the master acquisition card's detection time for the trigger confirmation signal is t2 = 3 / 50, in microseconds.

[0050] 3) The slave capture card sends a trigger command to the slave camera via a 20.833M low-speed link. A total of three 32-bit data are required to be sent, which are then encoded into three 40-bit encoded data. At this time, the sending time t from each slave capture card to the slave camera is α,u are the same, t α,u =120 / 20.833, unit is us.

[0051] 4) The time from camera detection to trigger signal is negligible.

[0052] Therefore, the total delay time t of each slave camera cam,u =t1+t2+t α,u =3 / 31.25+3 / 50+120 / 20.833=5.9us, that is, the exposure time difference between the master and slave cameras is 5.9us; usually, each light source also requires a delay time of the order of 10us from startup to actual lighting (specific scenarios need to be measured), that is, t β,v =10us, so the total delay time for each light source to complete lighting is t light,v =t1+t2+t β,v =3 / 31.25+5 / 50+10=10.156us. In order to ensure that the light source of each camera is on during exposure, it is necessary to perform corresponding delayed exposure operation on each camera. At this time, the delayed exposure time TD of the main camera ismaster =t light,v =10.156us, delayed exposure time TD of each slave camera slave,u =t light,v -t cam,u =4.256us.

[0053] Therefore, in a multi-camera, multi-light source system, delayed exposure compensation is required for the master and slave cameras to ensure synchronization between camera exposure and light source activation. The compensation amount between the master and slave cameras is set differently based on the calibration results of different time parameters. After delay compensation, the only difference between the cameras is the jitter of the detection clock. This difference can currently be reasonably controlled to the sub-microsecond level, which is sufficient for most applications.

[0054] As can be seen above, the above-mentioned delayed exposure operation can effectively control the synchronization difference between camera exposure and light source lighting to the sub-microsecond level. To further reduce the synchronization difference, it is sometimes necessary to consider the impact of temperature on the calibration results. Specifically, the following steps are included: Construct a fitting model of the delay time and temperature of each light source from startup to completion of lighting: t β,v =a v T 2 +b v T+c v ; Among them, a v 、b v 、c v are the fitting coefficients of the corresponding light sources, and T is the temperature.

[0055] Count the delay time of each light source from startup to complete lighting at different temperatures.

[0056] The fitting parameters of the fitting model corresponding to each light source are obtained through analysis.

[0057] For any light source, we only need to use the delay time from start-up to complete lighting of the light source at different temperatures and substitute it into the fitting model to calculate the fitting coefficients a of the corresponding light source. v 、b v 、c v , so that the current ambient temperature can be used to obtain t in subsequent actual control β,v , thus achieving precise control.

[0058] As can be seen from the above, accurately counting the delay time from startup to complete lighting of each light source at different temperatures will directly affect the accuracy of the subsequent fitting coefficients. Therefore, in order to more accurately calculate the fitting coefficients and ensure subsequent precise control, the delay time from startup to complete lighting of each light source at different temperatures is counted as follows: Install the line scan camera so that it is controlled by the same trigger source as the current light source. The line scan camera is set to expose and scan immediately after being triggered. In this case, the same trigger source control means that the exposure of the line scan camera and the start-up of the current light source will occur at the same time.

[0059] Acquire several lines of data collected by the line scan camera within a preset time; during this preset time, the light source will gradually change from a dark state to a bright state. The specific preset time can be preset in advance based on actual experience, or adjusted secondary according to the actual process. During the initial setting, the preset time can be appropriately increased to ensure that the light source can reach sufficient brightness after being lit to meet the needs of subsequent grayscale value detection and judgment.

[0060] Calculate the average grayscale value of each row of data in the order of acquisition to determine the row number corresponding to when the average grayscale value first reaches the threshold. Since the light source will gradually change from a dark state to a bright state after being turned on, the average grayscale value of each row of data will also gradually increase. When it reaches the threshold for the first time, it corresponds to the light source having basically completed the lighting state.

[0061] The product of the row number and the row interval is calculated as the delay time from startup to complete lighting of the current light source at the current temperature. Since the row interval time is fixed and known, the product of the row number and the row interval can be used to calculate the transition time from the dark state to the bright state after the light source is lit, that is, the delay time from startup to complete lighting.

[0062] The same workflow applies to CameraLink acquisition systems, except that the communication channel between the acquisition card and the camera becomes CC1 (Camera Control 1). Trigger signal response functionality must also be added to the camera, via the serial port from the camera to the acquisition card. The design principles of this invention are also applicable to acquisition systems based on other protocols with minimal adaptation.

[0063] A second aspect of the present invention further provides an image synchronization acquisition and control system, comprising: Several cameras, consisting of a master camera and several slave cameras. The master camera has the lowest line frequency / frame rate and is used to feedback a trigger confirmation signal after receiving a trigger command. Several light sources for providing different lighting environments; A plurality of light controllers, corresponding one to each light source, for controlling the switching of the corresponding light source; Several acquisition cards, corresponding to each camera one by one, consist of a master acquisition card and several slave acquisition cards. The master acquisition card is connected to the master camera, used to receive trigger signals, generate trigger instructions and send them to the master camera to determine whether it has received the trigger confirmation signal fed back by the master camera: If so, synchronously send a trigger instruction to all slave acquisition cards and one of the light controllers, so that all slave cameras perform exposure after receiving the trigger instruction from the corresponding slave acquisition card, and make one of the light controllers light up the corresponding light source after receiving the trigger instruction from the master acquisition card or the slave acquisition card; If not, no response is made; Among them, after receiving the trigger command, all cameras delay exposure according to the corresponding preset time, so that the corresponding light sources have been completely lit when all cameras are exposed; the sum of the number of output interfaces for connecting to light controllers on all acquisition cards is greater than the total number of light sources.

[0064] The specific implementation and principle of this control system can refer to the above control method.

[0065] A third aspect of the present invention further provides a computer-readable storage medium comprising a computer program, wherein the computer program implements the above-mentioned control method when executed by a processor.

[0066] In practical applications, computer-readable storage media may take the form of any combination of one or more computer-readable media. Computer-readable media may be computer-readable signal media or computer-readable storage media. Computer-readable storage media may be, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component.

[0067] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0068] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0069] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0070] Throughout this specification, references to terms such as "one embodiment," "example," and "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0071] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention, and such changes and modifications fall within the scope of the invention as claimed.

Claims

1. A method for synchronous image acquisition control, which receives a trigger signal to control the synchronous triggering of multiple cameras and multiple light sources, characterized in that: Control methods include: Install several cameras, acquisition cards, light controllers, and light sources so that each acquisition card corresponds to each camera, and each light controller corresponds to each light source; Select the acquisition card corresponding to the camera with the smallest line frequency / frame rate to receive the trigger signal, and generate a trigger instruction to send to the corresponding camera to determine whether the trigger confirmation signal fed back by the camera is received: If so, a trigger instruction is synchronously sent to other acquisition cards and one of the light controllers, so that all cameras perform exposure after receiving the trigger instruction from the corresponding acquisition card, and one of the light controllers lights up the corresponding light source after receiving the trigger instruction from the acquisition card; If not, no response is made; Among them, after receiving the trigger command, all cameras delay exposure according to the corresponding preset time, so that the corresponding light sources have been completely lit when all cameras are exposed; the sum of the number of output interfaces for connecting to light controllers on all acquisition cards is greater than the total number of light sources.

2. The image synchronous acquisition control method according to claim 1, characterized in that: After receiving the trigger command, the camera determines whether to feedback the trigger confirmation signal: If yes, continue to receive the next trigger instruction; If not, the current trigger instruction is retained, and after a preset time interval with the last trigger instruction is reached, the current trigger instruction is received again to determine whether a trigger confirmation signal is fed back.

3. The image synchronous acquisition control method according to claim 1, characterized in that: The control acquisition card counts each received trigger confirmation signal so that the count value corresponds to a different light source until the current count value reaches the total number of light sources and then counts again.

4. The image synchronous acquisition control method according to claim 3, characterized in that: The control methods of the light controller include: Set the numbers of all light controllers, capture cards, and capture card output interfaces in sequence; A mapping relationship between the number of the acquisition card connected to the light controller corresponding to the current trigger confirmation signal and the current count value, and a mapping relationship between the output interface number of the acquisition card connected to the light controller corresponding to the current trigger confirmation signal and the current count value are respectively established; The current count value is obtained, and the position of the acquisition card output interface to which the light controller corresponding to the current trigger confirmation signal is connected is analyzed to send a trigger instruction to the corresponding light controller.

5. The image synchronous acquisition control method according to claim 4, characterized in that: The mapping relationship between the acquisition card number connected to the light controller corresponding to the current trigger confirmation signal and the current count value satisfies: ; Among them, S q is the total number of output interfaces of the first q acquisition cards, P i is the number of output interfaces of the i-th acquisition card, n is the acquisition card number to which the light controller corresponding to the current trigger confirmation signal is connected, q is the index variable of the acquisition card number, N is the number of acquisition cards, and m is the current count value; The mapping relationship between the acquisition card output interface number connected to the light controller corresponding to the current trigger confirmation signal and the current count value satisfies: k=mS n-1 ; Among them, k is the output interface number of the acquisition card to which the light controller corresponding to the current trigger confirmation signal is connected, S n-1 The total number of output interfaces of the first n-1 capture cards.

6. The image synchronous acquisition control method according to any one of claims 1 to 5, characterized in that: Delayed exposure includes: The calibration obtains the transmission time t1 of the main camera feedback trigger confirmation signal to the main acquisition card, the detection time t2 of the main acquisition card for the trigger confirmation signal, and the sending time t α,u And the delay time t of each light source from starting to completing lighting β,v ; Analyze the total delay time t of each slave camera cam,u And the total delay time t for each light source to complete lighting light,v : t cam,u =t1+t2+t α,u ;t light,v =t1+t2+t β,v ; Calculate the delayed exposure time TD of the main camera master and the delayed exposure time TD of each slave camera slave,u : TD master =t light,v ;TD slave,u =t light,v -t cam,u =t β,v -t α,u ; Among them, the camera with the smallest line frequency / frame rate is the master camera, and the remaining cameras are slave cameras. The acquisition card corresponding to the master camera is the master acquisition card, and the acquisition card corresponding to the slave cameras is the slave acquisition card.

7. The image synchronous acquisition control method according to claim 6, characterized in that: Also includes: Construct a fitting model of the delay time and temperature of each light source from startup to completion of lighting: t β,v =a v T 2 +b v T+c v ; Among them, a v 、b v 、c v are the fitting coefficients of the corresponding light sources, and T is the temperature; Count the delay time of each light source from start-up to complete lighting at different temperatures; The fitting parameters of the fitting model corresponding to each light source are obtained through analysis.

8. The image synchronous acquisition control method according to claim 7, characterized in that: Statistics on the delay time from start-up to complete lighting of each light source at different temperatures include: Install the line scan camera so that it is controlled by the same trigger source as the current light source; the line scan camera is set to expose and scan immediately after being triggered; Obtain several lines of data collected by the line scan camera within a preset time; Calculate the average grayscale value of each row of data in the order of acquisition to determine the row number corresponding to when the average grayscale value first reaches the threshold; The product of the row number and the row interval time is calculated as the delay time from starting to completing lighting of the current light source at the current temperature.

9. An image synchronous acquisition and control system, characterized in that: include: Several cameras, consisting of a master camera and several slave cameras. The master camera has the lowest line frequency / frame rate and is used to feedback a trigger confirmation signal after receiving a trigger command. Several light sources for providing different lighting environments; A plurality of light controllers, corresponding one to each light source, for controlling the switching of the corresponding light source; Several acquisition cards, corresponding to each camera one by one, consist of a master acquisition card and several slave acquisition cards. The master acquisition card is connected to the master camera, used to receive trigger signals, generate trigger instructions and send them to the master camera to determine whether it has received the trigger confirmation signal fed back by the master camera: If so, synchronously send a trigger instruction to all slave acquisition cards and one of the light controllers, so that all slave cameras perform exposure after receiving the trigger instruction from the corresponding slave acquisition card, and make one of the light controllers light up the corresponding light source after receiving the trigger instruction from the master acquisition card or the slave acquisition card; If not, no response is made; Among them, after receiving the trigger command, all cameras delay exposure according to the corresponding preset time, so that the corresponding light sources have been completely lit when all cameras are exposed; the sum of the number of output interfaces for connecting to light controllers on all acquisition cards is greater than the total number of light sources.

10. A computer-readable storage medium comprising a computer program, characterized in that When the computer program is executed by a processor, the control method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Channel matching method based on industrial visual control system

    CN121531243A