Packaging can lid detection method based on image processing
By dividing the annular area and analyzing the degree of deformation of the grayscale image of the aluminum foil cover of the packaging can, the problem of low reliability of sealing detection in the prior art is solved, and accurate detection of micro air leakage points is achieved, and the reliability of detection is improved. sex.
Patent Information
- Application Number
- CN202411854337.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-17
AI Technical Summary
In the prior art, the reliability of the sealing detection of packaging cans is low, especially when the air leakage position is small or located at the edge of the packaging or at the joints of the aluminum foil cover, it is difficult to accurately identify the tiny air leakage points.
By obtaining the grayscale image of the aluminum foil cover on the packaging can and dividing it into multiple annular areas, counting the number of pixel points with a degree of deformation greater than the threshold in each annular area, combining the first, second and second levels of pixel points and the first, second levels of pixel points and the first and second levels of pixel points. Third, analyze grayscale fluctuations, texture differences and deformation coefficients, and determine whether the packaging can needs to be resealed.
The air leakage detection of the aluminum foil cover on the packaging can is more refined and accurate, and can effectively identify the tiny air leakage points and improve the reliability of seal detection.
Smart Images

Figure CN119313666B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and more specifically, to a packaging can lid detection method based on image processing. Background Art
[0002] After the can is filled with milk powder, an aluminum foil cover is usually placed on the mouth of the can to prevent the milk powder in the can from coming into contact with the air, ensuring its sealing and moisture-proof properties.
[0003] However, during the production process, due to various reasons, the aluminum foil seals in some packaging cans were not tight, causing the seals of the packaging cans to fail and leak, seriously affecting the quality and shelf life of the milk powder.
[0004] Therefore, after the aluminum foil cover is fastened, the packaging can needs to be tested for sealing. In the prior art, a negative pressure detector is usually used for sealing testing, specifically by detecting the pressure difference between the inside and outside of the aluminum foil cover of the packaging can to judge the sealing. However, if the leak is small or located at the edge of the package or the seam of the aluminum foil cover, the negative pressure detector may not be able to accurately identify these tiny leaks.
[0005] Based on the problems of low accuracy and low reliability of the above-mentioned sealing detection, the technology of using image processing to detect the sealing of packaging cans has emerged. In the related technology, such as the patent application document with application publication number CN117557526A, named A method, system and device for detecting the sealing of aluminum foil seals, it discloses that by obtaining the template image and target image of the aluminum foil seal thermal imaging, and calculating the roundness value and defect pixel ratio value of the aluminum foil seal of the target image, and calculating the similarity value between the target image and the template image after preprocessing; by judging the size of the roundness value, ratio value and similarity value with the corresponding threshold value, it is determined whether the aluminum foil seal is qualified.
[0006] Although the above scheme can perform sealing detection, when the air leakage at the seal is small, it is difficult to perform accurate detection through the overall roundness value; at the same time, since the aluminum foil seal will inevitably deform during sealing, and due to the differences in the can bodies of the packaging cans, the deformation of the aluminum foil seal caused by different can bodies during sealing may also be completely different. Therefore, measurement through similarity values may result in inaccurate detection. Summary of the invention
[0007] The purpose of the present invention is to propose a packaging can lid detection method based on image processing to solve the problem of low reliability of sealing detection of packaging cans in the prior art.
[0008] The packaging can lid detection method based on image processing provided by the present invention comprises:
[0009] Acquire a grayscale image of the surface image of the aluminum foil cover on the packaging can at the end of the sealing detection;
[0010] The grayscale image is divided into a plurality of annular regions; the number of pixel points in each annular region when the deformation degree is greater than a threshold is counted, and whether the packaging can needs to be resealed is determined based on the number; the deformation degree is positively correlated with the first degree, the second degree and the third degree; the first degree for: ; For the In the annular area The angle between the line connecting the pixel point and the center point of the grayscale image and the horizontal rightward direction with the center point as the origin, For the The mean angle of all pixels in the annular area, is the radius of the aluminum foil cover, For the The outer radius of the annular region, For the In the annular area The grayscale fluctuation of pixels, is an exponential function;
[0011] The second degree is positively correlated with the variance and the fitting slope. The fitting slope is obtained by fitting each pixel point with all the corresponding pixel points with the same angle, and the variance is obtained by fitting each pixel point with the pixel points with the same angle in the adjacent annular area. The pixel points with the same angle are on a straight line with the corresponding pixel points. The third degree is positively correlated with the texture difference and the deformation coefficient. The texture difference is the difference between the texture of each pixel point in the grayscale image and the texture of the corresponding pixel point in the original image of the aluminum foil cover before buckling. The deformation coefficient characterizes the deformation of the aluminum foil cover after buckling after being subjected to force.
[0012] In the above scheme, the first degree and the second degree of the pixel points are obtained respectively by combining the change of the grayscale value of the pixel points with the same distance from the center point and the change of the grayscale value of the pixel points with the same orientation relative to the center point, and taking into account the deformation of the aluminum foil cover itself due to the influence of external force when the cover is closed, the third degree of each pixel point is obtained by combining the deformation degree of the corresponding texture; the total deformation degree of each pixel point is obtained comprehensively, and the pixel points belonging to the unsealed area are further judged, thereby realizing accurate detection of whether there are tiny air leaks in the closed cover of the packaging can.
[0013] Optionally, the annular area is obtained by dividing the grayscale image using a midpoint circle algorithm.
[0014] The above solution can perform more refined division of the grayscale image.
[0015] Optionally, the deformation degree for: ;
[0016] in, are the first degree, second degree, and third degree of the b-th pixel, respectively. Represents the normalization function.
[0017] Optionally, the second degree for: ; It is The variance corresponding to the pixel point, , is the weight, It is In the annular area The fitting slope corresponding to the pixel point, is the inverse tangent function.
[0018] Optionally, the third degree for: ; is the deformation coefficient of the b-th pixel in the grayscale image, Respectively Texture length of pixel in original image and grayscale image, Represents the normalization function.
[0019] Optionally, the deformation coefficient for: ;
[0020] in, It is the pressure applied by the inner packaging machine when the lid is closed. The grayscale image The distance between the pixel and the center point, is the radius of the foil cover, is the bending stiffness of the foil cover, , t is the thickness, is the elastic modulus, is Poisson's ratio.
[0021] Optionally, the grayscale fluctuation changes for:
[0022] ;
[0023] in, For the In the annular area The gray value of the pixel, , Respectively The annular area and The pixel adjacent to Pixel, The gray value of the pixel, , Respectively The first quartile and the third quartile of the grayscale value of the pixel points in the annular area, Represents the normalization function.
[0024] In the above scheme, the fluctuation of the current pixel is determined by obtaining the difference in the grayscale value between the pixel in the annular area and other pixels.
[0025] Optionally, before calculating the deformation degree of each pixel point in each annular area, the pixel points in each annular area are screened to obtain the target pixel point, specifically, the step of:
[0026] When the grayscale value of any pixel point in each annular area is smaller than the grayscale values of the pixels on both sides thereof, the pixel point is taken as the target pixel point.
[0027] In the above scheme, by screening out target pixels, the amount of calculation can be reduced and the detection efficiency can be improved.
[0028] Optionally, the process of determining whether the packaging can needs to be resealed based on the number is:
[0029] Calculating the ratio of the number to the total number of pixels in the grayscale image;
[0030] In response to the ratio being greater than a set value, it is considered that the packaging can lid corresponding to the grayscale image needs to be resealed.
[0031] In the above scheme, by obtaining the number of deformation degrees and judging whether there is a leak based on the number, misjudgment can be avoided.
[0032] Optionally, the fitting slope is obtained by using a least squares method.
[0033] The beneficial effects of the present invention are:
[0034] The scheme of the present invention can accurately detect air leakage of the aluminum foil cover on the packaging can by analyzing the grayscale fluctuation of the pixel points in the same annular area, the change trend of the grayscale value in different annular areas, and the deformation of the aluminum foil cover before and after the cover is buckled. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0036] Figure 1 The flowchart schematically shows the steps of the packaging can lid detection method based on image processing in this embodiment;
[0037] Figure 2 The flowchart schematically shows the steps of obtaining the degree of deformation in the packaging can lid detection method based on image processing in this embodiment. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0039] The scenario targeted by the present invention is the packaging process of canned milk powder. The inner packaging machine is responsible for filling the milk powder into the packaging can and fastening the aluminum foil cover to ensure the sealing and moisture-proof effect. The outer packaging machine is responsible for external packaging of the packaging cans that have passed the sealing test, including automatic sorting, boxing and sealing, to complete the final packaging process.
[0040] Among them, after putting on the aluminum foil cover, a sealing test is required to ensure the sealing of the packaging can.
[0041] like Figure 1 As shown, the packaging can lid detection method based on image processing in this embodiment includes the following steps:
[0042] Step S1, obtaining a grayscale image of an initial image of the aluminum foil cover on the packaging can at the end of the sealing detection.
[0043] In this embodiment, after the packaging can is filled, the aluminum foil cover is buckled on the top of the packaging can by the inner packaging machine, and then each packaging can is inspected by the sealing detection device, and the surface image of the top of each packaging can after inspection is taken, and preprocessed to obtain an initial image.
[0044] The above surface image is a front image of the aluminum foil cover. Since the metal surface of the aluminum foil cover is prone to strong reflection when exposed to light, this will cause a highlight area to appear in the image, affecting the image quality and the accuracy of subsequent analysis. Frontal shooting can reduce the impact of reflected light and obtain a clearer image.
[0045] The above-mentioned preprocessing steps include threshold segmentation, median filtering, histogram equalization, grayscale processing, etc. on the front image.
[0046] Among them, the threshold segmentation technology is used to remove the complex background in the surface image, the median filtering algorithm is used to remove the noise in the surface image, and the histogram equalization algorithm is used to improve the brightness and contrast of the image, making the texture of the aluminum foil cover clearer and converting it into a grayscale image.
[0047] Among them, the threshold segmentation technology, the median filtering algorithm, the histogram equalization algorithm and the grayscale conversion are all existing technologies and will not be described in detail here.
[0048] The above preprocessing is because factors such as light changes, equipment vibrations, and camera heating in the production environment may introduce noise, so the captured surface images need to be preprocessed.
[0049] Step S2, dividing the grayscale image into a plurality of annular regions, and calculating the deformation degree of the pixel points in each annular region.
[0050] In order to more comprehensively and accurately determine the deformation of the aluminum foil cover in this embodiment, the grayscale image is first divided into annular areas, and then analyzed from three angles to obtain the deformation degree of the grayscale image of the aluminum foil cover when the sealing detection is completed.
[0051] In one embodiment, the annular region is obtained by a midpoint circle algorithm. Specifically, when the size of the grayscale image is When , the center coordinate of the aluminum foil cover of the corresponding packaging can is ( ),in, , .by Starting from the center and gradually expanding, the midpoint circle algorithm is used to obtain all the annular areas in the area of the aluminum foil cover, and then the outer radius of all the annular areas is obtained.
[0052] Specifically, the steps of obtaining the annular area using the midpoint circle algorithm are:
[0053] First, The center is r, the initial radius is r, the starting point is (0, r), and the end point is ( ). Among them, the initial radius r is less than or equal to min( , ), w and h are the width and height of the grayscale image respectively.
[0054] Construct the discriminant function: ; Select any point M in the grayscale image , and M is at the midpoint between p1 and p2 (the three points here are points in the column direction, p1 is above M), when , then M is on the circle, and we select any point between p1 and p2 as the next point. , indicating that the point is outside the circle, then p2 is selected as the next point. , indicating that the point is inside the circle, select p1 as the next point;
[0055] According to the above discriminant function, the judgment is circulated, and one-eighth of the circle is generated clockwise, and all the circles are drawn by symmetry; then, the above steps are repeated to increase the radius r according to the set value and generate circles of different radii, and then generate a series of concentric circles to form a ring area. The set value is 1, that is, each time the initial radius r is increased by 1 until the end point is reached.
[0056] Since the midpoint circle algorithm belongs to the prior art, the specific process will not be described here.
[0057] It should be noted that each annular area obtained by the midpoint circle algorithm has only one layer of pixels, and at this time, there is only one pixel in the direction radiating outward from the center point. At the same time, using the midpoint circle algorithm to divide the annular area can perform a more refined pixel analysis.
[0058] In another embodiment, the annular area may be further divided according to a set radius interval. When the set radius interval is larger, there may be multiple layers of pixels in an annular area, that is, there may be multiple pixels in the direction radiating outward from the center point.
[0059] In this embodiment, the process of obtaining the deformation degree includes steps S21 to S24. Figure 2 As shown, specifically:
[0060] Step S21, obtaining a first degree.
[0061] In this embodiment, it is taken into consideration that the leakage point is at the edge of the aluminum foil cover. If there is a leakage point, the concave and the smaller grayscale value caused by the leakage will affect the change of the grayscale value of the pixel points in this annular area. The closer the leakage point and the center point are on the same straight line, the smaller the grayscale value is relative to the surrounding pixels. Therefore, it is necessary to analyze the grayscale fluctuations of the pixels in each annular area to determine the first degree of each pixel point.
[0062] Specifically, the first degree acquisition process in this embodiment is:
[0063] First, the grayscale fluctuation of each pixel in each annular area is calculated.
[0064] In this embodiment, the first quartile and the third quartile in the annular area where each pixel point is located are firstly obtained; and then the grayscale fluctuation of the pixel point is calculated.
[0065] Among them, taking the b-th pixel as an example, the grayscale fluctuation for:
[0066] ;
[0067] in, For the In the annular area The gray value of the pixel, , Respectively The annular area and The adjacent pixels Pixel, The gray value of the pixel, , Respectively The first quartile and the third quartile of the grayscale value of the pixel points in the annular area, Represents the normalization function.
[0068] , Respectively represent Gray value of pixel With Pixel, Gray value of pixel , The absolute value of the difference. , Respectively represent Gray value of pixel With The third quartile of all grayscale values in the annular area , first quartile The absolute value of the difference between .
[0069] The above normalization function can use maximum and minimum normalization.
[0070] when , , The larger the value of The smaller the value of The pixel belongs to The greater the probability of the analyzed pixel points in the annular area, the greater the probability of the analyzed pixel points in the annular area. The pixel belongs to The probability of a pixel with a local minimum gray value in the annular area is greater, and vice versa.
[0071] The first quartile and the third quartile are obtained by obtaining the grayscale values of all pixels in the annular area, sorting them from small to large, selecting the 25% value in the sorting as the first quartile, and selecting the 75% value in the sorting as the third quartile.
[0072] The above quartiles are selected because the tinfoil cover has a regular texture, resulting in dark areas and bright areas. Therefore, the first quartile and the third quartile are selected to represent the boundary between the backlight area and the bright light area.
[0073] Secondly, the angles of the pixels in each annular area are obtained.
[0074] In this embodiment, the grayscale image is the center point, and the horizontal right direction is The positive direction of the axis is vertical upward. The positive direction of the axis constructs a rectangular coordinate system.
[0075] In this embodiment, based on the constructed rectangular coordinate system, the line connecting each pixel point and the center point in each annular area can be determined. The angle in the positive direction of the axis.
[0076] Then, based on the grayscale fluctuation of the pixel point, the angle, and the outer radius of the annular area, the first degree of the corresponding pixel point is determined.
[0077] First Degree for: ; For the In the annular area The line connecting the pixel point and the center point of the grayscale image is the horizontal right direction with the center point as the origin ( The angle between the positive direction of the axis and For the The mean angle of all pixels in the annular area, is the radius of the aluminum foil cover, For the The outer radius of the annular region, For the In the annular area The grayscale fluctuation of pixels, is an exponential function.
[0078] When the difference as well as The larger the In the annular area The larger the first degree of the pixel.
[0079] Step S22, obtaining the second degree of each pixel.
[0080] In this embodiment, it is taken into consideration that under normal circumstances, the grayscale value changes of pixels in different annular areas in the same direction are small; when the edge is concave, the grayscale value changes of pixels in the same direction are generally large. Therefore, it is also necessary to analyze the changes of pixels in the annular area where the pixel is located and the annular area adjacent to it.
[0081] Specifically, in the first annular region, Taking pixel points as an example for analysis, the second-level acquisition process is:
[0082] First, all pixels with the same angle as the b-th pixel are obtained, and the grayscale values of the b-th pixel and all pixels with the same angle are fitted to obtain the fitting slope of the fitting curve.
[0083] The pixels with the same angle in this embodiment are located in the extension direction of the line connecting the center point and the b-th pixel point.
[0084] The fitting slope in this embodiment is obtained by adopting the least square method.
[0085] The purpose of calculating the fitting slope above is that, since the poor sealing performance of the aluminum foil cover starts from the poor sealing at the edge and gradually affects the central area of the aluminum foil cover, the overall situation should be given priority when considering the gradual change of the grayscale values of pixels in multiple annular areas.
[0086] Secondly, calculate the variance between the bth pixel and its two adjacent pixels with the same angle.
[0087] The two adjacent pixels with the same angle are located at the position of the bth pixel. The annular area is located in two other adjacent annular areas.
[0088] Among them, when the annular area is the smallest or largest annular area, its adjacent annular area can be selected from two annular areas with a relatively close distance (such as two consecutive adjacent annular areas); when the annular area is located in the middle, the annular area has two other adjacent annular areas, and there are two pixels with the same angle in the other adjacent annular areas. For example, The pixel is located at The adjacent annular areas are: The annular area and Annular area.
[0089] Then, the second degree of each pixel is calculated according to the variance and the fitting slope.
[0090] Taking the bth pixel as an example, the second degree for: ; It is The variance corresponding to the pixel point, , is the weight, It is In the annular area The fitting slope corresponding to the pixel point, is the inverse tangent function.
[0091] The value of can reflect the local fluctuation degree of the grayscale value between the pixels with the same angle in the two annular areas adjacent to the annular area where the b-th pixel is located. Can reflect the first annular area The overall gray value change trend between a pixel and all pixels with the same angle in its annular area.
[0092] The above weights are In this embodiment, the weight of the fitting slope is taken as a larger value, while the weight of the variance is taken as a smaller value. The reason is that when considering the gradual change of the grayscale values of the pixel points in multiple annular areas, the overall priority is high. Therefore, the weight of the fitting slope will be larger.
[0093] Above Used for normalization.
[0094] The above variance is used to describe the fluctuation degree of grayscale values between pixels. The larger the variance value, the greater the fluctuation degree. At the same time, if the fitting slope is less than 0 and becomes smaller and smaller, it means that starting from the center point, the grayscale values of the pixels at the same angle to the b-th pixel point traversed are generally decreasing, reflecting that the possibility that the b-th pixel point is in the deformation area is greater at this time.
[0095] Step S23, obtaining the third degree.
[0096] Among them, the third degree is positively correlated with the texture difference of each pixel point and the deformation coefficient of the aluminum foil cover when the cover is buckled. The texture difference is the difference between the texture of each pixel point in the grayscale image and the texture of the corresponding pixel point in the image of the aluminum foil cover without buckling.
[0097] The deformation coefficient of the aluminum foil cover when buckling the cover is: ;
[0098] in, The grayscale image The deformation coefficient of the pixel reflects the The amount of depression at the pixel location, that is, the amount of vertical deformation, It is the pressure applied by the inner packaging machine when the lid is closed. The grayscale image The distance between the pixel and the center point, is the radius of the foil cover, is the bending stiffness of the foil cover, , t is the thickness, is the elastic modulus, is Poisson's ratio.
[0099] Third degree for: ; is the deformation coefficient of the b-th pixel in the grayscale image, Respectively Texture length of pixel in original image and grayscale image, Represents the normalization function.
[0100] The above texture length is The number of edge pixels in the original image or grayscale image; the edge pixels are calculated by the Canny operator. The image where the pixel is located is obtained by edge detection.
[0101] Among the above It is The difference in texture length between the pixel points in the original image and the grayscale image. When the deformation coefficient is larger, the difference in texture length is larger. The greater the deformation of the pixel, the more likely it is that the concave is caused by a loose seal.
[0102] In this embodiment, an original image of the aluminum foil cover before it is buckled is obtained and used as a template image to compare with a grayscale image during a subsequent seal inspection after the cover is buckled, so as to obtain corresponding texture areas of the aluminum foil cover before and after the cover is buckled.
[0103] It should be noted that, under normal circumstances, when the inner packaging machine fastens the aluminum foil cover in the packaging can, the compression deformation of the aluminum foil cover is symmetrical, that is, it gradually decreases from the center to the outside. At this time, the change of the pressure gauge is relatively small, and it is not easy to find small defects; if there is an unfastened part at the edge or center of the aluminum foil cover, this will cause irregular deformation of the local area, which may lead to edge warping or uneven depression in the center. Therefore, in this embodiment, it is necessary to determine the third degree of the aluminum foil cover by obtaining the deformation coefficient of each pixel point in the grayscale image under normal pressure and the deformation of the texture pixel points in the grayscale image during the sealing test.
[0104] Among them, the above-mentioned deformation coefficient is obtained by taking into account that the initial state of the aluminum foil cover before being fastened is usually flat, but when the inner packaging machine fastens the aluminum foil cover in the packaging can, the aluminum foil cover will be subjected to a certain pressure and produce a slight deformation; when the sealing detection is performed, the aluminum foil cover may further deform on the basis of the slight deformation, and the aluminum foil cover has an allowable basic deformation amount. When it is within the basic deformation amount, the aluminum foil cover is considered to be normal, and when it exceeds the basic deformation amount, it is considered that the shape of the aluminum foil cover is obviously deformed, and then there is a risk of air leakage in the packaging can; therefore, this embodiment combines the surface texture deformation of the aluminum foil cover and the deformation coefficient, which can further improve the accuracy of the sealing detection of the packaging can.
[0105] Step S24, obtaining the deformation degree of each pixel in the grayscale image based on the first degree, the second degree and the third degree.
[0106] In one embodiment, taking the cth pixel point in any annular region as an example, the deformation degree for: ;
[0107] in, are the first degree, second degree, and third degree of the c-th pixel, respectively. Represents the normalization function.
[0108] In another embodiment, the degree of deformation for: ;
[0109] in, are the first degree, second degree, and third degree of the c-th pixel, respectively. , , is the weight, Represents the normalization function.
[0110] Furthermore, in order to perform pixel analysis more specifically and reduce the amount of calculation, in this embodiment, the pixels in each annular area are screened to obtain target pixels, and then the deformation degree of the target pixels is analyzed.
[0111] Specifically, the screening condition is: when the grayscale value of any pixel in each annular area is less than the grayscale value of the pixels on both sides of it, the pixel is taken as the target pixel. and When the ath pixel is The target pixel in the annular area, where is the gray value of the a-th pixel, , Respectively Pixel, The grayscale value of the pixel.
[0112] Step S3, counting the number of pixel points when the deformation degree is greater than a threshold, and determining whether the packaging can is resealed based on the number.
[0113] The threshold value may be 0.6; of course, it may also be determined according to actual conditions.
[0114] The process of determining whether to reseal in this embodiment is:
[0115] Calculating the ratio of the number to the total number of pixels in the grayscale image;
[0116] In response to the ratio being greater than a set value, it is considered that the packaging can lid corresponding to the grayscale image needs to be resealed.
[0117] Specifically, the ratio for: ;
[0118] Where q is the number of pixels in the grayscale image that are greatly affected by poor sealing, and it is taken as the area of all regions in the grayscale image that are greatly affected by poor sealing; w is the total area of the grayscale image, w is the width of the image, is the height of the image.
[0119] When the ratio The larger the value, the greater the probability that the lid of the packaging can corresponding to the grayscale image is not fastened tightly and needs to be resealed.
[0120] The above setting value can be set to 0.3, that is, when When the grayscale image is viewed, it is considered that the aluminum foil cover of the packaging can corresponding to the grayscale image is not fastened tightly and needs to be resealed.
[0121] The scheme of the present invention can accurately detect air leakage of the aluminum foil cover on the packaging can by analyzing three aspects: the grayscale fluctuation of pixel points in the same annular area, the change trend of grayscale values in different annular areas, and the deformation of the aluminum foil cover before and after the cover is buckled.
[0122] In the description of this specification, “plurality” means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0123] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A packaging can lid detection method based on image processing, characterized in that: include: Acquire a grayscale image of the surface image of the aluminum foil cover on the packaging can at the end of the sealing detection; Divide the grayscale image into a plurality of annular regions; The number of pixels in each annular area when the deformation degree is greater than a threshold is counted, and whether the packaging can needs to be resealed is determined based on the number; the deformation degree is positively correlated with the first degree, the second degree and the third degree; the first degree for: ; For the In the annular area The angle between the line connecting the pixel point and the center point of the grayscale image and the horizontal rightward direction with the center point as the origin, For the The mean angle of all pixels in the annular area, is the radius of the aluminum foil cover, For the The outer radius of the annular region, For the In the annular area The grayscale fluctuation of pixels, is an exponential function; The second degree is positively correlated with the variance and the fitting slope. The fitting slope is obtained by fitting each pixel point and all corresponding pixels with the same angle. The variance is obtained by fitting each pixel point and the pixels with the same angle in the adjacent annular area. The pixels at the same angle are on a straight line with the corresponding pixels; the third degree is positively correlated with the texture difference and the deformation coefficient, the texture difference is the difference between the texture of each pixel in the grayscale image and the texture of the corresponding pixel in the original image of the aluminum foil cover before buckling; the deformation coefficient represents the deformation of the aluminum foil cover after buckling under force.
2. The packaging can lid detection method based on image processing according to claim 1 is characterized in that: The annular area is obtained by dividing the grayscale image using a midpoint circle algorithm.
3. The packaging can lid detection method based on image processing according to claim 2 is characterized in that: The degree of deformation for: ; in, are the first degree, second degree, and third degree of the b-th pixel, respectively. Represents the normalization function.
4. The packaging can lid detection method based on image processing according to claim 2 or 3, characterized in that: The second degree for: ; It is The variance corresponding to the pixel point, , is the weight, It is In the annular area The fitting slope corresponding to the pixel point, is the inverse tangent function.
5. The packaging can lid detection method based on image processing according to claim 2 is characterized in that: The third degree for: ; is the deformation coefficient of the aluminum foil cover when it is buckled. Respectively Texture length of pixel in original image and grayscale image, Represents the normalization function.
6. The packaging can lid detection method based on image processing according to claim 5 is characterized in that: The deformation coefficient for: ; in, It is the pressure applied by the inner packaging machine when the lid is closed. The grayscale image The distance between the pixel and the center point, is the radius of the foil cover, is the bending stiffness of the foil cover, , t is the thickness, is the elastic modulus, is Poisson's ratio.
7. The packaging can lid detection method based on image processing according to claim 2 is characterized in that: The grayscale fluctuation changes for: ; in, For the In the annular area The gray value of the pixel, , Respectively The annular area and The pixel adjacent to Pixel, The gray value of the pixel, , Respectively The first quartile and the third quartile of the grayscale value of the pixel points in the annular area, Represents the normalization function.
8. The packaging can lid detection method based on image processing according to claim 2 is characterized in that: Before calculating the deformation degree of each pixel point in each annular region, the pixel points in each annular region are screened to obtain the target pixel point, which is specifically as follows: When the grayscale value of any pixel point in each annular area is smaller than the grayscale values of the pixels on both sides thereof, the pixel point is taken as the target pixel point.
9. The packaging can lid detection method based on image processing according to claim 2 is characterized in that: The process of determining whether the packaging can needs to be resealed based on the number is as follows: Calculating the ratio of the number to the total number of pixels in the grayscale image; In response to the ratio being greater than a set value, it is considered that the packaging can lid corresponding to the grayscale image needs to be resealed.
10. The packaging can lid detection method based on image processing according to claim 2, characterized in that: The fitting slope is obtained by using the least squares method.
Citation Information
Patent Citations
Method, system and equipment for detecting sealing performance of aluminum foil seal
CN117557526A
Packaging machine defective product detection method based on machine vision
CN115272341A
Detection device, detection method and computer readable storage medium
CN116452585A