A method and system for detecting surface defects of plastic woven bags

Through edge detection algorithm and abnormal coefficient calculation method, the problem of difficulty in detecting small defects on the surface of woven bags in the prior art is solved, and high-precision detection of small defects on the surface of woven bags is achieved.

CN119251162BActive Publication Date: 2025-04-22ZAOZHUANG JINDALAI PLASTIC IND CO LTD

Patent Information

Application Number
CN202411287118.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-04-22
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

The prior art is difficult to detect minor defects on the surface of woven bags, such as braided jumpers or wire drawings.

Method used

By obtaining the surface defect detection image of the plastic woven bag, using the edge detection algorithm to obtain multiple edge lines, filter out abnormal edge lines and normal edge lines, and calculate the abnormal coefficient to determine whether the bag is abnormal.

Benefits of technology

It can detect tiny defects on the surface of the woven bag, improve the accuracy of the detection and avoid misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251162B_ABST
    Figure CN119251162B_ABST
Patent Text Reader

Abstract

The present application discloses a method and system for detecting surface defects of plastic woven bags, and relates to the field of image data processing technology. The method comprises obtaining a current surface defect detection image of the plastic woven bag; based on the current surface defect detection image, obtaining a plurality of edge straight lines by an edge detection algorithm; based on the plurality of edge straight lines, obtaining an abnormal edge straight line and a plurality of normal edge straight lines; based on the plurality of normal edge straight lines, obtaining a first abnormal coefficient; based on the first abnormal coefficient and the abnormal edge straight line, judging whether the plastic woven bag is abnormal. The present application can detect tiny defects formed on the surface of the woven bag (for example, wire jumps, wire drawing, or abnormal weaving direction of a certain braided wire, etc.) with the help of an edge detection algorithm. And the present application uses the characteristic of the braided wire having two edges to screen out some data that interferes with the detection results, so that subsequent detection results are more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image data processing, and in particular to a method and system for detecting surface defects of plastic woven bags. Background Art

[0002] During the transmission of semi-finished woven bags on the automatic production line, due to factors such as production process, manual operation errors or mechanical failures, it is inevitable that wrinkles, wire drawing, small wire drawing, holes and stains will appear on the surface. These quality defects greatly affect the quality and appearance of the woven bags, so defect detection on the surface of woven bags has become an indispensable and important part of woven bag manufacturing.

[0003] The existing technology mainly relies on manual inspection and computer vision technology to detect surface defects of woven bags. Due to the accelerated production line speed of modern woven bag weaving machines, the method based on manual defect detection has been gradually eliminated and gradually transformed into a detection method based on computer vision technology. When using computer vision for detection, since the braiding wire of some woven bags is too thin, the computer vision detection model of the existing technology can only detect obvious defects on the surface of the woven bag, such as: large area of ​​damage, or large area of ​​missing wires, etc. It is difficult to detect tiny defects on the surface of the woven bag, such as: braided jumper wires or wire drawing, etc. Summary of the invention

[0004] The purpose of the present application is to provide a method and system for detecting surface defects of plastic woven bags, so as to solve the technical problem in the prior art that it is difficult to detect tiny defects on the surface of woven bags.

[0005] To achieve the above objectives, this application provides the following technical solutions:

[0006] In the first aspect, the present application proposes a method for detecting surface defects of a plastic woven bag, comprising:

[0007] Acquire the current surface defect detection image of the plastic woven bag;

[0008] Based on the current surface defect detection image, a plurality of edge straight lines are obtained by an edge detection algorithm; each edge straight line is used to at least characterize the extension direction and extension length of the gap between two adjacent braided wires in the plastic woven bag;

[0009] Based on the plurality of edge straight lines, an abnormal edge straight line and a plurality of normal edge straight lines are obtained;

[0010] Based on a plurality of normal edge straight lines, a first abnormality coefficient is obtained; the first abnormality coefficient is at least used to characterize the length of each floating line segment in the current surface defect detection image along a first direction; the first direction is parallel to the weaving direction of the plastic woven bag;

[0011] Based on the first abnormality coefficient and the abnormal edge straight line, it is determined whether the plastic woven bag is abnormal.

[0012] As a specific solution in the technical solution of the present application, the surface defect detection image includes a priori image and an analysis image; the priori image and the analysis image are distributed in sequence along the length direction of the surface defect detection image, and the lengths of the priori image and the analysis image are both 1 / 2 of the length of the surface defect detection image; the length direction of the surface defect detection image is parallel to the first direction; the obtaining of the current surface defect detection image of the plastic woven bag includes:

[0013] Acquire a first time; the first time is the acquisition time of a historical surface defect detection image; the historical surface defect detection image is a surface defect detection image that is sequentially adjacent to the current surface defect detection image;

[0014] Obtaining the actual length of the plastic woven bag along the weaving direction in the historical surface defect detection image;

[0015] Based on the actual length, a first length is acquired; the first length is 1 / 2 of the actual length;

[0016] Get the current weaving speed;

[0017] Based on the first length and the current weaving speed, obtaining a first time period; the first time period is the first length divided by the current weaving speed;

[0018] Based on the first time and the first time period, obtain a second time; the second time is the sum of the first time and the first time period;

[0019] At the second time, a current surface defect detection image is captured.

[0020] As a specific solution in the technical solution of the present application, the method of obtaining abnormal edge lines and normal edge lines based on multiple edge lines includes:

[0021] Based on the multiple edge lines, a first edge line is obtained; the first edge line is any one edge line among the multiple edge lines;

[0022] Based on the first edge straight line and each second edge straight line, a plurality of similarities are obtained; the second edge straight line is any one of the plurality of edge straight lines that is different from the first edge straight line;

[0023] Based on the respective similarities, it is determined whether the first edge straight line is an abnormal edge straight line.

[0024] As a specific solution in the technical solution of the present application, based on the first edge straight line and each second edge straight line, a calculation formula for obtaining multiple similarities is as follows:

[0025] C B,i =max(|cos(θ B,i ,θ B,k )|,|cos(θ B,i ,θ k )|)

[0026] Among them, C B,i is the similarity of the i-th edge line of the analysis image in the current surface defect detection image, θ B,i is the extension direction of the i-th edge straight line of the analysis image in the current surface defect detection image, θ B,k is the extension direction of the kth edge line of the prior image in the current surface defect detection image, θ k is the extension direction of the kth edge line in the historical surface defect detection image; cos() is the cosine similarity function; || is for finding the absolute value; max() is for taking the maximum value.

[0027] As a specific solution in the technical solution of the present application, after obtaining abnormal edge lines and normal edge lines based on multiple edge lines, the method further includes:

[0028] Based on the multiple abnormal edge lines, a third edge line and a fourth edge line are obtained; the third edge line is any one edge line among the multiple abnormal edge lines; the fourth edge line is an edge line adjacent to the third edge line among the multiple abnormal edge lines;

[0029] Based on the third edge straight line, a first center point and a first extension direction are acquired; the first center point is the center point of the third edge straight line; the first extension direction is the extension direction of the third edge straight line;

[0030] Based on the fourth edge straight line, a second center point and a second extension direction are acquired; the second center point is the center point of the fourth edge straight line; the second extension direction is the extension direction of the fourth edge straight line;

[0031] Based on the first center point, the second center point, the first extension direction, and the second extension direction, obtaining a second anomaly coefficient of the third edge straight line;

[0032] Based on the second abnormality coefficient, it is determined again whether the third edge straight line is an abnormal edge straight line.

[0033] As a specific solution in the technical solution of the present application, the calculation formula for obtaining the second abnormal coefficient of the third edge straight line based on the first center point, the second center point, the first extension direction, and the second extension direction is as follows:

[0034]

[0035] Among them, J B,i represents the second abnormal coefficient of the i-th edge line in the current surface defect detection image; i Indicates the first center point; O i-1 and O i+1 Both represent the second center point; θ B,i represents the first extension direction; θ B,i-1 and θ B,i+1 Both represent the second extension direction; cos() represents the cosine similarity function; || is for finding the absolute value; min() is for taking the minimum value; sigmoid() represents a function that projects the value in the brackets to the range of (0, 1).

[0036] As a specific solution in the technical solution of the present application, the first abnormal coefficient is obtained based on multiple normal edge lines, including:

[0037] Based on a plurality of normal edge straight lines, a plurality of first straight line segments are obtained; each first straight line segment is used at least to characterize a third extension direction and a first extension length of a floating line portion of the woven line in the plastic woven bag;

[0038] Based on each first straight line segment, a fourth extension direction and a second extension length are obtained by a principal component analysis algorithm; the fourth extension direction is the principal component extension direction in each third extension direction; and the second extension length is the principal component extension length in each first extension length;

[0039] Based on the multiple normal edge straight lines, a fourth edge straight line is obtained; the fourth edge straight line is any one edge straight line among the multiple normal edge straight lines;

[0040] Based on the fourth edge straight line, obtaining a plurality of second straight line segments;

[0041] Based on the plurality of second straight line segments, acquiring a fifth extension direction and a third extension length corresponding to the second straight line segments;

[0042] Based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction, a first abnormality coefficient is acquired.

[0043] As a specific solution in the technical solution of the present application, the calculation formula for obtaining the first abnormal coefficient based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction is as follows:

[0044]

[0045] Among them, Q j represents the first abnormal coefficient of the jth normal edge line; θ i L represents the angle formed between the fifth extension direction corresponding to the i-th second straight line segment in the j-th normal edge straight line and the fourth extension direction; i represents the third extension length corresponding to the i-th second straight line segment in the j-th normal edge straight line; represents the second extension length; sin() represents the sine function; || represents the absolute value; sigmoid() represents the function that projects the value in the brackets to the range of (0, 1).

[0046] As a specific solution in the technical solution of the present application, judging whether the plastic woven bag is abnormal based on the first abnormal coefficient and the abnormal edge straight line includes:

[0047] If there is an abnormal edge straight line, it is determined that the plastic woven bag is abnormal;

[0048] If there is no abnormal edge straight line, but the first abnormal coefficient is greater than or equal to a first preset value, it is determined that the plastic woven bag is abnormal;

[0049] Otherwise, it is determined that the plastic woven bag is normal.

[0050] In the second aspect, the present application proposes a plastic woven bag surface defect detection system, comprising:

[0051] An acquisition device, used for acquiring a current surface defect detection image of the plastic woven bag;

[0052] A processing device, for obtaining a plurality of edge straight lines by an edge detection algorithm based on the current surface defect detection image; each edge straight line is used at least to characterize the extension direction and extension length of the gap between two adjacent braided wires in the plastic woven bag;

[0053] and, based on the plurality of edge straight lines, obtaining an abnormal edge straight line and a plurality of normal edge straight lines;

[0054] And, based on a plurality of normal edge straight lines, a first abnormality coefficient is obtained; the first abnormality coefficient is at least used to characterize the length of each floating line segment in the current surface defect detection image along a first direction; the first direction is parallel to the weaving direction of the plastic woven bag;

[0055] And, based on the first abnormality coefficient and the abnormal edge straight line, it is determined whether the plastic woven bag is abnormal.

[0056] As a specific solution in the technical solution of the present application, the surface defect detection image includes a priori image and an analysis image; the priori image and the analysis image are distributed in sequence along the length direction of the surface defect detection image, and the lengths of the priori image and the analysis image are both 1 / 2 of the length of the surface defect detection image; the length direction of the surface defect detection image is parallel to the first direction; the acquisition device is also used to acquire a first time; the first time is the acquisition time of the historical surface defect detection image; the historical surface defect detection image is a surface defect detection image that is adjacent to the current surface defect detection image in time sequence;

[0057] The processing device is also used to obtain the actual length of the plastic woven bag along the weaving direction in the historical surface defect detection image;

[0058] And, based on the actual length, obtaining a first length; the first length is 1 / 2 of the actual length;

[0059] And, obtain the current weaving speed;

[0060] And, based on the first length and the current weaving speed, a first time period is obtained; the first time period is the first length divided by the current weaving speed;

[0061] And, based on the first time and the first time period, a second time is obtained; the second time is the sum of the first time and the first time period;

[0062] The acquisition device is also used to capture the current surface defect detection image at the second time.

[0063] As a specific solution in the technical solution of the present application, the processing device is further used to obtain a first edge straight line based on multiple edge straight lines; the first edge straight line is any edge straight line among the multiple edge straight lines;

[0064] and obtaining a plurality of similarities based on the first edge straight line and each second edge straight line; the second edge straight line is any one of the plurality of edge straight lines that is different from the first edge straight line;

[0065] And, based on each similarity, it is determined whether the first edge straight line is an abnormal edge straight line.

[0066] As a specific solution in the technical solution of the present application, the processing device obtains a plurality of similarity calculation formulas based on the first edge straight line and each second edge straight line as follows:

[0067] C B,i =max(|cos(θ B,i ,θB,k )|,|cos(θ B,i ,θ k )|)

[0068] Among them, C B,i is the similarity of the i-th edge line of the analysis image in the current surface defect detection image, θ B,i is the extension direction of the i-th edge straight line of the analysis image in the current surface defect detection image, θ B,k is the extension direction of the kth edge line of the prior image in the current surface defect detection image, θ k is the extension direction of the kth edge line in the historical surface defect detection image; cos() is the cosine similarity function; || is for finding the absolute value; max() is for taking the maximum value.

[0069] As a specific solution in the technical solution of the present application, the processing device is further used to obtain a third edge straight line and a fourth edge straight line based on multiple abnormal edge straight lines; the third edge straight line is any edge straight line among the multiple abnormal edge straight lines; the fourth edge straight line is an edge straight line adjacent to the third edge straight line among the multiple abnormal edge straight lines;

[0070] And, based on the third edge straight line, a first center point and a first extension direction are acquired; the first center point is the center point of the third edge straight line; the first extension direction is the extension direction of the third edge straight line;

[0071] And, based on the fourth edge straight line, a second center point and a second extension direction are acquired; the second center point is the center point of the fourth edge straight line; the second extension direction is the extension direction of the fourth edge straight line;

[0072] and, based on the first center point, the second center point, the first extension direction, and the second extension direction, obtaining a second anomaly coefficient of the third edge straight line;

[0073] And, based on the second abnormality coefficient, it is determined again whether the third edge straight line is an abnormal edge straight line.

[0074] As a specific solution in the technical solution of the present application, the processing device obtains the calculation formula of the second abnormal coefficient of the third edge straight line based on the first center point, the second center point, the first extension direction, and the second extension direction as follows:

[0075]

[0076] Among them, J B,i represents the second abnormal coefficient of the i-th edge line in the current surface defect detection image; iIndicates the first center point; O i-1 and O i+1 Both represent the second center point; θ B,i represents the first extension direction; θ B,i-1 and θ B,i+1 Both represent the second extension direction; cos() represents the cosine similarity function; || is for finding the absolute value; min() is for taking the minimum value; sigmoid() represents a function that projects the value in the brackets to the range of (0, 1).

[0077] As a specific solution in the technical solution of the present application, the processing device is also used to obtain a plurality of first straight line segments based on a plurality of normal edge straight lines; each first straight line segment is at least used to characterize a third extension direction and a first extension length of a floating line portion of the braided line in the plastic woven bag;

[0078] And, based on each first straight line segment, a fourth extension direction and a second extension length are obtained by a principal component analysis algorithm; the fourth extension direction is the principal component extension direction in each third extension direction; the second extension length is the principal component extension length in each first extension length;

[0079] And, based on the multiple normal edge straight lines, a fourth edge straight line is obtained; the fourth edge straight line is any one edge straight line among the multiple normal edge straight lines;

[0080] and, based on the fourth edge straight line, obtaining a plurality of second straight line segments;

[0081] and, based on the plurality of second straight line segments, obtaining a fifth extension direction and a third extension length corresponding to the second straight line segments;

[0082] And, based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction, a first abnormality coefficient is obtained.

[0083] As a specific solution in the technical solution of the present application, the processing device obtains the calculation formula of the first abnormality coefficient based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction as follows:

[0084]

[0085] Among them, Q j represents the first abnormal coefficient of the jth normal edge line; θ i L represents the angle formed between the fifth extension direction corresponding to the i-th second straight line segment in the j-th normal edge straight line and the fourth extension direction; i represents the third extension length corresponding to the i-th second straight line segment in the j-th normal edge straight line; represents the second extension length; sin() represents the sine function; || represents the absolute value; sigmoid() represents the function that projects the value in the brackets to the range of (0, 1).

[0086] As a specific solution in the technical solution of the present application, the processing device is also used to determine that the plastic woven bag is abnormal if there is an abnormal edge straight line;

[0087] And, if there is no abnormal edge straight line, but the first abnormal coefficient is greater than or equal to a first preset value, the plastic woven bag is judged to be abnormal; otherwise, the plastic woven bag is judged to be normal.

[0088] Compared with the prior art, the beneficial effects of this application are:

[0089] This application can detect tiny defects on the surface of woven bags (for example, wire jumpers, wire drawing, or abnormal weaving direction of a certain woven wire, etc.) by using edge detection algorithms. In addition, this application uses the characteristics of the woven wire having two edges to filter out some data that interferes with the detection results, making subsequent detection results more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 A schematic diagram of a process for detecting surface defects of a plastic woven bag proposed in an embodiment of the present application;

[0091] Figure 2 This is a structural flow chart of a plastic woven bag surface defect detection system proposed in an embodiment of the present application;

[0092] Figure 3 A schematic diagram of the structure of a woven bag produced by a woven machine proposed in an embodiment of the present application;

[0093] Figure 4 A partial schematic diagram of a woven bag proposed in an embodiment of the present application;

[0094] Figure 5 A schematic diagram of obtaining a current surface defect detection image proposed in an embodiment of the present application;

[0095] Figure 6 This is a schematic diagram of the distribution of edge lines in a two-dimensional space proposed in an embodiment of the present application.

[0096] 1. Weaving machine; 2. Weaving bag; 21. Edge gap; 22. Weaving line; 211. First edge straight line; 212. Second edge straight line; 23. Straight line segment; 3. Camera; 41. Historical surface defect detection image; 411. First prior image; 412. First analysis image; 42. Current surface defect detection image; 421. Second prior image; 422. Second analysis image; 43. First abnormal edge straight line; 431. Center point of first straight line; 44. Second abnormal edge straight line; 441. Center point of second straight line; 45. Third abnormal edge straight line; 451. Center point of third straight line; 46. Normal edge straight line. DETAILED DESCRIPTION

[0097] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0098] The terms "first", "second", etc. in the specification of the embodiment of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, such as the first edge straight line and the second edge straight line proposed below, which belong to different straight lines. It should be understood that the straight lines used in this way can be interchanged in appropriate circumstances, so that the embodiments described here can be implemented in an order other than the content illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The division of the modules that appear in the embodiment of the present application is only a logical division. There may be other division methods when implemented in practical applications, such as multiple modules can be combined into or integrated in another system, or some features can be ignored, or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, and the indirect coupling or communication connection between modules can be electrical or other similar forms, which are not limited in the embodiment of the present application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed in multiple circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment of the present application.

[0099] In order to solve the technical problem that it is difficult to detect tiny defects on the surface of woven bags proposed in the background technology, this application proposes a method for detecting surface defects of plastic woven bags, such as Figure 1 As shown, the plastic woven bag surface defect detection method includes steps S100 to S500.

[0100] Step S100: obtaining a current surface defect detection image of the plastic woven bag.

[0101] It should be clear that in the embodiments of the present application, the current surface defect detection image of the plastic woven bag can be obtained in any manner. For example, a video of the production of the plastic woven bag can be shot, and then the current surface defect detection image of the plastic woven bag can be obtained from the video. Or, in one embodiment of the present application, Figure 3 As shown, the surface defect detection is performed on the woven bag 2 at the outlet of the weaving machine 1. Therefore, the shooting device 3 can be installed at the discharge port of the weaving machine 1. The distance between the shooting device 3 and the woven bag 2 can be fixed at 10 cm. Of course, in other embodiments of the present application, the shooting device 3 and the woven bag 2 can be adjusted according to actual needs. In the embodiment of the present application, the acquisition frequency of the shooting device 3 can be set according to the production speed of the woven bag 2 at the discharge port. It is easy to understand that if the production speed of the woven bag 2 is higher, the acquisition frequency of the shooting device 3 is higher; if the production speed of the woven bag 2 is lower, the acquisition frequency of the shooting device 3 is also lower.

[0102] In order to accurately detect the surface defects in the acquired surface defect detection image in the following, in one embodiment of the present application, as shown in FIG. Figure 5 As shown, the surface defect detection image includes a priori image and an analysis image. For example, the historical surface defect detection image 41 includes a first priori image 411 and a first analysis image 412; the current surface defect detection image includes a second priori image 421 and a second analysis image 422. Figure 5 It can be seen that the prior image and the analysis image are distributed in sequence along the length direction of the surface defect detection image, and the lengths of the prior image and the analysis image are both 1 / 2 of the length of the surface defect detection image. The length direction of the surface defect detection image is parallel to the weaving direction of the plastic woven bag, which is the first direction hereinafter (i.e. Figure 5 direction shown A).

[0103] As can be seen below, each surface defect detection image includes a priori image and analysis image, and as Figure 5As shown, the analysis image of the historical surface defect detection image 41 (i.e., the first analysis image 412) and the prior image of the current surface defect detection image 42 (i.e., the second prior image 421) overlap. It is easy to understand that if the historical surface defect detection image 41 is detected to have no surface defects, the analysis image of the current surface defect detection image 42 can be detected based on the analysis image of the historical surface defect detection image 41 (i.e., the prior image of the current surface defect detection image 42), which can improve the detection accuracy of the current surface defect detection image 42. Specifically, how to detect and analyze the analysis image with the help of the prior image of the surface defect detection image is described below, and will not be elaborated here.

[0104] In order to obtain a qualified current surface defect detection image having a prior image and an analysis image, in a specific embodiment of the present application, step S100, said obtaining the current surface defect detection image of the plastic woven bag, includes steps S110 to S170.

[0105] Step S110: Acquire the first time.

[0106] It should be clear that the first time is the acquisition time of the historical surface defect detection image; the historical surface defect detection image is a surface defect detection image that is adjacent to the current surface defect detection image in time sequence.

[0107] Step S120: obtaining the actual length of the plastic woven bag along the weaving direction in the historical surface defect detection image.

[0108] It should be clear that based on the historical surface defect detection image, the plastic woven bag along the weaving direction (that is, Figure 5 The actual length of the direction A) shown is a mature technology and will not be described here. Assuming that 1000 weaving lines are captured along the weaving direction in each surface defect detection image, and the width of each weaving line is 0.5mm; then the actual length of the plastic woven bag in each surface defect detection image is 1000*0.5mm=500mm.

[0109] Step S130: Based on the actual length, obtain a first length.

[0110] As can be seen from the foregoing, the prior image and the analysis image each account for half of the surface defect detection image, that is, for each woven bag of half the actual length, a surface defect detection image needs to be obtained for subsequent detection. That is, the first length is 1 / 2 of the actual length.

[0111] Step S140: Obtain the current knitting speed.

[0112] It should be clear that obtaining the current weaving speed of the weaving machine is a mature technology and will not be described in detail here.

[0113] Step S150: acquiring a first time period based on the first length and the current weaving speed.

[0114] It should be noted that, in this embodiment, the calculation formula for the first time period is as follows:

[0115] T=S / V

[0116] Wherein, T represents the first time period; S represents the first length; and V represents the current weaving speed. That is, in this embodiment, the first time period is the first length divided by the current weaving speed. In other words, in this embodiment, a surface defect detection image needs to be captured once every time the length of the first time period has passed. This ensures that half of each surface defect detection image is a priori image and the other half is an analysis image.

[0117] Step S160: Acquire a second time based on the first time and the first time period.

[0118] It is easy to understand that, in this embodiment, the second time is the sum of the first time and the first time period.

[0119] Step S170: During the second time, photograph and acquire a current surface defect detection image.

[0120] It should be clear that capturing images at fixed time points is a mature technology and will not be elaborated here.

[0121] Step S200: Based on the current surface defect detection image, a plurality of edge lines are acquired by an edge detection algorithm.

[0122] It should be noted that when a knitting machine is knitting a woven bag, the knitting program is first input into the knitting machine, and then the knitting machine interlaces and overlaps the knitting threads in a fixed order according to the knitting program to produce a woven bag. Figure 4 As shown, each braided wire of the woven bag has two edges during the weaving process, and the edge of one braided wire will form a gap with the edge of the adjacent braided wire. The color of these gaps in the surface defect detection image is different from the color of the braided wire itself, so these gaps can be identified and constructed based on the edge detection algorithm to simulate the two-dimensional space. The surface defects of the woven bag can be judged by the extension direction and extension length of these gaps. That is to say, in this embodiment, each edge straight line is at least used to characterize the extension direction and extension length of the gap between two adjacent braided wires in the plastic woven bag.

[0123] In the embodiment of the present application, the edge detection algorithm may be any suitable edge detection algorithm, for example, Sobel algorithm, Canny algorithm, Laplacian algorithm, Prewitt algorithm, OpenCV algorithm or RobertsCross algorithm, etc. Since there are many mature edge detection algorithms, they are not listed here one by one to avoid redundancy.

[0124] Step S300: based on a plurality of edge lines, obtaining an abnormal edge line and a plurality of normal edge lines;

[0125] As we can see from the previous article, the weaving machine produces woven bags by staggering and overlapping the weaving threads in a fixed order according to the weaving program. Therefore, the texture direction of all woven bags produced in a production line is the same. For example, Figure 4 is a partial image of a woven bag. Figure 4 The weaving direction of the woven bag is shown in direction A. Figure 4 As shown, each braided wire 22 corresponds to two edge lines (i.e., a first edge line 211 and a second edge line 212). Since the braided wire 22 extends along the second direction, the first edge line 211 and the second edge line 212 also extend along the second direction. Theoretically, the extension direction of the first edge line 211 and the second edge line 212 is close to direction A. In other words, if the x-axis in the two-dimensional space is parallel to direction A, the angle between the first edge line 211 and the second edge line 212 and the x-axis is also close to 0°. In other words, in the embodiments of the present application, we define the edge lines whose extension direction is close to direction A among the multiple edge lines as normal edge lines; and define the other edge lines among the multiple edge lines as abnormal edge lines.

[0126] In an embodiment of the present application, whether each edge line is normal or abnormal can be determined based on the angle between each edge line and the x-axis. For example, if the angle between an edge line and the x-axis is less than or equal to 5°, the edge line is considered to be a normal edge line, otherwise the edge line is considered to be an abnormal edge line. Of course, in other embodiments of the present application, other angles can also be selected, such as 3°, 4°, or 6°.

[0127] It should be clear that if Figure 3As shown, during the production process of the woven bag 2, the woven bag 2 will receive the traction force of the traction device, and the traction device will cause some of the woven wires in the woven bag 2 to be deformed due to the force. As can be seen from the foregoing, the edge straight line extends along the edge of the woven wire. If the woven wire is deformed due to force, the edge straight line will also be deformed. In other words, in the application scenario where the woven bag 2 is deformed due to force, the use of the above method may identify the normal edge straight line as an abnormal edge straight line, thereby affecting the detection accuracy. In order to make the plastic woven bag surface defect detection method proposed in the present application applicable to the application scenario where the woven bag 2 is deformed due to force, in one embodiment of the present application, step S300, the abnormal edge straight line and the normal edge straight line are obtained based on multiple edge straight lines, including steps S310 to S330.

[0128] Step S310: Based on multiple edge lines, obtain a first edge line.

[0129] It should be clear that it is necessary to determine whether each edge straight line is abnormal. Therefore, in this embodiment, the first edge straight line is any one of the plurality of edge straight lines.

[0130] Step S320: obtaining multiple similarities based on the first edge straight line and each second edge straight line.

[0131] It should be clear that if the woven bag 2 is locally deformed by a force in a certain direction, it is basically impossible for only one woven line to be deformed, but multiple local woven lines will be deformed. That is to say, in the embodiment of the present application, if there are multiple edge lines that have large angles with the x-axis, but the angles between these edge lines are similar, then these edge lines are most likely normal edge lines. In other words, in this embodiment, the second edge line is any one of the multiple edge lines that is different from the first edge line.

[0132] In order to more accurately determine whether the first edge line is normal, in one embodiment of the present application, in step S320, based on the first edge line and each second edge line, a calculation formula for obtaining multiple similarities is as follows:

[0133] C B,i =max(|cos(θ B,i ,θ B,k )|,|cos(θ B,i ,θ k )|)

[0134] Among them, C B,i is the similarity of the i-th edge line of the analysis image in the current surface defect detection image, θ B,iis the extension direction of the i-th edge straight line of the analysis image in the current surface defect detection image, θ B,k is the extension direction of the kth edge line of the prior image in the current surface defect detection image, θ k is the extension direction of the kth edge line in the historical surface defect detection image; cos() is the cosine similarity function; || is for finding the absolute value; max() is for taking the maximum value.

[0135] It should be noted that θ B,k is the extension direction of the kth edge line of the prior image in the current surface defect detection image; θ B,i is the extension direction of the ith edge line of the analysis image in the current surface defect detection image. As can be seen from the previous text, the woven bags in the prior image are all confirmed qualified woven bags; that is, if a certain edge line (part of the analysis image) has a large angle with the x-axis, but if such an edge line also exists in the prior image, it means that the edge line is very likely to be a normal edge line. Alternatively, although a certain edge line (part of the analysis image) has a large angle with the x-axis, if the entire current surface defect detection image also has an edge line with a similar extension direction, it means that the edge line is also very likely to be a normal edge line.

[0136] Step S330: Based on each similarity, determine whether the first edge line is an abnormal edge line.

[0137] As can be seen from the foregoing, the larger the value of the cosine similarity function is, the more similar the extension directions of the two straight lines are. Therefore, in an embodiment of the present application, any suitable method can be used to determine whether the first edge straight line is an abnormal edge straight line based on each similarity. For example: if the maximum value of each similarity is greater than a first preset value, the first edge straight line is determined to be a normal edge straight line; otherwise, the first edge straight line is determined to be an abnormal edge straight line. Alternatively, in an embodiment of the present application, the number of second edge straight lines that are similar to the extension direction of the first edge straight line can be obtained. If the number is greater than the second preset value, the first edge straight line is determined to be a normal edge straight line, otherwise it is determined to be an abnormal edge straight line.

[0138] As we can see from the previous article, woven bags will deform due to stress during the production process. Figure 3As shown, woven bags will also produce wrinkles when subjected to stress during the production process. It is easy to understand that these wrinkles will appear in different colors when located in the current surface defect detection image. In other words, if based on an edge detection algorithm, it is also easy to mistake these wrinkles for the gaps between the edges of two woven wires, that is, to simulate the wrinkles as straight edge lines. It is easy to understand that the straight edge lines formed by the wrinkles generally have a large angle with x and are fewer in number. That is, in an embodiment of the present application, if wrinkles exist, it is easy to misdetect, that is, to judge the woven bags with wrinkles as unqualified.

[0139] In order to improve the detection accuracy of the plastic woven bag surface defect detection method proposed in the present application, in one embodiment of the present application, in step S300, after obtaining abnormal edge lines and normal edge lines based on multiple edge lines, the method also includes steps S340 to S380.

[0140] Step S340: Based on the multiple abnormal edge lines, obtain a third edge line and a fourth edge line.

[0141] As can be seen from the foregoing, among the abnormal edge straight lines, there may be straight lines that are not formed by the edges of the braided wires (for example, straight lines generated by wrinkles). That is, in the embodiments of the present application, these straight lines that are not formed by the edges of the braided wires need to be excluded. Figure 6 This is a schematic diagram of the distribution of edge lines in a two-dimensional space proposed in an embodiment of the present application. Figure 6 As shown in FIG. 1 , generally, normal edge straight lines are approximately parallel to the x-axis, as shown in normal edge straight line 46. However, abnormal edge straight lines (e.g., Figure 6 The first abnormal edge straight line 43, the second abnormal edge straight line 44 and the third abnormal edge straight line 45) are all at a relatively large angle with the x-axis.

[0142] It is easy to understand that during the weaving process of the woven bag, if a certain weaving line is abnormal (for example, a certain weaving line deviates from the normal weaving track), then due to the characteristic that each weaving line will form two edge straight lines, two abnormal edge straight lines that are approximately parallel will also be formed in two-dimensional space, and the distance between these two abnormal edge straight lines (that is, the width of the weaving line in the image) is also similar to the distance between adjacent normal edge straight lines (that is, the width of the weaving line in the image). In other words, in the embodiments of the present application, based on the characteristic that abnormal edge straight lines will definitely appear in pairs, edge straight lines formed by other reasons (for example, wrinkles) can be excluded.

[0143] As can be seen from the above, in the embodiment of the present application, the third edge straight line is any one of the plurality of abnormal edge straight lines, and the fourth edge straight line is an edge straight line adjacent to the third edge straight line among the plurality of abnormal edge straight lines. Figure 6 The second abnormal edge straight line 44 in the example is used as the third edge straight line, and the first abnormal edge straight line 43 and the third abnormal edge straight line 45 are used as the fourth edge straight line to illustrate the present application. It does not represent the method proposed in the present application, and is only applicable to the following example. Figure 6 The application scenario shown.

[0144] Step S350: Based on the third edge straight line, obtain a first center point and a first extension direction.

[0145] It should be clear that in the embodiment of the present application, the first center point is the center point of the third edge straight line (that is, Figure 6 The first extension direction is the extension direction of the third edge straight line (ie, the second straight line center point 441 shown in FIG. 4 ); the first extension direction is the extension direction of the third edge straight line (ie, Figure 6 One end point of the second abnormal edge straight line 44 is shown pointing in the direction of the other end point).

[0146] Step S360: Based on the fourth edge straight line, obtain a second center point and a second extension direction.

[0147] It should be clear that in the embodiment of the present application, the second center point is the center point of the fourth edge straight line (that is, Figure 6 The first straight line center point 431 or the third straight line center point 451 shown in FIG. 4 ); the second extension direction is the extension direction of the fourth edge straight line (ie, Figure 6 One end point of the first abnormal edge straight line 43 points to the direction of the other end point or one end point of the third abnormal edge straight line 45 points to the direction of the other end point).

[0148] Step S370: Based on the first center point, the second center point, the first extension direction, and the second extension direction, obtain a second anomaly coefficient of the third edge straight line.

[0149] As can be seen from the foregoing, in the embodiments of the present application, the reason for the formation of the third edge line can be determined by the distance and angle between each abnormal edge line and the third edge line. If the third edge line is formed by wrinkles, the third edge line needs to be excluded from the subsequent abnormality determination; if the third edge line is formed by the edge of the braided wire, the third edge line needs to be involved in the subsequent abnormality determination.

[0150] In one embodiment of the present application, in step S370, based on the first center point, the second center point, the first extension direction, and the second extension direction, a calculation formula for obtaining a second anomaly coefficient of the third edge straight line is as follows:

[0151]

[0152] Among them, J B,i represents the second abnormal coefficient of the i-th edge straight line (i.e., the third edge straight line) in the current surface defect detection image; i Indicates the first center point; O i-1 and O i+1 Both represent the second center point; θ B,i represents the first extension direction; θ B,i-1 and θ B,i+1 All represent the second extension direction; cos() represents the cosine similarity function; || is for finding the absolute value; min() is for taking the minimum value; sigmoid() represents a function that projects the value in the brackets to the interval (0, 1). In the embodiment of the present application, L can be the width of the braided wire in the image, or it can be set to any value. It is easy to understand that in the embodiment of the present application, if J B,i The closer it is to 0, the more likely it is that the third edge straight line is the straight line formed by the edge of the braided wire.

[0153] Step S380: Based on the second abnormality coefficient, determine again whether the third edge line is an abnormal edge line.

[0154] In the embodiment of the present application, a third preset value may be set, and if the second abnormal coefficient is less than the third preset value, it indicates that the third edge line is an abnormal edge line. In the present embodiment, the third preset value may be any suitable value, such as 0.2 or 0.3.

[0155] It should be clear that if there are abnormal edge straight lines in the two-dimensional space, it means that there are surface defects on the surface of the woven bag, and the woven bag with surface defects needs to be processed in time.

[0156] It should be noted that even if there are no abnormal edge straight lines in the two-dimensional space, there may be tiny surface defects such as skipped stitches during the weaving process. In order to detect these surface defects, in one embodiment of the present application, step S400 needs to be executed.

[0157] Step S400: Based on a plurality of normal edge lines, a first abnormal coefficient is obtained.

[0158] It should be noted that each braided line will form alternating sinking line segments (i.e., the part of the braided line that is invisible to the naked eye) and floating line segments (i.e., the part of the braided line that is visible to the naked eye) during the braiding process. It is easy to understand that if a braided line participates in the braiding normally, the length of each floating line segment is basically equal. In other words, if the length of a floating line segment is significantly different from that of other floating line segments, it is likely that the floating line segment has an abnormality (for example, skipped stitches or wire drawing, etc.). In other words, if the length of a floating line segment is abnormal, it means that the corresponding woven bag surface is likely to have a small defect.

[0159] It is easy to understand that, in the embodiment of the present application, the first anomaly coefficient is at least used to characterize the length of each floating line segment in the current surface defect detection image along the first direction.

[0160] In one embodiment of the present application, step S400, based on a plurality of normal edge lines, obtains a first abnormal coefficient, including steps S410 to S460.

[0161] Step S410: Based on a plurality of normal edge straight lines, a plurality of first straight line segments are obtained.

[0162] It should be clear that each first straight line segment is Figure 4 As shown in the straight line segment 23 in the figure. Each first straight line segment is at least used to characterize the third extension direction and the first extension length of the floating line portion of the braided line in the plastic woven bag. It should be clear that most of the first straight line segments are consistent with the extension direction of the corresponding normal edge straight line.

[0163] It should be clear that each first straight line segment can be obtained based on an edge detection algorithm, which is a mature technology and will not be described in detail.

[0164] Step S420: Based on each first straight line segment, a fourth extension direction and a second extension length are obtained by a principal component analysis algorithm.

[0165] It should be clear that principal component analysis (PCA) is a statistical method that transforms a set of variables that may be correlated into a set of linearly uncorrelated variables through orthogonal transformation. The transformed set of variables is called principal components. The main purpose of PCA is dimensionality reduction and feature extraction. By transforming multiple features in the original data set into a few principal components through linear transformation, these principal components can retain most of the information in the original data while removing noise and redundant information, thereby simplifying the data set and improving the efficiency and accuracy of subsequent data analysis. Since the principal component analysis algorithm is a mature technology, it will not be described here.

[0166] It should be noted that, in this embodiment, the fourth extension direction is the main component extension direction of each third extension direction, and the second extension length is the main component extension length of each first extension length.

[0167] Step S430: Based on a plurality of normal edge lines, a fourth edge line is obtained.

[0168] It should be clear that in the embodiment of the present application, each edge straight line needs to be tested to determine whether the corresponding braided wire has a tiny surface defect. That is, in the present embodiment, the fourth edge straight line is any one of the plurality of normal edge straight lines.

[0169] Step S440: Based on the fourth edge straight line, obtain a plurality of second straight line segments.

[0170] It should be clear that each second straight line segment can be obtained based on an edge detection algorithm, which is a mature technology and will not be described in detail.

[0171] Step S450: Based on the plurality of second straight line segments, obtaining a fifth extension direction and a third extension length corresponding to the second straight line segments.

[0172] It should be clear that each straight line segment corresponds to an extension direction and an extension length, and obtaining the extension direction and the extension length in two-dimensional space based on the edge detection algorithm is a mature technology and will not be elaborated here.

[0173] Step S460: Obtain a first anomaly coefficient based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction.

[0174] It should be clear that in one embodiment of the present application, in step S460, based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction, the calculation formula for obtaining the first anomaly coefficient is as follows:

[0175]

[0176] Among them, Q j represents the first abnormal coefficient of the jth normal edge line (i.e., the fourth edge line); θ i L represents the angle formed between the fifth extension direction corresponding to the i-th second straight line segment in the j-th normal edge straight line and the fourth extension direction; i represents the third extension length corresponding to the i-th second straight line segment in the j-th normal edge straight line; represents the second extension length; sin() represents the sine function; || represents the absolute value; sigmoid() represents the function that projects the value in the brackets to the range of (0, 1).

[0177] In this embodiment, if the first abnormal coefficient is smaller, it means that the length of each straight line segment corresponding to the fourth edge straight line is closer to the extension length of the principal component, that is, the braided wire corresponding to the fourth edge straight line is more normal. If the first abnormal coefficient is larger, it means that the length of each straight line segment corresponding to the fourth edge straight line is more different from the extension length of the principal component, that is, the braided wire corresponding to the fourth edge straight line is more abnormal.

[0178] Step S500, judging whether the plastic woven bag is abnormal based on the first abnormal coefficient and the abnormal edge straight line, includes steps S510 to S520.

[0179] Step S510: If there is an abnormal edge straight line, it is determined that the plastic woven bag is abnormal.

[0180] In other words, if there are abnormal edge straight lines, it means that there is a high probability that there are crooked weaving lines on the surface of the woven bag, which means that there is a high probability that there is quality abnormality on the surface of the woven bag.

[0181] Step S520: If there is no abnormal edge straight line, but the first abnormal coefficient is greater than or equal to a first preset value, the plastic woven bag is judged to be abnormal. Otherwise, the plastic woven bag is judged to be normal.

[0182] In the embodiment of the present application, the first preset value may be any suitable value, for example, 0.2 or 0.3.

[0183] It should be clear that the plastic woven bag surface defect detection method proposed in this application can detect tiny defects formed on the surface of the woven bag (for example, jumper wires, wire drawing, or abnormal weaving direction of a certain woven wire, etc.) by means of edge detection algorithm. And this application uses the characteristic of the woven wire having two edges to filter out some data that interferes with the detection results, making the subsequent detection results more accurate.

[0184] After introducing the plastic woven bag surface defect detection method proposed in the embodiment of the present application, the following introduces the plastic woven bag surface defect detection system proposed in the present application. Figure 2 As shown, the plastic woven bag surface defect detection system 10 includes:

[0185] The acquisition device 11 is used to acquire the current surface defect detection image of the plastic woven bag;

[0186] The processing device 12 is used to obtain a plurality of edge straight lines by an edge detection algorithm based on the current surface defect detection image; each edge straight line is used to characterize at least an extension direction and an extension length of a gap between two adjacent braided wires in the plastic woven bag;

[0187] and, based on the plurality of edge straight lines, obtaining an abnormal edge straight line and a plurality of normal edge straight lines;

[0188] And, based on a plurality of normal edge straight lines, a first abnormality coefficient is obtained; the first abnormality coefficient is at least used to characterize the length of each floating line segment in the current surface defect detection image along a first direction; the first direction is parallel to the weaving direction of the plastic woven bag;

[0189] And, based on the first abnormality coefficient and the abnormal edge straight line, it is determined whether the plastic woven bag is abnormal.

[0190] As a specific embodiment of the present application, the surface defect detection image includes a priori image and an analysis image; the priori image and the analysis image are sequentially distributed along the length direction of the surface defect detection image, and the lengths of the priori image and the analysis image are both 1 / 2 of the length of the surface defect detection image; the length direction of the surface defect detection image is parallel to the first direction; the acquisition device 11 is also used to acquire a first time; the first time is the acquisition time of the historical surface defect detection image; the historical surface defect detection image is a surface defect detection image that is sequentially adjacent to the current surface defect detection image;

[0191] The processing device 12 is also used to obtain the actual length of the plastic woven bag along the weaving direction in the historical surface defect detection image;

[0192] And, based on the actual length, obtaining a first length; the first length is 1 / 2 of the actual length;

[0193] And, obtain the current weaving speed;

[0194] And, based on the first length and the current weaving speed, a first time period is obtained; the first time period is the first length divided by the current weaving speed;

[0195] And, based on the first time and the first time period, a second time is obtained; the second time is the sum of the first time and the first time period;

[0196] The acquisition device 11 is further used to capture the current surface defect detection image at the second time.

[0197] As a specific embodiment of the present application, the processing device 12 is further used to obtain a first edge straight line based on multiple edge straight lines; the first edge straight line is any one edge straight line among the multiple edge straight lines;

[0198] and obtaining a plurality of similarities based on the first edge straight line and each second edge straight line; the second edge straight line is any one of the plurality of edge straight lines that is different from the first edge straight line;

[0199] And, based on each similarity, it is determined whether the first edge straight line is an abnormal edge straight line.

[0200] As a specific embodiment of the present application, the processing device 12 obtains multiple similarity calculation formulas based on the first edge straight line and each second edge straight line as follows:

[0201] C B,i =max(|cos(θ B,i ,θ B,k )|,|cos(θ B,i ,θ k )|)

[0202] Among them, C B,i is the similarity of the i-th edge line of the analysis image in the current surface defect detection image, θ B,i is the extension direction of the i-th edge straight line of the analysis image in the current surface defect detection image, θ B,k is the extension direction of the kth edge line of the prior image in the current surface defect detection image, θ k is the extension direction of the kth edge line in the historical surface defect detection image; cos() is the cosine similarity function; || is for finding the absolute value; max() is for taking the maximum value.

[0203] As a specific embodiment of the present application, the processing device 12 is further used to obtain a third edge straight line and a fourth edge straight line based on the multiple abnormal edge straight lines; the third edge straight line is any edge straight line among the multiple abnormal edge straight lines; the fourth edge straight line is an edge straight line adjacent to the third edge straight line among the multiple abnormal edge straight lines;

[0204] And, based on the third edge straight line, a first center point and a first extension direction are acquired; the first center point is the center point of the third edge straight line; the first extension direction is the extension direction of the third edge straight line;

[0205] And, based on the fourth edge straight line, a second center point and a second extension direction are acquired; the second center point is the center point of the fourth edge straight line; the second extension direction is the extension direction of the fourth edge straight line;

[0206] and, based on the first center point, the second center point, the first extension direction, and the second extension direction, obtaining a second anomaly coefficient of the third edge straight line;

[0207] And, based on the second abnormality coefficient, it is determined again whether the third edge straight line is an abnormal edge straight line.

[0208] As a specific embodiment of the present application, the processing device 12 obtains the calculation formula of the second abnormal coefficient of the third edge straight line based on the first center point, the second center point, the first extension direction, and the second extension direction as follows:

[0209]

[0210] Among them, J B,i represents the second abnormal coefficient of the i-th edge line in the current surface defect detection image; i Indicates the first center point; O i-1 and O i+1 Both represent the second center point; θ B,i represents the first extension direction; θ B,i-1 and θ B,i+1 Both represent the second extension direction; cos() represents the cosine similarity function; || is for finding the absolute value; min() is for taking the minimum value; sigmoid() represents a function that projects the value in the brackets to the range of (0, 1).

[0211] As a specific embodiment of the present application, the processing device 12 is further used to obtain a plurality of first straight line segments based on a plurality of normal edge straight lines; each first straight line segment is at least used to characterize a third extension direction and a first extension length of a floating line portion of the woven line in the plastic woven bag;

[0212] And, based on each first straight line segment, a fourth extension direction and a second extension length are obtained by a principal component analysis algorithm; the fourth extension direction is the principal component extension direction in each third extension direction; the second extension length is the principal component extension length in each first extension length;

[0213] And, based on the multiple normal edge straight lines, a fourth edge straight line is obtained; the fourth edge straight line is any one edge straight line among the multiple normal edge straight lines;

[0214] and, based on the fourth edge straight line, obtaining a plurality of second straight line segments;

[0215] and, based on the plurality of second straight line segments, obtaining a fifth extension direction and a third extension length corresponding to the second straight line segments;

[0216] And, based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction, a first abnormality coefficient is obtained.

[0217] As a specific embodiment of the present application, the processing device 12 obtains a calculation formula for the first abnormality coefficient based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction as follows:

[0218]

[0219] Among them, Q j represents the first abnormal coefficient of the jth normal edge line; θ i L represents the angle formed between the fifth extension direction corresponding to the i-th second straight line segment in the j-th normal edge straight line and the fourth extension direction; i represents the third extension length corresponding to the i-th second straight line segment in the j-th normal edge straight line; represents the second extension length; sin() represents the sine function; || represents the absolute value; sigmoid() represents the function that projects the value in the brackets to the range of (0, 1).

[0220] As a specific embodiment of the present application, the processing device 12 is also used to determine that the plastic woven bag is abnormal if there is an abnormal edge straight line;

[0221] And, if there is no abnormal edge straight line, but the first abnormal coefficient is greater than or equal to a first preset value, the plastic woven bag is judged to be abnormal; otherwise, the plastic woven bag is judged to be normal.

[0222] It should be clear that the plastic woven bag surface defect detection system proposed in this application can detect tiny defects formed on the surface of the woven bag (for example, jumper wires, wire drawing, or abnormal weaving direction of a certain woven wire, etc.) by means of edge detection algorithm. And this application uses the characteristic of the woven wire having two edges to filter out some data that interferes with the detection results, making the subsequent detection results more accurate.

[0223] After introducing the plastic woven bag surface defect detection system proposed in the embodiments of the present application, a computer-readable storage medium proposed in the present application is introduced below. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the plastic woven bag surface defect detection method as described in any of the above embodiments.

[0224] It should be clear that the computer-readable storage media in this application include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technology, read-only compact disc read-only memory, digital versatile disc or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.

[0225] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0226] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the methods, devices and equipment described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0227] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0228] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0229] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0230] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0231] The computer program product includes one or more computer instructions. When the computer program is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disk), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0232] Although the embodiments of the present application have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles of the present application.

Claims

1. A method for detecting surface defects of plastic woven bags, characterized in that: include: Acquire the current surface defect detection image of the plastic woven bag; Based on the current surface defect detection image, a plurality of edge straight lines are obtained by an edge detection algorithm; each edge straight line is used to characterize at least an extension direction and an extension length of a gap between two adjacent braided wires in the plastic woven bag; Based on the plurality of edge straight lines, an abnormal edge straight line and a plurality of normal edge straight lines are obtained; Based on a plurality of normal edge straight lines, obtaining a first abnormal coefficient; The first abnormal coefficient is at least used to characterize the length of each floating line segment in the current surface defect detection image along a first direction; the first direction is parallel to the weaving direction of the plastic woven bag; Based on the first abnormality coefficient and the abnormal edge straight line, determining whether the plastic woven bag is abnormal; The method for obtaining an abnormal edge line and a plurality of normal edge lines is as follows: based on a plurality of edge lines, a first edge line is obtained; the first edge line is any one of the plurality of edge lines; based on the first edge line and each second edge line, a plurality of similarities are obtained; the second edge line is any one of the plurality of edge lines that is different from the first edge line; based on each similarity, whether the first edge line is an abnormal edge line is determined; The calculation formula of similarity is as follows: ; in, is the similarity of the i-th edge line of the analysis image in the current surface defect detection image, is the extension direction of the i-th edge straight line of the analysis image in the current surface defect detection image, is the extension direction of the kth edge line of the prior image in the current surface defect detection image, is the extension direction of the kth edge line in the historical surface defect detection image; is the cosine similarity function; To find the absolute value; To get the maximum value.

2. The method for detecting surface defects of plastic woven bags according to claim 1, characterized in that: The surface defect detection image includes a priori image and an analysis image; the priori image and the analysis image are sequentially distributed along the length direction of the surface defect detection image, and the lengths of the priori image and the analysis image are both 1 / 2 of the length of the surface defect detection image; The length direction of the surface defect detection image is parallel to the first direction; The step of obtaining the current surface defect detection image of the plastic woven bag comprises: Acquire a first time; the first time is the acquisition time of a historical surface defect detection image; the historical surface defect detection image is a surface defect detection image that is sequentially adjacent to the current surface defect detection image; Obtaining the actual length of the plastic woven bag along the weaving direction in the historical surface defect detection image; Based on the actual length, a first length is acquired; the first length is 1 / 2 of the actual length; Get the current weaving speed; Based on the first length and the current weaving speed, obtaining a first time period; the first time period is the first length divided by the current weaving speed; Based on the first time and the first time period, obtain a second time; the second time is the sum of the first time and the first time period; At the second time, a current surface defect detection image is captured.

3. The method for detecting surface defects of plastic woven bags according to claim 2, characterized in that: After obtaining the abnormal edge straight lines and the multiple normal edge straight lines based on the multiple edge straight lines, the method further includes: Based on the multiple abnormal edge lines, a third edge line and a fourth edge line are obtained; the third edge line is any one edge line among the multiple abnormal edge lines; the fourth edge line is an edge line adjacent to the third edge line among the multiple abnormal edge lines; Based on the third edge straight line, a first center point and a first extension direction are acquired; the first center point is the center point of the third edge straight line; the first extension direction is the extension direction of the third edge straight line; Based on the fourth edge straight line, a second center point and a second extension direction are acquired; the second center point is the center point of the fourth edge straight line; the second extension direction is the extension direction of the fourth edge straight line; Based on the first center point, the second center point, the first extension direction, and the second extension direction, obtaining a second anomaly coefficient of the third edge straight line; Based on the second abnormality coefficient, it is determined again whether the third edge straight line is an abnormal edge straight line.

4. The method for detecting surface defects of plastic woven bags according to claim 3, characterized in that: The calculation formula for obtaining the second abnormal coefficient of the third edge straight line based on the first center point, the second center point, the first extension direction, and the second extension direction is as follows: ; in, represents the second abnormal coefficient of the i-th edge line in the current surface defect detection image; represents the first center point; and Both represent the second center point; represents a first extension direction; and Both represent the second extension direction; represents the cosine similarity function; To find the absolute value; To take the minimum value; It represents the function that projects the value in the brackets to the interval (0, 1); L is the width of the braided line in the image.

5. The method for detecting surface defects of plastic woven bags according to any one of claims 1 to 4, characterized in that: The step of obtaining a first abnormal coefficient based on a plurality of normal edge straight lines includes: Based on a plurality of normal edge straight lines, a plurality of first straight line segments are obtained; each first straight line segment is used at least to characterize a third extension direction and a first extension length of a floating line portion of the woven line in the plastic woven bag; Based on each first straight line segment, a fourth extension direction and a second extension length are obtained by a principal component analysis algorithm; the fourth extension direction is the principal component extension direction in each third extension direction; and the second extension length is the principal component extension length in each first extension length; Based on the multiple normal edge lines, a fifth edge line is obtained; the fifth edge line is any one of the multiple normal edge lines; Based on the fifth edge straight line, acquiring a plurality of second straight line segments; Based on the plurality of second straight line segments, acquiring a fifth extension direction and a third extension length corresponding to the second straight line segments; Based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction, a first abnormality coefficient is acquired.

6. The method for detecting surface defects of plastic woven bags according to claim 5, characterized in that: The calculation formula for obtaining the first abnormal coefficient based on the second extension length, the third extension length, the fourth extension direction and the fifth extension direction is as follows: ; in, represents the first abnormal coefficient of the jth normal edge line; represents the angle formed between the fifth extension direction corresponding to the i-th second straight line segment in the j-th normal edge straight line and the fourth extension direction; represents the third extension length corresponding to the i-th second straight line segment in the j-th normal edge straight line; represents the second extension length; represents the cosine function; Indicates the absolute value. It represents a function that projects the values ​​in the brackets into the range (0, 1).

7. The method for detecting surface defects of plastic woven bags according to claim 6, characterized in that: The step of judging whether the plastic woven bag is abnormal based on the first abnormal coefficient and the abnormal edge straight line includes: If there is an abnormal edge straight line, it is determined that the plastic woven bag is abnormal; If there is no abnormal edge straight line, but the first abnormal coefficient is greater than or equal to a first preset value, it is determined that the plastic woven bag is abnormal; Otherwise, it is determined that the plastic woven bag is normal.

8. A plastic woven bag surface defect detection system, characterized in that: include: An acquisition device, used for acquiring a current surface defect detection image of the plastic woven bag; A processing device, for obtaining a plurality of edge straight lines by an edge detection algorithm based on the current surface defect detection image; each edge straight line is used at least to characterize the extension direction and extension length of the gap between two adjacent braided wires in the plastic woven bag; and, based on the plurality of edge straight lines, obtaining an abnormal edge straight line and a plurality of normal edge straight lines; and, based on the plurality of normal edge straight lines, obtaining a first abnormal coefficient; The first abnormal coefficient is at least used to characterize the length of each floating line segment in the current surface defect detection image along a first direction; the first direction is parallel to the weaving direction of the plastic woven bag; and, judging whether the plastic woven bag is abnormal based on the first abnormal coefficient and the abnormal edge straight line; And, the method for obtaining an abnormal edge line and a plurality of normal edge lines is: based on a plurality of edge lines, obtaining a first edge line; the first edge line is any one of the plurality of edge lines; based on the first edge line and each second edge line, obtaining a plurality of similarities; the second edge line is any one of the plurality of edge lines that is different from the first edge line; based on each similarity, determining whether the first edge line is an abnormal edge line; And, the similarity calculation formula is as follows: ; in, is the similarity of the i-th edge line of the analysis image in the current surface defect detection image, is the extension direction of the i-th edge straight line of the analysis image in the current surface defect detection image, is the extension direction of the kth edge line of the prior image in the current surface defect detection image, is the extension direction of the kth edge line in the historical surface defect detection image; is the cosine similarity function; To find the absolute value; To get the maximum value.

Citation Information

Patent Citations

  • Textile quality detection method based on image processing

    CN115100214A

Cited By

  • Woven bag surface defect detection method based on image recognition

    CN122265180A