Multi-camera multi-light-source control method and device, electronic equipment and storage medium
By employing a collaborative control method for multi-camera and multi-light source systems, the problems of low control accuracy and poor automation in existing technologies are solved, resulting in a high-precision, high-speed response, and highly scalable multi-light source system suitable for diverse application scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN GEYUAN TECH CO LTD
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-08
AI Technical Summary
Existing multi-camera, multi-light source systems have shortcomings in control accuracy, pairing efficiency, feedback mechanisms, and scalability, making them unsuitable for diverse application scenarios, especially in high-speed dynamic detection where collaborative operation is difficult.
By acquiring the control execution sequence in response to the target trigger signal, determining the mode of the control sub-task instruction, and setting the control pulse according to the mode, the coordinated control of multiple target light sources and cameras is realized, including the unified scheduling of internal and external light sources, and supporting dual-mode control and closed-loop feedback mechanism.
It improves control precision, enhances system reliability and scalability, supports high-speed execution of complex lighting processes, and meets the needs of industrial automation testing.
Smart Images

Figure CN122002123A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vision control technology, and in particular to a control method, device, electronic device and storage medium for multiple cameras and multiple light sources. Background Technology
[0002] In the field of industrial vision inspection, the collaborative control of multi-camera and multi-light source systems is crucial for achieving high-precision and high-efficiency inspection. However, existing technologies have significant shortcomings in control accuracy, pairing efficiency, feedback mechanisms, and scalability, severely restricting further improvements in system performance and its widespread application.
[0003] Currently, traditional multi-camera, multi-light source control relies primarily on fixed and singular technical methods. In terms of control modes, common light source controller solutions employ fixed pulse width control, such as using a programmable logic controller (PLC) to generate rising edge trigger signals to drive the light source. However, this lacks a binding relationship between input / output (IO) and execution sequence, resulting in a rigid synchronization strategy between the camera and the light source, making it unable to support complex lighting processes such as multi-stage exposure and alternating illumination from multiple light sources. Regarding multi-light source coordination, internal light sources (such as built-in camera illumination) and external light sources (such as independent supplemental lighting devices) are often managed separately by different controllers, lacking unified scheduling. This leads to difficulties in collaborative operation, poor scalability, and an inability to adapt to diverse application scenarios (such as high-speed dynamic detection).
[0004] Therefore, there is an urgent need in this field for an innovative control method to overcome the above-mentioned technical problems and improve the control accuracy, automation level and overall performance of multi-camera and multi-light source systems. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a control method, device, electronic device and storage medium for multiple cameras and multiple light sources, so as to solve the problems of low control accuracy and poor automation in the existing multi-camera and multi-light source systems, thereby improving the overall performance.
[0006] This application provides a control method for multiple cameras and multiple light sources, the control method including: In response to a target trigger signal, a control execution sequence is acquired; wherein, the control execution sequence includes at least one control subtask instruction, and each control subtask instruction contains corresponding task requirement parameters. For each control subtask instruction in the control execution sequence, the control mode of the control subtask instruction is determined according to the task requirement parameters corresponding to the control subtask instruction. Based on the determined control mode, set the control pulse of the control subtask instruction; According to the control pulse of each control subtask instruction, each control subtask instruction in the control execution sequence is executed sequentially to coordinate the control of multiple target light sources and target cameras; wherein, the target light sources include internal target light sources and external target light sources.
[0007] Optionally, the target trigger signal is a hardware trigger signal or a software trigger signal. The hardware trigger signal is a pulse trigger signal received from a PLC or other control device through an IO interface; the software trigger signal is a signal obtained by issuing a trigger command through an SDK based on network communication or serial communication.
[0008] Optionally, the task requirement parameters added to each control subtask instruction include internal lighting parameters, camera output parameters, and external device output parameters.
[0009] Optionally, the control mode of the control subtask instruction can be determined through the following steps: For this control subtask instruction, set parameters according to the task requirements of the control subtask instruction, and determine whether the pulse width of all pulses in the control subtask instruction exceeds the preset pulse width threshold. If none of them exceed the specified value, the control mode of this control subtask is determined to be high-precision mode. If any pulse width exceeds the preset threshold, the control mode of the control subtask is determined to be low precision mode.
[0010] Optionally, the control pulses of the control subtask instruction include LED light pulses, camera exposure pulses, and DO output pulses; wherein, the timing parameters are independently set in the LED light pulses, camera exposure pulses, and DO output pulses, and the timing parameters include pulse width and pulse delay; the pulse delay is used to ensure synchronization between the camera and the light source.
[0011] Optionally, the control pulses of the control subtask instructions include multiple control pulses, and the step of sequentially executing each control subtask instruction in the control execution sequence according to the control pulse of each control subtask instruction includes: When executing each control subtask instruction in the order of the control execution sequence, all control pulses of that control subtask instruction are executed in parallel, and the current instruction execution status is fed back in real time.
[0012] Optionally, the control method further includes: Basic information about each camera is obtained through the communication interface; Control the working state of each camera to the ready-to-shoot state so that each camera is ready to receive trigger pulses; Each light source controller is controlled sequentially to output a trigger signal, and all cameras are monitored to determine whether a response image is generated; The camera that generates the response image is bound to the corresponding light source controller, until all cameras and light source controllers are bound to each other.
[0013] This application embodiment also provides a control device for multiple cameras and multiple light sources, the control device comprising: The acquisition module is used to acquire a control execution sequence in response to a target trigger signal; wherein the control execution sequence includes at least one control subtask instruction, and each control subtask instruction has a corresponding task requirement parameter added to it; The determination module is used to determine the control mode of each control subtask instruction in the control execution sequence based on the task requirement parameters corresponding to the control subtask instruction. The setting module is used to set the control pulse of the control subtask instruction according to the determined control mode; The control module is used to execute each control subtask instruction in the control execution sequence sequentially according to the control pulse of each control subtask instruction, so as to coordinate the control of multiple target light sources and target cameras; wherein, the target light sources include internal target light sources and external target light sources.
[0014] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the control method described above are performed.
[0015] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the control method described above.
[0016] This application provides a control method, apparatus, electronic device, and storage medium for multiple cameras and multiple light sources. The method includes: acquiring a control execution sequence in response to a target trigger signal; wherein the control execution sequence includes at least one control sub-task instruction, and each control sub-task instruction includes a corresponding task requirement parameter; for each control sub-task instruction in the control execution sequence, determining a control mode for the control sub-task instruction based on the corresponding task requirement parameter; setting a control pulse for the control sub-task instruction based on the determined control mode; and executing each control sub-task instruction in the control execution sequence sequentially according to the control pulse of each control sub-task instruction to perform coordinated control of multiple target light sources and target cameras; wherein the target light sources include internal target light sources and external target light sources. Thus, this solution achieves the following technical effects: First, dual-mode control balances high-speed response and long-term feedback requirements, enabling optimal allocation of MCU resources, avoiding resource waste and performance bottlenecks, and improving control accuracy. Second, automatic pairing eliminates the need for manual configuration, effectively improving deployment efficiency. Third, a complete closed-loop feedback mechanism ensures control accuracy, thereby enhancing system reliability. Finally, the unified architecture provided by this solution supports collaborative control of internal and external light sources, adapting to diverse application scenarios, significantly improving the scalability of the solution, and supporting high-speed execution of complex lighting processes, thus meeting the needs of industrial automation inspection.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart illustrating a multi-camera, multi-light source control method provided in this application embodiment; Figure 2 This is one of the structural schematic diagrams of a multi-camera and multi-light source control device provided in the embodiments of this application; Figure 3 A second schematic diagram of a multi-camera, multi-light source control device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0021] In the field of industrial vision inspection, the collaborative control of multi-camera and multi-light source systems is crucial for achieving high-precision and high-efficiency inspection. However, existing technologies have significant shortcomings in control accuracy, pairing efficiency, feedback mechanisms, and scalability, severely restricting further improvements in system performance and its widespread application.
[0022] Currently, traditional multi-camera, multi-light source control relies primarily on fixed and singular technical methods. In terms of control modes, common light source controller solutions employ fixed pulse width control, such as using a programmable logic controller (PLC) to generate rising edge trigger signals to drive the light source. However, this lacks a binding relationship between input / output (IO) and execution sequence, resulting in a rigid synchronization strategy between the camera and the light source, making it unable to support complex lighting processes such as multi-stage exposure and alternating illumination from multiple light sources. Regarding multi-light source coordination, internal light sources (such as built-in camera illumination) and external light sources (such as independent supplemental lighting devices) are often managed separately by different controllers, lacking unified scheduling. This leads to difficulties in collaborative operation, poor scalability, and an inability to adapt to diverse application scenarios (such as high-speed dynamic detection).
[0023] Based on this, embodiments of this application provide a control method, device, electronic device, and storage medium for multi-camera and multi-light source systems to solve the problems of low control accuracy and poor automation in existing multi-camera and multi-light source systems, thereby improving overall performance.
[0024] Please see Figure 1 , Figure 1 This is a flowchart illustrating a multi-camera, multi-light source control method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the control method includes: S101. In response to the target trigger signal, acquire the control execution sequence.
[0025] S102. For each control subtask instruction in the control execution sequence, determine the control mode of the control subtask instruction according to the task requirement parameters corresponding to the control subtask instruction.
[0026] S103. Based on the determined control mode, set the control pulse of the control subtask instruction.
[0027] S104. Based on the control pulses of each control subtask instruction, execute each control subtask instruction in the control execution sequence in sequence to coordinate the control of multiple target light sources and target cameras.
[0028] The target light source includes an internal target light source and an external target light source.
[0029] The steps in the embodiments of this application are described in detail below: Regarding step S101, the target trigger signal is a hardware trigger signal or a software trigger signal. The hardware trigger signal is a pulse trigger signal received from a PLC or other control device through an IO interface; the software trigger signal is a signal obtained by issuing a trigger command through an SDK based on network communication or serial communication.
[0030] Here, the control execution sequence includes at least one control subtask instruction. Each control subtask instruction contains corresponding task requirement parameters, which include internal lighting parameters, camera output parameters, and external device output parameters.
[0031] The internal lighting parameters specifically include setting the on / off status, brightness, and exposure time of 32 independent channels.
[0032] The camera output parameters are camera trigger pulse outputs.
[0033] The external device output parameters include 6 digital output pulses.
[0034] Furthermore, it should be noted that different LED combinations or exposure times can be configured between control subtask commands. For example, the configuration process of the command (capture) is illustrated below: Each capture can be configured independently: Each capture can be configured with an LED pattern combination; the LED pattern combination includes the on / off state (0 or 1) and brightness level of 32 independent channels; each capture can be configured with an exposure time independently (controlled by the width parameter of the camera trigger pulse).
[0035] When configuring the sequence, different LED combinations can be set for different captures. Capture1 (instruction 1) uses the first 16 channels, capture2 (instruction 2) uses the last 16 channels, and capture3 (instruction 3) uses all 32 channels. Different lighting effects can be achieved by using different LED combinations.
[0036] During configuration, the exposure time difference can be configured: specifically, the camera trigger pulse for each capture can be set with different width parameters, and the width parameter directly controls the camera's exposure time.
[0037] For example, capture1 has an exposure of 50µs, capture2 has an exposure of 100µs, and capture3 has an exposure of 150µs. By using different exposure times, different shooting needs can be met.
[0038] During configuration, the execution order is also configured. When configuring the sequence, the captures are arranged in the required order. When the system executes the sequence, each capture is executed in the configured order, and each capture uses its own independent configuration parameters (LED combination, exposure time, etc.).
[0039] Continuing with step S101, each control subtask instruction represents a complete photo-taking process, meaning one frame of image capture by the camera, including light source control, camera triggering, and external device control.
[0040] Regarding step S102, in one embodiment provided in this application, the control mode of the control subtask instruction is determined by the following steps: For the control subtask instruction, parameters are set according to the task requirements of the control subtask instruction to determine whether the pulse width of all pulses in the control subtask instruction exceeds a preset pulse width threshold; if none exceed the threshold, the control mode of the control subtask is determined to be a high-precision mode; if any pulse width exceeds the preset threshold, the control mode of the control subtask is determined to be a low-precision mode.
[0041] Here, the preset pulse width threshold is determined based on hardware limitations. The specific pulse control accuracy depends on the hardware limitations of the 16-bit timer. Due to clock configuration and 16-bit timer width limitations, the maximum output pulse width is approximately 20ms. Therefore, the preset pulse width threshold is set to 20ms.
[0042] Regarding the high-precision mode, it should be noted that this mode is applicable to normal lighting and camera control scenarios, and the control accuracy can reach microsecond-level high-precision control; the pulse range is 0 to 20ms; technical features: based on 16-bit timer hardware, it provides 1μs pulse accuracy, but the pulse duration is limited (maximum 20ms); triggering condition: when the width of all pulses in the control subtask instruction does not exceed 20ms, the system automatically selects the high-precision mode.
[0043] Regarding the low-precision mode, it should be noted that the applicable scenarios are: PLC feedback signal control; control precision is millisecond-level control; pulse range is 21 to 999ms; technical features include: stable communication with the PLC system is achieved by extending the pulse width or setting a status hold bit, supporting long-term control; triggering condition: when the longest pulse in the control subtask instruction exceeds 20ms, the system automatically switches to low-precision mode for execution.
[0044] For step S103, the control pulses of the control subtask instruction include LED light pulses, camera exposure pulses, and DO output pulses; wherein, the timing parameters are independently set in the LED light pulses, camera exposure pulses, and DO output pulses, and the timing parameters include pulse width and pulse delay; the pulse delay is used to ensure synchronization between the camera and the light source.
[0045] The generation method of control pulses can also be different for different modes.
[0046] For example, the pulse generation principle in high-precision mode is as follows: The system provides a 16-bit high-precision timer HRTIM with a clock frequency multiplied to 100MHz by an external 8MHz crystal oscillator and the internal phase-locked loop of the MCU. The HRTIM peripheral can output high-precision pulses with an accuracy of nanoseconds in the range of 1µs to 20ms. The HRTIM hardware timer provides nanosecond-level time resolution to ensure the accuracy of pulse generation; pulse width range: 1µs to 20ms; pulse accuracy: nanosecond level.
[0047] The pulse generation principle in low-precision mode is as follows: When the system has an ACK requirement, a 20ms pulse cannot meet the requirement, and a wider pulse range is needed as the acknowledgment signal. At this time, HRTIM cannot meet the system's requirements (limited by a 16-bit counter and a maximum pulse width of 20ms). However, since the ACK signal does not have high requirements for pulse precision, a hardware timer with a time base of 1ms can be initialized. A wider pulse range can be output through interrupt counting. Within the lifetime of Capture, an Ack signal in the range of 21~999ms can be generated at most. Pulse width range: 21ms to 999ms; Pulse precision: millisecond level.
[0048] Thus, the pulse generation process in high-precision mode and low-precision mode is as follows: First, read the pulse configuration parameters (including pulse width and pulse delay) from the control subtask instruction (capture); then determine the required control mode based on the width of the longest pulse in the capture; finally, configure the corresponding timer hardware. In high-precision mode, an external 8MHz crystal oscillator is used, and the clock frequency is multiplied to 100MHz through the internal phase-locked loop of the MCU. A 16-bit high-precision timer HRTIM is configured, and HRTIM parameters, including clock source, frequency division coefficient, count value, etc., are set. The HRTIM hardware directly outputs a pulse signal with nanosecond-level precision.
[0049] In low-precision mode, a hardware timer with a time base of 1ms is initialized, the timer interrupt is configured, and the pulse output is controlled by interrupt counting. During the life cycle of Capture, the pulse output in the range of 21~999ms is achieved by interrupt counting. The timer is started to generate control pulses that meet the requirements. After the pulses are generated, they are output to the target device through the hardware output interface.
[0050] After the control pulse is generated, it is synchronously output to the camera and the light source.
[0051] Regarding step S104, in one embodiment provided in this application, the control pulses of the control subtask instruction include multiple control pulses. The step of sequentially executing each control subtask instruction in the control execution sequence according to the control pulse of each control subtask instruction includes: when executing each control subtask instruction sequentially according to the order of the control execution sequence, executing all control pulses of the control subtask instruction in parallel, and providing real-time feedback on the current instruction execution status.
[0052] The execution status may include the execution status of the sequence (start, in progress, completed, exception); the execution status of the capture: the execution progress and status of each capture; and the device response status: the response status of devices such as cameras and light sources.
[0053] It's important to note that all pulse outputs within a single capture are executed in parallel. The pulses include: LED light pulses, camera exposure pulses, and six DO output pulses. All pulses share the same trigger point but can have different delay times. Each pulse can have its timing parameters set independently, including: pulse width (controlling the pulse duration) and pulse delay (controlling the pulse's delay relative to the trigger signal). The minimum setting unit for pulse delay is 1 microsecond (µs); the minimum setting unit for pulse width is 1 microsecond (µs).
[0054] The principle behind camera and light source synchronization is as follows: there may be differences in the response time of the camera and the response time of the light. The system can compensate for the difference in response time between different devices by adjusting the pulse delay parameter.
[0055] For example, if the camera response requires 50µs and the light response requires 20µs, the light pulse delay can be set to 30µs to perfectly synchronize the exposure timing of the two. Through precise delay adjustment, the system can achieve microsecond-level synchronization accuracy.
[0056] For example, the synchronization process between the camera and the light source is illustrated below: After receiving the trigger signal, the system starts the timer for all pulses. According to the delay parameters configured for each pulse, the system outputs the pulse at the corresponding time point. The LED light pulse is output after a delay of T1, with a duration of W1; the camera exposure pulse is output after a delay of T2, with a duration of W2. By adjusting T1 and T2, it is ensured that the timing of the LED lighting and the camera exposure perfectly coincides. The DO output pulse is output at the specified time according to the configured delay and width parameters, achieving precise timing control.
[0057] Through the aforementioned dual-mode control architecture and precise timing parameter configuration, the system achieves precise timing control from microseconds to milliseconds, meeting the needs of different application scenarios.
[0058] Furthermore, in one embodiment provided in this application, the control method further includes: S201. Obtain basic information about each camera through the communication interface.
[0059] S202. Control the working state of each camera to the shooting state so that each camera is ready to receive the trigger pulse.
[0060] S203, sequentially control each light source controller to output trigger signals, and monitor all cameras to determine whether a response image is generated.
[0061] S204. Bind the information of the camera that generates the response image to the corresponding light source controller until the binding of all cameras and light source controllers is completed.
[0062] For steps S201-S204, the binding relationship between the camera and the light source controller will be explained as follows.
[0063] First, all cameras to be matched are set to a waiting-to-take-photo state. Then, the system records the unique identifier (camera SN) of each camera. One of the light source controllers is then controlled to execute a sequence, where the capture (control subtask instruction) contains the camera output pulse. The light source controller outputs a camera trigger pulse to the connected device, monitors the status of all cameras, and detects which camera responded to the photo-taking action (generated a new image). By detecting which camera responded to the photo-taking action, it can be determined which controller's pulse triggered which camera, establishing the correspondence between the light source controller and the camera, and recording the matching result: Light Source Controller SN. Camera SN. Repeat the above process, testing each light source controller in turn, until all cameras are matched with their corresponding light source controllers; if a camera does not respond, it is marked as unmatched and awaits further processing.
[0064] In this way, automatic recognition based on image response ensures the accuracy of pairing, interference is avoided through individual testing, pairing reliability is improved, and multi-round pairing is supported to handle abnormal situations.
[0065] After the binding relationship is determined, the logical binding relationship can be stored in the database. The storage format includes information such as camera SN, light source SN, binding time, and binding status.
[0066] Storage uses include: for subsequent queries and use; automatic loading of binding relationships upon system startup, eliminating the need for re-pairing; and support for modifying, deleting, and restoring binding relationships.
[0067] Furthermore, this solution enables high-speed task instruction switching. For example, the implementation of high-speed switching is described below: First, the lifecycle mechanism is set up as follows: Within a sequence, each capture (control subtask instruction) has its own lifecycle. The lifecycle defines the execution duration of the capture. After the lifecycle ends, the system immediately executes the next capture.
[0068] Then, configuration preloading is performed. Before executing the sequence, all capture configurations are preloaded into memory to avoid configuration loading delays during execution. Configuration data includes: LED combinations, pulse parameters, delay parameters, etc.
[0069] Next, hardware timer control is implemented to achieve precise lifecycle control. The timer accuracy reaches the microsecond level. When the lifecycle of the current capture ends, the timer triggers an interrupt.
[0070] Finally, when the timer interrupt is triggered, the system immediately performs the following operations: stops all output of the current capture, loads the configuration parameters of the next capture, and starts the execution of the next capture. The switching time is controlled in the microsecond range to ensure high-speed switching.
[0071] Furthermore, this solution can achieve a high-speed triggering of 200fps. The principle is as follows: 200fps means 200 frames per second, or 5ms per frame. If the lifecycle of each capture is 5ms, a triggering frequency of 200fps can be achieved.
[0072] For example, a sequence contains 10 captures, each with a lifespan of 5ms, for a total execution time of 50ms, and can take 10 photos.
[0073] Thus, this solution achieves the following technical effects: First, dual-mode control balances high-speed response and long-term feedback requirements, enabling optimal allocation of MCU resources, avoiding resource waste and performance bottlenecks, and improving control accuracy. Second, automatic pairing eliminates the need for manual configuration, effectively improving deployment efficiency. Third, a complete closed-loop feedback mechanism ensures control accuracy, thereby enhancing system reliability. Finally, the unified architecture provided by this solution supports collaborative control of internal and external light sources, adapting to diverse application scenarios, significantly improving the scalability of the solution, and supporting high-speed execution of complex lighting processes, thus meeting the needs of industrial automation inspection.
[0074] Based on the same inventive concept, this application also provides a control device corresponding to the control method. Since the principle of the device in this application is similar to the control method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0075] Please see Figure 2 , Figure 3 , Figure 2 This is one of the structural schematic diagrams of a multi-camera, multi-light source control device provided in the embodiments of this application. Figure 3 This is a second schematic diagram of a multi-camera, multi-light source control device provided in an embodiment of this application. Figure 2 As shown, the control device 200 includes: The acquisition module 210 is used to acquire a control execution sequence in response to a target trigger signal; wherein the control execution sequence includes at least one control subtask instruction, and each control subtask instruction has a corresponding task requirement parameter added to it; The determining module 220 is used to determine the control mode of each control subtask instruction in the control execution sequence based on the task requirement parameters corresponding to the control subtask instruction. Setting module 230 is used to set the control pulse of the control subtask instruction according to the determined control mode; The control module 240 is used to execute each control subtask instruction in the control execution sequence in sequence according to the control pulse of each control subtask instruction, so as to coordinate the control of multiple target light sources and target cameras; wherein, the target light sources include internal target light sources and external target light sources.
[0076] Optionally, the target trigger signal is a hardware trigger signal or a software trigger signal. The hardware trigger signal is a pulse trigger signal received from a PLC or other control device through an IO interface; the software trigger signal is a signal obtained by issuing a trigger command through an SDK based on network communication or serial communication.
[0077] Optionally, the task requirement parameters added to each control subtask instruction include internal lighting parameters, camera output parameters, and external device output parameters.
[0078] Optionally, the determining module 220 is further configured to determine the control mode of the control subtask instruction through the following steps: For this control subtask instruction, set parameters according to the task requirements of the control subtask instruction, and determine whether the pulse width of all pulses in the control subtask instruction exceeds the preset pulse width threshold. If none of them exceed the specified value, the control mode of this control subtask is determined to be high-precision mode. If any pulse width exceeds the preset threshold, the control mode of the control subtask is determined to be low precision mode.
[0079] Optionally, the control pulses of the control subtask instruction include LED light pulses, camera exposure pulses, and DO output pulses; wherein, the timing parameters are independently set in the LED light pulses, camera exposure pulses, and DO output pulses, and the timing parameters include pulse width and pulse delay; the pulse delay is used to ensure synchronization between the camera and the light source.
[0080] Optionally, the control pulses for the control subtask instructions include multiple pulses. When the control module executes each control subtask instruction in the control execution sequence sequentially according to the control pulses of each control subtask instruction, the control module is used to: When executing each control subtask instruction in the order of the control execution sequence, all control pulses of that control subtask instruction are executed in parallel, and the current instruction execution status is fed back in real time.
[0081] Optional, such as Figure 3 As shown, the control device 200 further includes a matching module 250, which is used for: Basic information about each camera is obtained through the communication interface; Control the working state of each camera to the ready-to-shoot state so that each camera is ready to receive trigger pulses; Each light source controller is controlled sequentially to output a trigger signal, and all cameras are monitored to determine whether a response image is generated; The camera that generates the response image is bound to the corresponding light source controller, until all cameras and light source controllers are bound to each other.
[0082] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.
[0083] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1 The steps in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0084] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0085] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0086] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0087] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0088] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0089] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0090] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A control method for multiple cameras and multiple light sources, characterized in that, The control method includes: In response to a target trigger signal, a control execution sequence is acquired; wherein, the control execution sequence includes at least one control subtask instruction, and each control subtask instruction contains corresponding task requirement parameters. For each control subtask instruction in the control execution sequence, the control mode of the control subtask instruction is determined according to the task requirement parameters corresponding to the control subtask instruction. Based on the determined control mode, set the control pulse of the control subtask instruction; According to the control pulse of each control subtask instruction, each control subtask instruction in the control execution sequence is executed sequentially to coordinate the control of multiple target light sources and target cameras; wherein, the target light sources include internal target light sources and external target light sources.
2. The control method according to claim 1, characterized in that, The target trigger signal is a hardware trigger signal or a software trigger signal. The hardware trigger signal is a pulse trigger signal received from a PLC or other control device through an IO interface. The software trigger signal is a signal obtained by issuing a trigger command through an SDK based on network communication or serial communication.
3. The control method according to claim 1, characterized in that, The task requirement parameters added to each control subtask instruction include internal lighting parameters, camera output parameters, and external device output parameters.
4. The control method according to claim 1, characterized in that, The control mode of the control subtask instruction is determined by the following steps: For this control subtask instruction, set parameters according to the task requirements of the control subtask instruction, and determine whether the pulse width of all pulses in the control subtask instruction exceeds the preset pulse width threshold. If none of them exceed the specified value, the control mode of this control subtask is determined to be high-precision mode. If any pulse width exceeds the preset threshold, the control mode of the control subtask is determined to be low precision mode.
5. The control method according to claim 1, characterized in that, The control pulses of the control subtask command include LED light pulses, camera exposure pulses, and DO output pulses; wherein, the timing parameters are independently set in the LED light pulses, camera exposure pulses, and DO output pulses, and the timing parameters include pulse width and pulse delay; the pulse delay is used to ensure synchronization between the camera and the light source.
6. The control method according to claim 1, characterized in that, The control pulses for the control subtask instructions include multiple control pulses. The step of sequentially executing each control subtask instruction in the control execution sequence according to the control pulse of each control subtask instruction includes: When executing each control subtask instruction in the order of the control execution sequence, all control pulses of that control subtask instruction are executed in parallel, and the current instruction execution status is fed back in real time.
7. The control method according to claim 1, characterized in that, The control method further includes: Basic information about each camera is obtained through the communication interface; Control the working state of each camera to the ready-to-shoot state so that each camera is ready to receive trigger pulses; Each light source controller is controlled sequentially to output a trigger signal, and all cameras are monitored to determine whether a response image is generated; The camera that generates the response image is bound to the corresponding light source controller, until all cameras and light source controllers are bound to each other.
8. A control device for multiple cameras and multiple light sources, characterized in that, The control device includes: The acquisition module is used to acquire a control execution sequence in response to a target trigger signal; wherein the control execution sequence includes at least one control subtask instruction, and each control subtask instruction has a corresponding task requirement parameter added to it; The determination module is used to determine the control mode of each control subtask instruction in the control execution sequence based on the task requirement parameters corresponding to the control subtask instruction. The setting module is used to set the control pulse of the control subtask instruction according to the determined control mode; The control module is used to execute each control subtask instruction in the control execution sequence sequentially according to the control pulse of each control subtask instruction, so as to coordinate the control of multiple target light sources and target cameras; wherein, the target light sources include internal target light sources and external target light sources.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the machine-readable instructions are executed by the processor to perform the steps of the control method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the control method as described in any one of claims 1 to 7.