A visual detection method for broken threads on complex lace of clothing

By analyzing pixel point characteristics of the non-closed edge curves of the clothing lace area, screening and judging the real broken line, the problem of difficulty in distinguishing broken threads from textures in the existing technology is solved, and a more accurate detection of broken threads of complex laces in the clothing is achieved.

CN118521582BActive Publication Date: 2024-11-15DANDONG YILU CLOTHING TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410985932.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-15
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

When the existing edge detection algorithm detects complex lace broken clothing, it cannot effectively distinguish the normal texture that is not connected to the clothing texture itself, resulting in misjudgment and increasing the cost of manual inspection.

Method used

By obtaining the grayscale image of the lace area of ​​the clothing, performing pixel point characteristics analysis of the non-closed edge curve, and filtering out suspected broken lines, combining the direction of the line head, the extension direction of the line body and the grayscale value characteristics, the real broken lines are judged and marked.

Benefits of technology

It improves the accuracy of detection of complex lace broken silk in clothing, saves labor and time resources, and solves the problem that the existing technology cannot distinguish between broken silk from texture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521582B_ABST
    Figure CN118521582B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing, and specifically to a visual detection method for broken threads in complex lace of clothing, comprising: obtaining an image of a lace area of ​​clothing and performing preprocessing to obtain a grayscale image of the lace area of ​​clothing; obtaining all non-closed edge curves in the grayscale image; performing a first pixel point feature analysis on all the non-closed edge curves to obtain a suspected curve pair set, wherein the suspected curve pair set includes at least one group of suspected curve pairs; performing a second pixel point feature analysis on the at least one group of suspected curve pairs one by one; and screening out real broken line pairs from the suspected curve pair set according to the pixel point feature analysis. The present invention performs pixel point feature analysis on non-closed edge curves, preliminarily screens suspected broken lines, and then determines real broken lines, thereby determining the broken line problem of complex lace of clothing, and solves the problem that the existing edge detection algorithm cannot distinguish whether the lace area is a broken line problem or the clothing texture itself is not connected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing, and in particular to a visual detection method for broken threads of complex lace on clothing. Background Art

[0002] In order to cater to the public's aesthetic taste, modern textile industry will design some complex lace to decorate the collar and cuffs of clothes. These complex laces are woven by hand or machine through complex procedures and are very precise. During the weaving process, strong pulling and other factors may cause the textile thread to break. In order to ensure the quality of clothing, it is necessary to detect the broken threads of complex lace on clothing.

[0003] Under the existing technology, the detection of broken threads that may occur during the knitting process of clothing is often carried out using edge segmentation algorithms. However, when faced with some more complex lace designs, this method may cause the algorithm to be unable to distinguish between broken threads and normal textures that are not connected to the clothing itself but are similar to broken threads. This may lead to problems such as misjudgment and increase the cost of manual detection. Summary of the invention

[0004] In order to solve the problem that the existing edge detection algorithm cannot distinguish the problem of broken threads and the problem that the texture of the clothing itself is not connected, the present invention provides a visual detection method for broken threads of complex lace on clothing, the method comprising:

[0005] Acquire an image of a clothing lace region and perform preprocessing to obtain a grayscale image of the clothing lace region;

[0006] Acquire all non-closed edge curves in the grayscale image;

[0007] Performing a first pixel feature analysis on all the non-closed edge curves to obtain a suspected curve pair set, wherein the suspected curve pair set includes at least one group of suspected curve pairs;

[0008] Performing second pixel feature analysis on the at least one group of suspected curve pairs one by one;

[0009] According to the pixel feature analysis, the real broken line pairs are screened out from the suspected curve pairs.

[0010] The real disconnected pairs are marked.

[0011] Wherein, a group of suspected curve pairs includes a first suspected broken line and a second suspected broken line;

[0012] The performing first pixel feature analysis on all the non-closed edge curves to obtain a set of suspected curve pairs specifically includes:

[0013] Calculate the line head pointing direction and line body extension direction of each non-closed edge curve;

[0014] Calculate the grayscale value of the first pixel of the first endpoint of each non-closed edge curve, where the first endpoint is the endpoint on the line head side;

[0015] Calculating a second pixel grayscale value of a pixel within a preset neighborhood of the first endpoint;

[0016] Determine whether the non-closed edge curve is a suspected broken line according to the grayscale value of the first pixel point, the grayscale value of the second pixel point, the direction of the line head and the extending direction of the line body of the same non-closed edge curve, so as to obtain a first suspected broken line;

[0017] Screening another non-closed edge curve matching the first suspected broken line to obtain a second suspected broken line;

[0018] The first suspected broken line and the second suspected broken line form a suspected curve pair;

[0019] All suspected curve pairs are grouped into suspected curve pair sets.

[0020] The step of calculating the line head pointing direction and the line body extending direction of each non-closed edge curve specifically includes:

[0021] For a non-closed edge curve, traverse edge pixel points of the non-closed edge curve, and obtain turning points of the non-closed edge curve according to the edge pixel points;

[0022] A thread head portion is obtained according to the turning point and the first end point of the non-closed edge curve, and the remaining portion of the non-closed edge curve is the thread body portion;

[0023] Traversing the pixel points of the line head part, and calculating the line head pointing direction of the line head part;

[0024] The pixel points of the thread body portion are traversed to calculate the thread body extension direction of the thread body portion.

[0025] The step of determining whether the non-closed edge curve is a suspected broken line according to the grayscale value of the first pixel point, the grayscale value of the second pixel point, the line head pointing direction and the line body extending direction of the same non-closed edge curve to obtain a first suspected broken line specifically includes:

[0026] Calculate the line break feature value of the non-closed edge curve according to the gray value of the first pixel point, the gray value of the second pixel point, the line head pointing direction and the line body extending direction of the same non-closed edge curve;

[0027] Comparing the disconnection characteristic value with a first preset threshold;

[0028] If the broken line characteristic value is greater than the first preset threshold, the non-closed edge curve is determined to be a first suspected broken line.

[0029] The step of screening another non-closed edge curve matching the first suspected broken line to obtain a second suspected broken line specifically includes:

[0030] Traversing other non-closed edge curves except the first suspected broken line, and respectively calculating the difference degree of the line head direction and the difference degree of the line body extension direction between the other non-closed edge curves and the first suspected broken line;

[0031] Calculate the unilateral direction difference of all non-closed edge curves respectively, where the unilateral direction difference is the difference between the line head pointing direction and the line body extending direction of the same non-closed edge curve;

[0032] Calculate the line break matching value between the other non-closed edge curves and the first suspected line break according to the line head direction difference, the line body extension direction difference, the single-side direction difference, and the single-side curve length of all non-closed edge curves, where the single-side curve length is the number of pixels of the non-closed edge curve;

[0033] A second suspected line break matching the first suspected line break is obtained according to the line break association value.

[0034] The step of performing second pixel feature analysis on the at least one group of suspected curve pairs one by one specifically includes:

[0035] Calculate a first grayscale average value of edge pixel points of a first suspected broken line in the at least one group of suspected curve pairs;

[0036] Calculate a second grayscale average value of edge pixel points of a second suspected broken line in the at least one group of suspected curve pairs;

[0037] A third grayscale average value of pixel points in a broken area between a first suspected broken line and a second suspected broken line in the at least one group of suspected curve pairs is calculated.

[0038] The step of selecting the real broken line pairs from the suspected curve pairs according to the pixel feature analysis specifically includes:

[0039] Analyzing the gray value similarity of the first gray value average and the second gray value average of the same group of suspected curve pairs;

[0040] Analyzing the first grayscale value difference between the third grayscale average value and the first grayscale average value of the same group of suspected curve pairs, and the second grayscale value difference between the third grayscale average value and the second grayscale average value;

[0041] Whether the corresponding suspected curve pair is a real broken line pair is determined according to the gray value similarity, the first gray value difference, and the second gray value difference.

[0042] The step of judging whether the corresponding suspected curve pair is a real broken line pair according to the gray value similarity, the first gray value difference, and the second gray value difference specifically includes:

[0043] Calculating the line break quantization value of the corresponding suspected curve pair by combining the gray value similarity, the first gray value difference, and the second gray value difference;

[0044] If the line-break quantization value is greater than a second preset value, the suspected curve pair is a real line-break pair.

[0045] The step of acquiring all non-closed edge curves in the grayscale image specifically includes:

[0046] Perform edge detection on the grayscale image using an edge detection algorithm to obtain all non-closed edge curves in the grayscale image.

[0047] After selecting the real broken line pairs from the set of suspected curve pairs according to the pixel feature analysis, the method further includes:

[0048] Marking the real disconnected pairs;

[0049] The marked actual disconnected pairs are displayed.

[0050] The present invention has the following beneficial effects: the present invention analyzes the pixel point features of the non-closed edge curve, preliminarily screens the suspected broken wires, and then determines the real broken wires, thereby judging the broken wire problem of the complex lace of the clothing, combining the directional features of the head part and the body part of the non-closed edge curve, the pixel points on the trend path and other feature information, and judging the suspicious area according to the unique features of the broken wire problem, so that the detection of the broken wire problem of the complex lace of the clothing is more accurate, saving manpower and time resources, and solving the problem that the existing edge detection algorithm cannot distinguish whether the lace area is a broken wire problem or the clothing texture itself is not connected. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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.

[0052] Figure 1 A schematic diagram of a first process flow of a method for visually detecting broken threads of complex lace on clothing provided by an embodiment of the present invention;

[0053] Figure 2A schematic diagram of a first sub-process of a method for visually detecting broken threads on complex lace of clothing provided by an embodiment of the present invention;

[0054] Figure 3 A schematic diagram of a second sub-process of a method for visually detecting broken threads on complex lace of clothing provided by an embodiment of the present invention;

[0055] Figure 4 A schematic diagram of a third sub-process of a method for visually detecting broken threads on complex lace of clothing provided by an embodiment of the present invention;

[0056] Figure 5 A schematic diagram of a fourth sub-process of a method for visually detecting broken threads on complex lace of clothing provided by an embodiment of the present invention;

[0057] Figure 6 A schematic diagram of a fifth sub-process of a method for visually detecting broken threads on complex lace of clothing provided by an embodiment of the present invention;

[0058] Figure 7 A second flow chart of a method for visually detecting broken threads of complex lace on clothing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] 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 a method and system for detecting the connection line of the indoor unit of a fixed-frequency air conditioner proposed by the present invention, its specific implementation method, 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.

[0060] 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.

[0061] The specific scheme of the visual detection method for broken threads of complex lace on clothing provided by the present invention is described in detail below in conjunction with the accompanying drawings.

[0062] See also Figure 1 , which shows a method flow chart of a method for visually detecting broken threads of complex lace on clothing provided by an embodiment of the present invention, and the method for detecting the connection line of the indoor unit of a fixed-frequency air conditioner includes steps S101-S105:

[0063] S101, acquiring an image of a clothing lace region and performing preprocessing to obtain a grayscale image of the clothing lace region.

[0064] The complex lace image of clothing is obtained through the camera, and it is grayscaled and subjected to noise reduction preprocessing to obtain a grayscale image.

[0065] S102: Acquire all non-closed edge curves in the grayscale image.

[0066] In one embodiment, obtaining all non-closed edge curves in the grayscale image specifically includes: performing edge detection on the grayscale image using an edge detection algorithm to obtain all non-closed edge curves in the grayscale image.

[0067] When the lace of clothing is relatively complex, the edge detection algorithm cannot distinguish whether these non-closed edge curves are caused by broken threads of clothing lace or by the normal disconnection of clothing texture itself, which will lead to misjudgment of broken threads. Therefore, in order to determine whether the lace of clothing is broken, all non-closed edge curves need to be further analyzed.

[0068] S103: Perform first pixel feature analysis on all the non-closed edge curves to obtain a set of suspected curve pairs, where the set of suspected curve pairs includes at least one group of suspected curve pairs.

[0069] The present application performs preliminary screening based on the pixel feature values ​​of the non-closed edge curve, that is, performs a first pixel feature analysis to preliminarily screen out suspected broken lines.

[0070] In one embodiment, if Figure 2 As shown, step S103 specifically includes steps S1031-S1037:

[0071] S1031. Calculate the line head pointing direction and line body extending direction of each non-closed edge curve.

[0072] The problem of broken threads is equivalent to a textile thread that originally belonged to the same line being broken in the middle. For a single-sided breakpoint, it loses the tension when connected and becomes loose, causing the thread head to rebound and point in a random direction, while the direction of the thread body does not change much. The difference between the direction of the thread head and the direction of the thread body will become larger. In contrast, the normal unconnected texture is regular, and the direction of the unconnected point is generally similar to the direction of the thread body. In addition, after the thread is broken, there is only one direction of the breakpoint that is a textile thread, while before the break, the breakpoint position should have two relative directions that are textile threads. Therefore, if any non-closed edge curve is a broken thread problem, the result will be a significant difference between the direction of the thread body extension and the direction of the thread head.

[0073] Further, in one embodiment, if Figure 3 As shown, step S1031 includes steps S301-S304:

[0074] S301 . For a non-closed edge curve, traverse edge pixel points of the non-closed edge curve, and obtain turning points of the non-closed edge curve according to the edge pixel points.

[0075] For any non-closed edge curve, traverse the edge pixels on the non-closed edge curve, assuming that there are For edge pixels, take each edge pixel as the center and all edge pixels in the 7*7 center window for least square method to find the absolute value of the left and right fitting slope difference of the edge pixel. , Indicates the bending degree of the edge curve at the ath edge pixel point. Assume ,Will The edge pixel represented by is recorded as the turning point of the non-closed edge curve .

[0076] S302: Obtain a line head portion according to a turning point and a first endpoint of the non-closed edge curve, and the remaining portion of the non-closed edge curve is a line body portion.

[0077] Turning Point The corresponding non-closed edge curve is divided into the line body part and the line head part, that is, The closer end To the turning point The part between them is the line head part of the non-closed edge curve, and the remaining part is the line body part.

[0078] S303, traverse the pixel points of the line head part, and calculate the line head pointing direction of the line head part.

[0079] S304, traverse the pixel points of the thread body part, and calculate the thread body extension direction of the thread body part.

[0080] The least squares method is used to fit the slope of all edge pixels of the thread head and the thread body to obtain the direction of the thread head. Indicates the direction of extension of the wire body, using express.

[0081] S1032. Calculate the grayscale value of a first pixel point of a first endpoint of each non-closed edge curve, where the first endpoint is an endpoint on the line head side.

[0082] S1033. Calculate the second pixel grayscale value of the pixel within a preset neighborhood of the first endpoint.

[0083] Further, obtain the endpoint associated with the first endpoint The gray value of the second pixel of the adjacent 8 pixels is recorded as , and take the The two closest values ​​are recorded as and (Assumption Compare closer).

[0084] S1034, judging whether the non-closed edge curve is a suspected broken line according to the grayscale value of the first pixel point, the grayscale value of the second pixel point, the line head pointing direction and the line body extending direction of the same non-closed edge curve, so as to obtain a first suspected broken line.

[0085] For any non-closed edge curve, set a quantitative value for the possibility that it may be one of the broken edges in the broken wire problem , called the broken line eigenvalue, It is related to the gray value of the first pixel, the gray value of the second pixel, the direction of the thread head and the extending direction of the thread body.

[0086] In one embodiment, if Figure 4 As shown, step S1034 specifically includes:

[0087] S401, calculating the line break feature value of the non-closed edge curve according to the gray value of the first pixel point, the gray value of the second pixel point, the line head pointing direction and the line body extending direction of the same non-closed edge curve .

[0088] S402: Compare the line break feature value with a first preset threshold value, and if the line break feature value is greater than the first preset threshold value, determine that the non-closed edge curve is a first suspected line break.

[0089] The calculation formula is:

[0090] ;

[0091] in, Represents the endpoint of a non-closed edge curve Gray value of the pixel at the location; Representation endpoint The pixel point at the location is within the preset neighborhood and The closest gray value; Representation endpoint The pixel point at the location is within the preset neighborhood and The second closest gray value; Indicates the direction of the line head of the non-closed edge curve; Indicates the extension direction of the line body of the non-closed edge curve. is a constant, which can be set to 0.01 to avoid the denominator of the formula being zero.

[0092] is the endpoint of the non-closed edge curve The absolute value of the difference between the grayscale value of the pixel position and the grayscale value of the closest pixel in its preset neighborhood, which shows whether there is a textile line around the endpoint. If it is a textile line, the grayscale values ​​are similar. The smaller the value, the greater the probability that there is a textile line around. is the endpoint The absolute value of the difference between the grayscale value of the pixel position and the grayscale value of the second closest pixel in its preset neighborhood, which shows whether there is only one textile line around the endpoint (if it exists). The larger the value, the greater the probability that there is only one textile line around the endpoint (if it exists); The endpoints are shown in a comprehensive manner Is there a textile line in one and only one direction around? The larger the value, the closer the endpoint is. The more likely it is that there is a textile line in only one direction around; It is the absolute value of the difference between the line extension direction and the line end direction of the non-closed edge curve, which shows the difference between the line extension direction and the line end direction. The larger the value, the more obvious the difference between the line extension direction and the line end direction.

[0093] It comprehensively represents the difference between the extension direction of the line body and the direction of the line head of the non-closed edge curve, and whether the gray value of the line head and its preset neighborhood is only slightly similar. The larger the value is, the more obvious the broken wire problem characteristics of the non-closed edge curve are, and the more likely it is that it is one of the broken edges of the broken wire problem.

[0094] Set a first preset threshold value, value ,like , it can be considered that the non-closed edge curve is likely to belong to one of the broken edges of the broken wire problem, that is, the first suspected broken wire.

[0095] S1035: Screen another non-closed edge curve that matches the first suspected broken line to obtain a second suspected broken line.

[0096] After obtaining one of the broken edges, it is necessary to continue to find another broken edge that matches it, and then determine the possibility that the two are broken wire problems.

[0097] The problem of broken wire is equivalent to a textile thread that originally belonged to the same line being broken in the middle. For a single-sided breakpoint, the longer its length is, the greater the resilience of the broken thread end is, and the greater the difference between the direction of the thread end and the direction of the thread body extension is; for a pair of broken line segments on both sides that originally belonged to one line, the directions of the two thread bodies are similar, but the directions of the thread ends are quite different. In comparison, the directions of the thread ends on both sides of normal unconnected textures are similar; therefore, if a non-closed edge curve can find another non-closed edge curve to match it and this pair of non-closed edge curves shows that the difference between the single-sided thread body extension direction and the thread end direction becomes more obvious as its own length increases, and the directions of the two sides of the thread body are similar but the directions of the thread ends are different, it can be considered that this pair of edge curves is likely to have a broken wire problem.

[0098] In one embodiment, if Figure 5 As shown, step S1035 specifically includes the following steps:

[0099] S501, traversing other non-closed edge curves except the first suspected broken line, and respectively calculating the difference in line head direction and line body extension direction between the other non-closed edge curves and the first suspected broken line.

[0100] S502 , calculating the unilateral direction difference of all non-closed edge curves respectively, where the unilateral direction difference is the difference between the line head pointing direction and the line body extending direction of the same non-closed edge curve.

[0101] S503. Calculate the line break matching value between the other non-closed edge curves and the first suspected line break according to the line head direction difference, the line body extension direction difference, the single-side direction difference, and the single-side curve length of all non-closed edge curves, where the single-side curve length is the number of pixels of the non-closed edge curve.

[0102] S504: Obtain a second suspected line break matching the first suspected line break according to the line break association value.

[0103] Along the extension direction of the first suspected broken wire Look forward to see if there is another non-closed edge curve. If not, it is considered that the first suspected wire break is not a wire break problem. If so, pair the two (called a non-closed edge curve pair) and use the previous method for the first suspected wire break to calculate the paired non-closed edge curve (assuming that the non-closed edge curve has a common edge pixels) point to the direction of the line head , and the direction of line extension For this non-closed edge curve pair, set a quantitative value for the possibility that it may be a broken wire problem , called the disconnection matching value.

[0104] The calculation formula is:

[0105] ;

[0106] in, Indicates the direction of the first suspected broken line head; Indicates the extension direction of the first suspected broken wire; Indicates the number of edge pixels of the first suspected broken line, that is, the length of the single-side curve of the first suspected broken line; , , Similarly, the above attribute value of the non-closed edge curve paired with the first suspected broken line is represented as follows: , is a constant, which can be set to 0.01 to avoid the denominator in the formula being zero.

[0107] It is the absolute value of the difference between the line head pointing directions of the non-closed edge curve pair, which shows the difference in the line head directions of the non-closed edge curve pair. The larger the value, the greater the difference in the line head pointing directions of the two non-closed edge curves. is the absolute value of the difference between the line extension directions of the pair of non-closed edge curves, which shows the difference between the line extension directions of the pair of non-closed edge curves. The smaller the value, the smaller the difference between the line extension directions of the two non-closed edge curves. It comprehensively represents the line body similarity and line head difference of the non-closed edge curve pair. The larger the value is, the greater the similarity of the line body extension direction and the difference of the line head pointing direction are.

[0108] It is the ratio of the absolute value of the difference between the extension direction of the first suspected broken line and the direction of the line head to the length of the single-side curve of the first suspected broken line (that is, the total number of edge pixels). Indicates the above attribute value of the paired non-closed edge curve. The difference between the two It reflects whether the difference between the extension direction of the wire body and the direction of the wire head is proportional to the length of the single-sided curve. The smaller it is, the more likely it is to be in a proportional relationship, that is, the longer the length of the broken line, the greater the difference between the slope of the broken line itself and the slope of the breakpoint.

[0109] It comprehensively reflects the similarity of the line extension direction of the non-closed edge curve pair, the difference in the line head pointing direction, and whether the difference between the single-side line head pointing direction and the line body extension direction is proportional to the single-side curve length. The larger the value is, the more likely the non-closed edge curve pair is a broken wire problem.

[0110] Generally speaking, there is at most one non-closed edge curve paired with a first suspected broken line, so a larger threshold can be set. ,like It can be considered that the non-closed edge curve pair is most likely to be a broken wire problem, that is, the second suspected broken wire is obtained.

[0111] S1036: Combine the first suspected broken line and the second suspected broken line into a suspected curve pair.

[0112] S1037. All the suspected curve pairs are combined into a suspected curve pair set.

[0113] According to the above method, matched suspected curve pairs were obtained, and the suspected broken wire problem was preliminarily obtained, which was added to the suspected curve pair set for the next step of screening.

[0114] S104: Perform second pixel feature analysis on the at least one group of suspected curve pairs one by one.

[0115] After the above calculation and comparison, a set of suspected curve pairs can be obtained, in which the suspected curve pairs all meet the characteristics of broken wire curves. It is necessary to judge the pixel grayscale values ​​between these suspected curve pairs to further determine whether they belong to the broken wire problem.

[0116] In one embodiment, step S104 specifically includes the following:

[0117] Calculate a first grayscale average value of edge pixel points of a first suspected broken line in the at least one group of suspected curve pairs.

[0118] A second grayscale average value of edge pixel points of a second suspected broken line in the at least one group of suspected curve pairs is calculated.

[0119] A third grayscale average value of pixel points in a broken area between a first suspected broken line and a second suspected broken line in the at least one group of suspected curve pairs is calculated.

[0120] The grayscale averages of the two curves in the suspected curve pair are obtained respectively, that is, the first grayscale average of the edge pixel points of the first suspected broken line The edge pixel point of the second suspected disconnection ; Connect the end point of the first suspected broken line with the end point of the second suspected broken line to obtain the area passed by the connecting line, i.e., the broken area, and obtain the average grayscale value of the pixels in the broken area, i.e., the third average grayscale value .

[0121] The broken wire problem can be further confirmed by analyzing the first grayscale average value, the second grayscale average value, and the third grayscale average value.

[0122] S105 , selecting real broken line pairs from the set of suspected curve pairs according to the pixel feature analysis.

[0123] The broken wire problem is further confirmed by performing feature analysis on the path pixel points composed of the first suspected broken wire and the second suspected broken wire.

[0124] In one embodiment, if Figure 6 As shown, step S105 specifically includes the following steps:

[0125] S1051, analyzing the grayscale value similarity of the first grayscale average value and the second grayscale average value of the same group of suspected curve pairs.

[0126] S1052: Analyze the first grayscale value difference between the third grayscale average value and the first grayscale average value of the same group of suspected curve pairs, and the second grayscale value difference between the third grayscale average value and the second grayscale average value.

[0127] S1053. Determine whether the corresponding suspected curve pair is a real broken line pair according to the gray value similarity, the first gray value difference, and the second gray value difference.

[0128] The broken thread problem is equivalent to a textile thread that originally belonged to the same thread being broken in the middle, and two broken textile threads will be formed after the break, that is, the middle of the two threads is the broken area. If the grayscale values ​​between the first suspected broken thread and the second suspected broken thread in the non-closed edge curve pair are similar in grayscale value, and the grayscale value of the broken area sandwiched between the two threads is significantly different from the grayscale values ​​of the two curves themselves.

[0129] Therefore, the grayscale value similarity between the first grayscale average and the second grayscale average, the first grayscale value difference between the third grayscale average and the first grayscale average, and the second grayscale value difference between the third grayscale average and the second grayscale average are analyzed. The greater the grayscale value similarity, the greater the first grayscale value difference, and the greater the second grayscale value difference, it can be considered that both belong to broken wire problems.

[0130] In one embodiment, step S1053 specifically includes: calculating the line break quantization value of the corresponding suspected curve pair in combination with the gray value similarity, the first gray value difference, and the second gray value difference; if the line break quantization value is greater than a second preset value, the suspected curve pair is a real line break pair.

[0131] Set a quantitative value for the probability that the suspected curve pair is a broken wire problem , called the line-breaking quantization value, the line-breaking quantization value The calculation formula is:

[0132] ;

[0133] in, The grayscale average value of all edge pixels of the first suspected broken line in the suspected broken line pair, that is, the first grayscale average value mentioned above; represents the grayscale average value of all edge pixels on the second suspected broken line paired with it, that is, the second grayscale average value mentioned above; It represents the grayscale average value of all pixels on the connecting line (i.e. the broken area) after connecting the two suspected broken line end points, that is, the third grayscale average value mentioned above. is a constant, which can be set to 0.01 to avoid the denominator being zero in the formula.

[0134] It is the absolute value of the difference between the first grayscale average value of the first suspected broken line and the second grayscale average value of the second suspected broken line, indicating the similarity of the grayscale values ​​of the two. The smaller the value, the higher the similarity between the grayscale average values ​​of the two.

[0135] It can be further expressed as , The difference between the first grayscale average value of the suspected broken wire pair and the third grayscale value of the broken area, that is, the first grayscale value difference, It represents the difference between the second grayscale average value and the third grayscale average value, that is, the second grayscale value difference. The absolute value of the sum of the two represents the difference between the average grayscale value of the pixels of the two suspected broken lines themselves and the broken area. The larger the value, the higher the difference between the two suspected broken lines and the broken area.

[0136] It comprehensively represents the similarity of the grayscale values ​​of the two suspected broken wires in the suspected broken wire pair, as well as the difference between the grayscale values ​​of the two suspected broken wires and the grayscale values ​​of the broken area. The larger the value is, the more similar the grayscale average values ​​of the first suspected wire break are to the second suspected wire break, and the greater the difference with the grayscale average value of the broken area is, the more likely it is a broken wire problem.

[0137] Set a second preset threshold value, and take the second preset threshold value as a larger value ,like It can be considered that the suspected broken wire pair belongs to the broken wire problem of complex lace of clothing and is a real broken wire pair.

[0138] In one embodiment, in combination Figure 7 The visual detection method for broken threads of complex lace of clothing of the present invention further comprises the following steps:

[0139] S106: Mark the real disconnected pair.

[0140] S107, displaying the marked real disconnected pairs.

[0141] After the real broken pair is found, the real broken pair is marked and displayed so as to further repair the real broken pair.

[0142] The visual detection method for broken threads in complex lace on clothing of the present invention analyzes the pixel point features of non-closed edge curves, preliminarily screens suspected broken threads, and then determines the real broken threads, thereby judging the broken threads problem of complex lace on clothing. The method combines the directional features of the head part and the body part of the non-closed edge curve, the pixel points on the trend path and other feature information, and judges the suspicious area according to the unique features of the broken thread problem, so that the detection of the broken thread problem of complex lace on clothing is more accurate, saving manpower and time resources, and solving the problem that the existing edge detection algorithm cannot distinguish whether the lace area is a broken thread problem or the clothing texture itself is not connected.

[0143] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0144] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A visual detection method for broken threads of complex lace on clothing, characterized in that: The method comprises: Acquire an image of a clothing lace region and perform preprocessing to obtain a grayscale image of the clothing lace region; Acquire all non-closed edge curves in the grayscale image; Performing a first pixel feature analysis on all the non-closed edge curves to obtain a suspected curve pair set, wherein the suspected curve pair set includes at least one group of suspected curve pairs; Performing second pixel feature analysis on the at least one group of suspected curve pairs one by one; Filtering out real broken line pairs from the set of suspected curve pairs according to the pixel feature analysis; A set of suspected curve pairs includes a first suspected broken line and a second suspected broken line; The performing first pixel feature analysis on all the non-closed edge curves to obtain a set of suspected curve pairs specifically includes: Calculate the line head pointing direction and line body extension direction of each non-closed edge curve; Calculate the grayscale value of the first pixel of the first endpoint of each non-closed edge curve, where the first endpoint is the endpoint on the line head side; Calculating a second pixel grayscale value of a pixel within a preset neighborhood of the first endpoint; Determine whether the non-closed edge curve is a suspected broken line according to the grayscale value of the first pixel point, the grayscale value of the second pixel point, the direction of the line head and the extending direction of the line body of the same non-closed edge curve, so as to obtain a first suspected broken line; Screening another non-closed edge curve matching the first suspected broken line to obtain a second suspected broken line; The first suspected broken line and the second suspected broken line form a suspected curve pair; All suspected curve pairs are grouped into suspected curve pair sets; The performing second pixel feature analysis on the at least one group of suspected curve pairs one by one specifically includes: Calculate a first grayscale average value of edge pixel points of a first suspected broken line in the at least one group of suspected curve pairs; Calculate a second grayscale average value of edge pixel points of a second suspected broken line in the at least one group of suspected curve pairs; Calculate a third grayscale average value of pixel points in a broken area between a first suspected broken line and a second suspected broken line in the at least one group of suspected curve pairs; The step of selecting the real broken line pairs from the suspected curve pairs according to the pixel feature analysis specifically includes: Analyzing the gray value similarity of the first gray value average and the second gray value average of the same group of suspected curve pairs; Analyzing the first grayscale value difference between the third grayscale average value and the first grayscale average value of the same group of suspected curve pairs, and the second grayscale value difference between the third grayscale average value and the second grayscale average value; Judging whether the corresponding suspected curve pair is a real broken line pair according to the gray value similarity, the first gray value difference, and the second gray value difference; The step of determining whether the non-closed edge curve is a suspected broken line according to the grayscale value of the first pixel point, the grayscale value of the second pixel point, the line head pointing direction and the line body extending direction of the same non-closed edge curve to obtain a first suspected broken line specifically includes: Calculate the line break feature value of the non-closed edge curve according to the gray value of the first pixel point, the gray value of the second pixel point, the line head pointing direction and the line body extending direction of the same non-closed edge curve; Comparing the disconnection characteristic value with a first preset threshold; If the line break feature value is greater than the first preset threshold, determining that the non-closed edge curve is a first suspected line break; The step of screening another non-closed edge curve matching the first suspected broken line to obtain a second suspected broken line specifically includes: Traversing other non-closed edge curves except the first suspected broken line, and respectively calculating the difference degree of the line head direction and the difference degree of the line body extension direction between the other non-closed edge curves and the first suspected broken line; Calculate the unilateral direction difference of all non-closed edge curves respectively, where the unilateral direction difference is the difference between the line head pointing direction and the line body extending direction of the same non-closed edge curve; Calculate the line break matching value between the other non-closed edge curves and the first suspected line break according to the line head direction difference, the line body extension direction difference, the single-side direction difference, and the single-side curve length of all non-closed edge curves, where the single-side curve length is the number of pixels of the non-closed edge curve; Obtaining a second suspected broken line matching the first suspected broken line according to the broken line matching value; The step of judging whether the corresponding suspected curve pair is a real broken line pair according to the gray value similarity, the first gray value difference, and the second gray value difference specifically includes: Calculating the line break quantization value of the corresponding suspected curve pair by combining the gray value similarity, the first gray value difference, and the second gray value difference; If the line-break quantization value is greater than a second preset value, the suspected curve pair is a real line-break pair.

2. The visual detection method for broken threads of complex lace on clothing according to claim 1, characterized in that: The calculating of the line head pointing direction and the line body extending direction of each non-closed edge curve specifically includes: For a non-closed edge curve, traverse edge pixel points of the non-closed edge curve, and obtain turning points of the non-closed edge curve according to the edge pixel points; A thread head portion is obtained according to the turning point and the first end point of the non-closed edge curve, and the remaining portion of the non-closed edge curve is the thread body portion; Traversing the pixel points of the line head part, and calculating the line head pointing direction of the line head part; The pixel points of the thread body portion are traversed to calculate the thread body extension direction of the thread body portion.

3. The visual detection method for broken threads of complex lace of clothing according to claim 1, characterized in that: The obtaining of all non-closed edge curves in the grayscale image specifically includes: Perform edge detection on the grayscale image using an edge detection algorithm to obtain all non-closed edge curves in the grayscale image.

4. The visual detection method for broken threads of complex lace of clothing according to claim 1, characterized in that: After selecting the real broken line pairs from the set of suspected curve pairs according to the pixel feature analysis, the method further includes: Marking the real disconnected pairs; The marked actual disconnected pairs are displayed.

Citation Information

Patent Citations

  • High-resolution remote sensing building extraction method combining semantic segmentation and edge detection

    CN113689445A

  • Oil curtain type fried peanut production system

    CN116168025A

  • Aorta diameter artificial intelligence measuring method

    CN117392128A

  • Curved surface creation apparatus and curved surface creation program

    JP2012003432A

  • Automatic inspection method for belt-type conveying device

    WO2023134789A1