A visual inspection system based on a light source control all-in-one machine
Patent Information
- Application Number
- CN202611208407.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-16
AI Technical Summary
在高速流水线场景下,该延迟会导致光源点亮时刻与相机曝光窗口不同步,使得采集图像出现亮度波动或拖影,最终致使微小缺陷(如划痕、异物、镀层不均)的特征对比度下降甚至湮没,直接影响缺陷识别算法的准确率与检出率,造成漏检或误判风险显著上升
通过提供一种基于光源控制一体机的视觉检测系统,光源控制一体机包括主板、IO功能扩展层与光源控制层,主板层、IO功能扩展层、光源控制层之间通过板对板连接器实现电气导通;主板层搭载工控主板,光源控制层集成有光源控制器;工控主板向光源控制器下发控制指令,由光源控制器驱动多光谱光源单元的各波段光源向生产线上输送的工件发射不同波长的照明光;成像单元接入IO功能扩展层的图像采集接口,用于采集不同波长照明下的工件图像并生成不同波长对应的工件图像;
Smart Images

Figure CN122922071A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of visual inspection technology, and in particular relates to a visual inspection system based on a light source control integrated machine. Background Technology
[0002] Currently, most mainstream vision inspection systems adopt a separate architecture, consisting of an independent industrial computer and an external light source controller connected via cables such as network cables and serial cables. This architecture has the following inherent drawbacks: First, the hardware deployment cost is high. External controllers require independent chassis, power supplies and wiring terminals, which not only increases material costs, but also occupies additional space for control cabinet rail mounting and wiring, resulting in low overall system integration and making it unsuitable for deploying compact equipment.
[0003] Secondly, limited real-time control performance severely impacts defect detection accuracy. Brightness adjustment and trigger commands rely on data packet relay transmission via a communication bus, a process with uncertain communication delays ranging from microseconds to milliseconds. In high-speed production line scenarios, this delay can cause the light source's illumination time to be out of sync with the camera's exposure window, resulting in brightness fluctuations or ghosting in the acquired image. Ultimately, this leads to a decrease or even obliteration of the feature contrast of minute defects (such as scratches, foreign objects, and uneven coatings), directly affecting the accuracy and detection rate of defect recognition algorithms and significantly increasing the risk of missed detections or misjudgments. Summary of the Invention
[0004] This application provides a vision inspection system based on an integrated light source control unit, which can improve the hardware integration and real-time control performance of the vision inspection system, thereby meeting the needs of high-speed and high-precision industrial defect detection.
[0005] This application provides a vision inspection system based on an integrated light source control unit, including an integrated light source control unit, an imaging unit, and a multispectral light source device; the integrated light source control unit includes a motherboard layer, an I / O function expansion layer, and a light source control layer, and the motherboard layer, the I / O function expansion layer, and the light source control layer are electrically connected through board-to-board connections; the motherboard layer is equipped with an industrial control motherboard, and the light source control layer integrates a light source controller; The industrial control motherboard sends an image acquisition command to the light source controller, which then drives the multispectral light source device to emit different wavelengths of illumination light onto the workpieces being transported on the production line. The imaging unit is connected to the image acquisition interface of the IO function extension layer, which is used to acquire workpiece images under different wavelength illumination and generate workpiece images corresponding to different wavelengths. The workpiece images corresponding to different wavelengths are transmitted back to the industrial control motherboard through the image acquisition interface. The industrial control motherboard is used to perform pixel-level registration of workpiece images corresponding to different wavelengths to obtain a registered multispectral image. Non-subsampled shear wave transform decomposition is then performed on each wavelength image in the registered multispectral image to obtain low-frequency sub-bands and multiple high-frequency sub-bands corresponding to each wavelength image. The low-frequency and high-frequency sub-bands decomposed from the multi-wavelength image are fused to output a fused image. The fused image is then processed by a dual-path feature extraction network to extract spatial and spectral features. A feature fusion module fuses the spatial and spectral features to obtain fused features. The fused features are then processed by a multi-scale convolutional neural network to extract multi-size defect features, and the defect category, location, and confidence level are output through the detection head.
[0006] Optionally, the integrated light source has a built-in global synchronous clock source, which is connected to the industrial control motherboard, the light source controller and the image acquisition interface through in-board wiring, so that the triggering sequence of light source lighting and imaging unit exposure is executed synchronously based on the same clock reference.
[0007] Optionally, the light source controller integrates multiple light source driving channels, and each light source driving channel is connected to each wavelength light source of the multispectral light source device in a one-to-one correspondence; When the industrial control motherboard is powered on and initialized or when the preset calibration trigger conditions are met, it triggers the light source controller to enter the parameter self-calibration mode. In parameter self-calibration mode, the light source controller drives each wavelength light source to light up one channel at a time, and at the same time samples and feeds back the light intensity signal of each light source driving channel in real time through the built-in photoelectric feedback circuit. The industrial control motherboard compares the light intensity signal fed back by each light source driving channel with the preset target light intensity threshold, and records the time consumed from the issuance of the lighting command to the attainment of the target light intensity threshold, defining it as the rise time of the corresponding wavelength light source. The industrial control motherboard calculates the target pre-trigger stabilization delay corresponding to each wavelength light source based on the rise time of each wavelength light source and in combination with a preset safety margin, and saves the target pre-trigger stabilization delay of each wavelength light source to the hardware timing register of the light source controller. During the formal image acquisition process, the light source controller responds to the image acquisition command and starts the hardware timing logic. The hardware timing logic executes the time-division lighting sequence of multiple wavelength light sources based on the pre-stored target trigger stabilization delay of each wavelength light source. The switching interval between adjacent wavelengths includes the target trigger stabilization delay and the preset switching dead time.
[0008] Optionally, the industrial control motherboard also receives test images of each wavelength acquired by the light source controller in parameter self-calibration mode; The industrial control motherboard analyzes the contrast and signal-to-noise ratio of the test images at each wavelength, and obtains the imaging score of each wavelength light source based on the contrast and signal-to-noise ratio. The lighting priority of each wavelength light source is set based on the imaging score of each wavelength light source, and the lighting priority of each wavelength light source is saved to the light source controller. During the formal image acquisition process, the light source controller responds to the image acquisition command and sequentially executes the time-division lighting of multiple wavelength light sources according to the lighting priority of each wavelength light source.
[0009] Optionally, the setting of the lighting priority for each wavelength light source based on the imaging score of each wavelength light source includes: Obtain the importance score pre-configured for each wavelength light source. The importance score for different wavelength light source configurations is determined based on the category of the work to be inspected and the inspection target. The lighting priority of each wavelength light source is determined based on its importance score, imaging score, and rise time.
[0010] Optionally, the step of fusing the low-frequency sub-bands and high-frequency sub-bands decomposed from the multi-wavelength image to output a fused image includes: Calculate the sum of the absolute values of the differences between the reference pixel and all other pixels in the image at each wavelength, and normalize the sum of the absolute values of the differences to obtain the difference value of the reference pixel in the image at each wavelength. The fusion weights of the low-frequency sub-bands of each wavelength image are determined based on the difference values, and the low-frequency sub-bands of multiple different wavelength images are fused based on the fusion weights to obtain a low-frequency fused image. The high-frequency subbands of multiple images with different wavelengths are fused using a parameter-adaptive pulse-coupled neural network to obtain a high-frequency fused image; The high-frequency fused image and the low-frequency fused image are reconstructed by inverse non-subsampled shear wave transform to obtain the fused image.
[0011] Optionally, determining the fusion weights of the low-frequency sub-bands of each wavelength image based on the difference value includes: The fusion weights of the low-frequency subbands of the i-th wavelength image are calculated using the following formula: ; in, Let be the fusion weight of the low-frequency subband of the i-th wavelength image. Let i be the difference value of the image at wavelength i. To prevent outliers.
[0012] Optionally, the step of extracting spatial and spectral features from the fused image using a dual-path feature extraction network includes: The fused image is input into the spatial and spectral branches of the dual-path feature extraction network for parallel processing to obtain spatial and spectral features; The spatial branch is embedded with a spatial attention module to adaptively reconstruct the original spatial feature map extracted by the spatial branch in the spatial dimension, and the spectral branch is embedded with a spectral attention module to adaptively reconstruct the original spectral feature map extracted by the spectral branch in the spectral dimension.
[0013] Optionally, the multispectral light source device includes at least two light sources of different wavelengths, which are selected from any combination of the visible light band, near-infrared band, and ultraviolet band.
[0014] The vision inspection system based on a light source control integrated machine provided in this application has at least the following beneficial effects: This invention provides a vision inspection system based on an integrated light source control unit. The integrated light source control unit includes a motherboard, an I / O function expansion layer, and a light source control layer. The motherboard, I / O function expansion layer, and light source control layer are electrically connected via board-to-board connectors. The motherboard is equipped with an industrial control motherboard, and the light source control layer integrates a light source controller. The industrial control motherboard sends control commands to the light source controller, which drives the multispectral light source unit to emit illumination light of different wavelengths onto the workpieces being transported on the production line. The imaging unit is connected to the image acquisition interface of the I / O function expansion layer to acquire workpiece images under different wavelength illumination and generate workpiece images corresponding to different wavelengths. The industrial control motherboard is used to perform pixel-level registration of images corresponding to different wavelengths to obtain registered multispectral images. Non-subsampled shear wave transform decomposition is performed on each registered spectral image to obtain corresponding low-frequency subbands and multiple high-frequency subbands. Based on the subband differences, the different subbands are fused to output a fused image. The fused image is then passed through a spectral attention module and a spatial attention module to adaptively enhance defect features from both channel and spatial dimensions, forming a multi-scale fused feature map. Finally, the map is sent to the detection head network to output the defect detection results on the workpiece surface.
[0015] In the above solution, the integrated light source control unit adopts an on-board hardware direct connection and a globally consistent clock design, enabling sub-microsecond-level light source channel switching and nanosecond-level timing jitter. The acquisition time for a single group of multi-wavelength images is only a few milliseconds. Based on this hardware characteristic, the system can achieve high-speed online visual inspection of workpieces on the production line. Combined with the defect detection module's multi-spectral dimension feature extraction and comparison, it can accurately locate defect-sensitive wavelengths and defect areas, ultimately achieving high-precision, low-false-detection workpiece surface defect detection. Attached Figure Description
[0016] Figure 1 This application provides a vision inspection system based on an integrated light source control unit. Figure 2 This is a hardware connection architecture diagram of the integrated light source control unit provided in the embodiments of this application. Detailed Implementation
[0017] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.
[0018] Please see Figure 1 , Figure 1 This is a structural block diagram of a vision inspection system based on a light source control integrated machine, as provided in an embodiment of this application. Figure 1 As shown, the vision inspection system based on the integrated light source control unit includes the integrated light source control unit 1, the imaging unit 3, and the multispectral light source device 2.
[0019] The integrated light source control unit includes a motherboard layer, an IO function expansion layer, and a light source control layer. The motherboard layer, IO function expansion layer, and light source control layer are electrically connected through board-to-board connections. The motherboard layer is equipped with an industrial control motherboard, and the light source control layer integrates a light source controller. The industrial control motherboard sends image acquisition commands to the light source controller, which then drives the multispectral light source device to emit different wavelengths of illumination light onto the workpieces being transported on the production line. The imaging unit connects to the image acquisition interface of the IO function extension layer to acquire workpiece images under different wavelength illumination and generate workpiece images corresponding to different wavelengths. The workpiece images corresponding to different wavelengths are transmitted back to the industrial control motherboard through the image acquisition interface. The industrial control motherboard is used to perform pixel-level registration of workpiece images corresponding to different wavelengths to obtain a registered multispectral image. Non-subsampled shear wave transform decomposition is then performed on each wavelength image in the registered multispectral image to obtain low-frequency sub-bands and multiple high-frequency sub-bands corresponding to each wavelength image. The low-frequency and high-frequency sub-bands decomposed from the multi-wavelength image are fused to output a fused image. The fused image is then processed by a dual-path feature extraction network to extract spatial and spectral features. A feature fusion module then fuses the spatial and spectral features to obtain fused features. These fused features are then processed by a multi-scale convolutional neural network to extract multi-size defect features, and the defect category, location, and confidence level are output through the detection head.
[0020] This application integrates the traditionally separate industrial control computer and light source controller into one unit, eliminating the need for a separate controller chassis. The light source controller is connected to the industrial control motherboard expansion interface in the form of a board, significantly saving installation space within the cabinet and resulting in a simpler control cabinet layout. This offers significant advantages for small, compact equipment. Simultaneously, the entire unit shares power supply, chassis, and heat dissipation resources, eliminating redundant materials such as separate casings and power supplies. This significantly reduces the material cost per unit, making it cost-effective for bulk shipments. Externally, only the light source cable needs to be directly connected to the industrial control computer's backplane, eliminating the need for communication cables and separate power supply lines between the industrial control computer and the controller. This shortens wiring time, reduces the number of connectors, and lowers the risk of poor contact failures.
[0021] Furthermore, the light source controller is directly connected to the industrial control internal bus via the onboard bus. Brightness adjustment, strobe triggering, and camera acquisition share the same industrial control clock reference, resulting in extremely low synchronization delay. This enables higher precision high-speed strobe and high-speed visual detection synchronization control. All control units are integrated into a single industrial control chassis, resulting in a high degree of standardization. The entire unit supports unified power-on / power-off and can be managed uniformly through the industrial control system, eliminating the need for separate air switches for external controllers and simplifying power distribution design and maintenance processes.
[0022] Specifically, the motherboard layer, functional expansion I / O layer, and light source control layer are arranged sequentially from top to bottom. The light source controller is located at the bottom of the unit, the I / O functional expansion layer is in the middle, and the industrial control motherboard is located at the top, connected via high-speed BTB terminals. The motherboard uses a one-piece heat dissipation design and is encased in a sheet metal casing. The motherboard and the light source controller communicate via COM signals.
[0023] Please see Figure 2 , Figure 2 This is a hardware connection architecture diagram of the integrated light source control machine provided in this application embodiment. The industrial control motherboard serves as the core control hub of the entire machine, housing core computing components such as the CPU and chipset. It centrally manages all system functions, including computing, communication, and light source control, and is the control core for all peripherals and modules. The industrial control motherboard is electrically connected to the power board, which performs voltage conversion of the input power, providing a stable and compatible operating voltage for the industrial control motherboard and all functional modules of the machine.
[0024] The industrial motherboard also includes electrical connections to an M.2 PCIe 3.0 x4 (SSD), two SODIMM DDR4 modules, an RS232 serial port, an HDMI port, a VGA port, six USB 3.0 ports, and a PCIe x16 expansion slot. M.2 PCIe 3.0 X4 (SSD) provides high-speed solid-state storage for the entire system, used to store the operating system, algorithm programs and test data; SODIMM DDR4*2 are dual-channel miniaturized memory slots that provide temporary data storage space for system operation and visual algorithm calculations. The RS232 serial port is used to connect to industrial peripherals and realize equipment debugging and low-speed serial communication. The HDMI and VGA interfaces are video output interfaces used to connect external display devices and output test images and operation interfaces. The six USB 3.0 ports are used to connect high-speed peripherals, industrial cameras and other devices to meet the needs of high-speed data transmission; The PCIe x16 expansion slot is a high-speed expansion slot that can connect external image acquisition cards, accelerator cards and other functional cards to expand the functional boundaries of the entire machine.
[0025] The industrial control motherboard and the I / O expansion board are electrically connected via onboard links. The I / O expansion board serves as an intermediate layer for interface expansion, receiving bus signals from the industrial control motherboard and expanding to various peripheral interfaces. The I / O expansion board is electrically connected to an audio module, serial (232 / 485), six RJ45 network cards, and a SATA 3.0 interface. It also extends downwards to connect to a 5G module, a WIFI module, an mSATA storage interface, two USB 2.0 interfaces, and a USB 3.0 interface. The Audio module enables the audio input and output functions of the entire device; The serial port (232 / 485) supports dual-standard serial communication of RS232 and RS485, adapting to the different bus device access requirements in industrial fields; The 6-channel RJ45 network card provides the whole machine with multi-channel wired Ethernet communication capability, and can simultaneously connect multiple industrial cameras and on-site industrial networks. The SATA3.0 interface is used to connect storage devices such as 2.5-inch hard drives to expand the overall storage capacity of the machine; The 5G module and the WIFI module provide fifth-generation cellular mobile network and wireless local area network access capabilities, respectively, which are suitable for outdoor and mobile application scenarios without wired networks. The mSATA interface is a miniaturized serial storage interface used to install mini solid-state drives, enabling large-capacity storage expansion in a small size. The addition of two USB 2.0 ports and a USB 3.0 port further enriches the peripheral access resources of the device, adapting to external devices with different bandwidth requirements.
[0026] The IO function expansion board is also bidirectionally electrically connected to the light source controller, which is the core of the light source drive control of the whole machine. It outputs drive signals of corresponding specifications based on control commands and collects feedback status. The light source controller is bidirectionally connected to the GPIO module, which realizes the interaction of general input and output signals, and is used to receive external trigger signals and output control commands. The drive output terminal of the light source controller is electrically connected to the light source to drive the light source to light up and precisely adjust the brightness, flicker frequency and trigger timing of the light source to provide stable lighting conditions for visual inspection scenarios.
[0027] The integrated light source unit has a built-in global synchronous clock source, which is connected to the motherboard, light source controller and image acquisition interface through on-board wiring. This ensures that the triggering sequence of light source lighting and imaging unit exposure is executed synchronously based on the same clock reference, thereby achieving real-time control and reducing the risk of missed detection or misjudgment.
[0028] The industrial control motherboard sends image acquisition commands to the light source controller, enabling the multispectral light source device to emit different wavelengths of illumination light onto the workpieces being transported on the production line at different times. The multispectral light source device contains at least two different wavelengths of light, selected from any combination of visible light, near-infrared light, and ultraviolet light bands.
[0029] The optical characteristics of different wavelengths determine their varying responses to different types of defects: visible light is sensitive to surface scratches, dirt, and other apparent defects; near-infrared light has strong material penetration and can be used to detect latent defects such as internal cracks, bubbles, or delamination in workpieces; ultraviolet light is extremely sensitive to corona discharge phenomena on the surface of high-voltage equipment and is often used for early fault diagnosis of power equipment. Therefore, based on the type of workpiece to be inspected and the inspection target, a matching combination of wavelengths can be adaptively selected for detection, thereby obtaining multiple workpiece images reflecting different defect characteristics and transmitting them back to the industrial control motherboard for processing, effectively improving the coverage and accuracy of defect identification.
[0030] Alternatively, considering that chips for different wavelength light sources use different semiconductor materials (e.g., AlGaInP is commonly used for red light, while InGaN is commonly used for green / blue / ultraviolet light), their electro-optical conversion efficiency, thermal characteristics, and response speed have inherent physical differences. Even when the same driving current is applied, the current settling time required to reach a stable light intensity varies for different wavelength bands, and the junction temperature rise rate also differs, causing the rise edge characteristics to drift over time. Therefore, a fixed-delay control method cannot guarantee optimal timing under all operating conditions.
[0031] Therefore, in this embodiment of the application, the industrial control motherboard also has a built-in power-on timing detection algorithm, the specific implementation logic of which is as follows: When the industrial control motherboard initializes the system upon power-up or when the preset calibration trigger conditions are met, it triggers the light source controller to enter the parameter self-calibration mode. In parameter self-calibration mode, the light source controller drives each wavelength light source to light up one channel at a time, and at the same time samples and feeds back the light intensity signal of each light source driving channel in real time through the built-in photoelectric feedback circuit. The industrial control motherboard compares the light intensity signal fed back from each light source drive channel with the preset target light intensity threshold, and records the time consumed from the issuance of the lighting command to the attainment of the target light intensity threshold, defining it as the rise time of the corresponding wavelength light source. Based on the rise time of each wavelength light source and combined with the preset safety margin, the industrial control motherboard calculates the target trigger pre-stress delay corresponding to each wavelength light source and saves the target trigger pre-stress delay of each wavelength light source to the hardware timing register of the light source controller. During the formal image acquisition process, the light source controller responds to the image acquisition command and starts the hardware timing logic. The hardware timing logic executes the time-division lighting sequence of multiple wavelength light sources based on the pre-stored target trigger stabilization delay of each wavelength light source. The switching interval between adjacent wavelengths includes the target trigger stabilization delay and the preset switching dead time.
[0032] As an example, the calibration trigger condition can be a preset trigger cycle, such as triggering a calibration once after 2000 cumulative detections to update the rise time of each wavelength light source and recalculate the target pre-trigger stabilization delay, thereby compensating for timing deviations caused by temperature drift or device aging.
[0033] The preset target light intensity threshold can be set to 90% to 95% of the rated stable light intensity value of the corresponding wavelength light source. This ensures that the LED light intensity has entered the stable linear region during subsequent imaging, thus ensuring image brightness consistency. It also avoids introducing excessively long waiting time due to the pursuit of infinitely approaching the steady state, thereby balancing imaging quality and detection efficiency.
[0034] In practice, each wavelength light source can undergo multiple lighting tests, and the average value of the multiple measured rise times is taken to suppress random noise and measurement fluctuations, so as to obtain the stable rise time of the light source of that wavelength, that is, the light response time of that wavelength.
[0035] To further ensure the stability of light intensity, the rise time can be added to a preset safety margin to obtain the stabilization delay before target triggering. The safety margin is a very small value used to handle minor characteristic drift caused by factors such as temperature fluctuations and device aging, preventing the light intensity from being unstable at the moment of triggering due to a slight increase in rise time. This stabilization delay before target triggering is the time required to wait after the corresponding wavelength light source is lit and before the camera exposure; essentially, it is a safety delay value slightly longer than the physical rise time. The industrial control motherboard saves this stabilization delay before target triggering to the hardware timing register of the light source controller for direct retrieval during subsequent formal data acquisition.
[0036] During the actual image acquisition process, the light source controller responds to the image acquisition command issued by the industrial control motherboard and initiates its built-in hardware timing logic. Based on the pre-programmed stable delay before the triggering of each wavelength light source target, this logic automatically and without interruption executes the time-division lighting sequence of multiple wavelength light sources.
[0037] The switching interval between adjacent wavelengths includes two independent parameters: illumination stabilization delay and preset switching dead time. The illumination stabilization delay is determined by the aforementioned target triggering stabilization delay, which is used to ensure that the light intensity of the current wavelength reaches stability before camera exposure; the dead time is used to wait for the LED afterglow to completely disappear, avoiding spectral crosstalk between the previous light source and the next wavelength.
[0038] Compared to traditional control methods that rely on fixed parameters or software delay cycles, this application's embodiments combine the real physical characteristics of light sources of different wavelengths to dynamically calculate the minimum stable delay required for each channel. Under the premise of ensuring stable light intensity, the dead time is compressed to the extreme, thereby improving the detection frame rate. At the same time, through a periodic self-calibration mechanism, the characteristics of the light source due to temperature drift and aging are tracked in a closed loop, ensuring that the device always maintains the optimal timing during long-term operation without manual intervention.
[0039] Optionally, the industrial control motherboard also incorporates a wavelength illumination sequence analysis algorithm, prioritizing the illumination of the wavelength with the best imaging effect in the current detection scenario. This ensures that key features are acquired first, thus enabling the acquisition of the most information-rich image even in extreme cases (such as when the detection time window is compressed). Specifically, the implementation logic of the wavelength illumination sequence analysis algorithm includes: The industrial control motherboard also receives test images of various wavelengths acquired by the light source controller in parameter self-calibration mode; The industrial control motherboard analyzes the contrast and signal-to-noise ratio of test images at each wavelength, and obtains the imaging score of each wavelength light source based on the contrast and signal-to-noise ratio. The lighting priority of each wavelength light source is set based on the imaging score of each wavelength light source, and the lighting priority of each wavelength light source is saved to the light source controller. During the formal image acquisition process, the light source controller responds to the image acquisition command and executes the time-division lighting sequence of multiple light sources according to the lighting priority of each wavelength light source.
[0040] Specifically, the industrial control motherboard can normalize the contrast and signal-to-noise ratio of the test images for each wavelength and then calculate the average or weighted sum of the two to obtain the imaging score for each wavelength light source. Then, based on the imaging score of each wavelength light source, the lighting priority for each wavelength light source is set. Wavelength light sources with higher imaging scores have higher lighting priority and are lit first.
[0041] Optionally, the system can further integrate detection scenario requirements and detection efficiency based on the above image quality scoring to comprehensively optimize the lighting priority: Obtain the importance score pre-configured for each wavelength light source. The importance score for different wavelength light source configurations is determined based on the category of the work to be inspected and the inspection target. The lighting priority of each wavelength light source is determined based on its importance score, imaging score, and rise time.
[0042] The importance score of the wavelength light source varies depending on the type of work to be inspected and the target of inspection. For example, when inspecting internal cracks, near-infrared light (with strong penetrating power) has the highest importance score; when inspecting surface scratches, blue light (sensitive to surface morphology) has the highest importance score.
[0043] The mapping relationship between workpiece category and inspection target to importance score is pre-configured in the system, and the importance score can be an integer value between 0 and 5.
[0044] Then, the importance score, imaging score, and rise time of each wavelength light source are normalized, and the comprehensive illumination score of each wavelength is calculated by weighted summation. The weighting coefficients can be flexibly adjusted according to actual needs. For example, when the current preference is for detection quality, the weight of the importance score and imaging score can be increased, and when the current preference is for detection speed, the weight of the rise time can be increased.
[0045] Finally, the wavelength light source with the highest overall lighting score is given the highest lighting priority, and they are arranged in order to form the final lighting sequence.
[0046] The light source controller drives different wavelength light sources to light up based on this lighting sequence, generating workpiece images of different wavelengths.
[0047] Based on the final determined light source illumination priority, the system sorts the illumination order of wavelength light sources and retrieves the pre-stored target trigger stabilization delay for each channel from the register according to this order, constructing a timing array arranged in execution order, which is then sent to the FPGA cache of the light source controller. The light source controller drives different wavelength light sources to illuminate sequentially according to the order of this array, generating workpiece images at different wavelengths and sending them back to the industrial control motherboard for processing.
[0048] After receiving multiple workpiece images at different wavelengths, the industrial control motherboard calls its built-in defect detection algorithm to identify defects in the workpiece. Specifically, due to the differences in the optical paths of light sources of different wavelengths, there are translational, rotational, or scale distortions between the original images. The industrial control motherboard first performs registration on the multiple workpiece images at different wavelengths. Registration can use the FAST-9 corner detection algorithm and the improved ORB (Oriented FAST and Rotated BRIEF) algorithm, depending on the detection accuracy.
[0049] Then, non-subsampled shearlet transform (NSST) decomposes each wavelength image in the registered multispectral image to obtain the low-frequency subband and multiple high-frequency subbands corresponding to each wavelength image. The low-frequency subband reflects the image contour, while the high-frequency subband reflects the details. The low-frequency subband and high-frequency subband are then fused to output a fused image.
[0050] Optionally, the low-frequency sub-bands and high-frequency sub-bands decomposed from the multi-wavelength image are fused to output a fused image, including: Calculate the sum of the differences in grayscale values between the reference pixel and all other pixels in the image at each wavelength, and normalize the sum to obtain the difference value of the reference pixel in the image at each wavelength. The fusion weights of the low-frequency sub-bands of each wavelength image are determined based on the difference values, and the low-frequency sub-bands of multiple different wavelength images are fused based on the fusion weights to obtain a low-frequency fused image. The high-frequency subbands of multiple images with different wavelengths are fused using a parameter-adaptive pulse-coupled neural network to obtain a high-frequency fused image; The high-frequency fused image and the low-frequency fused image are reconstructed by inverse non-subsampled shear wave transform to obtain the fused image.
[0051] The reference pixel can be selected as the pixel with the largest difference in grayscale value from its neighbors.
[0052] Considering that low-frequency subbands account for the majority of image energy, their fusion weights determine the overall contrast and structural fidelity of the fused image. Therefore, this application provides rules for setting the fusion weights of low-frequency subbands in images from different wavelength light sources: First, for each wavelength image, calculate the sum of the absolute values of the differences between the reference pixel and the grayscale values of all other pixels in the image at that wavelength. That is: .
[0053] Where N is the number of pixels in the image. The grayscale value of the reference pixel. Let p be the p-th pixel.
[0054] Then, the sum of the absolute values of the differences between the reference pixel and all other pixels in the image at different wavelengths. Normalization is performed to obtain the difference values of the reference pixels for each wavelength image. The larger the difference value, the more significant the contrast of the image, and the higher the weight should be assigned.
[0055] Then, the fusion weights of the low-frequency subbands of the i-th wavelength image are calculated using the following formula: ; .
[0056] in, Let be the fusion weight of the low-frequency subband of the i-th wavelength image. The difference value of the image at the i-th wavelength. To prevent outliers, when When the sum does not equal 1, it is corrected by fine-tuning the largest weight term, so that... .
[0057] The high-frequency subband uses a parameter-adaptive pulse-coupled neural network (PCNN). In practice, the high-frequency subband coefficients of each wavelength are used as input to the PCNN, and the fusion coefficient is determined according to the number of times the neuron fires (usually the coefficient corresponding to the highest number of fires is selected).
[0058] Finally, the fused low-frequency and high-frequency subbands are reconstructed using inverse non-subsampled shear wave transform (INSST) to generate the final fused image. This image combines complementary information from different bands (such as visible light texture clarity and infrared thermal anomaly information).
[0059] After reconstructing the fused image through downsampled shear wave inverse transform, considering that the fused image simultaneously contains fine spatial structure information and implicit spectral characteristics (i.e., response differences across different bands), a single convolutional kernel cannot efficiently capture both types of heterogeneous information. Therefore, this embodiment employs a dual-path feature extraction network to extract spatial and spectral features.
[0060] Specifically, the dual-path feature extraction network includes a spatial branch and a spectral branch. The spatial branch can use a multi-layer 2D-CNN (two-dimensional convolutional neural network) to extract details such as texture and edges. The spectral branch can use a 1D-CNN or Transformer encoder to perform calculations along the band dimension, capturing the correlation and difference features of each wavelength after fusion.
[0061] Furthermore, a spatial attention module can be embedded at the end of the spatial branch to perform adaptive weight reconstruction on the original spatial feature map extracted from the spatial branch in the spatial dimension (i.e., recalibrate the original spatial feature map in the height and width dimensions). Similarly, a spectral attention module can be embedded at the end of the spectral branch to perform adaptive weight reconstruction on the original spectral feature map extracted from the spectral branch in the spectral dimension, i.e., recalibrate the channel dimension of the original spectral feature map, strengthen the band feature channels that contribute more to defect discrimination, and suppress redundant noise channels.
[0062] Finally, the attention-enhanced spatial features and spectral features are concatenated along the channel dimension, and information interaction and dimensionality reduction are performed through 1*1 convolution to form a unified fusion feature. This fusion feature is then connected to a multi-scale convolutional neural network (such as dilated convolutions with different dilation rates or feature pyramid structures) to extract multi-size defect features under different receptive fields. Finally, the defect category, location, and confidence level are output through the detection head.
[0063] In the above scheme, the NSST and PCNN fusion strategy effectively integrates multispectral information, making up for the limitations of single imaging. This allows the fused image to retain rich spatial details and enhance the contrast of potential defects. At the same time, the dual-path network design decouples the extraction of spatial and spectral features, avoiding mutual interference from mixed extraction. Combined with the dual attention mechanism, adaptive recalibration of features is achieved, which significantly improves the network's sensitivity to weak and small-sized defects, making it suitable for workpiece defect detection scenarios with high accuracy requirements.
[0064] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A vision inspection system based on a light source control integrated machine, characterized in that, The system includes an integrated light source control unit, an imaging unit, and a multispectral light source device. The integrated light source control unit comprises a motherboard layer, an I / O function expansion layer, and a light source control layer. The motherboard layer, the I / O function expansion layer, and the light source control layer are electrically connected via board-to-board connections. The motherboard layer is equipped with an industrial control motherboard, and the light source control layer integrates a light source controller. The industrial control motherboard sends an image acquisition command to the light source controller, which then drives the multispectral light source device to emit different wavelengths of illumination light onto the workpieces being transported on the production line. The imaging unit is connected to the image acquisition interface of the IO function extension layer to acquire workpiece images under different wavelength illumination. The workpiece images corresponding to different wavelengths are transmitted back to the industrial control motherboard through the image acquisition interface. The industrial control motherboard is used to perform pixel-level registration of workpiece images corresponding to different wavelengths to obtain a registered multispectral image. Non-subsampled shear wave transform decomposition is then performed on each wavelength image in the registered multispectral image to obtain low-frequency sub-bands and multiple high-frequency sub-bands corresponding to each wavelength image. The low-frequency and high-frequency sub-bands decomposed from the multi-wavelength image are fused to output a fused image. The fused image is then processed by a dual-path feature extraction network to extract spatial and spectral features. A feature fusion module fuses the spatial and spectral features to obtain fused features. The fused features are then processed by a multi-scale convolutional neural network to extract multi-size defect features, and the defect category, location, and confidence level are output through the detection head.
2. The vision inspection system based on a light source control integrated machine as described in claim 1, characterized in that, The integrated light source unit has a built-in global synchronous clock source, which is connected to the industrial control motherboard, the light source controller and the image acquisition interface through in-board wiring, so that the triggering sequence of light source lighting and imaging unit exposure is executed synchronously based on the same clock reference.
3. The vision inspection system based on a light source control integrated machine as described in claim 2, characterized in that, The light source controller integrates multiple light source driving channels, and each light source driving channel is connected to each wavelength light source of the multispectral light source device in a one-to-one correspondence. When the industrial control motherboard is powered on and initialized or when the preset calibration trigger conditions are met, it triggers the light source controller to enter the parameter self-calibration mode. In parameter self-calibration mode, the light source controller drives each wavelength light source to light up one channel at a time, and at the same time samples and feeds back the light intensity signal of each light source driving channel in real time through the built-in photoelectric feedback circuit. The industrial control motherboard compares the light intensity signal fed back by each light source driving channel with the preset target light intensity threshold, and records the time consumed from the issuance of the lighting command to the attainment of the target light intensity threshold, defining it as the rise time of the corresponding wavelength light source. The industrial control motherboard calculates the target pre-trigger stabilization delay corresponding to each wavelength light source based on the rise time of each wavelength light source and in combination with a preset safety margin, and saves the target pre-trigger stabilization delay of each wavelength light source to the hardware timing register of the light source controller. During the formal image acquisition process, the light source controller responds to the image acquisition command and starts the hardware timing logic. The hardware timing logic executes the time-division lighting sequence of multiple wavelength light sources based on the pre-stored target trigger stabilization delay of each wavelength light source. The switching interval between adjacent wavelengths includes the target trigger stabilization delay and the preset switching dead time.
4. The vision inspection system based on a light source control integrated machine as described in claim 3, characterized in that, The industrial control motherboard also receives test images of each wavelength acquired by the light source controller in parameter self-calibration mode; The industrial control motherboard analyzes the contrast and signal-to-noise ratio of the test images at each wavelength, and obtains the imaging score of each wavelength light source based on the contrast and signal-to-noise ratio. The industrial control motherboard sets the lighting priority of each wavelength light source based on the imaging score of each wavelength light source, and saves the lighting priority of each wavelength light source to the light source controller. During the formal image acquisition process, the light source controller responds to the image acquisition command and sequentially executes the time-division lighting of multiple wavelength light sources according to the lighting priority of each wavelength light source.
5. The vision inspection system based on a light source control integrated machine as described in claim 4, characterized in that, The method of setting the lighting priority of each wavelength light source based on the imaging score of each wavelength light source includes: Obtain the importance score pre-configured for each wavelength light source. The importance score for different wavelength light source configurations is determined based on the category of the work to be inspected and the inspection target. The lighting priority of each wavelength light source is determined based on its importance score, imaging score, and rise time.
6. The vision inspection system based on a light source control integrated machine as described in claim 1, characterized in that, The process of fusing the low-frequency and high-frequency sub-bands decomposed from the multi-wavelength image to output a fused image includes: Calculate the sum of the absolute values of the differences between the reference pixel and all other pixels in the image at each wavelength, and normalize the sum of the absolute values of the differences to obtain the difference value of the reference pixel in the image at each wavelength. The fusion weights of the low-frequency sub-bands of each wavelength image are determined based on the difference values, and the low-frequency sub-bands of multiple different wavelength images are fused based on the fusion weights to obtain a low-frequency fused image. The high-frequency subbands of multiple images with different wavelengths are fused using a parameter-adaptive pulse-coupled neural network to obtain a high-frequency fused image; The high-frequency fused image and the low-frequency fused image are reconstructed by inverse non-subsampled shear wave transform to obtain the fused image.
7. The vision inspection system based on a light source control integrated machine as described in claim 6, characterized in that, The method of determining the fusion weights of the low-frequency sub-bands of each wavelength image based on the difference value includes: The fusion weights of the low-frequency subbands of the i-th wavelength image are calculated using the following formula: ; in, Let be the fusion weight of the low-frequency subband of the i-th wavelength image. Let i be the difference value of the image at wavelength i. To prevent outliers.
8. The vision inspection system based on a light source control integrated machine as described in claim 1, characterized in that, The step of extracting spatial and spectral features from the fused image using a dual-path feature extraction network includes: The fused image is input into the spatial and spectral branches of the dual-path feature extraction network for parallel processing to obtain spatial and spectral features; The spatial branch is embedded with a spatial attention module to adaptively reconstruct the original spatial feature map extracted by the spatial branch in the spatial dimension, and the spectral branch is embedded with a spectral attention module to adaptively reconstruct the original spectral feature map extracted by the spectral branch in the spectral dimension.
9. The vision inspection system based on a light source control integrated machine as described in claim 1, characterized in that, The multispectral light source device includes at least two light sources of different wavelengths, which are selected from any combination of visible light, near-infrared light, and ultraviolet light bands.