An image recognition-based bulk container filling port positioning compensation method, system, device and medium
By establishing a global coordinate system and using image recognition technology on the filling production line, the offset of the filling nozzle of the cylindrical container can be monitored and dynamically corrected in real time, which solves the problems of liquid spillage and equipment contamination caused by posture offset during the filling process, and improves filling efficiency and finished product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGHENG WEIGHING APP (SUZHOU) CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-14
Smart Images

Figure CN122391356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of filling positioning compensation technology, and in particular to a method, system, device and medium for positioning compensation of the filling port of bulk containers based on image recognition. Background Technology
[0002] In automated filling production lines, cylindrical bulk containers (such as various bottles, cans, and cylinders) present inherent positioning challenges during unloaded transport due to their structural characteristics. These containers typically have a centrally symmetrical geometry, a relatively limited contact area between their bottom and the conveyor belt, and a high center of gravity when unloaded, lacking a self-stabilizing guiding structure. As the containers move with the conveyor belt, they are highly susceptible to uncontrollable circumferential rotation along their own axis due to factors such as conveyor belt start-stop inertia, conveyor speed fluctuations, joint transitions, or lateral airflow interference. This rotational behavior causes random deviations in the container's originally preset filling port orientation when it reaches the filling station, making it difficult for the filling equipment to accurately align with the target position for liquid injection.
[0003] Existing patents disclose an online identification and correction method for tracking and positioning deviations of a high-speed filling robot. The steps are as follows: S1: Image acquisition is performed each time the robot reaches a fixed position; S2: The relative position deviation between the filling needle bar and the bottle mouth center is determined based on the acquired images; that is: first, the center position of the needle bar is determined; then, the bottle mouth area is detected to determine the bottle mouth edge position, and the center position of the bottle mouth is calculated based on the left and right edge positions; finally, the relative position deviation is obtained by combining the center positions of the needle bar and the bottle mouth; S3: Based on the relative position deviation obtained in step S2, the robot's trajectory is controlled to complete the correction. The above invention has advantages such as simple principle, easy operation, good real-time performance, and high control accuracy.
[0004] The existing technical solutions mentioned above have the following drawbacks: 1. During the filling process, the filling head is misaligned with the container opening, and the sprayed liquid will directly spill onto the outer surface of the container or the conveyor belt, resulting in material waste and equipment contamination; In actual production, even if some liquid enters the container, liquid accumulation or splashing around the filling port due to positional deviation can affect the sealing quality of subsequent sealing processes and even trigger equipment malfunction alarms, reducing filling efficiency and finished product qualification rate, and increasing equipment cleaning and maintenance costs. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the purpose of this application is to provide a method, system, device, and medium for positioning compensation of bulk container filling ports based on image recognition. By introducing a closed-loop feedback and self-calibration mechanism, continuous self-optimization of filling positioning accuracy is achieved, offsetting the cumulative deviation caused by various dynamic factors during long-term operation, reducing the frequency of downtime maintenance due to positioning problems, and improving the continuous operation capability of the production line and the overall efficiency of the equipment.
[0006] This was achieved using the following technical solutions: In a first aspect, this application provides a method for positioning compensation of the filling port of a bulk container based on image recognition, including: By monitoring and judging the liquid delivery process of the container to be filled, and combining the preset global reference position, the origin of the global coordinate system is determined. A baseline three-dimensional coordinate system is established based on the global coordinate origin, and container images of the containers to be filled are acquired and analyzed to extract container feature points. Match container feature points according to the preset container standard template, locate the container filling port, and calculate the filling port deviation angle; Align the container filling nozzle with the filling nozzle offset angle, monitor the container filling process, identify the type of deviation, and obtain deviation information; Based on the deviation information and the reference three-dimensional coordinate system, dynamic compensation commands are generated and distributed to correct the positioning deviation.
[0007] By adopting the above technical solution, a three-dimensional coordinate system is established through a global coordinate reference. The filling port is located and the deviation angle is calculated by combining image feature extraction and template matching algorithms. Dynamic deviation identification and compensation control technology is used to correct the positioning error in real time, realizing automated high-precision alignment of the container filling process, which significantly improves the filling alignment accuracy and production stability.
[0008] This application is further configured to: monitor and determine the liquid delivery process of the container to be filled, and determine the global coordinate origin by combining the preset global reference position, including: Based on the production line workstation layout, monitor the liquid delivery process of the filling containers to be filled and calculate the center coordinates of the containers; Based on the container shape and the container center coordinates, construct the virtual edge outline of the container; The distance to the virtual edge outline of the container is determined based on the preset virtual trigger line, and the relative distance of the container is calculated. If the relative distance between containers is less than or equal to the preset difference distance threshold, it is determined that the container to be filled has entered the stop interval and is located at the preset global reference position. If not, it is determined that the container to be filled is approaching the cut-off interval, and a window capture signal is generated; The container conveying speed of the container to be filled is detected based on the window capture signal, and the instantaneous speed of the container is sampled. If the instantaneous speed of the container is less than the preset container speed threshold, and the speed duration is within the container's stop time, then the container to be filled is determined to be at the global reference position. The global reference position is reverse-positioned based on the container center coordinates, the intersection of the container edge lines is extracted, and defined as the origin of the global coordinates.
[0009] By adopting the above technical solution, a virtual edge contour is constructed by monitoring the container conveying process, and the global reference position is determined based on both the distance to the trigger line and the instantaneous speed. Finally, the intersection of the edge lines is used as the coordinate origin, thus achieving precise dynamic positioning of the filling container and significantly improving the accuracy and reliability of filling alignment.
[0010] This application further specifies: establishing a reference three-dimensional coordinate system based on the global coordinate origin, acquiring and analyzing container images of the containers to be filled, and extracting container feature points, including: The coordinate axis directions are determined based on the direction of the conveyor belt's movement, and a reference three-dimensional coordinate system is constructed by combining it with the global coordinate origin. The container to be filled is scanned circumferentially according to the preset resolution to obtain the original container point cloud and the original container image. The original container point cloud is fitted, and the container's geometric center axis is extracted by combining the container's center coordinates. The container's geometric center axis is mapped using a reference three-dimensional coordinate system, and the container's torsion angle is calculated. Based on the data type, the original container point cloud and the original container image are filtered and sampled to obtain the noiseless container point cloud and the noiseless container image. The container torsion angles are filtered based on the noiseless container point cloud to obtain the effective torsion angles, thus forming the container torsion angle curve; Edge detection and segmentation fusion are performed on the noiseless container image based on the container shape to obtain the container appearance image; Based on the container appearance image, the noiseless container point cloud is correlated and fused to obtain the complete container point cloud; Based on the container design parameters, feature recognition is performed on the complete container point cloud to obtain a feature point cloud set; Perform texture analysis on the feature point cloud to calculate the contour curvature, point cloud reflectance, and point cloud angle; If the contour curvature, point cloud reflectance, and point cloud angle are all within the corresponding threshold range, then the current feature point cloud is determined to be a container feature point.
[0011] By adopting the above technical solution, based on the fusion of global coordinate system and multi-source data, the geometric axis of the container is extracted by point cloud fitting and the torsion angle is calculated. Combined with edge detection and texture analysis (contour curvature, reflectivity, angle) to automatically filter feature points, high-precision and robust automated extraction of filling container features is achieved, which significantly improves positioning accuracy and detection efficiency.
[0012] This application further includes: matching container feature points according to a preset container standard template, locating the container filling port, and calculating the filling port deviation angle, including: The container feature points are matched according to the preset container standard template, and the feature similarity is calculated. If the feature similarity is greater than the preset filling port feature threshold, then the current container feature point is determined to be the container filling port. The coordinates of the filling port center are obtained by performing coordinate transformation on the container filling port according to the reference three-dimensional coordinate system. The filling port center coordinates are fitted based on the container torsion angle curve to obtain the filling port rotation curve; The deviation angle of the filling port is calculated by performing deviation calculation on the rotation curve of the filling port based on the center coordinates of the container.
[0013] By adopting the above technical solution, the filling port is identified based on template matching and feature similarity threshold algorithm. The rotation curve of the filling port is calculated by coordinate transformation and torsion angle curve fitting. Then, the deflection angle of the filling port is obtained by combining the coordinate deviation of the container center. This achieves high-precision positioning and angle quantification of the filling port, which significantly improves the accuracy and automation level of filling alignment.
[0014] This application further includes: fitting the center coordinates of the filling port to the container torsion angle curve to obtain the rotation curve of the filling port, including: The container torsion angle curve is analyzed based on the timestamp to obtain the container torsion angle sequence; Based on the linear velocity of the conveyor belt and the radius of the fitted circle of the container, the rotational angular velocity of the container is calculated, and the container torsion angle sequence is filtered to construct the container rotation angle sequence. Calculate the radius of rotation of the filling port by performing distance calculation between the center coordinates of the filling port and the geometric center axis of the container. The initial filling port fitting circle is obtained by fitting the center coordinates of the filling port to the rotation radius of the filling port; Calculate the polar angle of the filling port edge based on the coordinates of the filling port edge and the center coordinates of the filling port; The offset phase is obtained by linearly calculating the polar angle of the filling port edge based on the container's rotation angle sequence. The initial filling port fitting circle is corrected based on the offset phase to obtain the corrected filling port fitting circle; Random sampling is performed on the container filling port to obtain the sampling coordinates of the filling port, and the residual of the fitted circle of the corrected filling port is calculated to calculate the radial error and height error; If at least one of the two is greater than or equal to the corresponding tolerance threshold, then the radial error and height error are correlated according to the container model identifier to construct a container model deviation compensation table; If not, then the currently modified filling port fitted circle is determined to be the filling port rotation curve.
[0015] By adopting the above technical solution, based on kinematic calculation and circle fitting algorithm, the offset phase is calculated by the container rotation angle sequence and the polar angle of the filling port edge. The fitted circle is corrected and the filling port rotation curve is generated after residual verification. If necessary, a deviation compensation table is constructed. This achieves high-precision fitting and error compensation of the dynamic rotation trajectory of the filling port, which significantly improves the accuracy and robustness of the dynamic positioning of the filling port.
[0016] This application is further configured to: align the container filling nozzle with the filling nozzle offset angle, monitor the container filling process, identify the type of deviation, and obtain deviation information, including: The deflection angle of the filling nozzle is decomposed based on the position of the filling tool to obtain the radial deviation value and the height deviation value, and then converted into the corresponding radial movement signal and height correction signal. Based on the filling tool constraints combined with radial movement signals and height correction signals, the filling tool is moved and corrected, and aligned with the container filling port. Multidimensional monitoring of the container filling process is conducted, collecting filling pressure values, instantaneous filling flow rate, and relative axial position of the tool; Time synchronization is performed between the instantaneous filling flow rate and the relative axial position of the tool to generate a timing signal for the filling process; The timing signals of the filling process are filtered according to the filling action timing window to extract the valid filling signals; Analyze the effective filling signals, calculate the moving average of the signals, and use it as the baseline for normal process fluctuations; Valid filling signals are detected based on the normal process fluctuation baseline, abnormal filling signals are extracted, and the duration of abnormality is calculated. If the duration of the abnormality exceeds the preset time threshold, the current abnormal filling signal is determined to be a valid abnormal signal. The source of the valid abnormal signal is traced and located according to the filling action sequence to obtain the location of the abnormality; Based on the filling process and the condition of the container, a circumferential judgment is made on the location of the anomaly. If the container is in a rotating state, capture the circumferential angle of the container corresponding to the current valid abnormal signal; If not, perform attenuation analysis on the filling pressure value to determine the type of deviation; If the filling pressure value is a steep drop, it is determined to be a radial deviation; If the filling pressure value is a slow-descent type, it is determined to be circumferential deflection; If the filling pressure value is oscillating, it is determined to be an additive deviation; Based on the circumferential angle and the type of deviation, the deviation of the container to be filled is quantified to obtain the quantified deviation value. The confidence level of the deviation is calculated based on the signal-to-noise ratio of the valid abnormal signal, the ratio of the abnormal duration to the corresponding threshold. Based on the container type identifier, the deviation type, deviation quantification value, container model deviation compensation table, and deviation confidence level are associated, and deviation information is generated in conjunction with the deviation correction action.
[0017] By adopting the above technical solution, based on motion decomposition and synchronous timing analysis algorithms, the filling port deviation angle is decomposed into radial and height deviations and the tool is driven to align. The filling signal baseline is calculated through a sliding window, and radial, circumferential or superimposed deviations are identified by steep drop / slow drop / oscillating pressure characteristics. Combined with deviation quantification value and reliability assessment, compensation information is generated, realizing dynamic adaptive alignment and accurate identification of multiple types of deviations in the filling process, which significantly improves filling quality and efficiency.
[0018] Secondly, this application also provides an image recognition-based positioning compensation system for the filling port of bulk containers, employing the following technical solution: A bulk container filling port positioning compensation system based on image recognition, used to implement a bulk container filling port positioning compensation method, comprising: The baseline construction module is used to monitor and judge the liquid delivery process of the container to be filled, and determine the global coordinate origin by combining the preset global baseline position. The feature extraction module is used to establish a reference three-dimensional coordinate system based on the global coordinate origin, and to acquire and analyze container images of the containers to be filled, and extract container feature points. The target positioning module is used to match container feature points according to a preset container standard template, locate the container filling port, and calculate the filling port deviation angle. The deviation calculation module is used to align the container filling port with the deflection angle of the filling port, monitor the container filling process, identify the deviation type, and obtain deviation information. The deviation compensation module is used to generate and distribute dynamic compensation commands based on deviation information and a reference three-dimensional coordinate system to correct positioning deviations. The periodic calibration module is used to automatically correct the zero-point drift and cumulative error of the container to be filled during the liquid delivery process, based on standard test procedures and baseline filling conditions.
[0019] By adopting the above technical solution, the filling port is located and the deviation angle is calculated through image feature extraction and template matching algorithms. Combined with time-series signal analysis and deviation pattern recognition (sharp drop / gradual drop / oscillation), radial, circumferential or superimposed deviations are dynamically distinguished. Compensation commands are generated based on the reference coordinate system. At the same time, periodic self-calibration is used to eliminate zero drift and cumulative error, realizing high-precision adaptive alignment and closed-loop control of the filling process, which significantly improves filling quality, production stability and equipment intelligence level.
[0020] Thirdly, this application also provides an electronic device, comprising: One or more processors; Memory, used to store one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement any of the methods in the above scheme.
[0021] Fourthly, this application also provides a storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the image recognition-based bulk container filling port positioning compensation method as described above.
[0022] In summary, the beneficial technical effects of this application are as follows: By pre-adjusting the circumferential posture of the container before filling, the initial deflection angle of the container when it arrives at the filling station is reduced, so that the rotating mechanism of the filling station only needs to be finely adjusted to complete the precise alignment, shortening the single operation time of the filling station and improving the filling efficiency of the whole line. By introducing a closed-loop feedback and self-calibration mechanism, continuous self-optimization of filling positioning accuracy is achieved, which offsets the cumulative deviation caused by various dynamic factors during long-term operation, reduces the frequency of downtime maintenance due to positioning problems, and improves the continuous operation capability of the production line and the overall efficiency of the equipment. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the overall process of the bulk container filling port positioning compensation method in this application; Figure 2 This is a flowchart illustrating step S3 in this application; Figure 3 This is a schematic diagram of the positioning and compensation system for the filling port of the bulk container in this application. Detailed Implementation
[0024] The present application will be further described in detail below with reference to the accompanying drawings.
[0025] Reference Figure 1The present application discloses a method for positioning compensation of the filling port of a bulk container based on image recognition, comprising: S1: Monitor and judge the liquid delivery process of the container to be filled, and determine the global coordinate origin by combining the preset global reference position; S2: Establish a reference three-dimensional coordinate system based on the global coordinate origin, and collect and analyze container images of the containers to be filled, and extract container feature points; S3: Match container feature points according to the preset container standard template, locate the container filling port, and calculate the filling port deviation angle; S4: Align the container filling nozzle with the filling nozzle offset angle, monitor the container filling process, identify the type of deviation, and obtain deviation information; S5: Based on the deviation information and the reference three-dimensional coordinate system, generate and distribute dynamic compensation commands to correct the positioning deviation.
[0026] In this embodiment, during the automatic filling process of cylindrical bulk IBC tonnes in a chemical plant, the movement of the container on the conveyor chain is first monitored, and the origin of the global coordinates is determined based on the preset global reference position (such as the photoelectric switch trigger point at the beginning of the conveyor belt). A reference three-dimensional coordinate system is established based on this origin. Then, the container image of the tonne to be filled is acquired by a top-mounted 3D camera. The container feature points such as the edge of the flange and the intersection of the reinforcing ribs are extracted through edge detection and point cloud segmentation. Then, ICP iterative nearest point matching is performed with the preset container standard template (including the theoretical position and posture of the tonne opening) to accurately locate the spatial coordinates of the filling port and calculate its deviation angle relative to the vertical axis (for example, the tonne opening tilts by 3.5° due to the deformation of the tonne body or the conveyor tilt).
[0027] Based on the deflection angle, the six-degree-of-freedom parallel mechanism of the filling head automatically rotates to align with the barrel opening and descends to begin filling. Simultaneously, it monitors the liquid level and the force feedback of the filling head in real time during the filling process. When it identifies the type of deviation caused by barrel shaking or liquid surface fluctuation (such as a sudden change in the rate of liquid level rise or excessive lateral force), it generates dynamic instructions that include X / Y / Z translation correction and rotation compensation around the Z-axis. These instructions are distributed to the servo driver via real-time Ethernet, enabling the filling head to continuously fine-tune its position during the filling process to correct positioning deviations. This ensures that the filling nozzle is always aligned with the center of the barrel opening and that the liquid level error is controlled within ±2mm, ultimately completing high-precision, leak-proof bulk container filling.
[0028] Preferably, step S1 includes: Based on the production line workstation layout, monitor the liquid delivery process of the filling containers to be filled and calculate the center coordinates of the containers; Based on the container shape and the container center coordinates, construct the virtual edge outline of the container; The distance to the virtual edge outline of the container is determined based on the preset virtual trigger line, and the relative distance of the container is calculated. If the relative distance between containers is less than or equal to the preset difference distance threshold, it is determined that the container to be filled has entered the stop interval and is located at the preset global reference position. If not, it is determined that the container to be filled is approaching the cut-off interval, and a window capture signal is generated; The container conveying speed of the container to be filled is detected based on the window capture signal, and the instantaneous speed of the container is sampled. If the instantaneous speed of the container is less than the preset container speed threshold, and the speed duration is within the container's stop time, then the container to be filled is determined to be at the global reference position. The global reference position is reverse-positioned based on the container center coordinates, the intersection of the container edge lines is extracted, and defined as the origin of the global coordinates.
[0029] In this embodiment, the movement of steel drums on the roller conveyor chain is continuously monitored according to the layout of each workstation. The edge of the drum lid is scanned in real time by the top lid radar and the center coordinate of the container is calculated by fitting the center of the circle. Then, a virtual edge contour line is constructed based on the cylindrical shape of the steel drum, the center coordinate, and the radius parameter. The preset virtual trigger line is located 500mm directly below the filling head. The relative distance between the contour line and the trigger line is continuously calculated. When the distance is less than or equal to the preset difference threshold of 20mm, it is determined that the steel drum has entered the stop zone and is at the global reference position. Otherwise, a window capture signal is generated and the instantaneous speed of the steel drum is sampled by the light curtain sensor. When the instantaneous speed drops below the preset speed threshold of 0.05m / s and this low speed state lasts for 0.3 seconds (within the stop time of 0.2-0.5 seconds), it is finally confirmed that the steel drum is accurately stopped at the reference position. Then, the spatial coordinates of the intersection of the edge line of the drum opening and the reinforcing rib are located in reverse according to the center coordinate of the steel drum. This intersection point is defined as the origin of the global coordinates, which effectively solves the positioning deviation problem caused by the inertia of the bulk container during transportation.
[0030] Preferably, step S2 includes: The coordinate axis directions are determined based on the direction of the conveyor belt's movement, and a reference three-dimensional coordinate system is constructed by combining it with the global coordinate origin. The container to be filled is scanned circumferentially according to the preset resolution to obtain the original container point cloud and the original container image. The original container point cloud is fitted, and the container's geometric center axis is extracted by combining the container's center coordinates. The container's geometric center axis is mapped using a reference three-dimensional coordinate system, and the container's torsion angle is calculated. Based on the data type, the original container point cloud and the original container image are filtered and sampled to obtain the noiseless container point cloud and the noiseless container image. The container torsion angles are filtered based on the noiseless container point cloud to obtain the effective torsion angles, thus forming the container torsion angle curve; Edge detection and segmentation fusion are performed on the noiseless container image based on the container shape to obtain the container appearance image; Based on the container appearance image, the noiseless container point cloud is correlated and fused to obtain the complete container point cloud; Based on the container design parameters, feature recognition is performed on the complete container point cloud to obtain a feature point cloud set; Perform texture analysis on the feature point cloud to calculate the contour curvature, point cloud reflectance, and point cloud angle; If the contour curvature, point cloud reflectance, and point cloud angle are all within the corresponding threshold range, then the current feature point cloud is determined to be a container feature point.
[0031] In this embodiment, on a lubricating oil filling line, the positive Y-axis is set along the conveyor belt's forward direction, and a reference three-dimensional coordinate system is constructed with the global coordinate origin (the intersection of the barrel's edge). Subsequently, a 360° circumferential laser scan is performed on a 200L steel barrel at a resolution of 0.5mm to obtain the original point cloud and image. The original point cloud is fitted using the least squares method, and the geometric center axis is extracted by combining the coordinates of the barrel's bottom center. This axis is mapped to the reference coordinate system to calculate the barrel's torsion angle (e.g., 2.3°) relative to the ideal vertical axis. Then, voxel filtering and median filtering are used to process the point cloud and image respectively. After obtaining noise-free data, outliers due to abnormal torsion angles (exceeding ±5°) are removed to form a torsion angle curve.
[0032] Simultaneously, the appearance image of the barrel is obtained by fusing Canny edge detection and region growing segmentation, and then associated with the noise-free point cloud to generate a complete point cloud. Based on the design parameters such as the barrel opening inner diameter of 120mm and the barrel height of 890mm, the RANSAC algorithm is used to identify the feature point cloud corresponding to the barrel opening flange, corrugated ribs and bottom rolled edge. After texture analysis, the contour curvature (0.8~1.2), point cloud reflectivity (40%~60%) and point cloud angle (85°~95°) are obtained. All three fall within the preset threshold range, thus accurately confirming the container feature points.
[0033] Reference Figure 2 Preferably, step S3 includes: The container feature points are matched according to the preset container standard template, and the feature similarity is calculated. If the feature similarity is greater than the preset filling port feature threshold, then the current container feature point is determined to be the container filling port. The coordinates of the filling port center are obtained by performing coordinate transformation on the container filling port according to the reference three-dimensional coordinate system. The filling port center coordinates are fitted based on the container torsion angle curve to obtain the filling port rotation curve; The deviation angle of the filling port is calculated by performing deviation calculation on the rotation curve of the filling port based on the center coordinates of the container.
[0034] In this embodiment, the container torsion angle curve is analyzed based on the timestamp to obtain the container torsion angle sequence; Based on the linear velocity of the conveyor belt and the radius of the fitted circle of the container, the rotational angular velocity of the container is calculated, and the container torsion angle sequence is filtered to construct the container rotation angle sequence. Calculate the radius of rotation of the filling port by performing distance calculation between the center coordinates of the filling port and the geometric center axis of the container. The initial filling port fitting circle is obtained by fitting the center coordinates of the filling port to the rotation radius of the filling port; Calculate the polar angle of the filling port edge based on the coordinates of the filling port edge and the center coordinates of the filling port; The offset phase is obtained by linearly calculating the polar angle of the filling port edge based on the container's rotation angle sequence. The initial filling port fitting circle is corrected based on the offset phase to obtain the corrected filling port fitting circle; Random sampling is performed on the container filling port to obtain the sampling coordinates of the filling port, and the residual of the fitted circle of the corrected filling port is calculated to calculate the radial error and height error; If at least one of the two is greater than or equal to the corresponding tolerance threshold, then the radial error and height error are correlated according to the container model identifier to construct a container model deviation compensation table; If not, then the currently modified filling port fitted circle is determined to be the filling port rotation curve.
[0035] In this embodiment, the extracted container feature points are matched with a preset container standard template using ICP, and the feature similarity is calculated. When the similarity exceeds the filling port feature threshold of 0.85, the current feature point is determined to be the container filling port, and the spatial coordinates of the filling port are converted into the center coordinates of the filling port according to the reference three-dimensional coordinate system. Then, the center coordinates of the filling port are fitted with cubic splines according to the container torsion angle curve to obtain the rotation curve of the filling port, and the deviation is calculated by combining the container center coordinates (center of the bottom circle) to calculate the deflection angle (e.g., 1.8°) of the filling port relative to the axis of the barrel. On this basis, the system parses the container torsion angle curve according to the timestamp to obtain the torsion angle sequence, calculates the container rotation angular velocity (0.667 rad / s) using the conveyor belt linear speed (0.2 m / s) and the radius of the container fitted circle (0.3 m), and filters out the container rotation angle sequence corresponding to the filling cycle.
[0036] Furthermore, the rotation radius of the filling port (0.28m) is obtained by calculating the distance between the center coordinates of the filling port and the geometric center axis of the container, and this radius is used to fit the initial fitting circle of the filling port. The edge polar angle is calculated by extracting multiple coordinate points on the edge of the filling port, and then a linear regression operation is performed on the edge polar angle based on the container's rotation angle sequence to obtain the offset phase (e.g., -0.12rad). This offset phase is then used to correct the initial fitting circle to obtain the corrected fitting circle of the filling port. To verify the correction accuracy, random sampling is performed on the container filling port (one point every 60°, for a total of 6 points) to obtain the sampled coordinates, and these coordinates are then used to refine the corrected fitting circle. The residual calculation of the concentric circle yielded an average radial error of 0.35 mm and an average height error of 0.42 mm, both of which are greater than the corresponding tolerance thresholds (0.2 mm for radial error and 0.3 mm for height error). Therefore, the system associates and stores the radial and height errors based on the container model identifier "20L square bucket", and constructs a container model deviation compensation table containing compensation coefficients (radial error +0.18 and height error +0.22) to ensure that the filling port alignment accuracy reaches ±0.1 mm, effectively solving the filling offset problem caused by bucket forming error and conveying sway.
[0037] Preferably, step S4 includes: The deflection angle of the filling nozzle is decomposed based on the position of the filling tool to obtain the radial deviation value and the height deviation value, and then converted into the corresponding radial movement signal and height correction signal. Based on the filling tool constraints combined with radial movement signals and height correction signals, the filling tool is moved and corrected, and aligned with the container filling port. Multidimensional monitoring of the container filling process is conducted, collecting filling pressure values, instantaneous filling flow rate, and relative axial position of the tool; Time synchronization is performed between the instantaneous filling flow rate and the relative axial position of the tool to generate a timing signal for the filling process; The timing signals of the filling process are filtered according to the filling action timing window to extract the valid filling signals; Analyze the effective filling signals, calculate the moving average of the signals, and use it as the baseline for normal process fluctuations; Valid filling signals are detected based on the normal process fluctuation baseline, abnormal filling signals are extracted, and the duration of abnormality is calculated. If the duration of the abnormality exceeds the preset time threshold, the current abnormal filling signal is determined to be a valid abnormal signal. The source of the valid abnormal signal is traced and located according to the filling action sequence to obtain the location of the abnormality; Based on the filling process and the condition of the container, a circumferential judgment is made on the location of the anomaly. If the container is in a rotating state, capture the circumferential angle of the container corresponding to the current valid abnormal signal; If not, perform attenuation analysis on the filling pressure value to determine the type of deviation; If the filling pressure value is a steep drop, it is determined to be a radial deviation; If the filling pressure value is a slow-descent type, it is determined to be circumferential deflection; If the filling pressure value is oscillating, it is determined to be an additive deviation; In this embodiment, if the container continues to rotate during the filling process (as required by certain filling processes), the encoder records the circumferential angle φ_anomaly of the container when the abnormal signal occurs. If the container is stationary during filling, φ_anomaly is set to 0. Steep drop type: The pressure drops from the normal value to near atmospheric pressure in a short time (<30ms) and then remains at a low level → usually corresponds to a large opening leak, which is common when the lateral offset is too large, causing the filling head and the container opening to be completely misaligned.
[0038] Slow-deceleration type: The pressure gradually decreases within hundreds of milliseconds, exhibiting exponential decay → corresponding to tiny gap leakage, commonly seen when circumferential deflection angle errors cause localized warping of the sealing surface.
[0039] Oscillating type: The pressure fluctuates periodically, and the frequency is related to the rotation of the container or external vibration → possibly due to superimposed deviations (both circumferential and lateral).
[0040] Continuous leakage: The leakage signal exists from the occurrence of the abnormality to the end of filling → the deviation is a static fixed deviation (such as the filling head being installed off-center).
[0041] Intermittent leakage: The leakage signal is intermittent and related to the circumferential position of the container → The typical characteristic is circumferential deflection angle error: When the container rotates to a certain angle, the sealing surface is in contact; when it rotates to another angle, it partially disengages.
[0042] Based on the circumferential angle and the type of deviation, the deviation of the container to be filled is quantified to obtain the quantified deviation value. The confidence level of the deviation is calculated based on the signal-to-noise ratio of the valid abnormal signal, the ratio of the abnormal duration to the corresponding threshold. Based on the container type identifier, the deviation type, deviation quantification value, container model deviation compensation table, and deviation confidence level are associated, and deviation information is generated in conjunction with the deviation correction action.
[0043] In this embodiment, the correction action includes: Circumferential deflection angle error → Recalculate the filling port deflection angle and perform fine-tuning rotation.
[0044] Radial offset error → Check the filling head installation position or conveyor belt alignment mechanism, and trigger hardware homing if necessary.
[0045] Overlapping error → First correct the lateral offset, then re-execute the skew angle alignment process.
[0046] In this embodiment, the calculated filling port deviation angle is decomposed into a radial deviation value of 2.3mm and a height deviation value of 1.7mm based on the current spatial position of the filling head. These are then converted into radial movement signals and height correction signals, respectively, to drive the servo motor to move the filling head to precisely align with the barrel opening. During the filling process, the system collects filling pressure, instantaneous flow rate, and axial position of the filling head in real time at a sampling frequency of 100Hz. After synchronizing the flow rate and position signals, a filling process timing signal is generated. Valid filling signals are selected according to the filling action timing window (e.g., 0.5s after valve opening to 0.2s before valve closing), and their moving average value is calculated as the normal fluctuation baseline (average flow rate 1.2L / s, fluctuation ±0.05L / s).
[0047] When the flow signal is detected to be below the baseline lower limit for 0.3s and the pressure shows a sharp drop, it is determined to be a valid abnormal signal caused by radial deviation. Combined with the container circumferential angle (e.g., 145°) recorded by the rotary encoder of the filling head when the abnormality occurs, the corresponding compensation coefficient is read from the constructed deviation compensation table according to the deviation type and container model identification (20L square barrel). Combined with the signal-to-noise ratio of the abnormal signal (22dB) and the ratio of the abnormal duration to the time threshold (0.2s) (1.5), the deviation confidence is calculated to be 92%. Finally, the deviation type "radial deviation", the quantification value of 2.1mm, the confidence and the suggested correction action (compensation of 0.8mm in the negative X direction) are associated to generate complete deviation information for real-time dynamic compensation in the next cycle.
[0048] Reference Figure 3 A bulk container filling port positioning compensation system based on image recognition, applied to a bulk container filling port positioning compensation method, includes: The baseline construction module is used to monitor and judge the liquid delivery process of the container to be filled, and determine the global coordinate origin by combining the preset global baseline position. The feature extraction module is used to establish a reference three-dimensional coordinate system based on the global coordinate origin, and to acquire and analyze container images of the containers to be filled, and extract container feature points. The target positioning module is used to match container feature points according to a preset container standard template, locate the container filling port, and calculate the filling port deviation angle. The deviation calculation module is used to align the container filling port with the deflection angle of the filling port, monitor the container filling process, identify the deviation type, and obtain deviation information. The deviation compensation module is used to generate and distribute dynamic compensation commands based on deviation information and a reference three-dimensional coordinate system to correct positioning deviations. In this embodiment, after determining that a positioning deviation exists, the source of the deviation is first determined to be circumferential, lateral, or longitudinal, and the compensation amount based on the direction and degree of the deviation is calculated with the origin as the reference. It is then determined whether the compensated target pose is still within the allowable range of motion of the actuator. If it exceeds the limit, automatic compensation is deemed impossible, and manual intervention is triggered. After the compensation command is converted into the attitude correction amount of the pre-adjustment segment or the filling head trajectory correction parameters, the frequency of sealing anomalies is continuously assessed during subsequent container operation to determine whether it decreases due to this fine-tuning. If the anomaly rate of multiple consecutive containers improves, the compensation is deemed effective, and the parameters are fixed; otherwise, the compensation direction or magnitude is deemed incorrect, and iterative calculation is required until the deviation is eliminated.
[0049] The periodic calibration module is used to automatically correct the zero-point drift and cumulative error of the container to be filled during the liquid delivery process, based on standard test procedures and baseline filling conditions.
[0050] In this embodiment, when the production line is idle, it is determined whether the self-calibration trigger condition is met, and a decision is made based on comprehensive indicators such as continuous no-task time, cumulative operating cycle, or recent increase in abnormality rate. After entering self-calibration, it is first determined whether there is no interference from other containers in the standard test process, and the "zero deviation" ideal state template has been correctly loaded. During operation, the measured data is compared with the ideal state item by item to determine whether the sensor reading drift and mechanical repeatability deviation exceed the acceptable threshold. If the drift is too large, it is determined that recalibration is required. If the mechanical deviation exceeds the standard, it is determined that there is deformation or wear that cannot be automatically recovered. Finally, it is determined whether each error has been adjusted to the allowable range through parameter correction to ensure that accuracy maintenance is based on a true healthy state. Example
[0051] The baseline construction module first monitors the movement of the ton containers to be filled on the conveyor chain. When the front end of the container triggers a preset global baseline position (photoelectric switch), the intersection of the flange edge and the reinforcing rib at this trigger point is taken as the global coordinate origin. The feature extraction module establishes a baseline three-dimensional coordinate system based on this origin and acquires images of the ton containers using a top-mounted 3D structured light camera. Through point cloud segmentation and edge detection, feature points such as the inner and outer circular contours of the container opening, the vent, and the lifting ring seat are extracted. The target positioning module performs ICP overlay between the feature points and a preset IBC standard template. The matching module calculates the center coordinates of the barrel opening and the deflection angle of the filling port (e.g., 2.1°) caused by barrel deformation or conveying skew. Based on this deflection angle, the deviation calculation module drives the six-degree-of-freedom parallel filling head to automatically rotate and align with the barrel opening and start filling. At the same time, during the filling process, the filling pressure, instantaneous flow rate and axial position of the filling head are monitored at a sampling rate of 200Hz. Through time-series signal analysis, the deviation types such as sharp pressure drop (radial deviation) or gradual pressure drop (circumferential deflection) are identified, and deviation information including deviation type, quantification value and confidence level is generated.
[0052] The deviation compensation module, based on the deviation information and the reference three-dimensional coordinate system, generates dynamic compensation commands for X / Y / Z translation and rotation around the Z-axis in real time. These commands are distributed to each servo driver via the EtherCAT bus, enabling the filling head to continuously fine-tune during the filling process to correct positioning deviations and ensure that the liquid level height error is ≤±1.5mm. In addition, the periodic calibration module automatically executes a standard test procedure every 1000 tonnes filled or every 4 hours of operation: a reference calibration barrel is transported to the filling position and reset to the initial reference state. The drift between the current zero point and the theoretical zero point is compared through laser ranging and visual verification. The module automatically calculates and corrects the cumulative errors caused by mechanical wear, temperature changes, or sensor aging (such as axial drift of 0.3mm or angular drift of 0.05°), updates the global reference position and coordinate system parameters, thereby ensuring long-term filling accuracy and stability and avoiding filling head collisions or sealing problems caused by cumulative errors.
[0053] An electronic device, comprising: One or more processors; Memory, used to store one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement any of the methods in the above scheme.
[0054] A storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the bulk container filling port positioning compensation method as described above.
[0055] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for positioning compensation of the filling port of a bulk container based on image recognition, characterized in that, include: By monitoring and judging the liquid delivery process of the container to be filled, and combining the preset global reference position, the origin of the global coordinate system is determined. A reference three-dimensional coordinate system is established based on the global coordinate origin, and container images of the containers to be filled are acquired and analyzed to extract container feature points. Match the container feature points according to the preset container standard template, locate the container filling port, and calculate the filling port deviation angle; Align the container filling port with the filling port deflection angle, monitor the container filling process, identify the type of deviation, and obtain deviation information; Based on the deviation information and the reference three-dimensional coordinate system, dynamic compensation commands are generated and distributed to correct the positioning deviation.
2. The image recognition-based method for positioning compensation of the filling port of bulk containers according to claim 1, characterized in that, The monitoring and judgment of the liquid delivery process of the container to be filled, combined with the preset global reference position, determines the global coordinate origin, including: Based on the production line workstation layout, monitor the liquid delivery process of the filling containers to be filled and calculate the center coordinates of the containers; Based on the container shape and the container center coordinates, construct the virtual edge outline of the container; The relative distance between the container and the virtual edge contour line is determined based on the preset virtual trigger line. If the relative distance between the containers is less than or equal to a preset difference distance threshold, it is determined that the container to be filled has entered the stop interval and is located at a preset global reference position. If not, it is determined that the container to be filled is approaching the cut-off interval, and a window capture signal is generated; The container conveying speed of the container to be filled is detected based on the window capture signal, and the instantaneous speed of the container is sampled. If the instantaneous speed of the container is less than the preset container speed threshold, and the speed duration is within the container stop time, then it is determined that the container to be filled is located at the global reference position. The global reference position is reverse-positioned based on the container center coordinates, the intersection of the container edge lines is extracted, and defined as the global coordinate origin.
3. The image recognition-based method for positioning compensation of the filling port of bulk containers according to claim 1, characterized in that, The step of establishing a reference three-dimensional coordinate system based on the global coordinate origin, acquiring and analyzing container images of the containers to be filled, and extracting container feature points includes: The coordinate axis directions are determined based on the direction of the conveyor belt's movement, and a reference three-dimensional coordinate system is constructed by combining it with the global coordinate origin. The container to be filled is scanned circumferentially according to the preset resolution to obtain the original container point cloud and the original container image. The original container point cloud is fitted, and the container's geometric center axis is extracted by combining the container's center coordinates. The container's geometric center axis is mapped using the reference three-dimensional coordinate system, and the container's torsion angle is calculated. The original container point cloud and the original container image are filtered and sampled according to the data type to obtain a noise-free container point cloud and a noise-free container image. The container torsion angles are filtered based on the noiseless container point cloud to obtain effective torsion angles and form a container torsion angle curve. Based on the shape of the container, edge detection and segmentation fusion are performed on the noiseless container image to obtain the container appearance image; Based on the container appearance image, the noiseless container point cloud is correlated and fused to obtain a complete container point cloud; Based on the container design parameters, feature recognition is performed on the complete container point cloud to obtain a feature point cloud set; Texture analysis is performed on the feature point cloud to calculate the contour curvature, point cloud reflectance, and point cloud angle. If the contour curvature, the point cloud reflectivity, and the point cloud angle are all within the corresponding threshold range, then the current feature point cloud is determined to be a container feature point.
4. The image recognition-based method for positioning compensation of the filling port of bulk containers according to claim 1, characterized in that, The step of matching container feature points according to a preset container standard template, locating the container filling port, and calculating the filling port deviation angle includes: The container feature points are matched according to the preset container standard template, and the feature similarity is calculated. If the feature similarity is greater than the preset filling port feature threshold, then the current container feature point is determined to be the container filling port. The coordinates of the filling port of the container are obtained by performing coordinate transformation based on the reference three-dimensional coordinate system; The center coordinates of the filling port are fitted based on the container torsion angle curve to obtain the filling port rotation curve; The deviation angle of the filling port is calculated by performing a deviation calculation on the rotation curve of the filling port based on the center coordinates of the container.
5. The image recognition-based method for positioning compensation of the filling port of bulk containers according to claim 4, characterized in that, The step of fitting the center coordinates of the filling port based on the container torsion angle curve to obtain the filling port rotation curve includes: The container torsion angle curve is analyzed based on the timestamp to obtain the container torsion angle sequence; Based on the linear velocity of the conveyor belt and the radius of the fitted circle of the container, the rotational angular velocity of the container is calculated, and the container torsion angle sequence is filtered to construct the container rotation angle sequence. Calculate the radius of rotation of the filling port by performing distance calculation between the center coordinates of the filling port and the geometric center axis of the container. The center coordinates of the filling port are fitted with the rotation radius of the filling port to obtain an initial fitting circle for the filling port; Calculate the polar angle of the filling port edge based on the coordinates of the filling port edge and the coordinates of the filling port center; The offset phase is obtained by linearly calculating the polar angle of the filling port edge based on the container rotation angle sequence. The initial filling port fitting circle is corrected based on the offset phase to obtain the corrected filling port fitting circle; Randomly sample the container filling port to obtain the sampling coordinates of the filling port, and calculate the residual of the fitted circle of the corrected filling port to calculate the radial error and height error; If at least one of the two is greater than or equal to the corresponding tolerance threshold, then the radial error and the height error are associated with the container model identifier to construct a container model deviation compensation table; If not, then the currently modified filling port fitted circle is determined to be the filling port rotation curve.
6. The image recognition-based method for positioning compensation of the filling port of bulk containers according to claim 1, characterized in that, The process of aligning the container filling nozzle with the filling nozzle offset angle, monitoring the container filling process, identifying the type of deviation, and obtaining deviation information includes: The deflection angle of the filling nozzle is decomposed based on the position of the filling tool to obtain the radial deviation value and the height deviation value, and then converted into the corresponding radial movement signal and height correction signal. Based on the filling tool constraints combined with the radial movement signal and the height correction signal, the filling tool is moved and corrected, and aligned with the container filling port. Multidimensional monitoring of the container filling process is conducted, collecting filling pressure values, instantaneous filling flow rate, and relative axial position of the tool; The instantaneous filling flow rate and the relative axial position of the tool are synchronized in time to generate a filling process timing signal; The timing signals of the filling process are filtered according to the filling action timing window to extract the valid filling signals; The effective filling signal is analyzed, the moving average value of the signal is calculated, and it is used as the baseline for normal process fluctuations. The effective filling signal is detected based on the normal process fluctuation baseline, abnormal filling signals are extracted, and the duration of the abnormality is calculated. If the duration of the abnormality is greater than a preset time threshold, the current abnormal filling signal is determined to be a valid abnormal signal.
7. The image recognition-based method for positioning compensation of bulk container filling ports according to claim 1 or 6, characterized in that, The step of aligning the container filling nozzle with the filling nozzle offset angle, monitoring the container filling process, identifying the type of deviation, and obtaining deviation information also includes: The source of the valid abnormal signal is traced and located according to the filling action sequence to obtain the location of the abnormality; Based on the filling process and the container condition, the location of the anomaly is determined circumferentially. If the container is in a rotating state, then capture the circumferential angle of the container corresponding to the current valid abnormal signal; If not, perform attenuation analysis on the filling pressure value to determine the type of deviation; If the filling pressure value is a steep drop, it is determined to be a radial deviation; If the filling pressure value is of the slow-descent type, it is determined to be circumferential deflection; If the filling pressure value is oscillating, it is determined to be an additive deviation; Based on the circumferential angle and the deviation type, the deviation of the container to be filled is quantified to obtain the deviation quantification value; The confidence level of the deviation is calculated based on the signal-to-noise ratio of the valid abnormal signal, the ratio of the abnormal duration to the corresponding threshold. The deviation type, the deviation quantification value, the container model deviation compensation table, and the deviation confidence level are associated with the container type identifier, and deviation information is generated in conjunction with the deviation correction action.
8. A bulk container filling port positioning compensation system based on image recognition, used to implement the method as described in any one of claims 1-7, characterized in that, include: The baseline construction module is used to monitor and judge the liquid delivery process of the container to be filled, and determine the global coordinate origin by combining the preset global baseline position. The feature extraction module is used to establish a reference three-dimensional coordinate system based on the global coordinate origin, and to acquire and analyze container images of the containers to be filled, and extract container feature points. The target positioning module is used to match the container feature points according to the preset container standard template, locate the container filling port, and calculate the filling port deviation angle; The deviation calculation module is used to align the container filling port with the deflection angle of the filling port, monitor the container filling process, identify the deviation type, and obtain deviation information. The deviation compensation module is used to generate and distribute dynamic compensation commands based on the deviation information and the reference three-dimensional coordinate system to correct the positioning deviation. The periodic calibration module is used to automatically correct the zero-point drift and cumulative error of the container to be filled during the liquid delivery process, based on standard test procedures and baseline filling conditions.
9. An electronic device, comprising: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the bulk container filling port positioning compensation method as described in any one of claims 1 to 7.
10. A storage medium storing at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the bulk container filling port positioning compensation method as described in any one of claims 1 to 7.