Industrial camera-based automatic filling production line bottle mouth positioning method, system and device
By analyzing the grayscale, color, and gradient features of the potential area at the bottle opening, effective pixels in different directions are selected, and the standardization of the bottle opening structure is quantified. This solves the problem of inaccurate bottle opening positioning in the filling production line and achieves high-precision bottle opening positioning.
Patent Information
- Application Number
- CN202511403872.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Existing methods are difficult to adapt to changes in bottle neck position in filling production lines, especially under the influence of factors such as clamp vibration and high-temperature condensation film, resulting in poor bottle neck positioning effect.
By acquiring the grayscale, color, and gradient features of the potential area of the bottle opening, calculating the local roughness and dynamic neighborhood radius, filtering effective pixels in different directions, and quantifying the structural standardization of the bottle opening, dynamic positioning is achieved.
It improves the accuracy of bottle mouth positioning, adapts to the effects of unstable clamps and high-temperature condensation film, and ensures filling accuracy.
Smart Images

Figure CN120876496B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of bottle mouth positioning, in particular to an automatic filling production line bottle mouth positioning method, system and device based on an industrial camera. BACKGROUND
[0002] In an automatic filling production line, an industrial vision system is a key technology for realizing accurate positioning of a bottle mouth. In existing methods, a gradient detection algorithm based on a fixed window is used to identify the position of a bottle mouth. However, vibration or wear of a clamp during transmission of the filling production line can cause a bottle body to deviate or tilt, so that the bottle mouth deviates from a preset static bottle mouth potential area. In addition, condensation water film generated after high-temperature cleaning of a PET bottle mouth causes edge blur at normal temperature, and strong reflection of a metal bottle body causes local pixel saturation, which seriously interferes with edge judgment. The detection method of the fixed window is difficult to adapt to position changes, and the effect of bottle mouth positioning is poor. SUMMARY
[0003] In order to solve the technical problem that the detection method of the fixed window is difficult to adapt to position changes and the effect of bottle mouth positioning is poor, the purpose of the present application is to provide an automatic filling production line bottle mouth positioning method, system and device based on an industrial camera, and the technical solution adopted is as follows:
[0004] The present application provides an automatic filling production line bottle mouth positioning method based on an industrial camera, which comprises the following steps:
[0005] An overhead image of a bottle mouth to be filled is obtained, and the overhead image contains a bottle mouth potential area;
[0006] According to the gray scale, color and gradient feature distribution of different pixel points in the bottle mouth potential area, the local roughness of each pixel point in the bottle mouth potential area is obtained. According to the morphological features of the bottle mouth potential area and the local roughness of each pixel point, the dynamic neighborhood radius of each pixel point in the bottle mouth potential area is obtained.
[0007] According to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points, the direction effective pixel points are screened out. According to the gradient direction and position distribution of the direction effective pixel points in the bottle mouth potential area, the direction standard degree of the bottle mouth potential area and the bottle mouth size regularity are obtained. According to the direction standard degree of the bottle mouth potential area and the bottle mouth size regularity, the structure standard of the bottle mouth potential area is obtained.
[0008] According to the structure standard of the bottle mouth potential area, the bottle mouth area is positioned.
[0009] Further, the method for obtaining the local roughness comprises:
[0010] According to the gray scale and color distribution of the pixel points in the bottle mouth potential area, the bottle mouth texture complexity of the bottle mouth potential area is obtained.
[0011] For the bottle potential region, if the gray value of the pixel point is less than the preset saturation threshold, the corresponding pixel point is taken as an unsaturated pixel point; the gray fluctuation degree of all unsaturated pixel points in the neighborhood range of each pixel point is obtained, and a preset quantile of the corresponding gray fluctuation degree in all pixel points is taken as the texture roughness of the bottle potential region;
[0012] According to the difference between the gradient amplitude of each pixel point and other pixel points in the neighborhood range, the bottle texture complexity and the texture roughness, the local roughness of each pixel point is obtained, and the difference between the gradient amplitude, the bottle texture complexity and the texture roughness are positively correlated with the local roughness.
[0013] Further, the method for obtaining the bottle texture complexity comprises:
[0014] For the bottle potential region, the average gray level is obtained by taking the average gray value of all pixel points;
[0015] According to the gray difference between the gray value of all unsaturated pixel points and the average gray level, the number of all pixel points in the bottle potential region and the hue component fluctuation degree of different pixel points in the HSV space, the bottle texture complexity of the bottle potential region is obtained, and the gray difference and the hue component fluctuation degree are positively correlated with the bottle texture complexity, and the number of pixel points is negatively correlated with the bottle texture complexity.
[0016] Further, the method for obtaining the dynamic neighborhood radius comprises:
[0017] The ratio of the number of edge pixel points of the bottle potential region to the number of all pixel points is obtained, and the product of the ratio and the pixel calibration size is taken as the minimum radius protection value;
[0018] The local roughness of each pixel point in the bottle potential region is normalized, and the minimum radius protection value is gain-adjusted according to the normalization result, so as to obtain the dynamic neighborhood radius of each pixel point.
[0019] Further, the method for obtaining the direction effective pixel point comprises:
[0020] The standard normal direction of the bottle CAD model is obtained; and the included angle between the gradient direction of each pixel point and the standard normal direction is taken as the first included angle;
[0021] According to the gradient direction fluctuation degree of all pixel points in the dynamic neighborhood radius range of each pixel point, the local roughness and the difference between the first included angle and the right angle corresponding to each pixel point, the direction confidence weight of each pixel point is obtained, and the gradient direction fluctuation degree, the local roughness and the difference between the first included angle and the right angle are negatively correlated with the direction confidence weight.
[0022] If the directional confidence weight of the pixel point is greater than the preset confidence threshold, the corresponding pixel point is taken as a directional effective pixel point. Further, the method for obtaining the directional standard degree comprises:
[0023] According to the gradient direction fluctuation degree of all directional effective pixel points in the local range of the different directional effective pixel points, and the difference between the first angle and the right angle corresponding to each directional effective pixel point, a directional standard degree is obtained, and the gradient direction fluctuation degree and the difference between the first angle and the right angle are negatively correlated with the directional standard degree. Further, the method for obtaining the bottle mouth size regularity comprises:
[0024] A curve for coordinate fitting of all directional effective pixel points is obtained, a minimum outer circle of the curve is constructed, and a radius difference between the radius of the minimum outer circle and the theoretical pixel equivalent radius is obtained;
[0025] A ratio of the radius difference and the maximum value of the radius is obtained, and is negatively correlated and mapped, as the bottle mouth size regularity.
[0026] Further, the method for obtaining the structure standard comprises:
[0027] The product of the directional standard degree of the bottle mouth potential area and the bottle mouth size regularity is obtained as the structure standard.
[0028] The application also proposes an automatic filling production line bottle mouth positioning device based on an industrial camera, comprising an image acquisition module, a radius dynamic adjustment module, a structure standard analysis module, and a bottle mouth positioning module:
[0029] The image acquisition module: obtains an overhead image of a bottle mouth to be filled, and the overhead image comprises a bottle mouth potential area;
[0030] The radius dynamic adjustment module: according to the gray, color and gradient feature distribution of different pixel points in the bottle mouth potential area, the local roughness of each pixel point in the bottle mouth potential area is obtained; according to the morphological characteristics of the bottle mouth potential area and the local roughness of each pixel point, the dynamic neighborhood radius of each pixel point in the bottle mouth potential area is obtained;
[0031] The structure standard analysis module: according to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points, the directional effective pixel points are screened out; according to the gradient direction and position distribution of the directional effective pixel points in the bottle mouth potential area, the directional standard degree of the bottle mouth potential area and the bottle mouth size regularity are obtained; according to the directional standard degree of the bottle mouth potential area and the bottle mouth size regularity, the structure standard of the bottle mouth potential area is obtained;
[0032] The bottle mouth positioning module: according to the structure standard of the bottle mouth potential area, the bottle mouth area is positioned.
[0033] The application further provides an industrial camera-based automatic filling production line bottle mouth positioning system, which stores programs or instructions, and the programs or instructions are executed by a processor to realize the steps of the industrial camera-based automatic filling production line bottle mouth positioning method.
[0034] The application has the following advantages:
[0035] The application considers that the gray scale of the metal light reflection jumps sharply and the color tone diverges, which interferes with the judgment of the real edge of the bottle mouth. According to the gray scale, color and gradient feature distribution of different pixel points in the potential bottle mouth area, the local roughness of each pixel point in the potential bottle mouth area is obtained. According to the morphological features of the potential bottle mouth area and the local roughness of each pixel point, the dynamic neighborhood radius of each pixel point in the potential bottle mouth area is obtained, which helps to retain details using a small neighborhood and suppress halos using a large neighborhood. According to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points, the direction effective pixel points are screened out to avoid the influence of the interference pixel points, which helps to improve the accuracy of subsequent analysis. According to the gradient direction and position distribution of the direction effective pixel points in the potential bottle mouth area, the structure standardization of the potential bottle mouth area is obtained, and the degree to which the bottle mouth contour conforms to the standard model is quantified. The bottle mouth area is positioned. The application improves the accuracy of bottle mouth positioning by accurately analyzing the structure standardization of the potential bottle mouth area. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art and the advantages thereof, a brief introduction will be given to the drawings needed in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can be obtained without creative labor based on these drawings.
[0037] Figure 1 A flowchart of an industrial camera-based automatic filling production line bottle mouth positioning method provided by an embodiment of the application;
[0038] Figure 2 A flowchart of a local roughness acquisition method provided by an embodiment of the application;
[0039] Figure 3 A flowchart of a direction effective pixel point acquisition method provided by an embodiment of the application;
[0040] Figure 4 A structural block diagram of an industrial camera-based automatic filling production line bottle mouth positioning device provided by an embodiment of the application. DETAILED DESCRIPTION
[0041] To further clarify the technical means and effects taken by the present application to achieve the predetermined inventive purpose, the specific implementation, structure, features and effects of a bottle mouth positioning method, system and device based on an industrial camera for an automatic filling production line according to the present application are described in detail as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.
[0043] The specific scheme of a bottle mouth positioning method, system and device based on an industrial camera for an automatic filling production line provided by the present application is described in detail below with reference to the accompanying drawings.
[0044] Please refer to Figure 1 which shows a flowchart of a bottle mouth positioning method based on an industrial camera for an automatic filling production line according to an embodiment of the present application, and the specific method comprises:
[0045] Step S1: Obtain an overhead image of a bottle mouth to be filled, which contains a potential area of the bottle mouth.
[0046] In the embodiment of the present application, the single clamp fixation method during filling makes the clamp position unstable, which may cause the bottle body to move or tilt during transportation, thereby affecting its position accuracy. Before the bottle body enters the filling station, it is usually cleaned, dried and subjected to other operations. However, due to the natural cooling of the bottle body after high-temperature disinfection, condensation often occurs on the PET bottle mouth, and a certain condensation film often appears on the bottle mouth at this time. In addition, the inevitable reflection problem of some metal bottle bodies will also affect the judgment of the true edge of the bottle mouth. First, in the dairy filling line, an overhead image of the bottle mouth to be filled is collected by an industrial camera installed on the side of the filling device. The ROI region is manually delineated as the potential area of the bottle mouth, which helps to reduce the proportion of interference areas in the image for analysis.
[0047] Step S2: Obtain the local roughness of each pixel point in the potential area of the bottle mouth according to the gray scale, color and gradient feature distribution of different pixel points in the potential area of the bottle mouth; and obtain the dynamic neighborhood radius of each pixel point in the potential area of the bottle mouth according to the morphological features of the potential area of the bottle mouth and the local roughness of each pixel point.
[0048] Compared with the normal region and the condensate film region, the pixel gray level of the metal reflective region at the bottle mouth usually has a large jump, a large local gray fluctuation, and a large gradient change. Therefore, the local roughness of each pixel in the bottle mouth potential region is obtained according to the gray level distribution and the gradient distribution of the pixels in the neighborhood of different pixels in the bottle mouth potential region.
[0049] Preferably, in an embodiment of the present application, the method for obtaining the local roughness is as follows: Figure 2 A flowchart of a method for obtaining the local roughness is shown in FIG. 2, which includes the following steps:
[0050] Step S201: Obtain the bottle mouth texture complexity of the bottle mouth potential region according to the gray level and color distribution of the pixels in the bottle mouth potential region.
[0051] Since the bottle mouth will have a certain condensate film, and the inevitable reflection problem of part of the metal bottle body will interfere with the judgment of the true edge of the bottle mouth, the metal reflection usually shows local saturation and hue divergence, so that the greater the complexity of the bottle mouth; the condensate film usually shows relatively uniform gray level and hue change, which covers the true roughness; therefore, the texture complexity is quantified by analyzing the gray level and color distribution of the pixels.
[0052] Preferably, in an embodiment of the present application, the method for obtaining the bottle mouth texture complexity includes:
[0053] For the bottle mouth potential region, the average gray level of all the pixels is obtained as the average gray level; the gray values of all the pixels in the bottle mouth potential region are quantified by averaging to reflect the overall gray level in the region, and the average gray level is compared in the subsequent calculation process.
[0054] Considering that the metal reflection will produce local saturation and hue divergence, and the saturated region will cover the true micro-surface relief, affecting the judgment of the overall complexity, the unsaturated pixels are analyzed; according to the gray level difference between the gray level of all the unsaturated pixels and the average gray level, the number of all the pixels in the bottle mouth potential region, and the hue component fluctuation degree of different pixels in the HSV space, the bottle mouth texture complexity of the bottle mouth potential region is obtained, the gray level difference and the hue component fluctuation degree are positively correlated with the bottle mouth texture complexity, and the number of pixels is negatively correlated with the bottle mouth texture complexity.
[0055] It should be noted that the gray difference between the gray value and the average gray level reflects the fluctuation of the gray value, the greater the gray difference, the greater the change of the gray value of the pixel point, the greater the gray fluctuation, and the more complex the texture; the fluctuation degree of the hue component reflects the uniformity of the color of the pixel point, the greater the fluctuation degree, the more uneven the color, the greater the influence of the reflection, and the more complex the texture; the more the number of pixel points in the region, the greater the area distribution, the more the local details are averaged, the smaller the influence on the whole, and the smaller the complexity of the texture, therefore, the gray difference and the fluctuation degree of the hue component are positively correlated with the complexity of the bottle mouth texture, and the number of pixel points is negatively correlated with the complexity of the bottle mouth texture.
[0056] In an embodiment of the present application, the gray difference cumulative value between the gray value and the average gray level of all unsaturated pixel points is obtained, the ratio of the gray difference cumulative value and the number of all pixel points in the region is calculated as the first complexity; the product of the fluctuation degree of the hue component of different pixel points in the HSV space in the bottle mouth potential region and the first complexity is obtained as the bottle mouth texture complexity; therefore, the correlation between the gray difference, the fluctuation degree of the hue component, and the number of pixel points and the complexity of the bottle mouth texture is constructed based on the above basic mathematical operations, that is, the greater the gray difference, the greater the fluctuation degree of the hue component, and the smaller the number of pixel points, the greater the influence of the local details, and the greater the complexity of the bottle mouth texture.
[0057] It should be noted that in an embodiment of the present application, the fluctuation degree can be reflected by calculating the standard deviation, the greater the standard deviation, the greater the fluctuation degree; in other embodiments of the present application, the fluctuation degree can also be reflected by calculating the variance, and the specific means is a technology known to those skilled in the art, which is not described here.
[0058] Step S202: For the bottle mouth potential region, if the gray value of the pixel point is less than the preset saturation threshold, the corresponding pixel point is taken as an unsaturated pixel point; the gray fluctuation degree of all unsaturated pixel points in the neighborhood range of each pixel point is obtained, and the preset quantile of the corresponding gray fluctuation degree in all pixel points is selected as the texture roughness of the bottle mouth potential region.
[0059] It should be noted that in the embodiments of the present application, the size of the preset saturation threshold can be dynamically adjusted by the implementer according to the material characteristics of the bottle mouth, which is not limited and described here.
[0060] It should be noted that, in an embodiment of the present application, the size of the neighborhood range is a range of 5*5 size constructed with the adjacent pixel points as the center of each pixel point; in order to avoid the interference of maximum value noise and retain the distribution characteristics, the preset quantile is set to 75% quantile, that is, the gray level fluctuation degree corresponding to all pixel points is sorted from small to large, and the value corresponding to the 75% quantile is selected as the texture roughness of the bottle mouth potential region; in other embodiments of the present application, the size of the neighborhood range can be set according to specific circumstances, which is not limited or described here.
[0061] Step S203: obtaining the local roughness of each pixel point according to the difference between the gradient amplitude of each pixel point and other pixel points in the neighborhood range, the bottle mouth texture complexity and the texture roughness; the difference between the gradient amplitude, the bottle mouth texture complexity and the texture roughness are positively correlated with the local roughness.
[0062] It should be noted that the gradient amplitude reflects the intensity of the gray level change of the pixel point, which can be obtained by the Canny edge detection algorithm or operator, and the specific means is the technical means familiar to those skilled in the art, which is not described here; the greater the difference between the gradient amplitude, the rougher the texture, the greater the texture roughness, and the greater the local roughness; therefore, the difference between the gradient amplitude and the texture roughness are positively correlated with the local roughness.
[0063] In an embodiment of the present application, the mean value of the difference between the gradient amplitude of each pixel point and all other pixel points in the neighborhood range is taken as the first roughness of each pixel point; the product of the first roughness, the bottle mouth texture complexity and the texture roughness is taken as the local roughness of each pixel point; therefore, the correlation between the difference between the gradient amplitude, the bottle mouth texture complexity and the texture roughness and the local roughness is constructed based on the above basic mathematical operation, that is, the greater the difference between the gradient amplitude, the more blurred the edge, the greater the bottle mouth texture complexity, the greater the texture roughness, and the greater the local roughness.
[0064] The intensity of the reflection light is different in different areas of the bottle mouth, the local roughness has a mutation with the surrounding normal area, and the dynamic radius can inhibit the influence of local overexposure or underexposure; according to the morphological characteristics of the bottle mouth potential region and the local roughness of each pixel point, the dynamic neighborhood radius of each pixel point in the bottle mouth potential region is obtained.
[0065] Preferably, in an embodiment of the present application, the method for obtaining the dynamic neighborhood radius comprises:
[0066] obtaining the ratio of the number of edge pixel points of the bottle mouth potential region to the number of all pixel points, calculating the product of the ratio and the pixel calibration size as the minimum radius protection value;
[0067] The local roughness of each pixel point in the potential area of the bottle mouth is normalized, the minimum radius protection value is gain-adjusted according to the normalized result, and the dynamic neighborhood radius of each pixel point is obtained.
[0068] In an embodiment of the present application, the sum of the positive integer 1 and the normalized result is calculated as the adjustment weight, and the product of the adjustment weight and the minimum radius protection value is calculated as the dynamic neighborhood radius.
[0069] It should be noted that in the embodiments of the present application, normalization can be performed by linear normalization or normalization function, and the specific means are well known to those skilled in the art, which will not be described here.
[0070] It should be noted that the pixel calibration size represents the actual physical size corresponding to a single pixel, and the acquisition method is to obtain the ratio of the known bottle mouth diameter size to the pixel size mapped in the image based on the scene where the bottle mouth is located, and the specific means are well known to those skilled in the art, which will not be described here.
[0071] It should be noted that the larger the local roughness, the greater the neighborhood that needs to be taken to smooth the noise and suppress the light spot; the smaller the local roughness, the smaller the neighborhood that needs to be taken to protect the weak texture features, therefore, the larger the local roughness, the larger the dynamic neighborhood radius.
[0072] Step S3: According to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points, the direction effective pixel points are screened out; according to the gradient direction and position distribution of the direction effective pixel points in the potential area of the bottle mouth, the direction standard degree of the potential area of the bottle mouth and the bottle mouth size regularity are obtained; according to the direction standard degree of the potential area of the bottle mouth and the bottle mouth size regularity, the structure standard of the potential area of the bottle mouth is obtained.
[0073] The gradient direction mainly distributes along the tangent direction of the bottle mouth contour, the more uneven the gradient direction distribution, the more likely the radius range is disturbed by the reflection light, and the poorer the effectiveness of the bottle mouth analysis; according to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points, the direction effective pixel points are screened out.
[0074] Preferably, in an embodiment of the present application, the acquisition method of the direction effective pixel point please refer to Figure 3 which shows a flow chart of a direction effective pixel point acquisition method, including:
[0075] Step S301: Obtain the standard normal direction of the bottle mouth CAD model; obtain the included angle between the gradient direction of each pixel point and the standard normal direction as the first included angle.
[0076] The normal direction represents the bottle mouth axis direction; in the ideal case of clear bottle mouth contour and no defects, the gradient direction of the pixel point in the image should be perpendicular to the normal direction of the CAD model; that is, the first included angle is a right angle; when the bottle mouth is blurred and there is reflection interference, the gradient direction of the pixel point should deviate from the normal direction of the CAD model, and the first included angle deviates from the right angle.
[0077] Step S302: According to the gradient direction fluctuation degree of all pixel points in the dynamic neighborhood radius range of each pixel point, the local roughness, and the difference between the first included angle and the right angle corresponding to each pixel point, the direction confidence weight of each pixel point is obtained. The gradient direction fluctuation degree, the local roughness, and the difference between the first included angle and the right angle are negatively correlated with the direction confidence weight.
[0078] In an embodiment of the present application, the gradient direction fluctuation degree is inverted to realize negative correlation normalization mapping as the direction consistency; the normalization result of the local roughness of each pixel point is taken as the direction penalty strength, the difference between the first included angle and the right angle is weighted, and the negative correlation mapping is realized by the exponential function with a natural constant as the base The product of the negative correlation mapping result and the direction consistency is taken as the direction confidence weight; that is, the greater the gradient direction fluctuation degree, the smaller the direction consistency, the more the reflection interference, and the smaller the direction confidence weight; the greater the local roughness, the more likely to be affected by reflection, the greater the direction penalty strength, the greater the difference between the first included angle and the right angle, and the smaller the direction confidence weight; therefore, the correlation between the gradient direction fluctuation degree, the local roughness, and the difference between the first included angle and the right angle and the direction confidence weight is constructed based on the above basic mathematical operations, that is, the gradient direction fluctuation degree, the local roughness, and the difference between the first included angle and the right angle are negatively correlated with the direction confidence weight. It should be noted that in an embodiment of the present application, the standard deviation is used to reflect the fluctuation degree, the greater the standard deviation, the greater the fluctuation degree, and the smaller the standard deviation, the smaller the fluctuation degree. In other embodiments of the present application, the variance can also be used to reflect the fluctuation degree, and the specific means is a technical means familiar to those skilled in the art, which will not be described here.
[0079] It should be noted that in an embodiment of the present application, the gradient direction of each pixel point is obtained by using operator, and the specific operator is a technical means familiar to those skilled in the art, which will not be described here.
[0080] Step S303: If the direction confidence weight of the pixel point is greater than the preset confidence threshold, the corresponding pixel point is taken as a direction effective pixel point.
[0081] It should be noted that in one embodiment of the present application, the size of the preset signal threshold is 0.6; in other embodiments of the present application, the size of the preset signal weight can be set according to specific circumstances, which is not limited or described here.
[0082] The gradient direction reflects the trend of the edge, which is helpful to analyze the compliance of the bottle mouth rotation direction and the texture arrangement; the position distribution reflects the constituting area of the direction effective pixel point, and reflects the regularity of the bottle mouth shape; therefore, according to the gradient direction and the position distribution of the direction effective pixel point in the potential area of the bottle mouth, the direction standard degree of the potential area of the bottle mouth and the size regularity of the bottle mouth are obtained.
[0083] Preferably, in one embodiment of the present application, the method for obtaining the direction standard degree comprises:
[0084] According to the gradient direction fluctuation degree of all direction effective pixel points in the local range of different direction effective pixel points and the difference between the first angle and the right angle corresponding to each direction effective pixel point, the direction standard degree is obtained, and the gradient direction fluctuation degree and the difference between the first angle and the right angle are negatively correlated with the direction standard degree.
[0085] It should be noted that in one embodiment of the present application, the local range is a range formed by selecting eight neighborhood pixel points as the center of the direction effective pixel point, and in other embodiments of the present application, the size of the local range can be set according to specific circumstances, which is not described here.
[0086] It should be noted that the difference between the first angle and the right angle reflects the correlation between the angle between the gradient direction and the standard normal direction and the right angle, the greater the difference, the more the angle between the gradient direction and the standard normal direction deviates from the right angle, the more it does not conform to the normal perpendicular relationship, and the worse the direction standard degree; the gradient direction fluctuation degree reflects the uniformity of the gradient direction of the pixel points in the local range, the greater the gradient direction fluctuation degree, the worse the direction uniformity, the greater the influence degree of the direction of the pixel points, the smaller the direction credibility, and the worse the direction standard degree; the gradient direction fluctuation degree and the direction difference are negatively correlated with the direction standard degree.
[0087] In one embodiment of the present application, the cosine function value of the difference between the first included angle and the right angle corresponding to each direction effective pixel point is calculated as the first standard degree, the greater the difference between the first included angle and the right angle, the smaller the cosine function value, and the smaller the first standard degree; the standard deviation of the gradient direction standard degree of all direction effective pixel points in the local range is calculated as the gradient direction fluctuation degree; the product mean of the negative correlation mapping result of all direction effective pixel points and the first standard degree is obtained by negative correlation mapping of the gradient direction fluctuation degree, as the direction standard degree of the bottle mouth potential area; therefore, the correlation between the gradient direction fluctuation degree, the difference between the first included angle and the right angle and the direction standard degree is constructed based on the above basic mathematical operation, that is, the greater the gradient direction fluctuation degree, the greater the difference between the first included angle and the right angle, the more uneven the direction distribution and the more deviated from the normal perpendicular relationship with the standard direction, and the smaller the direction standard degree.
[0088] Preferably, in one embodiment of the present application, the method for obtaining the bottle mouth size regularity degree comprises:
[0089] The curve of coordinate fitting of all direction effective pixel points is obtained, the minimum circumscribed circle of the curve is constructed, and the radius difference between the radius of the minimum circumscribed circle and the theoretical pixel equivalent radius is obtained;
[0090] The ratio of the radius difference and the maximum value of the radius is obtained and negatively correlated, as the bottle mouth size regularity degree.
[0091] It should be noted that the difference between the ratio of the positive integer 1 and the radius difference and the maximum value of the radius is calculated, that is, the ratio of the radius difference and the maximum value of the radius is negatively correlated, the greater the ratio of the radius difference and the maximum value of the radius, the smaller the bottle mouth size regularity degree.
[0092] It should be noted that in the embodiments of the present application, the coordinate fitting of all direction effective pixel points can be performed by least square method or polynomial fitting method; the method for obtaining the theoretical pixel equivalent radius is to convert the radius of the bottle mouth into the radius size after the pixel unit, that is, the ratio between the size of the radius and the pixel calibration size, and the specific means is the technical means familiar to those skilled in the art, which is not described here.
[0093] It should be noted that the minimum circumscribed circle of the curve of coordinate fitting of all direction effective pixel points can reflect the bottle mouth range fitted by the direction effective pixel points, the greater the radius difference between the radius of the minimum circumscribed circle and the theoretical pixel equivalent radius, the more the actual bottle mouth radius deviates from the theoretical condition, and the smaller the size regularity degree.
[0094] By combining the direction standard degree of the potential area of the bottle mouth and the size regularity of the bottle mouth, the standard performance of the potential area is more comprehensively reflected, and the larger the obtained result is, the greater the standard is; according to the direction standard degree of the potential area of the bottle mouth and the size regularity of the bottle mouth, the structural standard of the potential area of the bottle mouth is obtained.
[0095] Preferably, in an embodiment of the present application, the method for obtaining the structural standard comprises:
[0096] The product of the direction standard degree of the potential area of the bottle mouth and the size regularity of the bottle mouth is obtained as the structural standard.
[0097] Step S4: positioning the bottle mouth area according to the structural standard of the potential area of the bottle mouth.
[0098] In another embodiment of the present application, the positioning of the bottle mouth area according to the obtained structural standard of the potential area of the bottle mouth comprises: if the structural standard is greater than a preset first standard threshold, the potential area of the bottle mouth is maintained for normal filling; if the structural standard is greater than a preset second standard threshold and less than or equal to the preset first standard threshold, the model analysis of the potential area of the bottle mouth deviates from the standard, and the potential area of the bottle mouth needs to be proportionally enlarged based on the center of the potential area of the bottle mouth as a reference point to obtain a new potential area of the bottle mouth for structural standard analysis until the structural standard is greater than the preset first standard threshold, and the positioning is completed; if the structural standard is less than the preset standard threshold, the greater the deviation of the structure is, the more the equipment needs to be suspended for inspection; wherein the preset first standard threshold is greater than the preset second standard threshold.
[0099] In an embodiment of the present application, the size of the first standard threshold is 0.9, and the size of the second standard threshold is 0.7; in other embodiments of the present application, the sizes of the preset first standard threshold and the second standard threshold can be set according to specific circumstances, which are not limited and described here.
[0100] Therefore, the bottle body position offset caused by unstable clamps can be automatically adapted, the problem of failure of traditional fixed potential area of the bottle mouth is avoided, and the accuracy of bottle mouth positioning of the filling production line is improved.
[0101] In summary, according to the gray scale, color and gradient feature distribution of different pixel points in the bottle mouth potential area, the local roughness of each pixel point in the bottle mouth potential area is obtained; according to the morphological feature of the bottle mouth potential area and the local roughness of each pixel point, the dynamic neighborhood radius of each pixel point in the bottle mouth potential area is obtained; according to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points, the direction effective pixel points are screened out; according to the gradient direction and position distribution of the direction effective pixel points in the bottle mouth potential area, the structure standard of the bottle mouth potential area is obtained; and the bottle mouth area is positioned. The structure standard of the bottle mouth potential area is accurately analyzed, and the accuracy of the bottle mouth positioning is improved.
[0102] Based on the same application concept as the automatic filling production line bottle mouth positioning method based on an industrial camera provided in the embodiments of the present application, the embodiments also provide an automatic filling production line bottle mouth positioning device based on an industrial camera, as shown in Figure 4 The device comprises an image acquisition module 401, a radius dynamic adjustment module 402, a structure standard analysis module 403 and a bottle mouth positioning module 404.
[0103] The image acquisition module 401 acquires an overhead image of a bottle to be filled, and the overhead image comprises a bottle mouth potential area.
[0104] The radius dynamic adjustment module 402 obtains the local roughness of each pixel point in the bottle mouth potential area according to the gray scale, color and gradient feature distribution of different pixel points in the bottle mouth potential area; and obtains the dynamic neighborhood radius of each pixel point in the bottle mouth potential area according to the morphological feature of the bottle mouth potential area and the local roughness of each pixel point.
[0105] The structure standard analysis module 403 screens out direction effective pixel points according to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points; obtains the direction standard degree and the bottle mouth size regularity of the bottle mouth potential area according to the gradient direction and position distribution of the direction effective pixel points in the bottle mouth potential area; and obtains the structure standard of the bottle mouth potential area according to the direction standard degree and the bottle mouth size regularity of the bottle mouth potential area.
[0106] The bottle mouth positioning module 404 positions the bottle mouth area according to the structure standard of the bottle mouth potential area.
[0107] It should be understood that the automatic filling production line bottle mouth positioning device based on an industrial camera provided in the embodiments is used to execute the above-mentioned bladder pressure information monitoring method, and therefore has the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0108] The application further provides an industrial camera-based automatic filling production line bottle mouth positioning system, which stores programs or instructions, and the programs or instructions are executed by a processor to realize the steps of the above-mentioned industrial camera-based automatic filling production line bottle mouth positioning method.
[0109] It should be noted that the above-mentioned embodiment sequence is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0110] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment mainly explains the difference from other embodiments.
Claims
1. An industrial camera based automatic filling line mouth positioning method, characterized in that, The method comprises: acquiring a top view image of a bottle mouth to be filled, the top view image containing a potential bottle mouth region; obtaining a local roughness of each pixel point in the potential bottle mouth region according to the gray scale, color and gradient feature distribution of different pixel points in the potential bottle mouth region; obtaining a dynamic neighborhood radius of each pixel point in the potential bottle mouth region according to the morphological feature of the potential bottle mouth region and the local roughness of each pixel point; screening out directional effective pixel points according to the gradient direction change of pixel points within the dynamic neighborhood radius range of different pixel points; obtaining a direction standard degree of the potential bottle mouth region and a bottle mouth size regularity according to the gradient direction and position distribution of the directional effective pixel points in the potential bottle mouth region; and obtaining a structure standard of the potential bottle mouth region according to the direction standard degree and the bottle mouth size regularity of the potential bottle mouth region; positioning the bottle mouth region according to the structure standard of the potential bottle mouth region; the method for obtaining the directional effective pixel points comprises: obtaining a standard normal direction of a bottle mouth CAD model; and obtaining an included angle between the gradient direction of each pixel point and the standard normal direction as a first included angle; obtaining a directional confidence weight of each pixel point according to the gradient direction fluctuation degree of all pixel points within the dynamic neighborhood radius range of each pixel point, the local roughness and the difference between the first included angle and a right angle corresponding to each pixel point, wherein the gradient direction fluctuation degree, the local roughness and the difference between the first included angle and the right angle are negatively correlated with the directional confidence weight; if the directional confidence weight of a pixel point is greater than a preset confidence threshold, the corresponding pixel point is taken as a directional effective pixel point; the method for obtaining the direction standard degree comprises: obtaining the direction standard degree according to the gradient direction fluctuation degree of all directional effective pixel points within the local range of different directional effective pixel points and the difference between the first included angle and a right angle corresponding to each directional effective pixel point, wherein the gradient direction fluctuation degree and the difference between the first included angle and the right angle are negatively correlated with the direction standard degree; the method for obtaining the bottle mouth size regularity comprises: obtaining a curve for coordinate fitting of all directional effective pixel points, constructing a minimum circumscribed circle of the curve, obtaining a radius difference between the radius of the minimum circumscribed circle and a theoretical pixel equivalent radius; obtaining a ratio of the maximum value of the radius difference and the radius and performing negative correlation mapping, as the bottle mouth size regularity; the method for obtaining the structure standard comprises: obtaining a product of the direction standard degree and the bottle mouth size regularity of the potential bottle mouth region as the structure standard. the method for obtaining the local roughness comprises:
2. The method of claim 1, wherein, obtaining a bottle mouth texture complexity of the potential bottle mouth region according to the gray scale and color distribution of the pixel points in the potential bottle mouth region; for the potential bottle mouth region, if the gray scale value of a pixel point is less than a preset saturation threshold, the corresponding pixel point is taken as an unsaturated pixel point; obtaining a gray scale fluctuation degree of all unsaturated pixel points within the neighborhood range of each pixel point; and selecting a preset quantile of the corresponding gray scale fluctuation degree among all pixel points as a texture roughness of the potential bottle mouth region. According to the difference between the gradient amplitude of each pixel point and other pixel points in the neighborhood range, the texture complexity of the bottle mouth and the texture roughness, the local roughness of each pixel point is obtained, and the difference in gradient amplitude, the texture complexity of the bottle mouth and the texture roughness are positively correlated with the local roughness.
3. The method of claim 2, wherein, The method for obtaining the bottle mouth texture complexity comprises: For the bottle mouth potential area, the average gray level of all pixel points is obtained as the average gray level; According to the gray difference between the gray value of all unsaturated pixel points and the average gray level, the number of all pixel points in the bottle mouth potential area and the hue component fluctuation degree of different pixel points in the HSV space, the bottle mouth texture complexity of the bottle mouth potential area is obtained, and the gray difference and the hue component fluctuation degree are positively correlated with the bottle mouth texture complexity, and the number of pixel points is negatively correlated with the bottle mouth texture complexity.
4. The method of claim 1, wherein, The method for obtaining the dynamic neighborhood radius comprises: The ratio of the number of edge pixel points of the bottle mouth potential area to the number of all pixel points is obtained, and the product of the ratio and the pixel calibration size is calculated as the minimum radius protection value; The local roughness of each pixel point in the bottle mouth potential area is normalized, and the minimum radius protection value is gain-adjusted according to the normalization result to obtain the dynamic neighborhood radius of each pixel point.
5. An industrial camera based automatic filling line mouth positioning device, characterized in that, It comprises an image acquisition module, a radius dynamic adjustment module, a structure standardization analysis module and a bottle mouth positioning module: The image acquisition module: obtains the overhead image of the bottle mouth to be filled, and the overhead image contains the bottle mouth potential area; The radius dynamic adjustment module: according to the gray, color and gradient feature distribution of different pixel points in the bottle mouth potential area, the local roughness of each pixel point in the bottle mouth potential area is obtained; according to the morphological characteristics of the bottle mouth potential area and the local roughness of each pixel point, the dynamic neighborhood radius of each pixel point in the bottle mouth potential area is obtained; The structure standardization analysis module: according to the gradient direction change of the pixel points in the dynamic neighborhood radius range of different pixel points, the direction effective pixel points are screened out; according to the gradient direction and position distribution of the direction effective pixel points in the bottle mouth potential area, the direction standard degree of the bottle mouth potential area and the bottle mouth size regularity are obtained; according to the direction standard degree of the bottle mouth potential area and the bottle mouth size regularity, the structure standardization of the bottle mouth potential area is obtained; The method for obtaining the direction effective pixel point comprises: The standard normal direction of the bottle mouth CAD model is obtained; the included angle between the gradient direction of each pixel point and the standard normal direction is taken as the first included angle; According to the gradient direction fluctuation degree of all pixel points in the dynamic neighborhood radius range of each pixel point, the local roughness and the difference between the first included angle and the right angle corresponding to each pixel point, the direction confidence weight of each pixel point is obtained, and the gradient direction fluctuation degree, the local roughness and the difference between the first included angle and the right angle are negatively correlated with the direction confidence weight; If the direction confidence weight of the pixel point is greater than the preset confidence threshold, the corresponding pixel point is taken as the direction effective pixel point; The method for obtaining the direction standard degree comprises: According to the gradient direction fluctuation degree of all direction effective pixel points in the local range of the different direction effective pixel points, and the difference between the first angle and the right angle corresponding to each direction effective pixel point, a direction standard degree is obtained, and the gradient direction fluctuation degree and the difference between the first angle and the right angle are negatively correlated with the direction standard degree; The method for obtaining the neck size regularity comprises: A curve for coordinate fitting of all direction effective pixel points is obtained, a minimum outer circle of the curve is constructed, and a radius difference between a radius of the minimum outer circle and a theoretical pixel equivalent radius is obtained; A ratio of the radius difference and a maximum value of the radius is obtained, and is negatively correlated and mapped, as the neck size regularity; The method for obtaining the structure standard comprises: A product of the direction standard degree of the neck potential region and the neck size regularity is obtained, as the structure standard; The neck positioning module: according to the structure standard of the neck potential region, the neck region is positioned.
6. An industrial camera based automatic filling line mouth positioning system, characterized in that, The system stores programs or instructions, and the programs or instructions are executed by the processor to realize the steps of the automatic filling production line neck positioning method based on the industrial camera according to any one of claims 1-4.
Citation Information
Patent Citations
On-line PE bottle identification and positioning method based on machine vision
CN106875441A
AU2594288A