A method and system for controlling label defects

By pre-setting ROI regions and using an improved YOLOV5 algorithm, combined with deep learning and feature point matching technology, label defects are automatically detected. This solves the problems of time-consuming and labor-intensive manual inspection and high equipment costs in existing technologies, achieving efficient and accurate defect detection.

CN116664816BActive Publication Date: 2026-03-03CHANGSHA HI-TECH ZONE TOJOY ELECTRIC CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-20
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing label defect detection methods suffer from problems such as time-consuming, labor-intensive, and costly manual inspection, and expensive single-sheet inspection platforms.

Method used

The image is cropped by a preset ROI region. The model and deep learning neural network algorithm are trained using an improved YOLOv5 algorithm. The logo, letters and symbols in the label are matched. Combined with SIFT feature point matching and OpenCV edge detection, the label defects are judged and the results are output.

Benefits of technology

It achieves a high degree of automation in label defect detection, saving labor costs, and offering fast and accurate detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664816B_ABST
    Figure CN116664816B_ABST
Patent Text Reader

Abstract

The application discloses a label defect control method and system, which cuts the to-be-detected image by using the ROI region through presetting the ROI region; uses a Swish excitation function to improve a YoloV5 algorithm training model to obtain an AI model more suitable for cloth defects; matches corresponding logos, letters and symbols in the to-be-detected image through a deep learning neural network algorithm; scales the length and width of the to-be-detected image in a proportional manner, and shields the symbols matched by the deep learning neural network algorithm, then uses a SIFT feature point matching algorithm to match feature points of the to-be-detected cloth and the set standard cloth, finds out feature differences between the to-be-detected cloth and the standard cloth, judges difference values and marks difference regions to obtain defect positions and sizes. The label defect control method and system have high automation degree and save labor cost, and have fast detection speed and high detection precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular discloses a method and system for controlling label defects. Background Technology

[0002] Labels are tools used to identify categories or contents of objects, making it easier for oneself and others to find and locate their targets. The apparel industry typically uses woven labels for identification and differentiation, and these labels are usually affixed individually to the corresponding garments.

[0003] Among woven labels, there may be labels that do not conform to the predetermined pattern. For example, some labels may have inconsistent colors, missing parts of the pattern, or blurry images. These labels are considered defective, while labels that conform to the predetermined pattern are considered acceptable. Before the finished labels are accepted and delivered, defective labels need to be manually removed or removed using a single-label inspection platform. Manually inspecting all individual labels is time-consuming, labor-intensive, and costly; while single-label inspection platforms are expensive, increasing inspection costs and consequently increasing the cost of the label products.

[0004] Therefore, the aforementioned deficiencies in existing label defect detection methods are technical problems that urgently need to be solved. Summary of the Invention

[0005] This invention provides a method and system for controlling label defects, aiming to solve the above-mentioned defects in existing label defect detection.

[0006] One aspect of the present invention relates to a method for controlling label defects, comprising the following steps:

[0007] Preset ROI regions and use ROI regions to crop the image to be detected;

[0008] The model was trained by improving the YoloV5 algorithm using the Swish activation function, resulting in an AI model that is more suitable for fabric defects. The AI ​​model is used to predict defects in fabric and determine the location of defects.

[0009] The deep learning neural network algorithm is used to match the corresponding logo, letters and symbols in the image to be detected.

[0010] The length and width of the image to be detected are scaled proportionally, and the symbols matched by the deep learning neural network algorithm are occluded. Then, the SIFT feature point matching algorithm is used to match the feature points of the fabric to be detected and the set standard fabric to find the feature differences between the fabric to be detected and the standard fabric, determine the difference value and mark the difference area to obtain the defect location and size.

[0011] The symbols matched by the deep learning neural network algorithm are binarized, and the outline of the symbols is obtained by OpenCV edge detection. The outline is then fitted into a straight line using the least squares method. The straight line is extended to intersect the upper and lower edges of the fabric to obtain the angle between the fabric and the symbol. If the angle obtained is greater than a preset angle threshold, it is judged as a slanted mark.

[0012] The defect results obtained from the above steps are summarized to obtain the total labeled defects, and the total labeled defects are output externally.

[0013] Furthermore, the steps for matching the corresponding Logo, letters, and symbols in the image to be detected using deep learning neural network algorithms include:

[0014] Select the most distinctive symbol in the image to be detected and binarize the symbol;

[0015] Edge extraction is performed using the Prewitt operator to extract the edges of the symbol and select the center point of the edge point;

[0016] The shortest distance from the center to the outer edge of the label is obtained by eroding outward from the center point, as well as the ratio of the relative position of the center point on the fabric. The offset of the center point is determined by comparing it with the ratio of the standard image, and it is determined whether the label has defects such as large or small edges.

[0017] Furthermore, the Prewitt operator detects edges in the image by measuring gradient changes in pixel values. The Prewitt operator consists of two 3x3 convolution kernels: one for detecting gradient changes in pixel values ​​in the horizontal direction and the other for detecting gradient changes in pixel values ​​in the vertical direction.

[0018] Furthermore, the convolution kernel of the Prewitt operator is shown below: Convert the image to be detected into a grayscale image;

[0019] Applying hx and hy convolution kernels to a grayscale image yields gradient images in the horizontal and vertical directions;

[0020] The gradient images are merged into a single image, and all edges are displayed in the single image.

[0021] Furthermore, the symbols matched by the deep learning neural network algorithm are binarized, and the outline of the symbols is obtained through OpenCV edge detection. The outline is then fitted into a straight line using the least squares method. The straight line is extended to intersect the upper and lower edges of the fabric to obtain the angle between the fabric and the symbol. If the obtained angle is greater than a preset angle threshold, it is judged as a slanted mark. In this step, the preset angle threshold ranges from 87° to 93°.

[0022] Another aspect of the present invention relates to a control system for label defects, comprising:

[0023] The cropping module is used to preset the ROI region and crop the image to be detected using the ROI region;

[0024] The training module is used to train the model using the Swish activation function to improve the YoloV5 algorithm, resulting in an AI model that is more suitable for fabric defects. The AI ​​model is used to predict defects in the fabric and determine the location of the defects.

[0025] The first matching module is used to match the corresponding Logo, letters and symbols in the image to be detected using a deep learning neural network algorithm;

[0026] The second matching module is used to scale the length and width of the image to be detected proportionally, and to mask the symbols matched by the deep learning neural network algorithm. Then, the SIFT feature point matching algorithm is used to match the feature points of the fabric to be detected and the set standard fabric, find the feature differences between the fabric to be detected and the standard fabric, determine the difference value and mark the difference area, and obtain the defect location and size.

[0027] The judgment module is used to binarize the symbols matched by the deep learning neural network algorithm, obtain the outline of the symbols through OpenCV edge detection, and fit the outline into a straight line using the least squares method. The straight line is extended to intersect the upper and lower edges of the fabric to obtain the angle between the fabric and the symbol. If the obtained angle is greater than the preset angle threshold, it is judged as a slanted mark.

[0028] The output module is used to summarize the defect results obtained from the above steps, obtain the total labeled defects, and output the total labeled defects to the outside world.

[0029] Furthermore, the first matching module includes:

[0030] The selected cell is used to select the most characteristic symbol in the image to be detected and to binarize the symbol;

[0031] The extraction unit is used to perform edge extraction using the Prewitt operator, extracting the edges of the symbol and selecting the center point of the edge point;

[0032] The unit is determined by eroding outward from the center point to obtain the shortest distance from the center to the outer edge of the label, as well as the ratio of the relative position of the center point on the fabric. The center point offset is determined by comparing it with the ratio of the standard image, thus determining whether the label has large or small edge defects.

[0033] Furthermore, the Prewitt operator detects edges in the image by measuring gradient changes in pixel values. The Prewitt operator consists of two 3x3 convolution kernels: one for detecting gradient changes in pixel values ​​in the horizontal direction and the other for detecting gradient changes in pixel values ​​in the vertical direction.

[0034] Furthermore, the convolution kernel of the Prewitt operator is shown below: Convert the image to be detected into a grayscale image;

[0035] Applying hx and hy convolution kernels to a grayscale image yields gradient images in the horizontal and vertical directions;

[0036] The gradient images are merged into a single image, and all edges are displayed in the single image.

[0037] Furthermore, in the judgment module, the preset included angle threshold range is 87°-93°.

[0038] The beneficial effects achieved by this invention are as follows:

[0039] This invention provides a method and system for controlling label defects. It involves pre-setting a Region of Interest (ROI) and cropping the image to be detected within that ROI; training a model using the Swish activation function to improve the YoloV5 algorithm, resulting in an AI model more suitable for fabric defects. This AI model predicts defects in the fabric and determines their locations; matching the corresponding logo, letters, and symbols in the image to be detected using a deep learning neural network algorithm; scaling the length and width of the image to be detected proportionally and occluding the symbols matched by the deep learning neural network algorithm; and then using the SIFT feature point matching algorithm to match the fabric to be detected with the set label. Feature point matching is performed on the fabric to be inspected to find the feature differences between the fabric to be inspected and the standard fabric. The difference value is determined and the difference area is marked to obtain the defect location and size. The symbol matched by the deep learning neural network algorithm is binarized, and the outline of the symbol is obtained by OpenCV edge detection. The outline is fitted to a straight line using the least squares method. The straight line is extended to intersect the upper and lower edges of the fabric to obtain the angle between the fabric and the symbol. If the angle obtained is greater than a preset angle threshold, it is judged as a skewed label. The defect results obtained from the above steps are summarized to obtain the total label defects, and the total label defects are output. The label defect control method and system provided by this invention have a high degree of automation, save labor costs, and have fast detection speed and high detection accuracy. Attached Figure Description

[0040] Figure 1 A flowchart illustrating an embodiment of a label defect control method provided by the present invention;

[0041] Figure 2 for Figure 1 The diagram shows a detailed flowchart of an embodiment of the step of matching the corresponding Logo, letter and symbol in the image to be detected using a deep learning neural network algorithm.

[0042] Figure 3 A functional block diagram of an embodiment of a label defect control system provided by the present invention;

[0043] Figure 4 for Figure 3 The first matching module shown is a functional module diagram of one embodiment.

[0044] Explanation of icon numbers:

[0045] 10. Cropping module; 20. Training module; 30. First matching module; 40. Second matching module; 50. Judgment module; 60. Output module; 31. Selected unit; 32. Extracted unit; 33. Determined unit. Detailed Implementation

[0046] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0047] like Figure 1 As shown, the first embodiment of the present invention proposes a method for controlling various label defects, including the following steps:

[0048] Step S100: Preset ROI region and use ROI region to crop the image to be detected.

[0049] By manually defining ROIs (regions of interest), images can be cropped. This allows a continuous long roll of fabric to be divided into individual images for detection.

[0050] Step S200: Use the Swish activation function to improve the YoloV5 algorithm to train the model and obtain an AI model that is more suitable for fabric defects. The AI ​​model is used to predict defects in the fabric and determine the location of the defects.

[0051] The Swish activation function was used to improve the YoloV5 algorithm training model, resulting in an AI (Artificial Intelligence) model more suitable for fabric defects. The model predicts defects such as dirt and broken yarns in the fabric and determines their locations.

[0052] Step S300: Match the corresponding Logo, letters and symbols in the image to be detected using a deep learning neural network algorithm.

[0053] The algorithm uses a deep learning neural network to match corresponding logos, letters, and symbols. A human selects the most distinctive symbol.

[0054] Step S400: Scale the length and width of the image to be detected proportionally, and occlude the symbols matched by the deep learning neural network algorithm. Then, use the SIFT feature point matching algorithm to match the feature points of the fabric to be detected and the set standard fabric, find the feature differences between the fabric to be detected and the standard fabric, determine the difference value and mark the difference area, and obtain the defect location and size.

[0055] The length and width of the image to be detected are scaled by a factor of two to reduce the amount of data. The symbols matched by the deep learning neural network algorithm are occluded. Then, the SIFT (Scale-invariant feature transform) feature point matching algorithm is used to match the feature points of the fabric to be detected and the set standard fabric to find the feature differences between the fabric to be detected and the standard fabric. The difference value is used to mark the difference area and obtain the location and size of the defect.

[0056] Step S500: Binarize the symbol matched by the deep learning neural network algorithm, obtain the outline of the symbol through OpenCV edge detection, and fit the outline into a straight line using the least squares method. Extend the straight line to intersect the upper and lower edges of the fabric to obtain the angle between the fabric and the symbol. If the obtained angle is greater than the preset angle threshold, it is judged as a slanted mark.

[0057] The symbol matched by the deep learning neural network algorithm is binarized, and its outline is obtained through OpenCV edge detection. The outline is then fitted to a straight line using the least squares method. This line is extended to intersect the top and bottom edges of the fabric, obtaining the included angle. If this included angle is greater than a preset angle threshold, the label is determined to be a skewed label. In this embodiment, the preset angle threshold ranges from 87° to 93°. If the obtained angle is greater than 87°-93°, the label is determined to be a skewed label.

[0058] Step S600: Summarize the defect results obtained from the above steps to obtain the total labeled defects, and output the total labeled defects to the outside world.

[0059] The defect results obtained from the above steps are summarized to obtain the total tagged defects, which are then output externally.

[0060] The label defect control method provided in this embodiment, compared with the prior art, uses a preset ROI region to crop the image to be detected; it uses the Swish activation function to improve the YoloV5 algorithm to train the model, obtaining an AI model more suitable for fabric defects. The AI ​​model is used to predict defects in the fabric and determine the defect location; it uses a deep learning neural network algorithm to match the corresponding logo, letters, and symbols in the image to be detected; it scales the length and width of the image to be detected proportionally, and occludes the symbols matched by the deep learning neural network algorithm; then it uses the SIFT feature point matching algorithm to match the fabric to be detected with the set... The method involves matching feature points of standard fabrics to identify the differences between the fabric to be tested and the standard fabric, determining the numerical value of the difference, marking the difference area, and obtaining the location and size of the defect. The symbol matched by the deep learning neural network algorithm is binarized, and the outline of the symbol is obtained through OpenCV edge detection. The outline is then fitted to a straight line using the least squares method. This straight line is extended to intersect the upper and lower edges of the fabric, obtaining the angle between the fabric and the symbol. If the angle is greater than a preset angle threshold, it is judged as a skewed label. The defect results obtained from the above steps are summarized to obtain the total label defects, which are then output. The label defect control method provided in this embodiment has a high degree of automation, saves labor costs, and offers fast detection speed and high detection accuracy.

[0061] Preferably, please see Figure 2 , Figure 2 for Figure 1 The diagram shows a detailed flow chart of an embodiment of step S300. In this embodiment, step S300 includes:

[0062] Step S310: Select the most characteristic symbol in the image to be detected and binarize the symbol.

[0063] A symbol with the most distinctive features is manually selected, and then binarized.

[0064] Step S320: Extract the edge of the symbol using the Prewitt operator and select the center point of the edge point.

[0065] Edge extraction is performed using the Prewitt operator to extract the edge of the most characteristic symbol and select the center point of the edge point.

[0066] The Prewitt operator detects edges in an image by measuring gradient changes in pixel values. The Prewitt operator consists of two 3x3 convolution kernels: one for detecting gradient changes in pixel values ​​in the horizontal direction and the other for detecting gradient changes in pixel values ​​in the vertical direction.

[0067] Furthermore, the convolution kernel of the Prewitt operator is shown in Equation (1): Convert the image to be detected into a grayscale image.

[0068] Applying hx and hy convolution kernels to a grayscale image yields gradient images in the horizontal and vertical directions.

[0069] The gradient images are merged into a single image, and all edges are displayed in the single image.

[0070] Step S330: Erode outward from the center point to obtain the shortest distance from the center to the outer edge of the label, as well as the ratio of the relative position of the center point on the fabric. Determine the center point offset by comparing it with the ratio of the standard image, and determine whether the label has large or small edge defects.

[0071] The shortest distance from the center point to the outer edge of the label is obtained by eroding outward from the center point, thus obtaining the ratio of the relative position of the center point on the fabric. By comparing the ratio with the standard image, the offset of the center point can be determined, and whether there are defects such as large or small edges.

[0072] The label defect control method provided in this embodiment, compared with the prior art, selects the most characteristic symbol in the image to be detected and binarizes the symbol; performs edge extraction using the Prewitt operator to extract the edge of the symbol and selects the center point of the edge point; erodes outward from the center point to obtain the shortest distance from the center to the outer edge of the label, as well as the ratio of the center point's relative position on the fabric; and determines the center point offset by comparing it with a standard image to determine whether the label has large or small edge defects. The label defect control method provided in this embodiment has a high degree of automation, saves labor costs, and has a fast detection speed and high detection accuracy.

[0073] like Figure 3 As shown, Figure 3This is a functional block diagram of an embodiment of a label defect control system provided by the present invention. In this embodiment, the label defect control system includes a cropping module 10, a training module 20, a first matching module 30, a second matching module 40, a judgment module 50, and an output module 60. The cropping module 10 is used to preset a Region of Interest (ROI) and crop the image to be detected using the ROI. The training module 20 is used to train a model using the Swish activation function to improve the YoloV5 algorithm, obtaining an AI model more suitable for fabric defects. The AI ​​model is used to predict defects in the fabric and determine the defect location. The first matching module 30 is used to match the corresponding Logo, letters, and symbols in the image to be detected using a deep learning neural network algorithm. The second matching module 40 is used to scale the length and width of the image to be detected proportionally and... The symbols matched by the deep learning neural network algorithm are occluded. Then, the SIFT feature point matching algorithm is used to match the feature points of the fabric to be detected and the set standard fabric to find the feature differences between the fabric to be detected and the standard fabric, determine the difference value, mark the difference area, and obtain the defect location and size. The judgment module 50 is used to binarize the symbols matched by the deep learning neural network algorithm, obtain the outline of the symbol through OpenCV edge detection, and fit the outline into a straight line using the least squares method. The straight line is extended to intersect the upper edge and lower edge of the fabric respectively to obtain the angle between the fabric and the symbol. If the obtained angle is greater than the preset angle threshold, it is judged as a skewed label. The output module 60 is used to summarize the defect results obtained from the above steps to obtain the total label defects and output the total label defects.

[0074] The cropping module 10 crops the image by manually setting the ROI region. It can divide a continuous long roll of fabric into individual images to be detected.

[0075] Training module 20 uses the Swish activation function to improve the YoloV5 algorithm to train the model, resulting in an AI model more suitable for fabric defects. The model predicts defects such as dirt and broken yarns in the fabric and determines their locations.

[0076] The first matching module 30 uses a deep learning neural network algorithm to match the corresponding logo, letters, and symbols. A user manually selects the most distinctive symbol.

[0077] The second matching module 40 scales the length and width of the image to be detected by a factor of two to reduce the amount of data. It also occludes the symbols matched by the deep learning neural network algorithm. Then, it uses the SIFT (Scale Invariant Feature Transform) feature point matching algorithm to match the feature points of the fabric to be detected and the set standard fabric, finds the feature differences between the fabric to be detected and the standard fabric, judges the difference value, marks the difference area, and obtains the defect location and size.

[0078] The judgment module 50 binarizes the symbol matched by the deep learning neural network algorithm, obtains the outline of the symbol through OpenCV edge detection, and fits the outline into a straight line using the least squares method. This straight line is extended to intersect the top and bottom edges of the fabric to obtain the included angle. If the included angle is greater than a preset included angle threshold, it is judged as a skewed label. In this embodiment, the preset included angle threshold ranges from 87° to 93°. If the obtained included angle is greater than 87°-93°, the label is judged as a skewed label.

[0079] The output module 60 integrates the defect results obtained from the above steps, summarizes the defect results, obtains the total tagged defects, and outputs them externally.

[0080] The label defect control system provided in this embodiment, compared with the prior art, employs a cropping module 10, a training module 20, a first matching module 30, a second matching module 40, a judgment module 50, and an output module 60. It uses a preset ROI region to crop the image to be detected; it uses the Swish activation function to improve the YoloV5 algorithm training model, obtaining an AI model more suitable for fabric defects. The AI ​​model is used to predict defects in the fabric and determine their locations; it uses a deep learning neural network algorithm to match the corresponding Logo, letters, and symbols in the image to be detected; it scales the length and width of the image to be detected proportionally, and occludes the symbols matched by the deep learning neural network algorithm. Then, the SIFT feature point matching algorithm is used to match the feature points of the fabric to be detected and the set standard fabric, find the feature differences between the fabric to be detected and the standard fabric, determine the difference value, mark the difference area, and obtain the defect location and size. The symbol matched by the deep learning neural network algorithm is binarized, and the outline of the symbol is obtained by OpenCV edge detection. The outline is fitted to a straight line using the least squares method. The straight line is extended to intersect the upper and lower edges of the fabric to obtain the angle between the fabric and the symbol. If the obtained angle is greater than the preset angle threshold, it is judged as a skewed label. The defect results obtained from the above steps are summarized to obtain the total label defects, and the total label defects are output. The label defect control system provided in this embodiment has a high degree of automation, saves labor costs, and has a fast detection speed and high detection accuracy.

[0081] Further, see Figure 4 , Figure 4 for Figure 3The diagram shows a functional module schematic of an embodiment of the first matching module. In this embodiment, the first matching module 30 includes a selection unit 31, an extraction unit 32, and a determination unit 33. The selection unit 31 is used to select the most characteristic symbol in the image to be detected and binarize the symbol. The extraction unit 32 is used to extract the edge of the symbol by performing edge extraction using the Prewitt operator and select the center point of the edge point. The determination unit 33 is used to obtain the shortest distance from the center point to the outer edge of the label and the ratio of the relative position of the center point on the fabric by eroding outward from the center point. The center point offset is determined by the ratio with the standard image to determine whether the label has large or small edge defects.

[0082] Unit 31 selects the most distinctive symbol and performs binarization on it.

[0083] The extraction unit 32 performs edge extraction using the Prewitt operator, extracts the edge of the most characteristic symbol, and selects the center point of the edge point.

[0084] The Prewitt operator detects edges in an image by measuring gradient changes in pixel values. The Prewitt operator consists of two 3x3 convolution kernels: one for detecting gradient changes in pixel values ​​in the horizontal direction and the other for detecting gradient changes in pixel values ​​in the vertical direction.

[0085] Furthermore, the convolution kernel of the Prewitt operator is shown in equation (2): Convert the image to be detected into a grayscale image.

[0086] Applying hx and hy convolution kernels to a grayscale image yields gradient images in the horizontal and vertical directions.

[0087] The gradient images are merged into a single image, and all edges are displayed in the single image.

[0088] Unit 33 determines the shortest distance from the center to the outer edge of the label by eroding outward from the center point, thereby obtaining the ratio of the relative position of the center point on the fabric. By comparing the ratio with the standard image, the offset of the center point is determined, and whether there are defects such as large or small edges.

[0089] Compared with existing technologies, the label defect control system provided in this embodiment employs a selection unit 31, an extraction unit 32, and a determination unit 33 in its first matching module 30. It selects the most characteristic symbol in the image to be detected and binarizes the symbol. Edge extraction is performed using the Prewitt operator to extract the symbol's edge, and the center point of the edge is selected. Erosion is then performed outward from the center point to obtain the shortest distance from the center to the outer edge of the label, as well as the ratio of the center point's relative position on the fabric. The center point offset is determined by comparing this ratio with a standard image, thus determining whether the label has large or small edge defects. The label defect control system provided in this embodiment features a high degree of automation, saves labor costs, and offers fast detection speed and high detection accuracy.

[0090] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.

Claims

1. A method of controlling label defects, characterized by, The method comprises the following steps: presetting an ROI region, and cropping the to-be-detected image through the ROI region; using a Swish excitation function to improve a YoloV5 algorithm training model, so as to obtain an AI model more suitable for cloth defects, the AI model being used for predicting defects in cloth and determining defect positions, wherein the defects at least include defect stains and broken yarns in the cloth; matching a corresponding logo, letter and symbol in the to-be-detected image through a deep learning neural network algorithm; scaling the length and width of the to-be-detected image in a same proportion, shielding the symbol matched by the deep learning neural network algorithm, and then using a SIFT feature point matching algorithm to match feature points of the to-be-detected cloth and a standard cloth, so as to find feature differences between the to-be-detected cloth and the standard cloth, judge difference values and mark difference regions, and obtain defect positions and sizes; binarizing the symbol matched by the deep learning neural network algorithm, obtaining a contour of the symbol through Opencv edge detection, and fitting the contour into a straight line by using a least square method, extending the straight line to intersect with an upper edge and a lower edge of the cloth, so as to obtain an included angle between the cloth and the symbol, and if the included angle is greater than a preset included angle threshold, it is judged that the symbol is a slanted mark; summarizing defect results obtained through the above steps to obtain total label defects, and outputting the total label defects.

2. The label defect control method according to claim 1, wherein The step of matching the corresponding logo, letter and symbol in the to-be-detected image through the deep learning neural network algorithm comprises: selecting one symbol with the most features in the to-be-detected image, and binarizing the symbol; extracting an edge of the symbol through a Prewitt operator, and selecting a center point of the edge point; obtaining a shortest distance from the center point to an outer edge of the label and a proportion of a relative position of the center point on the cloth, judging a center point offset through the proportion of the standard picture, and determining whether the label has a size edge defect.

3. The label defect control method according to claim 2, wherein The Prewitt operator is an edge in the to-be-detected image, and is detected through gradient changes of pixel values in the to-be-detected image; the Prewitt operator comprises two 3x3 convolution kernels, one being used for detecting gradient changes of pixel values in a horizontal direction and the other being used for detecting gradient changes of pixel values in a vertical direction.

4. The label defect control method according to claim 3, wherein The convolution kernel of the Prewitt operator is as follows: convert the to-be-detected image into a gray image; apply hx and hy convolution kernels to the gray image to obtain gradient images in the horizontal direction and the vertical direction; merge the gradient images into a single image, and display all edges in the single image.

5. The label defect control method according to claim 4, wherein In the step of binarizing the symbol matched by the deep learning neural network algorithm, and obtaining the contour of the symbol through Opencv edge detection, and fitting the contour into a straight line by using the least square method, and extending the straight line to intersect with the upper edge and the lower edge of the cloth respectively to obtain the included angle between the cloth and the symbol, if the obtained included angle is greater than a preset included angle threshold, the cloth is determined as a diagonal protractor, and the range of the preset included angle threshold is 87°-93°.

6. A label defect control system characterized by, Comprise: The cropping module (10) is used for presetting an ROI region, and cropping the to-be-detected image through the ROI region; The training module (20) is used for improving the YoloV5 algorithm training model by using a Swish excitation function to obtain an AI model more suitable for cloth defects, the AI model is used for predicting defects in the cloth and determining the defect position, wherein the defects at least include defect stains and broken yarns in the cloth; The first matching module (30) is used for matching the corresponding Logo, letter and symbol in the to-be-detected image through a deep learning neural network algorithm; The second matching module (40) is used for scaling the length and width of the to-be-detected image in equal proportions, and shielding the symbol matched by the deep learning neural network algorithm, and then using a SIFT feature point matching algorithm to match the to-be-detected cloth and the standard cloth to find the feature difference between the to-be-detected cloth and the standard cloth, determine the difference value and mark the difference area to obtain the defect position and size; The judgment module (50) is used for binarizing the symbol matched by the deep learning neural network algorithm, and obtaining the contour of the symbol through Opencv edge detection, and fitting the contour into a straight line by using the least square method, and extending the straight line to intersect with the upper edge and the lower edge of the cloth respectively to obtain the included angle between the cloth and the symbol, if the obtained included angle is greater than a preset included angle threshold, the cloth is determined as a diagonal protractor; The output module (60) is used for collecting the defect results obtained in the above steps to obtain total label defects, and outputting the total label defects.

7. The label defect control system of claim 6, wherein, The first matching module (30) comprises: The selection unit (31) is used for selecting a symbol with the most features in the to-be-detected image, and binarizing the symbol; The extraction unit (32) is used for extracting the edge of the symbol through a Prewitt operator, and selecting the center point of the edge point; The determination unit (33) is used for determining whether the label has size defects by using the shortest distance from the center point to the outer edge of the label and the proportion of the relative position of the center point in the cloth, and determining the center point offset amount by comparing the proportion with that of the standard picture.

8. The label defect control system of claim 7, wherein, The Prewitt operator is the edge in the to-be-detected image, which is detected by the gradient change of the pixel value in the to-be-detected image; the Prewitt operator comprises two 3x3 convolution kernels, one is used for detecting the gradient change of the pixel value in the horizontal direction of the to-be-detected image, and the other is used for detecting the gradient change of the pixel value in the vertical direction.

9. The label defect control system of claim 8, wherein, The convolution kernel of the Prewitt operator is shown as follows: convert the image to be detected into a gray-scale image; apply hx and hy convolution kernels to the gray-scale image to obtain gradient images in horizontal and vertical directions; merge the gradient images into a single image in which all edges are displayed.

10. The label defect control system of claim 9, wherein, In the judging module (50), the preset included angle threshold value ranges from 87° to 93°.

Citation Information

Patent Citations

  • Label defect detection method, device, equipment and medium

    CN115829992A