Intelligent weaving defect image recognition and automatic classification method and system

Through the intelligent weaving defect image recognition and automatic classification method, image area classification, mathematical statistical feature analysis and deep learning model are used to solve the problems of low efficiency and poor accuracy of weaving defect recognition in the existing technology, and efficient and accurate defect recognition and classification are achieved.

CN119399196BActive Publication Date: 2025-04-01BAOJI DADI TEXTILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411984249.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-01
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The existing weaving defect identification and classification methods mainly rely on artificial visual inspection, which is inefficient and susceptible to subjective factors. Long-term visual inspection leads to visual fatigue among workers, reducing recognition accuracy.

Method used

The intelligent weaving defect image recognition and automatic classification method is adopted. By receiving weaving image recognition instructions, the weaving set to be detected is obtained for image shooting, the image area is extracted for classification and mathematical statistical feature analysis, and defect type recognition and automatic classification are combined with deep learning models.

Benefits of technology

It improves the accuracy and efficiency of weaving defect identification, reduces the workload of manual inspection, reduces the misjudgment rate caused by human factors, and improves the quality and efficiency of weaving defect identification and classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399196B_ABST
    Figure CN119399196B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of weaving image recognition, and is a method and system for intelligent weaving defect image recognition and automatic classification, comprising: performing image region classification on a weaving image to be detected to obtain a classified weaving image group, performing feature analysis on the classified weaving image to obtain statistical defect features and significant defect features, performing defect type recognition on each classified weaving image in the classified weaving image group to obtain a defect type marking group, marking image defect feature groups one by one using the defect type marking group to obtain a marked image feature group, summarizing the marked image feature groups to obtain a marked image feature group set, and training a deep learning model according to the marked image feature group set to obtain a defect automatic recognition model. The present invention can improve the accuracy and efficiency of weaving defect recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of weaving image recognition, and in particular to an intelligent weaving defect image recognition and automatic classification method and system. Background Art

[0002] In the production process of textiles, the presence of weaving defects will seriously affect the appearance quality and performance of the product. Weaving defects refer to fabric defects caused by various reasons during the weaving process, such as broken warp, broken weft, oil stains, color difference, etc. These defects not only affect the appearance of the product, but also may reduce the durability and comfort of the product. Therefore, effective identification and classification of weaving defects are crucial to ensure product quality.

[0003] The current method of identifying and classifying fabric defects mainly relies on manual visual inspection, which has many limitations. First, manual inspection is inefficient and difficult to meet the needs of large-scale production. Second, manual inspection is easily affected by subjective factors, and the accuracy of manual inspection results is difficult to guarantee. In addition, long-term visual inspection may also cause visual fatigue of workers, further reducing the accuracy of fabric identification and classification. Summary of the invention

[0004] The present invention provides an intelligent fabric defect image recognition and automatic classification method and system, the main purpose of which is to improve the accuracy and efficiency of fabric defect recognition.

[0005] To achieve the above-mentioned purpose, the present invention provides an intelligent fabric defect image recognition and automatic classification method, comprising:

[0006] Receiving a weaving image recognition instruction, acquiring a weaving set to be detected based on the weaving image recognition instruction, and taking images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected;

[0007] Extract the woven images to be detected in sequence from the woven image set to be detected, classify the image regions of the woven images to be detected, and obtain a classified woven image group;

[0008] Extracting classified woven images in the classified woven image group in sequence, performing mathematical statistical feature analysis on the classified woven images to obtain statistical defect features, wherein the statistical defect features include: an average defect pixel value, a maximum defect pixel value, and a minimum defect pixel value;

[0009] Performing image feature analysis on the classified woven fabric images to obtain significant defect features, wherein the significant defect features include: the number of significant defects and the average significant intensity difference;

[0010] Combining the statistical defect features and the significant defect features of the classified fabric images to obtain an image defect feature group;

[0011] Performing defect type identification on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type identification is performed by manual identification;

[0012] Using the defect type marking group to mark the image defect feature groups one by one to obtain a marked image feature group, summarizing the marked image feature group of each classified weaving image in each weaving image to be detected in the weaving image set to obtain a marked image feature group set;

[0013] According to the set of marked image features, the pre-acquired deep learning model is trained to obtain the automatic defect recognition model, and intelligent weaving defect image recognition and automatic classification are completed based on the automatic defect recognition model.

[0014] Optionally, the performing image region classification on the woven fabric image to be detected to obtain a classified woven fabric image group includes:

[0015] Acquire a standard woven image of the woven image to be detected, and calculate a standard pixel value of the standard woven image;

[0016] Identifying a set of pixels to be detected of the woven fabric image to be detected, and obtaining a set of pixel values ​​to be detected of the set of pixels to be detected;

[0017] Determining the number of target areas according to the standard pixel value and the pixel value set to be detected;

[0018] Based on the number of target areas, identifying a central pixel point group in the set of pixels to be detected, wherein the number of central pixel points is the same as the number of target areas;

[0019] Eliminate the central pixel point group from the pixel point set to be detected to obtain a pixel point set to be classified, and use the pixel point set to be classified to perform regional supplementation on the central pixel point group to obtain an original regional image group, wherein each original regional image corresponds to a central pixel point;

[0020] Extract original region images in the original region image group in sequence, identify original region pixel value sets in the original region images, and calculate original pixel deviations of the original region pixel value sets, wherein the original pixel deviations are expressed as:

[0021] ,

[0022] in, represents the original pixel deviation, Represents the number of original area pixel values ​​in the original area pixel value set, represents the jth original region pixel value in the original region pixel value set, Represents the pixel value of the kth original area;

[0023] Determining whether the original pixel deviation is greater than a preset standard pixel deviation;

[0024] If the original pixel deviation is greater than the standard pixel deviation, the original region image is used to update the woven fabric image to be detected, and the process returns to the step of identifying the pixel point set to be detected of the woven fabric image to be detected;

[0025] If the original pixel deviation is not greater than the standard pixel deviation, the original region image is recorded as a classified weaving image;

[0026] The classified woven fabric images are aggregated to obtain a classified woven fabric image group.

[0027] Optionally, determining the number of target areas according to the standard pixel value and the set of pixel values ​​to be detected includes:

[0028] Based on the standard pixel value and the pixel value set to be detected, the regional pixel deviation is calculated, and according to the regional pixel deviation and the preset minimum pixel deviation, the pixel deviation factor is calculated, wherein the regional pixel deviation and the pixel deviation factor are respectively expressed as:

[0029] ,

[0030] in, represents the regional pixel deviation, represents the number of pixel values ​​to be detected in the set of pixel values ​​to be detected, represents the i-th pixel value to be detected in the set of pixel values ​​to be detected, Represents the standard pixel value, represents the pixel deviation factor, Indicates the minimum pixel deviation;

[0031] According to the pixel deviation factor and the preset number of standard areas, the number of target areas is calculated using the following formula:

[0032] ,

[0033] in, Indicates the number of target areas, Indicates the number of standard regions.

[0034] Optionally, the step of identifying a central pixel point group in the set of pixels to be detected based on the number of target areas includes:

[0035] Extracting the maximum pixel and the second largest pixel from the set of pixels to be detected, wherein the maximum pixel is the pixel with the largest pixel value in the set of pixels to be detected, and the second largest pixel is the pixel with the second largest pixel value in the set of pixels to be detected;

[0036] Eliminate the largest pixel and the second largest pixel from the set of pixels to be detected to obtain a set of eliminated pixels;

[0037] Calculating the pixel space distance between the largest pixel and the second largest pixel, and determining whether the pixel space distance is greater than a preset minimum area span;

[0038] If the pixel space distance is not greater than the minimum area span, the pixel set to be detected is updated using the eliminated pixel set, and the step of extracting the maximum pixel point and the second largest pixel point in the pixel set to be detected is returned until the eliminated pixel set is an empty set;

[0039] If the pixel space distance is greater than the minimum area span, the maximum pixel point and the second largest pixel point are added to the pre-constructed original pixel point group to obtain the target pixel point group;

[0040] The pixel set to be detected and the original pixel set are updated respectively using the eliminated pixel set and the target pixel set, and the step of extracting the maximum pixel and the second largest pixel in the pixel set to be detected is returned until the eliminated pixel set is an empty set, and the target pixel set at this time is recorded as the central pixel set.

[0041] Optionally, the method of using the pixel set to be classified to perform regional supplementation on the central pixel group to obtain the original regional image group includes:

[0042] Constructing a central set for each central pixel point in the central pixel point group to obtain a plurality of original region pixel point sets, wherein the number of the original region pixel point sets is the same as the number of the central pixel points, and when the original region pixel point sets are created, the original region pixel point sets only include the central pixel points;

[0043] Extract the pixels to be classified in sequence from the set of pixels to be classified;

[0044] Extract central pixel points in the central pixel point group in sequence, and calculate the central pixel distance between the pixel point to be classified and the central pixel point;

[0045] Summarizing the central pixel distances between the pixel to be classified and each central pixel in the central pixel group to obtain a central pixel distance group;

[0046] Determine the minimum pixel distance of the central pixel distance group, identify the nearest central pixel point corresponding to the minimum pixel distance in the central pixel point group, and determine the nearest regional pixel point set corresponding to the nearest central pixel point in multiple original regional pixel point sets;

[0047] The pixel points to be classified are added to the nearest region pixel point set to obtain the target region pixel point set, the nearest region pixel point set is updated using the target region pixel point set, and the step of sequentially extracting the pixel points to be classified from the pixel point set to be classified is returned;

[0048] The target area pixel point sets are aggregated to obtain multiple target area pixel point sets, and an original area image group is determined based on the multiple target area pixel point sets, wherein the number of the target area pixel point sets is the same as the number of the original area images, and the original area image is composed of all the target area pixel points in the target area pixel point sets.

[0049] Optionally, calculating the center pixel distance between the pixel to be classified and the center pixel includes:

[0050] Determine the color channel value to be classified and the pixel coordinates to be classified of the pixel to be classified, wherein the color channel value to be classified includes: a red channel value to be classified, a green channel value to be classified and a blue channel value to be classified;

[0051] Determine the central color channel value and the central pixel coordinates of the central pixel point, wherein the central color channel value includes: a central red channel value, a central green channel value, and a central blue channel value;

[0052] The center color distance is calculated according to the center color channel value and the color channel value to be classified, wherein the center color distance is expressed as:

[0053] ,

[0054] in, represents the center color distance, Represents the center red channel value, Represents the red channel value to be classified, represents the center green channel value, Represents the green channel value to be classified, Represents the center blue channel value, Indicates the blue channel value to be classified;

[0055] Based on the center pixel coordinates and the coordinates of the pixels to be classified, the center space distance is calculated, where the center space distance is expressed as:

[0056] ,

[0057] in, represents the center space distance, Indicates the horizontal coordinate value of the center pixel coordinate, Represents the horizontal coordinate value of the pixel coordinate to be classified, Indicates the ordinate value of the center pixel coordinate, The ordinate value representing the coordinate of the pixel to be classified;

[0058] According to the center color distance and center space distance, the center pixel distance is calculated using the following formula:

[0059] ,

[0060] in, represents the center pixel distance, Represents a logarithmic function.

[0061] Optionally, performing image feature analysis on the classified woven fabric images to obtain significant defect features includes:

[0062] According to the standard pixel value, defect pixel intensity analysis is performed on the classified woven fabric image to obtain a pixel intensity difference set and an overall defect intensity;

[0063] Identify the maximum pixel intensity difference and the minimum pixel intensity difference in the pixel intensity difference set, and respectively identify the maximum intensity pixel point and the minimum intensity pixel point corresponding to the maximum pixel intensity difference and the minimum pixel intensity difference;

[0064] Based on the maximum intensity pixel point and the minimum intensity pixel point, the classified woven cloth image is cut to obtain a cut classified image group, wherein the cut classified image group includes two cut classified images;

[0065] Extracting cutting classification images in sequence from the cutting classification image group, and calculating the cutting strength difference set and the cutting defect strength of the cutting classification images according to the standard pixel value;

[0066] Calculate the local strength difference between the cutting defect strength and the overall defect strength;

[0067] Using the cutting intensity difference set and the cutting classification image to update the pixel intensity difference set and the classification woven fabric image respectively, and returning to the step of identifying the maximum pixel intensity difference and the minimum pixel intensity difference in the pixel intensity difference set until the number of the cutting classification images is not less than the preset standard cutting number;

[0068] The local intensity differences are summarized to obtain a local intensity difference set, and the average intensity difference of the local intensity difference set is calculated. According to the average intensity difference and a preset detection accuracy coefficient, a defect intensity threshold is set, wherein the defect intensity threshold is expressed as:

[0069] ,

[0070] in, represents the defect intensity threshold, represents the detection accuracy coefficient, represents the average intensity difference;

[0071] A significant defect intensity difference set greater than or equal to the defect intensity threshold is identified in the local intensity difference set, and the number of significant defects and the average significant intensity difference of the significant defect intensity difference set are obtained.

[0072] Optionally, the defect pixel intensity analysis of the classified woven fabric images to obtain a pixel intensity difference set and an overall defect intensity includes:

[0073] In the classified woven fabric image, classified pixel points are sequentially extracted, and classified pixel values ​​of the classified pixel points are identified, and the pixel intensity difference between the classified pixel value and the standard pixel value is calculated, and the pixel intensity difference is summarized to obtain a pixel intensity difference set, wherein the pixel intensity difference is expressed as:

[0074] ,

[0075] in, represents the pixel intensity difference, represents the absolute value symbol, Represents the classified pixel value;

[0076] Based on the pixel intensity difference set, the overall defect intensity is calculated using the following formula:

[0077] ,

[0078] in, Indicates the overall defect strength, represents the number of pixel intensity differences in the pixel intensity difference set, Represents the vth pixel intensity difference in the pixel intensity difference set.

[0079] Optionally, the classified woven fabric image is cut based on the maximum intensity pixel point and the minimum intensity pixel point to obtain a cut classified image group, including:

[0080] Based on the maximum intensity pixel point and the minimum intensity pixel point, construct an intensity drop line, wherein the intensity drop line is a line connecting the maximum intensity pixel point and the minimum intensity pixel point;

[0081] The perpendicular bisector of the intensity drop line is determined, and the classified fabric image is cut based on the perpendicular bisector to obtain a cut classified image group.

[0082] To achieve the above object, the present invention also provides an intelligent fabric defect image recognition and automatic classification system, comprising:

[0083] A weaving image classification module is used to receive a weaving image recognition instruction, obtain a weaving set to be detected based on the weaving image recognition instruction, and take images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected, extract the weaving images to be detected in the weaving image set to be detected in sequence, and classify the weaving images to be detected by image regions to obtain a classified weaving image group;

[0084] A defect feature analysis module is used to extract classified woven images in the classified woven image group in sequence, perform mathematical statistical feature analysis on the classified woven images to obtain statistical defect features, wherein the statistical defect features include: average defect pixel value, maximum defect pixel value and minimum defect pixel value, perform image feature analysis on the classified woven images to obtain significant defect features, wherein the significant defect features include: number of significant defects and average significant intensity difference;

[0085] A defect type recognition module is used to combine the statistical defect features and significant defect features of the classified woven fabric images to obtain an image defect feature group, and to perform defect type recognition on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type recognition is performed by manual recognition;

[0086] The recognition model training module is used to use the defect type marking group to mark the image defect feature group one by one to obtain a marked image feature group, summarize the marked image feature group of each classified weaving image in each weaving image to be detected in the weaving image set to obtain a marked image feature group set, and train the pre-acquired deep learning model according to the marked image feature group set to obtain a defect automatic recognition model.

[0087] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0088] a memory storing at least one instruction; and

[0089] The processor executes the instructions stored in the memory to implement the above-mentioned intelligent weaving defect image recognition and automatic classification method.

[0090] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned intelligent weaving defect image recognition and automatic classification method.

[0091] In order to solve the problem described in the background technology, the present invention first classifies the image regions of the woven image to be detected to obtain a classified woven image group, which can distinguish different regions in the woven image, thereby achieving a targeted and more detailed analysis of each region, thereby improving the pertinence and efficiency of defect detection, and then analyzing the mathematical statistical features in the classified woven image, wherein the mathematical statistical features can quantify the statistical features of the defects, such as the distribution of pixel values, which provides an important numerical basis for subsequent defect identification and helps to improve the accuracy of identification, and then identifies the significant defect features in the classified woven image, wherein the significant defect features can represent the defects that have a greater impact on the quality of the woven fabric. Defect distribution, through significant defect features, can more accurately identify and classify defects. Further, artificial defect type identification can be used. This step can use human experience and intuition to provide accurate labels for image defect features, providing a data basis for subsequent training of deep learning models. Finally, the deep learning model is trained using the labeled image feature set to obtain an automatic defect recognition model. The automatic defect recognition model can realize automatic defect recognition and classification, which greatly improves the efficiency of fabric defect recognition, reduces the workload of manual detection, and can reduce the misjudgment rate caused by human factors, improving the quality and efficiency of overall fabric defect recognition and classification. Therefore, the present invention can improve the accuracy and efficiency of fabric defect recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] Figure 1 A schematic diagram of a flow chart of an intelligent weaving defect image recognition and automatic classification method provided by an embodiment of the present invention;

[0093] Figure 2 A functional module diagram of an intelligent fabric defect image recognition and automatic classification system provided by an embodiment of the present invention;

[0094] Figure 3 A schematic diagram of the structure of an electronic device for implementing the intelligent weaving defect image recognition and automatic classification method provided in one embodiment of the present invention.

[0095] Description of reference numerals:

[0096] 1. Electronic device; 10. Processor; 11. Memory; 12. Bus.

[0097] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0098] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0099] The embodiment of the present application provides an intelligent weaving defect image recognition and automatic classification method. The execution subject of the intelligent weaving defect image recognition and automatic classification method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the intelligent weaving defect image recognition and automatic classification method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0100] Reference Figure 1 FIG. 1 is a flow chart of an intelligent fabric defect image recognition and automatic classification method provided by an embodiment of the present invention. In this embodiment, the intelligent fabric defect image recognition and automatic classification method includes:

[0101] S1. Receive a weaving image recognition instruction, obtain a weaving set to be detected based on the weaving image recognition instruction, and take images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected.

[0102] It can be understood that the weaving image recognition instruction refers to a manually initiated instruction for defect identification and automatic classification of weaving, and the weaving image recognition instruction includes the model of the weaving that needs to be identified, the weaving to be tested refers to the weaving that needs to be defect identified and classified, and the weaving image to be tested refers to the image obtained after shooting the weaving to be tested.

[0103] For example, Xiao Zhang is a manager of a weaving factory. One day, Xiao Zhang received a weaving image recognition instruction, which required him to identify defects and automatically classify a batch of model a weavings. So Xiao Zhang randomly selected multiple weavings to be tested from the batch of model a weavings, and recorded them as a weaving set to be tested. Then, Xiao Zhang used a high-definition camera to photograph all the weavings to be tested in the weaving set to be tested, and obtained the image set of weavings to be tested, wherein the weavings to be tested were photographed from the top to the bottom from the front, and the distance between the high-definition camera and the weavings to be tested was a fixed constant.

[0104] S2. Extract the woven images to be detected in sequence from the woven image set to be detected, classify the image regions of the woven images to be detected, and obtain a classified woven image group.

[0105] It should be explained that the classified woven image refers to the woven image to be detected after image area classification. Since the area of ​​the woven image to be detected is large and may contain many defects, regional classification of the woven image to be detected can reduce the number of defects in each classified woven image, thereby reducing the complexity of subsequent image processing.

[0106] In detail, the image region classification of the woven fabric image to be detected to obtain a classified woven fabric image group includes:

[0107] Acquire a standard woven image of the woven image to be detected, and calculate a standard pixel value of the standard woven image;

[0108] Identifying a set of pixels to be detected of the woven fabric image to be detected, and obtaining a set of pixel values ​​to be detected of the set of pixels to be detected;

[0109] Determining the number of target areas according to the standard pixel value and the pixel value set to be detected;

[0110] Based on the number of target areas, identifying a central pixel point group in the set of pixels to be detected, wherein the number of central pixel points is the same as the number of target areas;

[0111] Eliminate the central pixel point group from the pixel point set to be detected to obtain a pixel point set to be classified, and use the pixel point set to be classified to perform regional supplementation on the central pixel point group to obtain an original regional image group, wherein each original regional image corresponds to a central pixel point;

[0112] Extract original region images in the original region image group in sequence, identify original region pixel value sets in the original region images, and calculate original pixel deviations of the original region pixel value sets, wherein the original pixel deviations are expressed as:

[0113] ,

[0114] in, represents the original pixel deviation, Represents the number of original area pixel values ​​in the original area pixel value set, represents the jth original region pixel value in the original region pixel value set, Represents the pixel value of the kth original area;

[0115] Determining whether the original pixel deviation is greater than a preset standard pixel deviation;

[0116] If the original pixel deviation is greater than the standard pixel deviation, the original region image is used to update the woven fabric image to be detected, and the process returns to the step of identifying the pixel point set to be detected of the woven fabric image to be detected;

[0117] If the original pixel deviation is not greater than the standard pixel deviation, the original region image is recorded as a classified weaving image;

[0118] The classified woven fabric images are aggregated to obtain a classified woven fabric image group.

[0119] It can be understood that the standard woven image refers to a woven image without any defects that is set artificially, the woven model of the woven image is the same as the woven image to be detected, the standard pixel value refers to the average value of the pixel values ​​of each pixel in the standard woven image, the pixel to be detected refers to the pixel in the woven image to be detected, the pixel value to be detected refers to the pixel value of the pixel to be detected, the number of target areas refers to the number of classified woven images in the step to be classified, the central pixel refers to the central pixel in the classified woven image, the set of pixels to be classified refers to the pixels to be detected after elimination, the original area image refers to the woven image to be detected after preliminary division, wherein the center of the original area image is the central pixel, the original area pixel value refers to the pixel in the original area image, the original pixel deviation refers to the variance between the individual pixel values ​​in the original area pixel value set, and the standard pixel deviation refers to the constant of the artificially set pixel deviation.

[0120] In detail, determining the number of target areas according to the standard pixel value and the pixel value set to be detected includes:

[0121] Based on the standard pixel value and the pixel value set to be detected, the regional pixel deviation is calculated, and according to the regional pixel deviation and the preset minimum pixel deviation, the pixel deviation factor is calculated, wherein the regional pixel deviation and the pixel deviation factor are respectively expressed as:

[0122] ,

[0123] in, represents the regional pixel deviation, represents the number of pixel values ​​to be detected in the set of pixel values ​​to be detected, represents the i-th pixel value to be detected in the set of pixel values ​​to be detected, Represents the standard pixel value, represents the pixel deviation factor, Indicates the minimum pixel deviation;

[0124] According to the pixel deviation factor and the preset number of standard areas, the number of target areas is calculated using the following formula:

[0125] ,

[0126] in, Indicates the number of target areas, Indicates the number of standard regions.

[0127] It can be understood that the regional pixel deviation refers to a numerical value used to represent the degree of deviation between the pixel finger set to be detected and the standard pixel value. The larger the regional pixel deviation, the greater the color deviation between the woven image to be detected and the standard woven image, that is, there will be more defects in the woven image to be detected. At this time, it is necessary to increase the number of images to be classified for the woven image to be detected in order to better perform image processing.

[0128] It should be explained that the minimum pixel deviation refers to an artificially set constant regarding regional pixel deviation, the pixel deviation factor refers to the numerical value of the degree of color deviation in the fabric image to be detected, and the number of standard areas refers to an artificially set constant, which is the number of images that need to be classified under the minimum pixel deviation.

[0129] In detail, the step of identifying a central pixel point group in the set of pixels to be detected based on the number of target areas includes:

[0130] Extracting the maximum pixel and the second largest pixel from the set of pixels to be detected, wherein the maximum pixel is the pixel with the largest pixel value in the set of pixels to be detected, and the second largest pixel is the pixel with the second largest pixel value in the set of pixels to be detected;

[0131] Eliminate the largest pixel and the second largest pixel from the set of pixels to be detected to obtain a set of eliminated pixels;

[0132] Calculating the pixel space distance between the largest pixel and the second largest pixel, and determining whether the pixel space distance is greater than a preset minimum area span;

[0133] If the pixel space distance is not greater than the minimum area span, the pixel set to be detected is updated using the eliminated pixel set, and the step of extracting the maximum pixel point and the second largest pixel point in the pixel set to be detected is returned until the eliminated pixel set is an empty set;

[0134] If the pixel space distance is greater than the minimum area span, the maximum pixel point and the second largest pixel point are added to the pre-constructed original pixel point group to obtain the target pixel point group;

[0135] The pixel set to be detected and the original pixel set are updated respectively using the eliminated pixel set and the target pixel set, and the step of extracting the maximum pixel and the second largest pixel in the pixel set to be detected is returned until the eliminated pixel set is an empty set, and the target pixel set at this time is recorded as the central pixel set.

[0136] It can be understood that the maximum pixel point refers to the pixel point with the maximum pixel value in the pixel point set to be detected, the second largest pixel point refers to the pixel point with the second largest pixel value in the pixel point set to be detected, the eliminated pixel point set refers to the pixel point set to be detected after the maximum pixel point and the second largest pixel point are eliminated, the pixel space distance refers to the actual space distance between the maximum pixel point and the second largest pixel point in the woven image to be detected, the minimum area span refers to the minimum width of the classified woven image set artificially, the original pixel point group refers to the set of the maximum pixel point and the second largest pixel point before the current maximum pixel point and the second largest pixel point are obtained, in the initial state, the original pixel point group is an empty set, and the target pixel point group refers to the original pixel point group after being supplemented by the current maximum pixel point and the second largest pixel point.

[0137] It should be explained that when the pixel space distance is greater than the minimum area span, it means that the largest pixel and the second largest pixel may come from the same defect, and they should not be regarded as the central pixels of two separately classified woven images.

[0138] In detail, the method of using the pixel set to be classified to perform regional supplementation on the central pixel group to obtain the original regional image group includes:

[0139] Constructing a central set for each central pixel point in the central pixel point group to obtain a plurality of original region pixel point sets, wherein the number of the original region pixel point sets is the same as the number of the central pixel points, and when the original region pixel point sets are created, the original region pixel point sets only include the central pixel points;

[0140] Extract the pixels to be classified in sequence from the set of pixels to be classified;

[0141] Extract central pixel points in the central pixel point group in sequence, and calculate the central pixel distance between the pixel point to be classified and the central pixel point;

[0142] Summarizing the central pixel distances between the pixel to be classified and each central pixel in the central pixel group to obtain a central pixel distance group;

[0143] Determine the minimum pixel distance of the central pixel distance group, identify the nearest central pixel point corresponding to the minimum pixel distance in the central pixel point group, and determine the nearest regional pixel point set corresponding to the nearest central pixel point in multiple original regional pixel point sets;

[0144] The pixel points to be classified are added to the nearest region pixel point set to obtain the target region pixel point set, the nearest region pixel point set is updated using the target region pixel point set, and the step of sequentially extracting the pixel points to be classified from the pixel point set to be classified is returned;

[0145] The target area pixel point sets are aggregated to obtain multiple target area pixel point sets, and an original area image group is determined based on the multiple target area pixel point sets, wherein the number of the target area pixel point sets is the same as the number of the original area images, and the original area image is composed of all the target area pixel points in the target area pixel point sets.

[0146] It can be understood that the original area pixel point set refers to a set of pixel points distributed in the same classified woven image as the central pixel point. When the original area pixel point is initially created, since there is no additional pixel point to be classified, the original area pixel point set only contains one central pixel point.

[0147] It should be explained that the center pixel distance refers to a numerical value used to represent the similarity between the pixel to be classified and the center pixel. It includes the actual space distance and color space distance between the pixel to be classified and the center pixel. The detailed calculation steps of the center pixel distance will be given later.

[0148] Furthermore, the minimum pixel distance refers to the minimum value in the center pixel distance group, the nearest center pixel point refers to the center pixel point corresponding to the minimum pixel distance, the nearest area pixel point set refers to the original area pixel point set corresponding to the nearest center pixel point in multiple original area pixel point sets, and the target area pixel point set refers to the nearest pixel point set after supplementation.

[0149] Furthermore, the detailed steps of determining the original area image group based on multiple target area pixel point sets are: extracting target area pixel point sets from multiple target area pixel point sets in sequence, dividing all target area pixel points in the target area pixel point sets into original area images, and aggregating the original area images to obtain the original area image group.

[0150] In detail, the calculation of the center pixel distance between the pixel to be classified and the center pixel includes:

[0151] Determine the color channel value to be classified and the pixel coordinates to be classified of the pixel to be classified, wherein the color channel value to be classified includes: a red channel value to be classified, a green channel value to be classified and a blue channel value to be classified;

[0152] Determine the central color channel value and the central pixel coordinates of the central pixel point, wherein the central color channel value includes: a central red channel value, a central green channel value, and a central blue channel value;

[0153] The center color distance is calculated according to the center color channel value and the color channel value to be classified, wherein the center color distance is expressed as:

[0154] ,

[0155] in, represents the center color distance, Represents the center red channel value, Represents the red channel value to be classified, represents the center green channel value, Represents the green channel value to be classified, Represents the center blue channel value, Indicates the blue channel value to be classified;

[0156] Based on the center pixel coordinates and the coordinates of the pixels to be classified, the center space distance is calculated, where the center space distance is expressed as:

[0157] ,

[0158] in, represents the center space distance, Indicates the horizontal coordinate value of the center pixel coordinate, Represents the horizontal coordinate value of the pixel coordinate to be classified, Indicates the ordinate value of the center pixel coordinate, The ordinate value representing the coordinate of the pixel to be classified;

[0159] According to the center color distance and center space distance, the center pixel distance is calculated using the following formula:

[0160] ,

[0161] in, represents the center pixel distance, Represents a logarithmic function.

[0162] It should be explained that the color channel value to be classified refers to the color channel value of each color of the pixel to be classified in the RGB color space, wherein the color channel value in the RGB color space includes: red channel value, green channel value and blue channel value, the pixel coordinate to be classified refers to the coordinate value of the pixel to be classified in the woven image to be detected, the center color channel value refers to the color channel value of each color of the center pixel in the RGB color space, the center pixel coordinate refers to the coordinate value of the center pixel in the woven image to be detected, the center color distance refers to the numerical value used to represent the color difference between the pixel to be classified and the center pixel, and the center space distance refers to the numerical value of the space distance difference between the pixel to be classified and the center pixel.

[0163] Furthermore, when the central spatial distance between the pixel to be classified and the central pixel is small, it means that they are close in space and may come from the same defect. However, the error of judging that they come from the same defect only by spatial distance is large. Therefore, the central color distance is introduced. When the central color distance between them is small, it means that the color difference between them is small and there is a greater possibility that they come from the same defect. However, the central color distance cannot be the decisive factor in whether the pixel to be classified and the central pixel come from the same defect, because even if the central color distance between the pixel to be classified and the central pixel is very close, they are far apart in space, then they still do not come from the same defect. Therefore, in the actual calculation of the central pixel distance, the proportion of the central color distance should be reduced. The logarithmic function can be introduced to reduce the calculation weight of the central color distance when calculating the central pixel distance.

[0164] S3. Extract classified woven images in the classified woven image group in sequence, perform mathematical statistical feature analysis on the classified woven images, and obtain statistical defect features, wherein the statistical defect features include: an average defect pixel value, a maximum defect pixel value, and a minimum defect pixel value.

[0165] It can be understood that the statistical defect features refer to the numerical features obtained after the pixel points in the classified woven image are subjected to mathematical statistics, wherein the mathematical statistics method includes: calculating the average pixel value of each pixel point in the classified woven image, that is, the average defect pixel value, calculating the maximum pixel value and the minimum pixel value in the classified woven image, that is, the maximum defect pixel value and the minimum defect pixel value, these statistical defect features can reflect the overall distribution of pixel values ​​in the classified woven image.

[0166] S4. Perform image feature analysis on the classified woven fabric images to obtain significant defect features, wherein the significant defect features include: the number of significant defects and the average significant intensity difference.

[0167] It should be explained that the significant defect feature refers to the numerical value used to represent the local defect pixel feature in the classified woven image, which includes: the number of significant defects and the average significant intensity difference, among which the detailed calculation steps of the number of significant defects and the average significant intensity difference will be given later.

[0168] In detail, the image feature analysis of the classified woven fabric images is performed to obtain significant defect features, including:

[0169] According to the standard pixel value, defect pixel intensity analysis is performed on the classified woven fabric image to obtain a pixel intensity difference set and an overall defect intensity;

[0170] Identify the maximum pixel intensity difference and the minimum pixel intensity difference in the pixel intensity difference set, and respectively identify the maximum intensity pixel point and the minimum intensity pixel point corresponding to the maximum pixel intensity difference and the minimum pixel intensity difference;

[0171] Based on the maximum intensity pixel point and the minimum intensity pixel point, the classified woven cloth image is cut to obtain a cut classified image group, wherein the cut classified image group includes two cut classified images;

[0172] Extracting cutting classification images in sequence from the cutting classification image group, and calculating the cutting strength difference set and the cutting defect strength of the cutting classification images according to the standard pixel value;

[0173] Calculate the local strength difference between the cutting defect strength and the overall defect strength;

[0174] Using the cutting intensity difference set and the cutting classification image to update the pixel intensity difference set and the classification woven fabric image respectively, and returning to the step of identifying the maximum pixel intensity difference and the minimum pixel intensity difference in the pixel intensity difference set until the number of the cutting classification images is not less than the preset standard cutting number;

[0175] The local intensity differences are summarized to obtain a local intensity difference set, and the average intensity difference of the local intensity difference set is calculated. According to the average intensity difference and a preset detection accuracy coefficient, a defect intensity threshold is set, wherein the defect intensity threshold is expressed as:

[0176] ,

[0177] in, represents the defect intensity threshold, represents the detection accuracy coefficient, represents the average intensity difference;

[0178] A significant defect intensity difference set greater than or equal to the defect intensity threshold is identified in the local intensity difference set, and the number of significant defects and the average significant intensity difference of the significant defect intensity difference set are obtained.

[0179] It can be understood that the pixel intensity difference refers to the pixel difference between the standard pixel value and the pixel value in the classified woven image, the overall defect intensity refers to the numerical value used to represent the defect intensity in the classified woven image, and the detailed calculation steps of the pixel intensity difference and the overall defect intensity will be given in and later, the maximum pixel intensity difference and the minimum pixel intensity difference respectively refer to the maximum value and the minimum value in the pixel intensity difference set, the cut classified image refers to the classified woven image after cutting, the definitions of the cutting intensity difference and the cutting defect intensity are the same as the pixel intensity difference and the overall defect intensity, and will not be repeated here.

[0180] It should be explained that the local intensity difference refers to the difference between the cutting defect intensity and the overall defect intensity, the standard cutting number refers to the maximum number of cutting classification images set artificially, the detection accuracy coefficient refers to an artificially set constant, and the detection accuracy coefficient is greater than zero, the defect intensity threshold refers to the pixel intensity difference threshold used to distinguish defect areas from non-defect areas, the significant defect intensity refers to the local intensity difference greater than or equal to the defect intensity threshold, the significant defect number refers to the number of significant defect intensity differences in the significant defect intensity difference set, and the average significant intensity difference refers to the average value of all significant defect intensity differences in the significant defect intensity difference set.

[0181] In detail, the defect pixel intensity analysis of the classified woven fabric images to obtain the pixel intensity difference set and the overall defect intensity includes:

[0182] In the classified woven fabric image, classified pixel points are sequentially extracted, and classified pixel values ​​of the classified pixel points are identified, and the pixel intensity difference between the classified pixel value and the standard pixel value is calculated, and the pixel intensity difference is summarized to obtain a pixel intensity difference set, wherein the pixel intensity difference is expressed as:

[0183] ,

[0184] in, represents the pixel intensity difference, represents the absolute value symbol, Represents the classified pixel value;

[0185] Based on the pixel intensity difference set, the overall defect intensity is calculated using the following formula:

[0186] ,

[0187] in, Indicates the overall defect strength, represents the number of pixel intensity differences in the pixel intensity difference set, Represents the vth pixel intensity difference in the pixel intensity difference set.

[0188] It can be understood that the classified pixel value refers to the pixel value of the classified pixel point.

[0189] In detail, the classified woven fabric image is cut based on the maximum intensity pixel point and the minimum intensity pixel point to obtain a cut classified image group, including:

[0190] Based on the maximum intensity pixel point and the minimum intensity pixel point, construct an intensity drop line, wherein the intensity drop line is a line connecting the maximum intensity pixel point and the minimum intensity pixel point;

[0191] The perpendicular bisector of the intensity drop line is determined, and the classified fabric image is cut based on the perpendicular bisector to obtain a cut classified image group.

[0192] It should be explained that the intensity drop line refers to the line between the maximum intensity pixel point and the minimum intensity pixel point.

[0193] S5. Combining the statistical defect features and the significant defect features of the classified woven fabric images to obtain an image defect feature group.

[0194] It can be understood that the image defect feature group refers to a combination of statistical defect features and significant defect features, and the image defect feature group is used as a feature combination for classifying woven fabric images.

[0195] S6. Perform defect type identification on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type identification is performed manually.

[0196] It should be explained that the defect type mark refers to an artificially set mark symbol or value, which is used to mark the defect type represented in the classified woven image, wherein the defect types include: broken warp, broken weft, floating warp, normal, etc., and the defect type can be artificially identified by experts in related fields.

[0197] S7, using the defect type marking group to mark the image defect feature groups one by one to obtain a marked image feature group, summarizing the marked image feature group of each classified woven image in each woven image to be detected in the woven image set to obtain a marked image feature group set.

[0198] It can be understood that the labeled image features refer to the labeled image defect features, and the labeled image feature set obtained by summarizing all image defect features can be used in subsequent machine learning steps.

[0199] S8. According to the set of marked image features, the pre-acquired deep learning model is trained to obtain an automatic defect recognition model, and intelligent weaving defect image recognition and automatic classification are completed based on the automatic defect recognition model.

[0200] It should be explained that the deep learning model is, for example, a convolutional neural network, a recurrent neural network, etc. The automatic defect recognition model refers to a model that can automatically recognize and classify an input defect image. The image that needs to be recognized is input into the automatic defect recognition model, and the model will analyze the statistical defect features and significant defect features of the input image, wherein the method of analyzing the statistical defect features and the significant defect features has been given above, and the image is automatically recognized based on the analyzed features to obtain a recognition result, wherein the recognition result is the defect type that appears in the defect type marking group.

[0201] In order to solve the problem described in the background technology, the present invention first classifies the image regions of the woven image to be detected to obtain a classified woven image group, which can distinguish different regions in the woven image, thereby achieving a targeted and more detailed analysis of each region, thereby improving the pertinence and efficiency of defect detection, and then analyzing the mathematical statistical features in the classified woven image, wherein the mathematical statistical features can quantify the statistical features of the defects, such as the distribution of pixel values, which provides an important numerical basis for subsequent defect identification and helps to improve the accuracy of identification, and then identifies the significant defect features in the classified woven image, wherein the significant defect features can represent the defects that have a greater impact on the quality of the woven fabric. Defect distribution, through significant defect features, can more accurately identify and classify defects. Further, artificial defect type identification can be used. This step can use human experience and intuition to provide accurate labels for image defect features, providing a data basis for subsequent training of deep learning models. Finally, the deep learning model is trained using the labeled image feature set to obtain an automatic defect recognition model. The automatic defect recognition model can realize automatic defect recognition and classification, which greatly improves the efficiency of fabric defect recognition, reduces the workload of manual detection, and can reduce the misjudgment rate caused by human factors, improving the quality and efficiency of overall fabric defect recognition and classification. Therefore, the present invention can improve the accuracy and efficiency of fabric defect recognition.

[0202] like Figure 2 , which is a functional module diagram of an intelligent fabric defect image recognition and automatic classification system provided by an embodiment of the present invention.

[0203] The intelligent fabric defect image recognition and automatic classification system 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the intelligent fabric defect image recognition and automatic classification system 100 can include a fabric image classification module 101, a defect feature analysis module 102, a defect type recognition module 103 and a recognition model training module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0204] The weaving image classification module 101 is used to receive a weaving image recognition instruction, obtain a weaving set to be detected based on the weaving image recognition instruction, and take images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected, extract the weaving images to be detected from the weaving image set to be detected in sequence, and perform image region classification on the weaving images to be detected to obtain a classified weaving image group;

[0205] The defect feature analysis module 102 is used to extract classified woven fabric images in the classified woven fabric image group in sequence, perform mathematical statistical feature analysis on the classified woven fabric images to obtain statistical defect features, wherein the statistical defect features include: average defect pixel value, maximum defect pixel value and minimum defect pixel value, perform image feature analysis on the classified woven fabric images to obtain significant defect features, wherein the significant defect features include: number of significant defects and average significant intensity difference;

[0206] The defect type recognition module 103 is used to combine the statistical defect features and the significant defect features of the classified woven fabric images to obtain an image defect feature group, and to perform defect type recognition on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type recognition is performed by manual recognition;

[0207] The recognition model training module 104 is used to use the defect type marking group to mark the image defect feature group one by one to obtain a marked image feature group, summarize the marked image feature group of each classified weaving image in each weaving image to be detected in the weaving image set to obtain a marked image feature group set, and train the pre-acquired deep learning model according to the marked image feature group set to obtain a defect automatic recognition model.

[0208] In detail, the modules in the intelligent fabric defect image recognition and automatic classification system 100 in the embodiment of the present invention are used in the same manner as described above. Figure 1 The intelligent weaving defect image recognition described in the text is the same technical means as the automatic classification method and can produce the same technical effects, which will not be repeated here.

[0209] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for realizing an intelligent weaving defect image recognition and automatic classification method provided by an embodiment of the present invention.

[0210] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an intelligent fabric defect image recognition and automatic classification method program.

[0211] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 also includes an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the program of the intelligent weaving defect image recognition and automatic classification method, but also can be used to temporarily store data that has been output or is to be output.

[0212] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as intelligent weaving defect image recognition and automatic classification method programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0213] The bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 may be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0214] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0215] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management system, so that the power management system can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0216] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0217] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0218] The intelligent fabric defect image recognition and automatic classification method program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0219] Receiving a weaving image recognition instruction, acquiring a weaving set to be detected based on the weaving image recognition instruction, and taking images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected;

[0220] Extract the woven images to be detected in sequence from the woven image set to be detected, classify the image regions of the woven images to be detected, and obtain a classified woven image group;

[0221] Extracting classified woven images in the classified woven image group in sequence, performing mathematical statistical feature analysis on the classified woven images to obtain statistical defect features, wherein the statistical defect features include: an average defect pixel value, a maximum defect pixel value, and a minimum defect pixel value;

[0222] Performing image feature analysis on the classified woven fabric images to obtain significant defect features, wherein the significant defect features include: the number of significant defects and the average significant intensity difference;

[0223] Combining the statistical defect features and the significant defect features of the classified fabric images to obtain an image defect feature group;

[0224] Performing defect type identification on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type identification is performed by manual identification;

[0225] Using the defect type marking group to mark the image defect feature groups one by one to obtain a marked image feature group, summarizing the marked image feature group of each classified weaving image in each weaving image to be detected in the weaving image set to obtain a marked image feature group set;

[0226] According to the set of marked image features, the pre-acquired deep learning model is trained to obtain the automatic defect recognition model, and intelligent weaving defect image recognition and automatic classification are completed based on the automatic defect recognition model.

[0227] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 3 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0228] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or system that can carry the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0229] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0230] Receiving a weaving image recognition instruction, acquiring a weaving set to be detected based on the weaving image recognition instruction, and taking images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected;

[0231] Extract the woven images to be detected in sequence from the woven image set to be detected, classify the image regions of the woven images to be detected, and obtain a classified woven image group;

[0232] Extracting classified woven images in the classified woven image group in sequence, performing mathematical statistical feature analysis on the classified woven images to obtain statistical defect features, wherein the statistical defect features include: an average defect pixel value, a maximum defect pixel value, and a minimum defect pixel value;

[0233] Performing image feature analysis on the classified woven fabric images to obtain significant defect features, wherein the significant defect features include: the number of significant defects and the average significant intensity difference;

[0234] Combining the statistical defect features and the significant defect features of the classified fabric images to obtain an image defect feature group;

[0235] Performing defect type identification on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type identification is performed by manual identification;

[0236] Using the defect type marking group to mark the image defect feature groups one by one to obtain a marked image feature group, summarizing the marked image feature group of each classified weaving image in each weaving image to be detected in the weaving image set to obtain a marked image feature group set;

[0237] According to the set of marked image features, the pre-acquired deep learning model is trained to obtain the automatic defect recognition model, and intelligent weaving defect image recognition and automatic classification are completed based on the automatic defect recognition model.

[0238] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only illustrative, and actual implementation may have other division methods.

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

[0240] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0241] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0242] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. An intelligent method for recognizing and automatically classifying fabric defects, characterized in that: The method comprises: Receiving a weaving image recognition instruction, acquiring a weaving set to be detected based on the weaving image recognition instruction, and taking images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected; Extract the woven images to be detected in sequence from the woven image set to be detected, classify the image regions of the woven images to be detected, and obtain a classified woven image group; The method of performing image region classification on the woven fabric image to be detected to obtain a classified woven fabric image group includes: Acquire a standard woven image of the woven image to be detected, and calculate a standard pixel value of the standard woven image; Identifying a set of pixels to be detected of the woven fabric image to be detected, and obtaining a set of pixel values ​​to be detected of the set of pixels to be detected; Determining the number of target areas according to the standard pixel value and the pixel value set to be detected; Determining the number of target areas according to the standard pixel value and the pixel value set to be detected includes: Based on the standard pixel value and the pixel value set to be detected, the regional pixel deviation is calculated, and according to the regional pixel deviation and the preset minimum pixel deviation, the pixel deviation factor is calculated, wherein the regional pixel deviation and the pixel deviation factor are respectively expressed as: , in, represents the regional pixel deviation, represents the number of pixel values ​​to be detected in the set of pixel values ​​to be detected, represents the i-th pixel value to be detected in the set of pixel values ​​to be detected, Represents the standard pixel value, represents the pixel deviation factor, Indicates the minimum pixel deviation; According to the pixel deviation factor and the preset number of standard areas, the number of target areas is calculated using the following formula: , in, Indicates the number of target areas, Indicates the number of standard areas; Based on the number of target areas, identifying a central pixel point group in the set of pixels to be detected, wherein the number of central pixel points is the same as the number of target areas; Eliminate the central pixel point group from the pixel point set to be detected to obtain a pixel point set to be classified, and use the pixel point set to be classified to perform regional supplementation on the central pixel point group to obtain an original regional image group, wherein each original regional image corresponds to a central pixel point; Extract original region images in the original region image group in sequence, identify original region pixel value sets in the original region images, and calculate original pixel deviations of the original region pixel value sets, wherein the original pixel deviations are expressed as: , in, represents the original pixel deviation, Represents the number of original area pixel values ​​in the original area pixel value set, represents the jth original region pixel value in the original region pixel value set, Represents the pixel value of the kth original area; Determining whether the original pixel deviation is greater than a preset standard pixel deviation; If the original pixel deviation is greater than the standard pixel deviation, the original region image is used to update the woven fabric image to be detected, and the process returns to the step of identifying the pixel point set to be detected of the woven fabric image to be detected; If the original pixel deviation is not greater than the standard pixel deviation, the original region image is recorded as a classified weaving image; Summarizing the classified woven fabric images to obtain a classified woven fabric image group; Extracting classified woven images in the classified woven image group in sequence, performing mathematical statistical feature analysis on the classified woven images to obtain statistical defect features, wherein the statistical defect features include: an average defect pixel value, a maximum defect pixel value, and a minimum defect pixel value; Performing image feature analysis on the classified woven fabric images to obtain significant defect features, wherein the significant defect features include: the number of significant defects and the average significant intensity difference; Combining the statistical defect features and the significant defect features of the classified fabric images to obtain an image defect feature group; Performing defect type identification on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type identification is performed by manual identification; Using the defect type marking group to mark the image defect feature groups one by one to obtain a marked image feature group, summarizing the marked image feature group of each classified weaving image in each weaving image to be detected in the weaving image set to obtain a marked image feature group set; According to the set of marked image features, the pre-acquired deep learning model is trained to obtain the automatic defect recognition model, and intelligent weaving defect image recognition and automatic classification are completed based on the automatic defect recognition model.

2. The intelligent fabric defect image recognition and automatic classification method according to claim 1, characterized in that: The step of identifying a central pixel point group in the set of pixels to be detected based on the number of target areas includes: Extracting the maximum pixel and the second largest pixel from the set of pixels to be detected, wherein the maximum pixel is the pixel with the largest pixel value in the set of pixels to be detected, and the second largest pixel is the pixel with the second largest pixel value in the set of pixels to be detected; Eliminate the largest pixel and the second largest pixel from the set of pixels to be detected to obtain a set of eliminated pixels; Calculating the pixel space distance between the largest pixel and the second largest pixel, and determining whether the pixel space distance is greater than a preset minimum area span; If the pixel space distance is not greater than the minimum area span, the pixel set to be detected is updated using the eliminated pixel set, and the step of extracting the maximum pixel point and the second largest pixel point in the pixel set to be detected is returned until the eliminated pixel set is an empty set; If the pixel space distance is greater than the minimum area span, the maximum pixel point and the second largest pixel point are added to the pre-constructed original pixel point group to obtain the target pixel point group; The pixel set to be detected and the original pixel set are updated respectively using the eliminated pixel set and the target pixel set, and the step of extracting the maximum pixel and the second largest pixel in the pixel set to be detected is returned until the eliminated pixel set is an empty set, and the target pixel set at this time is recorded as the central pixel set.

3. The intelligent fabric defect image recognition and automatic classification method according to claim 2, characterized in that: The method of using the pixel point set to be classified to perform regional supplementation on the central pixel point group to obtain the original regional image group includes: Constructing a central set for each central pixel point in the central pixel point group to obtain a plurality of original region pixel point sets, wherein the number of the original region pixel point sets is the same as the number of the central pixel points, and when the original region pixel point sets are created, the original region pixel point sets only include the central pixel points; Extract the pixels to be classified in sequence from the set of pixels to be classified; Extract central pixel points in the central pixel point group in sequence, and calculate the central pixel distance between the pixel point to be classified and the central pixel point; Summarizing the central pixel distances between the pixel to be classified and each central pixel in the central pixel group to obtain a central pixel distance group; Determine a minimum pixel distance of the central pixel distance group, identify the nearest central pixel point corresponding to the minimum pixel distance in the central pixel point group, and determine the nearest regional pixel point set corresponding to the nearest central pixel point in multiple original regional pixel point sets; The pixel points to be classified are added to the nearest region pixel point set to obtain the target region pixel point set, the nearest region pixel point set is updated using the target region pixel point set, and the step of sequentially extracting the pixel points to be classified from the pixel point set to be classified is returned; The target area pixel point sets are aggregated to obtain multiple target area pixel point sets, and an original area image group is determined based on the multiple target area pixel point sets, wherein the number of the target area pixel point sets is the same as the number of the original area images, and the original area image is composed of all the target area pixel points in the target area pixel point sets.

4. The intelligent weaving defect image recognition and automatic classification method according to claim 3, characterized in that: The calculating the center pixel distance between the pixel to be classified and the center pixel includes: Determine the color channel value to be classified and the pixel coordinates to be classified of the pixel to be classified, wherein the color channel value to be classified includes: a red channel value to be classified, a green channel value to be classified and a blue channel value to be classified; Determine the central color channel value and the central pixel coordinates of the central pixel point, wherein the central color channel value includes: a central red channel value, a central green channel value, and a central blue channel value; The center color distance is calculated according to the center color channel value and the color channel value to be classified, wherein the center color distance is expressed as: , in, represents the center color distance, Represents the center red channel value, Represents the red channel value to be classified, represents the center green channel value, Represents the green channel value to be classified, Represents the center blue channel value, Indicates the blue channel value to be classified; Based on the center pixel coordinates and the coordinates of the pixels to be classified, the center space distance is calculated, where the center space distance is expressed as: , in, represents the center space distance, Indicates the horizontal coordinate value of the center pixel coordinate, Represents the horizontal coordinate value of the pixel coordinate to be classified, Indicates the ordinate value of the center pixel coordinate, The ordinate value representing the coordinate of the pixel to be classified; According to the center color distance and center space distance, the center pixel distance is calculated using the following formula: , in, represents the center pixel distance, Represents a logarithmic function.

5. The intelligent fabric defect image recognition and automatic classification method according to claim 4, characterized in that: The image feature analysis of the classified woven fabric images is performed to obtain significant defect features, including: According to the standard pixel value, defect pixel intensity analysis is performed on the classified woven fabric image to obtain a pixel intensity difference set and an overall defect intensity; Identify the maximum pixel intensity difference and the minimum pixel intensity difference in the pixel intensity difference set, and respectively identify the maximum intensity pixel point and the minimum intensity pixel point corresponding to the maximum pixel intensity difference and the minimum pixel intensity difference; Based on the maximum intensity pixel point and the minimum intensity pixel point, the classified woven cloth image is cut to obtain a cut classified image group, wherein the cut classified image group includes two cut classified images; Extracting cutting classification images in sequence from the cutting classification image group, and calculating the cutting strength difference set and the cutting defect strength of the cutting classification images according to the standard pixel value; Calculate the local strength difference between the cutting defect strength and the overall defect strength; Using the cutting intensity difference set and the cutting classification image to update the pixel intensity difference set and the classification woven fabric image respectively, and returning to the step of identifying the maximum pixel intensity difference and the minimum pixel intensity difference in the pixel intensity difference set until the number of the cutting classification images is not less than the preset standard cutting number; The local intensity differences are summarized to obtain a local intensity difference set, and the average intensity difference of the local intensity difference set is calculated. According to the average intensity difference and a preset detection accuracy coefficient, a defect intensity threshold is set, wherein the defect intensity threshold is expressed as: , in, represents the defect intensity threshold, represents the detection accuracy coefficient, represents the average intensity difference; A significant defect intensity difference set greater than or equal to the defect intensity threshold is identified in the local intensity difference set, and the number of significant defects and the average significant intensity difference of the significant defect intensity difference set are obtained.

6. The intelligent weaving defect image recognition and automatic classification method according to claim 5, characterized in that: The defect pixel intensity analysis of the classified woven fabric images is performed to obtain a pixel intensity difference set and an overall defect intensity, including: In the classified woven fabric image, classified pixel points are sequentially extracted, and classified pixel values ​​of the classified pixel points are identified, and the pixel intensity difference between the classified pixel value and the standard pixel value is calculated, and the pixel intensity difference is summarized to obtain a pixel intensity difference set, wherein the pixel intensity difference is expressed as: , in, represents the pixel intensity difference, represents the absolute value symbol, Represents the classified pixel value; Based on the pixel intensity difference set, the overall defect intensity is calculated using the following formula: , in, Indicates the overall defect strength, represents the number of pixel intensity differences in the pixel intensity difference set, Represents the vth pixel intensity difference in the pixel intensity difference set.

7. The intelligent fabric defect image recognition and automatic classification method according to claim 6, characterized in that: The classified woven cloth image is cut based on the maximum intensity pixel point and the minimum intensity pixel point to obtain a cut classified image group, including: Based on the maximum intensity pixel point and the minimum intensity pixel point, construct an intensity drop line, wherein the intensity drop line is a line connecting the maximum intensity pixel point and the minimum intensity pixel point; The perpendicular bisector of the intensity drop line is determined, and the classified fabric image is cut based on the perpendicular bisector to obtain a cut classified image group.

8. An intelligent fabric defect image recognition and automatic classification system, characterized in that: The system comprises: A weaving image classification module is used to receive a weaving image recognition instruction, obtain a weaving set to be detected based on the weaving image recognition instruction, and take images of the weaving set to be detected to obtain a weaving image set to be detected, wherein the weaving image to be detected is a panoramic image of the weaving to be detected, extract the weaving images to be detected in the weaving image set to be detected in sequence, perform image region classification on the weaving images to be detected, and obtain a classified weaving image group, wherein the image region classification on the weaving images to be detected to obtain the classified weaving image group includes: Acquire a standard woven image of the woven image to be detected, and calculate a standard pixel value of the standard woven image; Identifying a set of pixels to be detected of the woven fabric image to be detected, and obtaining a set of pixel values ​​to be detected of the set of pixels to be detected; Determining the number of target areas according to the standard pixel value and the pixel value set to be detected; Determining the number of target areas according to the standard pixel value and the pixel value set to be detected includes: Based on the standard pixel value and the pixel value set to be detected, the regional pixel deviation is calculated, and according to the regional pixel deviation and the preset minimum pixel deviation, the pixel deviation factor is calculated, wherein the regional pixel deviation and the pixel deviation factor are respectively expressed as: , in, represents the regional pixel deviation, represents the number of pixel values ​​to be detected in the set of pixel values ​​to be detected, represents the i-th pixel value to be detected in the set of pixel values ​​to be detected, Represents the standard pixel value, represents the pixel deviation factor, Indicates the minimum pixel deviation; According to the pixel deviation factor and the preset number of standard areas, the number of target areas is calculated using the following formula: , in, Indicates the number of target areas, Indicates the number of standard areas; Based on the number of target areas, identifying a central pixel point group in the set of pixels to be detected, wherein the number of central pixel points is the same as the number of target areas; Eliminate the central pixel point group from the pixel point set to be detected to obtain a pixel point set to be classified, and use the pixel point set to be classified to perform regional supplementation on the central pixel point group to obtain an original regional image group, wherein each original regional image corresponds to a central pixel point; Extract original region images in the original region image group in sequence, identify original region pixel value sets in the original region images, and calculate original pixel deviations of the original region pixel value sets, wherein the original pixel deviations are expressed as: , in, represents the original pixel deviation, Represents the number of original area pixel values ​​in the original area pixel value set, represents the jth original region pixel value in the original region pixel value set, Represents the pixel value of the kth original area; Determining whether the original pixel deviation is greater than a preset standard pixel deviation; If the original pixel deviation is greater than the standard pixel deviation, the original region image is used to update the woven fabric image to be detected, and the process returns to the step of identifying the pixel point set to be detected of the woven fabric image to be detected; If the original pixel deviation is not greater than the standard pixel deviation, the original region image is recorded as a classified weaving image; Summarizing the classified woven fabric images to obtain a classified woven fabric image group; A defect feature analysis module is used to extract classified woven images in the classified woven image group in sequence, perform mathematical statistical feature analysis on the classified woven images to obtain statistical defect features, wherein the statistical defect features include: average defect pixel value, maximum defect pixel value and minimum defect pixel value, perform image feature analysis on the classified woven images to obtain significant defect features, wherein the significant defect features include: number of significant defects and average significant intensity difference; A defect type recognition module is used to combine the statistical defect features and significant defect features of the classified woven fabric images to obtain an image defect feature group, and to perform defect type recognition on each classified woven fabric image in the classified woven fabric image group to obtain a defect type mark group, wherein one defect type mark corresponds to one classified woven fabric image, and the defect type recognition is performed by manual recognition; The recognition model training module is used to use the defect type marking group to mark the image defect feature group one by one to obtain a marked image feature group, summarize the marked image feature group of each classified weaving image in each weaving image to be detected in the weaving image set to obtain a marked image feature group set, and train the pre-acquired deep learning model according to the marked image feature group set to obtain a defect automatic recognition model.

Citation Information

Patent Citations

  • Image processing method and device, storage medium and electronic equipment

    CN112419161A

  • Textile defect detection method and system

    CN117495795A