Method and system for positioning the mouth of paper cups in a stacked paper cup production line
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-07
- Publication Date
- 2026-08-14
AI Technical Summary
但在实际生产过程中,传送带的振动易造成纸杯在输送阶段产生轻微滑动,静态图像无法捕捉该类动态微动现象,导致纸杯杯口定位出现偏差;同时,图像采集具有一定的滞后性,使得获取的杯口定位参数与纸杯的实际位置存在不匹配问题
本发明通过获取每个纸杯的连续帧图像;针对每帧图像,获取杯口轮廓,并选取轮廓代表点;获取每个轮廓代表点在相邻两帧图像中的位移向量,确定每帧图像中每个轮廓代表点的方向偏离角度;根据位移向量和方向偏离角度,获取每帧图像中杯口位置的滑动影响系数,进而分析所有帧图像中杯口位置滑动的波动幅度,确定每个杯口的滑动影响程度;根据位移向量和滑动影响系数,结合滞后时长,确定每帧图像中杯口位置的滞后偏差程度;根据滑动影响程度和滞后偏差程度,确定每个杯口的位置不匹配程度;根据位置不匹配程度,确定每个杯口的校正程度,结合杯口的整体位移,对杯口的位置进行校正。本发明通过连续帧图像分析纸杯在传送过程中的动态滑动特征,并量化计算因振动与图像采集滞后导致的综合位置偏差,实现动态校正与实时定位补偿,解决传统静态图像法因无法捕捉微动与滞后造成的定位准确度不足问题,提高了纸杯杯口定位精度,确保后续工序(如套装)的精准对位,提高堆叠纸杯的产品加工质量。
Smart Images

Figure CN122134729B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quality inspection technology, and specifically to a method and system for positioning the mouth of paper cups in a stacked paper cup production line. Background Technology
[0002] In the modern food packaging and consumer goods industry, disposable paper cups are widely used due to their advantages such as environmental friendliness, low cost, and ease of use. Stackable paper cups are disposable paper cups specifically designed for industrial production, warehousing, and distribution. They feature a frustum-shaped structure, wider at the top and narrower at the bottom, allowing individual cups to be nested inside each other from top to bottom. Multiple stacks form a compact stack, significantly saving storage and transportation space. Large-scale production relies on high-speed, fully automated production lines. The core processes of a stackable paper cup production line include base paper lamination, printing, cutting, cup body forming, cup rim curling, automatic stacking, cup separation, labeling, and packaging. Among these, cup rim positioning is a crucial step connecting the stacking, cup separation, labeling, filling, and packaging processes after rim curling. Its positioning accuracy and efficiency directly determine the product quality, production continuity, and finished product qualification rate of the stacked paper cups.
[0003] In existing technologies, cup rim positioning in stacked paper cup production lines often relies on single-frame static image acquisition. However, during actual production, conveyor belt vibrations can cause slight slippage of the paper cups during transport. Static images cannot capture these dynamic micro-movements, leading to positioning errors. Furthermore, image acquisition has a certain lag, causing a mismatch between the acquired cup rim positioning parameters and the actual cup position. Traditional methods fail to adequately consider these factors, resulting in the control mechanism's inability to accurately adjust the cup position based on the positioning parameters. This prevents precise alignment of the cup rim with the designated workstation for subsequent processing, impacting the normal operation of later processes and reducing the processing efficiency and quality of stacked paper cups. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of this invention is to provide a method and system for positioning the mouth of a paper cup in a stacked paper cup production line.
[0005] According to a first aspect of the present invention, a method for positioning the mouth of a paper cup in a stacked paper cup production line is provided, and the specific technical solution adopted is as follows: Acquire consecutive frame images of each paper cup; For each frame of the image, obtain the outline of the cup rim and select representative points of the outline; Obtain the displacement vector of each contour representative point in two adjacent frames, and determine the directional deviation angle of each contour representative point in each frame; Based on the displacement vector and the directional deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained, and then the fluctuation amplitude of the cup rim position sliding in all frame images is analyzed to determine the degree of sliding influence of each cup rim. Based on the displacement vector and the sliding influence coefficient, combined with the hysteresis duration, the degree of hysteresis deviation of the cup rim position in each frame image is determined; The degree of positional mismatch of each cup opening is determined based on the degree of sliding influence and the degree of hysteresis deviation. Based on the degree of positional mismatch, the correction degree for each cup rim is determined, and the position of the cup rim is corrected in conjunction with the overall displacement of the cup rim.
[0006] In some embodiments of the present invention, for each frame of image, the outline of the cup rim is obtained, and representative points of the outline are selected, including: For each frame of the image, establish a Cartesian coordinate system; For each frame of the image, the Canny edge detection algorithm is used to perform edge detection, and all contours in each frame of the image are obtained; For each frame of image, based on the prior geometric features of the cup rim, the most suitable contour is selected from all contours as the cup rim contour. For the cup rim outline of each frame image, select representative points of the outline according to the azimuth angle, and mark the coordinate values of the representative points of the outline.
[0007] In some embodiments of the present invention, obtaining the displacement vector of each contour representative point in two adjacent frames and determining the directional deviation angle of each contour representative point in each frame includes: Based on the coordinate values of the contour representative points, calculate the displacement vector of each contour representative point between the current frame image and the previous frame image; Based on the displacement vector and the unit vector of the conveyor belt's movement direction, the directional deviation angle of each contour representative point in each frame of the image is obtained.
[0008] In some embodiments of the present invention, the sliding influence coefficient of the cup rim position in each frame image is obtained based on the displacement vector and the direction deviation angle, including: Based on the displacement vector, the displacement length of each contour representative point between the current frame image and the previous frame image is obtained; Based on the displacement length and the sine value of the directional deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained.
[0009] In some embodiments of the present invention, the fluctuation amplitude of the cup rim position sliding in all frame images is analyzed to determine the degree of sliding influence of each cup rim, including: Obtain the minimum sliding influence coefficient corresponding to all frame images, calculate the difference between the sliding influence coefficient corresponding to all frame images and the minimum sliding influence coefficient, and combine it with the average sliding influence coefficient of all frame images to obtain the degree of sliding influence of each cup rim.
[0010] In some embodiments of the present invention, the degree of hysteresis deviation of the cup rim position in each frame of the image is determined based on the displacement vector and the sliding influence coefficient, combined with the hysteresis duration, including: The total time from the moment the image acquisition is triggered to the system outputting positioning parameters and transmitting them to the actuator is denoted as the lag time. Based on the displacement vector, the average displacement length of all the contour representative points in each frame image between the current frame image and the previous frame image is obtained. Based on the average displacement length and the sliding influence coefficient, combined with the hysteresis duration and frame interval duration, the degree of hysteresis deviation of the cup rim position in each frame image is obtained.
[0011] In some embodiments of the present invention, determining the degree of positional mismatch of each cup rim based on the degree of sliding influence and the degree of hysteresis deviation includes: Calculate the standard deviation and mean of the hysteresis deviation for all frame images, and combine this with the degree of slippage effect to obtain the degree of mismatch in the position of each cup rim.
[0012] In some embodiments of the present invention, acquiring consecutive frame images of each paper cup includes: Collect continuous frame images of paper cups on the production line; Convert the original image to a grayscale image; The grayscale image is smoothed using a Gaussian filtering method and enhanced using a histogram equalization algorithm to obtain an enhanced grayscale image. Based on the Otsu adaptive thresholding algorithm, the optimal segmentation threshold is automatically calculated, and the enhanced grayscale image is converted into a binary image to obtain continuous frame images of each paper cup.
[0013] According to a second aspect of the present invention, a paper cup rim positioning system for a stacked paper cup production line is provided, comprising: a memory and a processor, wherein: The memory is used to store program code; The processor is configured to read program code stored in the memory and execute the method described in the first aspect of the present invention.
[0014] In some embodiments of the present invention, the processor includes: The image acquisition module is used to acquire consecutive frame images of each paper cup; The cup rim contour acquisition module is used to acquire the cup rim contour for each frame of the image and select representative points of the contour. The orientation deviation analysis module is used to obtain the displacement vector of each of the contour representative points in two adjacent frames of images, and to determine the orientation deviation angle of each of the contour representative points in each frame of images. The position mismatch analysis module is used to obtain the sliding influence coefficient of the cup rim position in each frame image based on the displacement vector and the direction deviation angle, and then analyze the fluctuation amplitude of the cup rim position sliding in all frame images to determine the degree of sliding influence of each cup rim; and is used to determine the degree of lag deviation of the cup rim position in each frame image based on the displacement vector and the sliding influence coefficient, combined with the lag time; and is used to determine the degree of position mismatch of each cup rim based on the degree of sliding influence and the degree of lag deviation. The cup rim position correction module is used to determine the correction degree of each cup rim based on the degree of position mismatch, and to correct the position of the cup rim by combining the overall displacement of the cup rim.
[0015] Compared with the prior art, the paper cup rim positioning method and system for a stacked paper cup production line provided by the present invention has the following beneficial effects: This invention acquires consecutive frame images of each paper cup; for each frame, it obtains the cup rim outline and selects representative points; it obtains the displacement vector of each representative point in two adjacent frames, and determines the directional deviation angle of each representative point in each frame; based on the displacement vector and directional deviation angle, it obtains the sliding influence coefficient of the cup rim position in each frame, and then analyzes the fluctuation amplitude of the cup rim position sliding in all frames to determine the degree of sliding influence of each cup rim; based on the displacement vector and sliding influence coefficient, combined with the lag time, it determines the degree of lag deviation of the cup rim position in each frame; based on the degree of sliding influence and the degree of lag deviation, it determines the degree of position mismatch of each cup rim; based on the degree of position mismatch, it determines the degree of correction of each cup rim, and combined with the overall displacement of the cup rim, it corrects the position of the cup rim. This invention analyzes the dynamic sliding characteristics of paper cups during the conveying process using continuous frame images and quantifies the comprehensive positional deviation caused by vibration and image acquisition lag. It achieves dynamic correction and real-time positioning compensation, solving the problem of insufficient positioning accuracy caused by the inability to capture micro-movements and lag in traditional static image methods. This improves the positioning accuracy of paper cup mouths, ensures accurate alignment of subsequent processes (such as stacking), and improves the product processing quality of stacked paper cups. Attached Figure Description
[0016] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a basic flowchart illustrating a method for positioning the mouth of a paper cup in a stacked paper cup production line, as provided in one embodiment of the present invention. Figure 2 This is a schematic diagram of the basic components of a paper cup rim positioning system for a stacked paper cup production line, provided as an embodiment of the present invention. Detailed Implementation
[0018] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of the paper cup rim positioning method and system for a stacked paper cup production line proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. Terms such as “comprising,” “including,” or any other variations thereof are intended to cover a non-exclusive inclusion, such that a circuit structure, article, or device comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such article or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of additional identical elements in the article or device that includes the element.
[0020] The following describes in detail, with reference to the accompanying drawings, a specific scheme for a paper cup rim positioning method for a stacked paper cup production line provided by the present invention.
[0021] Please see Figure 1 This illustrates the basic flow of a paper cup rim positioning method for a stacked paper cup production line provided by an embodiment of the present invention.
[0022] like Figure 1 As shown, an embodiment of the present invention provides a method for positioning the mouth of a paper cup in a stacked paper cup production line, specifically including: S100: Acquire consecutive frame images of each paper cup.
[0023] After the stacked paper cups are processed, they are placed on a conveyor belt and transported to the inspection area. A high-resolution industrial camera is positioned in front of the inspection area of the stacked paper cup production line, ensuring that the camera's field of view completely covers each individual paper cup. The camera should be installed perpendicular to the cup's conveying direction to ensure complete capture of the cup's rim area. Additionally, a uniform lighting system is used to ensure clear images. The industrial camera acquires continuous frame images of the paper cups on the production line in real time, with a frame rate of at least 30 frames per second, and the frame interval is denoted as [missing information]. The entire dynamic process of covering each paper cup through the detection area is completed to obtain the information for each paper cup. A continuous sequence of original images.
[0024] Each acquired original image frame undergoes preprocessing. First, the color original image is converted to a grayscale image. Then, for each grayscale image frame, Gaussian filtering is used for image smoothing to suppress interference from dust, reflections, and other factors that may exist in the production environment. Histogram equalization is then used for image enhancement to improve image contrast and make the distinction between the cup rim edge and the background more obvious, resulting in an enhanced grayscale image. Finally, based on the Otsu adaptive thresholding algorithm, the optimal segmentation threshold is automatically calculated, and each enhanced grayscale image frame is converted into a binary image to separate the paper cup region from the interference region, obtaining the image for each paper cup. Frame-by-frame image.
[0025] S200: For each frame of image, obtain the outline of the cup rim and select representative points of the outline.
[0026] For each frame of the image, the outline of the cup's rim is obtained, and representative points on the outline are selected. Further steps include: First, a Cartesian coordinate system is established for each frame of the image. Specifically, for each frame of the image of each paper cup (each frame of the image after preprocessing each paper cup), a Cartesian coordinate system is established with the upper left corner of the camera imaging plane (or the edge of the conveyor belt, or a fixed point on the frame) as the origin (the x-axis is along the direction of movement of the conveyor belt, and the y-axis is perpendicular to the direction of transport of the conveyor belt and pointing downwards). This allows us to obtain the position coordinates of each pixel in each frame of the image, providing a reference for subsequent position change calculations.
[0027] Then, for each frame of the image, the Canny edge detection algorithm is used to perform edge detection, obtaining all contours in each frame. Specifically, for each frame of the image of each paper cup (each frame of the preprocessed image of each paper cup), the Canny edge detection algorithm is used to perform edge detection, obtaining all contours in each frame. After detection using the Canny edge detection algorithm, multiple contours may be obtained (the cup rim and other seams of the cup body, the edges of printed patterns, background interference, and other edge contours), so contour filtering is required to accurately obtain the cup rim contour of the paper cup. Furthermore, for each frame of image for each paper cup, based on the prior geometric features of the cup rim—that is, the cup rim is approximately circular in the image—other interfering contours on the production line (such as cup seams, edges of printed patterns, scratches or stains in the background) mostly appear as lines, irregular patches, or small-area graphics, rarely forming a complete, closed, and approximately circular contour. Moreover, within the effective imaging area of a single paper cup (i.e., the area where the paper cup is located in the image), the cup rim is the uppermost and largest diameter part of the entire paper cup. Therefore, when the camera shoots from above, the image area (i.e., the contour area) enclosed by the edge of the cup rim is usually the largest of all visible features of the entire paper cup. Using the above criteria, the most suitable contour is selected from each frame of image as the cup rim contour. That is, after obtaining all contours in the image through the Canny edge detection algorithm, if the distance between the first and last points of the contour is less than a set threshold (e.g., 2 pixels), the contour is considered closed. For closed contours, the roundness index is calculated based on the ratio of area to perimeter, and the area of the closed contour is calculated based on the number of pixels. The closed contour with the largest roundness and the largest area is then taken as the cup rim contour.
[0028] Finally, for the cup rim outline of each image frame, representative points are selected according to azimuth angles, and their coordinate values are marked. Specifically, for the cup rim outline of each image frame, a least-squares circle fitting is first performed on the outline. On the fitted standard cup rim outline, representative points can be selected according to azimuth angles. For example, on the closed cup rim outline, representative points are selected by dividing the azimuth angle into six equal parts: 0°, 60°, 120°, 180°, 240°, and 300°. And the... The first frame of the image The coordinates of the points representing the contour are as follows: .
[0029] S300: Obtain the displacement vector of each contour representative point in two adjacent frames, and determine the directional deviation angle of each contour representative point in each frame.
[0030] During the cup positioning process in a stacked paper cup production line, the vibration of the conveyor belt during cup transport may cause slight slippage of the cups, leading to deviations in cup positioning. Ideally, the cups move synchronously along the conveyor belt's transport direction, with their position information changing only in that direction and at the same speed. However, in actual production, factors such as conveyor belt vibration can cause the cups to slip, resulting in changes in the cup rim's position information in multiple directions. The greater the degree of change, the more pronounced the slippage trend, and the greater the impact on the accuracy of cup positioning.
[0031] Based on the above analysis, in the embodiments of the present invention, the directional deviation angle of each contour representative point in each frame image is determined by obtaining the displacement vector of each contour representative point in two adjacent frames. Further, it includes: First, based on the coordinates of the contour representative points, calculate the displacement vector of each contour representative point between the current frame and the previous frame. Specifically, taking the first... The first frame of the image Each contour represents a point (coordinate value) Taking ( ) as an example, calculate its relationship with the first ( ). The first frame of the image Each contour represents a point (coordinate value) The displacement vector between them is: In the formula, Indicates the first The first frame of the image The contour representative point and the first The first frame of the image Each contour represents a displacement vector between points; Indicates the first The first frame of the image Each contour represents the coordinate values of a point; Indicates the first The first frame of the image Each contour represents the coordinate value of a point.
[0032] It should be noted that the first one here The first frame of the image The contour representative point and the first The first frame of the image The outline represents a point that does not refer to a matching point of a physical point (paper cups may rotate on the production line, so a perfect match of points is meaningless). Instead, it refers to a matching point on the outline of the paper cup in the same direction (six equally divided directions: 0°, 60°, 120°, 180°, 240°, and 300°). In other words, it only focuses on the translation of the cup rim outline and does not focus on the rotation of the cup rim.
[0033] Then, the greater the deviation of the cup rim contour's point position information from the conveyor belt's transport direction, the more severe the influence of factors such as conveyor belt vibration. Therefore, based on the displacement vector and the unit vector of the conveyor belt's movement direction, the directional deviation angle of each contour representative point in each frame image is calculated. Specifically, the first... The first frame of the image The formula for calculating the directional deviation angle of each contour point is: In the formula, Indicates the first The first frame of the image Each contour represents the angle of deviation of a point from its direction. Indicates the first The first frame of the image The contour representative point and the first The first frame of the image Each contour represents a displacement vector between points; A unit vector representing the direction of movement of the conveyor belt; Indicates the first The first frame of the image The contour representative point and the first The first frame of the image Each contour represents the displacement length between points; The magnitude of the unit vector representing the direction of movement of the conveyor belt; This represents the inverse cosine function.
[0034] Direction deviation angle This value is used to quantify the degree to which the displacement of the representative point of the profile deviates from the synchronous movement of the conveyor belt. The larger the value, the more obvious the slippage of the representative point of the profile, the farther it deviates from the normal movement trajectory, and the lower the degree of synchronous movement.
[0035] It should be understood that before using the above formula to calculate the directional deviation angle, the displacement length must first be determined. If the noise level is less than a preset noise threshold (e.g., 0.5 pixels), the directional deviation angle is directly determined to be 0, and no further trigonometric function calculation is performed. Otherwise, the directional deviation angle is calculated using the above formula.
[0036] S400: Based on the displacement vector and the direction deviation angle, obtain the sliding influence coefficient of the cup rim position in each frame image, and then analyze the fluctuation amplitude of the cup rim position sliding in all frame images to determine the degree of sliding influence of each cup rim.
[0037] Step S300 analyzed that during actual production, conveyor belt vibration might cause slight slippage of the paper cups during the conveying stage, leading to an angle deviation of the paper cup's movement direction from the conveyor belt's transport direction. This step further analyzed the degree of deviation of the paper cup's movement on multiple consecutive frames of images, thereby quantifying the impact of paper cup slippage caused by factors such as vibration during conveyor belt transport. Specifically, the worse the synchronization between the paper cup displacement and the conveyor belt movement, and the greater the overall fluctuation, the more severe the paper cup slippage, and the greater the impact on the accuracy of the cup's positioning.
[0038] Based on the above analysis, in the embodiments of the present invention, the sliding influence coefficient of the cup rim position in each frame image is obtained according to the displacement vector and the direction deviation angle. Then, the fluctuation amplitude of the cup rim position sliding in all frame images is analyzed to determine the degree of sliding influence of each cup rim. Wherein: Based on the displacement vector and the directional deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained. This further includes: first, obtaining the displacement length of each contour representative point between the current frame image and the previous frame image based on the displacement vector; then, based on the displacement length and the sine value of the directional deviation angle, obtaining the sliding influence coefficient of the cup rim position in each frame image. Specifically, the worse the synchronization between the paper cup's displacement and the conveyor belt's movement, the more violent the paper cup sliding, and the greater the impact on the accuracy of the cup rim positioning. Therefore, the first... The formula for calculating the sliding influence coefficient of the cup rim position in the frame image is: In the formula, Indicates the first The sliding influence coefficient of the cup rim position in the frame image; Indicates the first The first frame of the image Each contour represents the angle of deviation of a point from its direction. Indicates the first The first frame of the image The contour representative point and the first The first frame of the image Each contour represents the displacement length between points; Represents the sine function; Indicates the first The total number of contour-representing points in a frame image; This represents a linear normalization function, such as a max-min normalization function, used to normalize the sliding influence coefficient to... Within the range, the maximum value in the maximum-minimum normalization function is the preset upper limit of the range, which is set based on the maximum displacement deviation that occurred in historical production data.
[0039] The larger the value, the greater the angle at which the point represented by the contour deviates from the normal motion trajectory (within the range of 0 to 90 degrees), the lower the degree of synchronous motion caused by sliding, and therefore the greater the sliding influence coefficient; The larger the value, the farther the point represented by the contour deviates from the normal motion trajectory; the sliding influence coefficient The larger the value, the worse the synchronization between the paper cup displacement and the conveyor belt movement in the frame image, indicating that the paper cup slides more violently and has a greater impact on the accuracy of the cup rim positioning; conversely, the smaller the value, the better the synchronization between the paper cup displacement and the conveyor belt movement in the frame image, and the smaller the sliding effect.
[0040] In the paper cup production process, the stability of the production process requires attention not only to instantaneous anomalies but also to the fluctuations throughout the entire process, i.e., the overall movement trend. In other words, the greater the fluctuation in the intensity of the sliding influence experienced by the paper cup as it passes through the entire detection area, the greater the degree of sliding influence. Therefore, by analyzing the fluctuation amplitude of the sliding at the cup rim position in all frame images, the degree of sliding influence for each rim is determined. This further includes: obtaining the minimum sliding influence coefficient corresponding to all frame images, calculating the difference between the sliding influence coefficients corresponding to all frame images and the minimum sliding influence coefficient, and combining this with the average sliding influence coefficient of all frame images to obtain the degree of sliding influence for each rim. Specifically, the formula for calculating the degree of sliding influence of the cup rim is: In the formula, Indicates the degree of influence of the sliding motion at the rim of the cup; This indicates the total number of frames captured by the cup rim as it passes through the entire detection area. This indicates that the cup opening passes through the entire detection area. Average sliding effect coefficient of frame image; Indicates the first The sliding influence coefficient of the cup rim position in the frame image; This represents a function that takes the minimum value. This indicates that the cup opening passes through the entire detection area. The minimum sliding effect coefficient of a frame image; This represents a linear normalization function, such as a max-min normalization function, used to normalize the degree of slippage effect to... Within the range, the maximum value of the maximum-minimum normalization function is the maximum allowable sliding energy level based on historical calibration.
[0041] This represents the slightest slippage of the paper cup, serving as a benchmark for the degree of slippage. This represents the sum of the deviations between the sliding influence coefficient and the minimum sliding influence coefficient corresponding to each frame of the image, reflecting the fluctuation range and instability of the paper cup sliding over time. This indicates the degree of slippage. The larger the value, the more violently the paper cup slips and the more severe the interference during transportation, resulting in poorer accuracy of cup mouth positioning.
[0042] S500: Based on the displacement vector and the sliding influence coefficient, combined with the hysteresis duration, determine the degree of hysteresis deviation of the cup rim position in each frame of the image.
[0043] Because the movement of paper cups on the conveyor belt in a high-speed production line is not perfect, in addition to slippage caused by vibration, there is an inherent delay in the image acquisition and processing process itself. During this delay, the paper cup continues to move along the conveyor belt, resulting in the system acquiring the cup rim position information not being the current real-time position of the paper cup, but rather its state at a certain point in the past. This lag directly affects the timing and accuracy of subsequent actuators (such as robotic arms and correction devices).
[0044] Based on the above analysis, in the embodiments of the present invention, the degree of hysteresis deviation of the cup rim position in each frame of the image is determined according to the displacement vector and the sliding influence coefficient, combined with the hysteresis duration. Further details include: First, the total time from the image acquisition trigger moment to the system outputting positioning parameters and transmitting them to the actuator is recorded as the lag time. Specifically, the total time from the image acquisition trigger moment of the paper cup to the system outputting positioning parameters and transmitting them to the actuator (clamp, correction device) is recorded as the lag time. The lag time can be obtained through system calibration, for example, by setting fixed markers on the conveyor belt and comparing the time difference between the camera capture moment and the moment the markers arrive at the photoelectric sensor.
[0045] Then, based on the displacement vector, the average displacement length of all contour representative points in each frame image between the current frame image and the previous frame image is obtained, that is, the calculation of the first frame image is performed. All contour-representing points in the frame image at the 1st Frame image and the first The average displacement length between frames.
[0046] Finally, based on the average displacement length and the sliding influence coefficient, combined with the hysteresis duration and frame interval duration, the degree of hysteresis deviation of the cup's position in each frame image is obtained. Specifically, the... The formula for calculating the degree of hysteresis deviation of the cup rim position in the frame image is as follows: In the formula, Indicates the first The degree of hysteresis deviation in the position of the cup rim in the frame image; Indicates the first The sliding influence coefficient of the cup rim position in the frame image; Indicates the first The first frame of the image The contour representative point and the first The first frame of the image Each contour represents the displacement length between points; Indicates the frame interval duration; Indicates the first The total number of contour-representing points in a frame image; Indicates the lag time; This represents a linear normalization function, such as a max-min normalization function, used to normalize the degree of slippage effect to... Within the range, the maximum value of the maximum-minimum normalization function is the maximum permissible hysteresis deviation energy level based on historical calibration.
[0047] Indicates all Each contour represents the average displacement length of a point. This indicates the speed at which the paper cup moves; the larger the value, the faster the paper cup moves, in conjunction with the lag time. The larger the value, the higher the number of... The greater the hysteresis deviation of the cup rim position in the frame image, the greater the deviation between the obtained cup rim positioning parameters and the actual real-time position of the paper cup.
[0048] S600: Determine the degree of positional mismatch of each cup opening based on the degree of sliding influence and the degree of hysteresis deviation.
[0049] The greater the temporal fluctuation of the hysteresis bias throughout the entire passage of the paper cup through the detection area, the worse the stability of the hysteresis bias and the more complex the paper cup's trajectory. The positional deviation caused by the hysteresis will be further amplified, resulting in a greater degree of mismatch in the position of the cup rim. In addition, the greater the degree of sliding influence, the greater the degree of mismatch in the position of the cup rim.
[0050] Based on the above analysis, in the embodiments of the present invention, the degree of positional mismatch of each cup rim is determined according to the degree of sliding influence and the degree of hysteresis deviation. Further, this includes: calculating the standard deviation and mean of the hysteresis deviation corresponding to all frame images, and combining this with the degree of sliding influence to obtain the degree of positional mismatch of each cup rim. Specifically, the formula for calculating the degree of positional mismatch of the cup rim is: In the formula, This indicates the degree of mismatch in the position of the cup rim; Indicates the degree of influence of the sliding motion at the rim of the cup; This indicates that the cup opening passes through the entire detection area. The mean degree of hysteresis in the frame image; This indicates that the cup opening passes through the entire detection area. The standard deviation of the hysteresis bias corresponding to the frame image; This indicates the total number of frames captured by the cup rim as it passes through the entire detection area. This represents a linear normalization function, such as a max-min normalization function, used to normalize the degree of positional mismatch to... Within the range, the maximum value of the maximum and minimum normalized functions is the limit value of the actuator correction (such as the maximum stroke of the correction mechanism).
[0051] Standard deviation A larger value indicates a greater temporal fluctuation in the hysteresis bias throughout the entire passage of the paper cup through the detection area, signifying poorer stability of the hysteresis bias, a more complex paper cup trajectory, and a further amplification of the positional deviation caused by the hysteresis, resulting in a greater degree of mismatch in the cup's position; the degree of sliding influence. The higher the value, the more violently the paper cup slides and the more severe the interference during transportation, resulting in a greater degree of mismatch in the cup rim position; the degree of mismatch... The larger the value, the greater the mismatch between the system positioning parameters and the actual real-time position of the paper cup, and the worse the positioning accuracy.
[0052] S700: Based on the degree of positional mismatch, determine the correction level for each cup rim, and correct the position of the cup rim by combining the overall displacement of the cup rim.
[0053] The degree of correction for each cup rim is determined based on the degree of positional mismatch. Specifically, the formula for calculating the degree of correction for the cup rim is: In the formula, Indicates the degree of correction at the rim of the cup; This indicates the degree of mismatch in the position of the cup rim; Represented by natural constant An exponential function with base 0.
[0054] Position mismatch The larger the value, the greater the positioning deviation, and the greater the degree of correction of the cup rim. Degree of Correction This reflects the correction strength required by the system to compensate for the positional deviation caused by the slippage of the paper cup and the lag in image acquisition. The larger the value, the more unstable the paper cup movement, the more significant the effects of slippage and lag, the less accurate the positioning, and the stronger the correction required by the system to ensure the positioning accuracy of the cup mouth.
[0055] Based on the degree of correction of the cup rim and considering the overall displacement of the cup rim, the position of the cup rim is corrected. Specifically, firstly, the center point of the cup rim contour is obtained, and the coordinates of this center point are marked as follows: (No. The coordinates of the center point of the cup's outline in the frame image are given. These coordinates are observed values in a Cartesian coordinate system. The last frame image (the...) The coordinates of the center point of the cup's rim outline in the frame image are denoted as follows: ; and obtain the average displacement vector of the cup rim, that is, the displacement vector of the cup rim as it passes through the entire detection area. The average displacement vector between the center point of the cup rim contour in the first frame image (excluding the first frame) and the center point of the cup rim contour in the previous frame image; then, based on the degree of correction... The coordinates of the center point are dynamically corrected based on the total displacement length to obtain the corrected coordinates of the center point. The calculation formula is as follows: In the formula, The coordinates of the center point of the corrected cup rim profile; Indicates the first The coordinates of the center point of the cup's rim outline in the frame image (the last frame image); Indicates the degree of correction at the rim of the cup; This indicates that the cup opening passes through the entire detection area. The average displacement vector between the center point of the cup rim contour in the first frame image (excluding the first frame) and the center point of the cup rim contour in the previous frame image. It reflects the overall displacement trend of the cup rim.
[0056] Corrected paper cup rim position parameters The system provides real-time feedback to the conveying and processing mechanisms on the production line. Based on this positioning parameter, the control system drives the speed adjustment module of the conveyor belt, the correction robot, or the rotary fixture and other actuators to dynamically adjust the position of the paper cup, ensuring that the cup mouth is accurately aligned with the subsequent processing station.
[0057] The above parameter calculation methods and correction logic are integrated into the cup mouth positioning system of the composite stacked paper cup production line to realize the cup mouth positioning of the stacked paper cup production line.
[0058] Based on the same inventive concept as the above method, this embodiment also provides a paper cup rim positioning system for a stacked paper cup production line.
[0059] Please see Figure 2 This illustrates the basic components of a paper cup rim positioning system for a stacked paper cup production line provided by an embodiment of the present invention.
[0060] like Figure 2 As shown, a paper cup rim positioning system for a stacked paper cup production line includes a memory 10 and a processor 20, wherein: Memory 10 is used to store program code; The processor 20 is used to read the program code stored in the memory 10 and execute it to acquire consecutive frame images of each paper cup; for each frame image, it acquires the cup rim outline and selects representative points of the outline; it acquires the displacement vector of each representative point of the outline in two adjacent frames, and determines the directional deviation angle of each representative point of the outline in each frame image; based on the displacement vector and directional deviation angle, it acquires the sliding influence coefficient of the cup rim position in each frame image, and then analyzes the fluctuation amplitude of the cup rim position sliding in all frames image to determine the degree of sliding influence of each cup rim; based on the displacement vector and sliding influence coefficient, combined with the lag time, it determines the degree of lag deviation of the cup rim position in each frame image; based on the degree of sliding influence and the degree of lag deviation, it determines the degree of position mismatch of each cup rim; based on the degree of position mismatch, it determines the degree of correction of each cup rim, and combined with the overall displacement of the cup rim, it corrects the position of the cup rim.
[0061] Furthermore, the processor 20 includes an image acquisition module 21, a cup rim contour acquisition module 22, a direction deviation analysis module 23, a position mismatch analysis module 24, and a cup rim position correction module 25, wherein: Image acquisition module 21 is used to acquire consecutive frame images of each paper cup; The cup rim contour acquisition module 22 is used to acquire the cup rim contour for each frame of image and select representative points of the contour; The orientation deviation analysis module 23 is used to obtain the displacement vector of each contour representative point in two adjacent frames of images and determine the orientation deviation angle of each contour representative point in each frame of images. The position mismatch analysis module 24 is used to obtain the sliding influence coefficient of the cup rim position in each frame image based on the displacement vector and the direction deviation angle, and then analyze the fluctuation amplitude of the cup rim position sliding in all frame images to determine the degree of sliding influence of each cup rim; and is used to determine the degree of hysteresis deviation of the cup rim position in each frame image based on the displacement vector and the sliding influence coefficient, combined with the hysteresis duration; and is used to determine the degree of position mismatch of each cup rim based on the degree of sliding influence and the degree of hysteresis deviation. The cup rim position correction module 25 is used to determine the correction degree of each cup rim based on the degree of position mismatch, and to correct the position of the cup rim in combination with the overall displacement of the cup rim.
[0062] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0063] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A method for positioning the mouth of a paper cup in a stacked paper cup production line, characterized in that, The method includes: Acquire consecutive frame images of each paper cup; For each frame of the image, obtain the outline of the cup rim and select representative points of the outline; Obtain the displacement vector of each contour representative point in two adjacent frames, and determine the directional deviation angle of each contour representative point in each frame; Based on the displacement vector and the directional deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained, and then the fluctuation amplitude of the cup rim position sliding in all frame images is analyzed to determine the degree of sliding influence of each cup rim. Based on the displacement vector and the sliding influence coefficient, combined with the hysteresis duration, the degree of hysteresis deviation of the cup rim position in each frame image is determined; The degree of positional mismatch of each cup opening is determined based on the degree of sliding influence and the degree of hysteresis deviation. Based on the degree of positional mismatch, the correction degree of each cup opening is determined, and the position of the cup opening is corrected in combination with the overall displacement of the cup opening. Based on the displacement vector and the direction deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained, including: Based on the displacement vector, the displacement length of each contour representative point between the current frame image and the previous frame image is obtained; Based on the displacement length and the sine value of the directional deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained.
2. The paper cup rim positioning method for a stacked paper cup production line according to claim 1, characterized in that, For each frame of the image, the outline of the cup's rim is obtained, and representative points of the outline are selected, including: For each frame of the image, establish a Cartesian coordinate system; For each frame of the image, the Canny edge detection algorithm is used to perform edge detection, and all contours in each frame of the image are obtained; For each frame of image, based on the prior geometric features of the cup rim, the most suitable contour is selected from all contours as the cup rim contour. For the cup rim outline of each frame image, select representative points of the outline according to the azimuth angle, and mark the coordinate values of the representative points of the outline.
3. The method for positioning the mouth of a paper cup in a stacked paper cup production line according to claim 2, characterized in that, Obtain the displacement vector of each contour representative point in two adjacent image frames, and determine the directional deviation angle of each contour representative point in each image frame, including: Based on the coordinate values of the contour representative points, calculate the displacement vector of each contour representative point between the current frame image and the previous frame image; Based on the displacement vector and the unit vector of the conveyor belt's movement direction, the directional deviation angle of each contour representative point in each frame of the image is obtained.
4. The paper cup rim positioning method for a stacked paper cup production line according to claim 1, characterized in that, Analyze the fluctuation amplitude of the cup rim position sliding in all frame images to determine the degree of sliding influence of each cup rim, including: Obtain the minimum sliding influence coefficient corresponding to all frame images, calculate the difference between the sliding influence coefficient corresponding to all frame images and the minimum sliding influence coefficient, and combine it with the average sliding influence coefficient of all frame images to obtain the degree of sliding influence of each cup rim.
5. The paper cup rim positioning method for a stacked paper cup production line according to claim 1, characterized in that, Based on the displacement vector and the sliding influence coefficient, combined with the hysteresis duration, the degree of hysteresis deviation of the cup rim position in each frame image is determined, including: The total time from the moment the image acquisition is triggered to the system outputting positioning parameters and transmitting them to the actuator is denoted as the lag time. Based on the displacement vector, the average displacement length of all the contour representative points in each frame image between the current frame image and the previous frame image is obtained. Based on the average displacement length and the sliding influence coefficient, combined with the hysteresis duration and frame interval duration, the degree of hysteresis deviation of the cup rim position in each frame image is obtained.
6. The method for positioning the mouth of a paper cup in a stacked paper cup production line according to claim 1, characterized in that, Based on the degree of sliding influence and the degree of hysteresis deviation, determine the degree of positional mismatch of each cup rim, including: Calculate the standard deviation and mean of the hysteresis deviation for all frame images, and combine this with the degree of slippage effect to obtain the degree of mismatch in the position of each cup rim.
7. The paper cup rim positioning method for a stacked paper cup production line according to claim 1, characterized in that, Obtain consecutive frame images of each paper cup, including: Collect continuous frame images of paper cups on the production line; Convert the original image to a grayscale image; The grayscale image is smoothed using a Gaussian filtering method and enhanced using a histogram equalization algorithm to obtain an enhanced grayscale image. Based on the Otsu adaptive thresholding algorithm, the optimal segmentation threshold is automatically calculated, and the enhanced grayscale image is converted into a binary image to obtain continuous frame images of each paper cup.
8. A paper cup rim positioning system for a stacked paper cup production line, characterized in that, The system includes: a memory and a processor, wherein: The memory is used to store program code; The processor is configured to read program code stored in the memory and execute the method as described in any one of claims 1 to 7.
9. The paper cup rim positioning system for a stacked paper cup production line according to claim 8, characterized in that, The processor includes: The image acquisition module is used to acquire consecutive frame images of each paper cup; The cup rim contour acquisition module is used to acquire the cup rim contour for each frame of the image and select representative points of the contour. The orientation deviation analysis module is used to obtain the displacement vector of each of the contour representative points in two adjacent frames of images, and to determine the orientation deviation angle of each of the contour representative points in each frame of images. The position mismatch analysis module is used to obtain the sliding influence coefficient of the cup rim position in each frame image based on the displacement vector and the direction deviation angle, and then analyze the fluctuation amplitude of the cup rim position sliding in all frame images to determine the degree of sliding influence of each cup rim; and is used to determine the degree of lag deviation of the cup rim position in each frame image based on the displacement vector and the sliding influence coefficient, combined with the lag time; and is used to determine the degree of position mismatch of each cup rim based on the degree of sliding influence and the degree of lag deviation. The cup rim position correction module is used to determine the correction degree of each cup rim based on the degree of position mismatch, and to correct the position of the cup rim by combining the overall displacement of the cup rim. Based on the displacement vector and the direction deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained, including: Based on the displacement vector, the displacement length of each contour representative point between the current frame image and the previous frame image is obtained; Based on the displacement length and the sine value of the directional deviation angle, the sliding influence coefficient of the cup rim position in each frame image is obtained.
Citation Information
Patent Citations
Vision-based belt deviation detection method, system and equipment and storage medium
CN116573366A
Cup defect detection method and system based on machine vision
CN120404776A