Filling opening anti-leakage monitoring system and method based on machine vision

By preprocessing and performing global grayscale threshold segmentation on the filling port image using machine vision technology, combined with dynamic frame difference matching, the problems of inaccurate liquid droplet segmentation and missegmentation of background impurities in the anti-drip monitoring of the filling port of a carton filling machine are solved, achieving efficient and accurate liquid droplet leakage monitoring.

CN121746366APending Publication Date: 2026-03-27SHANDONG BIHAI MASCH TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies for drip prevention monitoring at the filling nozzle of carton filling machines suffer from problems such as inaccurate droplet segmentation, missegmentation of background impurities, and missed detection of droplet movement trajectories, leading to a decrease in monitoring accuracy.

Method used

A machine vision-based anti-drip monitoring system for filling ports is adopted, which includes a filling port image preprocessing module, an image global grayscale threshold segmentation module, and a carton station frame difference dynamic matching module. Through specific wavelength imaging processing, adaptive Gamma correction, and global grayscale threshold segmentation, droplet characteristics are dynamically matched to achieve real-time monitoring of droplet leakage.

Benefits of technology

It improves the accuracy of droplet feature extraction and the real-time performance of monitoring, reduces interference from uneven lighting and color deviation, enhances the accuracy of droplet leakage detection and the relevance of alarms, and ensures the efficiency and accuracy of drip monitoring at the filling port.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746366A_ABST
    Figure CN121746366A_ABST
Patent Text Reader

Abstract

The invention provides a filling port leakage-proof monitoring system and method based on machine vision, and relates to the technical field of visual image processing, and the system comprises a filling port image preprocessing module, an image global gray threshold segmentation module, a carton station frame difference dynamic matching module and a liquid drop leakage monitoring and determination module. According to the method, the filling port images can be collected and preprocessed, then the preprocessed filling port images are subjected to global gray threshold segmentation, the filling port images at different time intervals are selected based on different working conditions of a paper box, and finally, the filling port images are subjected to global gray threshold segmentation. According to the invention, the accuracy of feature extraction during the extraction of the motion features of the liquid drops is realized, and the problem that the anti-leakage monitoring accuracy of the filling port of the carton filling machine is insufficient in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual image processing technology, and in particular to a machine vision-based anti-drip monitoring system and method for filling nozzles. Background Technology

[0002] In the wave of industrial production's deep transformation towards intelligent manufacturing, the food and beverage packaging industry is continuously upgrading its standards for quality control across the entire product chain. In particular, cardboard box filling, which is directly related to product sealing and food safety, has become a core link in enterprise quality control. In the current process of food and beverage packaging quality monitoring, manual inspection is generally carried out through visual observation and manual sampling to determine whether there are problems such as dripping or poor sealing at the filling port. For example, checking whether there are stains on the surface of the cardboard packaging and the cardboard box workstation to verify the integrity of the food and beverage packaging. However, this method has obvious lag: when stains are found, the packaging has already been contaminated, and the contamination range will continue to expand.

[0003] To improve the real-time performance of drip-proof monitoring at the filling port of a carton filling machine, existing technologies primarily acquire real-time frames of the filling process from cameras at each station of the machine, simultaneously collecting motion data from the carton stations. This data includes key information such as conveyor speed, start / stop points, and station positioning coordinates. By combining the image variation patterns during the carton conveying and filling stationary phases, the optimal frame difference interval for each scene is determined. Furthermore, image region calibration is performed using the motion data from the carton stations to eliminate image shift caused by station displacement. Next, targeted image enhancement is conducted, employing adaptive histogram equalization to improve the image clarity of the filling port area. Finally, the real-time frames of the filling process are combined with the motion data from the carton stations to extract the filling port image. A grayscale threshold segmentation algorithm is then used to separate the filling port area from the background area within the filling port image. The filling port area is the monitoring area of ​​the filling port of the carton filling machine in the image. It includes the filling port itself and the core target area around which droplets may appear. The background area is the irrelevant area in the image other than the filling port area, such as other parts of the carton surface, equipment frame, conveyor track, etc., thus locking the filling port area. Then, based on machine vision technology, the features of the filling port area are extracted, such as the continuity of the filling port edge, the shape, area, and position of the target spots in the image of the filling port, and the falling trajectory and area change trend of droplets in multiple consecutive frames. At the same time, deep learning algorithms, such as convolutional neural network algorithms, are used to determine anomalies. Different actions are performed according to the anomaly level. If the droplet pixel area, edge protrusion length exceeds the threshold, or droplet trajectory is detected in 3 consecutive frames, it is determined to be a leak. Finally, the anti-drip monitoring of the filling port of the carton filling machine is realized.

[0004] In existing technologies, grayscale thresholding algorithms cannot handle batch variations in liquids. For example, different transparency levels and colors of liquids result in differences in the absorption, reflection, transmission, and scattering characteristics of incident light. Since grayscale values ​​are essentially a quantitative representation of light brightness by image pixels, variations in image grayscale values ​​can easily lead to problems such as missed segmentation of droplets or missegmentation of background impurities. Furthermore, for non-standard shaped droplets, such as stringy droplets from viscous liquids, the grayscale values ​​of the stringy parts may overlap significantly with the grayscale values ​​of background areas, such as the metal edges of the filling port or the inner wall of the cardboard box, due to changes in the scattering angle. In such cases, grayscale thresholding alone cannot effectively distinguish stringy droplets from the background, easily resulting in stringy areas being missegmented. The lack of segmentation makes accurate segmentation difficult, directly causing positioning deviations in the filling port area. This leads to measurement distortions in the shape and area of ​​droplet spots, and may even result in the misjudgment of tiny impurities as "suspected droplets." In addition, although existing technologies combine motion data from the carton station to determine the optimal frame difference interval for each scenario, they still rely on a fixed optimal frame difference interval in actual execution. This causes sudden changes in the speed of the carton station during the dynamic phase of carton conveying start and stop. The fixed frame difference in consecutive frames cannot adapt to this situation, and it is easy to skip key trajectory nodes of droplet movement, resulting in missed detection of droplet movement trajectory. This disrupts the temporal continuity and spatial integrity required for droplet movement feature extraction, leading to deviations in the motion feature extraction level of machine vision technology, and ultimately reducing the accuracy of anti-drip monitoring at the filling port of the carton filling machine. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a machine vision-based anti-drip monitoring system and method for filling ports, which can achieve high accuracy in feature extraction when extracting droplet motion features, and solves the technical problem of insufficient accuracy in anti-drip monitoring of filling ports in existing carton filling machines.

[0006] This invention provides a machine vision-based anti-drip monitoring system for filling ports. The system includes: a filling port image preprocessing module, an image global grayscale threshold segmentation module, a carton station frame difference dynamic matching module, and a droplet leakage detection and determination module. The filling port image preprocessing module first acquires an image of the filling port and preprocesses it using machine vision methods. The image global grayscale threshold segmentation module performs global grayscale threshold segmentation on the filling port image obtained after preprocessing by the image preprocessing module, separating the filling port area from the background area in the filling port image. The carton station frame difference dynamic matching module extracts droplet features from the filling port based on the operating conditions after acquiring the segmented filling port image through the image global grayscale threshold segmentation module. The droplet leakage detection and determination module, after extracting the droplet features from the filling port by the carton station frame difference dynamic matching module, performs a droplet leakage pre-determination to determine the real-time performance of the anti-drip monitoring and obtains the corresponding determination result.

[0007] This application also provides a machine vision-based method for preventing dripping at filling ports. This method is applied to a machine vision-based system for preventing dripping at filling ports. The method includes: first, acquiring an image of the filling port and preprocessing the image using a machine vision method; performing global grayscale thresholding on the preprocessed image obtained by the image preprocessing module to separate the filling port area from the background area; after acquiring the segmented filling port image through the global grayscale thresholding module, the carton station frame difference dynamic matching module extracts droplet features based on the operating conditions; and after the carton station frame difference dynamic matching module extracts the droplet features, it performs a pre-judgment of droplet leakage to determine the real-time performance of the dripping port prevention monitoring, and obtains the corresponding judgment result.

[0008] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: 1. By acquiring and preprocessing images of the filling port, color cast is reduced, filling port area features are enhanced, and background interference is weakened, improving the overall recognizability and extractability of droplet features. This achieves the acquisition of high-quality, high-contrast standardized images. Global grayscale threshold segmentation is performed on the preprocessed filling port images, and filling port images at different time intervals are selected based on different working conditions of the cardboard box. This helps to accurately delineate the initial droplet candidate area, thereby ensuring the continuity of droplet trajectory and monitoring efficiency under different working conditions. It improves the accuracy of the initial screening of droplet candidate areas and the stability of trajectory tracking, thus achieving effective locking of the pre-leaking area of ​​droplets and the reliability of obtaining droplet falling motion features. The determination of droplet leakage monitoring based on the selected filling port images helps to classify droplet leakage risks, improves the accuracy of droplet leakage determination and the pertinence of alarms, thereby achieving real-time monitoring of filling port leakage.

[0009] 2. Preprocessing the filling port image using machine vision methods helps reduce interference from uneven lighting and color cast, enhances the distinction between the droplet area and the background, and improves the overall image quality and the recognizability of droplet features. Compared to existing technologies, which cannot handle batch differences in liquids (such as the absorption, reflection, transmission, and scattering characteristics of liquids with different transparency and color), and since grayscale values ​​are essentially a quantitative representation of light brightness by image pixels, variations in image grayscale values ​​can easily lead to problems such as missed droplet segmentation or missegmentation of background impurities. This solution helps adapt to the differences in optical properties of different batches of filling liquids, stabilizes the grayscale representation of the droplet area, reduces the impact of fluctuations in liquid optical properties on image grayscale values, and thus reduces the probability of missed droplet segmentation and missegmentation of background impurities.

[0010] 3. By weighting the filling port area and background area in the filling port image, the segmentation priority of the core filling port area is strengthened, which provides a clear regional priority benchmark for subsequent grayscale threshold segmentation. Compared with existing technologies, which are prone to droplet leakage or background impurity missegmentation due to changes in image grayscale values, and are not accurate in segmenting non-standard image regions such as irregularly shaped droplets, such as stringy droplets of viscous liquids, this solution helps to stabilize the segmentation threshold adaptability under different grayscale fluctuation scenarios and improve the segmentation accuracy of droplets in the filling port area of ​​the filling port image.

[0011] 4. Determining whether to issue a leak warning based on the droplet pixel area of ​​the pre-leaking area and the dripping characteristics of dairy products helps improve the targeting and comprehensiveness of leak detection. Compared with existing technologies, since the stringy droplets formed by viscous liquids are usually long, irregular, with blurred edges and uneven gray distribution, the pixel gray values ​​of the stringy part may overlap a lot with the gray values ​​of the background area, such as the metal edge of the filling port and the inner wall of the carton, due to the change of the scattering angle. At this time, relying solely on the gray value threshold cannot effectively distinguish the stringy droplets from the background, which easily leads to the omission of stringy areas and makes it difficult to achieve accurate segmentation, directly causing the positioning deviation of the filling port area. This solution helps to correct the positioning deviation of the filling port area and improve the recognition accuracy of irregular droplets. Attached Figure Description

[0012] Figure 1 This is a flowchart of a machine vision-based anti-drip monitoring system for filling ports provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the machine vision-based anti-drip monitoring system for filling ports provided in an embodiment of the present invention; Figure 3This is a diagram of the preprocessing framework for the filling port image of the machine vision-based anti-drip monitoring system provided in this embodiment of the invention. Figure 4 This is an image global grayscale threshold segmentation framework diagram of the machine vision-based anti-drip monitoring system for filling ports provided in this embodiment of the invention; Figure 5 This is a framework diagram of a machine vision-based anti-drip monitoring method for filling ports provided in an embodiment of the present invention. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0014] In this application, the term "at least one" means one or more, and the term "multiple" means two or more; for example, multiple devices means two or more devices. "At least two" means two or more. "At least three" means three or more.

[0015] Example: like Figure 1 The flowchart of the machine vision-based anti-drip monitoring system for filling nozzles is shown. First, the filling nozzle image is preprocessed using machine vision methods, specifically including specific wavelength imaging processing and adaptive gamma correction. This helps to initially calibrate the differences in light scattering and absorption caused by different batches of liquid, improve the consistency of grayscale distribution in the filling nozzle image, and reduce grayscale value fluctuations caused by batch differences in liquid. Next, global grayscale thresholding is performed on the preprocessed filling nozzle image. Based on a preset grayscale threshold algorithm, preliminary droplet candidate regions are obtained, which helps to match the appropriate frame difference interval, thereby ensuring the necessary features for droplet motion extraction. The system ensures the temporal continuity and spatial integrity of the filling port. Next, based on the carton's operating conditions, it extracts droplet features from the filling port area, helping to initially distinguish the filling port area from the background area and reducing the computational load during droplet identification. Finally, it performs a pre-judgment of droplet leakage to obtain the corresponding judgment result, determining whether the pixel area of ​​the pre-leakage area is greater than or equal to the preset pixel area. If so, a first-level warning is sent to the preset personnel; otherwise, based on Kalman filtering, it predicts the droplet's falling trend, helping to correct the filling port positioning deviation and droplet area or shape measurement distortion, ultimately improving the overall accuracy of the anti-drip monitoring of the carton filling machine's filling port.

[0016] This invention provides a machine vision-based anti-drip monitoring system for filling nozzles, such as... Figure 2 The diagram shown illustrates the structure of a machine vision-based anti-drip monitoring system for filling nozzles. The system's processing flow may include the following steps: Filling port image preprocessing module: During the filling port anti-drip monitoring process, filling port image preprocessing is performed. First, the filling port image is acquired, and then the filling port image is preprocessed based on machine vision methods, which improves the overall recognition of the filling port image and the extractability of droplet features.

[0017] Global grayscale thresholding module: Performs global grayscale thresholding on the filling port image obtained after preprocessing by the filling port image preprocessing module, separating the filling port area from the background area in the filling port image. Global grayscale thresholding is used to further distinguish the filling port area from the background area in the filling port image, reduce the grayscale value variation of the filling port image caused by the difference in physical properties of different batches of liquid, and accurately delineate the initial droplet candidate area.

[0018] The carton station frame difference dynamic matching module: After obtaining the segmented filling port image through the global grayscale threshold segmentation module, it extracts the droplet features of the filling port based on the carton working condition. This is used to realize the accurate matching of the filling port anti-drip monitoring and the carton station movement status, which improves the accuracy of the initial screening of droplet candidate areas and the stability of trajectory tracking. This enables the effective locking of the pre-drip area of ​​droplets and the reliability of the acquisition of droplet falling motion features.

[0019] Liquid droplet detection and judgment module: When the liquid droplet detection and judgment module extracts the liquid droplet features of the filling port based on the dynamic matching module of the carton station frame difference, it performs a liquid droplet pre-judgment to determine the real-time performance of the filling port anti-drip monitoring, and obtains the corresponding judgment result. This improves the accuracy of liquid droplet judgment and the pertinence of alarms, thereby realizing the real-time performance of filling port dripping monitoring.

[0020] It should be added that, prior to the design of the machine vision-based anti-drip monitoring system for filling ports in this application, a database storing various types of setting data was established. The database includes, but is not limited to, preset segmented grayscale standard limit thresholds, preset segmented grayscale difference limit thresholds, and preset frame differences.

[0021] The database contains various types of data, including experimental calibration data. During the experiment, a filling scenario consistent with actual production was constructed, and a large number of images of filling ports under normal, leak-free conditions and varying degrees of leakage were collected. By performing block grayscale analysis and inter-frame difference calculation on these sample images, the grayscale baseline value, grayscale difference range, and frame difference fluctuation range under different filling material liquid viscosity, color, light intensity, and filling speed were statistically analyzed. This determined the initial threshold parameters, and the experimentally calibrated thresholds were corrected for compliance and practicality to ensure that the parameters met production standards. In addition, historical operation and maintenance and iteration data after the filling machine has been running are continuously added. Image feature data and manually verified calibration data corresponding to misjudgments and omissions in actual operation are periodically stored in the database to achieve dynamic iterative optimization of threshold parameters, improving the adaptability and accuracy of monitoring. The database contains multi-level fields, including a scene identification layer that covers fields such as material type, filling speed, light level, and equipment model, used to distinguish different production scenarios to achieve accurate scenario-based matching of parameters.

[0022] As for the storage method, it is necessary to balance real-time performance and iterability. Therefore, a hybrid storage architecture is adopted. First, the real-time call layer stores the core threshold parameters that are frequently read during the monitoring process in an embedded lightweight database deployed locally on the monitoring terminal, such as SQLite (Structured Query Language Lite), to achieve millisecond-level parameter retrieval, avoid the impact of network latency on real-time analysis, and meet the response requirements of machine vision.

[0023] Furthermore, the specific process of preprocessing the filling port image based on machine vision methods is as follows: Machine vision methods include: white balance calibration, multi-channel illumination compensation, and CLAHE (Contrast Limited Adaptive Histogram Equalization) adaptive contrast enhancement; preprocessing refers to processing based on specific wavelength imaging processing and / or adaptive Gamma correction; specific wavelength imaging processing includes: specific wavelength active illumination processing and high dynamic range imaging processing; specific wavelength active illumination processing is used to improve the recognition accuracy of the filling port image, and the specific process is as follows: a prompt is sent to the preset personnel to use a fixed wavelength active light source, such as near-infrared, for illumination; based on the difference in spectral reflectance characteristics between the filling port area and the background area, a pre-calibrated spectral reflectance threshold range of the filling port area at a preset wavelength is obtained, and it is marked as the calibrated spectral reflectance threshold range, which is used to enhance the contrast of the droplet area in the filling port image to suppress background interference.

[0024] Specifically, the filling port area refers to the monitoring area of ​​the filling port of the carton filling machine in the filling port image, covering the filling port body and the surrounding core target area where droplets may appear; the background area is the irrelevant area in the filling port image other than the filling port area, such as other parts of the carton surface, equipment frame, conveyor track, etc.; spectral reflectance characteristics refer to the characteristics of the reflection ability and reflection law of an object surface to incident polychromatic light, such as visible light and near-infrared light, at different wavelengths. The degree of difference between the filling port area and the background area is determined by the spectral reflectance.

[0025] The system directly measures the reflected radiance of the filling port area at different wavelengths using a spectroradiometer, and calculates the spectral reflectance by combining this with the synchronous measurement of incident irradiance using a radiometer. It then captures images of the filling port illuminated at a preset wavelength and classifies the pixels using a calibrated spectral reflectance threshold range. If the spectral reflectance falls within the calibrated threshold range, the pixels belonging to the filling port area are enhanced in grayscale. If the spectral reflectance does not fall within the calibrated threshold range, the pixels belonging to the background area are weakened in grayscale. The grayscale values ​​are monitored by an industrial vision camera.

[0026] For example, in drip prevention monitoring at filling ports, near-infrared wavelengths, such as 850nm active illumination, can be selected. This scenario is suitable for situations where there is transparent packaging (such as plastic bottles) at the filling port. Under ordinary visible light, the transparent packaging will overlap with the color of the internal liquid or contents, while under near-infrared wavelengths, the light transmittance of the packaging material is more different from that of the contents, which can clearly distinguish the packaging edge from the filling liquid surface. Alternatively, blue light wavelengths, such as 450nm active illumination, can be selected to monitor white droplets at the filling port, because the reflectivity of droplets under blue light is much different from that of droplets of other colors, which can highlight tiny droplets.

[0027] It should be added that, such as Figure 3 As shown, the preprocessing framework of the filling port image of the machine vision-based anti-drip monitoring system is as follows: First, the filling port image is acquired, and then the filling port image is preprocessed based on machine vision methods, which specifically include: specific wavelength imaging processing and adaptive Gamma correction. The specific wavelength imaging processing includes: specific wavelength active illumination processing and high dynamic range imaging processing. Finally, global grayscale thresholding is performed on the preprocessed filling port image.

[0028] In this embodiment, in the monitoring of dripping at the filling port, preprocessing the filling port image based on machine vision methods can reduce color shift and equalize illumination, improve the local contrast of the filling port image, enhance the characteristics of the droplet area based on spectral reflectance differences and weaken background interference, expand the dynamic range of the image, and optimize the grayscale levels, thereby improving the recognition of the dripping area, enhancing the sensitivity and accuracy of dripping monitoring at the filling port, and providing high-quality image support for the accurate determination of the dripping state.

[0029] Furthermore, the specific process of high dynamic range imaging processing is as follows: Based on white balance calibration, obtain the white balance calibration value; calculate the RGB three-channel gain coefficients; perform white balance correction on the filling port image to obtain a corrected filling port image, which is used to unify the color reference of the filling port image; the specific acquisition of the white balance calibration value is as follows: Let the image of the filling port be I, where each pixel is composed of the intensity values ​​of the R, G, and B channels; let the rectangular region corresponding to the reference white board in the image of the filling port be Ω, and let the region be uniform white or neutral gray; , , This represents the channel value of any pixel within region Ω in the original image. The mean channel value of the reference white board region is obtained, which is the arithmetic mean of each color channel within the reference white board region Ω, and is used as the baseline response value of the corresponding channel.

[0030] ; ; ; Where N is the total number of pixels within the reference white area Ω; μ of the G channel is selected. G As a target value, the G channel is usually the most sensitive to the human eye and has a better camera response.

[0031] Obtain the gain coefficient K of the three channels R K G and K B When the mean values ​​of the three channels used for the reference whiteboard area are all equal to the target value, then μ within the reference whiteboard area Ω... R μ G and μ B They are equal, and the specific method for obtaining them is as follows: ; ; ; The calculated gain coefficient is applied to each pixel of the filling port image I to generate the filling port correction image I'.

[0032] For a pixel at any position (x, y) in the filling port image, its corrected values ​​R'(x, y), G'(x, y), and B'(x, y) are: ; ; ; Where min(·) means taking the minimum value, and T is the maximum value of the filling port image data. If it is an 8-bit irrigation port image, T is usually 255 (pixel value range 0-255) to prevent the gain from causing the value range of the three channels to overflow.

[0033] Additionally, the formula selects the mean value μ of the G channel. G This is chosen as the calibration target value because the human eye is most sensitive to green light, and camera sensors typically have a more stable and linear response to the G channel. Using this as a benchmark not only closely matches the visual perception habits of the human eye but also reduces calibration deviations caused by abnormal single-channel responses, making the corrected color more consistent with intuitive human judgment. Secondly, it ensures that the average values ​​of the R, G, and B channels in the reference white board area are ultimately unified to μ. G This restores the whiteboard area, which should be neutral gray or white, to a standard, unbiased state, eliminating color shifts caused by factors such as ambient light color temperature. In addition, the formula incorporates the min(·) function and the maximum value T, which enables the unification of the color reference for the filling port image. Regardless of changes in lighting conditions during shooting, the reference whiteboard area can maintain a stable neutral color after calibration, ensuring that filling port images from different batches and under different lighting conditions have a consistent color standard.

[0034] For example, in situations where there is strong backlighting or reflection on the filling production line, such as direct overhead light shining from above the filling nozzle, the filling nozzle area in the image may simultaneously exhibit both overexposed reflective areas and underexposed shadow areas. To preserve the details of the metal components of the filling nozzle in the reflective areas and the texture of the seal in the shadow areas, the loss of details in a single-exposure filling nozzle image can be reduced.

[0035] Converting the RGB value of each pixel in the filling nozzle calibration image to the corresponding values ​​of the three HSV (Hue, Saturation, Value) channels (Hue, Saturation, Value) completes the conversion of the filling nozzle calibration image to the HSV color space. Specifically, this means: Obtain the RGB value of each pixel in the filling port correction image; obtain the maximum, minimum, median, and difference between the maximum and minimum values ​​of R1, G1, and B1, where max is the maximum value of R1, G1, and B1, and min is the minimum value of R1, G1, and B1.

[0036] ; ; ; Gaussian filtering and adaptive brightness compensation are applied to the brightness channel of the filling port correction image. At the same time, based on multi-channel illumination compensation, targeted gain adjustments are made in the RGB channel for different types of liquids.

[0037] Specifically, the filling port correction image is converted from the RGB color space to the HSV color space, and a Gaussian filter with a 5×5 convolution kernel is applied to its brightness channel to eliminate high-frequency noise. Adaptive brightness compensation is then performed using the gray-scale mean of neighboring pixels. The HSV image after adaptive brightness compensation is then converted back to the RGB color space, thereby enhancing the color differentiation between the liquid, the filling port, and the background.

[0038] In addition, the formula extracts extreme values ​​based on the RGB values ​​after white balance correction. At this point, the RGB values ​​have eliminated ambient light interference and can truly reflect the color attributes of the filling port itself. The H, S, and V values ​​calculated based on this are more reliable. The simplified hue calculation for the specific color range (reddish and orange-toned) where R is the maximum value not only fits the common color distribution of the filling port in this scenario (such as warm colors of packaging and liquids) but also avoids the complex calculation of the complete HSV conversion. Combined with the simplified quantization of color saturation in the scene, it reflects the purity of color within the pixel and focuses on the brightness characteristics of the pixel, thereby simplifying the information dimensions of the original RGB values ​​and accurately capturing the abnormal state of the filling port.

[0039] Based on a preset histogram equalization algorithm, such as the contrast adaptive histogram equalization algorithm CLAHE, histogram equalization is performed on the filling port correction image to enhance the local contrast between the filling port area and the background area. Specifically, this means: The actual diameter of the filling nozzle is obtained, and the obtained length, corresponding to a preset proportion of its diameter, is used as the segment side length of the filling nozzle image. The preset proportion is set in advance by a preset person and is generally 1 / 3 of the filling nozzle diameter. At the same time, it is determined whether the segment contrast of the filling nozzle image exceeds the segment contrast limit threshold. If the segment contrast exceeds the segment contrast limit threshold, the histogram stretching range of the segment of the filling nozzle image is compressed based on a preset histogram equalization algorithm. If it does not exceed the segment contrast limit threshold, the histogram stretching range of the segment of the filling nozzle image is stretched based on the preset histogram equalization algorithm to accurately enhance the local contrast between the filling nozzle area and the background area to improve the clarity of details in the filling nozzle area. If the segment contrast only meets one of the conditions of the segment contrast limit threshold, a segment contrast anomaly prompt is sent to the preset person.

[0040] It should be explained that block contrast includes: block grayscale standard result and block grayscale difference result; block contrast limit threshold includes: preset block grayscale standard limit threshold and preset block grayscale difference limit threshold, which are respectively represented by preset personnel based on the average value of the block grayscale standard result and block grayscale difference result obtained during historical monitoring; block grayscale standard result is represented by the ratio of grayscale standard deviation to grayscale mean within the block, used to reflect the relative dispersion of grayscale distribution normalization within the block area; block grayscale difference result is represented by the difference between the maximum and minimum grayscale values ​​within the block, used to reflect the dynamic degree of grayscale distribution within the block area; histogram stretching range refers to the numerical range in which pixel grayscale values ​​are remapped when histogram equalization or stretching operations are performed on the irrigation port image blocks.

[0041] In this embodiment, white balance correction is completed by calculating the gain coefficient of the RGB three channels, which can unify the color reference of the filling port image. By separating the hue, saturation and brightness information, it is easier to extract the features of the dripping area in a targeted manner, reduce the impact of color coupling on the identification of dripping water at the irrigation port, provide standardized and easily distinguishable irrigation port image data for feature analysis of dripping prevention monitoring at the filling port, and improve the identifiability of the dripping area at the irrigation port.

[0042] Example 2 While remaining unchanged in Embodiment 1, the three methods provided for preprocessing the filling port image cannot completely cover the processing of all filling port images and easily overlook uneven lighting and reflection issues. Therefore, in order to reduce local overexposure or underexposure of the filling port image caused by global correction, this embodiment mainly uses adaptive Gamma correction to brighten the inner shadow area in the filling port image and suppress reflections in the filling port image. The specific process is as follows: Adaptive Gamma correction is used to brighten the inner shadow areas in the filling port image and suppress reflections in the image. The specific process is as follows: The brightness distribution of the filling port image is corrected by adjusting the nonlinear mapping of its grayscale values. The mapping formula for Gamma correction is O=I. γ Where O represents the normalized grayscale value of the output image, and γ is the Gamma value. The preset Gamma value is directly specified by the personnel based on their experience in monitoring the filling machine's filling port or the characteristics of the scene, to reflect the direction and degree of adjustment of the brightness and contrast of the filling port image. The specific process is as follows: When γ<1, the dark areas are brightened. The Gamma correction process increases the input block grayscale value to the preset minimum block grayscale value, thereby increasing the brightness of the dark areas of the filling port image and ensuring that the dark details of the filling port image are clearer.

[0043] When γ=1, the input and output gray values ​​have a linear relationship, which satisfies the adaptive Gamma correction effect, thus maintaining the original brightness of the filling port image.

[0044] When γ>1, bright areas are darkened. The Gamma correction process reduces the input block grayscale value to the preset maximum block grayscale value, suppressing the brightness of bright areas in the filling port image to reduce highlight reflections and avoid loss of bright details. For example, when the production line switches between natural light during the day and artificial light at night, the overall brightness of the filling port image fluctuates. Adaptive Gamma correction will automatically adjust γ according to the brightness distribution of the current filling port image. When the filling port image is dark, such as under artificial light at night, γ is increased to enhance the brightness of dark areas. When the filling port image is bright, such as under strong light during the day, γ is decreased to suppress overexposure of bright areas, ensuring uniform brightness of the filling port image under different lighting conditions, which facilitates stable operation of monitoring.

[0045] In this embodiment, adaptive Gamma correction is used to optimize the overall grayscale level of the irrigation port image, supplement the low grayscale areas in the irrigation port image, such as the details of the dripping droplet edges, and suppress the overexposure problem of high grayscale areas, such as the strong light reflection area. This effectively improves the grayscale distinction between the dripping area and the filling port body and background area, and reduces the loss of filling port droplet features in the irrigation port image caused by grayscale imbalance.

[0046] Furthermore, the specific process of global grayscale thresholding is as follows: Based on a preset grayscale thresholding algorithm, such as the Otsu algorithm, global grayscale thresholding is performed on the preprocessed filling port image to obtain preliminary droplet candidate regions. The specific process is as follows: Count the number of pixels n at grayscale level i. i By combining the weight factor ω(x, y) of the corresponding pixel, the weighted gray frequency p, which reflects the proportion of each gray level i pixel in the image, is obtained. i .

[0047]

[0048] in, x and y represent the pixel coordinates in the irrigation port image.

[0049] The probabilities ω1(A) and ω2(A) of obtaining the weighted filling port area and background area are calculated.

[0050] ; ; Obtain the weighted mean gray values ​​μ1(A) and μ2(A) of the filling port area and the background area.

[0051] ; ; Obtain the weighted global grayscale mean μ of the filling port image.

[0052] ; Obtain the weighted inter-class variance of the filling port image .

[0053] Where A is the grayscale threshold, and T is the threshold that maximizes the weighted inter-class variance of the filling port image. opt The threshold represents the optimal global segmentation threshold for the filling port area. The grayscale values ​​of the filling port image pixels in each block of the filling port image are obtained. If the grayscale value of the filling port image pixels is greater than or equal to the threshold with the largest inter-class variance, it indicates that the brightness difference of the region has reached the threshold for distinguishing the droplet from the filling port body and the background region, and the filling port region is marked as a preliminary droplet candidate region. If the pixel grayscale value is less than the threshold with the largest inter-class variance, it indicates that the brightness difference of the region does not meet the distinction threshold, and the filling port region is marked as a background region.

[0054] Furthermore, this formula aligns with the core requirement of area differentiation in anti-drip monitoring of filling ports, calculating the weighted grayscale frequency p through pixel weighting factors. i This allows the grayscale frequency to more accurately reflect the grayscale distribution characteristics of the filling port area, avoiding interference from background pixels on the statistical results. The design of the region probability is based on dividing the filling port and background areas according to the grayscale threshold T, while combining the weighted p i This allows the regional probability to better reflect the proportion of the filling port and the background in the actual filling image, ensuring that the mean is the true grayscale statistical result of the pixels in the filling port or background area, rather than the deviation value of the global mean, thereby improving the stability of the grayscale features of the filling port area.

[0055] It should be explained that global grayscale threshold segmentation refers to introducing a regional weight factor to assign the maximum weight to the filling port region, thereby reducing the interference of background impurities in the filling port region. The maximum weight is corrected by iterative training of multiple historical samples to adjust the initial weights of the filling port region and the background region. Finally, the weight value of the preliminary droplet candidate region is calibrated as the maximum value of the global weight interval. This maximum weight is generally 3-5 times the weight of the filling port region and 8-10 times the weight of the background region.

[0056] It should be added that, such as Figure 4As shown, the image global grayscale threshold segmentation framework diagram of the machine vision-based anti-drip monitoring system for filling ports is as follows: First, global grayscale threshold segmentation is performed on the preprocessed filling port image. Based on the preset grayscale threshold algorithm, preliminary droplet candidate regions are obtained. Feature points are extracted from the preliminary droplet candidate regions of adjacent frames to obtain the droplet features of the filling port. Then, droplet leakage pre-judgment is performed to obtain the pixel area of ​​the droplet candidate region. It is determined whether the pixel area of ​​the pre-drip region is greater than or equal to the preset pre-drip region pixel area. If so, a first-level warning is sent to the preset personnel. Otherwise, the dripping trend of the droplets is predicted based on Kalman filtering. Specifically, the number of times the predicted pre-drip region appears in the filling port image is counted. It is determined whether the number of times the pre-drip region appears meets the preset leakage judgment condition. If so, a first-level warning is sent to the preset personnel, an alarm is triggered, and the leakage time and workstation information are recorded. At the same time, a visual monitoring report is output. Otherwise, no alarm is triggered, and it is marked as low-risk interference.

[0057] In this embodiment, by using global grayscale threshold segmentation, background impurity interference can be effectively suppressed and the segmentation priority of the filling port area can be strengthened, thereby achieving accurate global grayscale segmentation of the preprocessed irrigation port image, which can quickly screen out potential drip leakage targets, thereby improving the target positioning efficiency and preliminary screening accuracy of drip prevention monitoring.

[0058] Furthermore, the specific process for extracting droplet characteristics from the filling port based on the carton's operating conditions is as follows: The carton operating conditions include: a uniform speed conveying stage to ensure the accuracy of the filling port image during the filling operation; a start-stop acceleration or deceleration stage to ensure that the carton can accurately stop at the designated position and avoid the filling port image deviation caused by inertia; and a stationary stage to ensure the stability of the filling port image during the filling operation. The specific division process is as follows: the operating conditions are divided based on the preset speed fluctuation range and acceleration threshold; when the instantaneous speed of the carton station is within the preset speed fluctuation range and the absolute value of acceleration is lower than the acceleration threshold within multiple consecutive frames, the current carton operating condition is marked as the uniform speed conveying stage.

[0059] When the instantaneous speed of the carton station monitored by the photoelectric speed sensor is not within the preset speed fluctuation range, and the absolute value of the acceleration monitored by the acceleration sensor is higher than the acceleration threshold, the current carton working condition is marked as a start-stop acceleration or deceleration phase. The preset speed fluctuation range is represented by the parameters of the filling machine itself, and the acceleration threshold is represented by the preset personnel based on the average value of the historical acceleration of the filling machine.

[0060] Specifically, when the instantaneous speed of the cardboard station is greater than the maximum value within the preset speed fluctuation range, the current cardboard operating condition is marked as the start-stop acceleration phase; when the instantaneous speed of the cardboard station is less than the minimum value within the preset speed fluctuation range, the current cardboard operating condition is marked as the deceleration phase.

[0061] When the instantaneous velocity and acceleration of the cardboard box station are both 0, the current cardboard box working condition is marked as a stationary stage.

[0062] The system monitors the station speed in real time and dynamically adjusts the frame difference interval based on preset feedback algorithms, such as the PID feedback algorithm, for three working conditions.

[0063] Specifically, the maximum frame difference, typically 5 frames, is used during the uniform speed conveying stage to ensure the real-time monitoring of droplets at the filling port of the carton filling machine. The minimum frame difference, typically 1-2 frames, is used during the start-stop acceleration or deceleration stages to ensure the continuity of the droplet trajectory. The preset frame difference is used during the stationary stage to reduce the complexity of droplet trajectory monitoring.

[0064] The preset frame difference represents the frame difference set in advance by the operator when the cardboard station is stationary during a historical time period. Feature points are extracted from the preliminary droplet candidate regions of adjacent frames, and the motion vector of the feature points is calculated using optical flow to obtain the droplet features at the filling port. In this process, a preset prediction algorithm is introduced, such as the Kalman filter algorithm, which predicts the position of the droplet in the next frame based on the trajectory data of the preceding frame of the preliminary droplet candidate region, corrects the abnormal droplet trajectory tracked by the optical flow method, and obtains the pre-drip area of ​​the droplet. Abnormal droplet trajectory refers to the trajectory that deviates from the normal movement law of the droplet, does not conform to the machine vision tracking logic, or is caused by external interference. Specifically, it includes droplet trajectory breakpoints and pixel displacements of droplet feature points in two adjacent frames that are much greater than the preset pixel displacement. The preset pixel displacement represents the average pixel displacement of droplet feature points in two adjacent frames acquired in history.

[0065] In this embodiment, the adaptability of droplet monitoring to operating conditions, the accuracy of trajectory tracking, and the effectiveness of pre-drip area identification in dairy product filling scenarios are synergistically improved. This ensures that the acquired droplet motion characteristics are highly consistent with the actual trajectory. The efficient acquisition of droplet features is achieved through frame difference adjustment for operating condition adaptation, and the accuracy of droplet trajectory data is ensured through a prediction correction mechanism. This allows for precise locking of the pre-drip area of ​​the droplet, thereby improving the overall technical reliability of the anti-drip monitoring technology at the irrigation port of the carton irrigation machine.

[0066] Furthermore, the specific process for pre-judgment of droplet leakage is as follows: A high-speed industrial camera is used to acquire the total number of pixels occupied by candidate droplet regions in the irrigation port image, which is represented as the pixel area of ​​the pre-leaking droplet region. To achieve quantitative screening and graded early warning of droplet leakage risk, it is determined whether the pixel area of ​​the pre-leaking droplet region is greater than or equal to the pixel area of ​​the pre-leaking droplet region pre-set by preset personnel. This allows for preliminary differentiation of droplet regions with leakage risk from the pipe opening image, ensuring that potential leaking droplet regions are not overlooked. If it is greater than or equal to, a first-level early warning is sent to preset personnel; otherwise, the droplet dripping trend is predicted based on Kalman filtering. The dripping trend indicates the direction of the droplet's trajectory and conforms to the acceleration law of free dripping. If the droplet trajectory conforms to the dripping trend, a morphological abnormality warning is sent to preset personnel; if the droplet trajectory does not conform to the dripping trend, a warning about residual dripping at the filling port is sent to preset personnel.

[0067] In this embodiment, the droplet leakage pre-judgment process first triggers a first-level warning by judging the pixel area threshold of the droplet pre-leakage area. Then, for areas that do not reach the threshold, the droplet falling trend is predicted by Kalman filtering. Based on whether the trajectory conforms to the free drip acceleration law, abnormal shape or leakage abnormality of the filling port is pushed to realize the hierarchical prediction and differentiated alarm of leakage risk, which is used to improve the accuracy of early risk identification and the targeted handling of anti-drip monitoring.

[0068] Furthermore, the specific process of predicting the droplet dripping trend based on Kalman filtering is as follows: During the time period corresponding to the droplet features extracted from the filling port based on the carton working condition, the number of times the predicted pre-drip area of ​​the droplet appears in the real-time frame of the filling port image is counted to achieve accurate determination of droplet leakage; if the preset leakage determination conditions are met, a first-level warning is sent to the preset personnel, and an alarm is triggered and the leakage time and workstation information are recorded, while a visual monitoring report is output, including droplet segmentation diagram, trajectory diagram, etc.; if the preset leakage determination conditions are not met, no alarm is triggered and it is marked as low-risk interference; the preset leakage determination conditions indicate that the pre-drip area of ​​the droplet predicted based on Kalman filtering in the filling port image exists continuously within the pre-judgment time period of droplet leakage.

[0069] In this embodiment, the process of predicting the droplet falling trend based on Kalman filtering first triggers a first-level warning by judging the pixel area threshold of the pre-droplet leakage area. Then, for areas that do not reach the threshold, the droplet falling trend is predicted by Kalman filtering. Based on whether the trajectory conforms to the law of free dripping acceleration, abnormal shape or leakage abnormality of the filling port is pushed to realize the hierarchical prediction and differentiated alarm of leakage risk.

[0070] Example 3 While remaining unchanged in Embodiment 1 or 2, in specific scenarios, such as dairy products, droplets may exhibit a certain degree of viscosity, especially those with high fat content, such as cream and whole milk. Due to this viscosity, the droplets adhere to the metal or plastic contact surface of the filling port and do not quickly detach. Instead, they first adhere and accumulate on the contact surface before gradually forming a dripping droplet. The morphology and pixel area change patterns of this pre-drip stage differ significantly from those of low-viscosity liquids. Therefore, to achieve accurate adaptation and early identification of high-viscosity droplet leakage risks, this embodiment determines whether to issue a drip warning based on the droplet pixel area of ​​the pre-drip region and the dripping characteristics of the dairy product. Thus, the pre-drip judgment also includes determining whether to issue a drip warning based on the droplet pixel area of ​​the pre-drip region and the dripping characteristics of the dairy product. The specific process is as follows: The system sends a prompt to designated personnel to extract the area and roundness of the pre-drip region of the droplet, as well as other dripping characteristics of the filling port. For example, low-viscosity droplets typically have a roundness close to 1, so a threshold C greater than or equal to 0.8 can be set. High-viscosity droplets, such as ellipsoidal or spindle-shaped droplets, have a lower roundness, so a threshold of 0.5 less than or equal to C less than or equal to 0.8 can be set. If the droplet exhibits a filamentous appearance, its roundness will be far below 0.5, and it will be directly excluded. If the droplet pixel area exceeds the set area threshold and the droplet shape matches the dripping characteristics, the pre-drip region is marked as a leaking area, and a level one warning is sent to designated personnel. If the droplet pixel area does not exceed the set area threshold, but the droplet shape matches the dripping characteristics, the pre-drip region is marked as an area about to drip, and a leak warning is not triggered temporarily. The system continues to monitor the droplet's movement within the designated filling port's real-time frames (typically 3-5 frames).

[0071] If the area of ​​the pre-drip region of the droplet in the real-time frame of the filling port continues to increase, the pre-drip region is marked as a suspected dripping area and a first-level warning is sent to the preset personnel. Conversely, a second-level warning is sent to the preset personnel. If the pixel area of ​​the droplet exceeds the set area threshold, but the droplet shape does not meet the dripping characteristics, an anomaly review is triggered to accurately distinguish between large-area background interference and special drips with irregular shapes to reduce the false judgment rate.

[0072] Specifically, the anomaly review refers to: based on machine vision methods, backtracking and comparing the grayscale features of the pre-drip area of ​​the droplet with the grayscale features of the historically acquired background area. If the grayscale features match those of the metal reflection at the filling port or the stains on the inner wall of the cardboard box, a background interference alert is sent to a designated person. If they do not match, a leak alert is sent to a designated person. If the droplet pixel area does not exceed a set area threshold and the droplet shape does not conform to the dripping characteristics, a direct alert is sent to a designated person to mark the pre-drip area of ​​the droplet as a non-leakage interference area and record the location and features of the area. If a non-leakage interference area continuously appears in the real-time frame of the filling port at the same location, a background interference warning is triggered, and a alert is sent to a designated person to clean the impurities at the filling port.

[0073] In this embodiment, the drip leakage pre-judgment process can achieve accurate stratification and identification of drip leakage risks, effective filtering of interference, and differentiated alarms, avoiding missed judgments or over-warnings caused by a single judgment standard. This allows for accurate differentiation between background interference such as metal reflections at the filling port and stains on the inner wall of the carton and special drips with irregular shapes, promoting timely cleaning of impurities at the filling port and significantly improving the accuracy and comprehensiveness of drip prevention monitoring in dairy product filling.

[0074] like Figure 5 The diagram shown is a framework diagram of a machine vision-based anti-drip monitoring method for filling nozzles provided in an embodiment of the present invention. This method includes: filling nozzle image preprocessing, global grayscale threshold segmentation, dynamic frame difference matching at the carton workstation, and drip leakage detection and determination. Specifically, during the anti-drip monitoring process, an image of the filling nozzle is first acquired, and then preprocessed using machine vision methods to reduce the variation in grayscale values ​​of the filling nozzle image caused by differences in the physical properties of different batches of liquid; the global grayscale threshold segmentation module further segments the image obtained by the filling nozzle image preprocessing module. The processed filling port image undergoes global grayscale thresholding to separate the filling port area from the background area. After obtaining the segmented filling port image through the global grayscale thresholding module, the droplet features of the filling port are extracted based on the carton working condition to achieve accurate matching of filling port anti-drip monitoring and carton station movement status. When the droplet monitoring and judgment module extracts the droplet features of the filling port based on the carton station frame difference dynamic matching module, it performs droplet pre-judgment to determine the real-time performance of filling port anti-drip monitoring and obtains the corresponding judgment result.

[0075] In summary, this embodiment of the application, by acquiring and preprocessing the filling port image, reduces image color shift, enhances the features of the filling port area, and weakens background interference, thereby improving the overall recognizability of the filling port image and the extractability of droplet features. This achieves the acquisition of high-quality, high-contrast standardized images. Global grayscale threshold segmentation is performed on the preprocessed filling port image, and filling port images at different time intervals are selected based on different working conditions of the cardboard box. This helps to accurately delineate the initial droplet candidate area, ensuring the continuity of droplet trajectory and monitoring efficiency under different working conditions. It also improves the accuracy of the initial selection of droplet candidate areas and the stability of trajectory tracking, thus achieving effective locking of the pre-leaking area and reliable acquisition of droplet falling motion features. The determination of droplet leakage monitoring based on the selected filling port image helps to classify droplet leakage risks, improving the accuracy of droplet leakage determination and the targeting of alarms, thereby achieving real-time monitoring of filling port leakage.

[0076] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0077] The above description is only an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A machine vision-based anti-drip monitoring system for filling nozzles, characterized in that, The system includes: The filling port image preprocessing module is used to first acquire the filling port image and then preprocess the filling port image based on machine vision methods. The global grayscale threshold segmentation module performs global grayscale threshold segmentation on the filling port image obtained after preprocessing by the filling port image preprocessing module, separating the filling port area from the background area in the filling port image. After obtaining the segmented filling port image through the global grayscale threshold segmentation module, the carton station frame difference dynamic matching module extracts the filling port droplet features based on the working conditions. The dripping detection and judgment module is used to obtain the corresponding judgment result when performing a dripping pre-judgment to determine the real-time performance of dripping detection at the filling port after the dripping characteristics are extracted by the frame difference dynamic matching module at the carton station.

2. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 1, characterized in that, The specific process of preprocessing the filling port image based on the machine vision method is as follows: The machine vision method includes: white balance calibration, multi-channel illumination compensation, and CLAHE adaptive contrast enhancement. The preprocessing refers to processing based on specific wavelength imaging processing and / or adaptive Gamma correction; The specific wavelength imaging processing includes: specific wavelength active illumination processing and high dynamic range imaging processing; The specific process of active illumination processing at the specific wavelength is as follows: Sending prompts to preset personnel using an active light source with a fixed wavelength; Based on the degree of difference in spectral reflectance characteristics between the filling port area and the background area, the pre-calibrated threshold range of spectral reflectance of the filling port area at a preset wavelength is obtained and marked as the calibrated threshold range of spectral reflectance. Capture images of the filling port after illumination with a preset wavelength, and classify the pixels of the filling port image using a calibrated spectral reflectance threshold range; If the spectral reflectance is within the calibrated spectral reflectance threshold range, then the grayscale value of the pixels belonging to the filling port area is enhanced. If the spectral reflectance is not within the calibrated spectral reflectance threshold range, then the grayscale value of the pixels belonging to the background area will be weakened.

3. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 2, characterized in that, The specific process of the high dynamic range imaging processing is as follows: The white balance calibration value is obtained based on the white balance calibration, the gain coefficient of the RGB three channels is calculated, and the white balance correction is performed on the filling port image to obtain the filling port correction image. Based on a preset histogram equalization algorithm, histogram equalization is performed on the filling port correction image, specifically referring to: Obtain the actual diameter of the filling port, and use the obtained length as the block side length of the filling port image, corresponding to a preset ratio of its diameter length. If the contrast of each block exceeds the block contrast limit threshold, the histogram stretching range of the blocks of the filling port image is compressed based on the preset histogram equalization algorithm. If none of them exceed the block contrast limit threshold, then the histogram stretching range of the blocks of the filling port image is stretched based on the preset histogram equalization algorithm. If the block contrast only meets one of the conditions of the block contrast limit threshold, a block contrast abnormality prompt will be sent to the preset personnel. The block contrast includes: block grayscale standard result and block grayscale difference result; The histogram stretching range refers to the range of pixel grayscale values ​​that are remapped when histogram equalization or stretching is performed on the irrigation port image blocks.

4. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 2, characterized in that, The specific process of the adaptive Gamma correction is as follows: The brightness distribution of the filling port image is corrected by adjusting the nonlinear mapping of the grayscale values ​​of the filling port image.

5. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 1, characterized in that, The specific process of global grayscale threshold segmentation is as follows: Preliminary droplet candidate regions are obtained based on a preset grayscale threshold algorithm; Obtain the grayscale values ​​of the pixels in each block of the filling port image; If the pixel grayscale value of the filling port image is greater than or equal to the threshold of the largest inter-class variance, it indicates that the brightness difference in this area has reached the threshold for distinguishing the droplet from the filling port body and the background area, and the filling port area is marked as a preliminary droplet candidate area. If the pixel grayscale value is less than the threshold for the largest inter-class variance, it indicates that the brightness difference in the region does not meet the distinction threshold, and the filling port area is marked as the background region.

6. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 1, characterized in that, The specific process for extracting droplet features at the filling port based on operating conditions is as follows: The operating conditions include: a constant speed conveying stage, a start-stop acceleration or deceleration stage, and a stationary stage, which are specifically divided as follows: Operating conditions are divided based on pre-defined speed fluctuation ranges and acceleration thresholds; When the instantaneous speed of the workstation is within the speed fluctuation range within multiple consecutive frames, and the absolute value of the acceleration is lower than the acceleration threshold, the current working condition is marked as the uniform speed conveying stage. When the instantaneous speed of the workstation is not within the preset speed fluctuation range and the absolute value of the acceleration is higher than the acceleration threshold, the current working condition is marked as the start-stop acceleration or deceleration phase. When the instantaneous speed of the workstation exceeds the maximum value within the preset speed fluctuation range, the current working condition is marked as the start-stop acceleration phase. When the instantaneous speed of the workstation is less than the minimum value within the preset speed fluctuation range, the current working condition is marked as the deceleration stage; When the instantaneous velocity and acceleration of the workstation are both 0, the current working condition is marked as a stationary stage; Real-time monitoring of workstation speed; based on a preset feedback algorithm, dynamic adjustment of frame difference interval for three working conditions. Feature points are extracted from the preliminary droplet candidate regions of adjacent frames, and the motion vectors of the feature points are calculated using the optical flow method to obtain the droplet features at the filling port. In this process, a preset prediction algorithm is introduced to predict the position of the droplet in the next frame based on the trajectory data of the previous frame of the preliminary droplet candidate region, correct the abnormal droplet trajectory tracked by the optical flow method, and obtain the droplet pre-leaking area.

7. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 1, characterized in that, The specific process for the pre-determination of drip leakage is as follows: Obtain the pixel area of ​​the droplet candidate region; Determine whether the pixel area of ​​the pre-drip region is greater than or equal to the preset pixel area of ​​the pre-drip region; If the value is greater than or equal to the value, a Level 1 warning is sent to the designated personnel; otherwise, the droplet's falling trend is predicted based on Kalman filtering.

8. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 7, characterized in that, The specific process of predicting the droplet falling trend based on Kalman filtering is as follows: Count the number of times the predicted pre-drip area of ​​droplets appears in the filling port image; If the preset leakage detection conditions are met, a level 1 warning will be sent to the preset personnel, and an alarm will be triggered to record the leakage time and workstation information, while a visual monitoring report will be output. If the preset leakage detection conditions are not met, no alarm will be triggered, and the system will be marked as a low-risk interference. The preset dripping determination condition means that the pre-dripping area is predicted in the filling port image based on Kalman filtering and continues to exist within the pre-dripping determination time period.

9. The machine vision-based anti-drip monitoring system for filling nozzles as described in claim 1, characterized in that, The droplet leakage pre-determination also includes determining whether to issue a leakage warning based on the droplet pixel area of ​​the droplet pre-leaking region and the dripping characteristics of dairy products. The specific process is as follows: Send a prompt to the designated personnel to extract the dripping characteristics from the filling nozzle; If the area of ​​a droplet pixel exceeds a set area threshold and the droplet shape matches the characteristics of a droplet falling, the droplet in the pre-drop area is marked as a leaking area, and a first-level warning is sent to the preset personnel. If the droplet pixel area does not exceed the set area threshold, but the droplet shape meets the dripping characteristics, then the droplet in the pre-drip area is marked as the area about to drip, and the dripping warning is not triggered for the time being. The movement status of the droplet in the preset filling port in real time is continuously monitored. If the area of ​​the pre-drip zone of the droplet in the real-time frame of the filling port continues to increase, the pre-drip zone of the droplet is marked as a suspected dripping area and a first-level warning is sent to the preset personnel; otherwise, a second-level warning is sent to the preset personnel. If the area of ​​a droplet pixel exceeds the set area threshold, but the shape of the droplet does not meet the characteristics of a droplet falling, an anomaly review is triggered to accurately distinguish between large-area background interference and special droplets with irregular shapes in order to reduce the false judgment rate. The aforementioned anomaly review specifically refers to: Based on machine vision methods, the grayscale features of the pre-drip area of ​​the droplet are compared with those of the historically acquired background area. If they match, a background interference warning is sent to a designated person. If the match is not found, a notification of dripping water from the filling port will be sent to the designated personnel. If the droplet pixel area does not exceed the set area threshold and the droplet shape does not meet the dripping characteristics, a prompt is sent directly to the preset personnel to mark the pre-drip area of ​​the droplet as a non-drip interference area and record the location and characteristics of the area. If the non-drip interference area continues to appear in the real-time frame of the filling port at the same location, a background interference warning is triggered and a prompt is sent to the preset personnel to clean the impurities at the filling port.

10. A machine vision-based method for preventing dripping at filling nozzles, wherein the machine vision-based method for preventing dripping at filling nozzles applies the machine vision-based method for preventing dripping at filling nozzles as described in any one of claims 1-9, characterized in that, The method includes: First, images of the filling nozzle are acquired, and then preprocessed using machine vision methods. Global grayscale thresholding is performed on the filling port image obtained after preprocessing by the filling port image preprocessing module to separate the filling port area from the background area in the filling port image. After obtaining the segmented filling port image through the global grayscale threshold segmentation module, the carton station frame difference dynamic matching module extracts the filling port droplet features based on the working conditions. After extracting the droplet features from the filling port by the frame difference dynamic matching module at the carton station, the corresponding judgment result is obtained when performing the droplet leakage pre-judgment to determine the real-time performance of the filling port anti-drip monitoring.

Citation Information

Patent Citations

  • Segmentation and extraction method combining dynamic block partitioning threshold value with block searching for insulator

    CN106157323A

  • Automatic identification method for landing moment of standing long jump based on optical flow analysis

    CN118735966A

  • Microscopic visual threshold segmentation algorithm based on OTSU improvement for micro-nano object image

    CN119991697A

  • UHPC decorative plate pressing quality detection method based on vision

    CN120385683A

  • Liquid pharmaceutical filling detection system based on image recognition detection

    CN120876964A