Image acquisition and control methods, devices, and storage media
By simplifying the communication link of AOI equipment through integrated control components and trigger sequences, the problem of excessive communication between the host computer and multiple components and the complexity of the link is solved, thereby improving the efficiency of automatic optical inspection and the flexibility and accuracy of image acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU LEICHEN INTELLIGENT EQUIP TECH CO LTD
- Filing Date
- 2024-11-14
- Publication Date
- 2026-05-26
AI Technical Summary
Existing AOI equipment suffers from low communication efficiency during image acquisition due to excessive communication between the host computer and multiple components and complex communication links, which affects the efficiency of automatic optical inspection.
The communication link between the host computer and the light source and camera is simplified by integrating control components. Trigger sequences are used to control the lighting of the light source and the acquisition of images by the camera, reducing the number of communications of the host computer. Trigger sequences are transmitted through network messages to achieve complex control operations.
It improves the efficiency of automatic optical inspection, simplifies the communication link, enhances the resistance to electromagnetic interference, and improves the flexibility and accuracy of image acquisition.
Smart Images

Figure CN122093547A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automatic optical inspection technology, and in particular to an image acquisition control method, device, and storage medium. Background Technology
[0002] AOI (Automated Optical Inspection) equipment is a machine vision-based inspection device used on production lines to detect visible defects in circuit boards. It issues alarms when defects are detected and stores and transmits the inspection results. AOI equipment detects surface defects on circuit boards by illuminating various light sources and capturing images under different lighting conditions using a camera.
[0003] In related technologies, AOI (Automated Optical Inspection) equipment, in order to acquire images under multiple light sources, repeatedly sends commands from a host computer control software to components such as the light source controller, programmable logic controller, trigger board, camera, and projector. These commands control the light source controller to illuminate various monochromatic light sources and the projector to illuminate various structural light sources, and control the camera to acquire images under multiple light sources. This multiple communication between the host computer and multiple components consumes a significant amount of communication time, impacting the efficiency of automated optical inspection. Furthermore, the communication links between the host computer and multiple components are complex and susceptible to interference, further reducing the efficiency of automated optical inspection. Summary of the Invention
[0004] This application provides an image acquisition control method, device, and storage medium to control the lighting of a light source and the acquisition of images by a camera according to a trigger sequence issued by a host computer. This simplifies the communication link between the host computer and the light source and camera, while reducing the number of communications by the host computer. It solves the problem of low communication efficiency caused by excessive communication and complex communication links in the prior art, and effectively improves the efficiency of automatic optical detection.
[0005] In a first aspect, this application provides an image acquisition control method applied to an image acquisition control system, the system comprising: a control component, a host computer electrically connected to the control component, a camera, and a light source, the method comprising:
[0006] The host computer obtains the detection requirements of at least one camera field of view on the board under test, obtains the imaging requirements of each camera field of view based on the detection requirements, and sets the trigger sequences of the camera and light source corresponding to the imaging requirements of a camera field of view into a communication message and sends it to the control unit.
[0007] The control unit receives communication messages transmitted from the host computer and parses the communication messages to obtain the trigger sequences for the camera and the light source;
[0008] The control unit parses the trigger sequence to obtain at least one trigger sub-sequence, and controls the corresponding light source to light up and the corresponding camera to capture images according to each trigger sub-sequence;
[0009] The light source and camera respond to the trigger subsequence to control the light source to light up and the camera to capture images, and send the images captured by the camera to the control unit;
[0010] The control unit receives the images corresponding to each of the trigger sub-sequences transmitted by the camera and transmits each of the images to the host computer.
[0011] Through the above technical solution, the host computer connects to the light source and camera via a control component, simplifying the communication link between the host computer and the light source and camera. The host computer can analyze the imaging requirements of the camera's field of view based on the detection needs, generate trigger sequences for the light source and camera according to the imaging requirements, convert the trigger sequences into communication messages, and send them to the control component. This allows the control component to acquire an image that meets the imaging requirements based on the trigger sequences carried in the communication messages, enabling the host computer to subsequently inspect the board under test based on this image. The control component can control the light source to illuminate and the camera to take pictures based on the trigger sequences, eliminating the need for separate communication between the host computer, the light source controller, and the camera. This reduces the number of communication operations for the host computer and solves the problem of low communication efficiency caused by excessive communication and complex communication links in existing technologies, thus improving the efficiency of automatic optical inspection. Multiple trigger sub-sequences can be configured in the trigger sequence, allowing the control component to control the illumination of various light sources and the camera to capture images under various light sources based on multiple trigger sub-sequences. Multiple light source images can be acquired with only one communication message sent by the host computer, further reducing the number of communication operations for the host computer and improving the efficiency of automatic optical inspection. The light source information and camera information in the trigger subsequence of the trigger sequence can be flexibly configured to acquire a rich variety of multi-light source images, thus improving the flexibility of image acquisition.
[0012] Optionally, the control component is an integrated control component.
[0013] By employing the aforementioned technical means, an integrated control component replaces the traditional IO adapter board, light source adapter board, light source controller driver board, light source controller main control board, programmable logic controller, and trigger board in the automatic optical control component. This integrated control component establishes a communication link between the host computer and the camera and light source, simplifying the communication link between the host computer and the light source and camera. This makes the entire image acquisition and control system simpler and more stable, and improves the anti-electromagnetic interference capability of the image acquisition and control system.
[0014] Optionally, the control unit sends an analog constant current signal to the light source and the camera when controlling the light source and the camera.
[0015] Through the above technical solution, the constant current signal, due to its constant current output characteristics, has a stable volt-ampere characteristic curve and is not easily affected by external interference, power supply voltage fluctuations, and line impedance changes, thereby improving the reliability of the drive operation of the control components.
[0016] Optionally, controlling the corresponding light source to illuminate and the corresponding camera to acquire images according to each trigger sub-sequence includes:
[0017] Based on the order of the trigger sub-sequences in the trigger sequence, the light source corresponding to the trigger sub-sequence is controlled to light up and the corresponding camera to capture images.
[0018] The above technical solution allows for the sequential acquisition of images corresponding to each trigger subsequence based on the order of each trigger subsequence in the trigger sequence, thereby meeting the acquisition order requirements in imaging needs and improving the accuracy and reliability of image acquisition.
[0019] Optionally, controlling the corresponding light source to illuminate and the corresponding camera to acquire images according to each trigger sub-sequence includes:
[0020] The corresponding target light source is determined according to the trigger sub-sequence, and a first driving signal for the target light source is generated. The corresponding target camera is determined according to the trigger sub-sequence, and a second driving signal for the target camera is generated.
[0021] The first driving signal and the second driving signal are sent to the target light source and the target camera to drive the target light source to light up and the target camera to capture images.
[0022] The above technical solution can determine the target light source and target camera based on the trigger sub-sequence, and send a first driving signal and a second driving signal to the target light source and target camera, so that the target light source is lit up under the action of the first driving signal and the target camera captures the image under the target light source under the action of the second driving signal, thus ensuring the reliability and accuracy of image acquisition.
[0023] Optionally, the trigger sub-sequence includes light source information and camera information;
[0024] Accordingly, the step of determining the target light source to be driven according to the trigger sub-sequence and generating a first driving signal for the target light source, and determining the target camera to be driven according to the trigger sub-sequence and generating a second driving signal for the target camera, includes:
[0025] Based on the light source information in the trigger sub-sequence, a target light source is determined from multiple light sources, and a first driving signal for the target light source is generated based on the light source information.
[0026] The target camera is determined from among multiple cameras based on the camera information in the trigger sub-sequence, and a second drive signal for the target camera is generated based on the camera information.
[0027] The above technical solution enables the accurate determination of a target light source based on light source information in a trigger sub-sequence when multiple light sources are configured in the image acquisition and control system. A first driving signal is then generated based on this light source information to accurately illuminate the target light source, ensuring the accuracy and reliability of image acquisition. Furthermore, when multiple cameras are configured in the image acquisition and control system, the target camera is determined based on camera information in a trigger sub-sequence, and a second driving signal is generated based on this camera information. This second driving signal accurately drives the target camera to start, ensuring the reliability and accuracy of image acquisition.
[0028] Optionally, the light source information includes monochromatic light source information and projection light source information. The monochromatic light source information includes the light source color and light source illumination information, and the projection light source information includes the light source number and projection trigger information.
[0029] Accordingly, determining the target light source among multiple light sources based on the light source information in the trigger sub-sequence, and generating a first driving signal for the target light source based on the light source information, includes:
[0030] Based on the light source color or light source number in the trigger sub-sequence, the target light source is determined from multiple light sources;
[0031] The first driving signal of the target light source is generated based on the light source illumination information or projection trigger information in the trigger sub-sequence.
[0032] The above technical solution can accurately determine the target light source based on the light source color or light source number in the light source information, and accurately generate the first driving signal for driving the target light source based on the light source lighting information or projection trigger information in the light source information. This ensures that the lighting parameters or trigger parameters of the target light source meet the corresponding light source lighting information or projection trigger information, thereby ensuring that the control component can acquire the image under the target light source and improving the accuracy and reliability of image acquisition.
[0033] Optionally, the light source illumination information includes illumination time and illumination brightness, and the projection trigger information includes projection trigger time;
[0034] Accordingly, generating the first driving signal for the target light source based on the light source illumination information or projection trigger information in the trigger sub-sequence includes:
[0035] When the target light source is the monochromatic light source, a constant current driving signal is generated according to the lighting time and lighting brightness in the trigger sub-sequence, and the constant current driving signal is determined as the first driving signal of the corresponding monochromatic light source;
[0036] When the target light source is a projection light source, a first square wave signal is generated according to the projection trigger time in the trigger sub-sequence, and the first square wave signal is determined as the first driving signal of the corresponding projection light source.
[0037] The above technical solution can generate a constant current drive signal based on the lighting time and brightness, thereby driving the LED-based color light source to light up, achieving precise control over the lighting time and brightness of the color light source, and improving the reliability and accuracy of image acquisition; and generate a first square wave signal based on the projection trigger time, thereby driving the projection light source to light up, achieving precise control over the start-up time of the projection light source, and improving the reliability and accuracy of image acquisition.
[0038] Optionally, transmitting each of the images to the host computer includes:
[0039] The control unit sorts the images corresponding to each trigger sub-sequence according to their order in the trigger sequence to generate an image sequence, and then transmits the image sequence to the host computer.
[0040] The above technical solution allows for the sorting of images corresponding to each trigger subsequence based on the order of the trigger subsequences in the trigger sequence. The sorted image sequence is then transmitted to the host computer, enabling the host computer to perform optical detection based on the image sequence, thus ensuring the accuracy of the detection results.
[0041] Secondly, this application provides an image acquisition control device applied to an image acquisition control system, the system comprising: a control component, a host computer electrically connected to the control component, a camera, and a light source, characterized in that the device comprises:
[0042] The message generation module is configured to obtain the detection requirements of at least one camera field of view on the board under test from the host computer, obtain the imaging requirements of each camera field of view based on the detection requirements, and collect the trigger sequences of the camera and light source corresponding to the imaging requirements of a camera field of view into a communication message and send it to the control unit.
[0043] The message parsing module is configured to receive communication messages transmitted by the host computer and parse the communication messages to obtain the trigger sequences of the camera and the light source;
[0044] The trigger control module is configured to control the component to parse the trigger sequence to obtain at least one trigger sub-sequence, and control the corresponding light source to light up and the corresponding camera to acquire images according to each trigger sub-sequence.
[0045] The image acquisition module is configured such that the light source and camera respond to the trigger subsequence to control the light source to light up and the camera to acquire images, and sends the images acquired by the camera to the control unit;
[0046] The image transmission module is configured to receive images corresponding to each of the trigger sub-sequences transmitted by the camera, and transmit each of the images to the host computer.
[0047] Thirdly, this application provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the image acquisition control method as described in the first aspect.
[0048] In this application, the host computer connects to the light source and camera via a control component, simplifying the communication link between the host computer and the light source and camera. The host computer can parse the imaging requirements of the camera's field of view based on the detection requirements, generate a trigger sequence for the light source and camera according to the imaging requirements, and convert the trigger sequence into a communication message and send it to the control component. This allows the control component to acquire an image that meets the imaging requirements based on the trigger sequence carried in the communication message, enabling the host computer to subsequently inspect the board under test based on the image that meets the imaging requirements. The control component can control the light source to light up and the camera to take pictures based on the trigger sequence, eliminating the need for separate communication between the host computer, the light source controller, and the camera. This reduces the number of communications by the host computer and solves the problem of low communication efficiency caused by excessive communication and complex communication links in existing technologies, thus improving the efficiency of automatic optical inspection. Multiple trigger sub-sequences can be configured in the trigger sequence, allowing the control component to control the lighting of various light sources and control the camera to capture images under various light sources based on multiple trigger sub-sequences. Multiple light source images can be acquired with only one communication message sent by the host computer, further reducing the number of communications by the host computer and improving the efficiency of automatic optical inspection. The light source information and camera information in the trigger subsequence of the trigger sequence can be flexibly configured to acquire a rich variety of multi-light source images, thus improving the flexibility of image acquisition. Attached Figure Description
[0049] Figure 1 This is a schematic diagram of the structure of a conventional image acquisition and control system provided in the embodiments of this application;
[0050] Figure 2 This is a schematic diagram of the structure of the image acquisition and control system provided in the embodiments of this application;
[0051] Figure 3This is a flowchart of an image acquisition control method provided in an embodiment of this application;
[0052] Figure 4 This is a schematic diagram of an Ethernet packet provided in an embodiment of this application;
[0053] Figure 5 This is a flowchart illustrating the control of the light source and camera by the control component provided in an embodiment of this application;
[0054] Figure 6 This is a schematic diagram of the structure of an image acquisition control device provided in an embodiment of this application;
[0055] Figure 7 This is a schematic diagram of the structure of an automatic optical inspection device provided in an embodiment of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. A process can be terminated when its operation is completed, but it may also have additional steps not included in the drawings. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0057] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0058] In common implementation methods, traditional automated optical inspection equipment includes a host computer, I / O adapter board, light source adapter board, light source controller driver board, light source controller main control board, programmable logic controller, trigger board, camera, light source and projector, etc. Figure 1This is a schematic diagram of the structure of a conventional automated optical inspection device provided in the embodiments of this application. For example... Figure 1 As shown, the host computer connects to a programmable logic controller (PLC), a camera, a main control board for a light source controller, and a light source adapter board. The main control board connects to the light source controller driver board. The PLC connects to an I / O adapter board, which in turn connects to a light source conversion board. The light source conversion board connects to the light source controller driver board, a trigger board, and the light source. The trigger board connects to the camera and a projector. The host computer sends commands to the PLC via control software. The PLC triggers the trigger board's start-up sequence via I / O levels. The trigger board then triggers the camera and the light source controller or projector via I / O levels. After the light source controller illuminates the light source or the projector emits structured light, the camera captures an image. When the host computer needs to acquire images under multiple light sources, it needs to send multiple commands to the light source controller, PLC, trigger board, camera, and projector to control the light source controller to illuminate various monochromatic light sources and the projector to illuminate various structured light sources, and to control the camera to acquire images under multiple light sources. This multiple communication between the host computer and multiple components consumes a significant amount of communication time, impacting the efficiency of automatic optical inspection. Furthermore, the communication links between the host computer and multiple components are complex and susceptible to interference, further reducing the efficiency of automatic optical inspection. A communication link contains multiple link nodes, which increases the probability of communication failure.
[0059] In addition, related technologies disclose the addition of a slave device between a host computer and the light source and camera at the terminal. Specifically, the host computer communicates with the slave device, which in turn connects to the light source and camera. The host computer sends control commands to the slave device via a serial port, and the slave device drives the circuit board to move to the corresponding shooting area according to these commands. When the circuit board moves to the shooting area, the slave device sends level signals to the light source and camera to drive the light source to light up and the camera to capture an image of the circuit board. Communication between the host and slave devices is via a serial port. Serial ports have low transmission efficiency. While they can ensure efficient transmission of simple control commands, their efficiency drops significantly when transmitting control commands containing large amounts of information. Therefore, the host computer can only send control commands to the slave device to move the circuit board to a preset shooting area, and cannot drive the slave device to perform more complex control operations. Consequently, the slave device has limited functionality and poor applicability. Furthermore, the slave device drives the light source and camera via level signals, which are susceptible to electromagnetic or noise interference, changes in line impedance, and power supply voltage fluctuations. This results in low anti-interference capability and poor stability, affecting the reliability of the slave device's operation. Furthermore, the control commands sent by the host computer can only drive the camera to capture images under one type of light source at a time. To capture images under multiple light sources, multiple control commands need to be sent, resulting in low acquisition efficiency for multi-light source images. The control commands sent by the host computer cannot be used to adjust the parameters of the light source and camera. Therefore, if the parameters of the light source and camera need to be adjusted, manual adjustment is required, which is cumbersome and affects the image acquisition efficiency.
[0060] To address the aforementioned issues, this embodiment provides an image acquisition control method. This method uses a control unit to control the illumination of a light source and the acquisition of images by a camera based on a trigger sequence issued by a host computer. This simplifies the communication link between the host computer and the light source and camera, reduces the number of communications by the host computer, lowers the probability of communication failures, and effectively improves the efficiency of automatic optical inspection. The control unit communicates with the host computer via network packets. The host computer can add trigger sequences containing a large amount of control information to the network packets and transmit these sequences quickly to the control unit. This allows the control unit to perform more complex control operations based on the trigger sequences in the network packets, enriching its functionality and improving its applicability. Furthermore, due to the high-speed transmission characteristics of network packets, even when transmitting trigger sequences with large amounts of data, the transmission efficiency between the host computer and the control unit is not significantly reduced, ensuring efficient communication between them. The control unit drives the light source and camera using a simulated constant current signal. This constant current signal is less susceptible to external interference, power supply voltage fluctuations, and line impedance changes, exhibiting strong anti-interference capabilities, a smoother volt-ampere characteristic curve, and superior light emission consistency, significantly improving the reliability of the control unit's driving operation. The trigger sequence can include multiple trigger sub-sequences, each corresponding to the acquisition of a single light source image. Multiple light source images can be acquired with a single communication message from the host computer, effectively improving the acquisition efficiency of multi-light source images. The trigger sub-sequence can include light source and camera parameters, allowing adjustment of these parameters without manual intervention, simplifying parameter adjustment operations and further enhancing image acquisition efficiency.
[0061] The image acquisition control method provided in this embodiment can be executed by an automatic optical inspection device, which can be implemented by software and / or hardware. The automatic optical inspection device can be composed of two or more physical entities, or it can be composed of a single physical entity.
[0062] The automated optical inspection device is equipped with at least one type of operating system, including but not limited to Android, Linux, and Windows. The automated optical inspection device can install at least one application based on the operating system; this application can be a built-in application of the operating system or an application downloaded from a third-party device or server. In this embodiment, the automated optical inspection device has at least one application capable of executing image acquisition control methods.
[0063] In one embodiment, the automatic optical inspection device can be an image acquisition and control system, which includes a host computer, control components, a light source, and a camera. The image acquisition and control method can be executed by the image acquisition and control system. Figure 2This is a schematic diagram of the image acquisition and control system provided in an embodiment of this application. Figure 2 As shown, the light source includes a monochromatic light source and a projection structured light source. The host computer is connected to the control unit, which is connected to the monochromatic light source, the projection structured light source, and the camera.
[0064] For ease of understanding, this embodiment uses an image acquisition and control system as the main body for executing the image acquisition and control method as an example for description.
[0065] Figure 3 This is a flowchart of an image acquisition control method provided in an embodiment of this application. Figure 3 As shown, the steps of this image acquisition control method include:
[0066] S110. The host computer obtains the detection requirements of at least one camera field of view on the board under test, obtains the imaging requirements based on the detection requirements, and sets the trigger sequences of the camera and light source corresponding to the imaging requirements of a camera field of view into a communication message and sends it to the control unit.
[0067] For example, the host computer receives a detection request for the field of view of at least one camera on the board under test. Based on the detection request, the host computer parses the imaging requirements for each camera's field of view. The imaging requirements include the type of light source, the color of the light source, the camera trigger time, and the light source illumination time. A test board has multiple test areas. Each test area can correspond to a camera's field of view, or multiple test areas can correspond to a single camera's field of view, depending on the distance between the test areas and the size of the camera's field of view. A camera's field of view is called a FOV. The detection requirements for each test area can be the same or different. Each detection area can have multiple detection requirements, such as: measuring excess or insufficient solder, character recognition, measuring coating defects, measuring pin warping, etc. Each detection requirement corresponds to at least one imaging requirement. The imaging requirements corresponding to different detection requirements are generally different. The relationship between detection requirements and imaging requirements is as follows: character recognition on the chip requires emitting white light; measuring coating defects on the chip requires emitting ultraviolet light; measuring whether the chip's pins are warped requires projecting and emitting 3D structured light; measuring whether the chip's pin soldering has excess or insufficient solder or poor solder joints requires emitting RGB light. At least one image is acquired based on different light sources to meet the detection requirements.
[0068] The host computer generates a trigger sequence containing the imaging requirements of a camera's field of view. These imaging requirements include information about at least one image to be acquired corresponding to the camera's video range, such as light source information and camera information. For example, the host computer generates a trigger sub-sequence for each image to be acquired based on the light source and camera information corresponding to various images in the imaging requirements. The trigger sequence is obtained by concatenating these trigger sub-sequences. Each trigger sub-sequence instructs the control unit to acquire one or more images under the corresponding light source. For instance, when the light source is a monochromatic light source, the camera captures one image of the board under test under monochromatic light illumination; when the light source is a projection light source, the camera captures multiple images of the board under test under at least one patterned light illumination from the projection light source.
[0069] For example, suppose the imaging requirements are: use camera one to capture an image under a red light source, use camera two to capture an image under red, green, and blue light, and use camera three to capture an image under a projection light source. The host computer can generate a trigger sequence containing three trigger sub-sequences based on these imaging requirements. One trigger sub-sequence contains the camera identifier of camera one and the light source identifier of the red light source. The control unit can use this trigger sub-sequence to control the red light source to illuminate and control camera one to capture an image. Another trigger sub-sequence contains the camera identifier of camera two and the light source identifiers of red, green, and blue light. The control unit can use this trigger sub-sequence to control the red, green, and blue light sources to illuminate and control camera two to capture an image. The last trigger sub-sequence contains the camera identifier of camera three and the light source identifier of the projection light source. The control unit can use this trigger sub-sequence to control the projection light source to illuminate and control camera three to capture at least one image corresponding to at least one pattern of light formed by the projection light source; that is, one image is captured by the camera under one pattern of light from one projection light source.
[0070] After generating the trigger sequence, the host computer converts it into a communication message, which can be transmitted to the control unit via serial communication, USB communication, CAN bus communication, or wireless communication. However, serial communication, USB communication, CAN bus communication, and wireless communication are limited by factors such as transmission efficiency, bandwidth, distance, and stability. When the trigger sequence contains a large amount of control information, the host computer cannot transmit it to the control unit quickly and reliably. Therefore, the host computer can communicate with the control unit via a network.
[0071] Optionally, the communication messages received by the control unit from the host computer are network messages. After generating a trigger sequence, the host computer converts the trigger sequence into a network message using a network protocol and sends the network message carrying the trigger sequence to the control unit via the network. Compared to the aforementioned serial communication, USB communication, CAN bus communication, or wireless communication, network communication allows the transmitted network messages to carry a large amount of information, enabling the addition of various light source and camera information to the trigger sequence. This allows the control unit to perform various complex control operations under the instruction of the trigger sequence, greatly enriching the functionality of the control unit and improving its applicability. Thanks to the long-distance transmission characteristics of network messages, long-distance transmission of network messages can be achieved even when the host computer and the control unit are far apart, making it suitable for remote control scenarios. Due to the high-efficiency transmission characteristics of network messages, even if the trigger sequence contains a large amount of light source and camera information, resulting in a large data volume in the network message, the transmission efficiency between the host computer and the control unit is not significantly reduced, ensuring efficient communication between them.
[0072] Furthermore, the host computer can communicate with the control unit via Ethernet. Ethernet has a large transmission bandwidth and high transmission efficiency, supporting the host computer to quickly transmit trigger sequences containing multiple imaging requirement information to the control unit, effectively improving the communication efficiency between the host computer and the control unit.
[0073] In this embodiment, when the host computer and the control unit communicate via Ethernet, the host computer can convert the trigger sequence into Ethernet packets through an interface protocol and transmit the Ethernet packets to the control unit through the established Ethernet link. Correspondingly, the control unit receives the Ethernet packets transmitted by the host computer through the Ethernet link and parses the Ethernet packets to obtain the trigger sequence.
[0074] According to the agreed protocol, the host computer converts the trigger sequence into an Ethernet message and sends the Ethernet message to the control unit through the Ethernet communication link. The control unit obtains the trigger sequence from the Ethernet message and controls the light source to light up and the camera to capture images according to the trigger sequence.
[0075] Optionally, the control unit is an integrated control unit. The integrated control unit includes a communication module, an MCU, and a driver module. The communication module connects to the MCU, and the MCU connects to the driver module. The host computer sends Ethernet messages to the communication module. The communication module receives the Ethernet messages and transmits them to the MCU. The MCU parses the Ethernet messages to obtain a trigger sequence. The MCU generates information for executing light source control and camera control based on the trigger sequence. The driver module in the control unit drives the external light source and camera according to the descriptions in the information containing light source control and camera control. The camera transmits the captured images to the MCU. The MCU generates a return message based on the images and transmits the return message to the communication module. The communication module uploads the return message to the host computer via the Ethernet communication link. The host computer confirms that the trigger sequence has been completed based on the image in the return message. Figure 2 The integrated control unit can generate drive signals for the monochrome light source, camera, and projection structure light source via the MCU and drive module, enabling these devices to start under the corresponding drive signals. Therefore, the integrated control unit can directly drive the light source and camera without requiring additional circuit boards, such as... Figure 1 The illustrated trigger board, light source adapter board, and light source controller driver board send drive signals to the light source and camera, simplifying the communication structure between the integrated control component and the light source and camera, and improving the driving speed of the camera and light source. Therefore, this embodiment replaces the IO adapter board, light source adapter board, light source controller driver board, light source controller main control board, programmable logic controller, and trigger board in the traditional automatic optical control component with an integrated control component. The integrated control component establishes a communication link between the host computer and the camera and light source, simplifying the communication link between the host computer and the light source and camera, making the entire image acquisition and control system simpler and more stable, and improving the anti-electromagnetic interference capability of the image acquisition and control system.
[0076] S120: The control unit receives communication messages transmitted from the host computer and parses the communication messages to obtain the trigger sequences of the camera and the light source.
[0077] The trigger sequence is a sequence used to instruct the control unit to control the light source to light up and the camera to capture images under the corresponding light source.
[0078] Because the host computer may lose messages during transmission, causing the control unit to receive empty sequence messages, which cannot be parsed to obtain the trigger sequence, this embodiment proposes that the control unit receive Ethernet messages transmitted by the host computer via an Ethernet link and compares the Ethernet messages with preset empty sequence messages. If the Ethernet message is not an empty sequence message, the trigger sequence is obtained by parsing the Ethernet message according to the interface protocol. Specifically, the trigger sequence is obtained by converting the Ethernet message through the interface protocol. For example, the control unit receives Ethernet messages transmitted by the host computer via an Ethernet link connected to the host computer and compares the received Ethernet message with the empty sequence message defined by the interface protocol. If the Ethernet message is the same as the empty sequence message, it is determined that the Ethernet message is an empty sequence message. The control unit can send an alarm message to the host computer to indicate that the message was lost, causing the host computer to resend an Ethernet message containing the trigger sequence to the control unit, thus preventing the host computer from being unable to obtain the corresponding image due to message loss. If the Ethernet packet differs from the empty sequence packet, it is determined that the Ethernet packet is not an empty sequence packet. The control unit can then parse the trigger sequence from the Ethernet packet according to the interface protocol. In this embodiment, the control unit compares the received Ethernet packet with a preset empty sequence packet to determine whether the Ethernet packet contains a trigger sequence. This ensures the accuracy of trigger sequence parsing by parsing Ethernet packets containing trigger sequences.
[0079] In one embodiment, Figure 4 This is a schematic diagram of an Ethernet packet provided in an embodiment of this application. For example... Figure 4 As shown, an Ethernet message includes a start-of-message (FOM), the receiver's slave address, a trigger sequence, an end-of-message (EOM), and a checksum. The receiver's slave address specifies the target device for the Ethernet message transmission, i.e., the address of the control unit. The checksum is used to verify whether an error occurred during transmission. After generating the trigger sequence, the host computer adds the FOM, the receiver's slave address, the EOM, and the checksum before and after the trigger sequence according to the Ethernet message format defined by the interface protocol to generate a message like this. Figure 4 The diagram shows an Ethernet packet. The host computer transmits the Ethernet packet to the control unit via the Ethernet link. When the Ethernet packet is not an empty sequence packet, the control unit verifies the Ethernet packet based on the packet checksum. After successful verification, the data between the slave address at the receiving end and the packet checksum in the Ethernet packet is parsed as the trigger sequence.
[0080] S130: The control unit parses the trigger sequence to obtain at least one trigger sub-sequence, and controls the corresponding light source to light up and the corresponding camera to acquire images according to each trigger sub-sequence.
[0081] The trigger sequence includes at least one trigger sub-sequence, which instructs the control unit to acquire an image under a single light source. When the light source indicated by the trigger sub-sequence is a monochromatic light source, the camera captures an image illuminated by the monochromatic light source. When the light source indicated by the trigger sub-sequence is a projection light source, the camera captures at least one image illuminated by at least one patterned light from the projection light source. The control unit can acquire at least one trigger sub-sequence from the trigger sequence and acquire an image that meets the imaging requirements based on each trigger sub-sequence. This embodiment describes an example where the trigger sequence includes multiple trigger sub-sequences.
[0082] Compared to the aforementioned related technologies where the host computer sends control commands to the slave computer to drive the light source to light up and the camera to capture images, this method requires the host computer to send multiple control commands to the slave computer to acquire multiple images under different light sources, resulting in low acquisition efficiency for multi-light source images. In contrast, the trigger sequence in this embodiment supports the configuration of multiple trigger sub-sequences. One trigger sub-sequence can be used to instruct the control component to acquire images under one type of light source. This allows the host computer to acquire images under multiple different light sources with only one communication message sent to the control component, reducing the number of communications required by the host computer and improving the efficiency of multi-light source image acquisition.
[0083] In the field of communications, communication messages are generally used to transmit information. The inventors of this application have discovered that control instructions used to implement control logic in traditional control fields carry relatively little control information. This results in some devices used to control end-point cameras or light sources, such as lower-level machines in related technologies, only being able to perform simple control operations based on control instructions, leading to relatively limited control functions. However, communication messages in the communications field can contain multiple information sequences, and these sequences can be distinguished from each other. Therefore, the inventors have creatively proposed adding trigger sequences containing multiple trigger sub-sequences to the communication message. Each trigger sequence contains control information for the camera and light source, giving the communication message the function of instructing the control logic for the camera and light source. The control unit can perform a series of control operations on the camera and light source based on multiple trigger sub-sequences in the communication message, enriching the control function of the control unit and improving its applicability. Furthermore, while one trigger sub-sequence can instruct the control unit to control the camera to capture images under one type of light source, multiple trigger sub-sequences can instruct the control unit to control the camera to capture images under various different light sources. Therefore, transmitting multiple trigger sub-sequences via communication messages not only enriches the control functions of the control unit but also allows it to acquire images from various light sources based on a single communication message, further expanding its functionality and improving its image acquisition efficiency. In summary, this application innovatively applies communication messages to the control domain of AOI. By adding multiple trigger sub-sequences to the communication message to implement various control logics, and using communication messages from the communication domain to replace control commands from the control domain, the control unit can perform a series of complex control operations on the camera and light source based on multiple trigger sub-sequences, enriching its control functions and improving its applicability.
[0084] It should be noted that although the message length limit allows a trigger sequence to be configured with a maximum of 128 trigger sub-sequences, the number of images used for each automatic optical inspection does not need to be too large. That is, the number of trigger sub-sequences that the trigger sequence supports can meet the number of images used for automatic optical inspection. Therefore, when the image acquisition and control system performs an automatic optical inspection process, it only needs to send the trigger sequence to the control unit once through the host computer. The control unit can acquire a sufficient number of images for automatic optical inspection based on the trigger sequence, which effectively improves the efficiency of automatic optical inspection.
[0085] In one embodiment, the trigger subsequences generated by the host computer have the same length and format, and each trigger subsequence contains the same type of information, such as information about the light source and camera. The start and end symbols of the subsequences can be detected, and the sequence between the start symbol and its corresponding adjacent end symbol is determined as a trigger subsequence. (See reference...) Figure 4The sequence between the first subsequence start symbol and the first subsequence end symbol can be used as the first trigger subsequence, and the sequence between the Nth subsequence start symbol and the Nth subsequence end symbol can be used as the Nth trigger subsequence. This embodiment can accurately obtain the trigger subsequences in the trigger sequence using the subsequence start symbol and subsequence end symbol, without requiring the trigger subsequences to have the same length, thus improving the configuration flexibility of the trigger subsequences.
[0086] After acquiring multiple trigger sub-sequences in the trigger sequence, the control unit can determine the corresponding trigger light source and camera based on the light source information and camera information in the trigger sub-sequences. It can then control the light source to illuminate and, after the light source is illuminated, control the camera to capture an image illuminated by that light source. For example, when the trigger sub-sequence contains the camera identifier of camera number one and the light source identifier of the red light source, the control unit can control the red light source to illuminate and control camera number one to capture an image under the red light source based on the trigger sub-sequence.
[0087] It should be noted that when a certain image to be acquired in the imaging requirement lacks configured camera information, the host computer can add the default camera information to the trigger subsequence for that image. This allows the control unit to control the camera to acquire images based on the default camera information in the trigger subsequence. However, adding the default camera information to the trigger subsequence increases the length of the trigger sequence, leading to a larger data volume in the communication message and affecting the transmission efficiency. Therefore, the default camera information can be omitted from the trigger subsequence to shorten its length, thereby reducing the data volume in the communication message and improving transmission efficiency. If the trigger subsequence does not include camera information, the control unit can control the camera to acquire images based on the locally stored default camera information.
[0088] In one embodiment, the detection requirements impose a sequential requirement on the acquired images. When generating imaging requirements based on the detection requirements, the host computer can determine the acquisition order of images under various light sources. For example, the imaging requirements could be: first acquire images under a red light source, then acquire images under both red and blue light sources, and finally acquire images under a projection light source. The host computer generates a trigger sequence based on the imaging requirements by concatenating the trigger sub-sequences of various images according to their acquisition order. Correspondingly, after obtaining multiple trigger sub-sequences from the trigger sequence, the control unit can control the light source corresponding to the trigger sub-sequence to illuminate and the corresponding camera to acquire images according to their order within the trigger sequence. For instance, in the case where the imaging requirements are to first acquire an image under a red light source, then acquire an image under a combination of red and blue light sources, and finally acquire at least one image under a projection light source, the first trigger sub-sequence in the trigger sequence contains the light source identifier for the red light source, the second trigger sub-sequence contains the light source identifiers for both the red and blue light sources, and the third trigger sub-sequence contains the light source identifier for the projection light source. The control unit can first control the red light source to illuminate based on the first trigger sub-sequence and control the camera to capture an image under the red light source. Then, based on the second trigger sub-sequence, it can control the red and blue light sources to illuminate and control the camera to capture an image under a combination of red and blue light sources. Finally, based on the third trigger sub-sequence, it can control the projection light source to illuminate and control the camera to capture at least one image under the projection light source. This embodiment acquires images corresponding to each trigger sub-sequence sequentially according to the order of the trigger sub-sequences in the trigger sequence, thereby meeting the acquisition sequence requirements in imaging needs and improving the accuracy and reliability of image acquisition.
[0089] Optionally, the control unit sends analog constant current signals to the light source and camera when controlling them. The control unit generates constant current signals for the light source and camera based on a trigger sequence, so that the light source and camera are illuminated and images are captured under the corresponding received constant current signals. Due to its constant current output characteristics, the constant current signal has a stable volt-ampere characteristic curve and is less susceptible to external interference, power supply voltage fluctuations, and changes in line impedance. Compared to the level signals used by the lower-level machine in related technologies, the light source exhibits better emission consistency and stronger anti-interference capabilities, thus resulting in higher reliability of the control unit's driving operation.
[0090] In one embodiment, when controlling the light source to illuminate and the camera to capture images, the control unit can send drive signals to the light source and the camera to drive the light source to illuminate and the camera to capture images. For example, Figure 5 This is a flowchart illustrating the control of a light source and a camera by a control component provided in an embodiment of this application. For example... Figure 5 As shown, the steps by which the control component controls the light source and camera specifically include S1301-S1302:
[0091] S1301. Determine the target light source to be driven according to the trigger sub-sequence and generate the first driving signal of the target light source. Determine the target camera to be driven according to the trigger sub-sequence and generate the second driving signal of the target camera.
[0092] In this design, the target light source is the light source that the trigger sub-sequence indicates the control unit to drive and illuminate, and the first driving signal is the driving signal used to drive the target light source to illuminate. For example, the control unit includes a microcontroller and multiple driving units, with each driving unit connected to a corresponding light source or camera. The microcontroller determines the target light source based on the trigger sub-sequence and generates the first driving signal. The microcontroller can send the first driving signal to the driving unit connected to the target light source, causing the driving unit to send the first driving signal to the target light source, and the target light source illuminates under the driving action of the first driving signal.
[0093] In this embodiment, the image acquisition and control system includes multiple light sources, and the trigger subsequence includes light source information. Accordingly, a target light source is determined from among the multiple light sources based on the light source information in the trigger subsequence, and a first driving signal for the target light source is generated based on the light source information. For example, the microcontroller acquires the light source information in the trigger subsequence, determines the target light source based on the light source identifier in the light source information, and generates the first driving signal based on other information in the light source information. This embodiment accurately determines the target light source through the light source information in the trigger subsequence and generates a first driving signal based on the light source information to drive the target light source to illuminate accurately, ensuring the accuracy and reliability of image acquisition.
[0094] Furthermore, the light source information includes monochromatic light source information and projected light source information. Monochromatic light source information includes light source color and illumination information, while projected light source information includes light source number and projection trigger information. The light source color and number can be considered as the light source identifiers for the corresponding monochromatic and projected light sources. Illumination information is used to define the illumination parameters of the monochromatic light source, and projection light source information is used to define the trigger parameters of the projected light source. Accordingly, the target light source can be determined from multiple light sources based on the light source color or number in the trigger sub-sequence; and the first driving signal for the target light source is generated based on the light source illumination information or projection trigger information in the trigger sub-sequence.
[0095] The light source identifier for a monochromatic light source is its color, while the light source identifier for a projection light source is its number. When the light source information includes the light source color, the corresponding monochromatic light source can be identified as the target light source based on that color. When the light source information includes the light source number, the corresponding projection light source can be identified as the target light source based on that number. After determining that the target light source is a monochromatic light source, a first driving signal for illuminating the monochromatic light source can be generated based on the light source illumination information in the trigger sub-sequence. After determining that the target light source is a projection light source, a first driving signal for illuminating the projection light source can be generated based on the projection trigger information in the trigger sub-sequence. This embodiment accurately determines the target light source by using the light source color or light source number in the light source information, and accurately generates a first driving signal for driving the target light source by using the light source illumination information or projection trigger information in the light source information. This ensures that the target light source is illuminated normally while ensuring that the illumination parameters or trigger parameters of the target light source meet the corresponding light source illumination information or projection trigger information, guaranteeing that the control component acquires the image under the target light source, and improving the accuracy and reliability of image acquisition.
[0096] Moreover, compared to the aforementioned related technologies where the driving platform controls the light source to illuminate, which can only control the light source to illuminate according to preset parameters such as duration and brightness, the host computer cannot adjust the illumination time and brightness parameters of the light source through control commands. If adjustments are needed, manual adjustment of the light source parameters is required on-site, which is a complex operation. This embodiment, however, adds light source illumination information or projection trigger information to the trigger subsequence. This allows for the adjustment of light source parameters such as illumination time, brightness, and trigger time via the host computer, enabling direct remote adjustment of light source parameters without the need for on-site personnel. This significantly simplifies the adjustment process and effectively improves image acquisition efficiency.
[0097] In one embodiment, the light source is either a monochromatic light source or a projection light source. When the light source is monochromatic, it can be any one of a white light source, an RGB light source, an ultraviolet light source, or an infrared light source. An RGB light source is a red, blue, and green LED. When the light source is a projection light source, it can be structured light emitted by a projection component, such as striped light. Since the monochromatic light source is an LED and the projection light source is a projection component, and the driving methods of monochromatic and projection light sources are different, after determining the target light source, a first driving signal of the corresponding type can be generated according to the type of the target light source to ensure that the first driving signal can normally drive the target light source to light up.
[0098] In this embodiment, the light source illumination information includes illumination time and illumination brightness. Accordingly, when the target light source is a monochromatic light source, a constant current drive signal is generated based on the illumination time and illumination brightness in the trigger sub-sequence, and this constant current drive signal is determined as the first drive signal for the corresponding monochromatic light source. The illumination time may include the time node at which the monochromatic light source begins to illuminate and the time node at which it ends to illuminate.
[0099] For example, suppose trigger subsequence A is used to instruct the control unit to illuminate a monochromatic light source. Trigger subsequence A includes the color of the monochromatic light source, the illumination time, and the illumination brightness. The control unit can determine the monochromatic light source as the target light source based on the light source color in trigger subsequence A, and generate a constant current drive signal to drive the monochromatic light source to illuminate at that illumination brightness during the illumination time, according to the illumination time and illumination brightness. For a monochromatic light source using LEDs, a constant current drive signal can be used to drive the LEDs to illuminate. Constant current drive can reduce thermal damage to LEDs, thereby extending their lifespan. The current of the constant current drive signal remains constant, and the illumination brightness and illumination time of the LEDs can be adjusted by adjusting the voltage of the constant current drive signal. The microcontroller adjusts the input voltage of the drive unit connected to the LEDs according to the illumination time and illumination brightness of the trigger subsequence, so that the drive unit outputs a constant current drive signal to the LEDs under the action of the input voltage. The LEDs illuminate during the illumination time and maintain their illumination brightness under the action of the constant current drive signal. This embodiment generates a constant current drive signal by controlling the lighting time and brightness, thereby driving the monochromatic light source using LEDs to light up. This achieves precise control over the lighting time and brightness of the monochromatic light source, improving the reliability and accuracy of image acquisition.
[0100] The projection trigger information includes the projection trigger time, which is the pulse time node that triggers the projection to start. When the target light source is a projection light source, a first square wave signal is generated based on the projection trigger time in the trigger sub-sequence, and this first square wave signal is determined as the first driving signal for the corresponding projection light source. For example, assuming trigger sub-sequence B is used to instruct the control unit to illuminate the projection light source, trigger sub-sequence B includes the light source number of the projection light source and the projection trigger time. The control unit can determine the projection light source as the target light source based on the light source number in trigger sub-sequence B, and generate a first square wave signal to drive the projection light source to start at the projection trigger time. For projection light sources using projection components, a square wave signal can be used to control the projection light source to start. After the projection light source starts, multiple pattern lights are sequentially formed to illuminate the board under test according to a preset number of projections, or multiple pattern lights are sequentially formed to illuminate the board under test according to the number of projections transmitted by the control unit's serial port. Each time the projection light source forms a pattern light, it sends a signal to the control unit indicating successful pattern light illumination. The control unit uses this feedback signal to control the camera to capture an image under that pattern light illumination. After the projection light source switches the pattern light for the number of projections, the camera can capture the image for that number of projections.
[0101] Specifically, the microcontroller generates a first square wave signal based on the projection trigger time in the trigger sub-sequence. The rising edge time of the first square wave signal is the projection trigger time. The microcontroller sends the first square wave signal to the projection component through the driving unit connected to the projection, causing the projection component to start forming various patterned lights under the action of the rising edge signal of the first square wave signal. Each time the projection component forms a patterned light, it feeds back a signal to the microcontroller. Based on the signal fed back by the projection component, the microcontroller synchronously drives the camera to capture an image of the board under test illuminated by the corresponding patterned light. After the projection component completes the patterned light switching for the number of projections, the projection light source can be automatically turned off. This embodiment generates a first square wave signal through the projection trigger time, and drives the projection light source to light up through the first square wave signal, achieving precise control over the start-up time of the projection light source and improving the reliability and accuracy of image acquisition.
[0102] It should be noted that the monochromatic light source information in the trigger sub-sequence can also include only the light source color and not the light source illumination information. When the monochromatic light source information only includes the light source color, the microcontroller determines the target light source based on the light source color and then generates the first drive signal based on the target light source and the locally preset light source illumination information. Similarly, the projection light source information in the trigger sub-sequence can also include only the light source number and not the projection trigger information. When the projection light source information only includes the light source number, the microcontroller determines the target light source based on the light source number and then generates the first drive signal based on the target light source and the locally preset projection trigger information.
[0103] The target camera is a camera driven by a trigger subsequence instruction control unit to capture images, and the second drive signal is a drive signal used to drive the target camera to capture images. For example, the microcontroller determines the target camera based on the trigger subsequence and generates the second drive signal. The microcontroller can send the second drive signal to the drive unit connected to the target camera, causing the drive unit to send the second drive signal to the target camera, and the target camera captures an image under the action of the second drive signal.
[0104] In one embodiment, the image acquisition and control system includes a camera, and the microcontroller can uniquely identify the camera as the target camera. Camera information also includes camera trigger information, which defines the camera's trigger parameters. The camera trigger information may include a camera trigger time, which is the pulse time node that triggers the camera to start. A second drive signal can be generated based on the camera trigger time. The second drive signal can be a second square wave signal, and the rising edge time of the second square wave signal is the camera trigger time. The camera starts correspondingly whenever it receives the rising edge signal of the second square wave signal. After the camera starts, the control unit receives a signal from the light source after the light source is lit, and synchronously drives the camera to capture an image based on this feedback signal.
[0105] In another embodiment, the image acquisition control system includes multiple cameras, and the trigger subsequence includes camera information. Accordingly, a target camera can be determined among the multiple cameras based on the camera information in the trigger subsequence, and a second drive signal for the target camera is generated based on the camera information. For example, the camera information includes a camera identifier and a camera trigger time; the target camera can be determined among the multiple cameras based on the camera identifier in the trigger subsequence. A second square wave signal is generated based on the camera trigger time, and this second square wave signal is used as the second drive signal to drive the camera to start. Subsequently, the control unit receives a signal from the light source after the light source is turned on, and synchronously drives the target camera to capture an image based on this feedback signal.
[0106] If the camera information includes the camera's shooting parameters, a second square wave signal is generated based on the camera trigger time, and a second serial port signal is generated based on the shooting parameters. The second square wave signal and the second serial port signal are used as a second driving signal to transmit the shooting parameters to the target camera via the second serial port signal and to drive the target camera to start using the second square wave signal, subsequently capturing images with those shooting parameters. In this embodiment, when multiple cameras are set up in the image acquisition control system, the target camera is determined based on the camera information in the trigger sub-sequence, and a second driving signal is generated based on the camera information to accurately drive the target camera to start, ensuring the reliability and accuracy of image acquisition.
[0107] Moreover, compared to the aforementioned related technologies where the platform controls the camera for shooting, this approach can only control the light source to take pictures according to preset shooting angles, exposure parameters, and other imaging parameters. The host computer cannot adjust the camera parameters via control commands; any adjustments require manual on-site intervention, making the process complex. In contrast, this embodiment adds camera parameters to the trigger subsequence, allowing for adjustment of the camera's shooting angle and exposure parameters directly via the host computer. This eliminates the need for on-site personnel to adjust the camera parameters, significantly simplifying the adjustment process and effectively improving image acquisition efficiency.
[0108] Optionally, the trigger sub-sequence structure is as follows: light source channel illumination configuration, projection channel trigger configuration, camera channel trigger configuration, light source channel brightness configuration, light source illumination time configuration, dark field time setting after light source illumination ends, camera trigger pulse time setting, projection trigger pulse time setting, and delay time setting. Each trigger sub-sequence has the same structure for easy machine parsing. The light source channel, projection channel, and camera channel are configured according to the monochrome light source, projection light source, and camera in the image acquisition and control system.
[0109] refer to Figure 4A trigger subsequence is generated by sorting the following parameters: subsequence start symbol, light source channel 1 illumination configuration, light source channel 2 illumination configuration, projection channel trigger configuration, camera channel trigger configuration, light source channel 1 brightness configuration, light source channel 2 brightness configuration, light source illumination time configuration, dark field time setting after light source illumination ends, camera trigger pulse time setting, projection start trigger pulse time setting, delay or advance time setting, and subsequence end symbol. The light source channel 1 illumination configuration, light source channel 2 illumination configuration, and projection channel trigger configuration can be considered as light source identifiers in the trigger subsequence. When the field content corresponding to the light source channel 1 illumination configuration, light source channel 2 illumination configuration, or projection channel trigger configuration is 1, the light source corresponding to light source channel 1, light source channel 2, or projection channel is confirmed to be illuminated. When the field content corresponding to the light source channel 1 illumination configuration, light source channel 2 illumination configuration, or projection channel trigger configuration is 0, the light source corresponding to light source channel 1, light source channel 2, or projection channel is confirmed not to be illuminated. The brightness configurations for Light Source Channel 1 and Light Source Channel 2 can be considered as the illumination brightness of the light source information in the trigger subsequence. The illumination brightness of Light Source Channel 1 and Light Source Channel 2 can be confirmed based on their respective field contents. The light source illumination time configuration and the dark field time setting after the light source illumination ends can be considered as the illumination time of the light source information in the trigger subsequence. The illumination time of the monochromatic light source can be confirmed based on these settings. The pulse time setting for triggering projection startup can be considered as the projection trigger time of the projection trigger information in the trigger subsequence. The startup time of the projection light source can be confirmed based on the pulse time. The camera channel trigger configuration can be considered as the camera identifier in the camera information of the trigger subsequence. When the field content of the camera channel trigger configuration is 1, it confirms that the camera corresponding to the camera channel captures an image. When the field content of the camera channel trigger configuration is 0, it confirms that the camera corresponding to the camera channel does not capture an image. The pulse time setting and delay or advance time setting of the trigger camera can be regarded as the camera trigger time in the camera information of the trigger subsequence. The camera start time can be confirmed according to the field content corresponding to the pulse time setting and delay or advance time of the trigger camera.
[0110] S1302, Send the first driving signal and the second driving signal to the target light source and the target camera to drive the target light source to light up and the target camera to acquire images.
[0111] For example, the microcontroller sends a first driving signal to the target light source via a driving unit connected to the target light source to illuminate it. After the target light source is illuminated, the microcontroller sends a second driving signal to the target camera via a driving unit connected to the target camera to activate the target camera. After the target camera is activated, the microcontroller synchronously sends a shooting signal to the target camera upon receiving a successful illumination signal from the target light source. The target camera then captures an image under the target light source. This embodiment determines the target light source and the target camera through a trigger sub-sequence and sends a first driving signal and a second driving signal to the target light source and the target camera, respectively, so that the target light source illuminates under the action of the first driving signal and the target camera activates under the action of the second driving signal and captures an image under the target light source after it is illuminated, ensuring the reliability and accuracy of image acquisition.
[0112] S140, the light source and camera response trigger subsequence to control the light source to light up and the camera to acquire images, and send the images acquired by the camera to the control unit.
[0113] For example, the light source is illuminated by a drive signal sent by the drive module of the control unit. The camera captures an image of the corresponding light source under the drive signal sent by the drive module of the control unit, and sends the captured image to the control unit.
[0114] S150: The control unit receives the images corresponding to each trigger sub-sequence transmitted by the camera and transmits each image to the host computer.
[0115] For example, after the camera captures one or more images, it transmits the captured images to the control unit. The control unit receives the images transmitted by the camera and uploads the received images to the host computer.
[0116] In this embodiment, the detection requirements impose a sequential requirement on the acquired images. When generating imaging requirements based on the detection requirements, the host computer can determine the acquisition order of various images. The order of each trigger sub-sequence in the trigger sequence corresponds to the acquisition order of the images corresponding to the trigger sub-sequences required in the imaging requirements. Therefore, after receiving the images of each trigger sub-sequence transmitted from the camera, the control unit can sort the images corresponding to each trigger sub-sequence according to their order in the trigger sequence to generate an image sequence, and upload the image sequence to the host computer. For example, after receiving the images transmitted from the camera, the control unit determines the corresponding trigger sub-sequences. After acquiring the images of each trigger sub-sequence, it sorts the images according to the position of the corresponding trigger sub-sequence in the trigger sequence to obtain an image sequence, and uploads the image sequence to the host computer so that the host computer can perform optical detection based on the image sequence. This embodiment sorts the images corresponding to the trigger sub-sequences according to their order in the trigger sequence, and transmits the sorted image sequence to the host computer, enabling the host computer to perform optical detection based on the image sequence, thus ensuring the accuracy of the detection results.
[0117] In summary, the image acquisition and control method provided in this application simplifies the communication link between the host computer and the light source and camera by connecting the host computer to the control unit. The host computer can parse the imaging requirements of the camera's field of view based on the detection requirements, generate trigger sequences for the light source and camera according to the imaging requirements, and convert the trigger sequences into communication messages and send them to the control unit. This allows the control unit to acquire an image that meets the imaging requirements based on the trigger sequences carried in the communication messages, enabling the host computer to subsequently inspect the board under test based on the image that meets the imaging requirements. The control unit can control the light source to light up and the camera to take pictures based on the trigger sequences, eliminating the need for separate communication between the host computer, the light source controller, and the camera. This reduces the number of communications by the host computer and solves the problem of low communication efficiency caused by excessive communication and complex communication links in the prior art, thus improving the efficiency of automatic optical inspection. Multiple trigger sub-sequences can be configured in the trigger sequence, allowing the control unit to control the lighting of various light sources and control the camera to capture images under various light sources based on multiple trigger sub-sequences. This enables the acquisition of images from multiple light sources with only one communication message sent by the host computer, further reducing the number of communications by the host computer and improving the efficiency of automatic optical inspection. The light source information and camera information in the trigger subsequence of the trigger sequence can be flexibly configured to acquire a rich variety of multi-light source images, thus improving the flexibility of image acquisition.
[0118] Based on the above embodiments, Figure 6 This is a schematic diagram of an image acquisition and control device provided in an embodiment of this application. (Reference) Figure 6The image acquisition control device provided in this embodiment specifically includes: a message generation module 21, a message parsing module 22, a trigger control module 23, an image acquisition module 24, and an image transmission module 25.
[0119] Among them, the message generation module 21 is configured to obtain the detection requirements of at least one camera field of view on the board under test from the host computer, obtain the imaging requirements of each camera field of view based on the detection requirements, and collect the trigger sequences of the camera and light source corresponding to the imaging requirements of a camera field of view into a communication message and send it to the control unit.
[0120] The message parsing module 22 is configured to receive communication messages transmitted by the host computer and parse the communication messages to obtain the trigger sequence of the camera and the light source.
[0121] Trigger control module 23 is configured to control the component to parse the trigger sequence to obtain at least one trigger subsequence, and control the corresponding light source to light up and the corresponding camera to acquire images according to each trigger subsequence;
[0122] Image acquisition module 24 is configured to respond to light source and camera response trigger subsequence to control the light source to light up and the camera to acquire images, and send the images acquired by the camera to the control unit;
[0123] The image transmission module 25 is configured to receive the images corresponding to each trigger subsequence transmitted by the camera and transmit each image to the host computer.
[0124] Based on the above embodiments, the control component sends simulated constant current signals to the light source and camera when controlling the light source and camera.
[0125] Based on the above embodiments, the trigger control module 23 includes: a sequential trigger control module, configured to control the light source corresponding to the trigger sub-sequence to light up and the corresponding camera to acquire images according to the order of the trigger sub-sequence in the trigger sequence.
[0126] Based on the above embodiments, the trigger control module 23 includes: a signal generation submodule, configured to determine the target light source to be driven according to the trigger subsequence and generate a first driving signal for the target light source, and to determine the target camera to be driven according to the trigger subsequence and generate a second driving signal for the target camera; and a drive control submodule, configured to send the first driving signal and the second driving signal to the target light source and the target camera to drive the target light source to light up and the target camera to acquire images.
[0127] Based on the above embodiments, the trigger sub-sequence includes light source information and camera information; correspondingly, the signal generation sub-module includes: a first signal generation unit configured to determine a target light source among multiple light sources based on the light source information in the trigger sub-sequence, and generate a first driving signal for the target light source based on the light source information; and a second signal generation unit configured to determine a target camera among multiple cameras based on the camera information in the trigger sub-sequence, and generate a second driving signal for the target camera based on the camera information.
[0128] Based on the above embodiments, the monochromatic light source information and the projection light source information are provided. The monochromatic light source information includes the light source color and the light source illumination information, and the projection light source information includes the light source number and the projection trigger information. Correspondingly, the first signal generation unit includes: a target light source determination subunit, configured to determine the target light source among multiple light sources according to the light source color or the light source number in the trigger subsequence; and a first signal generation subunit, configured to generate a first driving signal for the target light source according to the light source illumination information or the projection trigger information in the trigger subsequence.
[0129] Based on the above embodiments, the light source illumination information includes illumination time and illumination brightness, and the projection trigger information includes projection trigger time; correspondingly, the first signal generation subunit is specifically configured to: when the target light source is a monochromatic light source, generate a constant current driving signal according to the illumination time and illumination brightness in the trigger subsequence, and determine the constant current driving signal as the first driving signal of the corresponding monochromatic light source; when the target light source is a projection light source, generate a first square wave signal according to the projection trigger time in the trigger subsequence, and determine the first square wave signal as the first driving signal of the corresponding projection light source.
[0130] Based on the above embodiments, the image transmission module 25 includes an image sequence transmission submodule, which is configured to sort the images corresponding to each trigger subsequence according to the order of each trigger subsequence in the trigger sequence to generate an image sequence, and transmit the image sequence to the host computer.
[0131] The image acquisition and control device provided in this application embodiment simplifies the communication link between the host computer and the light source and camera by connecting the host computer to the control component. The host computer can parse the imaging requirements of the camera's field of view based on the detection requirements, generate trigger sequences for the light source and camera according to the imaging requirements, and convert the trigger sequences into communication messages and send them to the control component. This allows the control component to acquire an image that meets the imaging requirements based on the trigger sequences carried in the communication messages, enabling the host computer to subsequently inspect the board under test based on the image that meets the imaging requirements. The control component can control the light source to light up and the camera to take pictures based on the trigger sequences, eliminating the need for separate communication between the host computer, the light source controller, and the camera. This reduces the number of communication operations for the host computer and solves the problem of low communication efficiency caused by excessive communication operations and complex communication links in the prior art, thus improving the efficiency of automatic optical inspection. Multiple trigger sub-sequences can be configured in the trigger sequence. The control component can control the lighting of various light sources and control the camera to take pictures under various light sources based on multiple trigger sub-sequences. Even with only one communication message sent by the host computer, it can acquire images of multiple light sources, further reducing the number of communication operations for the host computer and improving the efficiency of automatic optical inspection. The light source information and camera information in the trigger subsequence of the trigger sequence can be flexibly configured to acquire a rich variety of multi-light source images, thus improving the flexibility of image acquisition.
[0132] The image acquisition control device provided in this application embodiment can be used to execute the image acquisition control method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0133] Figure 7 This is a schematic diagram of the structure of an automated optical inspection device provided in an embodiment of this application, with reference to... Figure 7 The automated optical inspection device includes a processor 31, a memory 32, a communication device 33, an input device 34, and an output device 35. The automated optical inspection device may have one or more processors 31 and one or more memory units 32. The processor 31, memory 32, communication device 33, input device 34, and output device 35 of the automated optical inspection device can be connected via a bus or other means.
[0134] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the image acquisition control method in any embodiment of this application (e.g., message generation module 21, message parsing module 22, trigger control module 23, image acquisition module 24, and image transmission module 25 in the image acquisition control device). The memory 32 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory 32 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0135] The communication device 33 is used for data transmission.
[0136] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 32, thereby realizing the above-mentioned image acquisition control method.
[0137] Input device 34 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 35 may include display devices such as a display screen.
[0138] The automatic optical inspection equipment provided above can be used to execute the image acquisition control method provided in the above embodiments, and has corresponding functions and beneficial effects.
[0139] This application embodiment also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute an image acquisition control method. The image acquisition control method includes: a host computer acquiring detection requirements for the field of view of at least one camera on a test board; obtaining imaging requirements for each camera's field of view based on the detection requirements; aggregating trigger sequences of the camera and light source corresponding to the imaging requirements of a camera's field of view into a communication message and sending it to a control unit; the control unit receiving the communication message transmitted by the host computer and parsing the communication message to obtain the trigger sequences of the camera and light source; the control unit parsing the trigger sequences to obtain at least one trigger sub-sequence; controlling the corresponding light source to light up and the corresponding camera to acquire images according to each trigger sub-sequence; the light source and camera responding to the trigger sub-sequence to control the light source to light up and the camera to acquire images, and sending the images acquired by the camera to the control unit; and the control unit receiving the images acquired corresponding to each trigger sub-sequence transmitted by the camera and transmitting each image to the host computer.
[0140] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0141] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the image acquisition control method described above, but can also execute related operations in the image acquisition control method provided in any embodiment of this application.
[0142] The image acquisition control device and storage medium provided in the above embodiments can execute the image acquisition control method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the image acquisition control method provided in any embodiment of this application.
[0143] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application. The scope of this application is determined by the scope of the claims.
Claims
1. An image acquisition control method, applied to an image acquisition control system, the system comprising: The method comprises: a control unit, a host computer electrically connected to the control unit, a camera, and a light source, characterized in that the method includes: The host computer obtains the detection requirements of at least one camera field of view on the board under test, obtains the imaging requirements of each camera field of view based on the detection requirements, and sets the trigger sequences of the camera and light source corresponding to the imaging requirements of a camera field of view into a communication message and sends it to the control unit. The control unit receives communication messages transmitted from the host computer and parses the communication messages to obtain the trigger sequences for the camera and the light source; The control unit parses the trigger sequence to obtain at least one trigger sub-sequence, and controls the corresponding light source to light up and the corresponding camera to capture images according to each trigger sub-sequence; The light source and camera respond to the trigger subsequence to control the light source to light up and the camera to capture images, and send the images captured by the camera to the control unit; The control unit receives the images corresponding to each of the trigger sub-sequences transmitted by the camera and transmits each of the images to the host computer.
2. The image acquisition control method according to claim 1, characterized in that, The control component is an integrated control component.
3. The image acquisition control method according to claim 1, characterized in that, When the control unit controls the light source and the camera, it sends a simulated constant current signal to the light source and the camera.
4. The image acquisition control method according to claim 1, characterized in that, The step of controlling the corresponding light source to light up and the corresponding camera to acquire images according to each trigger sub-sequence includes: Based on the order of the trigger sub-sequences in the trigger sequence, the light source corresponding to the trigger sub-sequence is controlled to light up and the corresponding camera to capture images.
5. The image acquisition control method according to claim 1, characterized in that, The step of controlling the corresponding light source to light up and the corresponding camera to acquire images according to each trigger sub-sequence includes: The corresponding target light source is determined according to the trigger sub-sequence, and a first driving signal for the target light source is generated. The corresponding target camera is determined according to the trigger sub-sequence, and a second driving signal for the target camera is generated. The first driving signal and the second driving signal are sent to the target light source and the target camera to drive the target light source to light up and the target camera to capture images.
6. The image acquisition control method according to claim 5, characterized in that, The trigger sub-sequence includes light source information and camera information; Accordingly, the step of determining the target light source to be driven according to the trigger sub-sequence and generating a first driving signal for the target light source, and determining the target camera to be driven according to the trigger sub-sequence and generating a second driving signal for the target camera, includes: Based on the light source information in the trigger sub-sequence, a target light source is determined from multiple light sources, and a first driving signal for the target light source is generated based on the light source information. The target camera is determined from among multiple cameras based on the camera information in the trigger sub-sequence, and a second drive signal for the target camera is generated based on the camera information.
7. The image acquisition control method according to claim 6, characterized in that, The light source information includes monochromatic light source information and projection light source information. The monochromatic light source information includes the light source color and the light source illumination information. The projection light source information includes the light source number and the projection trigger information. Accordingly, determining the target light source among multiple light sources based on the light source information in the trigger sub-sequence, and generating a first driving signal for the target light source based on the light source information, includes: Based on the light source color or light source number in the trigger sub-sequence, the target light source is determined from multiple light sources; The first driving signal of the target light source is generated based on the light source illumination information or projection trigger information in the trigger sub-sequence.
8. The image acquisition control method according to claim 7, characterized in that, The light source illumination information includes illumination time and illumination brightness, and the projection trigger information includes projection trigger time; Accordingly, generating the first driving signal for the target light source based on the light source illumination information or projection trigger information in the trigger sub-sequence includes: When the target light source is the monochromatic light source, a constant current driving signal is generated according to the lighting time and lighting brightness in the trigger sub-sequence, and the constant current driving signal is determined as the first driving signal of the corresponding monochromatic light source; When the target light source is a projection light source, a first square wave signal is generated according to the projection trigger time in the trigger sub-sequence, and the first square wave signal is determined as the first driving signal of the corresponding projection light source.
9. The image acquisition control method according to claim 1, characterized in that, The step of transmitting each of the images to the host computer includes: The control unit sorts the images corresponding to each trigger sub-sequence according to their order in the trigger sequence to generate an image sequence, and then transmits the image sequence to the host computer.
10. An image acquisition control device, applied to an image acquisition control system, the system comprising: A control unit, a host computer electrically connected to the control unit, a camera, and a light source, characterized in that the device comprises: The message generation module is configured to obtain the detection requirements of at least one camera field of view on the board under test from the host computer, obtain the imaging requirements of each camera field of view based on the detection requirements, and collect the trigger sequences of the camera and light source corresponding to the imaging requirements of a camera field of view into a communication message and send it to the control unit. The message parsing module is configured to receive communication messages transmitted by the host computer and parse the communication messages to obtain the trigger sequences of the camera and the light source; The trigger control module is configured to control the component to parse the trigger sequence to obtain at least one trigger sub-sequence, and control the corresponding light source to light up and the corresponding camera to acquire images according to each trigger sub-sequence. The image acquisition module is configured such that the light source and camera respond to the trigger subsequence to control the light source to light up and the camera to acquire images, and sends the images acquired by the camera to the control unit; The image transmission module is configured to receive images corresponding to each of the trigger sub-sequences transmitted by the camera, and transmit each of the images to the host computer.
11. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the image acquisition control method as described in any one of claims 1-9.