A method and system for visually detecting sealing defects of cartons

By identifying and calculating the overlapping area of ​​the carton tape area and its narrowing degree in the carton seal defect detection, combined with the defect weight factor, the problem of inaccurate detection in the prior art is solved, and higher detection accuracy is achieved.

CN118817696BActive Publication Date: 2025-02-25ZHANGJIAGANG JIAYANG PRECISION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411022962.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-02-25
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

When detecting carton seal defects, the prior art fails to effectively consider the overlapping and extrusion of corrugated cardboard, resulting in inaccurate detection results.

Method used

By obtaining the grayscale image of the carton tape surface, the carton tape area and its overlapping area are identified, the degree of narrowing and defects of the carton tape are calculated, and the defect degree is corrected in combination with the defect weight factor, and the degree of defects of the carton sealing defects are finally quantified.

Benefits of technology

The accuracy of carton seal defect detection is improved, and the overlapping extrusion areas between corrugated cardboard can be more effectively analyzed, thereby more accurately evaluating carton seal quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118817696B_ABST
    Figure CN118817696B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and in particular to a method and system for visually detecting sealing defects of a carton, comprising: obtaining a grayscale image of a carton tape surface; obtaining a carton tape area of ​​the grayscale image of the carton tape surface; obtaining an overlapping area in the carton tape area; obtaining a narrowing degree of the carton tape according to the overlapping area in the carton tape area; obtaining a carton defect degree according to the area of ​​the overlapping area and the narrowing degree of the carton tape; obtaining a carton defect weight factor according to the carton tape area; correcting the carton defect degree based on the carton defect weight factor to obtain a quantified value of the carton defect degree; and performing sealing defect detection on the carton according to the quantified value of the carton defect degree. The present invention improves the accuracy of the sealing defect detection result of the carton.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for visually detecting sealing defects of cartons. Background Art

[0002] With the popularity of online shopping, corrugated boxes are the most commonly used outer packaging for express delivery, protecting the express delivery on the outermost layer; ensuring the sealing quality of corrugated boxes can, to a certain extent, ensure that the express items in the box will not fall or be damaged due to road bumps, and can effectively protect the express items. Therefore, it is necessary to detect the sealing defects of the boxes. The existing methods for detecting sealing defects often use edge detection methods, which directly observe the spacing of the corrugated cardboard adhered by the tape to analyze whether there are sealing defects; because the overlapping and squeezing of the corrugated cardboard are not taken into account, the sealing defect detection results of the boxes are inaccurate. Summary of the invention

[0003] In order to solve the above problems, the present invention provides a method and system for visually detecting sealing defects of cartons.

[0004] An embodiment of the present invention provides a method for visually detecting sealing defects of a carton, the method comprising the following steps:

[0005] Get the grayscale image of the carton tape surface;

[0006] Get the carton tape area of ​​the grayscale image of the carton tape surface; get the overlapping area in the carton tape area;

[0007] According to the overlapping area in the carton tape area, the narrowing degree of the carton tape is obtained; according to the area of ​​the overlapping area and the narrowing degree of the carton tape, the degree of carton defect is obtained; according to the carton tape area, a carton defect weight factor is obtained; based on the carton defect weight factor, the degree of carton defect is corrected to obtain a quantitative value of the degree of carton defect;

[0008] Carton sealing defects are detected based on the quantitative values ​​of the carton defect levels.

[0009] Preferably, the method of obtaining the carton tape area of ​​the grayscale image of the carton tape surface includes:

[0010] The side length of the grayscale image of the carton tape surface is denoted as A; the Canny edge detection algorithm is used to perform edge detection on the grayscale image of the carton tape surface to obtain all edge curves in the grayscale image of the carton tape surface. For any edge curve, if the number of all edge pixels on the edge curve is greater than or equal to A, the edge curve is recorded as a target edge curve; for any target edge curve, the Euclidean distance between the central pixel point of the grayscale image of the carton tape surface and the target edge curve is recorded as the first distance of the target edge curve; the sequence after sorting all target edge curves from large to small according to the first distance is recorded as the target edge curve sequence; the area formed by the first target edge curve and the second target edge curve in the target edge curve sequence is taken as the carton tape area.

[0011] Preferably, the obtaining of the overlapping area in the carton tape area includes the following specific methods:

[0012] For any edge curve in the carton tape area, if the edge pixel points at the two end points of the edge curve are both located on the same short side edge line of the carton tape area, the edge curve is recorded as the reference edge curve; among all the reference edge curves, the reference edge curve with the largest number of pixels is recorded as the crack edge curve; the area formed by the crack edge curve and the short side edge line of the carton tape area is recorded as the crack triangle area; the opposite triangle area of ​​the crack triangle area is taken as the overlapping area in the carton tape area.

[0013] Preferably, the method of obtaining the narrowing degree of the carton tape according to the overlapping area in the carton tape area includes:

[0014] Use a horizontal straight line to intercept the overlapping area from the vertex with a step length of 1 until the edge of the overlapping area. The length of the straight line intercepted each time is recorded as the first straight line length. The inverse proportional value of the ratio of the maximum first straight line length to the minimum first straight line length is used as the degree of narrowing of the carton tape.

[0015] Preferably, the method of obtaining the degree of carton defects according to the area of ​​the overlapping region and the degree of narrowing of the carton tape comprises:

[0016] According to the crack edge curve, the separation degree of the carton cracks is obtained;

[0017] The product of the number of all pixels in the overlapping area of ​​the carton tape area, the degree of separation of the carton cracks and the degree of narrowing of the carton tape is taken as the degree of carton defect.

[0018] Preferably, the method of obtaining the separation degree of the carton cracks includes:

[0019] The Euclidean distance between the edge pixels at both ends of the crack edge curve is taken as the degree of separation of the carton cracks.

[0020] Preferably, the method of obtaining the carton defect weight factor according to the carton tape area includes:

[0021] The carton tape area is divided into two tape areas using the perpendicular midline of the grayscale image of the carton tape surface; and the absolute value of the difference in area between the two tape areas is used as a carton defect weight factor.

[0022] Preferably, the method of correcting the carton defect degree based on the carton defect weight factor to obtain the quantified value of the carton defect degree includes the following specific methods:

[0023] The normalized value of the sum of the carton defect weight factor and the carton defect degree is used as the quantified value of the carton defect degree.

[0024] Preferably, the method of performing sealing defect detection on the carton according to the quantified value of the carton defect degree includes:

[0025] A threshold parameter K is preset. If the quantitative value of the degree of carton defects is greater than or equal to the threshold parameter K, the sealed carton is recorded as an unqualified carton.

[0026] The present invention also proposes a system for visually detecting sealing defects of cartons, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the steps of a method for visually detecting sealing defects of a carton when executing the computer program.

[0027] The beneficial effects of the technical solution of the present invention are as follows: the present invention obtains the degree of carton defects according to the area of ​​the overlapping area and the degree of narrowing of the carton tape; obtains the carton defect weight factor according to the carton tape area; corrects the carton defect degree based on the carton defect weight factor to obtain a quantitative value of the carton defect degree; performs sealing defect detection on the carton according to the quantitative value of the carton defect degree; thereby analyzing the spacing between corrugated cardboards adhered by the tape, and further obtains the overlapping extrusion area between the corrugated cardboards, thereby improving the accuracy of the carton sealing defect detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 A flowchart of the steps of a method for visually detecting sealing defects of a carton according to the present invention;

[0030] Figure 2 The present invention provides a grayscale image of the carton tape surface for visual inspection of sealing defects of a carton. DETAILED DESCRIPTION

[0031] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the method and system for visual inspection of carton sealing defects proposed by the present invention, its specific implementation, structure, features and effects in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0032] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0033] The specific scheme of the method and system for visually detecting sealing defects of cartons provided by the present invention is described in detail below with reference to the accompanying drawings.

[0034] See also Figure 1 , which shows a flowchart of a method for visually detecting sealing defects of a carton provided by an embodiment of the present invention, the method comprising the following steps:

[0035] Step S001: Obtain a grayscale image of the carton tape surface.

[0036] It should be noted that, in this embodiment, a quality inspection is performed on the sealing condition of the carton after the carton is sealed by the automatic carton sealing machine to determine whether there are defects in the sealing of the carton.

[0037] Specifically, we first need to collect the grayscale image of the carton tape surface. The specific process is as follows:

[0038] The carton is sealed by an automatic carton sealing machine. After sealing, a high-definition camera is installed above the carton to shoot the side with the tape to obtain a carton tape surface image; the carton tape surface image is subjected to median filtering, denoising and grayscale operations to obtain a carton tape surface grayscale image. In this embodiment, the size of the obtained carton tape surface grayscale image is 800×800; median filtering and grayscale operations are prior arts, and this embodiment will not be described in detail here.

[0039] See also Figure 2 , which shows a grayscale image of the tape surface of a carton for visual inspection of sealing defects of a carton.

[0040] So far, the grayscale image of the carton tape surface is obtained through the above method.

[0041] Step S002: obtaining a carton tape region of the grayscale image of the carton tape surface; obtaining an overlapping region in the carton tape region.

[0042] It should be noted that the sealing operation is roughly divided into two steps. The first step is to fold the carton into a hexahedral shape, and the second step is to glue the two folded and merged carton boards with tape. In the first step, the two carton boards may not be aligned parallel to each other during the folding process, but partially overlap each other. In this way, the carton obtained by direct pasting often overlaps and squeezes together partly, and the other side has a gradually increasing gap due to the overlap, which will lead to unreliable pasting. In the second step, the pasting area distribution of the two carton boards may be uneven during the pasting process, with more pasting on one side and less pasting on the other side, resulting in uneven adhesion on both sides. And if pasted to the cardboard overlapped by the first step, the tape will not be firmly adhered and wrinkles will occur because it cannot completely fit the cardboard surface. Possible errors in the above two steps will cause the pasting area of ​​the carton to break open due to bumps during transportation, causing damage to the goods. The characteristic performance of the above problems can be combined to calculate and judge the degree of defects of the carton image. Therefore, it is necessary to determine the overlapping area in the carton tape area of ​​the grayscale image of the carton tape surface.

[0043] 1. Get the carton tape area of ​​the grayscale image of the carton tape surface.

[0044] It should be noted that, because the sealing operation is to merge the two cardboards on the carton and stick them together with tape, the tape area is from the upper edge of the carton in the grayscale image to the lower edge, and the length of the tape area should be equal to or even larger than the length of the vertical side of the carton; the tape area can be quickly located thereby.

[0045] Preferably, the side length of the grayscale image of the carton tape surface is denoted as A; the Canny edge detection algorithm is used to perform edge detection on the grayscale image of the carton tape surface to obtain all edge curves in the grayscale image of the carton tape surface; for any edge curve, if the number of all edge pixels on the edge curve is greater than or equal to A, the edge curve is recorded as the target edge curve; for any target edge curve, the Euclidean distance between the central pixel point of the grayscale image of the carton tape surface and the target edge curve is recorded as the first distance of the target edge curve; the sequence in which all target edge curves are sorted from large to small according to the first distance is recorded as the target edge curve sequence; the area formed by the first target edge curve and the second target edge curve in the target edge curve sequence is taken as the carton tape area.

[0046] It should be noted that the Canny edge detection algorithm is a prior art and will not be described in detail in this embodiment.

[0047] At this point, the carton tape area of ​​the grayscale image of the carton tape surface is obtained.

[0048] 2. Get the overlap area in the carton tape area.

[0049] It should be noted that if two carton boards are partially overlapped and squeezed during the folding process, the edge curves of the two carton boards that were originally parallel will cross. One part of the intersection appears as the overlapping and squeezing of the two corrugated cardboards, and the other part appears as a gradually increasing gap between the two corrugated cardboards. Based on this characteristic, the overlapping area in the carton tape area is obtained; since the gradually increasing gap is caused by the overlap of cardboards, in order to find the overlapping area, it is necessary to first find the gradually increasing crack triangular area; and the crack triangular area can be expressed as a "V" shaped edge curve.

[0050] Preferably, in some implementations of the embodiments of the present invention, the specific method for obtaining the overlapping area in the carton tape area is:

[0051] For any edge curve in the carton tape area, if the edge pixel points at the two end points of the edge curve are both located on the same short side edge line of the carton tape area, the edge curve is recorded as the reference edge curve; among all the reference edge curves, the reference edge curve with the largest number of pixels is recorded as the crack edge curve; the area formed by the crack edge curve and the short side edge line of the carton tape area is recorded as the crack triangle area; the opposite triangle area of ​​the crack triangle area is taken as the overlapping area in the carton tape area.

[0052] So far, the overlapping area in the carton tape area is obtained by the above method.

[0053] Step S003: According to the overlapping area in the carton tape area, obtain the degree of narrowing of the carton tape; according to the area of ​​the overlapping area and the degree of narrowing of the carton tape, obtain the degree of carton defect; according to the carton tape area, obtain the carton defect weight factor; based on the carton defect weight factor, correct the carton defect degree to obtain a quantitative value of the carton defect degree.

[0054] It should be noted that the carton sealing operation is roughly divided into two steps. The first step is to fold the carton into a hexahedron shape, and the second step is to stick the two folded carton boards together with tape. Possible errors in the above two steps will cause the carton to break due to bumps during transportation, causing damage to the goods in the pasting area. Therefore, the degree of carton defects can be corrected based on the carton tape area to obtain a quantitative value of the degree of carton defects.

[0055] 1. Get the degree of carton defects.

[0056] It should be noted that the two parallel edges of the cardboards are squeezed and overlapped during the folding process, resulting in an intersection between the two cardboard edges. One side of the intersection is the gradually increasing gap area obtained above, and the other side is the overlapping and squeezing area of ​​the cardboards. Due to the overlapping and squeezing, the area of ​​the overlapping area between the two cannot be seen, but due to the symmetry of the intersecting straight lines about the intersection, the area of ​​the overlapping area can be roughly calculated using the proportional relationship of the gap area. However, it is a bit one-sided to quantify the degree of defects caused by the overlap based only on the area of ​​the overlapping area. The influence of the overlapping area on the sticking of the tape can be further analyzed. When the tape is stuck to the overlapping area of ​​the cardboards, it may cause a part of the tape area to not stick to any physical object, resulting in the failure of the tape to be spread out flat and appearing to be narrowed.

[0057] Preferably, in some implementations of the embodiments of the present invention, the specific method for obtaining the degree of carton defects according to the overlapping area in the carton tape area is:

[0058] According to the crack edge curve, the separation degree of the carton cracks is obtained;

[0059] According to the overlapping area, the narrowing degree of the carton tape is obtained;

[0060] The product of the number of all pixels in the overlapping area of ​​the carton tape area, the degree of separation of the carton cracks and the degree of narrowing of the carton tape is taken as the degree of carton defect.

[0061] The specific formula is:

[0062] ,

[0063] Where T represents the degree of carton defect; S represents the number of all pixels in the overlapping area of ​​the carton tape area; D represents the degree of separation of the carton cracks; and C represents the degree of narrowing of the carton tape.

[0064] It should be noted that the area of ​​the overlapping area of ​​the cardboards can indicate the degree of defects caused by the overlapping area to the carton. The larger the value, the greater the degree of defects of the carton; the greater the degree of separation between the carton cracks and the degree of narrowing of the carton tape, the greater the degree of defects of the carton.

[0065] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the degree of separation of carton cracks includes:

[0066] The Euclidean distance between the edge pixels at both ends of the crack edge curve is taken as the degree of separation of the carton cracks.

[0067] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the narrowing degree of the carton tape includes:

[0068] Use a horizontal straight line to intercept the overlapping area from the vertex with a step length of 1 until the edge of the overlapping area. The length of the straight line intercepted each time is recorded as the first straight line length. The inverse proportional value of the ratio of the maximum first straight line length to the minimum first straight line length is used as the degree of narrowing of the carton tape.

[0069] At this point, the degree of carton defects is obtained.

[0070] 2. Obtain the quantitative value of the degree of carton defects.

[0071] It should be noted that when the tape is being applied, there may be a situation where there is too much adhesive area on one side of the cardboard and too little on the other side. This situation will also cause the carton to be unable to withstand bumps and shaking after sealing, and should also be regarded as a sealing defect. The greater the difference in area on both sides, the more uneven the distribution of the tape, and the more likely it is a defect.

[0072] Preferably, in some implementations of the embodiments of the present invention, the carton defect degree is corrected based on the carton tape area, and the calculation method for obtaining the quantitative value of the carton defect degree is:

[0073] Obtain carton defect weight factor based on carton tape area;

[0074] The normalized value of the sum of the carton defect weight factor and the carton defect degree is used as the quantified value of the carton defect degree.

[0075] The specific formula is:

[0076] ,

[0077] In the formula, TP represents the quantitative value of the carton defect degree; P represents the carton defect weight factor; T represents the carton defect degree; represents the linear normalization function.

[0078] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the carton defect weight factor includes:

[0079] The carton tape area is divided into two tape areas using the perpendicular midline of the grayscale image of the carton tape surface; and the absolute value of the difference in area between the two tape areas is used as a carton defect weight factor.

[0080] At this point, the quantitative value of the degree of carton defects is obtained through the above method.

[0081] Step S004: Perform sealing defect detection on the carton according to the quantified value of the carton defect degree.

[0082] Specifically, a threshold parameter K is preset, wherein this embodiment is described by taking K=0.75 as an example, and this embodiment is not specifically limited, wherein K is determined according to specific implementation conditions.

[0083] If the quantitative value of the carton defect degree is greater than or equal to the threshold parameter K, the sealed carton is marked as an unqualified carton.

[0084] Through the above steps, a method for visually detecting sealing defects of cartons is completed.

[0085] The present invention also proposes a system for visually detecting sealing defects of cartons, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, steps S001 to S004 of a method for visually detecting sealing defects of cartons are implemented.

[0086] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for visually detecting sealing defects of a carton, characterized in that: The method comprises the following steps: Get the grayscale image of the carton tape surface; Get the carton tape area of ​​the grayscale image of the carton tape surface; get the overlapping area in the carton tape area; According to the overlapping area in the carton tape area, the narrowing degree of the carton tape is obtained; according to the area of ​​the overlapping area and the narrowing degree of the carton tape, the degree of carton defect is obtained; according to the carton tape area, a carton defect weight factor is obtained; based on the carton defect weight factor, the degree of carton defect is corrected to obtain a quantitative value of the degree of carton defect; The method of obtaining the narrowing degree of the carton tape according to the overlapping area in the carton tape area includes: Use a horizontal straight line to intercept the overlapping area from the vertex with a step length of 1 until the edge of the overlapping area, and record the length of the straight line intercepted each time as the first straight line length; the inverse proportional value of the ratio of the maximum first straight line length to the minimum first straight line length is used as the narrowing degree of the carton tape; The method of obtaining the degree of carton defects according to the area of ​​the overlapping region and the degree of narrowing of the carton tape includes: According to the crack edge curve, the separation degree of the carton cracks is obtained; The product of the number of all pixels in the overlapping area of ​​the carton tape area, the separation degree of the carton cracks, and the narrowing degree of the carton tape is taken as the carton defect degree; Carton sealing defects are detected based on the quantitative values ​​of the carton defect levels.

2. According to claim 1, a method for visually inspecting sealing defects of a carton, characterized in that: The specific method of obtaining the carton tape area of ​​the grayscale image of the carton tape surface includes: The side length of the grayscale image of the carton tape surface is denoted as A; the Canny edge detection algorithm is used to perform edge detection on the grayscale image of the carton tape surface to obtain all edge curves in the grayscale image of the carton tape surface. For any edge curve, if the number of all edge pixels on the edge curve is greater than or equal to A, the edge curve is recorded as a target edge curve; for any target edge curve, the Euclidean distance between the central pixel point of the grayscale image of the carton tape surface and the target edge curve is recorded as the first distance of the target edge curve; the sequence after sorting all target edge curves from large to small according to the first distance is recorded as the target edge curve sequence; the area formed by the first target edge curve and the second target edge curve in the target edge curve sequence is taken as the carton tape area.

3. According to claim 1, a method for visually inspecting sealing defects of a carton, characterized in that: The specific method of obtaining the overlapping area in the carton tape area includes: For any edge curve in the carton tape area, if the edge pixel points at the two end points of the edge curve are both located on the same short side edge line of the carton tape area, the edge curve is recorded as the reference edge curve; among all the reference edge curves, the reference edge curve with the largest number of pixels is recorded as the crack edge curve; the area formed by the crack edge curve and the short side edge line of the carton tape area is recorded as the crack triangle area; the opposite triangle area of ​​the crack triangle area is taken as the overlapping area in the carton tape area.

4. According to claim 1, a method for visually inspecting sealing defects of a carton, characterized in that: The specific method of obtaining the degree of separation of the carton cracks includes: The Euclidean distance between the edge pixels at both ends of the crack edge curve is taken as the degree of separation of the carton cracks.

5. According to claim 1, a method for visually inspecting sealing defects of a carton, characterized in that: The specific method of obtaining the carton defect weight factor according to the carton tape area includes: The carton tape area is divided into two tape areas using the perpendicular midline of the grayscale image of the carton tape surface; and the absolute value of the difference in area between the two tape areas is used as a carton defect weight factor.

6. A method for visually inspecting carton sealing defects according to claim 1, characterized in that: The method of correcting the carton defect degree based on the carton defect weight factor to obtain the quantified value of the carton defect degree includes: The normalized value of the sum of the carton defect weight factor and the carton defect degree is used as the quantified value of the carton defect degree.

7. A method for visually inspecting sealing defects of a carton according to claim 1, characterized in that: The specific method of performing sealing defect detection on the carton according to the quantified value of the carton defect degree includes: A threshold parameter K is preset. If the quantitative value of the carton defect degree is greater than or equal to the threshold parameter K, the carton after sealing is recorded as an unqualified carton.

8. A carton sealing defect visual inspection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for visually detecting sealing defects of a carton as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Apparatus and method for defect inspection of paper container

    KR1020190086934A

  • Process and apparatus for the testing of carton packs

    US4984409A