Multi-channel adaptive control method and device and electronic equipment

By judging the working mode in the multi-channel adaptive control system and adopting corresponding control strategies, the problems of low image quality and low detection efficiency in the prior art are solved, and efficient and flexible image capture and detection are achieved.

CN119935878APending Publication Date: 2025-05-06SUZHOU JIALI AUTOMATION TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411992235.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The prior art has defects in multi-channel adaptability control, resulting in blurred image, uneven lighting and inaccurate trigger timing control, thereby reducing detection efficiency.

Method used

By judging the current working mode, the trigger output signal of the time-sharing strobe camera is detected when using the camera trigger control mode to accurately light up the target channel and take images under optimal lighting conditions; in other modes, an encoder signal is generated synchronized with the conveyor belt running speed, and multiple channels are lit in preset order to achieve coordination between light source and motion.

Benefits of technology

It improves imaging quality, reduces image defects caused by uneven light and insufficient exposure, enhances detection efficiency and flexibility, and meets the needs of machine vision applications under different workpieces and process conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119935878A_ABST
    Figure CN119935878A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-channel adaptive control method and device and electronic equipment, and relates to the field of visual inspection. In the method, a current working mode is determined, and the working mode comprises a camera trigger control mode and other modes; if the working mode is determined to be the camera trigger control mode, judging whether the target channel detects a trigger output signal from the time-sharing stroboscopic camera or not; if it is determined that the target channel detects the trigger output signal from the time-sharing stroboscopic camera, the target channel is lightened; controlling the time-sharing stroboscopic camera to shoot the to-be-detected object under the lightened light source to obtain a first picture; if the working mode is determined to be other modes, an encoder signal consistent with the running speed of the conveyor belt is generated; based on the encoder signal, sequentially lightening the plurality of channels according to a preset sequence; and when each channel is lightened, controlling the time-sharing stroboscopic camera to shoot a corresponding picture to obtain a plurality of second pictures. By implementing the technical scheme provided by the invention, the automatic detection efficiency of the production line is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of visual detection, and in particular to a multi-channel adaptive control method, device and electronic equipment. Background Art

[0002] With the rapid development of industrial automation technology, especially in the field of manufacturing and quality inspection, the application of high-speed automated visual inspection systems has become more and more widespread. These systems are widely used in industries such as food, pharmaceuticals, and electronic components to detect the quality and integrity of products in real time. In order to meet the inspection needs on high-speed production lines, time-sharing strobe cameras are introduced to achieve fast and accurate image capture.

[0003] At present, although time-sharing stroboscopic cameras can provide high-quality images in a very short time, the existing technology has obvious defects in multi-channel adaptive control. In practical applications, traditional image capture systems are usually faced with problems such as blurred images, uneven lighting, and imprecise trigger timing control. These problems are mainly due to the system's inability to flexibly adjust lighting and shooting parameters according to different production line speeds. When the captured image quality is not high, it is often necessary to reshoot, resulting in low detection efficiency. In addition, the existing multi-channel control schemes often cannot effectively switch automatically according to the conveyor belt speed and working mode, resulting in low detection efficiency. Therefore, the related technology has the problem of low detection efficiency.

[0004] Therefore, there is an urgent need for a multi-channel adaptive control method, device and electronic equipment. Summary of the invention

[0005] The present application provides a multi-channel adaptive control method, device and electronic equipment, which improve the efficiency of automatic detection of production lines.

[0006] In a first aspect of the present application, a multi-channel adaptive control method is provided, the method comprising: determining a current working mode, the working mode comprising a camera trigger control mode and other modes; if the working mode is determined to be the camera trigger control mode, determining whether a target channel detects a trigger output signal from the time-sharing stroboscopic camera, the target channel being any one of the multiple channels; if the target channel is determined to detect a trigger output signal from the time-sharing stroboscopic camera, lighting the target channel; controlling the time-sharing stroboscopic camera to shoot an object to be detected under the lit light source to obtain a first photo, so as to achieve image capture under optimal lighting conditions; if the working mode is determined to be other modes, generating an encoder signal consistent with the running speed of the conveyor belt; based on the encoder signal, lighting up multiple channels in sequence according to a preset order; controlling the time-sharing stroboscopic camera to shoot a corresponding photo when each channel is lit to obtain multiple second photos with different visual features.

[0007] By adopting the above technical solution, the current working mode is first determined, and corresponding control strategies are adopted for different working modes. In the camera trigger control mode, the target channel is accurately lit by detecting the trigger output signal of the time-sharing stroboscopic camera, and the object to be detected is photographed under the optimal lighting conditions to obtain a high-quality first photo. This adaptive light source control based on camera triggering can effectively improve the imaging quality and reduce image defects caused by factors such as uneven lighting and insufficient exposure. In other modes, by generating an encoder signal synchronized with the running speed of the conveyor belt, and lighting each channel in a preset order based on the signal, accurate coordination between the light source and the movement is achieved. At the same time, by taking photos at the moment of lighting each channel, a second photo reflecting different visual features of the object to be inspected is obtained, which provides a data basis for subsequent multi-view defect detection. This multi-channel, time-sharing multiplexed light source control method not only ensures detection efficiency, but also greatly improves flexibility and adaptability, and can meet the machine vision application requirements of different workpieces and different process conditions. The method can automatically adjust the channel lighting and the trigger timing of the camera according to different working modes, ensuring the capture of high-quality images under the optimal lighting conditions, while improving the flexibility and response speed of the system. Through this method, the efficiency and accuracy of automated inspection on the production line can be greatly improved.

[0008] Optionally, the determining whether the target channel detects the trigger output signal from the time-sharing stroboscopic camera specifically includes: detecting the input signal of the target channel; comparing the input signal with a preset trigger output signal template; if it is determined that the input signal matches the preset trigger output signal template, then determining that the target channel detects the trigger output signal from the time-sharing stroboscopic camera; if it is determined that the input signal does not match the preset trigger output signal template, then determining that the target channel does not detect the trigger output signal from the time-sharing stroboscopic camera.

[0009] By adopting the above technical solution, the reliability and accuracy of trigger signal detection are improved by comparing the input signal of the target channel with the preset trigger output signal template. On the one hand, the introduction of the trigger signal template matching mechanism can effectively avoid misjudgment caused by factors such as signal distortion and noise interference; on the other hand, by presetting the trigger output signal template, it can adapt to camera devices of different models and different interfaces, improving the compatibility of the system.

[0010] Optionally, lighting up the target channel specifically includes: determining light source parameters corresponding to the target channel, the light source parameters including light source type, light source brightness and duration; generating a lighting signal corresponding to the target channel according to the light source parameters; and outputting the lighting signal to the light source corresponding to the target channel to light up the target channel.

[0011] By adopting the above technical solution, by introducing light source parameters including light source type, light source brightness, duration, etc., a refined description and regulation of the lighting process is achieved. Based on the light source parameters, corresponding lighting signals can be generated for different target channels, and the signals can be accurately output to the light source control circuit of the channel, thereby achieving precise control of the light source brightness and lighting time.

[0012] Optionally, before lighting up the plurality of channels in sequence according to a preset order based on the encoder signal, the method further includes: acquiring the running speed of the conveyor belt; adjusting the frequency of the encoder signal based on a preset frequency library and the running speed so that the frequency of the encoder signal is synchronized with the running speed of the conveyor belt, the preset frequency library including the corresponding relationship between the running speed and the frequency; using the adjusted encoder signal as a timing trigger signal to trigger lighting up the plurality of channels.

[0013] By adopting the above technical solution, the running speed of the conveyor belt is obtained in real time, and the frequency of the encoder signal is dynamically adjusted based on the preset frequency library, so as to achieve real-time synchronization between the lighting of the light source and the motion state. This method introduces a speed and frequency matching mechanism. By establishing a mapping relationship between the running speed of the conveyor belt and the frequency of the encoder signal, when the conveyor belt speed changes, the corresponding synchronization frequency can be quickly found, and the timing of channel lighting can be adjusted accordingly, thereby ensuring the consistency of the object position and lighting conditions during the image acquisition process. At the same time, using the adjusted encoder signal as a synchronous trigger signal for multi-channel lighting can ensure that each channel is lit in sequence, which improves the energy utilization of the light source while reducing the crosstalk interference between channels.

[0014] Optionally, determining the current working mode specifically includes: obtaining an externally set working mode selection instruction, the working mode selection instruction is used to indicate selection of the camera trigger control mode or the other modes; if the working mode selection instruction is a first preset value, the current working mode is determined to be the camera trigger control mode; if the working mode selection instruction is a second preset value, the current working mode is determined to be the other mode, and the first preset value and the second preset value are different numbers or characters.

[0015] By adopting the above technical solution, by receiving and parsing the manually set mode selection instruction and matching the instruction value with the predetermined mode identifier, the desired working mode can be automatically identified and switched. On the one hand, the introduction of the mode selection instruction mechanism can flexibly switch between the camera trigger mode and other modes according to actual needs to meet the specific requirements of different working conditions and different application scenarios; this method simplifies the process of working mode switching through human-computer interaction without increasing the complexity of hardware, thereby improving the flexibility, usability and manageability of the machine vision system.

[0016] Optionally, after controlling the time-sharing stroboscopic camera to take corresponding photos when each of the channels is illuminated to obtain a plurality of second photos with different visual features, the method further includes: judging whether each of the second photos meets preset image quality requirements; if it is determined that there is a target photo that does not meet the preset image quality requirements, adjusting the lighting parameters of the channel corresponding to the target photo, the lighting parameters including one or more of lighting brightness, lighting angle and lighting duration; and controlling the time-sharing stroboscopic camera to retake photos based on the adjusted lighting parameters and the channel corresponding to the target photo.

[0017] By adopting the above technical solution, by performing quality assessment on photos collected through multiple channels and comparing the assessment results with the preset image quality requirements, the method can automatically detect unqualified target photos and adjust the lighting parameters of the corresponding channels accordingly, such as lighting brightness, lighting angle and lighting duration, and then re-shoot based on the optimized parameters, thereby realizing closed-loop feedback control and continuously improving imaging quality.

[0018] Optionally, based on the encoder signal, lighting up the multiple channels in sequence according to a preset order, specifically including: generating a lighting timing control signal for each channel according to the preset order; outputting the lighting timing control signal to the corresponding channels respectively to control the lighting time and duration of each channel.

[0019] By adopting the above technical solution, independent lighting timing control signals are generated for each channel according to a preset sequence, and these signals are accurately distributed to the control interface of the corresponding channel. This method realizes accurate timing control of the light sources of each channel, ensuring the controllability and consistency of the lighting moment and duration.

[0020] In a second aspect of the present application, a multi-channel adaptive control device is provided, the device comprising: a determination module and a processing module, wherein: the determination module is used to determine the current working mode, the working mode including the camera trigger control mode and other modes; the processing module is used to determine whether the target channel detects the trigger output signal from the time-sharing stroboscopic camera if the working mode is determined to be the camera trigger control mode, the target channel is any one of the multiple channels; the processing module is also used to light up the target channel if it is determined that the target channel detects the trigger output signal from the time-sharing stroboscopic camera; the processing module is also used to control the time-sharing stroboscopic camera to shoot the object to be detected under the lit light source to obtain a first photo, so as to achieve image capture under optimal lighting conditions; the processing module is also used to generate an encoder signal consistent with the running speed of the conveyor belt if the working mode is determined to be other modes; the processing module is also used to light up the multiple channels in sequence according to a preset order based on the encoder signal; the processing module is also used to control the time-sharing stroboscopic camera to shoot corresponding photos when each channel is lit to obtain multiple second photos with different visual features.

[0021] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.

[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.

[0023] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. First, determine the current working mode and adopt corresponding control strategies for different working modes. In the camera trigger control mode, by detecting the trigger output signal of the time-sharing stroboscopic camera, the target channel is accurately lit, and the object to be detected is photographed under the optimal lighting conditions to obtain a high-quality first photo. This adaptive light source control based on camera triggering can effectively improve the imaging quality and reduce image defects caused by factors such as uneven lighting and insufficient exposure. In other modes, by generating an encoder signal synchronized with the running speed of the conveyor belt, and lighting each channel in a preset order based on the signal, precise coordination between the light source and the movement is achieved. At the same time, by taking photos at the moment of lighting each channel, a second photo reflecting the different visual features of the object to be inspected is obtained, providing a data basis for subsequent multi-view defect detection. This multi-channel, time-sharing multiplexed light source control method not only ensures detection efficiency, but also greatly improves flexibility and adaptability, and can meet the machine vision application requirements of different workpieces and different process conditions. This method can automatically adjust the channel lighting and the trigger timing of the camera according to different working modes, ensuring the capture of high-quality images under the optimal lighting conditions, while improving the flexibility and response speed of the system. Through this method, the efficiency and accuracy of automated inspection on the production line can be greatly improved.

[0024] 2. By comparing the input signal of the target channel with the preset trigger output signal template, the reliability and accuracy of trigger signal detection are improved. On the one hand, the introduction of the trigger signal template matching mechanism can effectively avoid misjudgment caused by factors such as signal distortion and noise interference; on the other hand, by presetting the trigger output signal template, it can adapt to camera devices of different models and different interfaces, improving the compatibility of the system.

[0025] 3. By introducing light source parameters including light source type, light source brightness, duration and other parameters, a refined description and regulation of the lighting process is achieved. Based on the light source parameters, corresponding lighting signals can be generated for different target channels, and the signals can be accurately output to the light source control circuit of the channel, thereby achieving precise control of the light source brightness and lighting time. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flow chart of a multi-channel adaptive control method disclosed in an embodiment of the present application; Figure 2 It is a module schematic diagram of a multi-channel adaptive control device disclosed in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.

[0027] Explanation of the reference numerals: 201, determination module; 202, processing module; 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION

[0028] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0029] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0030] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0031] The present application provides a multi-channel adaptive control method, referring to Figure 1 , Figure 1 1 is a flow chart of a multi-channel adaptive control method provided in an embodiment of the present application. The method is applied to a controller, the controller includes multiple channels, and the controller is used to cooperate with a time-sharing stroboscopic camera and a conveyor belt system. The method includes steps S101 to S107, and the above steps are as follows: Step S101: Determine the current working mode, where the working mode includes a camera trigger control mode and other modes.

[0032] In step S101, the current working mode is determined, specifically including: obtaining an externally set working mode selection instruction, the working mode selection instruction is used to indicate the selection of a camera trigger control mode or other modes; if the working mode selection instruction is a first preset value, the current working mode is determined to be a camera trigger control mode; if the working mode selection instruction is a second preset value, the current working mode is determined to be other modes, and the first preset value and the second preset value are different numbers or characters.

[0033] Specifically, the controller can monitor the status of a physical switch or a digital input port. For example, a two-position toggle switch can be used. When the switch is in the first position, it indicates that the camera trigger control mode is selected; when the switch is in the second position, it indicates that other modes are selected. The controller can know the currently selected working mode by detecting the switch position. Another way is to receive the working mode selection instruction through a serial port or a network. The host computer or other device can send instructions in a specific format to the controller through a serial port or a network. The instructions contain specific values ​​or characters indicating the working mode. For example, it can be agreed that sending the character 'A' indicates selecting the camera trigger control mode, and sending the character 'B' indicates selecting other modes. After receiving the instruction, the controller parses the specific characters therein to determine the selected working mode.

[0034] After the controller obtains the working mode selection instruction, it needs to further determine the specific content of the instruction to determine the current working mode. Here, the first preset value and the second preset value are used to represent different working modes, and these two values ​​can be preset according to actual needs. For example, the first preset value can be the number 1, and the second preset value can be the number 2; or the first preset value is the character 'X', and the second preset value is the character 'Y', as long as the two values ​​are different.

[0035] If the working mode selection instruction is equal to the first preset value (such as the number 1 or the character 'X'), the controller determines the current working mode as the camera trigger control mode. In this mode, the controller will control the lighting of the channel according to the trigger signal of the camera to match the exposure time of the camera for image acquisition.

[0036] If the working mode selection instruction is equal to the second preset value (such as the number 2 or the character 'Y'), the controller determines the current working mode as other modes. In other modes, the controller controls the lighting of the channel according to the running speed of the conveyor belt to obtain images of different viewing angles.

[0037] Step S102: If it is determined that the working mode is the camera trigger control mode, it is determined whether the target channel detects a trigger output signal from the time-sharing stroboscopic camera, and the target channel is any one of the multiple channels.

[0038] In step S102, it is determined whether the target channel detects the trigger output signal from the time-sharing stroboscopic camera, specifically including: detecting the input signal of the target channel; comparing the input signal with a preset trigger output signal template; if it is determined that the input signal matches the preset trigger output signal template, it is determined that the target channel detects the trigger output signal from the time-sharing stroboscopic camera; if it is determined that the input signal does not match the preset trigger output signal template, it is determined that the target channel does not detect the trigger output signal from the time-sharing stroboscopic camera.

[0039] Specifically, if the controller determines that the current working mode is the camera trigger control mode, it further determines whether the target channel detects the trigger output signal from the time-sharing stroboscopic camera. The target channel here can be any one of the multiple channels in the controller. In order to determine whether the target channel receives the trigger signal, the controller performs the following operations: First, the controller needs to detect the input signal of the target channel. This step can be implemented by the hardware circuit of the controller, such as using a level comparator or ADC (analog-to-digital converter) to obtain the voltage signal on the target channel and convert it into a digital quantity for subsequent processing by the controller.

[0040] Next, the controller needs to compare the acquired input signal with the preset trigger output signal template. The preset trigger output signal template is stored in the controller's memory in advance, which defines the characteristics of the trigger signal, such as voltage range, duration, rising edge or falling edge, etc. The controller matches the actual detected input signal with the preset trigger output signal template to determine whether it is a valid trigger signal.

[0041] The matching method can vary depending on the type of trigger signal. For example, if the trigger signal is a square wave pulse with a fixed voltage for a period of time, the controller can record the voltage change of the input signal and determine whether it has lasted long enough within the preset voltage range. If the trigger signal is a rising or falling edge, the controller can detect the instantaneous voltage change of the input signal to determine whether there is an edge and whether the voltage change rate meets the requirements.

[0042] If the controller determines that the input signal matches the preset trigger output signal template, it can be considered that the target channel has detected a valid trigger output signal from the time-sharing strobe camera. This means that the camera has completed an exposure, and the controller needs to cooperate with the camera for subsequent image acquisition and processing operations. Conversely, if the input signal does not match the preset trigger output signal template, the controller believes that the target channel has not received a valid trigger signal.

[0043] For example, suppose the trigger output signal of a time-sharing strobe camera is a square wave pulse with a duration of 10 milliseconds and a voltage of 5V. The preset trigger output signal template of the controller can be defined as: voltage range 4.5V to 5.5V, duration greater than 9 milliseconds and less than 11 milliseconds. When the controller detects a pulse signal with a voltage of 5.1V and a duration of 9.8 milliseconds on the target channel, it can be determined that it matches the preset trigger output signal template and is a valid trigger signal.

[0044] In this way, the controller can reliably detect the trigger signal from the time-sharing stroboscopic camera and take corresponding control measures based on the detection results, thereby achieving precise synchronization and coordination with the camera. This is particularly important for high-speed, high-precision machine vision application scenarios, and can effectively improve the reliability and stability of the system.

[0045] Step S103: If it is determined that the target channel detects the trigger output signal from the time-sharing stroboscopic camera, the target channel is illuminated.

[0046] In step S103, lighting the target channel specifically includes: determining light source parameters corresponding to the target channel, the light source parameters including light source type, light source brightness and duration; generating a lighting signal corresponding to the target channel according to the light source parameters; and outputting the lighting signal to the light source corresponding to the target channel to light up the target channel.

[0047] Specifically, the controller determines the light source parameters corresponding to the target channel. The light source parameters include the light source type, light source brightness, and duration, which determine the effect and duration of the channel lighting. The light source type can be LED, flash, etc. Different types of light sources will differ in brightness, response speed, spectrum and other characteristics. The controller needs to select the appropriate driving mode and control strategy according to the actual light source type used. For example, for LED light sources, the controller can adjust its brightness through PWM (pulse width modulation); for flash lights, the controller needs to trigger the flash at the right time according to its discharge characteristics.

[0048] The brightness of the light source determines the light intensity when the channel is lit, which is closely related to the image quality. The controller sets the appropriate light source brightness value according to the specific application requirements and environmental conditions. For example, when shooting reflective objects, the light source brightness should not be too high to avoid overexposure; when shooting dark objects, the light source brightness needs to be increased to obtain a clear image. The controller can control the light source brightness by adjusting the power supply current or PWM duty cycle of the light source.

[0049] The duration determines how long the channel is lit, and it matches the camera's exposure time to get the ideal imaging effect. The controller needs to calculate the best duration value based on the camera's exposure parameters and the object's movement speed. For example, when the object moves faster, the duration needs to be shortened to avoid smearing; when the object moves slower, the duration can be appropriately extended to get a better exposure effect.

[0050] After determining the light source parameters, the controller generates a lighting signal corresponding to the target channel based on these parameters. The format and content of the lighting signal depend on the specific light source type and drive circuit used. For example, for an LED light source, the lighting signal can be a series of PWM waveforms, whose duty cycle determines the brightness of the light source and the duration determines the duration of the lighting; while for a flash light, the lighting signal can be a trigger pulse, whose width determines the duration of the flash. The controller synthesizes the corresponding lighting signal sequence based on the light source parameters.

[0051] Finally, the controller outputs the generated lighting signal to the light source corresponding to the target channel to realize the channel lighting. The specific output method depends on the connection method and interface type between the controller and the light source. For example, the controller can directly drive the LED through the digital IO port, or communicate with the intelligent LED controller through the RS485 bus, and the controller drives the LED according to the received lighting signal.

[0052] Step S104: controlling the time-sharing stroboscopic camera to photograph the object to be detected under the lit light source to obtain a first photo, so as to achieve image capture under optimal lighting conditions.

[0053] In step S104, the controller establishes a communication connection with the time-sharing stroboscopic camera and configures various parameters of the time-sharing stroboscopic camera. These parameters include exposure time, resolution, trigger mode, etc. After configuring the camera parameters, the controller triggers the time-sharing stroboscopic camera to shoot at an appropriate time according to the preset timing. Usually, the controller sends a trigger signal to the time-sharing stroboscopic camera after a short delay (such as a few microseconds) after the light source is turned on. This delay is to ensure that the light source has reached a stable light-emitting state to avoid the problem of uneven brightness during shooting. The duration of the trigger signal needs to match the exposure time of the camera to ensure the correct exposure of the image. After the time-sharing stroboscopic camera completes the exposure, it will transmit the collected image data to the controller.

[0054] Step S105: If the working mode is determined to be another mode, an encoder signal consistent with the running speed of the conveyor belt is generated.

[0055] In step S105, the controller obtains the real-time running speed of the conveyor belt. The running speed of the conveyor belt can be measured in many ways, such as using a speed sensor or an encoder. The speed sensor can directly output an analog quantity or a pulse signal proportional to the running speed. The controller can obtain the speed value of the conveyor belt by collecting and calculating these signals. The encoder converts the movement of the conveyor belt into a pulse signal. The controller can indirectly calculate the running speed of the conveyor belt by counting the number and frequency of pulses.

[0056] Suppose the controller uses an incremental encoder to measure the speed of the conveyor belt. The encoder is installed on the driving shaft of the conveyor belt and outputs a certain number of pulses for each rotation. The controller can calculate the linear speed of the conveyor belt by counting the number of pulses per unit time and combining it with the resolution of the encoder (number of pulses per revolution). For example, if the resolution of the encoder is 1000 pulses / revolution, and the controller counts 100 pulses in 100 milliseconds, the running speed of the conveyor belt is: running speed = (100 / 1000) / 0.1 = 1 rev / sec = 60 rev / min; Assuming that the circumference of the conveyor belt is 1 meter, its linear speed is: linear speed = 1 meter / rev × 1 rev / sec = 1 meter / sec; after obtaining the real-time speed of the conveyor belt, the controller needs to generate an encoder signal synchronized with the speed. The signal is usually a series of square wave pulses, and its frequency is proportional to the running speed of the conveyor belt. The frequency of the encoder signal can be obtained by multiplying the running speed of the conveyor belt by the proportional factor. The proportional factor can be pre-set according to actual needs, and this application does not limit this.

[0057] Step S106: Based on the encoder signal, multiple channels are sequentially lit up in a preset order.

[0058] In a possible implementation, before step S106, the method further includes: obtaining the running speed of the conveyor belt; adjusting the frequency of the encoder signal based on a preset frequency library and the running speed so that the frequency of the encoder signal is synchronized with the running speed of the conveyor belt, the preset frequency library including the corresponding relationship between the running speed and the frequency; using the adjusted encoder signal as a timing trigger signal to trigger lighting of multiple channels.

[0059] Specifically, the controller obtains the real-time running speed of the conveyor belt. Similar to the previous steps, the speed of the conveyor belt can be measured by speed sensors, encoders and other devices. The controller can obtain the current speed value of the conveyor belt by collecting and calculating the signals output by these devices. After obtaining the running speed of the conveyor belt, the controller adjusts the frequency of the encoder signal according to the running speed so that it is synchronized with the movement of the conveyor belt. Here, the controller can use a pre-established preset frequency library to quickly find the encoder signal frequency that matches the running speed.

[0060] The preset frequency library is actually a speed-frequency comparison table, which records the optimal encoder signal frequency corresponding to different conveyor belt speeds. The preset frequency library can be constructed by offline calibration. Specifically, the encoder signal frequency that can achieve the best synchronization effect can be tested and recorded at different conveyor belt speeds, and these speed-frequency pairs can be organized into a table or array and stored in the non-volatile memory of the controller.

[0061] After adjusting the encoder signal frequency, the controller uses the signal as a timing trigger signal to trigger the synchronous lighting of multiple channels. Specifically, the controller will trigger the light sources of each channel in turn to light up when the rising edge (or falling edge) of each encoder signal cycle arrives.

[0062] In step S106, based on the encoder signal, multiple channels are sequentially lit up in a preset order, specifically including: generating a lighting timing control signal for each channel according to the preset order; and outputting the lighting timing control signal to the corresponding channels respectively to control the lighting time and duration of each channel.

[0063] Specifically, the controller generates a lighting timing control signal for each channel according to a preset sequence. This signal is actually a series of pulse waveforms, which determines the lighting time and duration of the light source of each channel. When generating the lighting timing control signal, the controller refers to the period and phase of the encoder signal to ensure that the lighting of each channel is synchronized with the movement of the conveyor belt. The period of the lighting timing control signal is the same as the period of the encoder signal, and the lighting time of each channel corresponds to a specific phase of the encoder signal (such as the rising edge or the falling edge).

[0064] For example, suppose the controller controls the lighting of 4 channels (CH1~CH4), the preset lighting order is CH1→CH2→CH3→CH4, the light duration of each channel is 1 millisecond, and the lighting interval between channels is 0.5 milliseconds. Given the encoder signal frequency of 500Hz (cycle of 2 milliseconds), the controller can generate the following lighting timing control signal: CH1: It is triggered and lights up at 0 milliseconds (rising edge) of each encoder signal cycle, and lasts for 1 millisecond; CH2: Triggered and lit at 0.5 milliseconds of each encoder signal cycle, and lasts for 1 millisecond; CH3: Triggered and lit at 1 millisecond of each encoder signal cycle, and lasts for 1 millisecond; CH4: It is triggered and lights up at 1.5 milliseconds of each encoder signal cycle, and lasts for 1 millisecond.

[0065] These lighting timing control signals can be expressed in the form of digital levels, with a high level indicating that the light source is on and a low level indicating that the light source is off. The controller uses the on-chip timer / counter resources to generate the required waveform in real time according to the preset lighting time and duration. After generating the lighting timing control signals, the controller outputs these signals to the corresponding channels to control the actual lighting of the light sources of each channel. The controller will equip each channel with an independent output port, through which it outputs the lighting timing control signal to the channel's drive circuit (such as a MOS tube or relay). When the signal is high, the drive circuit is turned on and the light source is lit; when the signal is low, the drive circuit is turned off and the light source is off.

[0066] Step S107: When each channel is lit, the time-sharing stroboscopic camera is controlled to take corresponding photos to obtain a plurality of second photos with different visual features.

[0067] In step S107, the controller sends a shooting trigger signal to the time-sharing stroboscopic camera when the light source of each channel is turned on. The sending time of the shooting trigger signal needs to be synchronized with the output of the channel lighting timing control signal to ensure that the camera shoots at the moment the light source is turned on and captures a stable and clear image. The controller will generate a corresponding shooting trigger signal sequence while generating the lighting timing control signal. The duration of these trigger signals is very short (usually tens of microseconds) to ensure that the camera can complete exposure and image acquisition within the short time when the light source is turned on. Based on the above example, the controller can generate the following shooting trigger signal sequence: Trigger CH1 shooting at 0.1 milliseconds, with a duration of 50 microseconds; CH2 shooting is triggered at 0.6 milliseconds, and the duration is 50 microseconds; CH3 shooting is triggered at 1.1 milliseconds, and the duration is 50 microseconds; CH4 shooting is triggered at 1.6 milliseconds and lasts for 50 microseconds.

[0068] After step S107, the method further includes: determining whether each second photo meets the preset image quality requirement; if it is determined that there is a target photo that does not meet the preset image quality requirement, adjusting the lighting parameters of the channel corresponding to the target photo, the lighting parameters including one or more of the lighting brightness, the lighting angle and the lighting duration; based on the adjusted lighting parameters and the channel corresponding to the target photo, controlling the time-sharing strobe camera to retake the photo.

[0069] Specifically, the controller determines whether each second photo meets the preset image quality requirements. Image quality requirements include image brightness, contrast, and clarity indicators, which are used to measure whether the image is suitable for subsequent defect detection and identification processing. The controller can use a variety of image quality assessment algorithms, such as histogram analysis, edge detection, frequency domain analysis, etc., to judge the quality of each second photo. For example, the controller can calculate the average brightness and standard deviation of the image to determine whether it is within a preset brightness range and a preset standard deviation range; it can also extract the edge information of the image to evaluate its clarity and sharpness; it can also detect whether there are defects such as oversaturation, undersaturation, and noise in the image.

[0070] By comprehensively analyzing various quality indicators, the controller can derive a quality score for each second photo and compare it with a preset quality threshold. If a second photo's score is lower than the preset quality threshold, it will be marked as a target photo, indicating that its quality does not meet the requirements and needs to be optimized and retaken.

[0071] When the controller determines that there is a target photo, it will adjust the lighting parameters of the channel corresponding to the photo accordingly in order to obtain a higher quality image. The lighting parameters usually include the lighting brightness, lighting angle and lighting duration of the light source. For example, if the target photo is dark as a whole, it means that the light intensity is insufficient. The controller can appropriately increase the lighting brightness of the light source of the corresponding channel (such as increasing the working current of the LED); if some areas of the target photo are too bright while other areas are normal, it may be caused by an unreasonable light source angle. The controller can adjust the spatial position and light output direction of the light source; if the target photo is blurred as a whole, it may be caused by too long exposure time (too long light source lighting duration). The controller can shorten the lighting duration to obtain a clearer image.

[0072] After determining the lighting parameter adjustment strategy for the channel corresponding to the target photo, the controller converts these adjustment values ​​(such as brightness increment, angle change, duration reduction, etc.) into specific control instructions and sends them to the corresponding channel control circuit (such as LED driver, motor controller, etc.) to achieve real-time adjustment of the light source lighting parameters. After completing the lighting parameter adjustment, the controller controls the time-sharing stroboscopic camera to retake the target photo based on the adjusted lighting parameters.

[0073] Reference Figure 2The present application also provides a multi-channel adaptive control device, which is a controller. The controller includes a determination module 201 and a processing module 202, wherein: the determination module 201 is used to determine the current working mode, and the working mode includes a camera trigger control mode and other modes; the processing module 202 is used to determine whether the target channel detects a trigger output signal from a time-sharing stroboscopic camera if the working mode is determined to be the camera trigger control mode, and the target channel is any one of the multiple channels; the processing module 202 is also used to determine whether the target channel detects a trigger output signal from the time-sharing stroboscopic camera if the working mode is determined to be the camera trigger control mode. The processing module 202 is also used to control the time-sharing stroboscopic camera to shoot the object to be detected under the lit light source to obtain a first photo, so as to achieve image capture under optimal lighting conditions; the processing module 202 is also used to generate an encoder signal consistent with the running speed of the conveyor belt if the working mode is determined to be other modes; the processing module 202 is also used to light up multiple channels in sequence according to a preset order based on the encoder signal; the processing module 202 is also used to control the time-sharing stroboscopic camera to shoot corresponding photos when each channel is lit to obtain multiple second photos with different visual features.

[0074] In a possible implementation, the processing module 202 determines whether the target channel detects the trigger output signal from the time-sharing stroboscopic camera, specifically including: the processing module 202 detects the input signal of the target channel; the processing module 202 compares the input signal with a preset trigger output signal template; if the determination module 201 determines that the input signal matches the preset trigger output signal template, it is determined that the target channel detects the trigger output signal from the time-sharing stroboscopic camera; if the determination module 201 determines that the input signal does not match the preset trigger output signal template, it is determined that the target channel does not detect the trigger output signal from the time-sharing stroboscopic camera.

[0075] In a possible implementation, lighting up a target channel specifically includes: determining light source parameters corresponding to the target channel, the light source parameters including light source type, light source brightness, and duration; generating a lighting signal corresponding to the target channel according to the light source parameters; and outputting the lighting signal to the light source corresponding to the target channel to light up the target channel.

[0076] In a possible embodiment, before the processing module 202 sequentially lights up multiple channels in a preset order based on the encoder signal, the method also includes: the processing module 202 obtains the running speed of the conveyor belt; the processing module 202 adjusts the frequency of the encoder signal based on a preset frequency library and the running speed so that the frequency of the encoder signal is synchronized with the running speed of the conveyor belt, and the preset frequency library includes a corresponding relationship between the running speed and the frequency; the processing module 202 uses the adjusted encoder signal as a timing trigger signal to trigger the lighting of multiple channels.

[0077] In a possible implementation, the determination module 201 determines the current working mode, specifically including: the processing module 202 obtains an externally set working mode selection instruction, the working mode selection instruction is used to indicate the selection of a camera trigger control mode or other modes; if the working mode selection instruction is a first preset value, the determination module 201 determines the current working mode as a camera trigger control mode; if the working mode selection instruction is a second preset value, the determination module 201 determines the current working mode as other modes, and the first preset value and the second preset value are different numbers or characters.

[0078] In a possible implementation, after the processing module 202 controls the time-sharing stroboscopic camera to take corresponding photos when each channel is illuminated, and obtains multiple second photos with different visual features, the method further includes: the processing module 202 determines whether each second photo meets the preset image quality requirements; if it is determined that there is a target photo that does not meet the preset image quality requirements, the processing module 202 adjusts the lighting parameters of the channel corresponding to the target photo, and the lighting parameters include one or more of the lighting brightness, the lighting angle, and the lighting duration; the processing module 202 controls the time-sharing stroboscopic camera to retake the photo based on the adjusted lighting parameters and the channel corresponding to the target photo.

[0079] In a possible implementation, the processing module 202 sequentially lights up multiple channels in a preset order based on the encoder signal, specifically including: the processing module 202 generates a lighting timing control signal for each channel according to the preset order; the processing module 202 outputs the lighting timing control signal to the corresponding channels respectively to control the lighting time and duration of each channel.

[0080] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0081] The present application also provides an electronic device. Figure 3 , Figure 3 The electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .

[0082] The communication bus 302 is used to realize the connection and communication between these components.

[0083] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0084] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0085] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.

[0086] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally also be at least one storage device located away from the aforementioned processor 301. Refer to Figure 3, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of a multi-channel adaptive control method.

[0087] exist Figure 3 In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call the application program storing a multi-channel adaptive control method in the memory 305, and when executed by one or more processors 301, the electronic device 300 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0088] The present application also provides a computer-readable storage medium, which stores instructions. When executed by one or more processors 301, the electronic device 300 executes one or more of the methods described in the above embodiments.

[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0090] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0091] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0092] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0094] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.

[0095] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A multi-channel adaptive control method, characterized in that: The method is applied to a controller, the controller comprising a plurality of channels, the controller being used to cooperate with a time-sharing stroboscopic camera and a conveyor belt system, the method comprising: Determine a current working mode, where the working mode includes a camera trigger control mode and other modes; If it is determined that the working mode is the camera trigger control mode, determining whether a target channel detects a trigger output signal from the time-sharing stroboscopic camera, the target channel being any one of the multiple channels; If it is determined that the target channel detects the trigger output signal from the time-sharing stroboscopic camera, then lighting up the target channel; Controlling the time-sharing stroboscopic camera to photograph the object to be detected under the lit light source to obtain a first photo, so as to achieve image capture under optimal lighting conditions; If it is determined that the working mode is another mode, an encoder signal consistent with the running speed of the conveyor belt is generated; Based on the encoder signal, lighting up the plurality of channels in sequence according to a preset order; When each of the channels is lit, the time-sharing stroboscopic camera is controlled to take corresponding photos, thereby obtaining a plurality of second photos with different visual features.

2. The method according to claim 1, characterized in that The step of determining whether the target channel detects a trigger output signal from the time-sharing stroboscopic camera specifically includes: Detecting an input signal of the target channel; Comparing the input signal with a preset trigger output signal template; If it is determined that the input signal matches the preset trigger output signal template, it is determined that the target channel detects the trigger output signal from the time-sharing stroboscopic camera; If it is determined that the input signal does not match the preset trigger output signal template, it is determined that the target channel does not detect the trigger output signal from the time-sharing stroboscopic camera.

3. The method according to claim 1, characterized in that The lighting up the target channel specifically includes: Determine light source parameters corresponding to the target channel, the light source parameters including light source type, light source brightness and duration; According to the light source parameters, generating a lighting signal corresponding to the target channel; The lighting signal is output to the light source corresponding to the target channel to light up the target channel.

4. The method according to claim 1, characterized in that: Before sequentially lighting up the plurality of channels according to a preset order based on the encoder signal, the method further includes: Get the running speed of the conveyor belt; Based on a preset frequency library and the running speed, adjusting the frequency of the encoder signal so that the frequency of the encoder signal is synchronized with the running speed of the conveyor belt, wherein the preset frequency library includes a corresponding relationship between the running speed and the frequency; The adjusted encoder signal is used as a timing trigger signal to trigger lighting of the plurality of channels.

5. The method according to claim 1, characterized in that Determining the current working mode specifically includes: Acquire an externally set working mode selection instruction, where the working mode selection instruction is used to instruct selection of the camera trigger control mode or the other mode; If the working mode selection instruction is the first preset value, the current working mode is determined as the camera trigger control mode; If the working mode selection instruction is a second preset value, the current working mode is determined to be the other mode, and the first preset value and the second preset value are different numbers or characters.

6. The method according to claim 1, characterized in that After controlling the time-sharing stroboscopic camera to take corresponding photos when each channel is illuminated to obtain a plurality of second photos with different visual features, the method further includes: Determining whether each of the second photos meets a preset image quality requirement; If it is determined that there is a target photo that does not meet the preset image quality requirement, adjusting the lighting parameters of the channel corresponding to the target photo, the lighting parameters including one or more of lighting brightness, lighting angle, and lighting duration; Based on the adjusted lighting parameters and the channel corresponding to the target photo, the time-sharing stroboscopic camera is controlled to retake the photo.

7. The method according to claim 1, characterized in that The step of sequentially lighting up the plurality of channels according to a preset order based on the encoder signal specifically includes: According to the preset sequence, a lighting timing control signal of each channel is generated; The lighting timing control signals are output to the corresponding channels respectively to control the lighting time and duration of each channel.

8. A multi-channel adaptive control device, characterized in that: The device comprises a determination module (201) and a processing module (202), wherein: The determination module (201) is used to determine the current working mode, wherein the working mode includes a camera trigger control mode and other modes; The processing module (202) is used to determine whether a target channel detects a trigger output signal from the time-sharing stroboscopic camera if it is determined that the working mode is a camera trigger control mode, and the target channel is any one of the multiple channels; The processing module (202) is further configured to light up the target channel if it is determined that the target channel detects a trigger output signal from the time-sharing stroboscopic camera; The processing module (202) is further used to control the time-sharing stroboscopic camera to photograph the object to be detected under the lit light source to obtain a first photo, so as to achieve image capture under optimal lighting conditions; The processing module (202) is further configured to generate an encoder signal consistent with the running speed of the conveyor belt if it is determined that the working mode is another mode; The processing module (202) is further used to sequentially light up the plurality of channels in a preset order based on the encoder signal; The processing module (202) is further used to control the time-sharing stroboscopic camera to take corresponding photos when each channel is lit, so as to obtain a plurality of second photos with different visual features.

9. An electronic device, characterized in that: The electronic device (300) comprises a processor (301), a memory (305), a user interface (303) and a network interface (304), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device (300) executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is performed.

Citation Information

Cited By

  • Peripheral signal control method of visual inspection system

    CN121300203A

  • Channel matching method based on industrial visual control system

    CN121531243A

  • Machine vision light source dynamic adjustment method and system

    CN121600234A