Textile surface defect detection system and method based on artificial intelligence
Through the textile surface defect detection system based on artificial intelligence, the area expansion and image segmentation technology of grayscale images are used to identify defect areas on the fabric surface, solving the problem of low detection accuracy in the prior art and achieving higher detection accuracy and reliability.
Patent Information
- Application Number
- CN202411866450.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When detecting fabrics with patterns and holes, the identification distinction degree is low, resulting in misjudgment, which in turn reduces the detection accuracy of fabric surface defects.
Using an artificial intelligence-based textile surface defect detection system, the grayscale image of the fabric is obtained, area expansion and image segmentation are performed, the shape of the segmented image is identified and local consistency is calculated to determine whether there are suspicious defect areas.
It improves the detection accuracy and reliability of fabric surface defects, reduces the probability that patterns and holes are mistakenly identified as defects, and is suitable for detecting fabrics with patterns and holes.
Smart Images

Figure CN119780094A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of textile detection, and in particular to a textile surface defect detection system and method based on artificial intelligence. Background Art
[0002] In the production process of some textiles, it is necessary to further process the woven large pieces of fabric to create specified patterns and holes on the surface of the fabric, so as to produce personalized textile products that can be used in clothing, packaging and other fields to meet the needs of aesthetics and practicality.
[0003] During the fabric processing, yarn breakage may occur, which may affect the connection of surrounding yarns and cause abnormal defects or holes in the fabric. Traditional fabric surface defect detection methods mainly rely on manual inspection, where workers check defects area by area, which is prone to omissions and leads to a high after-sales rate.
[0004] In the prior art, an industrial camera is usually used to capture images of the fabric surface, and image features are extracted through image processing technology to perform visual inspection and identify defects. This method is usually performed by dividing the image into multiple regions in the horizontal and vertical directions, and there is a large difference in the grayscale images between each region after the division, and then each region is compared with a standard fabric sample, so as to perform defect detection based on the comparison results.
[0005] With respect to the above technical solution, when this method is used to detect fabrics with distributed patterns and holes, it is easy to result in low recognition differentiation, causing misjudgment, and reducing the detection accuracy of fabric surface defects. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a textile surface defect detection system and method based on artificial intelligence, so that defects can be accurately distinguished during detection, thereby improving the detection accuracy of fabric surface defects.
[0007] In the first aspect, the present invention provides a textile surface defect detection system based on artificial intelligence, which adopts the following technical solutions to achieve the purpose of the invention:
[0008] The artificial intelligence-based textile surface defect detection system includes the following modules:
[0009] Acquisition module I: The output end is connected to the input end of calculation module I, and is used to acquire the grayscale image of the target pattern style preset in the system, take the central pixel point of each pattern style as the starting pixel point, set the preset structure area of the specified shape, and calculate the grayscale value distribution map of each preset structure area in the specified preset direction;
[0010] Irradiation module I: the output end is connected to the input end of the acquisition module II, and is used to provide a first light source at a designated position to irradiate the fabric;
[0011] Acquisition module II: the input end is connected to the output end of the irradiation module I, and the output end is connected to the input end of the processing module, and is used to acquire the grayscale image of the surface of the measured fabric in the specified irradiation area;
[0012] Processing module: the input end is connected to the output end of the acquisition module II, and the output end is connected to the input end of the recognition module, and is used to expand the region based on the grayscale consistency with one pixel as the center according to the distribution of the grayscale value of each pixel in the grayscale image, obtain the expanded regions with different grayscales, and respectively perform image segmentation on the expanded regions with different grayscales in the grayscale image to obtain multiple segmented images;
[0013] Recognition module: the input end is connected to the output end of the processing module, and the output end is connected to the input end of the calculation module I, and is used to identify the shape of the segmented image, and obtain the central pixel point of each segmented image according to the shape of the segmented image as the target pixel point, and make the preset shape area centered on the target pixel point as the structure area;
[0014] Calculation module I: the input end is connected to the output end of the acquisition module I and the output end of the recognition module respectively, and the output end is connected to the input end of the judgment module I, and is used to obtain the gray value distribution map in the structure area in a specified preset direction with the target pixel point as the starting point, and respectively calculate the local consistency of the gray value distribution map of each structure area and each preset structure area;
[0015] Judgment module I: the input end is connected to the output end of the calculation module I, and the output end is connected to the input end of the feedback module I, and is used to judge that a structural region has a suspected defect if the structural region does not meet the local consistency with each preset structural region, record it as a suspected defect region, and execute the feedback module I; otherwise, it is judged that the structural region does not have a suspected defect;
[0016] Feedback module I: The input end is connected to the output end of the judgment module I, which is used to issue an alarm and upload data to the management end.
[0017] As a further limitation of the technical solution, it also includes an acquisition module III and a calculation module II. When the judgment module I determines that there is a suspicious defect in the structural area, the acquisition module III is also executed:
[0018] Acquisition module III: the input end is connected to the output end of the judgment module I, and the output end is connected to the input end of the calculation module II, and is used to obtain the Euclidean distance between the central pixel point and the starting pixel point of different pattern styles in the preset structure area, which is recorded as the first set;
[0019] Calculation module II: the input end is connected to the output end of the acquisition module III, and the output end is connected to the input end of the judgment module II, which is used to extract the central pixel positions of different segmented images in the suspected defect area, and calculate the Euclidean distance between each central pixel position and the target pixel, which is recorded as the second set;
[0020] Judgment module II: The input end is connected to the output end of the calculation module II, and the output end is connected to the input end of the feedback module I, which is used to calculate the correlation coefficient r between the first set and the second set, and the confidence α∈(0, 1). If |r|≥α, the suspected defect area is judged to be a retained area and the feedback module I is executed. Otherwise, the suspected defect area is judged to be an unqualified area and the feedback module I is executed.
[0021] As a further limitation of the technical solution, an adjustment module is also included: the input end is connected to the output end of the acquisition module II, and the output end is connected to the input end of the processing module, which is used to calculate the extreme difference values of the grayscale values of all pixels in each specified preset direction in the grayscale image of the preset structure area and the discrete deviation value of the grayscale value distribution, and the accumulated values of the extreme difference values in all specified preset directions are negatively correlated and normalized to obtain local brightness consistency;
[0022] The product of the local brightness consistency and the discrete deviation value is taken as the adjustment value, and the grayscale of each pixel in the grayscale image of the measured fabric surface is uniformly added and adjusted according to the adjustment value.
[0023] As a further limitation of the technical solution, it also includes an analysis module and a correction module;
[0024] Analysis module: the input end is connected to the output end of the acquisition module II, and the output end is connected to the input end of the correction module, and is used to calculate the gradient amplitude of the brightness change of each pixel in the grayscale image of the measured fabric surface in the specified irradiation area in the specified preset direction;
[0025] Correction module: The input end is connected to the output end of the analysis module, and the output end is connected to the input end of the processing module. It is used to set the gradient threshold according to historical data, count the pixels whose gradient amplitude is lower than the gradient threshold, merge adjacent pixels into multiple shadow areas, record them as the first shadow area set, and correct the shadow area in the grayscale image.
[0026] As a further limitation of the technical solution, it also includes an irradiation module II, an acquisition module IV, a judgment module III, and a feedback module II. When the judgment module I determines that there is no suspicious defect in the structural area, the irradiation module II is also executed;
[0027] Irradiation module II: the input end is connected to the output end of the judgment module I, and the output end is connected to the input end of the acquisition module IV, and is used to provide a second light source at another designated position to irradiate the same designated irradiation area of the fabric;
[0028] Acquisition module IV: the input end is connected to the output end of the irradiation module II, and the output end is connected to the input end of the judgment module III, and is used to acquire the grayscale image of the surface of the measured fabric in the specified irradiation area, calculate the gradient amplitude of the brightness change of each pixel point in the grayscale image in the specified preset direction, count the pixel points below the gradient threshold, and merge adjacent pixel points into multiple shadow areas, which are recorded as a second shadow area set;
[0029] Judgment module III: the input end is connected to the output end of acquisition module IV, and the output end is connected to the input end of feedback module II, and is used to perform similarity matching between the first shadow area set and the second shadow area set, and set a matching threshold according to historical data. If the similarity is lower than the matching threshold, it is judged that the matching fails, and the feedback II step is executed. Otherwise, it is judged that the matching is successful.
[0030] Feedback module II: the input end is connected to the output end of the judgment module III, and the output end is connected to the input end of the illumination module I, and is used to adjust the brightness and position of the first light source according to the similarity matching result.
[0031] In a second aspect, the present invention provides a textile surface defect detection method based on artificial intelligence, which uses the following technical solutions to achieve the invention objectives:
[0032] The method for detecting textile surface defects based on artificial intelligence comprises the following steps:
[0033] Obtaining data I: Obtaining a grayscale image of a target pattern preset in the system, taking the central pixel point of each pattern style as the starting pixel point, setting a preset structure area of a specified shape, and calculating a grayscale value distribution map of each preset structure area in a specified preset direction;
[0034] Irradiation I: a first light source is set at a designated position to irradiate the fabric;
[0035] Acquiring data II: acquiring a grayscale image of the surface of the fabric under test in the specified irradiation area;
[0036] Data processing: According to the distribution of grayscale values of each pixel in the grayscale image, the region is expanded based on grayscale consistency with one pixel as the center to obtain expanded regions with different grayscales, and image segmentation is performed on the expanded regions with different grayscales in the grayscale image to obtain multiple segmented images;
[0037] Recognition: Recognize the shape of the segmented image, and obtain the central pixel point of each segmented image according to the shape of the segmented image as the target pixel point, and make the preset shape area centered on the target pixel point as the structure area;
[0038] Calculation I: obtaining a grayscale value distribution map in a specified preset direction with the target pixel point as the starting point in the structure area, and calculating the local consistency of the grayscale value distribution map of each structure area and each preset structure area respectively;
[0039] Judgment I: If a structural region does not meet the local consistency with each preset structural region, it is judged that there is a suspected defect in the structural region, recorded as a suspected defect region, and the feedback step I is executed; otherwise, it is judged that there is no suspected defect in the structural region;
[0040] Feedback I: Issue an alarm and upload the data to the management terminal.
[0041] As a further limitation of the present technical solution, a data acquisition III step, a calculation II step and a judgment II step are further provided between the judgment I step and the feedback I step. In the judgment I step, when it is judged that there is a suspected defect in the structural area, the data acquisition III step is further executed:
[0042] Obtaining data III: Obtaining the Euclidean distance between the central pixel point and the starting pixel point of different pattern styles in the preset structure area, recorded as the first set;
[0043] Calculation II: extract the central pixel positions of different segmented images in the suspected defect area, and calculate the Euclidean distance between each central pixel position and the target pixel, which is recorded as the second set;
[0044] Judgment II: Calculate the correlation coefficient r between the first set and the second set, and the confidence α∈(0, 1). If |r|≥α, then the suspected defect area is judged as a retained area and the feedback I step is executed. Otherwise, the suspected defect area is judged as an unqualified area and the feedback I step is executed.
[0045] As a further limitation of the present technical solution, an adjustment step is further provided between the step of obtaining data II and the step of processing data:
[0046] Adjustment: Calculate the extreme value of the grayscale value of all pixels in each specified preset direction and the discrete deviation value of the grayscale value distribution in the grayscale image of the preset structure area, perform negative correlation mapping on the accumulated value of the extreme value in all specified preset directions and normalize it to obtain local brightness consistency;
[0047] The product of the local brightness consistency and the discrete deviation value is taken as the adjustment value, and the grayscale of each pixel in the grayscale image of the measured fabric surface is uniformly added and adjusted according to the adjustment value.
[0048] As a further limitation of the present technical solution, the following steps are further provided between the step of obtaining data II and the step of processing data:
[0049] Analysis: Calculate the gradient amplitude of the brightness change of each pixel in the grayscale image of the measured fabric surface in the specified irradiation area in the specified preset direction;
[0050] Correction: Set the gradient threshold according to historical data, count the pixels whose gradient amplitude is lower than the gradient threshold, merge adjacent pixels into multiple shadow areas, record them as the first shadow area set, and correct the shadow areas in the grayscale image.
[0051] As a further limitation of the technical solution, after the judgment step I, there are also an irradiation step II, a data acquisition step IV, a judgment step III and a feedback step II. In the judgment step I, when it is judged that there is no suspicious defect in the structural area, the irradiation step II is also performed;
[0052] Irradiation II: a second light source is arranged at another designated position to irradiate the same designated irradiation area of the fabric;
[0053] Acquiring data IV: acquiring a grayscale image of the surface of the fabric under test in the specified irradiation area, calculating the gradient amplitude of the brightness change of each pixel in the grayscale image in the specified preset direction, counting the pixels below the gradient threshold, and merging adjacent pixels into multiple shadow areas, which are recorded as a second shadow area set;
[0054] Judgment III: perform similarity matching between the first shadow area set and the second shadow area set, set a matching threshold according to historical data, if the similarity is lower than the matching threshold, it is judged that the matching fails, and the feedback step II is executed; otherwise, it is judged that the matching is successful;
[0055] Feedback II: According to the similarity matching result, the brightness and position of the first light source are adjusted.
[0056] Compared with the prior art, the advantages and positive effects of the present invention are:
[0057] 1. Expand the area according to the distribution of grayscale values in the grayscale image of the fabric, perform image segmentation on the expanded areas of different grayscales, obtain the central pixel point as the target pixel point according to the shape of the segmented image, and make the preset shape area centered on the target pixel point as the structural area, so as to separate the possible defect area from the normal area, and perform regional identification, thereby providing a basis for subsequent defect detection; by dividing the structural area of the specified shape according to the central pixel points of different segmented images, and comparing the local consistency between the structural area and the preset structural area, it is possible to identify whether there is a structural area that does not conform to the specified pattern style or the specified hole distribution. The detection area can be delineated according to the actual distribution law of the fabric surface, so that the grayscale images between each segmented area have a certain local consistency, reducing the probability of patterns and holes being mistakenly identified as defects. It can be suitable for detecting fabrics with patterns and holes, improving the recognition distinction, and thus improving the accuracy and reliability of detection.
[0058] 2. When it is determined that there are suspected defects in the structural area, the Euclidean distance between the central pixel points and the starting pixel points of different pattern styles in the preset structural area is obtained, which is recorded as the first set. The central pixel point positions of different segmented images in the suspected defect area are extracted, and the Euclidean distance between each central pixel point position and the target pixel point is calculated, which is recorded as the second set. By calculating the correlation coefficient r between the first set and the second set, the suspected defect area is judged as a retained area or an unqualified area, an alarm is issued to the management end, and the retained area and unqualified area are fed back. Then, through further calculation or manual intervention, the detection process is intervened and adjusted, and the interference of external factors is eliminated in time to improve the accuracy and reliability of the detection, and the unqualified area is directly processed with the corresponding process, which reduces the waste of human resources and production costs and improves production efficiency.
[0059] 3. By calculating the extreme value of the grayscale value of the preset structural area and the discrete deviation value of the grayscale value distribution, and performing negative correlation mapping and normalization processing, the local brightness consistency is obtained, and the product of the local brightness consistency and the discrete deviation value is used as the adjustment value, so that the grayscale of each pixel in the grayscale image of the measured fabric surface is uniformly added and adjusted according to the adjustment value. In an ideal grayscale image, the brightness of the local area is usually uniform, but in the actual production process, the illumination of the fabric surface is easily affected by human factors and environmental factors, resulting in large fluctuations in brightness in some local areas, which in turn affects the distribution of grayscale values. At the same time, foreign matter residues or unevenness may appear on the fabric surface, which is also likely to affect the distribution of grayscale values. By judging the local brightness consistency and discrete deviation value, the pixels in the grayscale image are uniformly adjusted, which is conducive to reducing the probability of misjudgment and improving the recognition distinction. At the same time, the sensitivity to details and minor defects is enhanced, thereby improving the detection accuracy of fabric surface defects.
[0060] 4. By calculating the gradient amplitude of the brightness change of the grayscale image of the measured fabric surface, the gradient threshold is set according to historical data, the pixel points with gradient amplitude lower than the gradient threshold are counted, and the adjacent pixel points are merged into multiple shadow areas, which are recorded as the first shadow area set. The first shadow area set is the shadow area in the calculated fabric grayscale image, and the shadow area in the measured fabric grayscale image is corrected according to the first shadow area set. Due to the differences in light source angle, light source intensity, and fabric material, shadow areas may appear. These shadow areas are easy to interfere with defect detection. The calculation of gradient amplitude and shadow correction can help reduce false defect recognition caused by lighting changes or external environmental factors, improve the accuracy of shadow processing, and thus improve the detection accuracy of fabric surface defects, and enhance the stability and reliability of detection.
[0061] 5. After it is determined that there are no suspicious defects in the structural area, a second light source is set at another designated position, and the same irradiation area is irradiated at a designated intensity and for a designated time. The grayscale image of the surface of the fabric to be tested in the designated irradiation area is obtained again, and the gradient amplitude of the brightness change of each pixel in the grayscale image in the designated preset direction is calculated. The pixels below the gradient threshold are counted, and the adjacent pixels are merged into multiple shadow areas, which are recorded as a second shadow area set. The first shadow area set is matched with the second shadow area set for similarity. If the similarity between the second shadow area set and the first shadow area set is lower than the matching threshold, it is determined that the match fails. Otherwise, it is determined that the match succeeds. When it is determined that the match fails, the illumination intensity, position, angle and quantity of the first light source are adjusted according to the similarity matching result to improve the image quality, effectively reduce the influence of human factors and environmental factors on the defect detection results, reduce the brightness fluctuation amplitude in the local area, and reduce the probability of patterns and holes being mistakenly identified as defects due to shadows caused by light, thereby improving the detection accuracy of fabric surface defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. 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 creative work. In the drawings:
[0063] Figure 1 This is a system diagram of Embodiment 1 of the present invention;
[0064] Figure 2 This is a flow chart of Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0065] The following will be combined with the present invention Figure 1 and Figure 2 , the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] It should be noted that the directional terms such as left, right, up, down, front and back in the embodiments of the present invention are merely relative concepts or are based on the normal use state of the product, that is, the direction of movement of the product, and should not be considered as limiting.
[0067] When a component is referred to as being “located” or “disposed on” another component, it may be on the other component or there may be an intervening component. When a component is referred to as being “connected to” another component, it may be directly connected to the other component or there may be an intervening component.
[0068] Embodiment 1: A textile surface defect detection system based on artificial intelligence, comprising the following modules:
[0069] Acquisition module I: The output end is connected to the input end of the calculation module I and the input end of the adjustment module respectively, and is used to acquire the grayscale image of the target pattern style preset in the system, take the central pixel point of each pattern style as the starting pixel point, set the preset structure area of the specified shape, and calculate the grayscale value distribution map of each preset structure area in the specified preset direction;
[0070] Irradiation module I: the input end is connected to the output end of the feedback module II, and the output end is connected to the input end of the acquisition module II, and is used to provide a first light source at a designated position to irradiate the fabric;
[0071] Acquisition module II: the input end is connected to the output end of the irradiation module I, and the output end is connected to the input end of the adjustment module, and is used to acquire the grayscale image of the surface of the measured fabric in the specified irradiation area.
[0072] Adjustment module: The input end is connected to the output end of acquisition module I and the output end of acquisition module II respectively, and the output end is connected to the input end of the analysis module, which is used to calculate the extreme difference value of the gray value of all pixels in each specified preset direction in the gray image of the preset structure area and the discrete deviation value of the gray value distribution, and negatively correlate the accumulated value of the extreme difference value in all specified preset directions and normalize it to obtain local brightness consistency;
[0073] The product of the local brightness consistency and the discrete deviation value is taken as the adjustment value, and the grayscale of each pixel in the grayscale image of the measured fabric surface is uniformly added and adjusted according to the adjustment value.
[0074] Analysis module: the input end is connected to the output end of the adjustment module, and the output end is connected to the input end of the correction module, and is used to calculate the gradient amplitude of the brightness change of each pixel in the grayscale image of the measured fabric surface in the specified irradiation area in the specified preset direction;
[0075] Correction module: The input end is connected to the output end of the analysis module, and the output end is connected to the input end of the processing module. It is used to set the gradient threshold according to historical data, count the pixels whose gradient amplitude is lower than the gradient threshold, merge adjacent pixels into multiple shadow areas, record them as the first shadow area set, and correct the shadow area in the grayscale image.
[0076] Processing module: the input end is connected to the output end of the correction module, and the output end is connected to the input end of the recognition module, and is used to expand the region based on the grayscale consistency with one pixel as the center according to the distribution of the grayscale value of each pixel in the grayscale image, obtain the expanded regions with different grayscales, and respectively perform image segmentation on the expanded regions with different grayscales in the grayscale image to obtain multiple segmented images;
[0077] Recognition module: the input end is connected to the output end of the processing module, and the output end is connected to the input end of the calculation module I, and is used to identify the shape of the segmented image, and obtain the central pixel point of each segmented image according to the shape of the segmented image as the target pixel point, and make the preset shape area centered on the target pixel point as the structure area;
[0078] Calculation module I: The input end is connected to the output end of the acquisition module I and the output end of the recognition module respectively, and the output end is connected to the input end of the judgment module I, and is used to obtain the gray value distribution map in the structure area in a specified preset direction with the target pixel point as the starting point, and calculate the local consistency of the gray value distribution map of each structure area and each preset structure area respectively.
[0079] Judgment module I: the input end is connected to the output end of the calculation module I, and the output end is connected to the input end of the feedback module I. If a structural area does not meet the local consistency with each preset structural area, it is judged that there is a suspicious defect in the structural area, and it is recorded as a suspicious defect area, and the acquisition module III is executed. Otherwise, it is judged that there is no suspicious defect in the structural area, and the irradiation module II is executed.
[0080] Acquisition module III: the input end is connected to the output end of the judgment module I, and the output end is connected to the input end of the calculation module II, and is used to obtain the Euclidean distance between the central pixel point and the starting pixel point of different pattern styles in the preset structure area, which is recorded as the first set;
[0081] Calculation module II: the input end is connected to the output end of the acquisition module III, and the output end is connected to the input end of the judgment module II, which is used to extract the central pixel positions of different segmented images in the suspected defect area, and calculate the Euclidean distance between each central pixel position and the target pixel, which is recorded as the second set;
[0082] Judgment module II: The input end is connected to the output end of the calculation module II, and the output end is connected to the input end of the feedback module I, which is used to calculate the correlation coefficient r between the first set and the second set, and the confidence α∈(0, 1). If |r|≥α, the suspected defect area is judged to be a retained area and the feedback module I is executed. Otherwise, the suspected defect area is judged to be an unqualified area and the feedback module I is executed.
[0083] Feedback module I: The input end is connected to the output end of the judgment module II, which is used to issue an alarm and upload data to the management end.
[0084] Irradiation module II: the input end is connected to the output end of the judgment module I, and the output end is connected to the input end of the acquisition module IV, and is used to provide a second light source at another designated position to irradiate the same designated irradiation area of the fabric;
[0085] Acquisition module IV: the input end is connected to the output end of the irradiation module II, and the output end is connected to the input end of the judgment module III, and is used to acquire the grayscale image of the surface of the measured fabric in the specified irradiation area, calculate the gradient amplitude of the brightness change of each pixel point in the grayscale image in the specified preset direction, count the pixel points below the gradient threshold, and merge adjacent pixel points into multiple shadow areas, which are recorded as a second shadow area set;
[0086] Judgment module III: the input end is connected to the output end of acquisition module IV, and the output end is connected to the input end of feedback module II, and is used to perform similarity matching between the first shadow area set and the second shadow area set, and set a matching threshold according to historical data. If the similarity is lower than the matching threshold, it is judged that the matching fails, and the feedback II step is executed. Otherwise, it is judged that the matching is successful.
[0087] Feedback module II: the input end is connected to the output end of the judgment module III, and the output end is connected to the input end of the illumination module I, and is used to adjust the brightness and position of the first light source according to the similarity matching result.
[0088] The working principle of this embodiment is:
[0089] When in use, the acquisition module I acquires the grayscale image of the preset target pattern style input into the system, takes the central pixel point of different types of pattern styles as the starting pixel point, and sets a preset structural area of the specified shape and size that conforms to the pattern style. The preset structural area generally includes but is not limited to the structural area of a single pattern style, the structural area of multiple pattern styles, and the structural area including multiple pattern styles under a specific distribution law, etc. The grayscale distribution map of each pixel point and its surrounding area in the preset structural area is acquired according to the actually set detection target, thereby providing a reference for the subsequent analysis of the structural area.
[0090] The irradiation module I provides a first light source at a specified position to irradiate the fabric, and the acquisition module II acquires the grayscale image of the surface of the fabric under test in the specified irradiation area to remove the interference of color, so as to accurately analyze the surface texture and brightness information of the fabric. The adjustment module calculates the extreme value of the grayscale value of the preset structure area and the discrete deviation value of the grayscale value distribution, and performs negative correlation mapping and normalization processing to obtain the local brightness consistency, and takes the product of the local brightness consistency and the discrete deviation value as the adjustment value, so as to uniformly add and adjust the grayscale of each pixel point in the grayscale image of the surface of the fabric under test according to the adjustment value, and in the ideal grayscale image In the process of fabric detection, the brightness of local areas is usually uniform. However, in the actual production process, the light on the fabric surface is easily affected by human and environmental factors, resulting in large fluctuations in brightness in some local areas, which in turn affects the distribution of grayscale values. At the same time, foreign matter residues or unevenness may appear on the fabric surface, which can also easily affect the distribution of grayscale values. By judging the consistency of local brightness and the discrete deviation value, the pixels in the grayscale image are uniformly adjusted, which is conducive to reducing the probability of misjudgment, improving the discrimination of recognition, and enhancing the sensitivity to details and minor defects, thereby improving the detection accuracy of fabric surface defects.
[0091] The analysis module calculates the gradient amplitude of the brightness change of each pixel in the grayscale image of the surface of the tested fabric in the specified irradiation area in the specified preset direction. The correction module sets the gradient threshold according to the historical data, wherein the historical data usually comes from the gradient amplitude of the fabric that has been tested. The gradient threshold is set by the gradient amplitude of the brightness change of the pixel points identified as the shadow area, and the pixel points with gradient amplitude lower than the gradient threshold are counted, and the adjacent pixel points are merged into a plurality of shadow areas, which are recorded as a first shadow area set. The first shadow area set is the shadow area in the calculated fabric grayscale image, and the shadow area in the tested fabric grayscale image is corrected according to the first shadow area set. Due to the differences in light source angle, light source intensity, and fabric material, shadow areas may appear, and these shadow areas are easy to interfere with defect detection. The calculation of gradient amplitude and shadow correction can help reduce false defect recognition caused by lighting changes or external environmental factors, improve the accuracy of shadow processing, and thus improve the detection accuracy of fabric surface defects, and enhance the stability and reliability of detection.
[0092] The processing module expands the area according to the distribution of grayscale values in the fabric grayscale image, and performs image segmentation on the expanded areas of different grayscales to obtain multiple segmented images. The recognition module obtains the central pixel point according to the shape of the segmented image as the target pixel point, and makes the preset shape area centered on the target pixel point as the structural area, thereby separating the possible defective area from the normal area and performing regional recognition, thereby providing a basis for subsequent defect detection.
[0093] The calculation module 1 obtains the gray value distribution map of the structure area, and respectively calculates the local consistency of the gray value distribution map of each structure area and each preset structure area. If a structure area does not meet the local consistency with each preset structure area, the judgment module 1 determines that there is a suspicious defect in the structure area, indicating that the suspicious defect does not meet the pattern style or hole distribution specified on the fabric surface, and is recorded as a suspicious defect area. Otherwise, the judgment module 1 determines that there is no suspicious defect in the structure area.
[0094] By dividing the structural area of the specified shape according to the central pixel points of different segmented images, and comparing the local consistency between the structural area and the preset structural area, it is possible to identify whether there is a structural area that does not conform to the specified pattern style or the specified hole distribution. The detection area can be delineated according to the actual distribution law of the fabric surface, so that there is a certain consistency in the grayscale image between each segmented area, reducing the probability of patterns and holes being mistakenly identified as defects. It can be suitable for detecting fabrics with patterns and holes, improving the recognition distinction, and thus improving the accuracy and reliability of detection.
[0095] When the judgment module I determines that there is a suspected defect in the structural area, the acquisition module III obtains the Euclidean distance between the central pixel points and the starting pixel points of different pattern styles in the preset structural area, which is recorded as the first set. The calculation module II extracts the central pixel position of different segmented images in the suspected defect area, and calculates the Euclidean distance between each central pixel position and the target pixel point, which is recorded as the second set. The judgment module II performs the next step of judgment by calculating the correlation coefficient r between the first set and the second set, wherein the confidence α∈(0,1). If |r|≥α, the judgment module II determines that the suspected defect area is a retention area, and the feedback module I sends an alarm to the management end and feeds back the retention area, and then intervenes and adjusts the detection process through further calculation or manual intervention, and timely eliminates the interference of external factors to improve the accuracy and reliability of the detection. Otherwise, the judgment module II determines that the suspected defect area is an unqualified area, and the feedback module I sends an alarm to the management end and feeds back the unqualified area, and then directly performs corresponding process processing on the area, thereby reducing the waste of human resources and production costs and improving production efficiency.
[0096] After judging that there is no suspicious defect in the structural area, the irradiation module II provides a second light source at another designated position, and irradiates the same irradiation area at a designated intensity and for a designated time. The acquisition module IV acquires the grayscale image of the surface of the fabric under test in the designated irradiation area again, and calculates the gradient amplitude of the brightness change of each pixel in the grayscale image in the designated preset direction, counts the pixels below the gradient threshold, and merges the adjacent pixels into a plurality of shadow areas, which are recorded as a second shadow area set. The judgment module III performs similarity matching between the first shadow area set and the second shadow area set, and sets a matching threshold according to historical data, wherein the historical data usually comes from the shadow area set of the fabric that has been tested. A matching threshold is set by a similarity matching value between the shadow area set of the detected fabric and the first shadow area set. If the similarity between the second shadow area set and the first shadow area set is lower than the matching threshold, the judgment module III judges that the matching fails. Otherwise, the judgment module III judges that the matching is successful. When it is judged that the matching fails, the feedback module II adjusts the illumination intensity, position, angle and quantity of the first light source provided by the illumination module I according to the similarity matching result to improve the image quality, effectively reduce the influence of human factors and environmental factors on the defect detection results, reduce the brightness fluctuation amplitude in the local area, reduce the probability of patterns and holes being mistakenly identified as defects, and thus improve the detection accuracy of fabric surface defects.
[0097] Embodiment 2: A textile surface defect detection method based on artificial intelligence comprises the following steps:
[0098] S1. Obtaining data I: Obtaining a grayscale image of a target pattern preset in the system, taking the central pixel point of each pattern as the starting pixel point, setting a preset structural area of a specified shape, and calculating a grayscale value distribution map of each preset structural area in a specified preset direction;
[0099] S2, irradiation I: setting a first light source at a designated position to irradiate the fabric;
[0100] S3, obtaining data II: obtaining a grayscale image of the surface of the fabric under test in the specified irradiation area;
[0101] S4, adjustment: calculating the extreme difference values of the grayscale values of all pixels in each specified preset direction and the discrete deviation value of the grayscale value distribution in the grayscale image of the preset structure area, performing negative correlation mapping and normalization processing on the accumulated values of the extreme difference values in all specified preset directions, and obtaining local brightness consistency;
[0102] The product of the local brightness consistency and the discrete deviation value is taken as the adjustment value, and the grayscale of each pixel in the grayscale image of the measured fabric surface is uniformly added and adjusted according to the adjustment value.
[0103] S5, analysis: calculating the gradient amplitude of the brightness change of each pixel in the grayscale image of the measured fabric surface in the specified irradiation area in the specified preset direction;
[0104] S6. Correction: Set a gradient threshold according to historical data, count the pixels whose gradient amplitude is lower than the gradient threshold, merge adjacent pixels into multiple shadow areas, record them as a first shadow area set, and correct the shadow areas in the grayscale image.
[0105] S7, data processing: according to the distribution of the gray value of each pixel in the gray image, a region is expanded based on gray consistency with one pixel as the center to obtain expanded regions with different gray levels, and image segmentation is performed on the expanded regions with different gray levels in the gray image to obtain multiple segmented images;
[0106] S8, recognition: recognizing the shape of the segmented image, and obtaining the central pixel point of each segmented image as the target pixel point according to the shape of the segmented image, and making a preset shape area centered on the target pixel point as the structure area;
[0107] S9, calculation I: obtaining a gray value distribution map in a specified preset direction with the target pixel point as the starting point in the structure area, and respectively calculating the local consistency of the gray value distribution map of each structure area and each preset structure area;
[0108] S10, judgment I: if a structural region does not meet the local consistency with each preset structural region, it is judged that there is a suspected defect in the structural region, recorded as a suspected defect region, and the data acquisition III step S11 is executed; otherwise, it is judged that there is no suspected defect in the structural region, and the irradiation II step S15 is executed;
[0109] S11, obtaining data III: obtaining the Euclidean distance between the central pixel point and the starting pixel point of different pattern styles in the preset structure area, recorded as the first set;
[0110] S12, calculation II: extracting the central pixel positions of different segmented images within the suspected defect area, and calculating the Euclidean distance between each central pixel position and the target pixel, which is recorded as the second set;
[0111] S13, judgment II: calculate the correlation coefficient r between the first set and the second set, the confidence α∈(0,1), if |r|≥α, then judge the suspected defect area as a retention area, and execute feedback I step S14, otherwise, judge the suspected defect area as an unqualified area, and execute feedback I step S14.
[0112] S14, Feedback I: Issue an alarm and upload data to the management end.
[0113] S15, irradiation II: a second light source is arranged at another designated position to irradiate the same designated irradiation area of the fabric;
[0114] S16, obtaining data IV: obtaining a grayscale image of the surface of the fabric under test in the specified irradiation area, calculating the gradient amplitude of the brightness change of each pixel in the grayscale image in the specified preset direction, counting the pixels below the gradient threshold, and merging adjacent pixels into multiple shadow areas, which are recorded as a second shadow area set;
[0115] S17, judgment III: perform similarity matching between the first shadow area set and the second shadow area set, set a matching threshold according to historical data, if the similarity is lower than the matching threshold, it is judged that the matching fails, and the feedback II step S18 is executed; otherwise, it is judged that the matching is successful;
[0116] S18, Feedback II: adjusting the brightness and position of the first light source according to the similarity matching result.
[0117] The working principle of this embodiment is:
[0118] When in use, first obtain the grayscale image of the preset target pattern style input into the system, take the central pixel point of different types of pattern styles as the starting pixel point, set the preset structural area of the specified shape and size that conforms to the pattern style, and the preset structural area generally includes but is not limited to the structural area of a single pattern style, the structural area of multiple pattern styles, and the structural area including multiple pattern styles under a specific distribution law, etc. According to the actually set detection target, the grayscale distribution map of each pixel point in the preset structural area and its surrounding area is obtained, so as to provide a reference for the subsequent analysis of the structural area.
[0119] A first light source is set at a designated position to illuminate the fabric, a grayscale image of the fabric surface under test in the designated irradiation area is obtained, and color interference is removed, so as to accurately analyze the surface texture and brightness information of the fabric. The local brightness consistency is obtained by calculating the extreme difference value of the grayscale value of the preset structure area and the discrete deviation value of the grayscale value distribution, and negative correlation mapping and normalization processing are performed. The product of the local brightness consistency and the discrete deviation value is used as the adjustment value, so as to uniformly add and adjust the grayscale of each pixel point in the grayscale image of the fabric surface under test according to the adjustment value. In an ideal grayscale image, the brightness of the local area is usually uniform, but in the actual production process, the illumination on the fabric surface is easily interfered by human factors and environmental factors, resulting in large brightness fluctuations in some local areas, thereby affecting the distribution of grayscale values. At the same time, foreign matter residue or unevenness may occur on the fabric surface, which is also likely to affect the distribution of grayscale values. By judging the local brightness consistency and the discrete deviation value, the pixels in the grayscale image are uniformly adjusted, which is conducive to reducing the probability of misjudgment, improving the recognition distinction, and enhancing the sensitivity to details and minor defects, thereby improving the detection accuracy of fabric surface defects.
[0120] The gradient amplitude of the brightness change of the grayscale image of the tested fabric surface is calculated, and a gradient threshold is set according to historical data, wherein the historical data usually comes from the gradient amplitude of the tested fabric. The gradient threshold is set by the gradient amplitude of the brightness change of the pixel points in the shadow area that have been identified, and the pixel points with gradient amplitude lower than the gradient threshold are counted, and the adjacent pixel points are merged into multiple shadow areas, which are recorded as a first shadow area set. The first shadow area set is the shadow area in the calculated fabric grayscale image, and the shadow area in the tested fabric grayscale image is corrected according to the first shadow area set. Due to the differences in light source angle, light source intensity, and fabric material, shadow areas may appear, and these shadow areas are easy to interfere with defect detection. The calculation of gradient amplitude and shadow correction can help reduce false defect recognition caused by lighting changes or external environmental factors, improve the accuracy of shadow processing, and thus improve the detection accuracy of fabric surface defects, and enhance the stability and reliability of detection.
[0121] According to the distribution of grayscale values in the fabric grayscale image, the region is expanded, and the image segmentation is performed on the expanded regions with different grayscales to obtain multiple segmented images. The central pixel point is obtained according to the shape of the segmented image as the target pixel point, and the preset shape area centered on the target pixel point is taken as the structural area, so as to separate the possible defective area from the normal area and perform regional identification, thereby providing a basis for subsequent defect detection.
[0122] Obtaining a grayscale value distribution map of the structural area, and respectively calculating the local consistency of the grayscale value distribution map of each structural area with each preset structural area, if a structural area does not meet the local consistency with each preset structural area, then it is judged that there is a suspected defect in the structural area, indicating that the suspected defect does not meet the pattern style or hole distribution specified on the fabric surface, and is recorded as a suspected defect area, otherwise, it is judged that there is no suspected defect in the structural area;
[0123] By dividing the structural area of the specified shape according to the central pixel points of different segmented images, and comparing the local consistency between the structural area and the preset structural area, it is possible to identify whether there is a structural area that does not conform to the specified pattern style or the specified hole distribution. The detection area can be delineated according to the actual distribution law of the fabric surface, so that there is a certain consistency in the grayscale image between each segmented area, reducing the probability of patterns and holes being mistakenly identified as defects. It can be suitable for detecting fabrics with patterns and holes, improving the recognition distinction, and thus improving the accuracy and reliability of detection.
[0124] After it is determined that there is a suspected defect in the structural area, the Euclidean distance between the central pixel points and the starting pixel points of different pattern styles in the preset structural area is obtained, which is recorded as the first set. The central pixel point positions of different segmented images in the suspected defect area are extracted, and the Euclidean distance between each central pixel point position and the target pixel point is calculated, which is recorded as the second set. The next step of judgment is performed by calculating the correlation coefficient r between the first set and the second set, wherein the confidence α∈(0,1). If |r|≥α, the suspected defect area is judged to be a retention area, an alarm is issued to the management end, and the retention area is fed back. Then, the detection process is intervened and adjusted by further calculation or manual intervention, and the interference of external factors is timely eliminated to improve the accuracy and reliability of the detection. Otherwise, the suspected defect area is judged to be an unqualified area, an alarm is issued to the management end, and the unqualified area is fed back. Then, the corresponding process is directly processed for the area, reducing the waste of human resources and production costs and improving production efficiency.
[0125] After it is determined that there are no suspicious defects in the structural area, a second light source is set at another specified position, and the same irradiation area is irradiated at a specified intensity and for a specified time. The grayscale image of the surface of the fabric under test in the specified irradiation area is obtained again, and the gradient amplitude of the brightness change of each pixel in the grayscale image in the specified preset direction is calculated. The pixel points below the gradient threshold are counted, and the adjacent pixel points are merged into multiple shadow areas, which are recorded as a second shadow area set. The first shadow area set and the second shadow area set are matched for similarity, and the matching threshold is set according to historical data, where the historical data usually comes from the shadow areas of the fabric that have been tested. Domain set, set the matching threshold by the similarity matching value between the shadow area set of the detected fabric and the first shadow area set, if the similarity between the second shadow area set and the first shadow area set is lower than the matching threshold, it is judged as a matching failure, otherwise, it is judged as a matching success. When it is judged as a matching failure, the illumination intensity, position, angle and quantity of the first light source are adjusted according to the similarity matching result to improve the image quality, effectively reduce the influence of human factors and environmental factors on the defect detection results, reduce the brightness fluctuation amplitude in the local area, reduce the probability of patterns and holes being mistakenly identified as defects, and thus improve the detection accuracy of fabric surface defects.
[0126] The above disclosure is only a specific embodiment of the present invention, but the present invention is not limited thereto, and any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. The textile surface defect detection system based on artificial intelligence is characterized by: Includes the following modules: Acquisition module I: The output end is connected to the input end of calculation module I, and is used to acquire the grayscale image of the target pattern style preset in the system, take the central pixel point of each pattern style as the starting pixel point, set the preset structure area of the specified shape, and calculate the grayscale value distribution map of each preset structure area in the specified preset direction; Irradiation module I: the output end is connected to the input end of the acquisition module II, and is used to provide a first light source at a designated position to irradiate the fabric; Acquisition module II: the input end is connected to the output end of the irradiation module I, and the output end is connected to the input end of the processing module, and is used to acquire the grayscale image of the surface of the measured fabric in the specified irradiation area; Processing module: the input end is connected to the output end of the acquisition module II, and the output end is connected to the input end of the recognition module, and is used to expand the region based on the grayscale consistency with one pixel as the center according to the distribution of the grayscale value of each pixel in the grayscale image, obtain the expanded regions with different grayscales, and respectively perform image segmentation on the expanded regions with different grayscales in the grayscale image to obtain multiple segmented images; Recognition module: the input end is connected to the output end of the processing module, and the output end is connected to the input end of the calculation module I, and is used to identify the shape of the segmented image, and obtain the central pixel point of each segmented image according to the shape of the segmented image as the target pixel point, and make the preset shape area centered on the target pixel point as the structure area; Calculation module I: the input end is connected to the output end of the acquisition module I and the output end of the recognition module respectively, and the output end is connected to the input end of the judgment module I, and is used to obtain the gray value distribution map in the structure area in a specified preset direction with the target pixel point as the starting point, and respectively calculate the local consistency of the gray value distribution map of each structure area and each preset structure area; Judgment module I: the input end is connected to the output end of the calculation module I, and the output end is connected to the input end of the feedback module I, and is used to judge that a structural region has a suspected defect if the structural region does not meet the local consistency with each preset structural region, record it as a suspected defect region, and execute the feedback module I; otherwise, it is judged that the structural region does not have a suspected defect; Feedback module I: The input end is connected to the output end of the judgment module I, which is used to issue an alarm and upload data to the management end.
2. The textile surface defect detection system based on artificial intelligence according to claim 1, characterized in that: It also includes an acquisition module III and a calculation module II. When the judgment module I determines that there are suspicious defects in the structural area, the acquisition module III is also executed: Acquisition module III: the input end is connected to the output end of the judgment module I, and the output end is connected to the input end of the calculation module II, and is used to obtain the Euclidean distance between the central pixel point and the starting pixel point of different pattern styles in the preset structure area, which is recorded as the first set; Calculation module II: the input end is connected to the output end of the acquisition module III, and the output end is connected to the input end of the judgment module II, which is used to extract the central pixel positions of different segmented images in the suspected defect area, and calculate the Euclidean distance between each central pixel position and the target pixel, which is recorded as the second set; Judgment module II: The input end is connected to the output end of the calculation module II, and the output end is connected to the input end of the feedback module I, which is used to calculate the correlation coefficient r between the first set and the second set, and the confidence α∈(0, 1). If |r|≥α, the suspected defect area is judged to be a retained area and the feedback module I is executed. Otherwise, the suspected defect area is judged to be an unqualified area and the feedback module I is executed.
3. The textile surface defect detection system based on artificial intelligence according to claim 2 is characterized in that: It also includes an adjustment module: the input end is connected to the output end of the acquisition module II, and the output end is connected to the input end of the processing module, which is used to calculate the extreme difference values of the grayscale values of all pixels in each specified preset direction in the grayscale image of the preset structure area and the discrete deviation value of the grayscale value distribution, and negatively correlate the accumulated values of the extreme difference values in all specified preset directions and normalize them to obtain local brightness consistency; The product of the local brightness consistency and the discrete deviation value is taken as the adjustment value, and the grayscale of each pixel in the grayscale image of the measured fabric surface is uniformly added and adjusted according to the adjustment value.
4. The textile surface defect detection system based on artificial intelligence according to claim 1, characterized in that: It also includes an analysis module and a correction module; Analysis module: the input end is connected to the output end of the acquisition module II, and the output end is connected to the input end of the correction module, and is used to calculate the gradient amplitude of the brightness change of each pixel in the grayscale image of the measured fabric surface in the specified irradiation area in the specified preset direction; Correction module: The input end is connected to the output end of the analysis module, and the output end is connected to the input end of the processing module. It is used to set the gradient threshold according to historical data, count the pixels whose gradient amplitude is lower than the gradient threshold, merge adjacent pixels into multiple shadow areas, record them as the first shadow area set, and correct the shadow area in the grayscale image.
5. The textile surface defect detection system based on artificial intelligence according to claim 4 is characterized in that: It also includes an irradiation module II, an acquisition module IV, a judgment module III, and a feedback module II. When the judgment module I determines that there is no suspicious defect in the structural area, the irradiation module II is also executed; Irradiation module II: the input end is connected to the output end of the judgment module I, and the output end is connected to the input end of the acquisition module IV, and is used to provide a second light source at another designated position to irradiate the same designated irradiation area of the fabric; Acquisition module IV: the input end is connected to the output end of the irradiation module II, and the output end is connected to the input end of the judgment module III, and is used to acquire the grayscale image of the surface of the measured fabric in the specified irradiation area, calculate the gradient amplitude of the brightness change of each pixel point in the grayscale image in the specified preset direction, count the pixel points below the gradient threshold, and merge adjacent pixel points into multiple shadow areas, which are recorded as a second shadow area set; Judgment module III: the input end is connected to the output end of acquisition module IV, and the output end is connected to the input end of feedback module II, and is used to perform similarity matching between the first shadow area set and the second shadow area set, and set a matching threshold according to historical data. If the similarity is lower than the matching threshold, it is judged that the matching fails, and the feedback II step is executed. Otherwise, it is judged that the matching is successful. Feedback module II: the input end is connected to the output end of the judgment module III, and the output end is connected to the input end of the illumination module I, and is used to adjust the brightness and position of the first light source according to the similarity matching result.
6. A textile surface defect detection method based on artificial intelligence, characterized in that: The following steps are involved: Obtaining data I: Obtaining a grayscale image of a target pattern preset in the system, taking the central pixel point of each pattern style as the starting pixel point, setting a preset structure area of a specified shape, and calculating a grayscale value distribution map of each preset structure area in a specified preset direction; Irradiation I: a first light source is set at a designated position to irradiate the fabric; Acquiring data II: acquiring a grayscale image of the surface of the fabric under test in the specified irradiation area; Data processing: According to the distribution of grayscale values of each pixel in the grayscale image, the region is expanded based on grayscale consistency with one pixel as the center to obtain expanded regions with different grayscales, and image segmentation is performed on the expanded regions with different grayscales in the grayscale image to obtain multiple segmented images; Recognition: Recognize the shape of the segmented image, and obtain the central pixel point of each segmented image according to the shape of the segmented image as the target pixel point, and make the preset shape area centered on the target pixel point as the structure area; Calculation I: obtaining a grayscale value distribution map in a specified preset direction with the target pixel point as the starting point in the structure area, and calculating the local consistency of the grayscale value distribution map of each structure area and each preset structure area respectively; Judgment I: If a structural region does not meet the local consistency with each preset structural region, it is judged that there is a suspected defect in the structural region, recorded as a suspected defect region, and the feedback step I is executed; otherwise, it is judged that there is no suspected defect in the structural region; Feedback I: Issue an alarm and upload the data to the management terminal.
7. The method for detecting textile surface defects based on artificial intelligence according to claim 6, characterized in that: Between the judgment step I and the feedback step I, there are also steps of obtaining data III, calculating II and judging II. In the judgment step I, when it is judged that there is a suspected defect in the structural area, the data obtaining step III is also executed: Obtaining data III: Obtaining the Euclidean distance between the central pixel point and the starting pixel point of different pattern styles in the preset structure area, recorded as the first set; Calculation II: extract the central pixel positions of different segmented images in the suspected defect area, and calculate the Euclidean distance between each central pixel position and the target pixel, which is recorded as the second set; Judgment II: Calculate the correlation coefficient r between the first set and the second set, and the confidence α∈(0, 1). If |r|≥α, then the suspected defect area is judged as a retained area and the feedback I step is executed. Otherwise, the suspected defect area is judged as an unqualified area and the feedback I step is executed.
8. The method for detecting textile surface defects based on artificial intelligence according to claim 7, characterized in that: There is also an adjustment step between the data acquisition II step and the data processing step: Adjustment: Calculate the extreme value of the grayscale value of all pixels in each specified preset direction and the discrete deviation value of the grayscale value distribution in the grayscale image of the preset structure area, perform negative correlation mapping on the accumulated value of the extreme value in all specified preset directions and normalize it to obtain local brightness consistency; The product of the local brightness consistency and the discrete deviation value is taken as the adjustment value, and the grayscale of each pixel in the grayscale image of the measured fabric surface is uniformly added and adjusted according to the adjustment value.
9. The method for detecting textile surface defects based on artificial intelligence according to claim 6, characterized in that: The following steps are also provided between the step of obtaining data II and the step of data processing: Analysis: Calculate the gradient amplitude of the brightness change of each pixel in the grayscale image of the measured fabric surface in the specified irradiation area in the specified preset direction; Correction: Set the gradient threshold according to historical data, count the pixels whose gradient amplitude is lower than the gradient threshold, merge adjacent pixels into multiple shadow areas, record them as the first shadow area set, and correct the shadow areas in the grayscale image.
10. The method for detecting textile surface defects based on artificial intelligence according to claim 9, characterized in that: After the judgment step I, there are also an irradiation step II, a data acquisition step IV, a judgment step III and a feedback step II. In the judgment step I, when it is judged that there is no suspected defect in the structural area, the irradiation step II is also performed; Irradiation II: a second light source is arranged at another designated position to irradiate the same designated irradiation area of the fabric; Acquiring data IV: acquiring a grayscale image of the surface of the fabric under test in the specified irradiation area, calculating the gradient amplitude of the brightness change of each pixel in the grayscale image in the specified preset direction, counting the pixels below the gradient threshold, and merging adjacent pixels into multiple shadow areas, which are recorded as a second shadow area set; Judgment III: perform similarity matching between the first shadow area set and the second shadow area set, set a matching threshold according to historical data, if the similarity is lower than the matching threshold, it is judged that the matching fails, and the feedback step II is executed; otherwise, it is judged that the matching is successful; Feedback II: According to the similarity matching result, the brightness and position of the first light source are adjusted.
Citation Information
Cited By
Intelligent mask production detection system and method based on big data analysis
CN120028329A
Textile surface defect detection method and system
CN120761390A