Camera shooting control method and device using optical fiber signal, equipment and medium
By replacing traditional cables with optical fiber signal transmission and combining electro-optical conversion and quantum encryption, the signal interference problem of traditional cables in complex electromagnetic environments is solved, stable and secure equipment control is achieved, and the transmission needs of high flexibility over short distances and high stability over long distances are met.
Patent Information
- Application Number
- CN202510690561.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional cable media for transmitting electrical signals are susceptible to interference in complex electromagnetic environments, resulting in signal distortion and limited transmission distance. In addition, the cables are heavy and can easily lead to false triggering or control deviations.
Fiber optic signal transmission is adopted, and traditional cables are replaced by plastic optical fiber or quartz optical fiber. The electro-optical conversion module and the photoelectric conversion module are combined to realize the photoelectric conversion of the signal. The flexibility and low loss characteristics of the optical fiber are utilized to ensure the stable transmission of the signal in different distance scenarios, and the transmission security is improved through quantum key distribution and encryption mechanism.
It effectively avoids electromagnetic interference, improves system stability and transmission distance, reduces the probability of false triggering, ensures the accuracy of multi-device collaboration, and adapts to device control in complex environments.
Smart Images

Figure CN120676246A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of equipment control, and in particular to a camera control method, device, equipment and medium using optical fiber signals. Background Art
[0002] In machine vision systems, the traditional architecture usually consists of a light source, a camera, a trigger system, and a host computer (such as a PC). Its typical workflow is as follows: the host computer sends a work instruction to the trigger system, and the trigger system sends a trigger signal to the camera and light source via a level pulse signal (such as TTL, LVTTL, 485, etc.). After receiving the signal, the light source and camera respectively perform flashing and image acquisition operations, and finally transmit the image data to the host computer for processing. However, this type of level pulse-based transmission method is extremely susceptible to interference in complex electromagnetic environments (such as large motor operation and high current switching scenarios), resulting in problems such as false triggering and signal distortion, seriously affecting system stability and image acquisition accuracy. With the development of industrial automation and intelligent equipment, higher requirements are placed on the anti-interference ability of camera control systems, long-distance transmission stability, and multi-device collaborative accuracy. Summary of the Invention
[0003] In view of this, the embodiments of the present invention provide a camera control method, device, equipment and medium using optical fiber signals to solve the problem that electromagnetic interference existing when traditional cable media transmit electrical signals causes signal distortion, limited transmission distance, and heavy cable weight, which easily leads to a high probability of false triggering or control deviation due to signal instability.
[0004] In a first aspect, an embodiment of the present invention provides a camera control method using an optical fiber signal, the method comprising:
[0005] After detecting a power-on event, the host computer generates a control instruction, and sends the control instruction to the controlled device via an optical fiber through an electro-optical conversion module of the host computer;
[0006] The control instruction is converted into an electrical signal by using the photoelectric conversion module of the controlled device, and a corresponding control operation is performed based on the electrical signal until the controlled device reaches a target control state.
[0007] Furthermore, the optical fiber includes a plastic optical fiber or a quartz optical fiber. The plastic optical fiber is used in conjunction with an adapter to achieve photoelectric signal transmission in a short-distance scenario, and the quartz optical fiber is used in conjunction with an adapter to achieve photoelectric signal transmission in a long-distance scenario.
[0008] Furthermore, the method further comprises:
[0009] In response to the power-on event, performing an initialization operation on the host computer and the controlled device, and obtaining first configuration information of the controlled device and second configuration information of the host computer;
[0010] The first configuration information is used to configure the working mode corresponding to the controlled device, and the second configuration information is used to configure the working parameters corresponding to the host computer.
[0011] Furthermore, configuring the operating mode corresponding to the controlled device using the first configuration information includes:
[0012] Parsing the first configuration information to obtain configuration parameters corresponding to the controlled device;
[0013] The configuration parameters are verified to obtain verification results. When the verification fails, abnormal parameters in the configuration parameters are corrected until the verification passes, and the working mode of the controlled device is configured using the corrected configuration parameters.
[0014] Furthermore, the control instruction is sent to the controlled device via an optical fiber by the electro-optical conversion module of the host computer, including:
[0015] Detecting the current working state of the host computer and the working mode of the controlled device;
[0016] If the working mode is the synchronous mode and the working state is the normal state, the control instruction is sent to the controlled device via the optical fiber through the electro-optical conversion module of the host computer.
[0017] Furthermore, when the controlled device is a camera device, performing a corresponding control operation based on the electrical signal includes:
[0018] parsing a trigger timing sequence in the electrical signal, controlling the camera device to start exposure within a specified time window according to the trigger timing sequence, and synchronously adjusting image acquisition parameters;
[0019] Image data is collected based on the image collection parameters, and after the collection is completed, the image data is fed back to the host computer through the optical fiber.
[0020] Furthermore, when the controlled device is a light source device, performing a corresponding control operation based on the electrical signal includes:
[0021] Analyzing the target light source intensity value in the electrical signal to generate a pulse modulation signal;
[0022] The sensor array is driven to output a flashing light source according to the pulse modulation signal, and an actual light source intensity value is detected, and the actual light source intensity value is compared with the target light source intensity value. If there is a deviation, the pulse modulation signal of the sensor array is adjusted.
[0023] Furthermore, when the controlled device is an aperture device, performing a corresponding control operation based on the electrical signal includes:
[0024] parsing the target aperture value in the electrical signal;
[0025] Based on the aperture adjustment parameter, the stepper motor is controlled to rotate to adjust the aperture blade opening and closing degree, and the actual aperture value is detected and compared with the target aperture value. If there is a deviation, the driving signal of the stepper motor is corrected.
[0026] Furthermore, after the controlled device reaches the target control state, the method further includes:
[0027] Collecting output data of the controlled device;
[0028] Performing quality assessment on the output data to obtain an assessment result;
[0029] If the evaluation result does not meet the preset standard, a parameter adjustment instruction is generated and transmitted back to the host computer through the optical fiber, and the host computer is controlled to update the control instruction according to the parameter adjustment instruction.
[0030] In a second aspect, an embodiment of the present invention provides a camera control device using an optical fiber signal, the device comprising:
[0031] A sending module, configured to generate a control instruction from a host computer after detecting a power-on event, and send the control instruction to a controlled device via an optical fiber through an electro-optical conversion module of the host computer;
[0032] An execution module is used to convert the control instruction into an electrical signal by using the photoelectric conversion module of the controlled device, and execute a corresponding control operation based on the electrical signal until the controlled device reaches a target control state.
[0033] In a third aspect, an embodiment of the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0034] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0035] The method provided in the embodiment of the present application adopts optical fiber (including plastic optical fiber and quartz optical fiber) as the signal transmission medium to replace the traditional level pulse signal. Among them, plastic optical fiber is suitable for short-distance scenarios (such as internal integration of equipment). With its good flexibility and easy connection characteristics, it can be used with an adapter to achieve high-speed photoelectric signal conversion and reduce the impact of electromagnetic interference on the trigger signal; quartz optical fiber is aimed at long-distance transmission scenarios (such as cross-regional monitoring of industrial assembly lines). Its low-loss characteristics ensure that the signal maintains high integrity after long-distance transmission. The upper computer converts the control instruction into an optical signal through the electro-optical conversion module, and transmits it to the photoelectric conversion module of the controlled device through the optical fiber to restore it to an electrical signal, avoiding the pollution of electromagnetic interference to the signal from the physical layer, significantly reducing the probability of false triggering, and ensuring the stable operation of the system in complex environments.
[0036] The method provided in the embodiment of the present application will automatically initialize the host computer and the controlled device after responding to the power-on event, obtain the configuration information of both parties and perform parameter verification, and ensure that the device working mode matches the system requirements through a closed-loop process of parsing, verifying and correcting abnormal parameters for the configuration parameters of the controlled device, thereby avoiding control failure and improving adaptability; before sending the control instruction, the working status of the host computer and the working mode of the controlled device are detected, and the signal transmission is triggered only when both parties are in synchronization mode and the status is normal, such as the camera starts exposure in the specified time window according to the trigger sequence and adjusts the acquisition parameters, and the light source generates a pulse modulation signal according to the target intensity value and corrects it. The actual output intensity is accurate to ensure the timing synchronization of multiple devices; exclusive control logic is designed for different controlled devices. The camera accurately controls the exposure time and acquisition parameters based on the trigger timing and feeds back the image data. The light source drives the sensor array through a pulse modulation signal and monitors the calibration intensity. The aperture uses a stepper motor to adjust the opening and closing degree and compares and corrects the drive signal; after collecting the output data of the controlled device, the quality is evaluated according to the preset standard. If it does not meet the standard, the parameter adjustment instruction is generated and sent back to the host computer to dynamically update the control strategy. For example, if the image quality does not meet the standard, the camera or light source parameters are adjusted, forming a self-optimizing closed loop of "acquisition-evaluation-adjustment" to continuously improve system performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 is a flow chart of a camera control method using optical fiber signals according to an embodiment of the present invention;
[0039] Figure 2 is a schematic diagram of a plastic optical fiber according to an embodiment of the present invention;
[0040] Figure 3 is a schematic diagram of a signal transmission process of a camera control system according to an embodiment of the present invention;
[0041] Figure 4 1 is a flow chart of initialization and synchronous triggering of a camera control system according to an embodiment of the present invention;
[0042] Figure 5 is a schematic diagram of a framework of a camera control system according to an embodiment of the present invention;
[0043] Figure 6 This is a working principle diagram of the camera control system provided by an embodiment of the present invention;
[0044] Figure 7 is a structural block diagram of a camera control device using optical fiber signals according to an embodiment of the present invention;
[0045] Figure 8 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0047] According to an embodiment of the present invention, a camera control method, apparatus, device and medium using optical fiber signals are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0048] In this embodiment, a camera control method using optical fiber signals is provided. Figure 1 FIG. 1 is a flow chart of a camera control method using optical fiber signals according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0049] Step S11: After detecting a power-on event, the host computer generates a control instruction, and sends the control instruction to the controlled device via an optical fiber through an electro-optical conversion module of the host computer.
[0050] It should be noted that the optical fiber includes plastic optical fiber or quartz optical fiber, plastic optical fiber (the schematic diagram of plastic optical fiber is as shown in FIG. Figure 2 Fiber optic cables (as shown) are used in conjunction with adapters to achieve photoelectric signal transmission in short-distance scenarios, while quartz optical fibers are used in conjunction with adapters to achieve photoelectric signal transmission in long-distance scenarios.
[0051] Specifically, the fiber type is adaptively selected: For short-distance scenarios (≤50 meters): plastic optical fiber is used, taking advantage of its flexibility and low cost. Standardized adapters (such as ST and LC interfaces) are used to achieve the physical connection between the host computer's electro-optical conversion module and the controlled device's optoelectronic conversion module, reducing the difficulty of device integration. For long-distance scenarios (>50 meters): quartz optical fiber is used, taking advantage of its low loss characteristics (signal attenuation <0.5dB / km). In combination with optical fiber amplifiers or repeaters, this ensures signal integrity after long-distance transmission, making it suitable for scenarios such as cross-workshop monitoring of industrial production lines.
[0052] After detecting the power-on event, the host computer (including computers, encoders, PLCs, trigger boxes, motors, motion platforms, switches, IO control cards, etc.) generates control instructions according to the current configuration (such as "trigger the camera to expose after 10ms, and synchronously trigger the light source to flash twice"), and converts the electrical signal into an optical signal through the built-in electro-optical conversion module (such as encoding the TTL level signal into an 850nm wavelength light pulse) to ensure that the signal format matches the optical fiber transmission characteristics. Subsequently, the sending conditions are double-checked: confirm that the host computer has no hardware failures, the software is not stuck, and the trigger control module is in normal state; verify that the working mode of each controlled device is synchronous mode (that is, the exposure trigger of the camera device and the flashing operation of the light source device all support strict timing synchronization with the trigger signal). Only when the above conditions are met, the control instructions are sent through the optical fiber to avoid timing confusion caused by asynchronous operation (such as the flashing of the light source and the camera exposure are not synchronized, causing image blur). For example, if Figure 3 As shown, the antenna timing in the signal transmission system obtains time information, and the trigger signal is input into the optical fiber, which outputs the processed synchronization signal to the two camera devices respectively for controlling the synchronization of the cameras.
[0053] In an embodiment of the present application, in response to the transmission security requirements of sensitive information such as product defect feature data and equipment parameter configuration in industrial control scenarios, a dynamic encryption mechanism based on quantum key distribution (QKD) can be embedded in the electro-optical conversion module. The electro-optical conversion module integrates a quantum random number generator (QRNG) and a polarization encoder (such as IDQuantique's CLavis2 series). When the control instruction generated by the host computer contains a security level identifier (identified by the 4-bit security flag bit in the instruction header, 1010 indicates a high security level), the quantum encryption transmission mode is automatically activated:
[0054] First, the host computer sends a polarization state quantum light pulse (using the BB84 protocol, producing four polarization states: |0, |1, +45°, and -45°) to the controlled device via an unused 1550nm wavelength channel in the optical fiber (isolated from the 850nm wavelength used for control command transmission). A single-photon detector (such as the PerkinElmer series from Excelitas) on the controlled device performs a basis vector measurement on the received state. This information is exchanged via a classical channel (an out-of-band management channel independent of the quantum channel), resulting in the selection of consistent qubits and the generation of an initial quantum key. This process automatically refreshes the key every 10ms to ensure the dynamic nature of the session key.
[0055] Secondly, the quantum bit error rate (QBER) of the quantum channel is monitored in real time by comparing the inconsistency rate between the polarization state at the transmitter and the measured results at the receiver. When the QBER is less than 3%, the channel is judged to be low-noise and a 256-bit AES-GCM encryption key is generated (providing authenticated encryption). When 3% ≤ QBER < 8%, the channel has moderate interference and is downgraded to a 128-bit AES-CBC key with an added CRC32 checksum. If the QBER is ≥ 8%, the channel is considered potentially eavesdropped, the connection is immediately severed, and a hardware-level key erase (implemented via an EEPROM write protection mechanism) is triggered. This hierarchical mechanism is particularly important in long-distance quartz fiber transmission, dynamically adjusting security policies based on the noise characteristics of erbium-doped fiber amplifiers (EDFAs).
[0056] Thirdly, time division-wavelength division multiplexing (TDM-WDM) technology is used to divide the control instructions into N data segments (N=8, each time segment is 50ns) according to the time slice, and each data segment is loaded into a different wavelength channel (such as 8 DWDM channels with an interval of 200GHz in the range of 1520nm to 1560nm). Each wavelength channel uses an independent quantum key (the subkey is generated by the key derivation function HKDF) for AES block encryption, and the data segment carries a timestamp and serial number. The receiving end needs to reorganize and verify the sequence continuity according to the time slice. This design requires the attacker to crack the real-time keys of 8 independent quantum channels at the same time, which significantly increases the difficulty of eavesdropping. It is especially suitable for long-distance secure transmission scenarios across workshops.
[0057] Finally, the quantum fingerprint verification module on the controlled device performs a double check on the decrypted instruction: first, a 256-bit hash value is generated using the SHA-256 algorithm and compared bit by bit with the quantum fingerprint transmitted synchronously through the quantum channel (a random 256-bit quantum true random number generated by the sender during the key negotiation phase). Second, the CRC checksum in the instruction is verified to be consistent with the security level identifier. If either check fails, the instruction is immediately discarded and an "E012: Quantum Verification Failed" error code is sent to the host computer. This also triggers a channel reset process, ensuring that even if the key is partially cracked, the valid instruction cannot be tampered with.
[0058] The method provided in the embodiment of the present application uses an adaptive selection mechanism for optical fiber types to accurately match the characteristics of different transmission distance scenarios: in short-distance scenarios, plastic optical fiber is used in combination with standardized adapters. Its flexibility advantage allows for flexible deployment in complex wiring environments inside equipment or between cabinets, avoiding signal loss caused by bending radius limitations of traditional cables. At the same time, its low-cost characteristics reduce system integration costs. In long-distance scenarios, quartz optical fiber is used in combination with optical fiber amplifiers or repeaters. Its low-loss characteristics allow for compensation of link loss through optical signal amplification even when transmitting across workshops on industrial assembly lines. OTDR is used to monitor the integrity of the optical fiber link in real time, ensuring that the signal is distortion-free after long-distance transmission. This mechanism circumvents the distance limitations and electromagnetic interference problems of electrical signal transmission at the physical layer, improving the system's adaptability in short-distance, highly flexible deployment and long-distance, stable transmission scenarios. It is particularly suitable for industrial vision systems with distributed collaboration of multiple devices.
[0059] In an embodiment of the present application, the method further includes steps A1-A2:
[0060] Step A1: In response to a power-on event, perform initialization operations on the host computer and the controlled device, and obtain first configuration information of the controlled device and second configuration information of the host computer.
[0061] Specifically, the control system uses a built-in power-on event detection circuit to monitor changes in the power input voltage (e.g., from 0V to the rated operating voltage) in real time. When a sudden voltage change (i.e., a power-on event) is detected, the circuit triggers a system-level response, waking up the host computer (e.g., PC, industrial computer) and the controlled devices (e.g., camera, light source, aperture component, etc.) to initiate the initialization process.
[0062] The dual-end initialization operation may include: when the host computer is initialized, it loads the system firmware, configures the default communication protocol (such as trigger frequency and synchronization mode parameters), establishes a connection channel with the controlled device, and obtains the second configuration information (such as the operating parameters of the trigger module and the communication protocol version) from local storage or an external interface. When the controlled device is initialized, it performs a self-test on the camera device, light source device, aperture device, etc. (such as lens focus initialization and light source brightness calibration), reads the stored first configuration information (such as image resolution, light source flashing frequency, aperture adjustment range), and loads the factory default value if the configuration information is missing.
[0063] The control system uses a built-in power-on event detection circuit to monitor changes in the power input voltage (e.g., from 0V to the rated operating voltage) in real time. When a sudden voltage change (i.e., a power-on event) is detected, the circuit triggers a system-level response, waking up the host computer (e.g., a PC, industrial computer) and controlled devices (e.g., cameras, light sources, aperture components, etc.) to initiate the initialization process. Specifically, the power-on event detection circuit can use a voltage monitoring chip (e.g., the MAX811T) to acquire the power supply voltage in real time. When the voltage remains stable at or above 90% of the rated voltage for 50ms, it is considered a valid power-on event, thus avoiding false triggering caused by transient voltage fluctuations. During host computer initialization, in addition to loading the system firmware, a hardware self-test process is also performed: The communication functions of the network port, serial port, and USB interface are tested in sequence; the parity bits of the memory modules are verified; the motherboard BIOS version is read and matched with the firmware library to ensure that the hardware components are fault-free. When the controlled device is initialized, the camera device performs a "zero-limit" movement through the built-in focus motor: first driving the lens to the mechanical limit position, then returning to the factory default focus position, and simultaneously completing the dark current calibration of the image sensor; the light source device starts the LED lamp bead lighting test one by one, collects the brightness value of each area through the photosensitive diode matrix, and generates a light source uniformity distribution map. If the brightness deviation of a single lamp bead exceeds 10%, the fault is marked and reported to the host computer.
[0064] Step A2: Use the first configuration information to configure the corresponding working mode of the controlled device, and use the second configuration information to configure the corresponding working parameters of the host computer.
[0065] In an embodiment of the present application, the first configuration information is used to configure the corresponding working mode of the controlled device, including: parsing the first configuration information to obtain configuration parameters corresponding to the controlled device; verifying the configuration parameters to obtain a verification result, and when the verification fails, correcting the abnormal parameters in the configuration parameters until the verification passes, and using the corrected configuration parameters to configure the working mode of the controlled device.
[0066] Specifically, the first configuration information obtained from the controlled device includes basic parameters for each device, such as image resolution, exposure time range, and gain adjustment step size for cameras; maximum flicker frequency and target area brightness threshold for light sources; and aperture range and stepper motor drive parameters for aperture devices. The second configuration information obtained from the host computer includes trigger control parameters, such as trigger mode (single trigger / continuous trigger), trigger delay time, and fiber transmission rate.
[0067] Secondly, the configuration parameters are parsed according to preset rules (such as JSON format field recognition), and the parameter legitimacy (such as exposure time must be greater than 0ms and aperture gear must be within the range of 0-22) and logical consistency (such as the light source flicker frequency must not exceed the hardware upper limit). If the verification fails (such as the aperture parameter exceeds the physical adjustment range), the system automatically corrects the abnormal parameter to the most recent valid value (such as correcting the illegal gear 25 to the maximum legal gear 22), or requests the host computer to re-issue the configuration information until all parameters pass the verification.
[0068] Finally, the corrected first configuration information is written into the controlled device, and the working mode of each controlled device is configured (such as the "synchronous exposure mode" of the camera device and the "area flashing mode" of the light source device); the second configuration information is written into the trigger control module of the host computer to generate a trigger strategy that matches the controlled device (such as the trigger frequency is synchronized with the camera frame rate).
[0069] The method provided in the embodiment of the present application constructs a reliability assurance system for the system startup phase through a dual-end initialization and configuration parameter verification mechanism driven by a power-on event: the power supply voltage mutation is monitored in real time by the power-on event detection circuit, triggering the synchronous initialization of the host computer and the controlled device (camera, light source, aperture, etc.). The host computer loads the system firmware, configures the default communication protocol (such as trigger frequency, synchronization mode parameters) and establishes a connection channel to ensure that the underlying communication link is unobstructed; the controlled device performs a self-test (such as camera lens focus initialization, light source brightness calibration), reads or loads the default configuration information, and avoids device initialization failure due to missing configuration. The first configuration information of the controlled device (such as image resolution, light source flashing frequency) and the second configuration information of the host computer (such as trigger delay time) are parsed, and the legitimacy and logical consistency of the parameters are verified by preset rules (such as the light source frequency does not exceed the hardware upper limit). For abnormal parameters that fail the verification (such as aperture gears that exceed the physical range), they are automatically corrected to the most recent valid value or requested to be re-issued to avoid abnormal device operation due to parameter errors. This mechanism ensures the accuracy of device parameters and the reliability of communication links from the system startup phase, laying the foundation for the precise generation and execution of subsequent control instructions, and effectively reducing the probability of system failures caused by initialization anomalies.
[0070] In the embodiment of the present application, the control instruction is sent to the controlled device via an optical fiber by the electro-optical conversion module of the host computer, including steps B1-B2:
[0071] Step B1: Detect the current working state of the host computer and the working mode of the controlled device.
[0072] Specifically, the host computer working status detection process can include: detecting the power stability, processor load, storage module read and write functions of the host computer (such as a PC or industrial computer) to ensure that there are no hardware failures (such as memory errors and hard disk read and write anomalies). For example, the built-in monitoring module can obtain parameters such as CPU temperature and fan speed in real time. If they exceed the threshold, it is determined to be an abnormal state. Confirm that the trigger control software has completed initialization (such as the communication protocol stack has been loaded), there are no conflicts in the configuration parameters (such as the trigger frequency matches the camera frame rate), and there are no software process stuck or error logs. For example, check whether the host computer has successfully established a communication connection with the controlled device. If the connection times out, it is determined to be abnormal.
[0073] Power stability testing uses the motherboard's power management chip (such as the Intersil ISL6327) to monitor voltage fluctuations at +12V, +5V, and +3.3V in real time, with an acceptable range of ±5%. Exceeding this limit triggers a hardware alarm. Processor load testing uses the Task Manager API to obtain CPU utilization. If it exceeds 80% for 100ms continuously, it is considered overloaded. Storage module read / write functionality is tested by writing a 512MB test file to the solid-state drive and immediately reading it. A CRC32 checksum error rate exceeding 0.1% indicates a storage media error. For controlled device operating mode testing, for multi-device collaborative scenarios (such as synchronized triggering of a light source and camera), the host computer batch queries the configuration registers of each device via the Modbus TCP protocol. Function code 0x03 is sent to the camera device to read register 0x1001. A return value of 0x01 indicates that synchronized mode is active. Function code 0x06 is sent to the light source device to write trigger mode register 0x2002 to "external synchronized trigger." The written value is then read again to verify consistency, ensuring that all device mode configurations are synchronized and effective.
[0074] It should be noted that controlled devices (such as cameras, light sources, and aperture devices) have two operating modes: Synchronous mode: The controlled device operates strictly in sync with the trigger signal timing (for example, the error between the camera exposure start time and the light source flash start time is less than 1μs), which is suitable for high-speed dynamic scenarios (such as assembly line product inspection). Asynchronous mode: The controlled device operates independently and is not related to the trigger signal timing (such as manual single-point triggering), which is suitable for debugging or asynchronous scenarios.
[0075] Specifically, the controlled device operating mode detection process may include: determining whether it is in synchronization mode by parsing the controlled device's configuration register or status return value (e.g., a register value of "0x01" for a camera submodule indicates that synchronization mode is active). For scenarios where multiple controlled devices collaborate (e.g., light sources and cameras are triggered synchronously), it is necessary to ensure that all related controlled devices are in synchronization mode. For example, check whether the flash trigger of a light source device is set to "external synchronization trigger" and whether the exposure mode of a camera device is set to "trigger synchronization exposure."
[0076] Step B2: If the working mode is the synchronous mode and the working state is the normal state, the control instruction is sent to the controlled device via the optical fiber through the electro-optical conversion module of the host computer.
[0077] Specifically, only when the "host computer status is normal" and the "controlled device working mode is synchronous mode", the host computer will convert the control instructions containing precise timing parameters (such as trigger delay time and signal duty cycle) into digital electrical signals, and encode them into optical signals (such as 850nm wavelength pulse light) that match the optical fiber transmission characteristics through the electro-optical conversion module. This encoding rule supports multiple instruction multiplexing to improve transmission efficiency; in short-distance scenarios, the host computer and the controlled device are connected through an ST / LC adapter, and the low bending loss characteristics of plastic optical fiber are used to ensure reliable transmission of signals inside the device or between cabinets. In long-distance scenarios, a relay amplifier is enabled to compensate for signal attenuation, and the integrity of the optical fiber link is monitored in real time through an OTDR; after the optoelectronic conversion module of the controlled device restores the optical signal to an electrical signal, the trigger timing is calibrated through a hardware timer with an accuracy of ±0.1μs to ensure that the sub-module performs operations within the specified time window, thereby ensuring the effectiveness of signal transmission and timing consistency.
[0078] In addition, if the host computer is in an abnormal state (such as power fluctuations), the system automatically enters standby mode, suspends signal transmission, and sends an error code to the host computer (such as "E001: Host computer communication interrupted"). If the controlled device operates in asynchronous mode (such as by mistake in asynchronous mode), the system refuses to send control commands and prompts the user to check the submodule configuration (such as by highlighting the abnormal module on the human-machine interface).
[0079] For example, inspecting product surface defects on an assembly line requires strict synchronization of the light source and camera to avoid motion blur. The host computer detects that its CPU load is less than 30% and that communication with the PLC is normal (normal status). The light source submodule reports that the operating mode is "synchronized flashing mode," and the camera submodule reports that it is "synchronized exposure mode." The host computer sends control commands via quartz fiber. The light source flashes once (for 5μs) when the product reaches the center of the field of view, and the camera simultaneously initiates exposure (exposure time 10μs), ensuring clear images of moving products without artifacts.
[0080] The method provided in the embodiment of the present application constructs a safe sending threshold for control instructions through a dual detection mechanism (state detection + mode verification): the upper computer working state detection covers power supply stability, hardware functions and software status to ensure that there is no hardware failure or software anomaly that causes instruction sending failure; the controlled device working mode detection determines whether it is in synchronization mode (such as camera "synchronous exposure mode" and light source "external synchronous trigger") by parsing the configuration register or status return value, ensuring strict timing alignment in multi-device collaborative scenarios. Only when the upper computer state is normal and the controlled device synchronization mode is activated, the control instruction is encoded into an optical signal that matches the optical fiber characteristics through the electro-optical conversion module. The low bending loss characteristics of plastic optical fiber are utilized in short-distance scenarios, and the relay amplifier is enabled in long-distance scenarios to compensate for attenuation. This mechanism effectively avoids the problem of false triggering caused by device anomalies or mode mismatches (such as the camera being mistakenly set to asynchronous mode) in traditional electrical signal transmission, and ensures the timing consistency of the trigger signal from the logic layer. Especially in high-speed dynamic scenes, it avoids image blur caused by light source flickering and camera exposure asynchrony, thereby improving the system control accuracy.
[0081] Step S12: using the photoelectric conversion module of the controlled device to convert the control instruction into an electrical signal, and performing a corresponding control operation based on the electrical signal until the controlled device reaches the target control state.
[0082] In the embodiment of the present application, when the controlled device is a camera device, performing a corresponding control operation based on the electrical signal includes the following steps C1-C2:
[0083] Step C1: parse the trigger timing in the electrical signal, control the camera device to start exposure within a specified time window according to the trigger timing, and synchronously adjust the image acquisition parameters.
[0084] Specifically, after the photoelectric conversion module of the controlled device (camera) converts the received optical signal into an electrical signal, it first analyzes the trigger timing parameters (such as exposure start time, trigger delay, and signal period). For example, the instruction "exposure window is 10μs-20μs after the rising edge of the trigger signal" carried in the electrical signal is converted into a clock trigger signal within the camera via a hardware timer (with an accuracy of ±0.1μs). Based on the analyzed timing, the camera initiates exposure within the specified time window to avoid motion blur caused by deviations in exposure timing (for example, when photographing products on a high-speed assembly line, the exposure window must strictly match the speed of the object). Simultaneously, image acquisition parameters are adjusted, including but not limited to: exposure time: dynamically adjusted based on scene brightness (e.g., extending the exposure time to 50ms in dark environments and shortening it to 1ms in bright environments); gain parameter: improving signal sensitivity and suppressing noise in low-light environments; resolution and frame rate: matching the backend processing capabilities (e.g., high-resolution mode for detail detection, high-frame rate mode for dynamic tracking). These parameter adjustments are implemented by the camera's internal digital signal processor, ensuring coordinated optimization of exposure timing and parameter settings.
[0085] To analyze the trigger timing in electrical signals, the camera uses a field-programmable gate array (FPGA) for hardware-level timing decoding. The received electrical signal is fed into the FPGA's high-speed I / O interface, where a phase-locked loop (PLL) generates a high-precision clock (100MHz), which then performs sub-nanosecond timing on the rising and falling edges of the trigger signal. For example, if a command is received stating that "exposure should start 10μs after the rising edge of the trigger signal," the FPGA's internal counter begins counting from the rising edge and triggers the exposure enable signal when 1000 clock cycles (10μs) have elapsed, with an error within ±1 clock cycle (±10ns). Image acquisition parameter adjustment is dynamically optimized based on a fuzzy logic algorithm: a three-dimensional fuzzy rule library for "ambient brightness-exposure time-gain" is constructed. When the photoresistor detects that the ambient illumination is lower than 50 lux, the exposure time is preferentially increased to the maximum allowable value of the sensor (e.g., 50ms). If the signal-to-noise ratio requirement (SNR < 30dB) is still not met, the gain is gradually increased in 0.5dB steps to avoid the noise amplification problem caused by simply increasing the gain.
[0086] Step C2: collecting image data based on the image collection parameters. After the collection is completed, the image data is fed back to the host computer through the optical fiber.
[0087] Specifically, the camera sensor (such as a CMOS / CCD) converts optical signals into electrical signals within the exposure window, generating raw image data (e.g., in RAW format). The acquisition process strictly adheres to trigger timing, for example, initiating exposure at the same time as the light source submodule flashes, ensuring uniform illumination of the target area (for example, in industrial inspection, the time difference between the light source flash and the camera exposure is less than 5μs). After acquisition, the image data is converted into an optical signal by the camera's photoelectric conversion module and transmitted back to the host computer via optical fiber (plastic optical fiber for short distances and quartz fiber for long distances). Data compression techniques (such as JPEG2000) are used during transmission to reduce bandwidth usage, while CRC checksums ensure data integrity. Feedback includes image data for back-end processing (such as image recognition and defect detection) and status parameters such as camera operating temperature, sensor gain, and exposure time, which are used by the host computer to monitor device status. The anti-interference properties of optical fiber transmission are particularly critical in this process, preventing image data distortion (such as fringe interference and pixel errors) caused by electromagnetic noise in traditional electrical signal transmission, ensuring the accuracy of inspection results in industrial vision systems.
[0088] The method provided in the embodiment of the present application realizes precise control of the camera device through trigger timing analysis and dynamic adjustment of parameters: after the photoelectric conversion module of the camera device converts the optical signal into an electrical signal, the trigger timing parameters are analyzed by the hardware timer to ensure that the exposure is started within the specified time window (such as the synchronization moment of the light source flashing), avoiding motion blur caused by deviation in exposure timing (such as matching the exposure window with the motion speed when shooting high-speed objects). At the same time, the image acquisition parameters are dynamically adjusted according to the brightness of the scene. The sensor completes the optical signal conversion within the exposure window, generates raw image data, and transmits it back to the host computer through the optical fiber. The transmission process uses data compression and verification, combined with the anti-interference characteristics of the optical fiber, to avoid image distortion caused by electromagnetic noise and ensure the integrity of the image data processed by the back-end. This mechanism realizes sub-microsecond precision control of the camera exposure timing, and cooperates with the adaptive adjustment of parameters to significantly improve the imaging quality under complex lighting and dynamic scenes, providing a highly reliable image data source for defect detection in machine vision systems.
[0089] In the embodiment of the present application, when the controlled device is a light source device, performing a corresponding control operation based on the electrical signal includes the following steps D1-D2:
[0090] Step D1: Analyze the target light source intensity value in the electrical signal to generate a pulse modulation signal.
[0091] Specifically, after the photoelectric conversion module of the light source device converts the light signal into an electrical signal, it first parses the target light source intensity value (such as "2000lux"), which is pre-set by the host computer according to the shooting scene requirements (such as the reflective characteristics of the object material in industrial inspection) and is included in the control instruction. For example, when shooting dark objects, the target intensity value may be set higher to avoid the image being too dark. Based on the target intensity value, the driving circuit of the light source device generates a corresponding pulse modulation signal (such as a PWM pulse width modulation signal). The parameters of the modulation signal (such as duty cycle and frequency) are linearly related to the intensity of the light source. For example, the larger the duty cycle, the higher the luminous intensity of the LED lamp group. By adjusting the duty cycle (such as increasing it from 50% to 70%), dynamic driving of the sensor array (such as LED lamp beads) is achieved to ensure that the light source output meets the target requirements.
[0092] In step D2, the sensor array is driven to output a flashing light source according to the pulse modulation signal, and the actual light source intensity value is detected and compared with the target light source intensity value. If there is a deviation, the pulse modulation signal of the sensor array is adjusted.
[0093] Specifically, the pulse modulation signal drives the light source sensor array (such as multiple groups of LED lights) to flash at a specified frequency and area (such as high-frequency flashing in the center area and low-frequency fill light in the edge area) to meet the lighting requirements of specific scenes (such as structured light illumination that highlights the outline of the object). The flashing mode can be synchronized through the trigger signal, for example, strictly aligned with the camera exposure cycle to avoid stripe interference caused by the lack of synchronization between the light source flicker and image acquisition. The built-in light sensor (such as a photodiode) collects the actual light source intensity value in real time and compares it with the target value (such as converting the light intensity signal into a digital value through ADC analog-to-digital conversion). If there is a deviation (such as the actual intensity is 1800 lux and the target value is 2000 lux), the system automatically adjusts the parameters of the pulse modulation signal:
[0094] Positive deviation (actual > target): reduce PWM duty cycle or reduce flicker frequency;
[0095] Negative deviation (actual < target): Increase PWM duty cycle or increase flashing frequency.
[0096] After adjustment, retest until the deviation between the actual intensity value and the target value is within the allowable range (such as ±5%), forming a closed-loop control of "drive-detection-adjustment" to ensure the stability and accuracy of the light intensity.
[0097] In addition, the closed-loop control process of the light source equipment can also introduce an adaptive PID algorithm to improve regulation accuracy: a light sensor (such as the BH1750) collects the actual light source intensity value at a frequency of 1kHz. The deviation from the target value is calculated through the proportional (P), integral (I), and differential (D) steps to calculate the adjustment amount. The proportional coefficient Kp dynamically switches according to the current light source intensity (Kp = 0.1 when the target value is greater than 1000 lux, Kp = 0.05 when it is less than 1000 lux). The integral coefficient Ki is set to 0.01 to eliminate static error, and the differential coefficient Kd = 0.02 to suppress overshoot. When the actual intensity value deviates from the target value by more than 5%, the system automatically enters the fast adjustment mode: the duty cycle adjustment step of the pulse modulation signal is increased to 10%, and the intensity value is checked every 20ms. When the deviation is reduced to within 2%, it switches to the fine adjustment mode: the step size is reduced to 1%, and the detection period is extended to 100ms, balancing adjustment speed and stability. In view of the temperature drift characteristics of LED lamp beads, the built-in NTC thermistor monitors the temperature of the light source module in real time. When the temperature exceeds 50°C, the maximum allowable duty cycle is automatically reduced to 70%, and the fan is triggered to dissipate heat to avoid light decay caused by high temperature.
[0098] The method provided in the embodiments of this application achieves precise control of light source devices through target intensity analysis and closed-loop feedback. The light source device analyzes the target light intensity value in the control command and generates a PWM pulse modulation signal through the driver circuit. Its duty cycle is linearly related to the light source intensity, meeting the lighting requirements of different scenarios (for example, dark object detection requires higher intensity to avoid excessive darkness). A built-in light sensor collects the actual intensity value in real time and compares it with the target value. After adjustment, the pulse parameters are adjusted using an adaptive algorithm: if the actual intensity is lower than the target value, the duty cycle or flashing frequency is increased; if it is higher than the target value, the output is reduced. The adjustment process adopts a dual mode of "fast adjustment and fine adjustment", combined with a thermistor to monitor temperature and dynamically limit the maximum duty cycle to prevent LED light decay. This mechanism ensures that the light source output intensity is precisely matched to the scene requirements. Through the "drive-detect-adjust" closed-loop control, the intensity deviation is controlled within ±5%. When triggered synchronously with the camera, the illumination uniformity and stability are achieved. This solves the output fluctuation problem caused by temperature drift and component aging in traditional light sources and improves the lighting quality during image acquisition.
[0099] In the embodiment of the present application, when the controlled device is an aperture device, performing a corresponding control operation based on the electrical signal includes the following steps E1-E2:
[0100] Step E1: analyzing the target aperture value in the electrical signal.
[0101] Specifically, after the photoelectric conversion module of the aperture device converts the optical signal into an electrical signal, it first analyzes the target aperture value (such as f / 2.8, f / 16, etc.), which is pre-set by the host computer according to the shooting requirements (such as depth of field requirements, ambient light intensity). For example, in a scene that requires a large depth of field (such as detecting multi-layer objects), the target aperture value is set to f / 8.0 to ensure that both near and far objects are clear. Based on the target aperture value, combined with the mechanical characteristics of the aperture device (such as the step angle of the stepper motor and the transmission ratio of the aperture blades), the corresponding aperture adjustment parameters (such as the number of steps of the stepper motor and the direction of rotation) are generated. For example, to adjust from the current f / 4.0 to f / 2.8, the stepper motor needs to be controlled to rotate counterclockwise 15 steps (each step corresponds to a 0.5-stop aperture change) to ensure the accuracy of the adjustment process.
[0102] In step E2, the stepper motor is controlled to rotate based on the aperture adjustment parameter to adjust the aperture blade opening and closing degree, and the actual aperture value is detected and compared with the target aperture value. If there is a deviation, the driving signal of the stepper motor is corrected.
[0103] Specifically, the generated adjustment parameters drive the stepper motor, which adjusts the aperture blade opening and closing via a gear or rack mechanism. The motor utilizes micro-stepping technology (e.g., 16-step increments) to achieve a precision of 0.0625 steps per step, ensuring smooth aperture switching. For example, in industrial inspection, the aperture is adjusted synchronously with a trigger signal to prevent unstable light input due to blade vibration during adjustment. Built-in position sensors (e.g., potentiometers and Hall sensors) provide real-time feedback on the actual aperture blade position, which is converted into the actual aperture value and compared with the target value. If there is a deviation (e.g., mechanical wear causing step loss in the stepper motor, with the actual value at f / 3.0 and the target at f / 2.8), the system automatically calculates the compensation steps and corrects the drive signal: For a positive deviation (actual > target), the positive drive pulse is increased to further open the blades; for a negative deviation (actual < target), the reverse drive pulse is increased to reduce the blade opening. After correction, retesting is performed until the actual value deviates from the target value by less than 0.1 step, ensuring aperture adjustment accuracy.
[0104] The method provided in the embodiment of the present application realizes high-precision adjustment of the aperture device through target aperture analysis and mechanical closed-loop correction: the target aperture value in the control instruction is analyzed, and the precise adjustment parameters are generated by combining the step angle of the stepping motor and the transmission ratio of the blades. The adjustment accuracy is improved to the target gear by using subdivision drive technology to ensure smooth gear switching. The stepping motor drives the aperture blades to open and close, and the built-in position sensor provides real-time feedback on the actual gear position, which is then compared with the target value to correct the drive signal. If the step is lost due to mechanical wear, the compensation step number is automatically calculated, and the influence of gear clearance is reduced by combining the drive current compensation. This mechanism solves the problem of unstable light input caused by mechanical transmission error and step loss of the stepping motor in traditional aperture adjustment, ensures that the depth of field matches the ambient light requirements, and synchronizes the adjustment with the trigger signal to avoid blade jitter affecting the imaging, thereby improving the edge imaging clarity and the overall consistency of the picture. It is especially suitable for precision detection scenarios with extremely high requirements for depth of field accuracy.
[0105] As an example, Figure 4 FIG. 1 is a flow chart of initialization and synchronous triggering of a camera control system according to an embodiment of the present invention. Figure 4 As shown in the figure, the process includes the following: After the system is powered on, it enters the initialization phase, during which the light source device, camera device, and host computer each perform initialization operations. After initialization is complete, the operating mode of the light source device and the camera device are configured, as well as the operating parameters of the trigger module. Subsequently, the light source device and camera device are checked to see if they are in synchronous mode, and the host computer checks whether a start signal has been received. If both the light source device and the camera device are in synchronous mode and the host computer receives the start signal, it issues a control command. Upon receiving the control command, the light source device begins flashing, and the camera device begins capturing images, completing the entire process.
[0106] In the embodiment of the present application, after the controlled device reaches the target control state, the method further includes steps F1-F3:
[0107] Step F1: collecting output data of the controlled device.
[0108] Specifically, the corresponding output data is collected based on the type of controlled device: Camera devices: collect raw image data (such as RAW format), acquisition parameters (exposure time, gain value), and status information (sensor temperature, focus status); Light source devices: obtain actual light intensity (measured by light sensor), flicker frequency, pulse duty cycle, and other real-time parameters; Aperture devices: read the actual aperture position (feedback from position sensor) and stepper motor drive parameters (such as number of rotation steps and subdivision accuracy). The output data is transmitted back to the host computer via optical fiber, leveraging the low loss and electromagnetic interference resistance of plastic optical fiber / quartz optical fiber to ensure data distortion during transmission (for example, motor noise in industrial environments does not affect image data integrity).
[0109] Step F2: perform quality assessment on the output data to obtain an assessment result.
[0110] Specifically, regarding image quality: edge detection algorithms are used to assess clarity (e.g., calculating edge gradients using the Sobel operator), and histogram analysis is used to analyze contrast and brightness, with preset thresholds such as clarity ≥ 80 points and contrast ≥ 50%. Light source stability: the deviation between the actual intensity value and the target value is compared (e.g., an allowable error of ±3%), and flicker frequency consistency is tested (e.g., a fluctuation of ±1Hz is allowed when the set frequency is 100Hz). Aperture accuracy: the error between the actual gear position and the target gear position is verified (e.g., a deviation of ±0.1 gear position is allowed), and the repeatability of the blade opening and closing is tested (e.g., an error of <0.05 gear position after multiple adjustments). Image quality is scored using machine learning models (e.g., convolutional neural networks) or traditional algorithms (e.g., PSNR, SSIM). A threshold comparison method is used to determine whether the light source and aperture parameters meet the standards, and a quantitative evaluation result is output (e.g., "Image clarity 75 points, not up to standard").
[0111] The image quality assessment phase uses a multi-scale feature fusion algorithm to improve assessment accuracy: First, the image is downsampled three times using a Gaussian pyramid to extract edge features (Sobel operator), texture features (LBP operator), and frequency domain features (FFT amplitude spectrum) at different resolutions, respectively, to construct a 128-dimensional feature vector. This feature vector is then fed into a pre-trained support vector machine (SVM) model for classification. Cross-validation is used during model training to optimize the penalty parameter C and kernel function parameter γ, and the clarity threshold is set to a feature vector classification confidence level ≥ 0.8. Statistical process control (SPC) technology is incorporated into light source stability assessment: the mean and standard deviation of the light source intensity values for 100 consecutive sampling periods are calculated, and an X-bar control chart is plotted. If seven consecutive points are on the same side of the mean line, or a single point exceeds the ±3σ control limits, the light source is considered abnormal and a hardware self-check is triggered. Aperture accuracy is assessed through a mechanical hysteresis test: the target aperture value is adjusted back and forth 10 times between f / 4.0 and f / 5.6, the actual gear position after each adjustment is recorded, and the maximum hysteresis value is calculated. If it exceeds 0.1 gear, the stepper motor drive current compensation is triggered (increasing the drive current by 5%) to compensate for the error caused by mechanical transmission clearance.
[0112] In step F3, if the evaluation result does not meet the preset standard, a parameter adjustment instruction is generated and transmitted back to the host computer via the optical fiber, and the host computer is controlled to update the control instruction according to the parameter adjustment instruction.
[0113] Specifically, a closed-loop feedback mechanism dynamically optimizes control parameters until the output meets preset standards. Intelligent adjustment strategies can include: When image quality falls short of standards, such as insufficient clarity, automatically increasing the light source intensity by 10% or extending the camera exposure time by 5μs; triggering the lens correction submodule to load the correction algorithm for the corresponding aperture position (e.g., enabling the barrel distortion compensation model at f / 2.8); increasing the PWM duty cycle when the light source / aperture deviates, such as when the actual intensity falls below the target value; and sending compensation pulses to correct the stepper motor drive signal (e.g., sending two additional forward pulses) if the aperture adjustment loses steps.
[0114] The generated adjustment instructions are transmitted back to the host computer via optical fiber. The host computer updates the control instructions (such as modifying the flashing frequency of the trigger signal and the aperture target value) and resends them to the controlled device through the electro-optical conversion module, forming a closed loop of "acquisition-evaluation-adjustment" (for example, in industrial inspection, the image clarity can be improved to more than 90 points within 3 iterations).
[0115] The method provided in this embodiment achieves dynamic optimization of controlled devices through multi-dimensional data acquisition and intelligent evaluation: the camera device transmits image data, acquisition parameters, and status information; the light source device provides actual intensity and flicker frequency; and the aperture device provides actual gear position and stepper motor parameters. Data is transmitted via low-loss optical fiber, and its electromagnetic interference resistance ensures distortion-free operation in industrial environments. Image quality is scored using edge detection, histogram analysis, and machine learning models. Light source stability is assessed by comparing deviations between target and actual values, creating a control chart to detect anomalies. Aperture accuracy verifies actual gear position error and blade repeatability. If the evaluation fails to meet the standards, adjustment instructions are automatically generated and transmitted back to the host computer via optical fiber to update the control instructions. It supports iterative optimization, forming a closed "acquisition-evaluation-adjustment" loop. This mechanism addresses the limited adaptability of traditional systems due to fixed parameters. Through real-time feedback and intelligent optimization, it dynamically adapts to environmental changes (such as light fluctuations and device aging), significantly improving image acquisition stability and detection accuracy in complex scenarios, meeting the high-reliability requirements of industrial automation for device self-calibration and self-optimization.
[0116] For example, industrial production requires product quality inspection to ensure that products meet quality standards. In this scenario, the trigger module, lighting device, camera device, and back-end system in the host computer can be used as follows: After the trigger module in the host computer is set up, it waits for a start signal from an external device. The start signal can be a specific condition detected by sensors on the production line, such as product position or light intensity. Upon receiving the start signal, the host computer simultaneously transmits control instructions to the lighting device and camera device via an optical fiber link. This allows the lighting device and camera to start operating simultaneously. The lighting device flashes according to the set operating mode, providing sufficient light to illuminate the product. The camera device performs image acquisition according to the set operating mode. It captures product images and then uses image processing algorithms to analyze features and defects in the images to detect quality issues. The image data captured by the camera device is transmitted and stored by the back-end system. The back-end system can store and analyze the image data for operations such as product quality assessment, statistics, and report generation. In this way, the industrial vision system can monitor and inspect product quality during the production process in real time, improving production efficiency and product consistency. At the same time, subsequent image processing and analysis can help discover and correct problems in the production process, improving product quality and production processes.
[0117] After the camera device works synchronously based on the control instructions to obtain image data, the process may also include: performing quality evaluation on the image data according to preset detection indicators to obtain a first evaluation result; comparing the first evaluation result with the preset evaluation result, and if the first evaluation result does not reach the preset evaluation result, adjusting the aperture parameters of the aperture control submodule and adjusting the correction parameters of the lens correction submodule; performing a camera operation through the adjusted aperture control submodule and the adjusted lens correction submodule to obtain a new image, and performing quality evaluation on the new image to obtain a second evaluation result; if the second evaluation result still does not reach the preset evaluation result, adjusting the parameters of the aperture control submodule and the lens correction submodule again until the re-captured image reaches the preset evaluation effect.
[0118] It should be noted that the preset detection indicators are key parameters pre-set to measure the quality of images. For example, image clarity, which is related to the sharpness of image details, is related to the sharpness of the image details. The higher the clarity, the clearer the edges, textures, and other details in the image. Contrast affects the difference between bright and dark areas in the image. The appropriate contrast can make the subject stand out more in the image, enhancing the visual effect. Brightness is also critical. Too bright may cause the image to be overexposed and lose details, while too dark may make the image dim and difficult to see. Using specific image processing algorithms or professional evaluation models, the image data is analyzed based on these indicators to obtain the first evaluation result, which is a quantitative description of the image data quality.
[0119] Specifically, the first evaluation result is compared with a preset evaluation result, which represents the ideal image quality level. If the evaluation result does not meet the preset evaluation result, the current image data quality is substandard and requires adjustment and optimization. Adjustments are made to the aperture parameters of the aperture device and the correction parameters of the lens correction device. The aperture parameters determine the amount of light passing through the lens. Different shooting scenarios have different requirements. In low-light environments, increasing the aperture parameters (i.e., widening the aperture) allows more light to enter and prevents a dim image. In bright light and when a large depth of field is desired, narrowing the aperture allows for sharp images of both near and far objects. Adjusting the correction parameters of the lens correction device is also crucial. Due to the inherent optical properties of the lens, different aperture settings may result in issues such as barrel distortion (where the edges of the image bulge outward, resembling a barrel) and pincushion distortion (where the edges of the image concave inward, resembling a pillow). By adjusting the correction parameters and applying the corresponding correction algorithms and techniques, these distortions can be corrected, restoring the image's normal form.
[0120] After adjusting the parameters of the aperture and lens correction devices, they are driven again to perform the camera operation. This time, the adjusted parameters are used to recapture images, generating new images. Next, the quality of these new images is evaluated using the same image processing algorithm or evaluation model as for the image data, yielding the final evaluation results.
[0121] If, after adjustment and re-collection and evaluation, it is found that the final evaluation result still does not meet the preset evaluation result, it means that the image quality problem has not been completely resolved. It is necessary to repeat the process of adjusting the parameters of the aperture device and lens correction device again. This cycle should be repeated and optimized continuously until the re-collected image can achieve the preset evaluation effect, ensuring that the final image quality meets the application requirements.
[0122] Figure 5 FIG. 1 is a schematic diagram of the hardware framework of the camera control system provided by an embodiment of the present invention, such as Figure 5 As shown in the figure, the system primarily consists of a light source, a camera, and a trigger control box on the host computer. The trigger control box is responsible for receiving commands from the PC, setting the trigger frequency and number, and converting electrical trigger signals into optical trigger signals, which are then transmitted via optical fiber to the controlled devices, such as the light source and camera. The light source receives the optical signal from the trigger control box, converts it into an electrical signal, and triggers the light source to flash. The camera receives the optical signal from the trigger control box, converts it into an electrical signal, triggers the camera to capture images, and transmits the captured images to the backend PC.
[0123] Figure 6FIG. 1 is a working principle diagram of the camera control system provided by an embodiment of the present invention, such as Figure 6 As shown, the satellite is connected to a network switch via a trigger source link, and antenna timing provides time information for the system. The system includes multiple devices, including flashes, high-speed cameras, and time targets. Trigger synchronization boxes and trigger adapter boxes participate in signal processing. Trigger sources such as encoders provide trigger signals, and BD / GPS antennas are used to acquire positioning and time information. The system transmits signals via high-speed and low-speed optical fibers, divided into three paths: A, B, and C. Each path has a host computer (computer) connected to other devices via network timing and control links. These links, including timing links, image links, and synchronization links, enable control of controlled devices (such as cameras and light sources). The overall architecture aligns with the camera control method using optical fiber signals described in the text to the right, encompassing processes such as command generation, transmission, device control, and status feedback.
[0124] By using optical signal transmission, the embodiments of the present application can reduce the impact of electromagnetic interference on signal transmission and improve the reliability and stability of the system. Using optical fiber for signal transmission can achieve long-distance transmission and is suitable for applications requiring long-distance signal transmission. By receiving PC commands and setting parameters such as trigger frequency and number through the trigger control box, the trigger mode can be flexibly adjusted according to actual needs to meet the requirements of different applications.
[0125] Furthermore, the light source and camera devices each convert the optical trigger signal into an electrical trigger signal, achieving synchronous triggering of the light source and camera, ensuring the timing consistency of the captured images and improving image quality. The camera device transmits the captured images to the backend PC. The transmission of optical trigger signals enables efficient image data transmission and reduces transmission delays.
[0126] This embodiment also provides a camera control device utilizing optical fiber signals, which is used to implement the aforementioned embodiments and preferred implementations. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. While the devices described in the following embodiments are preferably implemented using software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0127] This embodiment provides a camera control device using optical fiber signals, such as Figure 7 Shown, including:
[0128] The sending module 71 is used to generate a control instruction by the host computer after detecting a power-on event, and send the control instruction to the controlled device via the optical fiber through the electro-optical conversion module of the host computer;
[0129] The execution module 72 is used to convert the control instruction into an electrical signal using the photoelectric conversion module of the controlled device, and execute the corresponding control operation based on the electrical signal until the controlled device reaches the target control state.
[0130] Furthermore, the optical fiber includes plastic optical fiber or quartz optical fiber. Plastic optical fiber is used in conjunction with an adapter to achieve photoelectric signal transmission in short-distance scenarios, and quartz optical fiber is used in conjunction with an adapter to achieve photoelectric signal transmission in long-distance scenarios.
[0131] Furthermore, the device also includes: an initialization module, which is used to respond to a power-on event, perform initialization operations on the host computer and the controlled device, and obtain first configuration information of the controlled device and second configuration information of the host computer; use the first configuration information to configure the corresponding working mode of the controlled device, and use the second configuration information to configure the corresponding working parameters of the host computer.
[0132] Furthermore, the initialization module is used to parse the first configuration information to obtain configuration parameters corresponding to the controlled device; verify the configuration parameters to obtain verification results, and when the verification fails, correct the abnormal parameters in the configuration parameters until the verification passes, and use the corrected configuration parameters to configure the working mode of the controlled device.
[0133] Furthermore, the sending module 71 is used to detect the current working state of the host computer and the working mode of the controlled device; if the working mode is the synchronous mode and the working state is the normal state, the control instruction is sent to the controlled device via the optical fiber through the electro-optical conversion module of the host computer.
[0134] Furthermore, the execution module 72 includes a first control submodule, a second control submodule, and a third control submodule;
[0135] The first control submodule is used to analyze the trigger timing in the electrical signal, control the camera device to start exposure within a specified time window according to the trigger timing, and synchronously adjust the image acquisition parameters; collect image data based on the image acquisition parameters, and after the acquisition is completed, feed back the image data to the host computer through the optical fiber.
[0136] The second control submodule is used to analyze the target light source intensity value in the electrical signal and generate a pulse modulation signal; drive the sensor array to output the flashing light source according to the pulse modulation signal, detect the actual light source intensity value, and compare the actual light source intensity value with the target light source intensity value. If there is a deviation, the pulse modulation signal of the sensor array is adjusted.
[0137] The third control submodule is used to analyze the target aperture value in the electrical signal; control the rotation of the stepper motor based on the aperture adjustment parameter to adjust the opening and closing degree of the aperture blades, detect the actual aperture value, and compare the actual aperture value with the target aperture value. If there is a deviation, the drive signal of the stepper motor is corrected.
[0138] Furthermore, the device also includes: an update module for collecting output data of the controlled device; performing quality assessment on the output data to obtain an assessment result; if the assessment result does not meet the preset standard, generating a parameter adjustment instruction and transmitting it back to the host computer through the optical fiber, and controlling the host computer to update the control instruction according to the parameter adjustment instruction.
[0139] See also Figure 8 , Figure 8 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0140] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0141] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0142] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created based on the use of a computer device for displaying a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0143] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0144] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0145] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0146] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A camera control method using optical fiber signals, characterized in that: The method comprises: After detecting a power-on event, the host computer generates a control instruction, and sends the control instruction to the controlled device via an optical fiber through an electro-optical conversion module of the host computer; The control instruction is converted into an electrical signal by using the photoelectric conversion module of the controlled device, and a corresponding control operation is performed based on the electrical signal until the controlled device reaches a target control state.
2. The method according to claim 1, characterized in that The optical fiber includes a plastic optical fiber or a quartz optical fiber. The plastic optical fiber is used in conjunction with an adapter to realize photoelectric signal transmission in a short-distance scenario, and the quartz optical fiber is used in conjunction with an adapter to realize photoelectric signal transmission in a long-distance scenario.
3. The method according to claim 1, characterized in that The method further comprises: In response to the power-on event, performing an initialization operation on the host computer and the controlled device, and obtaining first configuration information of the controlled device and second configuration information of the host computer; The first configuration information is used to configure the working mode corresponding to the controlled device, and the second configuration information is used to configure the working parameters corresponding to the host computer.
4. The method according to claim 3, characterized in that The configuring the working mode corresponding to the controlled device by using the first configuration information includes: Parsing the first configuration information to obtain configuration parameters corresponding to the controlled device; The configuration parameters are verified to obtain verification results. When the verification fails, abnormal parameters in the configuration parameters are corrected until the verification passes, and the working mode of the controlled device is configured using the corrected configuration parameters.
5. The method according to claim 1, wherein The step of sending the control instruction to the controlled device via an optical fiber by the electro-optical conversion module of the host computer includes: Detecting the current working state of the host computer and the working mode of the controlled device; If the working mode is the synchronous mode and the working state is the normal state, the control instruction is sent to the controlled device via the optical fiber through the electro-optical conversion module of the host computer.
6. The method according to claim 1, characterized in that When the controlled device is a camera device, performing a corresponding control operation based on the electrical signal includes: parsing a trigger timing sequence in the electrical signal, controlling the camera device to start exposure within a specified time window according to the trigger timing sequence, and synchronously adjusting image acquisition parameters; Image data is collected based on the image collection parameters, and after the collection is completed, the image data is fed back to the host computer through the optical fiber.
7. The method according to claim 1, characterized in that When the controlled device is a light source device, performing a corresponding control operation based on the electrical signal includes: Analyzing the target light source intensity value in the electrical signal to generate a pulse modulation signal; The sensor array is driven to output a flashing light source according to the pulse modulation signal, and an actual light source intensity value is detected, and the actual light source intensity value is compared with the target light source intensity value. If there is a deviation, the pulse modulation signal of the sensor array is adjusted.
8. The method according to claim 1, characterized in that When the controlled device is an aperture device, performing a corresponding control operation based on the electrical signal includes: parsing the target aperture value in the electrical signal; Based on the aperture adjustment parameter, the stepper motor is controlled to rotate to adjust the aperture blade opening and closing degree, and the actual aperture value is detected and compared with the target aperture value. If there is a deviation, the driving signal of the stepper motor is corrected.
9. The method according to claim 1, characterized in that After the controlled device reaches the target control state, the method further includes: Collecting output data of the controlled device; Performing quality assessment on the output data to obtain an assessment result; If the evaluation result does not meet the preset standard, a parameter adjustment instruction is generated and transmitted back to the host computer through the optical fiber, and the host computer is controlled to update the control instruction according to the parameter adjustment instruction.
10. A camera control device using optical fiber signals, characterized in that: The device comprises: A sending module, configured to generate a control instruction from a host computer after detecting a power-on event, and send the control instruction to a controlled device via an optical fiber through an electro-optical conversion module of the host computer; An execution module is used to convert the control instruction into an electrical signal by using the photoelectric conversion module of the controlled device, and execute a corresponding control operation based on the electrical signal until the controlled device reaches a target control state.
Citation Information
Cited By
A method and system for signal transmission of timing motion events
CN122420456A