A method for identifying plastic particles of a row of ampoules
By using deep learning models and multi-dimensional feature analysis, the problem of low accuracy in identifying plastic particles in row ampoules has been solved, achieving efficient and accurate identification of plastic particles, adapting to high-speed production environments, reducing production costs and improving detection accuracy.
Patent Information
- Application Number
- CN202511408274.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-09-29
AI Technical Summary
In existing technologies, the accuracy of identifying plastic particles in ampoules is low. Traditional methods are greatly affected by subjective factors, making it difficult to distinguish between plastic particles and air bubbles. Furthermore, the detection accuracy is insufficient under the influence of liquid films.
Using a deep learning-based convolutional neural network model combined with multi-dimensional feature analysis, plastic particles and air bubbles inside ampoules are identified through image acquisition, anomaly feature recognition, edge detection, transparency analysis, and liquid film interference correction.
It improves the accuracy and robustness of plastic particle identification, adapts to interference in different production scenarios, reduces production costs and improves production efficiency, and ensures product quality control.
Smart Images

Figure CN120876501B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of ampoule plastic particle identification, in particular to an identification method for plastic particles in a row of ampoules. BACKGROUND
[0002] Blow molding, liquid filling and sealing of the ampoules in a row are completed in one station of the processing line in three actions in sequence. In the industrial production of the ampoules in a row (for example, production of secondary throwing cosmetics, eye drops and oral liquid), the product quality is closely related to the process control of the production links. The blow molding forming link is prone to produce plastic particles with a diameter of about 1-3 mm and residual in the inner wall of the ampoule due to the processes of raw material melting and mold contact. After the liquid is filled, the liquid forms bubbles or water droplets and adheres to the inner wall.
[0003] In quality control, the ampoules with plastic particles and residual in the inner wall are unqualified products and must be effectively identified and rejected. In the prior art, the detection of abnormal features in the inner wall of the ampoule mainly depends on manual visual inspection or traditional image recognition methods. Manual detection is not only low in efficiency but also greatly affected by subjective factors, and it is difficult to stably distinguish plastic particles from bubbles. The traditional image recognition method realizes automation, but has significant limitations. On the one hand, the plastic particles (blow molding residual) and the bubbles (filling generated) have certain similarity in gray scale and shape, especially in the liquid film covering area, the visual difference between the two is further reduced. On the other hand, the liquid film in the inner wall of the ampoule causes abnormal refraction of light, which distorts the key features such as the edge profile and transparency of the abnormal features, causing the traditional algorithm to often misjudge the bubbles as plastic particles or miss the real plastic particles, which seriously affects the detection accuracy. In view of this, an identification method for plastic particles in a row of ampoules is proposed. SUMMARY
[0004] The purpose of the present application is to provide an identification method for plastic particles in a row of ampoules to solve the technical problem of low recognition accuracy of plastic particles in existing ampoules.
[0005] To solve the above technical problems, the present application provides the following technical scheme: an identification method for plastic particles in a row of ampoules, comprising the following steps:
[0006] S1, image acquisition, during the filling process after blow molding and forming of the plastic ampoules in a row, the image acquisition device integrated in the filling head is used to acquire images inside the ampoules multiple times;
[0007] S2, abnormal feature identification, an image recognition algorithm is used to process the acquired images to identify abnormal features on the inner wall of the ampoule;
[0008] S2a, boundary division, for the identified abnormal features, through analyzing the gray level co-occurrence matrix and texture features of the surrounding area, distinguishing the edge of the abnormal feature itself and the edge of the liquid film, and retaining the independent contour data of the abnormal feature;
[0009] S3, edge feature-based judgment, performing edge detection and analysis on the abnormal features, and preliminarily judging whether the abnormal features are plastic particles or bubbles according to the smoothness of the edges;
[0010] S4, transparency feature-based judgment, performing transparency analysis on the abnormal features, and preliminarily judging whether the abnormal features are plastic particles or bubbles according to the transparency;
[0011] S5, multi-image comparison-based judgment, comparing the size and position changes of the abnormal features in multiple images, and preliminarily judging whether the abnormal features are plastic particles or bubbles according to the changes;
[0012] S6, liquid film interference correction, detecting and analyzing the state of the liquid film in the area where the abnormal features are located, and correcting the preliminary judgment results of S3, S4 and S5 according to the influence degree of the liquid film;
[0013] S7, comprehensive judgment, comprehensively determining whether the abnormal features are plastic particles or bubbles based on the preliminary judgment results after S6 correction.
[0014] Preferably, in S1:
[0015] The lens of the image acquisition device faces the inside of the ampoule bottle and the shooting range covers the key area of the inner wall of the ampoule bottle, and the key area includes the corner of the inner wall of the ampoule bottle, the peripheral area in contact with the filling head and the middle area of the bottle body, wherein the corner covers the arc part connecting the bottle body and the bottle bottom, and the peripheral area in contact with the filling head is a ring-shaped area centered on the insertion point of the filling head;
[0016] Multiple image acquisition is performed at a set time interval;
[0017] The multiple images of the inside of the ampoule bottle at different times clearly present the texture of the inner wall of the ampoule bottle and the possible abnormal features, without obvious blur or distortion.
[0018] Preferably, in S2:
[0019] The image recognition algorithm is a deep learning-based algorithm, specifically including a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer;
[0020] The preprocessing in the processing process includes denoising the image to eliminate random noise generated in the shooting process, the denoising mode adopts filtering processing based on pixel neighborhood information, enhancement to enhance the contrast between abnormal features and background in the image, the enhancement mode includes adjusting the brightness and contrast of the image, edge extraction to highlight the outline of the object in the image, and the extraction mode adopts an edge detection method based on gradient change;
[0021] The abnormal feature is identified by the trained abnormal feature recognition model, the abnormal feature recognition model is trained by an image data set containing a large number of plastic particles and bubble samples, and the sample is subjected to data enhancement processing during the training process, including image rotation, flipping and cropping operation;
[0022] The abnormal feature is a region suspected of being a plastic particle or a bubble, which appears as a region with obvious visual difference in color, gray scale or texture from the surrounding normal region in the image.
[0023] Preferably, in S2a,
[0024] When analyzing the gray level co-occurrence matrix, the feature parameters of the gray level correlation, contrast, energy and uniformity of the abnormal feature and the surrounding area in different directions and distances are calculated;
[0025] The roughness and directionality indicators in the texture feature are combined to distinguish the edge of the abnormal feature itself from the edge of the liquid film.
[0026] Preferably, in S3,
[0027] The edge detection of the abnormal feature includes obtaining the edge contour data of the abnormal feature by an edge detection operator, the edge detection operator is an operator capable of identifying the gray scale mutation region in the image, and the edge contour data contains the coordinate information of each pixel point on the contour, forming a complete closed contour;
[0028] The analysis process is to calculate the smoothness parameter of the edge contour, the smoothness parameter is obtained by measuring the continuous change degree of the adjacent pixel point connecting line on the edge contour, specifically by calculating the change amplitude of the included angle between adjacent pixel point connecting lines;
[0029] When the smoothness parameter reaches the set standard, that is, the edge contour presents a continuous and no obvious abrupt turning state, the change amplitude of the included angle of each adjacent connecting line is small and uniform, it is preliminarily judged as a bubble;
[0030] Otherwise, that is, the edge contour has obvious jagged or abrupt turning, the change amplitude of the included angle of the adjacent connecting line is large and irregular, it is preliminarily judged as a plastic particle.
[0031] Preferably, in S4,
[0032] The transparency analysis obtains a transparency parameter by calculating the ratio of the light transmittance of the abnormal feature region to the light transmittance of the normal liquid region in the ampoule;
[0033] The light transmittance is determined by analyzing the light penetration degree of the corresponding region in the image, specifically, the intensity of the light after penetration is reflected by the gray value of the region in the image;
[0034] When the transparency parameter reaches the set standard, that is, the light transmittance of the abnormal feature region approaches or reaches the light transmittance of the normal liquid region, the difference between the gray values of the two is very small, and there is almost no obstruction when the light penetrates, it is preliminarily judged as a bubble;
[0035] Otherwise, that is, the light transmittance of the abnormal feature region is significantly lower than the light transmittance of the normal liquid region, the difference between the gray values of the two is significant, and there is obvious obstruction when the light penetrates, it is preliminarily judged as a plastic particle.
[0036] Preferably, in S5:
[0037] Comparing the size and position changes of the abnormal features in multiple images includes tracking the same abnormal feature by a feature matching algorithm, the feature matching algorithm adopts a matching method based on local invariant features, combined with the motion vector prediction of the liquid film flow, to eliminate false matching points generated by the liquid film interference, and to realize cross-image corresponding matching by identifying the unique visual features of the abnormal features;
[0038] Record the size data and position coordinates thereof in each image, the size data is embodied by the number of pixel points contained in the abnormal feature region, the more the number of pixel points, the larger the abnormal feature, and the position coordinates are embodied by the coordinates of the geometric center of the abnormal feature region in the image, the geometric center is the center position enclosed by the region boundary;
[0039] Calculate the size change rate and position offset of the abnormal feature in the adjacent images;
[0040] When the size change rate and the position offset reach the set standard, that is, the size of the abnormal feature presents obvious inflation or shrinkage with time, the number of pixel points increases or decreases significantly, and the position presents obvious movement with time, the coordinates of the geometric center change significantly, it is preliminarily judged as a bubble;
[0041] Otherwise, that is, the size and position of the abnormal feature basically remain stable, the number of pixel points and the coordinates of the geometric center change little or not at all, it is preliminarily judged as a plastic particle.
[0042] Preferably, in S6:
[0043] The detection and analysis of the liquid film state of the region where the abnormal feature is located includes identifying the distribution range by analyzing the gray gradient change of the liquid film region in the image, judging the thickness by the light reflection intensity difference of the liquid film region, and analyzing the flow state by the pixel displacement trajectory of the liquid film region in the continuous image;
[0044] An interference model is established according to the optical characteristics of the liquid film, which reflects the influence law of the liquid film on the refraction and transparency of light;
[0045] According to the position of the abnormal feature in the liquid film and the state of the liquid film, the correction value of the edge smoothness parameter in S3, the correction value of the light transmittance ratio in S4 and the correction value of the size change rate and position offset in S5 are calculated according to the interference model, and then the preliminary judgment results of S3, S4 and S5 are adjusted.
[0046] Preferably, in S7:
[0047] The comprehensive judgment includes setting the weight values of the preliminary judgment results of S3, S4 and S5 after the correction of S6, and the weight values are dynamically adjusted according to the state of the liquid film, when the liquid film is thicker, the weight of S5 is increased, and when the liquid film is thinner, the weights of S3 and S4 are increased;
[0048] The comprehensive judgment value is obtained by weighted calculation, which is the sum of the scores corresponding to each preliminary judgment result multiplied by its weight, wherein a positive value is given when the preliminary judgment is a bubble, and a negative value is given when the preliminary judgment is a plastic particle;
[0049] When the comprehensive judgment value reaches the set standard, it is determined to be a bubble, otherwise it is determined to be a plastic particle;
[0050] And in the comprehensive judgment process, the secondary verification is carried out in the case of contradiction of each preliminary judgment result, which includes rechecking the processing process and feature extraction result of each step to ensure the accuracy of the judgment.
[0051] Compared with the prior art, the beneficial effects of the present application are:
[0052] 1、The present application accurately captures the essential difference between plastic particles and bubbles through the synergistic effect of multi-dimensional feature analysis and liquid film interference correction: the edge of the plastic particle is rough, the transparency is low, the position and size are stable, while the edge of the bubble is smooth, the transparency is close to the liquid, it is easy to flow and the size changes obviously, thereby effectively solving the problem of low recognition accuracy of plastic particles in the prior art, ensuring that the plastic particles produced in the blow molding process can be reliably identified, and providing a core guarantee for product quality control.
[0053] 2. This invention also employs a deep learning-based convolutional neural network model for anomaly feature recognition. Through training with a large number of samples containing interference from plastic particles, bubbles, and liquid films, the model can automatically learn feature patterns in complex scenarios. Even when the liquid film is unevenly distributed or the lighting conditions change, it can still stably extract abnormal features, significantly improving the robustness of recognition and reducing missed or false detections caused by environmental interference.
[0054] 3. This invention also uses a dynamic weight adjustment mechanism to flexibly allocate the judgment weights of each feature according to the thickness of the liquid film, so that the recognition method can adapt to the interference intensity of different production scenarios, ensuring detection accuracy and adapting to the high-speed production rhythm of ampoules. At the same time, the real-time recognition results can be fed back to the blow molding process to provide data support for process parameter optimization, reduce the generation of plastic particles from the source, reduce production costs and improve overall production efficiency. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0056] To facilitate understanding of the technical solution of the present invention by those skilled in the art, the technical solution of the present invention will now be further described in conjunction with the accompanying drawings.
[0057] Example 1, such as Figure 1 As shown, the present invention provides a method for identifying plastic particles in a row of ampoules, comprising the following steps:
[0058] S1. Image acquisition: During the filling process after the plastic ampoules are blow-molded, the image acquisition device integrated on the filling head performs multiple image acquisitions of the inside of the ampoules.
[0059] S2. Abnormal Feature Recognition: Image recognition algorithms are used to process the acquired images and identify abnormal features on the inner wall of the ampoule.
[0060] S2a, Boundary Distinction: For the identified abnormal features, by analyzing the gray-level co-occurrence matrix and texture features of the features with the surrounding area, the edge of the abnormal feature itself is distinguished from the edge of the liquid film, and the independent contour data of the abnormal feature is preserved.
[0061] S3. Based on the judgment of edge features, perform edge detection and analysis on abnormal features, and make a preliminary judgment on whether the abnormal feature is a plastic particle or a bubble based on the smoothness of the edge.
[0062] S4. Based on the judgment of transparency characteristics, perform transparency analysis on abnormal features, and make a preliminary judgment on whether the abnormal features are plastic particles or bubbles based on the degree of transparency.
[0063] S5, judging based on multi-image contrast, comparing the size and position change of abnormal features in multiple images, and preliminarily judging whether the abnormal features are plastic particles or bubbles according to the change;
[0064] S6, liquid film interference correction, detecting and analyzing the liquid film state of the region where the abnormal features are located, and correcting the preliminary judgment results of S3, S4 and S5 according to the influence degree of the liquid film;
[0065] S7, comprehensive judgment, comprehensively judging the preliminary judgment results after S6 correction, and finally determining whether the abnormal features are plastic particles or bubbles.
[0066] In the embodiment of the application, in S1:
[0067] The lens of the image acquisition device faces the inside of the ampoule bottle and the shooting range covers the key area of the inner wall of the ampoule bottle, and the key area includes the corner of the inner wall of the ampoule bottle, the peripheral area in contact with the filling head and the middle area of the bottle body, wherein the corner covers the arc part connecting the bottle body and the bottle bottom, and the peripheral area in contact with the filling head is a ring-shaped area centered on the insertion point of the filling head;
[0068] Multiple image acquisition is performed at a set time interval, and the relative position between the image acquisition device and the ampoule bottle is kept stable by a mechanical fixing structure during the acquisition process to avoid image deviation caused by vibration and other factors;
[0069] The multiple images of the inside of the ampoule bottle at different times clearly present the texture of the inner wall of the ampoule bottle and possible abnormal features, without obvious blur or distortion;
[0070] To evaluate the image clarity, a clarity evaluation index is used Quantification:
[0071] ;
[0072] Wherein, The image clarity evaluation index is a dimensionless value, and the larger the value is, the clearer the image is;
[0073] The width of the image, in pixels, is the number of pixel points included in the image in the horizontal direction;
[0074] The height of the image, in pixels, is the number of pixel points included in the image in the vertical direction;
[0075] The absolute value of the gray gradient at the coordinate in the image, wherein, The gray-level gradient of this pixel is calculated using the Sobel operator. It reflects the rate of change of the gray-level value at this pixel. The larger its absolute value, the clearer the image details at that location.
[0076] This formula is used to quantitatively evaluate the sharpness of images captured inside ampoules. First, the Sobel operator is used to calculate the sharpness of each pixel in the image. grayscale gradient at The grayscale gradient reflects the rate of change of grayscale values at a pixel; a larger rate of change indicates clearer image details at that location. Then, the absolute values of the grayscale gradients of all pixels are summed to obtain the overall grayscale gradient sum of the image. The larger this sum, the more clear details are present in the image. Finally, this sum is divided by the total number of pixels in the image (i.e., the image width). With height The product of these factors is normalized to obtain the sharpness evaluation index. , The magnitude of the value is positively correlated with image sharpness. The higher the value, the clearer the image;
[0077] From the perspective of targeted image acquisition, the image acquisition equipment accurately covers key areas of the ampoule's inner wall, ensuring focused monitoring of corners prone to plastic particles or air bubbles, areas surrounding the filling head, and the central part of the bottle, avoiding the omission of critical anomalies. The use of a mechanical fixing structure effectively maintains the relative positional stability of the image acquisition equipment and the ampoule, reducing image shift caused by vibration and other factors, providing a stable image foundation for subsequent anomaly identification and analysis. As for the sharpness evaluation index... The introduction of this technology enables a quantitative assessment of image sharpness, allowing for a scientific determination of whether the acquired image meets the requirements for subsequent processing. When the value reaches the set standard, it indicates that the image clearly presents the texture of the ampoule's inner wall and any possible abnormal features, ensuring the accuracy of subsequent steps such as abnormal feature recognition and edge detection; if If the value does not meet the standard, the image can be re-acquired in a timely manner to avoid misjudgment caused by blurry images, thereby improving the reliability and accuracy of the entire method for identifying plastic particles in a row of ampoules.
[0078] In an embodiment of the present invention, in S2:
[0079] The image recognition algorithm is a deep learning-based algorithm, specifically including a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer.
[0080] The preprocessing in the processing process includes denoising the image to eliminate random noise generated in the shooting process, the denoising method adopts filtering processing based on the neighborhood information of pixels, enhancing to enhance the contrast between abnormal features and background in the image, the enhancing method includes adjusting the brightness and contrast of the image, edge extraction to highlight the outline of the object in the image, and the extraction method adopts an edge detection method based on gradient change;
[0081] An abnormal feature is identified by the trained abnormal feature recognition model, the abnormal feature recognition model is trained by an image data set containing a large number of plastic particles and bubble samples, and the sample is subjected to data enhancement processing during the training process, including image rotation, flipping and cropping operation;
[0082] The abnormal feature is a region suspected of being a plastic particle or a bubble, which appears as a region with obvious visual difference in color, gray scale or texture from the surrounding normal region in the image;
[0083] The contrast between the abnormal feature and the background The calculation formula is:
[0084] ;
[0085] Wherein, represents the contrast between the abnormal feature and the background, dimensionless, and the value range is The larger the value is, the more obvious the difference between the abnormal feature and the background is;
[0086] represents the average gray value of the abnormal feature region, which is obtained by calculating the arithmetic average value of the gray values of all pixel points in the abnormal feature region, dimensionless, and the value range is consistent with the gray level of the image;
[0087] represents the average gray value of the background region, which is calculated by the arithmetic average value of the gray values of all pixel points in the background region, dimensionless, and the value range is the same as ;
[0088] represents the maximum value of and , which is used to avoid zero denominator, is a very small positive number (such as ), to ensure the effectiveness of the calculation;
[0089] The absolute value symbol ensures that the contrast is a non-negative value;
[0090] The formula is used to quantify the contrast between the abnormal feature region and the background region. First, the average gray value of the abnormal feature region is calculated The average gray value of the background region The difference between the two Reflects the degree of difference in the gray of the two regions, the greater the difference, the more obvious the difference. Then, in order to avoid the case that the denominator is zero, the is used as the denominator, ensuring that the denominator is always positive. Finally, the absolute value of the ratio of the difference value to the denominator is taken, and the contrast , The greater the value, the more significant the difference between the abnormal feature region and the background region, and the easier it is to identify the abnormal feature from the background;
[0091] The convolutional neural network model based on deep learning has strong feature extraction and pattern recognition capability. The abnormal feature recognition model obtained by training a large number of samples can accurately identify the abnormal features on the inner wall of the ampoule, which are plastic particles or bubbles, laying a solid foundation for the subsequent judgment step. The denoising operation in the preprocessing process effectively eliminates random noise in the image, reducing the interference of noise on the identification of abnormal features; the enhanced contrast and edge extraction further highlight the abnormal features, making them easier to be identified. The introduction of the abnormal feature and background contrast formula achieves quantitative evaluation of contrast, facilitating the judgment of the degree of differentiation between abnormal features and background. When the value reaches a certain standard, it means that the abnormal feature is obvious enough to facilitate the subsequent steps of edge detection, transparency analysis, etc. If the value is low, the contrast can be improved by adjusting the brightness and contrast of the image, etc. to improve the accuracy and reliability of the entire identification method, ensuring that plastic particles and bubbles can be accurately identified and distinguished.
[0092] In the embodiments of the present application, in the S2a:
[0093] When analyzing the gray level co-occurrence matrix, the feature parameters of gray level correlation, contrast, energy and uniformity of the abnormal feature and the surrounding area in different directions and distances are calculated;
[0094] The roughness and directionality indicators in the texture feature are combined to distinguish the edge of the abnormal feature itself from the edge of the liquid film;
[0095] Among them, the gray level of the edge of the abnormal feature itself changes more sharply and stably, and the gray level of the edge of the liquid film changes relatively gently and dynamically with the flow state;
[0096] To quantify the gray level correlation, the following formula is used to calculate:
[0097] ;
[0098] Among them, , which represents the gray correlation, dimensionless, and the value range is , the greater the value, the closer the correlation of the pixel gray in the region;
[0099] , which represents the maximum gray value, dimensionless, and depends on the gray level of the image;
[0100] , which represents the probability of the pixel pair appearing in the gray co-occurrence matrix, dimensionless, and the value range is , the sum of all is 1;
[0101] , , respectively, are the gray values of the two pixels in the pixel pair, dimensionless, and the value range is ;
[0102] This formula is used to quantify the correlation of the gray values of different pixel pairs in the image and the surrounding area. First, the probability of the pixel pair appearing in the gray co-occurrence matrix is obtained, which reflects the frequency of a specific combination of gray values in the image. Then, the gray values and of each pixel pair are multiplied, and the corresponding probability is multiplied, and the sum of all results is obtained, which is the sum of the gray value correlation. Finally, the sum is divided by the square of the maximum gray value to normalize, and the gray correlation , is obtained, the greater the value, the higher the correlation of the pixel gray in the region, and the more uniform the texture;
[0103] The calculation formula of the gray contrast is:
[0104] ;
[0105] , where represents the gray contrast, dimensionless, and the value range is , the greater the value, the more obvious the gray difference in the region;
[0106] , which represents the square of the difference between the gray values of the pixel pair, dimensionless, and is used to amplify the gray difference;
[0107] This formula is used to measure the degree of difference in the gray values in the region. By calculating the square of the difference between the gray values of each pixel pair , and multiplying it by the probability of the pixel pair appearing , the sum of all results is obtained, which is the gray contrast , The greater the value, the more significant the gray difference of different pixels in the region, and the coarser the texture is;
[0108] By calculating the gray correlation and contrast and other characteristic parameters, the difference between the abnormal features and the liquid film on the texture can be effectively captured. The edge gray of the abnormal features changes sharply (high ) and the correlation is stable, the edge gray of the liquid film changes gently (low ) and the correlation changes with the flow, and the edge of the two can be accurately distinguished by using these differences. This distinction ensures that only the abnormal features themselves are analyzed in the subsequent steps, avoiding the interference of the liquid film edge, improving the accuracy of the subsequent steps such as edge detection and transparency analysis, and thus improving the reliability and accuracy of the entire plastic particle recognition method, providing stronger technical support for ampoule quality detection.
[0109] In the embodiment of the present application, in the S3:
[0110] The edge detection of the abnormal features includes obtaining edge contour data of the abnormal features by an edge detection operator, the edge detection operator is an operator capable of identifying gray mutation regions in an image, and the edge contour data contains coordinate information of each pixel point on the contour, forming a complete closed contour.
[0111] The analysis process is to calculate the smoothness parameter of the edge contour, the smoothness parameter is obtained by measuring the continuous change degree of the adjacent pixel point connecting line on the edge contour, and specifically, the change amplitude of the included angle between adjacent pixel point connecting lines is calculated.
[0112] When the smoothness parameter reaches the set standard, that is, the edge contour presents a continuous and no obvious abrupt turning state, the change amplitude of the included angle of each adjacent connecting line is small and uniform, and it is preliminarily judged as a bubble.
[0113] Otherwise, that is, the edge contour has obvious sawtooth shape or abrupt turning, the change amplitude of the included angle of the adjacent connecting line is large and irregular, and it is preliminarily judged as a plastic particle.
[0114] The calculation formula of the smoothness parameter is as follows:
[0115] ;
[0116] Wherein, represents the smoothness parameter of the edge contour, dimensionless, and the value range is , the value closer to 1 indicates that the edge is smoother;
[0117] represents the number of adjacent pixel point connecting lines on the edge contour, dimensionless, is a positive integer, and depends on the complexity of the edge contour;
[0118] denotes the ratio of the circumference of a circle to its diameter, approximately equal to 3.1416, used to normalize the range of angular change to ;
[0119] denotes the angle between the line connecting the nth and the (n+1)th adjacent pixel points and the horizontal direction, in radian, with the value range of ;
[0120] denotes the angle between the line connecting the nth and the (n+1)th adjacent pixel points and the horizontal direction, in radian, with the value range of ;
[0121] denotes the absolute value of the difference between the angle of the line connecting the nth and the (n+1)th adjacent pixel points and the angle of the line connecting the (n-1)th and the nth adjacent pixel points, in radian, reflecting the change amplitude of the contour direction; Since the edge contour is closed, the line connecting the 0th and the 1st adjacent pixel points is the same as the line connecting the (N-1)th and the Nth adjacent pixel points, ensuring the integrity of the calculation;
[0122] This formula is used to quantify the smoothness of the edge contour of the abnormal feature. First, the number of lines connecting adjacent pixel points on the edge contour is determined , and the angle of each line with the horizontal direction is obtained ; then, the absolute value of the difference between the angles of two adjacent lines is calculated
[0123] , which reflects the change amplitude of the edge contour direction, and the larger the difference, the more abrupt the contour turns. After summing up all the adjacent angle differences, divide by , the average angle change rate is obtained. Finally, subtract 1 from the average angle change rate to obtain the smoothness parameter ; The closer the value is to 1, the smoother the edge contour is, and the smaller the value, the rougher the edge contour is and the more obvious the turning is; On the one hand, this scheme uses edge detection operators to accurately obtain the edge contour data of abnormal features, providing a reliable basis for subsequent analysis; on the other hand, the calculation logic of the smoothness parameter is scientific and reasonable, which can effectively distinguish the smooth edge of the bubble from the rough edge of the plastic particle by quantitatively analyzing the change amplitude of the adjacent line angles.
[0124] When the value reaches the set standard, it is determined as a bubble, otherwise it is determined as a plastic particle, which is consistent with the difference in physical characteristics of bubbles and plastic particles. This scheme not only improves the accuracy of the preliminary determination, but also provides an important basis for subsequent comprehensive determination, reduces the overall recognition deviation caused by the misjudgment of the edge feature, and thus improves the reliability and practicability of the whole row ampoule plastic particle identification method, which is helpful for more efficient ampoule quality detection.
[0125] In the embodiment of the application, in the S4:
[0126] The transparency analysis obtains a transparency parameter by calculating the ratio of the light transmittance of the abnormal feature region to the light transmittance of the normal liquid region in the ampoule;
[0127] The light transmittance is determined by analyzing the light penetration degree of the corresponding region in the image, specifically by reflecting the intensity of the light after penetration through the gray value of the region in the image;
[0128] When the transparency parameter reaches the set standard, that is, the light transmittance of the abnormal feature region approaches or reaches the light transmittance of the normal liquid region, the difference between the gray values of the two is very small, and there is almost no obstruction when the light penetrates, it is preliminarily determined as a bubble;
[0129] Otherwise, that is, the light transmittance of the abnormal feature region is significantly lower than the light transmittance of the normal liquid region, the difference between the gray values of the two is significant, and there is obvious obstruction when the light penetrates, it is preliminarily determined as a plastic particle.
[0130] The transparency parameter The calculation formula is:
[0131]
[0132] In the formula, and can be calculated according to the average gray value and of the corresponding region, is the maximum gray value of the image;
[0133] wherein, represents the transparency parameter, dimensionless, and the value range is , which is used to measure the difference in transparency between the abnormal feature region and the normal liquid region, and the value closer to 1 indicates that the abnormal feature is more transparent;
[0134] represents the light transmittance of the abnormal feature region, dimensionless, and the value range is , which reflects the ability of the light to penetrate the abnormal feature region, and the greater the value, the stronger the penetration ability;
[0135] This represents the light transmittance of the normal region of a liquid, dimensionless, and its value ranges from [value missing]. This reflects the ability of light to penetrate the normal area of a liquid and serves as a reference standard.
[0136] This represents the average grayscale value of the anomalous feature region. It is dimensionless and is the average of the grayscale values of all pixels within the anomalous feature region. Its value range is consistent with the image grayscale levels, and it is used for calculation. ;
[0137] Transparency parameter The calculation logic reflects the transparency of abnormal features by comparing the light transmittance of the abnormal feature region and the normal liquid region. First, based on the average gray value of the abnormal feature region... Average gray value of the normal liquid area Combined with the maximum gray value of the image According to Calculate the light transmittance of the anomalous feature region Light transmittance in the normal liquid region Here, a higher grayscale value indicates a stronger intensity of light after penetration, and thus a higher light transmittance. Then, the light transmittance of the abnormal feature region is used... Divide by the light transmittance of the normal liquid region To obtain the transparency parameter , The closer the value is to 1, the closer the transparency of the abnormal feature area is to that of a normal liquid area, and the more likely it is to be an air bubble. The smaller the value, the lower the transparency of the abnormal feature area, and the more likely it is to be a plastic particle;
[0138] This method effectively utilizes the inherent differences in transparency between bubbles and plastic particles for preliminary judgment, yielding significant results. On one hand, it correlates light transmittance with image grayscale values, quantifying light transmittance through this directly obtainable image feature. This makes transparency analysis operable and objective, avoiding errors from subjective judgment. On the other hand, transparency parameters... The calculation method is simple and intuitive, clearly reflecting the transparency difference between abnormal features and normal liquid areas, providing a reliable quantitative basis for distinguishing between bubbles and plastic particles. When If the set standard is met, it is identified as an air bubble; otherwise, it is identified as plastic particles. This method aligns with the physical properties of both, significantly improving the accuracy of the initial assessment. Furthermore, the results of this approach, as a crucial component of the comprehensive assessment, complement and validate other findings, further enhancing the precision of the entire method for identifying plastic particles in ampoule packs. This contributes to improving the efficiency and reliability of ampoule quality inspection.
[0139] In an embodiment of the present invention, in step S5:
[0140] Comparing the size and positional changes of abnormal features in multiple images includes tracking the same abnormal feature through a feature matching algorithm. The feature matching algorithm adopts a matching method based on local invariant features (such as SIFT features), combined with the prediction of motion vectors of liquid film flow, eliminating false matching points caused by liquid film interference, and achieving corresponding matching across images by identifying the unique visual features of abnormal features.
[0141] Record its size data and position coordinates in each image. The size data is reflected by the number of pixels contained in the abnormal feature region. The more pixels, the larger the abnormal feature. The position coordinates are reflected by the coordinates of the geometric center of the abnormal feature region in the image. The geometric center is the center position surrounded by the region boundary.
[0142] Calculate the rate of change of the size and the positional offset of abnormal features in adjacent images;
[0143] When the rate of change in size and the positional offset reach the set standards, that is, when the size of the abnormal feature shows obvious expansion or contraction over time, the number of pixels increases or decreases significantly, the position moves significantly over time, and the geometric center coordinates change significantly, it is initially judged to be a bubble.
[0144] Otherwise, if the size and location of the abnormal features remain relatively stable, and the number of pixels and the coordinates of the geometric center change little or nothing, it is preliminarily judged to be plastic particles.
[0145] Rate of change in size The calculation formula is:
[0146] ;
[0147] in, Represents the rate of change of magnitude, dimensionless, and its range is [value range missing]. This reflects the relative degree of change in the size of abnormal features;
[0148] Indicates the first The number of pixels in the abnormal feature region of the image, dimensionless, and a positive integer;
[0149] Indicates the first The number of pixels in the abnormal feature region of the image, dimensionless, and a positive integer;
[0150] Represents the absolute value symbol, guaranteeing It is a non-negative value;
[0151] The formula is used to calculate the relative change degree of the size of the abnormal feature in the adjacent two images. First, the difference between the number of pixels of the abnormal feature region in the first image and the second image is calculated , then the difference is divided by the number of pixels of the abnormal feature region in the first image , the relative change ratio is obtained, and finally the absolute value is taken to obtain the size change rate , The greater the value is, the more obvious the size change of the abnormal feature is;
[0152] Position offset The calculation formula is:
[0153] ;
[0154] Wherein, represents the position offset, the unit is pixel, and the value range is , represents the moving distance of the abnormal feature position;
[0155] represents the coordinates of the geometric center of the abnormal feature region in the first image, the unit is pixel, is the horizontal coordinate, is the vertical coordinate;
[0156] represents the coordinates of the geometric center of the abnormal feature region in the second image, the unit is pixel, and the meaning is the same as ;
[0157] represents the square root symbol, which is used to calculate the straight line distance between two points on the plane;
[0158] The formula is used to calculate the moving distance of the abnormal feature position in the adjacent two images. By calculating the difference between the geometric center coordinates of the abnormal feature region in the first image and the second image in the horizontal direction and the vertical direction , the sum of the squares of the two differences is calculated, and the square root of the sum is calculated to obtain the position offset , The greater the value is, the more significant the moving of the abnormal feature position is;
[0159] Feature matching similarity The calculation formula is:
[0160] ;
[0161] in, Represents feature matching similarity, dimensionless, with a value range of... The closer the value is to 1, the more accurate the feature point matching.
[0162] This represents the number of matched feature points; it is dimensionless and a positive integer.
[0163] Indicates the first Euclidean distance between feature points, in pixels, reflects the spatial distance between two feature points;
[0164] This represents the distance adjustment parameter, in pixels, used to adjust the influence of Euclidean distance on matching similarity.
[0165] This represents an exponential function used to convert distance information into similarity weights;
[0166] This formula is used to measure the degree of matching of feature points in different images. For each pair of matching feature points, their Euclidean distance is calculated. With distance adjustment parameters The square of the ratio is taken, its negative is exponentially calculated, and then the results are summed over all matching feature points. Finally, the result is divided by the number of matching feature points. To obtain feature matching similarity , The closer the value is to 1, the more accurate the feature point matching.
[0167] By analyzing the size and location changes of abnormal features through multi-image comparison and combining this with feature matching algorithms, bubbles and plastic particles can be effectively distinguished, with significant results. (Size change rate) and position offset The calculation can quantify the dynamic changes of anomalous characteristics. Bubbles, due to their fluidity and variability, [are subject to these changes]. and The values are usually larger, while plastic granules are relatively stable. and The value is relatively small, which allows for a preliminary judgment. Feature matching similarity. The introduction of this method improves the accuracy of tracking abnormal features across images, reduces false matches caused by liquid film interference, and provides a reliable basis for calculating size and position changes. This scheme utilizes the differences in dynamic characteristics between bubbles and plastic particles, providing a key basis for comprehensive judgment. Combined with other judgment steps, it further enhances the accuracy of the entire recognition method, enabling more efficient quality inspection of ampoules.
[0168] In an embodiment of the present invention, in step S6:
[0169] The detection and analysis of the liquid film state in the region where the abnormal feature is located includes identifying the distribution range by analyzing the gray gradient change of the liquid film region in the image (such as the gray mutation of the liquid film and air interface), judging the thickness by the light reflection intensity difference of the liquid film region (such as the thicker film region reflecting more strongly), and analyzing the flow state by the pixel displacement trajectory of the liquid film region in the continuous image;
[0170] An interference model is established according to the optical properties of the liquid film, which reflects the influence law of the liquid film on the refraction and transparency of light;
[0171] According to the position of the abnormal feature in the liquid film and the state of the liquid film, the correction value of the edge smoothness parameter in S3, the correction value of the light transmittance ratio in S4, and the correction value of the size change rate and position offset in S5 are calculated according to the interference model, and then the preliminary judgment results of S3, S4 and S5 are adjusted.
[0172] The calculation formula of the edge smoothness parameter correction value is:
[0173] ;
[0174] Wherein, represents the corrected edge smoothness parameter, dimensionless, and the value range is , which can more truly reflect the edge smoothness of the abnormal feature;
[0175] represents the edge smoothness parameter before correction, dimensionless, and the value range is ;
[0176] represents the liquid film thickness influence coefficient, dimensionless, which is determined according to experiments or experience, and reflects the influence degree of the liquid film thickness on the edge smoothness parameter;
[0177] represents the liquid film thickness, which reflects the thickness of the liquid film;
[0178] The formula is used to correct the influence of the liquid film thickness on the edge smoothness parameter. First, the liquid film thickness influence coefficient and the liquid film thickness are determined, the product of the two is calculated, and the correction coefficient is obtained by subtracting 1 from the product. Then, the edge smoothness parameter before correction is multiplied by the correction coefficient to obtain the edge smoothness parameter after correction . The greater the liquid film thickness, the more the corrected value is reduced than the value, so as to offset the interference of the liquid film on the edge detection.
[0179] The light transmittance ratio correction value The calculation formula is:
[0180] ;
[0181] Wherein, The corrected light transmittance ratio is dimensionless, and can more accurately reflect the transparency of the abnormal feature;
[0182] The uncorrected transparency parameter is dimensionless;
[0183] The liquid film distribution influence coefficient is dimensionless, determined by experiment or experience, and reflects the influence of liquid film distribution on light transmittance ratio;
[0184] The distance from the abnormal feature to the edge of the liquid film reflects the positional relationship between the abnormal feature and the edge of the liquid film;
[0185] This formula is used to correct the influence of the distance from the abnormal feature to the edge of the liquid film on the light transmittance ratio. The liquid film distribution influence coefficient And the distance from the abnormal feature to the edge of the liquid film The product is subtracted by 1 to obtain the correction coefficient, and the uncorrected transparency parameter Is multiplied by the correction coefficient to obtain the corrected light transmittance ratio The closer the abnormal feature is to the edge of the liquid film, The value is smaller than The value decreases more, so as to correct the interference of the liquid film distribution on the transparency analysis;
[0186] The size change rate correction value And the position offset correction value Respectively:
[0187] ;
[0188] ;
[0189] Wherein, The corrected size change rate is dimensionless, and more accurately reflects the size change of the abnormal feature itself;
[0190] The uncorrected size change rate is dimensionless;
[0191] The corrected position offset is in pixels, and more truly reflects the position movement of the abnormal feature itself;
[0192] represents the position offset before correction, in pixels;
[0193] represents the liquid film flow speed influence coefficient, dimensionless, determined according to experiments or experience, reflecting the influence of the liquid film flow speed on the size change rate and the position offset;
[0194] represents the liquid film flow speed, in millimeters per unit time, such as millimeters per second;
[0195] represents the time interval of adjacent image acquisition, in time units, such as seconds;
[0196] size change rate correction value is the size change rate before correction minus the product of the liquid film flow speed influence coefficient and the liquid film flow speed to eliminate the influence of the liquid film flow on the abnormal feature size change judgment; position offset correction value is the position offset before correction minus the product of and the adjacent image acquisition time interval to correct the abnormal feature position offset misjudgment caused by the liquid film flow;
[0197] the calculation formula of the liquid film flow speed is as follows:
[0198] ;
[0199] wherein, represents the pixel physical size, in millimeters per pixel, i.e. the actual physical length represented by each pixel;
[0200] represents the number of tracked feature points in the liquid film region, dimensionless, being a positive integer;
[0201] represents the coordinate of the i-th feature point in the j-th image, in pixels; represents the coordinate of the i-th feature point in the j-th image, in pixels;
[0202] represents the coordinate of the i-th feature point in the j-th image, in pixels;
[0203] The formula is used for calculating the flow speed of the liquid film. First, the displacement distance of each tracking feature point in the liquid film area in two adjacent images is calculated, that is, the coordinate difference of the feature point in the first image and the second image is calculated, the pixel distance of the displacement is calculated by using the Pythagorean theorem, and then the moving speed (pixels / unit time) of the feature point is obtained by dividing the pixel distance by the time interval of adjacent image acquisition . The average value of the moving speeds of all feature points is multiplied by the physical size of the pixel , and then the unit is converted into millimeters / unit time to obtain the flow speed of the liquid film .
[0204] Through detection and analysis of the state of the liquid film, the interference model is established, and the preliminary judgment results of S3, S4 and S5 are corrected, so that the interference of the liquid film on the abnormal feature recognition is effectively eliminated, and the effect is remarkable. The calculation of the edge smoothness parameter correction value, the light transmittance ratio correction value, the size change rate correction value and the position offset correction value respectively solves the influence of the thickness, distribution and flow speed of the liquid film on the edge detection, transparency analysis, size and position change judgment, so that the corrected parameters can more truly reflect the inherent properties of the abnormal features. The accurate calculation of the flow speed of the liquid film provides a reliable basis for the above correction, and ensures the rationality and accuracy of the correction. Through the scientific correction mechanism, the accuracy of the subsequent comprehensive judgment is greatly improved, the whole joint row ampoule plastic particle recognition method is further improved, and the recognition accuracy is still high in the actual production scene with liquid film interference. A more powerful technical support is provided for ampoule quality detection.
[0205] In the embodiment of the present application, the S7 comprises:
[0206] The comprehensive judgment comprises setting weight values of the preliminary judgment results of S3, S4 and S5 corrected by S6, and the weight values are dynamically adjusted according to the state of the liquid film. When the liquid film is thicker, the weight of S5 is increased, and when the liquid film is thinner, the weights of S3 and S4 are increased.
[0207] The comprehensive judgment value is obtained by weighted calculation, the weighted calculation is summing the scores corresponding to the preliminary judgment results after multiplying the scores by the weights, wherein a positive value is given when the preliminary judgment is a bubble, and a negative value is given when the preliminary judgment is a plastic particle.
[0208] When the comprehensive judgment value reaches the set standard, it is determined to be a bubble, otherwise it is determined to be a plastic particle.
[0209] And the secondary verification is performed on the situation that there is a contradiction between the preliminary judgment results in the comprehensive judgment process, the secondary verification comprises rechecking the processing process and feature extraction results of each step, and ensuring the accuracy of the judgment.
[0210] Comprehensive judgment value The calculation formula is:
[0211] ;
[0212] Among them, represents the comprehensive judgment value, dimensionless, used for the final judgment of whether the abnormal feature is a bubble or a plastic particle, the larger the value, the more likely it is a bubble;
[0213] , , S3, S4, and S5 preliminary judgment results after S6 correction, dimensionless, the value range is , and the sum of the three is 1;
[0214] represents the maximum possible position offset, unit: pixel, according to the actual scene setting, used for normalizing ;
[0215] The formula is used to integrate the corrected parameters to obtain the final judgment index. First, multiply the edge smoothness parameter correction value , the light transmittance ratio correction value and the respective weights and to obtain the weighted values of the two items. For the size change rate correction value and the position offset correction value , first convert them to indicators reflecting stability (the larger the value, the more stable the abnormal feature, the more likely it is a plastic particle) through and , then multiply the two and multiply by the weight to obtain the weighted value of this item. Finally, add the three weighted values to obtain the comprehensive judgment value , The larger the value, the more the abnormal feature conforms to the characteristics of the bubble; The smaller the value, the more likely it is a plastic particle;
[0216] The dynamic weight adjustment formula is:
[0217] ;
[0218] ;
[0219] ;
[0220] Among them, represents the weight distribution coefficient, dimensionless, the value range is , used to control and the proportion of
[0221] represents the liquid film thickness;
[0222] represents the maximum possible thickness of the liquid film, determined according to the actual situation;
[0223] This formula is used to dynamically adjust the weight of each judgment result according to the liquid film thickness. When the liquid film thickness is small, the value is large, and the weights corresponding to S3 and S4 are large, small, highlighting the role of edge and transparency features; when the liquid film thickness is large, the value is small, and small, large, emphasizing the role of multi-image contrast results. The weight distribution coefficient is used to control and the overall proportion, ensuring that the sum of the weights is 1;
[0224] Through comprehensive judgment and dynamic weight adjustment, accurate identification of abnormal features is achieved, with remarkable results. The calculation of the comprehensive judgment value combines multiple aspects of information such as the modified edge smoothness, transparency, size change rate, and position offset, avoiding the limitations of single feature judgment and more comprehensively reflecting the properties of abnormal features. The dynamic weight adjustment mechanism flexibly allocates the weights of each feature according to the liquid film thickness, highlighting more reliable judgment basis in different liquid film states, improving the adaptability and accuracy of the judgment. The secondary verification step further reduces the misjudgment caused by accidental errors, ensuring the reliability of the final results. As the last link of the entire recognition method, this scheme integrates all the effective information from the previous stages, greatly improving the accuracy of the recognition of plastic particles in the side-by-side ampoule, providing strong technical support for quality control in the ampoule production process, and helping to improve product quality and production efficiency.
[0225] The embodiments of the present application disclose the preferred embodiments, but are not limited thereto. Those skilled in the art can easily understand the spirit of the present application according to the above embodiments, and make different inferences and changes, as long as they do not deviate from the spirit of the present application, which are within the protection scope of the present application.
Claims
1. A method for identifying plastic particles in a row of ampoules, characterized in that, Includes the following steps: S1. Image acquisition: During the filling process after the plastic ampoules are blow-molded, the image acquisition device integrated on the filling head performs multiple image acquisitions of the inside of the ampoules. S2. Abnormal Feature Recognition: Image recognition algorithms are used to process the acquired images and identify abnormal features on the inner wall of the ampoule. S2a, Boundary Distinction: For the identified abnormal features, by analyzing the gray-level co-occurrence matrix and texture features of the features with the surrounding area, the edge of the abnormal feature itself is distinguished from the edge of the liquid film, and the independent contour data of the abnormal feature is preserved. S3. Based on the judgment of edge features, perform edge detection and analysis on abnormal features, and make a preliminary judgment on whether the abnormal feature is a plastic particle or a bubble based on the smoothness of the edge. S4. Based on the judgment of transparency characteristics, perform transparency analysis on abnormal features, and make a preliminary judgment on whether the abnormal features are plastic particles or bubbles based on the degree of transparency. S5. Based on the judgment of multiple images, compare the size and position changes of abnormal features in multiple images, and make a preliminary judgment on whether the abnormal feature is plastic particles or bubbles based on the changes. S6, Liquid film interference correction: Detects and analyzes the state of the liquid film in the region where the abnormal feature is located, and corrects the preliminary judgment results of S3, S4, and S5 according to the degree of influence of the liquid film. S7. Comprehensive judgment: Based on the combined preliminary judgment results after S6 correction, finally determine whether the abnormal feature is plastic particles or air bubbles.
2. The method for identifying plastic particles in a row of ampoules according to claim 1, characterized in that, In S1: The lens of the image acquisition device is directed towards the inside of the ampoule and the shooting range covers the key areas of the inner wall of the ampoule. The key areas include the corner of the inner wall of the ampoule, the peripheral area that contacts the filling head, and the middle area of the bottle. The corner covers the arc-shaped part where the bottle body and the bottom of the bottle are connected, and the peripheral area that contacts the filling head is a ring-shaped area centered on the insertion point of the filling head. Multiple image acquisitions are performed at set time intervals; Multiple images of the ampoule's interior taken at different times clearly show the texture of the ampoule's inner wall and any possible abnormal features, without obvious blurring or distortion.
3. The method for identifying plastic particles in a row of ampoules according to claim 1, characterized in that, In S2: The image recognition algorithm is a deep learning-based algorithm, specifically including a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The preprocessing process includes denoising the image to eliminate random noise generated during the shooting process. The denoising method adopts filtering based on pixel neighborhood information. Enhancement is used to improve the contrast between abnormal features and the background in the image. The enhancement method includes adjusting the brightness and contrast of the image. Edge extraction is used to highlight the contours of objects in the image. The extraction method adopts an edge detection method based on gradient changes. Anomalies are identified by a trained anomaly recognition model, which is trained on an image dataset containing a large number of plastic particles and bubble samples. During the training process, data augmentation processing is performed on the samples, including image rotation, flipping, and cropping operations. The abnormal features are areas that appear to be plastic particles or bubbles, which are visually distinct from the surrounding normal areas in terms of color, grayscale, or texture in the image.
4. The method for identifying plastic particles in a row of ampoules according to claim 3, characterized in that, In S2a: When analyzing the gray-level co-occurrence matrix, the characteristic parameters of gray-level correlation, contrast, energy, and uniformity of the abnormal features and surrounding areas at different directions and distances are calculated. By combining roughness and directionality indicators in texture features, the edges of abnormal features themselves can be distinguished from the edges of liquid films.
5. The method for identifying plastic particles in a row of ampoules according to claim 4, characterized in that, In S3: Edge detection of anomalous features includes obtaining edge contour data of anomalous features through an edge detection operator. The edge detection operator is an operator that can identify regions with abrupt changes in grayscale in an image. The edge contour data contains the coordinate information of each pixel on the contour, forming a complete closed contour. The analysis process involves calculating the smoothness parameter of the edge contour. The smoothness parameter is obtained by measuring the degree of continuous change of the line connecting adjacent pixels on the edge contour, specifically by calculating the change range of the angle between the line connecting adjacent pixels. When the smoothness parameter reaches the set standard, that is, the edge contour is continuous and there are no obvious abrupt turns, and the angle between adjacent lines changes little and is uniform, it is initially judged to be a bubble. Otherwise, if the edge contour has obvious jaggedness or abrupt turns, and the included angle between adjacent lines varies greatly and is irregular, it is preliminarily judged to be plastic granules.
6. The method for identifying plastic particles in a row of ampoules according to claim 5, characterized in that, In S4: Transparency analysis yields a transparency parameter by calculating the ratio of light transmittance in abnormal feature areas to light transmittance in normal areas of the liquid inside the ampoule. The light transmittance is determined by analyzing the degree of light penetration in the corresponding area of the image, specifically by using the gray value of the area in the image to reflect the intensity of light after penetration. When the transparency parameter reaches the set standard, that is, the light transmittance of the abnormal feature area is close to or reaches the light transmittance of the normal liquid area, the difference in gray value between the two is very small, and the light passes through almost without obstruction, it is initially judged to be a bubble. Otherwise, if the light transmittance of the abnormal feature area is significantly lower than that of the normal liquid area, the gray value of the two is significantly different, and there is obvious obstruction when the light passes through, it is initially judged to be plastic particles.
7. The method for identifying plastic particles in a row of ampoules according to claim 6, characterized in that, In S5: Comparing the size and positional changes of abnormal features in multiple images includes tracking the same abnormal feature through a feature matching algorithm. The feature matching algorithm adopts a matching method based on local invariant features, combined with the prediction of motion vectors of liquid film flow, eliminating false matching points caused by liquid film interference, and achieving corresponding matching across images by identifying the unique visual features of abnormal features. Record its size data and position coordinates in each image. The size data is reflected by the number of pixels contained in the abnormal feature region. The more pixels, the larger the abnormal feature. The position coordinates are reflected by the coordinates of the geometric center of the abnormal feature region in the image. The geometric center is the center position surrounded by the region boundary. Calculate the rate of change of the size and the positional offset of abnormal features in adjacent images; When the rate of change in size and the positional offset reach the set standards, that is, when the size of the abnormal feature shows obvious expansion or contraction over time, the number of pixels increases or decreases significantly, the position moves significantly over time, and the geometric center coordinates change significantly, it is initially judged to be a bubble. Otherwise, if the size and location of the abnormal features remain relatively stable, and the number of pixels and the coordinates of the geometric center change little or not at all, it is preliminarily judged to be plastic particles.
8. The method for identifying plastic particles in a row of ampoules according to claim 7, characterized in that, In S6: The detection and analysis of the liquid film state in the region of abnormal features includes identifying the distribution range by analyzing the gray-level gradient changes of the liquid film region in the image, determining the thickness by the difference in light reflection intensity of the liquid film region, and analyzing the flow state by analyzing the pixel displacement trajectory of the liquid film region in continuous images. An interference model is established based on the optical properties of liquid films, which reflects the influence of liquid films on light refraction and transparency. Based on the location of the abnormal features in the liquid film and the state of the liquid film, the correction values of the edge smoothness parameter in S3, the correction value of the light transmittance ratio in S4, and the correction values of the size change rate and position offset in S5 are calculated according to the interference model, and then the preliminary judgment results of S3, S4, and S5 are adjusted.
9. The method for identifying plastic particles in a row of ampoules according to claim 8, characterized in that, In S7: The comprehensive judgment includes setting weight values for the preliminary judgment results of S3, S4 and S5 after S6 correction. The weight values are dynamically adjusted according to the state of the liquid film. When the liquid film is thicker, the weight of S5 is increased, and when the liquid film is thinner, the weights of S3 and S4 are increased. A comprehensive judgment value is obtained through weighted calculation. The weighted calculation is to multiply the score corresponding to each preliminary judgment result by its weight and then sum them up. A positive value is assigned when the preliminary judgment is a bubble and a negative value is assigned when the preliminary judgment is a plastic particle. When the comprehensive judgment value reaches the set standard, it is determined to be an air bubble; otherwise, it is determined to be a plastic particle. Furthermore, in the process of comprehensive judgment, if there are contradictions in the preliminary judgment results, a second verification is carried out. The second verification includes re-examining the processing procedures and feature extraction results of each step to ensure the accuracy of the judgment.
Citation Information
Patent Citations
Row ampoule bottle identification system and identification method and storage medium
CN115291765A
Sub-visible particle quality control method, system and equipment for intraocular injection
CN116563249A