Industrial vision-based bagging machine conveying detection system

By integrating image streams and instantaneous velocity in the bagging machine conveyor detection system and constructing an elliptical Gaussian kernel for smoothing, the problem of separating real physical defects from motion shadows under high-speed conveying was solved, achieving real-time and accurate detection results and improving the sensitivity and reliability of the detection system.

CN122066697BActive Publication Date: 2026-06-19振华新材料(东营)有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
振华新材料(东营)有限公司
Filing Date
2026-04-16
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing image edge detection methods struggle to effectively distinguish between real physical defects and motion shadows under high-speed conveying conditions, leading to misjudgments and time-consuming computation of highly complex image deblurring algorithms, which cannot meet the real-time detection requirements of continuous production lines for bagging machines.

Method used

The image stream and instantaneous velocity are acquired through the data fusion acquisition module. An elliptical Gaussian kernel is constructed using the motion prior mapping module. Smoothing is performed by combining the adaptive structure tensor calculation module. The pixel region is divided into real physical edges, pseudo-defect regions, or nonlinear texture regions through the feature decomposition and segmentation module. The image stream and velocity information are synchronized by a hardware trigger line. A delay constraint evaluation module is introduced to ensure the real-time performance and accuracy of the detection.

Benefits of technology

It achieves effective separation of real physical defects and motion shadows under high-speed transport, ensuring the real-time performance and accuracy of detection, reducing the risk of misjudgment and missed judgment, improving detection sensitivity, and providing reliable scale criteria and rejection strategies for on-site operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122066697B_ABST
    Figure CN122066697B_ABST
Patent Text Reader

Abstract

This invention relates to the field of industrial vision and automated inspection technology, specifically to a bagging machine conveying inspection system based on industrial vision. The system includes: a data fusion acquisition module for acquiring the instantaneous velocity scalar and direction of motion of the conveying carrier; a motion prior mapping module for constructing an elliptical Gaussian kernel; an adaptive structure tensor calculation module for calculating an initial image structure tensor and generating an adaptive structure tensor; and a feature decomposition and segmentation module for extracting a first feature value and a second feature value, and dividing the pixel region in the image stream into real physical edges, pseudo-defect regions, or nonlinear texture regions based on the numerical relationship between the first and second feature values. Based on the topological features of the divided real physical edges, the system determines whether the target object has physical defects and outputs the detection result. This invention effectively prevents the missed rejection window due to the instantaneous load of the industrial control computer exceeding a preset load threshold, ensuring reliable interception of defective products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial vision and automated inspection technology, specifically to a bagging machine conveying inspection system based on industrial vision. Background Technology

[0002] With the continuous development of modern industrial automation, the operating speed of continuous production lines for bagging machines has been significantly improved; this high-speed conveying condition increases the processing complexity of visual inspection of physical defects on the surface of packaging bags.

[0003] Currently, conventional image edge extraction algorithms are generally used to analyze continuous image streams. The system uses edge detection operators to identify abnormal features such as sealing wrinkles or bag cracks in the image. However, traditional image edge detection and segmentation methods rely on static local feature extraction and do not effectively combine the instantaneous motion state of the transported object. Although these methods can extract basic structural contour information, they are prone to misjudging motion blur as real cracks when high-speed operation causes image motion blur and when optical shadows are generated by the deformation of flexible object surfaces. In addition, the introduction of highly complex image deblurring algorithms is usually time-consuming and difficult to meet the image processing and analysis requirements of the production line. Therefore, how to accurately and in real time separate the real physical defects of the target object from motion shadow interference in a continuous moving image stream has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a bagging machine conveying and detection system based on industrial vision. Specifically, the technical solution of this invention includes:

[0005] The data fusion acquisition module is configured to acquire the image stream of the target object to be detected on the conveyor in the bagging machine system during continuous movement, and simultaneously acquire the instantaneous velocity scalar and movement direction of the conveyor.

[0006] The motion prior mapping module is configured to establish an image pixel coordinate system, map the instantaneous velocity scalar and motion direction to a motion blur kernel vector in the image pixel coordinate system, and construct an elliptical Gaussian kernel based on the motion blur kernel vector;

[0007] The adaptive structure tensor calculation module is configured to calculate the initial image structure tensor based on the image stream, and to perform anisotropic smoothing on the initial image structure tensor using an elliptical Gaussian kernel to generate the adaptive structure tensor.

[0008] The feature decomposition and segmentation module is configured to perform eigenvalue decomposition on the adaptive structure tensor, extract the first feature value and the second feature value, and divide the pixel region in the image stream into real physical edges, pseudo-defect regions or nonlinear texture regions according to the numerical relationship between the first feature value and the second feature value. Based on the topological features of the divided real physical edges, it determines whether the target object has physical defects and outputs the detection results.

[0009] Optionally, the major axis of the elliptic Gaussian kernel is parallel to the direction of motion of the transport carrier, and the variance of the major axis is directly proportional to the instantaneous velocity scalar. The variance of the minor axis of the elliptic Gaussian kernel is a preset constant. Based on the numerical relationship between the first and second eigenvalues, the pixel regions in the image stream are divided into real physical edges, pseudo-defect regions, or nonlinear texture regions, including:

[0010] If the first feature value is greater than or equal to a preset edge threshold and the second feature value is less than a preset noise threshold, the corresponding pixel region is determined to be a real physical edge; if the first feature value is less than a preset edge threshold and the second feature value is less than a preset noise threshold, the corresponding pixel region is determined to be a pseudo-defect region; if the second feature value is greater than or equal to a preset noise threshold, the corresponding pixel region is determined to be a non-linear texture region.

[0011] Optionally, the data fusion acquisition module includes: an image acquisition unit configured to continuously expose the target object on the conveyor carrier using an industrial area scan camera to acquire an image stream; a velocity acquisition unit configured to acquire pulse count values ​​using a servo motor encoder and calculate the pulse count values ​​using a discrete difference operator to obtain an instantaneous velocity scalar and the direction of motion; and a synchronization triggering unit configured to synchronize the industrial area scan camera and the servo motor encoder via a hardware trigger line to ensure that the image stream and the instantaneous velocity scalar are strictly aligned in the time dimension.

[0012] Optionally, the adaptive structure tensor calculation module includes: a gradient calculation unit, configured to use a discrete difference operator to calculate the horizontal and vertical gradients of the image frames in the image stream; and a tensor matrix construction unit, configured to construct an initial image structure tensor based on the horizontal and vertical gradients through gradient outer product operations.

[0013] Anisotropic diffusion units are configured to acquire the pose information of the target object in the image stream and determine the sealing direction of the target object. Spatial convolution operations are performed on each feature component layer of the initial image structure tensor through an elliptical Gaussian kernel. Spatial integral smoothing is performed in the motion direction of the transport carrier, and gradient sensitivity is preserved in the direction orthogonal to the motion direction and close to the sealing direction, thereby generating an adaptive structure tensor.

[0014] Optionally, the feature decomposition and segmentation module further includes: a physical attribute mapping unit, configured to map the real physical edge to the wrinkled area or broken crack area on the surface of the target object, and to map the pseudo defect area to the optical shadow area or motion blur area generated by the flexible deformation of the target object; and a defect confirmation unit, configured to extract the topological contour of the real physical edge as a topological feature, and to confirm that the target object has a physical defect in response to the size of the topological contour exceeding or equal to a preset size threshold.

[0015] Optionally, the system also includes: a delay constraint evaluation module, configured to calculate the total processing delay from acquiring the image stream to confirming that the target object has a physical defect, acquire the preset physical distance between the detection station and the rejection station on the transport carrier, and calculate the physical movement time of the target object to the rejection station in combination with the instantaneous speed scalar; and determine whether the total processing delay is less than the physical movement time.

[0016] The feedback rejection module is configured to send a rejection control command to the cylinder rejection mechanism located at the rejection station if the total processing delay is less than the physical movement time and the target object has a physical defect; if the total processing delay is greater than or equal to the physical movement time, a delay alarm signal is sent to the preset system control console.

[0017] Optionally, the motion prior mapping module includes: a coordinate system construction unit, configured to set the one-dimensional physical velocity direction of the transport carrier as the vertical axis and the horizontal direction perpendicular to the one-dimensional physical velocity direction as the horizontal axis to construct an image pixel coordinate system; and a modulation coefficient application unit, configured to calculate and extract the vertical scaling coefficient corresponding to the instantaneous velocity scalar in the image pixel coordinate system according to the preset linear mapping relationship between velocity and pixel trailing, and use the vertical scaling coefficient to generate a motion blur kernel vector.

[0018] Optionally, the target object is a flexible packaging bag, the conveying carrier is a bagging machine conveyor belt; the image stream is a grayscale image matrix, and the bit depth of the grayscale image matrix is ​​a preset fixed bit depth; the first eigenvalue represents the energy distribution of the local region of the image in the direction of the dominant gradient, and the second eigenvalue represents the energy distribution of the local region of the image orthogonal to the direction of the dominant gradient.

[0019] Optionally, the system also includes: an environmental monitoring module configured to acquire the current ambient light intensity and the reference operating speed of the transport carrier; and a threshold adaptive adjustment module configured to, in response to the current ambient light intensity being lower than a preset light threshold or the reference operating speed being higher than a preset speed threshold, lower a preset edge threshold and a preset noise threshold according to a preset ratio; and to, in response to the current ambient light intensity being higher than or equal to the preset light threshold and the reference operating speed being lower than or equal to the preset speed threshold, maintain the preset edge threshold and the preset noise threshold unchanged.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] 1. This system integrates image stream and instantaneous velocity information, constructs an elliptical Gaussian kernel that is positively correlated with the motion state to smooth the structure tensor, and classifies it based on eigenvalue decomposition. This mechanism can effectively separate real physical defects from motion shadows and interference under high-speed transmission without relying on highly complex blind deblurring algorithms, ensuring the real-time performance and accuracy of production line inspection.

[0022] 2. This system uses a hardware trigger line to synchronize the industrial area scan camera with the servo motor encoder, and obtains the aligned image stream and instantaneous speed information from the sampling source. This mechanism effectively avoids the working condition matching error caused by software scheduling delay or sudden changes in production line speed, ensures the accuracy of fuzzy kernel construction parameters, and reduces the risk of misjudgment and missed judgment caused by it.

[0023] 3. This system introduces the orientation information of the target object during the anisotropic diffusion process. While performing strong spatial integration along the conveying direction, it retains gradient sensitivity in the sealing direction. This mechanism takes into account both the motion law and the geometric orientation of the packaging bag itself. Even when the packaging bag deflects at an angle smaller than the preset tolerance angle, it can prevent cracks with actual dimensions smaller than the preset size threshold from being erased by the smoothing algorithm, thus improving the detection sensitivity.

[0024] 4. This system further maps the underlying pixel classification results into physical attribute categories such as wrinkles, cracks, or shadows, and combines them with the topological contour dimensions for final confirmation. This mechanism transforms abstract tensor features into physical semantics that closely resemble actual production processes, providing the system with reliable scale criteria and offering an intuitive basis for on-site operators to adjust process parameters and set rejection strategies.

[0025] 5. This system introduces a delay constraint evaluation module, which compares the total processing delay with the physical movement time of the target object to the rejection station in real time, and performs rejection or alarm accordingly. This mechanism tightly closes the visual inspection results with the physical control link of the automated production line, effectively preventing the rejection window from being missed due to the instantaneous load of the industrial control computer exceeding the preset load threshold, and ensuring the reliable interception of non-conforming products.

[0026] 6. This system monitors the ambient light intensity and baseline operating speed in real time, and adaptively lowers the edge threshold and noise threshold proportionally when the light intensity is insufficient or the production speed is too high. This mechanism actively compensates for the weakening of the image signal-to-noise ratio caused by the environment where the light intensity is lower than the preset light threshold, while maintaining the consistency of the core classification rules. This allows defect features with feature quantity lower than the preset feature threshold to still be stably detected under dynamic fluctuation conditions. Attached Figure Description

[0027] The present invention will be further explained below with reference to the accompanying drawings and embodiments:

[0028] Figure 1 This is a schematic diagram of the module of the bagging machine conveying and detection system based on industrial vision provided in the embodiments of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0030] A bagging machine conveyor inspection system based on industrial vision, comprising:

[0031] The data fusion acquisition module is configured to acquire the image stream of the target object to be detected on the conveyor in the bagging machine system during continuous movement, and simultaneously acquire the instantaneous velocity scalar and movement direction of the conveyor.

[0032] The motion prior mapping module is configured to establish an image pixel coordinate system, map the instantaneous velocity scalar and motion direction to a motion blur kernel vector in the image pixel coordinate system, and construct an elliptical Gaussian kernel based on the motion blur kernel vector;

[0033] The adaptive structure tensor calculation module is configured to calculate the initial image structure tensor based on the image stream, and to perform anisotropic smoothing on the initial image structure tensor using an elliptical Gaussian kernel to generate the adaptive structure tensor.

[0034] The feature decomposition and segmentation module is configured to perform eigenvalue decomposition on the adaptive structure tensor, extract the first feature value and the second feature value, and divide the pixel region in the image stream into real physical edges, pseudo-defect regions or nonlinear texture regions according to the numerical relationship between the first feature value and the second feature value. Based on the topological features of the divided real physical edges, it determines whether the target object has physical defects and outputs the detection results.

[0035] The major axis of the elliptic Gaussian kernel is parallel to the direction of motion of the transport carrier, and the variance of the major axis is directly proportional to the instantaneous velocity scalar. The variance of the minor axis of the elliptic Gaussian kernel is a preset constant. Based on the numerical relationship between the first eigenvalue and the second eigenvalue, the pixel regions in the image stream are divided into real physical edges, pseudo-defect regions, or nonlinear texture regions, including: if the first eigenvalue is greater than or equal to a preset edge threshold and the second eigenvalue is less than a preset noise threshold, then the corresponding pixel region is determined to be a real physical edge; if the first eigenvalue is less than the preset edge threshold and the second eigenvalue is less than the preset noise threshold, then the corresponding pixel region is determined to be a pseudo-defect region; if the second eigenvalue is greater than or equal to the preset noise threshold, then the corresponding pixel region is determined to be a nonlinear texture region.

[0036] This embodiment provides a bagging machine conveying detection mechanism based on industrial vision, such as... Figure 1 As shown; specifically, the mechanism is deployed on a continuously operating bagging machine production line. After the packaging bags are filled and heat-sealed, the conveyor belt sequentially sends the packaging bags into the inspection station. An industrial camera is installed above the inspection station, and a servo encoder is installed on the side of the conveyor belt. Within a preset time window when the packaging bags pass through the inspection field of view, the system uses image stream and conveyor speed information to make online judgments on sealing wrinkles, bag cracks and local damage, and provides the inspection results before the subsequent rejection station.

[0037] Specifically, the system obtains multiple frames of images of the current packaging bag from a continuous image stream, and simultaneously obtains the instantaneous velocity scalar and motion direction at the corresponding moment. The motion direction here is usually kept in a single direction along the conveyor belt on a conventional production line, but due to situations such as start-stop, shaking, or rewind testing, the direction can also be positive or negative. The system maps the velocity information in the physical domain to the image pixel coordinate system.

[0038] For ease of understanding, we can assume that the horizontal direction is x and the vertical direction is y in the image coordinate system. When the conveyor belt is running along the positive y direction, if the speed at a certain moment corresponds to a vertical trailing shadow of 3 pixels in the image during each frame of exposure, then a motion blur kernel vector [0,3] can be formed.

[0039] Specifically, the system extracts the longitudinal scaling factor based on the instantaneous speed scalar and configures the variance of the major axis as a linear growth function related to the longitudinal scaling factor. For example, if the variance of the minor axis is fixed at 1, and the variance of the major axis is 1, the variance of the major axis can increase from 2 to 5 with the increase of the longitudinal scaling factor brought by the speed, in order to reflect the fuzzy accumulation of positive correlation along the conveying direction under high-speed operation.

[0040] The system calculates the initial image structure tensor for image frames; it can use discrete gradients to obtain the horizontal and vertical gradients at each pixel, and then form a two-dimensional tensor through gradient cross product; to clearly illustrate its physical meaning, an example is assumed: if in a certain 3×3 local region, the sealing edge mainly extends in the left and right direction, then the horizontal gradient of the corresponding region is greater than the first preset gradient threshold and the vertical gradient is less than the second preset threshold; the resulting tensor has concentrated energy in one main direction and weaker energy in another direction;

[0041] The system does not directly use the initial result for classification, but instead uses the aforementioned elliptical Gaussian kernel to anisotropically smooth the tensor. Since the smoothing has a greater smoothing weight along the transport direction, the motion noise and shadow easing components in the motion direction will be canceled out by the integral, while the edges that meet the preset aspect ratio threshold in the orthogonal direction can still be preserved.

[0042] After obtaining the adaptive structure tensor, the system performs eigenvalue decomposition on each pixel region to extract the first and second eigenvalues. To facilitate the explanation of the eigenvalue extraction process, the system treats the adaptive structure tensor as a local positive semi-definite symmetric matrix. If the diagonal elements of this matrix are denoted as tensor variables A and B, and the off-diagonal cross term is denoted as cross variable C, then the trace of this symmetric matrix, i.e., the sum of A and B, and the corresponding determinant, i.e., the product of A and B minus the square of C, can be obtained first. The solution is then obtained using the quadratic characteristic equation formula:

[0043] ;

[0044] in, Let represent two algebraic eigenvalues ​​derived from a local positive semidefinite symmetric matrix. The larger and smaller values ​​obtained directly from algebraic analysis are taken as the first and second eigenvalues, respectively. The classification process can be further illustrated by numerical derivation. Suppose that after decomposition, a region has a first eigenvalue of 12 and a second eigenvalue of 1. The preset edge threshold is 8 and the preset noise threshold is 3. Then, if the first eigenvalue is greater than or equal to the edge threshold and the second eigenvalue is less than the noise threshold, the region is determined to be a real physical edge.

[0045] If another region has a first feature value of 4 and a second feature value of 1, it indicates that the local change is below the lower limit threshold of the feature value and belongs to a pseudo-defect region. If a region has a first feature value of 10 and a second feature value of 6, it indicates that there is energy greater than the preset energy threshold in both orthogonal directions. This usually corresponds to texture, wrinkles, printing pattern interference or nonlinear shadow regions and is classified as a nonlinear texture region.

[0046] After completing pixel-level segmentation, the system does not directly identify all real physical edges as defects. Instead, it further extracts topological features such as connectivity, length, closure degree, and direction consistency between these edges. For example, if an edge with continuous length, abrupt direction, and crossing the heat-sealed boundary is detected in the sealing area, it is more likely to correspond to an actual crack. If it is just an isolated short line segment that does not form a stable connected structure, it is more likely to be a transient indentation or noise. Based on this, the system determines whether the target object has physical defects and outputs a qualified or unqualified detection result.

[0047] As an anomaly protection method, when the instantaneous velocity data is missing, image frames are lost, or the timestamps of the two cannot be aligned, the system will prioritize marking the current packaging bag as pending verification rather than directly accepting it as qualified, in order to avoid missed detections. If the reversal frequency of the motion direction between adjacent frames exceeds the preset frequency threshold, it indicates that there may be encoder anomalies or mechanical rebound. At this time, the kernel parameters corresponding to the previous stable direction can be frozen, and the current frame can be included in the anomaly cache queue. If the two feature values ​​of a certain region are both close to zero and the area is smaller than the smallest analysis unit, it can be directly ignored as background to avoid mistakenly incorporating static dark noise into the false defect region.

[0048] For example, on a food bagging production line that processes up to the rated throughput per minute, after the packaging bags are sealed, they enter the inspection station; due to material offset, a bulge with a deformation height within the preset tolerance range appears on the surface of a certain bag of products, while the conveyor belt is in the acceleration section; in the image captured by the industrial camera, the shadow of the bulge trails along the conveying direction, which is easily mistaken for a crack by conventional edge detection.

[0049] In this embodiment, the system uses the real-time speed given by the encoder to construct an elliptical Gaussian kernel with the major axis along the conveying direction. After directional smoothing of the structural tensor, the bulge shadow is classified into the pseudo-defect region, while a fracture edge with a length of about a few millimeters and a stable direction at the sealing point is retained and is ultimately determined to be a real defect.

[0050] The purpose of this step is to directly couple the external physical prior of transport motion into the image structure analysis process, thereby achieving effective separation of real physical edges from shadows, blur, and texture interference under high-speed transport, and completing real-time detection without relying on blind deblurring algorithms with computational complexity exceeding a preset threshold.

[0051] Furthermore, the data fusion acquisition module includes: an image acquisition unit configured to continuously expose the target object on the conveyor carrier using an industrial area scan camera to acquire an image stream; a velocity acquisition unit configured to acquire pulse count values ​​using a servo motor encoder and calculate the pulse count values ​​using a discrete differential operator to obtain an instantaneous velocity scalar and the direction of motion; and a synchronization triggering unit configured to synchronize the industrial area scan camera and the servo motor encoder via a hardware trigger line to ensure that the image stream and the instantaneous velocity scalar are strictly aligned in the time dimension.

[0052] This embodiment provides a data fusion acquisition mechanism for strict alignment of image and motion information. Specifically, in the aforementioned production line scenario, when loose alignment is achieved solely by relying on image frame sequence numbers and software timestamps, mismatches can easily occur when the variance of the conveying speed fluctuation exceeds a preset fluctuation threshold or the scheduling delay of the industrial control computer exceeds a preset delay threshold. This can lead to errors in the selection of the elliptical Gaussian kernel. Therefore, this embodiment further employs an industrial area scan camera, a servo motor encoder, and a hardware trigger line to form a synchronous acquisition link, ensuring that the image stream and speed information maintain a consistent time reference at the sampling source.

[0053] Specifically, the image acquisition unit can be configured as a fixed-focal-length industrial area array camera to continuously expose the packaging bags passing through the inspection station, forming an image stream arranged according to the sampling time sequence; the speed acquisition unit reads the pulse count value from the servo encoder and calculates the instantaneous speed through discrete difference; to illustrate with a simplified example, if the encoder count values ​​at three consecutive sampling times are 1000, 1012, and 1027 respectively, and the sampling interval is the same, then the pulse increment in the previous time period is 12, and the pulse increment in the next time period is 15; given that each pulse corresponds to a fixed conveying displacement, the speed can be calculated from the first preset speed value to a second preset speed value greater than the first preset speed value; if the pulse increment is negative, it indicates that the conveying direction is reversed, and the system synchronously updates the motion direction indicator;

[0054] The synchronous trigger unit associates the camera exposure start signal with the encoder sampling clock through a hardware trigger line. For example, the camera completes one frame exposure each time it receives a trigger pulse, while the encoder latches the pulse count at the corresponding moment on the same trigger edge. In this way, image frames F1, F2, and F3 can correspond to velocity samples V1, V2, and V3 respectively, without needing to rely on the software timestamp scheduled by the operating system for secondary matching. For subsequent motion prior mapping, each image frame can obtain a velocity input that strictly corresponds to its exposure period.

[0055] As an anomaly protection method, if the encoder does not return a new count value within a certain trigger cycle, the system can set the frame speed to the previous stable value and add a speed maintenance mark to the current frame; if there is no change for several consecutive cycles, the bag product is switched to a low confidence mode, and subsequent re-inspection can be selected; if the trigger line jitters, causing multiple edges to be detected in a single frame, the first valid edge is used as the latch point, and pulses with a pulse width less than the preset pulse width threshold are ignored to prevent repeated exposure or repeated counting; if the camera frame is successfully acquired but the encoder sampling fails, the defect confirmation can be temporarily suspended, and a synchronization anomaly status can be output.

[0056] For example, on the same bagging production line, if a software polling method is used to read images at the instant the conveyor belt rises from 2.0 m / s to 2.6 m / s, the image frame may still be incorrectly matched to the lower speed, resulting in the major axis of the subsequently constructed elliptical Gaussian kernel being too short, which cannot fully suppress motion blur. In this embodiment, since the camera exposure and encoder latching are driven by the same hardware trigger source, the system can obtain the updated speed sample in real time at the moment of acceleration, thereby providing an accurate motion prior for each frame.

[0057] The purpose of this step is to ensure strict consistency between the image stream and the instantaneous velocity scalar in the time dimension, thereby achieving the accuracy of subsequent blur kernel construction and reducing the risk of misjudgment and missed judgment due to synchronization deviation.

[0058] Furthermore, the adaptive structure tensor calculation module includes: a gradient calculation unit, configured to use a discrete difference operator to calculate the image frames in the image stream to obtain the horizontal and vertical gradients; and a tensor matrix construction unit, configured to construct an initial image structure tensor based on the horizontal and vertical gradients through gradient outer product operations.

[0059] Anisotropic diffusion units are configured to acquire the pose information of the target object in the image stream and determine the sealing direction of the target object. Spatial convolution operations are performed on each feature component layer of the initial image structure tensor through an elliptical Gaussian kernel. Spatial integral smoothing is performed in the motion direction of the transport carrier, and gradient sensitivity is preserved in the direction orthogonal to the motion direction and close to the sealing direction, thereby generating an adaptive structure tensor.

[0060] This embodiment provides an adaptive structural tensor calculation mechanism. Specifically, in the aforementioned scheme, although a motion-related elliptical Gaussian kernel has been constructed based on the conveying speed, if the orientation of the packaging bag itself is still ignored, especially when the packaging bag enters the field of view and there is a slight deflection, folding, or non-horizontal sealing line, simply analyzing the edge according to a fixed coordinate direction may still weaken the real defects at the sealing point. Therefore, this embodiment further introduces orientation information and sealing direction determination, so that the anisotropic smoothing conforms to the conveying direction and also takes into account the geometric orientation of the target object itself.

[0061] Specifically, the gradient calculation unit can use center difference, forward difference, or backward difference to calculate the horizontal and vertical gradients pixel by pixel in the image frame. For ease of understanding, we can assume that in a certain 3×3 image block, the gray value of the left column is approximately 20, the middle column is 80, and the right column is 85. Then, the horizontal gray value change in this area is obvious, and the horizontal gradient is large. If the gray values ​​of the top, middle, and bottom rows are similar, the vertical gradient is small.

[0062] The tensor matrix construction unit uses the outer product of these two types of gradients to obtain a 2×2 initial structure tensor for each pixel; the matrix construction process of this outer product operation is as follows: if the pixel horizontal gradient scalar extracted by the operator is... The vertical gradient scalar is Then the tensor outer product operation can be expressed as the multiplication of a column vector and a row vector, that is:

[0063] ;

[0064] The resulting initial image structure tensor is a symmetric matrix:

[0065] ;

[0066] If a pixel has a horizontal gradient of 4 and a vertical gradient of 1, then the corresponding tensor can be understood as a structural description where the gradient magnitude in the local principal direction is greater than a preset first magnitude threshold and the gradient magnitude in the orthogonal direction is less than a preset second magnitude threshold.

[0067] Based on this, the anisotropic diffusion unit first obtains the pose information of the target object in the image; the pose can be determined by the outer contour of the packaging bag, the printing baseline, the long side direction of the sealing strip area, etc.; for example, the system first extracts the position of the sealing strip at the top edge of the packaging bag after coarse segmentation, and then calculates its main extension direction to obtain the angle between the sealing direction and the horizontal axis of the image; if the angle is 8°, it indicates that the packaging bag has a slight rotation in the field of view; at this time, although the major axis of the elliptical Gaussian kernel is still consistent with the transport direction, the sealing direction can be used as the priority direction to retain gradient sensitivity when performing tensor smoothing and subsequent defect interpretation;

[0068] Furthermore, when performing strong spatial integration in the transport direction, it essentially applies the constructed two-dimensional kernel mask matrix to each component layer of the initial image structure tensor, i.e., the spatial feature layer corresponding to the squared horizontal gradient. Spatial feature layers corresponding to cross gradients and the corresponding spatial feature layer with squared vertical gradient Furthermore, two-dimensional spatial convolution is performed independently on the aforementioned layers to ensure that the original abrupt gradient is preserved as much as possible in the direction orthogonal to the conveying direction and close to the sealing direction.

[0069] To illustrate the processing effect using a specific local feature as an example: Suppose there are two types of regions near the seal: Region A is a real crack, with local gradients showing horizontal gradients greater than a preset threshold and vertical gradients less than a preset threshold; Region B is a bulge shadow, with local gradients showing horizontal gradients less than a preset threshold and vertical gradients less than a preset threshold, and the range exceeding a preset width threshold; After spatial integration with a larger weight along the conveying direction, the shadow in Region B with a gradient change rate lower than a preset change rate threshold is further homogenized, while the gradient peak in Region A in the sealing direction is still retained; Therefore, in subsequent eigenvalue decomposition, Region A is more likely to show energy concentration in a single principal direction, while Region B is more likely to degenerate into a low-energy region;

[0070] As an anomaly protection mechanism, if posture information extraction fails, for example, if the outer contour of the packaging bag is obscured, the sealing tape is incomplete, or the printing interference noise exceeds the preset signal-to-noise ratio threshold, the system can revert to the default posture, that is, set the sealing direction to be consistent with the horizontal direction of the image, and add a posture confidence mark to the output result; if the tilt angle of the packaging bag is greater than the preset tilt threshold, causing the angle between the sealing direction and the conveying direction to be greater than the preset upper limit value, such as exceeding the preset limit value, the bag product can be directly marked as a posture anomaly, and a reshoot or individual rejection can be selected; if a saturated region appears in the local gradient calculation, causing the gradient value to exceed the sensor's preset range upper limit, the amplitude of this region can be limited before tensor construction to avoid bright spots dominating the overall structural analysis;

[0071] For example, on the bagging machine production line, a flexible packaging bag enters the detection field of view at a slightly oblique angle due to the instability of the front guide; its sealing line rotates about 10° relative to the horizontal line, while the conveyor belt maintains high-speed operation; the system first identifies the posture of the packaging bag, and then constructs an orientation smoothing mechanism in combination with the direction of movement to process the internal components of the structural tensor separately; as a result, a diagonal fine crack at the seal is preserved, while the large shadow caused by the bulging of the bag is weakened, and the defect area is finally extracted stably;

[0072] The purpose of this step is to further utilize the target object's attitude information beyond the velocity prior, thereby achieving anisotropic tensor smoothing that better reflects actual working conditions and improving sensitivity to directional defects such as sealing cracks and wrinkles.

[0073] Furthermore, the feature decomposition and segmentation module also includes: a physical attribute mapping unit, configured to map the real physical edge to the wrinkled area or broken crack area on the surface of the target object, and to map the pseudo defect area to the optical shadow area or motion blur area generated by the flexible deformation of the target object; and a defect confirmation unit, configured to extract the topological contour of the real physical edge as a topological feature, and to confirm that the target object has a physical defect in response to the size of the topological contour exceeding or equal to a preset size threshold.

[0074] This embodiment provides a mechanism to further extend from feature classification results to physical attribute interpretation and defect confirmation. Specifically, the aforementioned scheme can already divide pixel regions into real physical edges, pseudo-defect regions, and non-linear texture regions. However, in actual production lines, simply staying at the edge type classification level still has a deficiency: on-site operators are more concerned with the physical meaning of defects, such as sealing wrinkles, bag cracks, or simply shadows caused by bulges. Without this mapping layer, although the system can output abnormal pixels, it is not conducive to subsequent process adjustments and rejection strategy settings. Therefore, this embodiment further adds physical attribute mapping and defect confirmation processes.

[0075] Specifically, the physical attribute mapping unit converts the region categories obtained in the previous stage into surface phenomenon labels that are closer to the actual process. For real physical edges that meet the strong response in a single principal direction, they can be further subdivided according to location, direction, and connectivity. For example, if the edge is located inside the heat-sealing strip, is short and dense, and is generally parallel to the sealing line, it can be mapped as a wrinkled area. If the edge crosses the bag boundary or extends from the sealing line into the bag, and has a slenderness ratio greater than the preset aspect ratio threshold, it is more likely to be mapped as a broken or cracked area. For areas previously judged as false defects, their grayscale gradient range, area width, and motion direction consistency are combined to map them as optical shadow areas or motion blur areas.

[0076] Based on this, the defect confirmation unit extracts the topological contour of the actual physical edge and makes a final confirmation based on the size threshold. The size here can be the contour length, the bounding box width, the area, or the maximum span. For example, suppose three connected contours C1, C2, and C3 are extracted from the sealing area, with lengths of 2, 7, and 11 pixels respectively. The preset size threshold is 6 pixels. Then C2 and C3 enter the defect candidate set. If C2 exceeds the threshold but is located at the edge of the printing area and has a disordered direction, it can be excluded in post-processing. If C3 is located in the middle of the heat-sealing tape and has a stable extension direction, then the existence of a physical defect can be confirmed. In this way, the system output is no longer just an anomaly in a certain area, but a crack in the sealing or an obvious wrinkle is detected.

[0077] As an anomaly protection method, if there are too many real physical edges and they are fragmented, it indicates that the image may be contaminated, the packaging bag surface is too reflective, or the threshold setting is too low. In this case, contour merging and small fragment removal can be performed first, and then size judgment can be made. If all contours do not exceed the size threshold, the current bag product can be marked as having no confirmed defects, but it can still be recorded as a minor anomaly for statistical analysis. If the mapping results conflict, such as the same contour simultaneously meeting some conditions of wrinkles and cracks, the judgment can be based on whether it crosses the sealing boundary. If it still cannot be resolved, it can be output as pending manual review.

[0078] For example, on this bagging production line, due to fluctuations in heat sealing temperature, a twisted linear mark with a length exceeding a preset abnormal length threshold forms at the sealing edge of one bag. After the aforementioned structural tensor analysis, this area is identified as a real physical edge. In this embodiment, based on its characteristics of being located within the heat-sealing strip, having a direction nearly parallel to the sealing line, and having a length exceeding the threshold, it is mapped as a sealing wrinkle, and the physical defect of the bag is confirmed. Another bag only has a shadow trail caused by material accumulation on its surface, which is mapped as an optical shadow and does not enter the unqualified judgment.

[0079] The purpose of this step is to further transform abstract image feature categories into executable defect semantics and contour scale criteria, thereby achieving a closed loop from pixel analysis to process defect confirmation.

[0080] Furthermore, the system also includes: a delay constraint evaluation module, configured to calculate the total processing delay from acquiring the image stream to confirming that the target object has a physical defect, acquire the preset physical distance between the detection station and the rejection station on the conveyor, and calculate the physical movement time of the target object to the rejection station in combination with the instantaneous speed scalar; determine whether the total processing delay is less than the physical movement time; and a feedback rejection module, configured to send a rejection control command to the cylinder rejection mechanism arranged at the rejection station if the total processing delay is less than the physical movement time and the target object has a physical defect; and send a delay alarm signal to the preset system control console if the total processing delay is greater than or equal to the physical movement time.

[0081] This embodiment provides a delay constraint evaluation and feedback rejection mechanism coupled with the physical production line cycle time. Specifically, the aforementioned scheme can identify whether there are defects in the packaging bag, but on a high-speed production line, the detection result alone is still insufficient to guarantee actual usability. The reason is that if the total time spent on image acquisition, calculation and analysis, and execution control exceeds the running time of the packaging bag from the detection station to the rejection station, even if the judgment is correct, the rejection opportunity will be missed, causing defective products to flow into the later stage. Therefore, this embodiment further introduces a comparison logic between processing delay and physical movement time.

[0082] Specifically, the delay constraint evaluation module starts timing from the beginning of image acquisition until the defect confirmation is completed, accumulating the total processing delay. This total processing delay can be composed of multiple parts, such as image transmission time, tensor calculation time, contour analysis time, and control command preparation time. At the same time, the system pre-stores the physical distance between the inspection station and the rejection station, and calculates the time required for the packaging bag to move to the rejection station based on the current instantaneous speed.

[0083] For example: if the distance between two workstations is 0.6 meters and the current conveyor speed is 2.0 meters per second, the physical movement time is approximately 300 milliseconds; if the total processing delay is 45 milliseconds, it is determined to be less than 300 milliseconds, and the system has an effective rejection window; if the current conveyor belt speed reaches the preset second speed range and the speed increases to 4.0 meters per second, the physical movement time is shortened to approximately 150 milliseconds, but the total processing delay increases to 170 milliseconds due to network congestion and increased buffering, indicating that reliable rejection cannot be completed within the time limit;

[0084] The feedback rejection module executes actions based on the above comparison results. When a physical defect is confirmed and the total processing delay is less than the physical movement time, the system further calculates the estimated time when the target object will arrive at the rejection station based on the current speed, and sends a rejection control command to the cylinder rejection mechanism before that time. If the total processing delay is greater than or equal to the physical movement time, the rejection command will no longer be issued blindly, but a delay alarm signal will be output to the system console to indicate that the current detection link no longer meets the real-time requirements, so as to avoid mistakenly rejecting the normal packaging bags behind it.

[0085] As an anomaly protection method, if the current instantaneous speed is unavailable, the nearest stable speed within a short time window can be used instead, but this will reduce the reliability of timing prediction. If the rejection mechanism itself is in a faulty state, such as abnormal cylinder pressure or action count overflow, even if the time condition is met, the rejection command should be suspended and converted to a fault alarm. If the distance between multiple defective packaging bags is less than the minimum safe rejection distance, causing a single rejection action to affect adjacent qualified bags, a minimum rejection interval check can be introduced. When the interval is insufficient, a cycle conflict alarm should be output first.

[0086] For example, on this bagging production line, the system detects a bag with a cracked seal. At this time, the distance from the detection station to the rejection station is 800 mm, and the current conveying speed is 2.5 m / s. It takes about 320 milliseconds for the bag to reach the rejection station. The system takes only 38 milliseconds from image acquisition to defect confirmation, which meets the real-time constraint. Therefore, after an appropriate delay, the system controls the cylinder to act and rejects the defective bag. If the total processing delay rises to 340 milliseconds due to a sudden increase in the load on the industrial control computer, the system will switch to sending a delay alarm to prompt a pause on relying on the automatic rejection result.

[0087] The purpose of this step is to close the link between the image detection results and the real-time control of the production line, thereby achieving automated closed-loop control from defect detection to timely removal.

[0088] Furthermore, the motion prior mapping module includes: a coordinate system construction unit, configured to set the one-dimensional physical velocity direction of the transport carrier as the vertical axis and the horizontal direction perpendicular to the one-dimensional physical velocity direction as the horizontal axis, to construct an image pixel coordinate system; and a modulation coefficient application unit, configured to calculate and extract the vertical scaling coefficient corresponding to the instantaneous velocity scalar according to the preset linear mapping relationship between velocity and pixel shadow in the image pixel coordinate system, and use the vertical scaling coefficient to generate a motion blur kernel vector.

[0089] This embodiment provides a more refined motion prior mapping mechanism. Specifically, in the aforementioned scheme, although it has been explained that velocity information is mapped to a motion blur kernel in the image, if the correspondence between the physical transport direction and the image coordinates is not clearly defined, errors in kernel direction setting can easily occur when the camera installation angle changes, the field of view is cropped, or the equipment is recalibrated after maintenance. To address this, this embodiment uses coordinate system construction and modulation coefficient application to make the velocity-to-pixel kernel conversion process reproducible and calibrable.

[0090] Specifically, the coordinate system construction unit defines the one-dimensional physical velocity direction of the transport carrier as the vertical axis in the image and its perpendicular direction as the horizontal axis. Here, the vertical axis is not necessarily the same as the natural column direction of the original pixel array of the sensor, but rather the analytical coordinate after installation and calibration. In other words, as long as the system obtains the projection of the transport direction in the image through calibration, this direction can be uniformly used as the kernel major axis direction. In this way, even if the camera rotates slightly, subsequent calculations can still be completed under the unified analytical coordinate.

[0091] The modulation coefficient application unit further converts the instantaneous velocity scalar into a longitudinal scaling factor. A linear scaling relationship can be used, for example, the average trailing length of 2 pixels during exposure corresponds to a conveying speed of 1 meter per second in a production line. When the instantaneous speed is 1.5 meters per second, the longitudinal scaling factor can be 3; when the speed is 2.5 meters per second, the factor can be 5. This generates a motion blur kernel vector. If the horizontal direction is not directly affected by the main conveying motion in the analysis coordinates, the kernel vector can be approximately written in the form of [0,5], indicating that the main blur expands along the longitudinal direction. Based on this kernel vector, the major axis scale and direction of the elliptical Gaussian kernel can be determined.

[0092] As an anomaly protection method, if the calibration result shows that the angle between the conveying direction and the image axis exceeds the preset angle tolerance, it indicates that the camera installation may be misaligned beyond the allowable range. In this case, recalibration can be requested or the image can be rotated and corrected before proceeding to the next process. If the speed scalar exceeds the rated range of the equipment, for example, if a value suddenly exceeds the preset speed upper limit threshold, it is first determined to be a sensor anomaly, and the longitudinal scaling factor is limited to the preset maximum value to prevent the construction of an excessively large blur kernel. If the speed is lower than the preset minimum effective operating speed threshold, the longitudinal scaling factor can be reduced to the minimum value, so that the elliptic kernel approximately degenerates into a smaller scale kernel to adapt to the stop or slow debugging conditions.

[0093] For example, at the bagging machine site, after the maintenance personnel replaced the camera bracket, the camera rotated slightly relative to the conveying direction. After the system was recalibrated, the new conveying projection direction was defined as the vertical axis in the analysis coordinates, and the vertical scaling factor was calculated based on the current speed. In this way, even if the packaging bag in the original image is moving at an angle, the motion blur kernel can still accurately follow the actual conveying direction and will not mistakenly treat the horizontal fine lines as vertical blur.

[0094] The purpose of this step is to establish a clear coordinate bridge between physical motion and image analysis, thereby achieving consistency and maintainability in the construction of the fuzzy kernel.

[0095] Furthermore, the target object is a flexible packaging bag, the conveying carrier is a bagging machine conveyor belt; the image stream is a grayscale image matrix, and the bit depth of the grayscale image matrix is ​​a preset fixed bit depth; the first eigenvalue represents the energy distribution of the local region of the image in the direction of the dominant gradient, and the second eigenvalue represents the energy distribution of the local region of the image orthogonal to the direction of the dominant gradient.

[0096] This embodiment provides a data object and feature semantic constraint mechanism for flexible packaging bag scenarios. Specifically, in the aforementioned scheme, the processing logic of structural tensor and eigenvalue decomposition is applicable to general motion images. However, in order to facilitate industrial implementation, it is necessary to further clarify the target object, image data format, and the actual interpretation of the two eigenvalues. This is beneficial for system deployment and also helps on-site technicians understand the correspondence between classification results and the surface state of packaging bags.

[0097] Specifically, the target object can be a flexible packaging bag, and the conveying carrier is the bagging machine conveyor belt. Flexible packaging bags differ from rigid boxes in that their surface deforms due to the distribution of contents, residual gas, and heat-sealing conditions, making them more prone to shadows, wrinkles, and ghosting. The image stream uses a grayscale image matrix instead of a multi-channel color image, which reduces bandwidth usage and computational load, making it more suitable for real-time processing on high-speed production lines. The bit depth is preferably a preset fixed bit depth, such as 8-bit grayscale. Using a fixed grayscale bit depth facilitates the unified calibration of threshold, gradient amplitude, and eigenvalue range during long-term operation.

[0098] The meanings of the first and second eigenvalues ​​can be understood as follows: The first eigenvalue represents the energy distribution of a local area of ​​the image in the direction of the dominant gradient. The larger the value, the more likely the local area has a unidirectional structure with an energy distribution higher than a preset energy threshold. The second eigenvalue represents the energy distribution in the orthogonal direction. The larger the value, the more likely the local area has changes in multiple directions that are greater than a preset fluctuation threshold.

[0099] For example, if a certain area is a thin crack, it will often show a large first characteristic value and a small second characteristic value; if a certain area is a messy fold or printing texture, both characteristic values ​​will be greater than the preset upper limit threshold; if a certain area is a smooth shadow, both characteristic values ​​will be less than the preset lower limit threshold.

[0100] Further microscopic numerical analysis is used to illustrate this: Suppose that the feature value pairs obtained by decomposing the three pixel regions P1, P2, and P3 are (15,2), (4,1), and (11,8), respectively; among them, P1 has a significant dominant direction and is suitable for classification as a real physical edge; P2 has weak energy in both directions and is suitable for classification as a pseudo-defect; P3 has obvious changes in both directions and is closer to a nonlinear texture or complex wrinkle region; through this semantic constraint, a more direct explanatory relationship is established between the system output and the actual defect phenomenon of the packaging bag;

[0101] As an anomaly protection method, if grayscale saturation occurs due to the illumination change rate exceeding the preset illumination fluctuation threshold, and the number of pixels exceeding the preset area ratio threshold approaches the upper limit of the bit depth, the distinguishability of gradients and intrinsic values ​​will decrease. In this case, exposure compensation or limiting processing can be performed first. If there are large-area printed patterns on the surface of the packaging bag, but the on-site requirement is to only detect the seal and bag damage, a position mask can be used to limit the feature value analysis to the sealing strip and edge sensitive areas. If the bit depth is fixed but the camera gain is manually adjusted, causing the feature value distribution of the same defect to drift in different batches, the threshold should be recalibrated.

[0102] For example, on this food bagging production line, the objects to be detected are all heat-sealed flexible packaging bags, and the industrial camera outputs a uniform 8-bit grayscale image matrix. After the system extracts the local structure tensor near the sealing strip, the cracked area of ​​one bag product shows two distinct feature values, one large and one small, while the area of ​​another bag with only light shadows has both feature values ​​that are low, thus achieving stable differentiation.

[0103] The purpose of this step is to clearly define the detection object, image representation, and physical meaning of feature values, thereby achieving consistency in parameter settings, threshold training, and on-site interpretation.

[0104] Furthermore, the system also includes: an environmental monitoring module configured to acquire the current ambient light intensity and the reference operating speed of the transport carrier; and a threshold adaptive adjustment module configured to, in response to the current ambient light intensity being lower than a preset light threshold or the reference operating speed being higher than a preset speed threshold, lower a preset edge threshold and a preset noise threshold according to a preset ratio; and to, in response to the current ambient light intensity being higher than or equal to the preset light threshold and the reference operating speed being lower than or equal to the preset speed threshold, maintain the preset edge threshold and the preset noise threshold unchanged.

[0105] This embodiment provides a threshold self-adjustment mechanism to adapt to environmental changes. Specifically, in the aforementioned scheme, edge thresholds and noise thresholds can achieve basic classification. However, on actual production lines, ambient lighting and conveyor cycle time are not always stable. If the workshop illumination decreases, the image signal-to-noise ratio will decrease; if the conveyor belt speed increases, motion blur will increase. If a fixed threshold is still used at this time, weak cracks that can be identified may be classified as false defects, or blurred boundary areas may be mistakenly included in nonlinear textures. Therefore, this embodiment further adds environmental monitoring and adaptive threshold adjustment.

[0106] Specifically, the environmental monitoring module acquires the current ambient light intensity and the reference operating speed of the conveyor in real time. This reference operating speed can be the average speed over a time window, distinct from the instantaneous speed frame by frame, and is primarily used to reflect the overall cycle time of the production line. The threshold adaptive adjustment module determines whether to correct the classification thresholds based on the monitoring results. A simplified example illustrates this: Assume a preset light threshold of 300 lux, a preset speed threshold of 2.2 m / s, an original edge threshold of 8, and an original noise threshold of 3. When the current light intensity drops to 240 lux, even though the speed is normal, the system can still lower the two thresholds by a preset ratio, for example, 10%, making them 7.2 and 2.7. The same downward adjustment can be performed when the light intensity is normal but the reference operating speed rises to 2.6 m / s. If the light intensity recovers to 350 lux and the speed drops back to 2.0 m / s, the thresholds remain unchanged from their original settings.

[0107] The significance of this adjustment logic is that, without changing the core classification rules, it allows weak edges to still cross the judgment threshold in adverse environments; at the same time, the noise threshold is lowered synchronously, which can maintain the relative distinction boundary between different categories, rather than just relaxing the edge threshold alone; this is more conducive to maintaining the consistency of classification.

[0108] As an anomaly protection mechanism, if the light intensity sensor malfunctions and continuously returns a fixed value or an out-of-range value, the system can temporarily maintain the threshold based on the stable statistical value over the recent period without immediate and significant adjustments. If the light intensity is lower than the preset lower limit light threshold and the speed is greater than the preset upper limit speed threshold, both triggering conditions are met simultaneously. Although the threshold can be lowered, it will not be lower than the preset absolute lower limit. Therefore, a minimum lower limit can be set to prevent noise from being mistakenly classified as a true edge category over a large area. If the threshold needs to be adjusted back after the environment returns to normal, a gradual recovery can be adopted instead of an instantaneous jump to avoid instability in judgment caused by parameter changes in adjacent batches of products.

[0109] For example, when the bagging production line is operating under low ambient lighting conditions, the local lighting in the workshop is reduced due to the aging of the lamps. At the same time, in order to increase the production rate, the conveyor belt speed is increased. After the system detects that the current light intensity is lower than the threshold and the base speed is higher than the threshold, it automatically lowers the edge threshold and noise threshold proportionally, so that the originally weak crack response at the sealing point can still be identified. After the ambient lighting returns to normal and the normal production speed is restored, the threshold automatically returns to the default state.

[0110] The purpose of this step is to enable the classification threshold to dynamically adapt to changes in ambient lighting and production line pace, thereby achieving a balance between detection sensitivity and stability under different working conditions.

[0111] To verify the reliability of this system, the following continuous operation test data was obtained. Under the conditions of a base operating speed of 2.5 meters per second for the conveyor and an ambient light intensity of 300 lux, the data fusion acquisition module continuously acquired image streams of 10,000 flexible packaging bags. After verification by the feature decomposition and segmentation module, a total of 148 real physical defects were identified, with the first feature value greater than or equal to the preset edge threshold and the second feature value less than the preset noise threshold. Two real physical edges were missed, and three false defect areas were misidentified as physical defects. The delay constraint evaluation module recorded that the average total processing delay from image stream acquisition to confirmation of physical defects in the target object was 42 milliseconds, and the maximum single delay was 51 milliseconds. Combined with the preset physical distance of 800 mm from the detection station to the rejection station, the physical movement time was calculated to be approximately 320 milliseconds. The total processing delay was always less than the physical movement time, and the feedback rejection module sent rejection control commands to the cylinder rejection mechanism on time, successfully verifying the system's real-time interception capability.

[0112] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A bagging machine conveying and detection system based on industrial vision, characterized in that, The system includes: The data fusion acquisition module is configured to acquire the image stream of the target object to be detected on the conveyor in the bagging machine system during continuous movement, and simultaneously acquire the instantaneous velocity scalar and movement direction of the conveyor. The motion prior mapping module is configured to map instantaneous velocity scalars and motion direction to motion blur kernel vectors in the image pixel coordinate system, and construct elliptical Gaussian kernels based on the motion blur kernel vectors; The adaptive structure tensor calculation module is configured to calculate the initial image structure tensor based on the image stream, and to perform anisotropic smoothing on the initial image structure tensor using an elliptical Gaussian kernel to generate the adaptive structure tensor. The feature decomposition and segmentation module is configured to perform eigenvalue decomposition on the adaptive structure tensor, extract the first feature value and the second feature value, and divide the pixel region in the image stream into real physical edges, pseudo-defect regions or nonlinear texture regions according to the numerical relationship between the first feature value and the second feature value. Based on the topological features of the divided real physical edges, it determines whether the target object has physical defects and outputs the detection results.

2. The bagging machine conveying and detection system based on industrial vision according to claim 1, characterized in that, The major axis of the elliptic Gaussian kernel is parallel to the direction of motion of the transport vehicle, and the variance of the major axis is directly proportional to the instantaneous velocity scalar. The variance of the minor axis of the elliptic Gaussian kernel is a preset constant. Based on the numerical relationship between the first and second eigenvalues, pixel regions in the image stream are divided into real physical edges, pseudo-defect regions, or non-linear texture regions, including: If the first feature value is greater than or equal to a preset edge threshold and the second feature value is less than a preset noise threshold, the corresponding pixel region is determined to be a real physical edge; if the first feature value is less than a preset edge threshold and the second feature value is less than a preset noise threshold, the corresponding pixel region is determined to be a pseudo-defect region; if the second feature value is greater than or equal to a preset noise threshold, the corresponding pixel region is determined to be a non-linear texture region.

3. The bagging machine conveying and detection system based on industrial vision according to claim 1, characterized in that, The data fusion acquisition module includes: The image acquisition unit is configured to continuously expose the target object on the transport carrier using an industrial area scan camera to acquire an image stream. The velocity acquisition unit is configured to acquire pulse count values ​​through a servo motor encoder and calculate the pulse count values ​​using a discrete differential operator to obtain the instantaneous velocity scalar and the direction of motion. The synchronization trigger unit is configured to synchronize the industrial area array camera and the servo motor encoder through a hardware trigger line to ensure that the image stream and the instantaneous velocity scalar are strictly aligned in the time dimension.

4. The bagging machine conveying and detection system based on industrial vision according to claim 1, characterized in that, The adaptive structure tensor calculation module includes: The gradient calculation unit is configured to use the discrete difference operator to calculate the horizontal and vertical gradients of the image frames in the image stream; the tensor matrix construction unit is configured to construct the initial image structure tensor based on the horizontal and vertical gradients through gradient outer product operation. Anisotropic diffusion units are configured to acquire the pose information of the target object in the image stream and determine the sealing direction of the target object. Spatial convolution operations are performed on each feature component layer of the initial image structure tensor through an elliptical Gaussian kernel. Spatial integral smoothing is performed in the motion direction of the transport carrier, and gradient sensitivity is preserved in the direction orthogonal to the motion direction and close to the sealing direction, thereby generating an adaptive structure tensor.

5. The bagging machine conveying and detection system based on industrial vision according to claim 1, characterized in that, The feature decomposition and segmentation module also includes: a physical attribute mapping unit, configured to map real physical edges to wrinkled or cracked areas on the surface of the target object, and to map pseudo-defect areas to optical shadow areas or motion blur areas generated by the flexible deformation of the target object; and a defect confirmation unit, configured to extract the topological contour of the real physical edge as a topological feature, and to confirm that the target object has physical defects in response to the size of the topological contour exceeding or equal to a preset size threshold.

6. The bagging machine conveying and detection system based on industrial vision according to claim 5, characterized in that, The system also includes an inspection station and a rejection station, with the conveyor passing through the inspection station and rejection station sequentially; the system also includes: The delay constraint evaluation module is configured to calculate the total processing delay from acquiring the image stream to confirming that the target object has a physical defect, acquire the preset physical distance between the detection station and the rejection station on the conveyor, and calculate the physical movement time of the target object to the rejection station in combination with the instantaneous speed scalar; determine whether the total processing delay is less than the physical movement time; the feedback rejection module is configured to send a rejection control command to the cylinder rejection mechanism arranged at the rejection station if the total processing delay is less than the physical movement time and the target object has a physical defect. If the total processing delay is greater than or equal to the physical movement time, a delay alarm signal is sent to the preset system console.

7. The bagging machine conveying and detection system based on industrial vision according to claim 1, characterized in that, The motion prior mapping module includes: a coordinate system construction unit, configured to set the one-dimensional physical velocity direction of the transport carrier as the vertical axis and the horizontal direction perpendicular to the one-dimensional physical velocity direction as the horizontal axis to construct an image pixel coordinate system; and a modulation coefficient application unit, configured to calculate and extract the vertical scaling coefficient corresponding to the instantaneous velocity scalar in the image pixel coordinate system according to the preset linear mapping relationship between velocity and pixel trailing, and use the vertical scaling coefficient to generate a motion blur kernel vector.

8. The bagging machine conveying and detection system based on industrial vision according to claim 1, characterized in that, The target object is a flexible packaging bag, and the conveying carrier is the bagging machine conveyor belt; the image stream is a grayscale image matrix, and the bit depth of the grayscale image matrix is ​​a preset fixed bit depth; the first eigenvalue represents the energy distribution of the local region of the image in the direction of the dominant gradient, and the second eigenvalue represents the energy distribution of the local region of the image orthogonal to the direction of the dominant gradient.

9. The bagging machine conveying and detection system based on industrial vision according to claim 1, characterized in that, The system also includes: an environmental monitoring module configured to acquire the current ambient light intensity and the reference operating speed of the transport carrier; and a threshold adaptive adjustment module configured to, in response to the current ambient light intensity being lower than a preset light threshold or the reference operating speed being higher than a preset speed threshold, lower a preset edge threshold and a preset noise threshold according to a preset ratio; and to, in response to the current ambient light intensity being higher than or equal to the preset light threshold and the reference operating speed being lower than or equal to the preset speed threshold, maintain the preset edge threshold and the preset noise threshold unchanged.