Linear light source for machine vision inspection
Patent Information
- Application Number
- CN202611268194.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-10-27
AI Technical Summary
[0003]线性光源在机器视觉检测中按整灯亮度或预设档位随曝光时序点亮,条带区域内反射差异和运动位置变化会使局部图像灰度偏离识别参考范围,后续边缘连续性和纹理对比度判断易受过曝或欠曝干扰,恒流驱动过程侧重供电设定,温度电流电压状态与图像响应之间缺少联动校正,检测工位依据相机采集图像进行边缘轮廓纹理识别时,触发信号与曝光信号时序偏差易形成无效采集结果
[0017]多个发光区段与条带感兴趣区域中的图像子区域建立映射关系后,控制器以像素集合的灰度分布、饱和比例、边缘梯度或纹理对比度相对识别参考范围的偏离方向和偏离程度生成分区照明调节量,使局部照射位置与局部图像响应形成对应。光源状态采样电路取得温度、电流或电压状态后,控制器对分区照明调节量进行限幅、补偿或保持处理,并在曝光信号与被测对象位置触发信号满足时序对应条件时输出更新驱动参数,使照明控制与图像采集形成闭环。异常条件触发回退照明参数,减少异常图像继续参与调节。
Smart Images

Figure CN122990147A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a linear light source for machine vision inspection. Background Technology
[0002] Image recognition technology focuses on the acquisition, transmission, recognition, judgment, storage, and display processing of images and video frames acquired by industrial cameras or imaging devices, along with their pixel grayscale, color, texture, contour, edge, and positional status information. Image data is transmitted to processing equipment via camera interface, acquisition card, or local bus. The processing program compares and judges based on pixel coordinates, grayscale thresholds, edge continuity, contour matching relationships, and target status markers. Traditional linear light sources for machine vision inspection refer to light source devices that provide linear illumination to a strip area of the workpiece, packaging, printed materials, or moving materials in machine vision inspection scenarios. They typically consist of a strip lamp body, light-emitting devices, a light guide or focusing structure, a heat dissipation substrate, a mounting bracket, and a constant current drive circuit. During inspection, the light source is arranged along the direction of the edge or surface texture to be recognized on the object being inspected. The controller sends on / off or brightness setting commands to the drive circuit based on the camera exposure sequence, conveyor line position trigger signal, and inspection station status. After the industrial camera acquires the image in the corresponding illuminated area, it is used for subsequent edge, contour, texture, and status information recognition.
[0003] In machine vision inspection, linear light sources are illuminated according to the full lamp brightness or preset level and the exposure sequence. Differences in reflection and changes in movement position within the strip area can cause the grayscale of the local image to deviate from the recognition reference range. Subsequent judgment of edge continuity and texture contrast is easily affected by overexposure or underexposure. The constant current drive process focuses on power supply settings, and there is a lack of linkage correction between temperature, current, voltage status and image response. When the inspection station performs edge contour texture recognition based on the image acquired by the camera, the timing deviation between the trigger signal and the exposure signal can easily lead to invalid acquisition results. Summary of the Invention
[0004] The purpose of this invention is to provide a linear light source for machine vision inspection, which enables the linear light source to perform closed-loop control of driving parameters based on the local response of the detected image, the working state of the luminous segment, and the image acquisition timing during the machine vision inspection process. This allows it to adapt to differences in image grayscale, edge, and texture response at different locations within the region of interest of the strip, and to perform backoff processing for abnormal image responses or acquisition timing deviations.
[0005] To achieve the aforementioned objective, the present invention employs the following technical solution: a linear light source for machine vision inspection, comprising a strip lamp body, multiple light-emitting segments, a driving channel, an industrial camera interface, a conveyor line trigger interface, a light source status sampling circuit, and a controller. The multiple light-emitting segments are arranged along the length of the strip lamp body. The driving channel is connected to each of the multiple light-emitting segments. The industrial camera interface is used to receive detection images and exposure signals. The conveyor line trigger interface is used to receive a trigger signal indicating the position of the object under test. The light source status sampling circuit is used to collect the temperature, current, and voltage status of the corresponding light-emitting segments.
[0006] The controller stores the mapping relationship between multiple image sub-regions in the region of interest (ROI) and the multiple luminous segments. Based on this mapping relationship, the controller extracts the pixel set of the image sub-region corresponding to each luminous segment from the detected image. Using the grayscale distribution, saturation ratio, edge gradient, or texture contrast of the pixel set relative to the recognition reference range as input, the controller generates the corresponding partitioned illumination adjustment amount for the luminous segment. The controller performs limiting, compensation, or maintenance processing on the partitioned illumination adjustment amount based on temperature, current, and voltage conditions, and forms updated driving parameters. When the exposure signal and the target object position trigger signal meet the timing correspondence condition, the controller sends the updated driving parameters to the driving channel and recalculates the deviation direction and degree of the pixel set in the next detected image. When the feature data extracted from the detected image meets any of the abnormal conditions of overexposure, underexposure, or missing edge response, or when the time difference between the exposure signal and the target object position trigger signal exceeds the allowable range, the controller calls preset backlighting parameters to replace the updated driving parameters.
[0007] Furthermore, the controller divides the strip into regions of interest according to the coordinate axis corresponding to the length direction of the strip light body in the industrial camera imaging coordinate system, obtaining multiple image sub-regions, and writes a coordinate start point, coordinate end point, and region sequence identifier for each image sub-region. The controller generates luminous segment numbers according to the arrangement order of the multiple luminous segments along the length direction of the strip light body, and establishes the mapping relationship between the luminous segment numbers and the coordinate start point, coordinate end point, and region sequence identifier of the image sub-region. Based on the passing direction corresponding to the trigger signal of the measured object position, the controller determines the time sequence in which the measured object passes through the corresponding illumination area of each luminous segment, and sequentially calls the mapping relationship according to the time sequence to perform feature extraction and closed-loop control of the corresponding image sub-region.
[0008] Furthermore, before establishing the mapping relationship, the controller receives a calibration image acquired by an industrial camera and extracts the strip illumination boundary position and the strip illumination center line position from the calibration image. The controller compares the strip illumination boundary position with the boundary range determined by the coordinate start point and coordinate end point. When the strip illumination boundary position falls within the boundary range, the controller determines that the physical illumination area is aligned with the image sub-region, maintaining the mapping relationship between the current image sub-region and the corresponding luminous segment. When the strip illumination boundary position does not fall within the boundary range, the controller performs offset correction on the coordinate start point and coordinate end point of the image sub-region based on the deviation value of the strip illumination center line position relative to the preset theoretical center line, and updates the mapping relationship between the image sub-region and the luminous segment number.
[0009] Furthermore, the controller performs masking processing on the pixel set extracted from the detected image and removes pixels located outside the strip illumination boundary. The controller calculates the grayscale distribution, saturation ratio, edge gradient, and texture contrast within the pixel set, and converts the calculation results into feature values of a uniform scale according to a preset mapping rule. The controller combines these feature values according to preset feature weights to form comprehensive image response data. When the comprehensive image response data falls within the recognition reference range, the controller generates a brightness maintenance amount; when the comprehensive image response data is higher or lower than the recognition reference range, the controller generates a brightness reduction amount or a brightness increase amount according to the deviation direction.
[0010] Further, the controller writes the comprehensive image response data into a single-segment response sequence according to the acquisition time, and the single-segment response sequence corresponds to the number of the luminous segment. The controller compares the comprehensive image response data of the current detected image with the comprehensive image response data of the previous detected image to obtain the deviation direction, and combines the deviation direction with the brightness reduction amount or the brightness increase amount to form the partitioned illumination adjustment amount. When the deviation direction is consistent with the adjustment direction corresponding to the partitioned illumination adjustment amount, it is determined that the partitioned illumination adjustment amount meets the convergence condition, and the controller allows the partitioned illumination adjustment amount to enter the driving parameter generation process; when the deviation direction is inconsistent with the adjustment direction corresponding to the partitioned illumination adjustment amount, it is determined that the partitioned illumination adjustment amount meets the adjustment suppression condition, and the controller reduces the preset brightness adjustment step size of the partitioned illumination adjustment amount or outputs the brightness maintenance amount.
[0011] Furthermore, the light source status sampling circuit obtains current and voltage sampling values from the driving channel corresponding to each luminous segment, and obtains temperature sampling values from the sampling position near the luminous segment in the strip lamp body. The controller compares the current sampling value with the current setting range, the voltage sampling value with the voltage setting range, and the temperature sampling value with the temperature setting range to obtain the segment status result for each luminous segment. When the segment status result simultaneously meets the current setting range, the voltage setting range, and the temperature setting range, the controller allows the zone lighting adjustment amount to enter the driving parameter generation process; when any segment status result does not meet the corresponding setting range, the controller performs amplitude limiting processing on the corresponding luminous segment.
[0012] Furthermore, the controller stores a preset brightness adjustment step size, upper limit of driving current, lower limit of driving current, and temperature correction level for each luminous segment, and writes the segment status results into a status record corresponding to the luminous segment number. When the temperature sampling value in the segment status result is higher than the set temperature range, the controller reduces the upper limit of driving current for the corresponding luminous segment or directly reduces the driving parameters according to the temperature correction level, so that the corresponding luminous segment can effectively cool down when the temperature is too high; when the current sampling value in the segment status result is lower than the set current range and the voltage sampling value is within the set voltage range, the controller compensates for the partition lighting adjustment amount according to the preset brightness adjustment step size. The controller adds the partition lighting adjustment amount after the limiting or compensation processing to the current driving parameters to obtain a new target driving value, and compares the target driving value with the upper limit of driving current and the lower limit of driving current. When the target driving value exceeds the limit, the target driving value is truncated to the upper limit of driving current or the lower limit of driving current, and the updated driving parameters are generated.
[0013] Furthermore, the controller receives the exposure start time and exposure end time from the exposure signal, and the arrival time from the position trigger signal of the object under test. The controller compares the arrival time with the exposure start time. When the arrival time is within the allowable advance range before the exposure start time, the controller generates an early lighting command based on the inherent response delay time of the light source; when the arrival time is between the exposure start time and the exposure end time, the controller generates a synchronous lighting command. The controller sends the updated drive parameters to the drive channel corresponding to the position of the object under test according to the early lighting command or the synchronous lighting command, and outputs an extinguishing command after the exposure end time.
[0014] Further, the controller determines the movement direction of the tested object based on the position trigger signal of the tested object, and determines the adjacent light-emitting segments in the movement direction of the tested object according to the mapping relationship. When the driving channel corresponding to the current light-emitting segment receives the updated driving parameters, the controller sends pre-lighting parameters to the driving channel corresponding to the adjacent light-emitting segment. The output time of the pre-lighting parameters is earlier than the time when the tested object arrives at the illumination position corresponding to the adjacent light-emitting segment. After the tested object actually arrives at the illumination position corresponding to the adjacent light-emitting segment, the controller extracts the pixel set of the image sub-region corresponding to the adjacent light-emitting segment from the next detection image acquired, and recalculates the deviation direction and deviation degree of the pixel set relative to the recognition reference range. When the deviation degree is within the allowable deviation range, the controller maintains the pre-lighting parameters; when the deviation degree exceeds the allowable deviation range, the controller updates the pre-lighting parameters according to the deviation direction, the deviation degree, and the partition lighting adjustment amount.
[0015] Furthermore, the controller establishes an abnormal state time window and statistically analyzes the saturation ratio and edge gradient based on the image sub-regions in multiple consecutive frames of detected images, comparing the statistical results with the abnormal judgment range. When the saturation ratio of any image sub-region falls within the abnormal judgment range for a consecutive preset number of frames, or the edge gradient is lower than the edge response lower limit for a consecutive preset number of frames, the controller determines that the continuous detected images meet the abnormal conditions and stops using the current partition illumination adjustment to generate driving parameters. When the time difference between the exposure signal and the trigger signal of the measured object position exceeds the allowable range, the controller determines that the acquisition timing is abnormal, outputs an abnormal prompt signal, and calls the preset backoff illumination parameters to output backoff driving parameters to the driving channel corresponding to the abnormal image sub-region.
[0016] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:
[0017] After establishing mapping relationships between multiple luminescent segments and image sub-regions within the region of interest (ROI), the controller generates zoned illumination adjustment amounts based on the direction and degree of deviation of the pixel set's grayscale distribution, saturation ratio, edge gradient, or texture contrast relative to the identification reference range. This ensures a correspondence between local illumination positions and local image responses. After the light source status sampling circuit acquires temperature, current, or voltage status data, the controller limits, compensates for, or maintains the zoned illumination adjustment amounts. When the exposure signal and the trigger signal for the measured object's position meet the timing correspondence condition, it outputs updated driving parameters, creating a closed loop between illumination control and image acquisition. Abnormal conditions trigger a fallback of illumination parameters to reduce the continued involvement of abnormal images in the adjustment process. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the accompanying drawings without creative effort.
[0019] Figure 1 This is a flowchart of the linear light source closed-loop lighting control of the present invention;
[0020] Figure 2 This is a data flow diagram of the mapping calibration between image sub-regions and luminescent segments in this invention;
[0021] Figure 3 This invention provides a logic diagram for generating integrated image response data.
[0022] Figure 4 This is a feedback diagram showing the relationship between the zoned lighting adjustment amount and the light source status correction in this invention.
[0023] Figure 5 This is a diagram showing the exposure timing and pre-lighting signal flow of adjacent light-emitting sections in this invention.
[0024] Figure 6 This is a diagram showing the transition between the abnormal state time window and the backlighting state in this invention. Detailed Implementation
[0025] The following combination Figures 1 to 6 The technical solution described in this invention will be explained. Figures 1 to 6 This is a newly added drawing compiled based on the technical solution described in the application documents, used to illustrate the structural composition, control flow, data flow, state correction, timing coordination, and anomaly backoff relationship of the linear light source for machine vision inspection. The strip lamp body, multiple light-emitting sections, drive channels, industrial camera interface, conveyor line trigger interface, light source state sampling circuit, and controller in the following embodiments are all based on the technical objects already defined in the protection scope text and the invention content. The detection image, exposure signal, measured object position trigger signal, strip region of interest, image sub-region, mapping relationship, pixel set, recognition reference range, zoned illumination adjustment amount, updated drive parameters, preset backoff illumination parameters, comprehensive image response data, section state results, early illumination command, synchronous illumination command, pre-illumination parameters, and anomaly warning signal are all data objects or control objects consistently used in this embodiment. This implementation does not limit the specific number of light-emitting sections, the type of LED beads, the material of the lamp body, the type of driver chip, the type of industrial camera, the type of conveyor line, the specific value of the identification reference range, the specific value of the preset feature weight, or the specific value of the allowable advance range. The specific values can be determined within the scope supported by the technical solution based on the detection object, the camera field of view, and the installation conditions.
[0026] Please see Figures 1 to 6 This embodiment provides a linear light source for machine vision inspection, including a strip light body, multiple light-emitting segments, driving channels, an industrial camera interface, a conveyor line trigger interface, a light source status sampling circuit, and a controller. Multiple light-emitting segments are arranged along the length of the strip light body, and each segment is connected to a corresponding driving channel. The driving channel receives driving parameters from the controller and outputs driving current or pulse control signals to the corresponding light-emitting segment. The industrial camera interface is connected to an industrial camera in the machine vision inspection station to receive inspection images, calibration images, and exposure signals. The conveyor line trigger interface is connected to the conveyor line position detection end or the inspection station trigger end to receive the position trigger signal of the object under test. The light source status sampling circuit corresponds to the sampling positions in each driving channel and the strip light body, and is used to obtain current sampling values, voltage sampling values, and temperature sampling values. The controller is used to store the mapping relationship between image sub-regions in the region of interest of the strip and the multiple light-emitting segments, and generates updated driving parameters based on the local response of the inspection image, the light source status sampling results, and the acquisition timing.
[0027] The operation process of this embodiment may include S1 to S6. S1 establishes the mapping relationship between image sub-regions and luminous segments. S2 extracts pixel sets from the detection image and forms comprehensive image response data. S3 generates zonal illumination adjustment amounts based on the comprehensive image response data. S4 limits, compensates, or maintains the zonal illumination adjustment amounts in combination with temperature, current, and voltage states and forms updated driving parameters. S5 controls the output of the driving channel to update the driving parameters based on the exposure signal and the trigger signal of the measured object position, and forms feedback calculations in the next detection image. S6 calls preset backoff illumination parameters to replace the updated driving parameters when the feature data of the detection image meets abnormal conditions or the acquisition timing is abnormal. The above S1 to S6 constitute a closed-loop control process from detection input, local response generation, adjustment amount determination, light source state correction, driving output to feedback in the next frame.
[0028] In step S1, the controller divides the region of interest (ROI) into multiple image sub-regions according to the coordinate axis corresponding to the length direction of the strip light body in the industrial camera imaging coordinate system. Each image sub-region corresponds to a coordinate range within the ROI, which includes a starting point, an ending point, and a region sequence identifier. The controller also generates luminous segment numbers according to the arrangement order of the multiple luminous segments along the length direction of the strip light body and establishes a mapping relationship between the luminous segment numbers and the starting point, ending point, and region sequence identifier of the image sub-regions. This mapping relationship is used to define the control correspondence between local pixel ranges in the detection image and the actual luminous segments, enabling the subsequent controller to determine the illumination adjustment action of the corresponding luminous segment based on the image response data of a certain image sub-region.
[0029] In S1, since the industrial camera and linear light source are fixed hardware facilities at the inspection station, their relative spatial positions are absolutely fixed. Therefore, the physical spatial mapping between the image sub-region and the physical light-emitting section remains unchanged. The controller analyzes the direction of passage in the trigger signal of the measured object's position and adapts to the object's movement through timing control. That is, it determines the order in which the measured object enters the corresponding illumination area of each light-emitting section based on the direction of passage, ensuring that subsequent adjustment amounts can accurately act when it passes through the corresponding physical area.
[0030] In S1, to reduce the impact of installation deviations on the mapping relationship, the controller receives a calibration image acquired by an industrial camera before establishing the mapping relationship, and extracts the strip illumination boundary position and the strip illumination center line position from the calibration image. The strip illumination boundary position can be determined by the brightness change boundary in the calibration image, the continuous position of the edge of the strip illumination area, or the distribution of boundary pixels. The strip illumination center line position can be determined by the center position between the strip illumination boundary positions. The controller compares the strip illumination boundary position with the boundary range determined by the coordinate start and end points. When the strip illumination boundary position falls within the boundary range, the controller determines that the physical illumination area is aligned with the image sub-region, maintaining the mapping relationship between the current image sub-region and the corresponding luminous segment. When the strip illumination boundary position does not fall within the boundary range, the controller performs offset correction on the coordinate start and end points of the image sub-region based on the deviation value of the strip illumination center line position relative to the preset theoretical center line, and updates the mapping relationship between the image sub-region and the luminous segment number. The calibrated mapping relationship is written to the controller's storage area as the basis for retrieving pixel sets and output driving parameters during the detection process.
[0031] In S2, the industrial camera interface receives the detection image. Based on the mapping relationship, the controller extracts a set of pixels corresponding to the image sub-regions of each luminous segment from the detection image. The pixel set includes the pixel grayscale value, position, and neighboring pixel information used to calculate edge gradients or texture contrast within the corresponding image sub-region. The controller performs masking on the pixel set extracted from the detection image, targeting pixels outside the strip illumination boundary. Pixels located outside the strip illumination boundary are not included in subsequent calculations of grayscale mean, overexposed pixel percentage, underexposed pixel percentage, edge gradient mean, and texture contrast value, thus ensuring that the overall image response data primarily reflects the local response within the strip illumination area.
[0032] S2 also includes local feature calculation. The controller calculates the gray-level distribution, saturation ratio, edge gradient, and texture contrast within the pixel set. The gray-level distribution is obtained by statistically analyzing the gray levels of pixels entering the calculation within the image sub-region, and is used to characterize the local brightness level. The saturation ratio is obtained by the relationship between the number of pixels exceeding the overexposure judgment boundary and the number of pixels below the underexposure judgment boundary and the total number of pixels involved in the calculation, and is used to characterize the state of excessively high or low local brightness. The edge gradient is formed by the intensity of gray-level changes at edge response locations within the image sub-region, and is used to characterize the edge response state. The texture contrast is formed by the gray-level difference or gray-level distribution difference between texture pixels within the image sub-region, and is used to characterize the state of texture discernibility.
[0033] In S2, the controller converts the calculation results into feature values of a uniform scale according to preset mapping rules. These preset mapping rules are used to convert grayscale distribution, saturation ratio, edge gradient, and texture contrast to the same evaluation scale, allowing features of different dimensions or statistical calibers to enter the same combination process. The controller combines the feature values according to preset feature weights to form comprehensive image response data. This comprehensive image response data serves as an intermediate response result for a sub-region of the image, used by S3 to determine the deviation between the local illumination state and the recognition reference range. If the pixel set of any sub-region of the image is empty, the timestamp is inconsistent with the detected image, or there are too many pixels located outside the strip illumination boundary, the controller will not use the corresponding calculation result as valid comprehensive image response data and can call preset backoff illumination parameters during subsequent anomaly handling.
[0034] In S3, the controller compares the integrated image response data with a recognition reference range, which defines the local response state required for a sub-region of the image to participate in image recognition. The controller generates a brightness maintenance amount, a brightness reduction amount, or a brightness increase amount based on the comparison result. When the integrated image response data falls within the recognition reference range, the controller generates a brightness maintenance amount, indicating that the illumination output of the corresponding luminous segment does not need to be increased or decreased based on the current detected image. When the integrated image response data is higher than the recognition reference range, the controller generates a brightness reduction amount in the direction of deviation. When the integrated image response data is lower than the recognition reference range, the controller generates a brightness increase amount in the direction of deviation. The degree of deviation defines the source of the adjustment range for the brightness reduction or increase amount, enabling the controller to generate corresponding zoned illumination adjustment amounts based on the difference between the local response and the recognition reference range.
[0035] S3 also includes adjustment convergence judgment in the acquisition time dimension. The controller writes the comprehensive image response data into a single-segment response sequence according to the acquisition time, and the single-segment response sequence corresponds to the luminous segment number. The single-segment response sequence is used to record the local response changes of the corresponding image sub-region of the same luminous segment during continuous acquisition. The controller compares the comprehensive image response data of the current detection image with the comprehensive image response data of the previous detection image to obtain the deviation change direction, and combines the deviation change direction with the brightness reduction or brightness increase amount to form the partition illumination adjustment amount. When the deviation change direction is consistent with the adjustment direction corresponding to the partition illumination adjustment amount, the controller determines that the partition illumination adjustment amount meets the convergence condition and allows the partition illumination adjustment amount to enter the driving parameter generation process. When the deviation change direction is inconsistent with the adjustment direction corresponding to the partition illumination adjustment amount, the controller determines that the partition illumination adjustment amount meets the adjustment suppression condition and reduces the preset brightness adjustment step size or output brightness hold amount of the partition illumination adjustment amount. This processing enables the local response changes in continuously detected images to inversely constrain the current illumination adjustment action, avoiding the direct amplification of driving changes by abnormal responses in a single frame image.
[0036] In S4, the light source status sampling circuit obtains current and voltage sampling values from the driving channel corresponding to each light-emitting segment, and temperature sampling values from the sampling position of the strip lamp body near the light-emitting segment. The current sampling value reflects the driving current status output by the corresponding driving channel to the light-emitting segment, the voltage sampling value reflects the power supply or load voltage status of the corresponding driving channel, and the temperature sampling value reflects the thermal status of the strip lamp body near the light-emitting segment. The controller compares the current sampling value with the current setting range, the voltage sampling value with the voltage setting range, and the temperature sampling value with the temperature setting range to obtain the segment status result for each light-emitting segment.
[0037] In S4, when the segment status result simultaneously meets the current setting range, voltage setting range, and temperature setting range, the controller allows the zone lighting adjustment amount to enter the drive parameter generation process. When any segment status result does not meet the corresponding setting range, the controller performs limiting processing on the corresponding luminous segment. Limiting processing is used to constrain the available range of the zone lighting adjustment amount when entering the drive parameter generation process, ensuring that the drive parameters are consistent with the electrical and thermal states of the luminous segment. The controller stores the preset brightness adjustment step size, drive current upper limit, drive current lower limit, and temperature correction level for each luminous segment, and writes the segment status result into the status record corresponding to the luminous segment number. The status record serves as the light source status input when the next round of detected images enters closed-loop control.
[0038] S4 also includes compensation and truncation processing. When the temperature sampling value in the segment status result is higher than the temperature setting range, the controller reduces the upper limit of the driving current of the corresponding luminous segment or directly reduces the driving parameters according to the temperature correction level, so that the corresponding luminous segment can effectively cool down when the temperature is too high. When the current sampling value in the segment status result is lower than the current setting range and the voltage sampling value is within the voltage setting range, the controller compensates for the partition lighting adjustment amount according to the preset brightness adjustment step size, so that the partition lighting adjustment amount matches the actual output state of the driving channel. The controller adds the partition lighting adjustment amount after the limiting or compensation processing to the current driving parameters to obtain a new target driving value, and compares the target driving value with the upper limit and lower limit of the driving current. When the target driving value exceeds the boundary formed by the upper limit or lower limit of the driving current, the controller truncates the target driving value to the upper limit or lower limit of the driving current and generates updated driving parameters. The updated driving parameters are sent as the control output to the driving channel, and also serve as the previous round of control state for the next detection image feedback calculation.
[0039] In S5, the industrial camera interface receives exposure signals, including the exposure start and end times; the conveyor trigger interface receives the measured object position trigger signal, including the object's arrival time. The controller compares the arrival time with the exposure start time. When the arrival time is within the allowable advance range before the exposure start time, the controller generates an advance lighting command based on the inherent response delay time of the light source. The advance lighting command ensures that the luminous segment enters the illumination response process before the industrial camera's exposure window arrives, so that the corresponding luminous segment is in an irradiable state when the exposure start time arrives. When the arrival time is between the exposure start and end times, the controller generates a synchronous lighting command. The synchronous lighting command ensures that the corresponding luminous segment outputs updated drive parameters within the exposure window.
[0040] In S5, the controller sends updated driving parameters to the drive channel corresponding to the position of the object under test according to the advance lighting command or synchronous lighting command, and outputs an extinguishing command after the exposure ends. After receiving the updated driving parameters, the drive channel outputs driving current or pulse control signal to the corresponding light-emitting segment according to the updated driving parameters. The light-emitting segment outputs strip illumination, and the industrial camera acquires the next detection image within the exposure window. In the next detection image, the controller recalculates the deviation direction and degree of the pixel set relative to the identification reference range, and uses the recalculated deviation direction and degree as feedback input for the generation of subsequent zone illumination adjustment. Thus, a closed loop is formed between the detection image and the illumination output with the acquisition timing as the boundary.
[0041] S5 also includes a pre-lighting process for adjacent luminous sections. The controller determines the movement direction of the tested object based on the position trigger signal and determines the adjacent luminous sections in the movement direction based on the mapping relationship. When the drive channel corresponding to the current luminous section receives updated drive parameters, the controller sends pre-lighting parameters to the drive channel corresponding to the adjacent luminous section. The output time of the pre-lighting parameters is earlier than the time when the tested object arrives at the illumination position corresponding to the adjacent luminous section. After the tested object actually arrives at the illumination position corresponding to the adjacent luminous section, the controller extracts the pixel set of the image sub-region corresponding to the adjacent luminous section from the next detection image acquired, and recalculates the deviation direction and degree of the pixel set relative to the recognition reference range. When the deviation degree is within the allowable deviation range, the controller maintains the pre-lighting parameters. When the deviation degree exceeds the allowable deviation range, the controller updates the pre-lighting parameters based on the deviation direction, deviation degree, and zone illumination adjustment amount. This pre-lighting process enables adjacent luminous sections in the movement direction to obtain corresponding control input before the tested object arrives, and confirms whether to continue maintaining or adjusting the pre-lighting parameters through the feedback result of the next detection image.
[0042] In S6, the controller establishes an abnormal state time window and statistically analyzes the saturation ratio and edge gradient based on image sub-regions in multiple consecutive frames of detected images, comparing the statistical results with the anomaly determination range. When the saturation ratio of any image sub-region falls within the anomaly determination range for a consecutive preset number of frames, or the edge gradient falls below the lower limit of the edge response for a consecutive preset number of frames, the controller determines that the continuous detected images meet the anomaly conditions and stops using the current partition illumination adjustment amount to generate driving parameters. The abnormal state time window is used to limit the statistical range of anomaly determination, making anomaly determination based on the local response state in the continuous detected images, rather than just based on isolated sampling points. The consecutive preset number of frames, the anomaly determination range, and the lower limit of the edge response can be determined according to the detection object, camera exposure conditions, and recognition reference range supported by the technical solution.
[0043] S6 also includes acquisition timing anomaly handling. The controller compares the time difference between the exposure signal and the trigger signal at the position of the object under test with the allowable range. When the time difference exceeds the allowable range, the controller determines that the acquisition timing is abnormal, outputs an anomaly prompt signal, and calls the preset backoff illumination parameters to output backoff drive parameters to the drive channel corresponding to the abnormal image sub-region. The preset backoff illumination parameters are illumination control parameters pre-stored by the controller, used to replace the drive parameters formed by the current partition illumination adjustment in the abnormal state. After the backoff drive parameters are output, the drive channel controls the corresponding light-emitting segment according to the backoff drive parameters. The controller re-acquires the pixel set of the image sub-region in the subsequent detection image and re-enters the calculation of deviation direction and deviation degree. If the detection image recovers to the recognition reference range, the controller can continue to generate subsequent updated drive parameters according to the process from S2 to S5; if the detection image still meets the abnormal conditions, the controller continues to call the preset backoff illumination parameters or continues to output the anomaly prompt signal.
[0044] In this embodiment, the data or signal flow between the industrial camera interface, the conveyor line trigger interface, the light source status sampling circuit, and the drive channel has a clearly defined receiving and output relationship. The input objects of the industrial camera interface are the detection image, calibration image, and exposure signal; the output objects are the image data and exposure timing data that the controller can access. The input object of the conveyor line trigger interface is the position trigger signal of the object under test; the output object is the passing direction and arrival time that the controller can access. The input objects of the light source status sampling circuit are the actual current and voltage analog signals of the drive channel, as well as the thermal analog signal near the light-emitting section; the output objects are the current sampling value, voltage sampling value, and temperature sampling value provided to the controller as input for calculating the section status result. The output objects of the controller are updated drive parameters, early lighting instructions, synchronous lighting instructions, extinguishing instructions, pre-lighting parameters, abnormal prompt signals, and rollback drive parameters. The response object of the drive channel is the corresponding light-emitting section, and the illumination output of the light-emitting section then enters the next detection image acquisition process of the industrial camera.
[0045] In this embodiment, the verification method can be confirmed through observable engineering conditions. For mapping relationships, the verification method is the correspondence between the strip illumination boundary position in the calibration image and the boundary range of the image sub-region determined by the coordinate start and end points, as well as the correspondence between the image sub-region after offset correction and the luminous segment number. For comprehensive image response data, the verification method is whether the grayscale distribution, saturation ratio, edge gradient, and texture contrast enter a unified scale according to preset mapping rules and form intermediate response results of the same image sub-region. For zoned illumination adjustment, the verification method is whether the deviation direction and degree of the comprehensive image response data relative to the recognition reference range are converted into brightness maintenance, brightness reduction, or brightness increase. For updating driving parameters, the verification method is whether the temperature sample value, current sample value, and voltage sample value participate in limiting, compensation, or maintenance processing and are output by the controller to the corresponding driving channel. For anomaly handling, the verification method is whether the statistical results of continuous detection images or the acquisition timing difference within the abnormal state time window trigger an anomaly prompt signal and rollback driving parameters.
[0046] The above embodiments, based on the technical solutions described in this invention, provide feasible structural components, data sources, processing procedures, control timing, state correction, feedback entry points, and anomaly rollback processes. The descriptions of coordinate division, mapping relationships, integrated image response data, zoned lighting adjustment, updated drive parameters, pre-lighting parameters, and preset rollback lighting parameters in the embodiments are used to explain the feasible implementation methods of linear light sources for machine vision inspection. This invention should not be limited to the specific process order, field names, parameter values, interface forms, or controller implementation forms listed. Without departing from the scope of the technical solutions described in this invention, any equivalent substitutions, modifications, combinations, execution order adjustments, equivalent transformations of field names, equivalent acceptance of interface forms, equivalent changes in controller implementation forms, or equivalent changes in drive channel forms that can be conceived by those skilled in the art should fall within the protection scope of this patent, but should not extend to protected subjects not described in the application documents, nor should they alter the substantive correspondence between technical objects through name changes.
Claims
1. A linear light source for machine vision inspection, characterized in that, It includes a strip lamp body, multiple light-emitting sections arranged along the length of the strip lamp body, drive channels connected to the multiple light-emitting sections respectively, an industrial camera interface, a conveyor line trigger interface, a light source status sampling circuit and a controller; The controller stores the mapping relationship between multiple image sub-regions and multiple light-emitting segments in the region of interest of the strip; the industrial camera interface receives the detection image and exposure signal; and the conveyor line trigger interface receives the position trigger signal of the object under test. Based on the mapping relationship, the controller extracts the pixel set of the image sub-region corresponding to each luminous segment from the detection image, and generates the partition illumination adjustment amount of the corresponding luminous segment by taking the gray-scale distribution, saturation ratio, edge gradient or texture contrast of the pixel set as input and the deviation direction and degree of deviation relative to the recognition reference range. The light source status sampling circuit collects the temperature, current and voltage status of the corresponding light-emitting section. The controller limits, compensates or maintains the adjustment amount of the zoned lighting based on the temperature, current and voltage status, and generates updated driving parameters. When the exposure signal and the trigger signal of the object under test meet the timing correspondence condition, the controller sends the updated driving parameters to the driving channel and recalculates the deviation direction and degree of the pixel set in the next detection image; When the feature data extracted from the detected image meets any of the abnormal conditions of overexposure, underexposure, or missing edge response, or when the time difference between the exposure signal and the trigger signal of the measured object position exceeds the allowable range, the controller calls the preset backlight parameters to replace the updated drive parameters.
2. The linear light source for machine vision inspection according to claim 1, characterized in that, The controller divides the region of interest into strips according to the coordinate axis corresponding to the length direction of the strip light body in the imaging coordinate of the industrial camera, and obtains multiple image sub-regions. The controller also writes the coordinate start point, coordinate end point and region sequence identifier for each image sub-region. The controller generates luminous segment numbers according to the arrangement order of multiple luminous segments along the length of the strip lamp body, and establishes a mapping relationship between the luminous segment numbers and the coordinate start point, coordinate end point, and region sequence identifier of the image sub-region; The controller determines the time sequence of the object passing through the corresponding irradiated area of each luminous segment based on the direction of passage corresponding to the trigger signal of the object's position, and sequentially calls the mapping relationship to perform feature extraction and closed-loop control of the corresponding image sub-region according to the time sequence.
3. The linear light source for machine vision inspection according to claim 2, characterized in that, Before establishing the mapping relationship, the controller receives the calibration image acquired by the industrial camera and extracts the strip irradiation boundary position and the strip irradiation center line position from the calibration image; The controller compares the position of the strip illumination boundary with the boundary range determined by the coordinate start point and coordinate end point. When the position of the strip illumination boundary falls into the boundary range, the controller determines that the physical illumination area is aligned with the image sub-region, and maintains the mapping relationship between the current image sub-region and the corresponding luminous segment. When the position of the strip illumination boundary does not fall within the boundary range, the controller performs offset correction on the coordinate start point and coordinate end point of the image sub-region based on the deviation value of the position of the strip illumination center line relative to the preset theoretical center line, and updates the mapping relationship between the image sub-region and the luminous segment number.
4. The linear light source for machine vision inspection according to claim 1, characterized in that, The controller performs masking on the set of pixels extracted from the detection image and removes pixels located outside the strip illumination boundary. The controller calculates the grayscale distribution, saturation ratio, edge gradient and texture contrast within the pixel set, and converts each calculation result into feature values of a uniform scale according to a preset mapping rule. The controller combines each feature value according to a preset feature weight to form comprehensive image response data. When the integrated image response data falls within the recognition reference range, the controller generates a brightness maintenance amount. When the integrated image response data is higher or lower than the recognition reference range, the controller generates a brightness reduction amount or a brightness increase amount according to the deviation direction.
5. The linear light source for machine vision inspection according to claim 4, characterized in that, The controller writes the integrated image response data into a single-segment response sequence according to the acquisition time, and the single-segment response sequence corresponds to the luminous segment number. The controller compares the integrated image response data of the current detected image with the integrated image response data of the previous detected image to obtain the deviation change direction, and combines the deviation change direction with the brightness reduction amount or brightness increase amount to form the zone lighting adjustment amount; When the deviation direction is consistent with the adjustment direction corresponding to the zone lighting adjustment amount, it is determined that the zone lighting adjustment amount meets the convergence condition, and the controller allows the zone lighting adjustment amount to enter the drive parameter generation process. When the deviation direction is inconsistent with the adjustment direction corresponding to the zone lighting adjustment amount, it is determined that the zone lighting adjustment amount meets the adjustment suppression condition, and the controller reduces the preset brightness adjustment step size or outputs the brightness hold amount of the zone lighting adjustment amount.
6. The linear light source for machine vision inspection according to claim 1, characterized in that, The input objects of the light source state sampling circuit are the actual current simulation signal, voltage simulation signal and thermal simulation signal near the light-emitting section of the driving channel, and the output objects are the current sampling value, voltage sampling value and temperature sampling value provided to the controller as the input for calculating the section state result; The controller compares the current sample value with the current setting range, the voltage sample value with the voltage setting range, and the temperature sample value with the temperature setting range to obtain the segment status result of each light-emitting segment; When the state result of the section simultaneously meets the current setting range, voltage setting range, and temperature setting range, the controller allows the zone lighting adjustment amount to enter the drive parameter generation process. When the state result of any section does not meet the corresponding setting range, the controller performs amplitude limiting processing on the corresponding light-emitting section.
7. The linear light source for machine vision inspection according to claim 6, characterized in that, The controller stores the brightness adjustment step size, upper limit of drive current, lower limit of drive current and temperature correction level for each light-emitting segment, and writes the segment status results into the status record corresponding to the light-emitting segment number. When the temperature sampling value in the section status result is higher than the temperature setting range, the controller reduces the upper limit of the driving current of the corresponding light-emitting section or directly reduces the driving parameters according to the temperature correction level. When the current sampling value in the section status result is lower than the current setting range and the voltage sampling value is within the voltage setting range, the controller compensates for the zonal lighting adjustment amount according to the brightness adjustment step size. The controller adds the zone lighting adjustment amount after limiting or compensation processing to the current drive parameters to obtain a new target drive value, and compares the target drive value with the upper limit of the drive current and the lower limit of the drive current; When the target drive value exceeds the limit formed by the upper limit of the drive current or the lower limit of the drive current, the controller truncates the target drive value to the upper limit of the drive current or the lower limit of the drive current and generates the updated drive parameters.
8. The linear light source for machine vision inspection according to claim 1, characterized in that, The controller receives the exposure start time and exposure end time from the exposure signal, and the arrival time from the position trigger signal of the object under test; The controller compares the arrival time with the exposure start time. When the arrival time is within the allowable advance range before the exposure start time, the controller generates an advance lighting command based on the inherent response delay time of the light source. When the arrival time is between the exposure start time and the exposure end time, the controller generates a synchronous lighting command. The controller sends updated driving parameters to the driving channel corresponding to the position of the object under test according to the advance lighting instruction or the synchronous lighting instruction, and outputs an extinguishing instruction after the exposure ends.
9. The linear light source for machine vision inspection according to claim 8, characterized in that, The controller determines the direction of movement of the object under test based on the trigger signal of the object's position, and determines the adjacent light-emitting segments in the direction of movement of the object under test based on the mapping relationship; When the driving channel corresponding to the current luminous segment receives the updated driving parameters, the controller sends pre-lighting parameters to the driving channel corresponding to the adjacent luminous segment. The output time of the pre-lighting parameters is earlier than the time when the object under test reaches the irradiation position corresponding to the adjacent luminous segment. After the object under test actually reaches the illumination position corresponding to the adjacent luminous segment, the controller extracts the pixel set of the image sub-region corresponding to the adjacent luminous segment from the next detection image, and recalculates the deviation direction and degree of the image sub-region relative to the recognition reference range. When the deviation degree is within the allowable deviation range, the controller maintains the pre-lighting parameters. When the deviation degree exceeds the allowable deviation range, the controller updates the pre-lighting parameters according to the deviation direction, the deviation degree, and the zonal illumination adjustment amount.
10. The linear light source for machine vision inspection according to claim 1, characterized in that, The controller establishes an abnormal state time window and calculates the saturation ratio and edge gradient based on image sub-regions in multiple consecutive frames of detected images, and compares the statistical results with the abnormal judgment range. When the saturation ratio of any image sub-region falls within the anomaly determination range for a consecutive preset number of frames, or the edge gradient is lower than the lower limit of the edge response for a consecutive preset number of frames, the controller determines that the continuously detected images meet the anomaly conditions and stops using the current partition illumination adjustment amount to generate driving parameters. When the time difference between the exposure signal and the trigger signal of the measured object position exceeds the allowable range, the controller determines that the acquisition timing is abnormal, outputs an abnormality prompt signal, and calls the preset back-off illumination parameters to output back-off drive parameters to the drive channel corresponding to the abnormal image sub-region.