CN113777030A - Cloth surface defect detection device and method based on machine vision - Google Patents

Cloth surface defect detection device and method based on machine vision Download PDF

Info

Publication number
CN113777030A
CN113777030A CN202110765759.9A CN202110765759A CN113777030A CN 113777030 A CN113777030 A CN 113777030A CN 202110765759 A CN202110765759 A CN 202110765759A CN 113777030 A CN113777030 A CN 113777030A
Authority
CN
China
Prior art keywords
cloth
image
detected
defect
brightness
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110765759.9A
Other languages
Chinese (zh)
Inventor
沈人
庄健
尚金道
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Xinchang Information Technology Co ltd
Original Assignee
Hangzhou Xinchang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Xinchang Information Technology Co ltd filed Critical Hangzhou Xinchang Information Technology Co ltd
Priority to CN202110765759.9A priority Critical patent/CN113777030A/en
Publication of CN113777030A publication Critical patent/CN113777030A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/89Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles
    • G01N21/892Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles characterised by the flaw, defect or object feature examined
    • G01N21/898Irregularities in textured or patterned surfaces, e.g. textiles, wood
    • G01N21/8983Irregularities in textured or patterned surfaces, e.g. textiles, wood for testing textile webs, i.e. woven material

Abstract

The invention discloses a cloth surface defect detection device and method based on machine vision, wherein the detection device is assembled in modules and comprises a pretreatment module, a vision detection module and a winding module; shooting a flawless cloth image as a standard sample by using an area-array camera module in a visual detection module, calculating a flat field correction matrix according to the standard sample and realizing brightness compensation; calculating the clustering center and other characteristic parameters of the standard sample by adopting the principle of a K-means clustering algorithm; the area array camera module shoots cloth to be detected in real time and performs flat field correction; edge detection and region cutting are realized according to the brightness value difference between the background and the cloth image; calculating Euclidean distance from the pixels of the image to be detected to the clustering center and judging whether defects exist according to a threshold value; if so, the defect image is saved. The invention overcomes the problems of low detection speed, low precision, high omission factor and high false detection rate of the traditional manual visual inspection, and promotes the automatic development of the detection in the textile field.

Description

Cloth surface defect detection device and method based on machine vision
Technical Field
The invention relates to the field of cloth detection, in particular to a cloth surface defect detection device and method based on machine vision, which can detect defects of running cloth in real time.
Background
The textile industry has an important position in national economy, provides articles such as clothes, curtains and bedding which are indispensable in daily life for people, and is closely related to the life of people. However, in the textile production process, factors such as mechanical failure, manual operation errors and external environment interference can cause defects on the textile surface. The appearance of the textile is seriously affected by the generation of defects, and the enterprise image and the economic benefit of textile manufacturers are seriously damaged. In the textile industry, cloth defects directly affect the grading of cloth. The cloth is divided into superior products, first-class products, second-class products and inferior products according to the quality of the cloth, and the price difference of the cloth in different grades is large. Generally, the price of the second-class cloth is about 50% of the first-class cloth, so the fabric defects seriously affect the economic income of the textile industry. Therefore, the textile defect detection is an essential link, and has the advantages that after the defect is found, the cloth with the defect can be marked, the information such as the type and the number of the defect in the cloth is recorded, and the fabric is graded, so that the subsequent treatment of the defective cloth is facilitated.
For a long time, the quality detection of the cloth is mainly completed manually, and the detection speed is about 15-20 meters per minute. Because manual detection depends heavily on experience and proficiency of cloth inspection personnel, evaluation standards are unstable and inconsistent, and false detection and missed detection are often generated. Even a skilled cloth inspector can only find about 70% of the defects as investigated. In addition, the detection of cloth defects is tedious and seriously impairs the vision of cloth inspectors. Therefore, the automatic cloth inspecting system is a necessary way for improving the production efficiency, saving the labor cost and upgrading the transformation of the industry in the textile industry.
Disclosure of Invention
The invention aims to provide a cloth surface defect detection device and method based on machine vision, which are used for rapidly identifying defect areas in a textile cloth defect image and realizing automation of cloth quality detection.
In order to achieve the purpose, the invention adopts the following technical scheme:
the utility model provides a cloth surface defect detection device based on machine vision, includes that mechanical component divides the module equipment, including preprocessing module, visual detection module, rolling module, preprocessing module will advance cloth wrinkle removal exhibition in and send to visual detection module, visual detection module gathers the cloth image of advancing and does the fault and detects, rolling module carries out the opposite side rolling to the cloth that detects the completion.
A cloth surface defect detection method based on machine vision specifically comprises the following steps:
step 1), collecting a defect-free cloth image sample, and transmitting the obtained sample image to a computer;
step 2), calculating a brightness flat field correction matrix of the standard sample image collected in the step 1, and performing brightness compensation on the sample image according to the correction matrix;
step 3), carrying out K-means clustering algorithm processing on the sample image after the brightness compensation, carrying out iterative computation to obtain a clustering center, calculating other related characteristic parameters and storing the other related characteristic parameters in a computer, wherein the other characteristic parameters comprise the pixel average distance and the standard deviation in each clustering item, and the maximum value and the minimum value of the pixel distance;
step 4), shooting an image of the cloth to be detected on a visual detection module of the cloth inspecting machine in real time by using an area-array camera module, transmitting the image to a computer, and performing brightness compensation on the image of the cloth to be detected according to the flat-field correction matrix calculated in the step 2;
and step 5), carrying out cloth edge detection and image cutting processing on the images collected by the two cameras at the edge of the area array camera module in the step 4, only reserving cloth image data to be detected, and cutting off the rough edge part of the background and the cloth boundary.
And 6) carrying out defect detection algorithm processing on the images to be detected obtained in the steps 4 and 5, calculating Euclidean distances between pixels of the images to be detected and the clustering center obtained in the step 3, setting a threshold value according to the characteristic parameters calculated in the step 3, judging that the actually measured cloth images are qualified if the Euclidean distances are within the set threshold value range, and otherwise, judging that the defects exist in the actually measured cloth images.
And 7) performing morphological closing operation and defect framing processing on the cloth image with defects judged in the step 6, storing the cloth image with the defects framed in a computer, and storing defect information in a database.
Step 8), judging whether the currently detected cloth image is the last one, if not, turning to the step 4 to continue to collect and detect the cloth image; and if the number of the defects is the last one, stopping collecting the images, scoring according to the defect conditions stored in the database in the step 7, and carrying out grade evaluation on the current whole roll of cloth.
In the method for detecting defects on the surface of a fabric based on machine vision, the flat field correction and the brightness compensation in step 2 are performed to eliminate the problem of 'black circles' in camera imaging caused by uneven illumination and inconsistent response of the center and the edge of a lens, and the calculation of the flat field correction matrix is to find the center of a sample image, intercept a rectangular area of 50 pixels with the center of the sample image as a central point, calculate the mean in the area HSV space, perform pixel-by-pixel subtraction on the V space in the sample image HSV space, calculate the difference value between the mean and the intercepted rectangular area mean, and obtain the following formula
Mc=Mmean-MV
Wherein M ismeanIs a single channel matrix with all pixel values set to MeanValue, MVA V space image matrix separated from the HSV channel of the standard sample image is subtracted to obtain a flat field correction matrix Mc
In the method for detecting the defect on the surface of the cloth based on the machine vision, the brightness compensation in the step 2 is to convert the standard sample image into the HSV space, separate three channels, extract the V space image matrix therein, add the V space image matrix to the calculated flat field correction matrix, and use the following formula
Figure BDA0003151220850000031
Wherein
Figure BDA0003151220850000032
V-space image matrix, M, separated for standard sample image HSV channelcAccording to step 2A flat field correction matrix calculated for the standard sample image,
Figure BDA0003151220850000033
and the result matrix is obtained after flat field correction, and the HSV three channels are combined to realize the brightness compensation of the standard sample image.
In the method for detecting the defect on the surface of the cloth based on the machine vision, the K-means clustering algorithm in the step 3 firstly initializes K clustering centers (mu) for the RGB three-channel images of the sample image12,…μk) Set the samples (x)i) Divided into k clusters (C)1,C2,…Ck) Calculating Euclidean distances from all sample points to the cluster center, as shown in the following formula
Figure BDA0003151220850000034
Then select as a class the samples closest to the cluster center with the goal of minimizing the squared error E
Figure BDA0003151220850000035
Wherein muiIs a cluster CiIs also called the centroid, the expression is
Figure BDA0003151220850000036
And updating the cluster center by using the calculated minimum RGB three-channel Euclidean distance mean value, and continuously iterating until the square error E meets the requirement, and ending iteration.
In the method for detecting the defect on the surface of the cloth based on the machine vision, the brightness compensation in the step 4 firstly converts the image to be detected into HSV space, then three channels are separated, and then the V space image matrix in the HSV space image matrix is added with the flat field correction matrix calculated in the step 2, as shown in the following formula
Figure BDA0003151220850000037
Wherein
Figure BDA0003151220850000038
V space image matrix, M, separated for HSV channel of image to be detectedcFor the flat field correction matrix calculated from the standard sample image in step 2,
Figure BDA0003151220850000039
and the result matrix is obtained after flat field correction, and the HSV three channels are combined, so that the brightness compensation of the image to be detected is realized.
In the cloth edge detection in the step 5, a rectangular region with 5 pixels high and an image wide to be detected at the upper section, the middle section and the lower section of an image to be detected is extracted, the average value filtering of 3 x 3 is performed on the rectangular region obtained by three sections of the image, then HSV three-channel separation is performed, a V channel image matrix is extracted, the average value (mu) and the standard deviation (sigma) of the brightness value of the V channel image are calculated, and the brightness value (V) of the rectangular region is calculated pixel by pixel in the three sections of the rectangular regioni) The difference value with the brightness mean value (mu) is used for resetting the brightness value of the rectangular area by setting the threshold value of k sigma according to the obvious brightness value difference between the background and the cloth, as shown in the following formula
Figure BDA0003151220850000041
After the brightness value is reset, traversing the V space image of the three rectangular areas, and searching the first brightness value (V) in the upper, middle and lower rectangular areas of the image to be detectedi) Target pixel point position other than 0
Figure BDA0003151220850000042
Calculating the position average value (P) of target pixel points of three sections of rectangular areasm) Of the formula
Figure BDA0003151220850000043
PmThe position of the cloth boundary is obtained through calculation, and the image to be detected is subjected to image segmentation according to the position, so that the boundary identification and the image cutting are realized.
In the defect detection method for the cloth surface based on the machine vision, the defect detection algorithm in the step 6 is to calculate the euclidean distance between the pixels of the image to be detected and the cluster center obtained in the step 3 in the RGB three channels, then set a threshold T according to the most significant value of the pixel distance calculated in the step 3, if the euclidean distance is within the set threshold T range, judge that the actually measured cloth image is qualified, otherwise judge that the actually measured cloth image has defects, and perform binarization processing on the image according to whether the calculated euclidean distance is within the threshold range, as shown in the following formula
Figure BDA0003151220850000044
Wherein, VR、VG、VBRespectively refers to the pixel values dis of the image to be detected in RGB three channelsR、disG、disBAnd respectively calculating Euclidean distances between the image to be detected and the clustering center in RGB three channels.
In the method for detecting the fabric surface defect based on the machine vision, in the step 7, performing the morphological closing operation on the fabric image with the defect, which is judged to exist, includes performing the expansion operation with the kernel size of 5 × 5 on the binarized image, performing the corrosion operation with the kernel size of 3 × 3, and connecting the fracture part of the defect image, so that the small crack is closed, and the total position and the shape are unchanged; the areas and locations of the detected continuity defects are then calculated and recorded.
In the method for detecting the surface defect of the cloth based on the machine vision, step 8 is to first judge whether the current detected cloth image is the last one, if not, go to step 4 to continue to collect and detect the cloth image; and if the number of the defects is the last one, stopping collecting the images, counting the defect information obtained in the previous step, subdividing the types and the sizes of the defects, grading according to the American standard and standard marking standard, and evaluating the grade of the current whole roll of cloth.
Drawings
Fig. 1 is a schematic view of the overall structure of a detection device according to an embodiment of the present invention.
FIG. 2 is a flowchart of a method for detecting defects on a surface of a fabric according to an embodiment of the present invention.
FIG. 3 is a diagram illustrating the problem of black circles in the camera according to an embodiment of the present invention.
FIG. 4 is a flowchart of a K-means clustering algorithm in an embodiment of the present invention.
Fig. 5 is a diagram of cloth boundary identification and image segmentation effects in the embodiment of the present invention.
FIG. 6 is a diagram illustrating the identification effect of several cloth defects according to an embodiment of the present invention.
Detailed Description
The invention will be further described with reference to the accompanying drawings.
The invention aims to provide a cloth surface defect detection device and method based on machine vision, which are used for rapidly identifying defect areas in a textile cloth defect image and realizing automation of cloth quality detection.
In order to achieve the purpose, the invention adopts the following technical scheme:
the utility model provides a cloth surface defect detection device based on machine vision, detailed structure can see figure 1, includes that mechanical component divides the module equipment, including preprocessing module, visual detection module, rolling module, preprocessing module will advance cloth wrinkle removal exhibition and send to visual detection module, visual detection module gathers the cloth image of advancing and does the fault detection, the rolling module carries out the opposite side rolling to the cloth that detects the completion.
The cloth surface defect detection device based on machine vision comprises a stepping motor (71), a cloth blocking frame (82), a cloth roller (12), a yarn separating roller (14), a sliding strip roller (15) and a movable roller (13), wherein tension is adjusted through the rotating speed difference of a driving cloth roller and a driven cloth roller, and cloth in the process of advancing passes through the yarn separating roller, the sliding strip roller and the movable roller successively to achieve the effect of wrinkle removal and flattening so as to facilitate subsequent vision detection.
The cloth surface defect detection device based on machine vision comprises an LED top light source (36), an LED bottom light source (35), an area array camera module (42), a computer (91) and a light source controller (92), wherein the area array camera module is connected with the computer through a data line and used for acquiring a cloth surface image in the advancing process in real time, transmitting data to the computer for algorithm detection, identifying a cloth boundary and a cloth defect point, recording and storing the cloth image with the defect point.
According to the cloth surface defect detection device based on machine vision, the rolling module comprises a stepping motor (72), a cloth roller (12) and a cloth blocking frame (80), tension is adjusted by setting a rotating speed difference between a driving cloth roller and a driven cloth roller, and cloth is finally rolled.
A cloth surface defect detection method based on machine vision is disclosed, a detailed detection method flow chart can be shown in figure 2, and the method specifically comprises the following steps:
step 1), collecting a defect-free cloth image sample, and transmitting the obtained sample image to a computer;
step 2), calculating a brightness flat field correction matrix of the standard sample image collected in the step 1, and performing brightness compensation on the sample image according to the correction matrix;
step 3), carrying out K-means clustering algorithm processing on the sample image after the brightness compensation, carrying out iterative computation to obtain a clustering center, calculating other related characteristic parameters and storing the other related characteristic parameters in a computer, wherein the other characteristic parameters comprise the pixel average distance and the standard deviation in each clustering item, and the maximum value and the minimum value of the pixel distance;
step 4), shooting an image of the cloth to be detected on a visual detection module of the cloth inspecting machine in real time by using an area-array camera module, transmitting the image to a computer, and performing brightness compensation on the image of the cloth to be detected according to the flat-field correction matrix calculated in the step 2;
and step 5), carrying out cloth edge detection and image cutting processing on the images collected by the two cameras at the edge of the area array camera module in the step 4, only reserving cloth image data to be detected, and cutting off the rough edge part of the background and the cloth boundary.
And 6) carrying out defect detection algorithm processing on the images to be detected obtained in the steps 4 and 5, calculating Euclidean distances between pixels of the images to be detected and the clustering center obtained in the step 3, setting a threshold value according to the characteristic parameters calculated in the step 3, judging that the actually measured cloth images are qualified if the Euclidean distances are within the set threshold value range, and otherwise, judging that the defects exist in the actually measured cloth images.
And 7) performing morphological closing operation and defect framing processing on the cloth image with defects judged in the step 6, storing the cloth image with the defects framed in a computer, and storing defect information in a database.
Step 8), judging whether the currently detected cloth image is the last one, if not, turning to the step 4 to continue to collect and detect the cloth image; and if the number of the defects is the last one, stopping collecting the images, scoring according to the defect conditions stored in the database in the step 7, and carrying out grade evaluation on the current whole roll of cloth.
In the method for detecting defects on the surface of a fabric based on machine vision, the flat field correction and the brightness compensation in step 2 are performed to solve the problem of 'black circles' in camera imaging caused by uneven illumination and inconsistent response of the center and the edge of a lens as shown in fig. 3, and the calculation of the flat field correction matrix is to first find the center of a sample image, then take the center of the sample image as a central point, intercept a rectangular area of 50 × 50 pixels, then calculate the mean value of V space in HSV space in the area, then perform pixel-by-pixel difference on V space in HSV space of the sample image, calculate the difference value between the mean value of the intercepted rectangular area mean value, and the following formula is as follows
Mc=Mmean-MV
Wherein M ismeanIs that the pixel values are all setIs a single channel matrix of MeanValue, MVA V space image matrix separated from the HSV channel of the standard sample image is subtracted to obtain a flat field correction matrix Mc
In the method for detecting the defect on the surface of the cloth based on the machine vision, the brightness compensation in the step 2 is to convert the standard sample image into the HSV space, separate three channels, extract the V space image matrix therein, add the V space image matrix to the calculated flat field correction matrix, and use the following formula
Figure BDA0003151220850000071
Wherein
Figure BDA0003151220850000072
V-space image matrix, M, separated for standard sample image HSV channelcFor the flat field correction matrix calculated from the standard sample image in step 2,
Figure BDA0003151220850000073
and the result matrix is obtained after flat field correction, and the HSV three channels are combined to realize the brightness compensation of the standard sample image.
In the method for detecting the defect on the surface of the cloth based on the machine vision, the K-means clustering algorithm process in the step 3 can be shown in fig. 4, and K clustering centers (mu) are initialized for the RGB three-channel image of the sample image12,…μk) Set the samples (x)i) Divided into k clusters (C)1,C2,…Ck) Calculating Euclidean distances from all sample points to the cluster center, as shown in the following formula
Figure BDA0003151220850000074
Then select as a class the samples closest to the cluster center with the goal of minimizing the squared error E
Figure BDA0003151220850000075
Wherein muiIs a cluster CiIs also called the centroid, the expression is
Figure BDA0003151220850000076
And updating the cluster center by using the calculated minimum RGB three-channel Euclidean distance mean value, and continuously iterating until the square error E meets the requirement, and ending iteration.
In the method for detecting the defect on the surface of the cloth based on the machine vision, the brightness compensation in the step 4 firstly converts the image to be detected into HSV space, then three channels are separated, and then the V space image matrix in the HSV space image matrix is added with the flat field correction matrix calculated in the step 2, as shown in the following formula
Figure BDA0003151220850000077
Wherein
Figure BDA0003151220850000078
V space image matrix, M, separated for HSV channel of image to be detectedcFor the flat field correction matrix calculated from the standard sample image in step 2,
Figure BDA0003151220850000079
and the result matrix is obtained after flat field correction, and the HSV three channels are combined, so that the brightness compensation of the image to be detected is realized.
In the cloth edge detection in the step 5, rectangular areas with 5 pixels high and 5 pixels wide to be detected in the upper, middle and lower sections of the image to be detected are extracted, 3 x 3 mean value filtering is performed on the three sections of the rectangular areas, and HSV three-channel separation is performedExtracting the V-channel image matrix, calculating the mean value (mu) and standard deviation (sigma) of the brightness value of the V-channel image, and calculating the brightness value (V) of the three rectangular areas pixel by pixeli) The difference value with the brightness mean value (mu) is used for resetting the brightness value of the rectangular area by setting the threshold value of k sigma according to the obvious brightness value difference between the background and the cloth, as shown in the following formula
Figure BDA0003151220850000081
After the brightness value is reset, traversing the V space image of the three rectangular areas, and searching the first brightness value (V) in the upper, middle and lower rectangular areas of the image to be detectedi) Target pixel point position other than 0
Figure BDA0003151220850000082
Calculating the position average value (P) of target pixel points of three sections of rectangular areasm) Of the formula
Figure BDA0003151220850000083
PmThe position of the cloth boundary is obtained through calculation, image segmentation is performed on the image to be detected according to the position, so that the boundary recognition and the image cutting are realized, and the specific realization effect can be shown in fig. 5.
In the defect detection method for the cloth surface based on the machine vision, the defect detection algorithm in the step 6 is to calculate the euclidean distance between the pixels of the image to be detected and the cluster center obtained in the step 3 in the RGB three channels, then set a threshold T according to the most significant value of the pixel distance calculated in the step 3, if the euclidean distance is within the set threshold T range, judge that the actually measured cloth image is qualified, otherwise judge that the actually measured cloth image has defects, and perform binarization processing on the image according to whether the calculated euclidean distance is within the threshold range, as shown in the following formula
Figure BDA0003151220850000084
Wherein, VR、VG、VBRespectively refers to the pixel values dis of the image to be detected in RGB three channelsR、disG、disBThe Euclidean distances between the image to be detected and the clustering center calculated in the RGB three channels are respectively shown in the figure 6, and the specific detection effects are respectively detection results of the algorithm on stains, scratches, holes, crosspieces, color points and lacunae.
In the method for detecting the fabric surface defect based on the machine vision, in the step 7, performing the morphological closing operation on the fabric image with the defect, which is judged to exist, includes performing the expansion operation with the kernel size of 5 × 5 on the binarized image, performing the corrosion operation with the kernel size of 3 × 3, and connecting the fracture part of the defect image, so that the small crack is closed, and the total position and the shape are unchanged; the areas and locations of the detected continuity defects are then calculated and recorded.
In the method for detecting the surface defect of the cloth based on the machine vision, step 8 is to first judge whether the current detected cloth image is the last one, if not, go to step 4 to continue to collect and detect the cloth image; and if the number of the defects is the last one, stopping collecting the images, counting the defect information obtained in the previous step, subdividing the types and the sizes of the defects, grading according to the American standard and standard marking standard, and evaluating the grade of the current whole roll of cloth.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and their concepts should be equivalent or changed within the technical scope of the present invention.

Claims (11)

1. The utility model provides a cloth surface defect detection device based on machine vision which characterized in that: the mechanical assembly is assembled in modules and comprises a preprocessing module, a visual detection module and a rolling module, wherein the preprocessing module is used for removing wrinkles and flattening advancing cloth and sending the cloth to the visual detection module, the visual detection module is used for collecting images of the advancing cloth and detecting defects, and the rolling module is used for rolling the opposite sides of the detected cloth.
2. The cloth surface defect detection device based on machine vision according to claim 1, characterized in that: the pretreatment module comprises a stepping motor (71), a cloth blocking frame (82), a cloth roller (12), a yarn separating roller (14), a sliding strip roller (15) and a movable roller (13), tension is adjusted by setting the rotating speed difference of a driving cloth roller and a driven cloth roller, and advancing cloth passes through the yarn separating roller, the sliding strip roller and the movable roller successively to achieve the effect of wrinkle removal and flattening so as to facilitate subsequent visual detection.
3. The cloth surface defect detection device based on machine vision according to claim 1, characterized in that: the visual detection module comprises an LED top light source (36), an LED bottom light source (35), an area array camera module (42), a computer (91) and a light source controller (92), wherein the area array camera module is connected with the computer through a data line and used for ensuring that a cloth surface image in the advancing process is collected in real time, the data is transmitted to the computer for algorithm detection, a cloth boundary and a cloth defect are identified, and a cloth image with the defect is recorded and stored.
4. A cloth surface defect detection method based on machine vision is characterized by comprising the following steps:
step 1), collecting a defect-free cloth image sample, and transmitting the obtained sample image to a computer;
step 2), calculating a brightness flat field correction matrix of the standard sample image collected in the step 1, and performing brightness compensation on the sample image according to the correction matrix;
step 3), carrying out K-means clustering algorithm processing on the sample image after the brightness compensation, carrying out iterative computation to obtain a clustering center, calculating other related characteristic parameters and storing the other related characteristic parameters in a computer, wherein the other characteristic parameters comprise the pixel average distance and the standard deviation in each clustering item, and the maximum value and the minimum value of the pixel distance;
step 4), shooting an image of the cloth to be detected on a visual detection module of the cloth inspecting machine in real time by using an area-array camera module, transmitting the image to a computer, and performing brightness compensation on the image of the cloth to be detected according to the flat-field correction matrix calculated in the step 2;
and step 5), carrying out cloth edge detection and image cutting processing on the images collected by the two cameras at the edge of the area array camera module in the step 4, only reserving cloth image data to be detected, and cutting off the rough edge part of the background and the cloth boundary.
And 6) carrying out defect detection algorithm processing on the images to be detected obtained in the steps 4 and 5, calculating Euclidean distances between pixels of the images to be detected and the clustering center obtained in the step 3, setting a threshold value according to the characteristic parameters calculated in the step 3, judging that the actually measured cloth images are qualified if the Euclidean distances are within the set threshold value range, and otherwise, judging that the defects exist in the actually measured cloth images.
And 7) performing morphological closing operation and defect framing processing on the cloth image with defects judged in the step 6, storing the cloth image with the defects framed in a computer, and storing defect information in a database.
Step 8), judging whether the currently detected cloth image is the last one, if not, turning to the step 4 to continue to collect and detect the cloth image; and if the number of the defects is the last one, stopping collecting the images, scoring according to the defect conditions stored in the database in the step 7, and carrying out grade evaluation on the current whole roll of cloth.
5. The cloth surface defect detection method based on machine vision according to claim 4, characterized in that the calculation of the brightness flat field correction matrix in the step 2 is to select a rectangular area with 50 pixels by 50 pixels in the center of the sample image, calculate the V space brightness mean value MeanValue in the HSV space in the area, perform pixel-by-pixel subtraction on the V space in the HSV space of the sample image, and calculate the difference value between the V space brightness mean value and the rectangular area brightness mean value, as shown in the following formula
Mc=Mmean-MV
Wherein M ismeanIs a single-channel matrix with pixel values all of MeanValue, MVA V space image matrix separated from the HSV channel of the standard sample image is subtracted to obtain a flat field correction matrix Mc
6. The cloth surface defect detection method based on machine vision as claimed in claim 4, characterized in that the K-means clustering algorithm in step 3 first initializes K clustering centers (μ) for RGB three-channel images of the sample image1,μ2,...μk) Set the samples (x)i) Divided into k clusters (C)1,C2,...Ck) Calculating Euclidean distances from all sample points to the cluster center, as shown in the following formula
Figure FDA0003151220840000021
Then select as a class the samples closest to the cluster center with the goal of minimizing the squared error E
Figure FDA0003151220840000022
Wherein muiIs a cluster CiIs also called the centroid, the expression is
Figure FDA0003151220840000023
And updating the cluster center by using the calculated minimum RGB three-channel Euclidean distance mean value, and continuously iterating until the square error E meets the requirement, and ending iteration.
7. The cloth surface defect detection method based on machine vision as claimed in claim 4, characterized in that the brightness compensation in step 4 is to convert the image to be detected into HSV space, separate three channels, and add the V space image matrix to the flat field correction matrix calculated in step 2, as shown in the following formula
Figure FDA0003151220840000024
Wherein
Figure FDA0003151220840000025
V space image matrix, M, separated for HSV channel of image to be detectedcFor the flat field correction matrix calculated from the standard sample image in step 2,
Figure FDA0003151220840000034
and the result matrix is obtained after flat field correction, and the HSV three channels are combined, so that the brightness compensation of the image to be detected is realized.
8. The method as claimed in claim 4, wherein the cloth edge detection in step 5 is performed by first extracting rectangular regions with 5 pixels high at the upper, middle and lower sections of the image to be detected and with the image width to be detected, then performing 3 x 3 average filtering on the three rectangular regions, then calculating the average and standard deviation of the brightness, and resetting the brightness value of the rectangular region according to the significant brightness difference between the background and the cloth, as shown in the following formula
Figure FDA0003151220840000031
Wherein, ViIs the luminance value of the rectangular region, μ is the luminance mean value of the rectangular region, and σ is the luminance standard deviation value of the rectangular region. After the brightness value is reset, traversing the V space image of the three rectangular areas, searching the position of the target pixel point with the first brightness value not being 0 in the upper, middle and lower rectangular areas of the image to be detected, and calculatingThe mean value of the positions of target pixel points in three rectangular regions is as follows
Figure FDA0003151220840000032
Wherein
Figure FDA0003151220840000035
The position of a first target pixel point with the brightness value not being 0 in the upper, middle and lower three sections of rectangular areas of the image to be detected is respectivelymThe position of the cloth boundary is obtained through calculation, and the image to be detected is subjected to image segmentation according to the position, so that the boundary identification and the image cutting are realized.
9. The cloth surface defect detection method based on machine vision as claimed in claim 4, characterized in that the defect detection algorithm in step 6 firstly calculates Euclidean distances between pixels of the image to be detected and the cluster center obtained in step 3 in RGB three channels, then sets a threshold T according to the maximum pixel distance calculated in step 3, if the Euclidean distances are all within the set threshold T range, the actually measured cloth image is judged to be qualified, otherwise, the actually measured cloth image is judged to have defects, and binarization processing is performed on the image according to whether the calculated Euclidean distances are within the threshold range, as shown in the following formula
Figure FDA0003151220840000033
Wherein, VR、VG、VBRespectively refers to the pixel values dis of the image to be detected in RGB three channelsR、disG、disBAnd respectively calculating Euclidean distances between the image to be detected and the clustering center in RGB three channels.
10. The method for detecting the fabric surface defects based on the machine vision is characterized in that in the step 7, the binarized defect images are expanded and corroded, the fracture parts of the defect images are connected through morphological closed operation, and the defect framing processing is realized through outline extraction.
11. The method of claim 4 wherein step 8 further comprises the step of counting the defect information obtained in the preceding step to subdivide the defect types and sizes and scoring the subdivided defect types according to a scoring criteria of the U.S. notation.
CN202110765759.9A 2021-07-08 2021-07-08 Cloth surface defect detection device and method based on machine vision Pending CN113777030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110765759.9A CN113777030A (en) 2021-07-08 2021-07-08 Cloth surface defect detection device and method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110765759.9A CN113777030A (en) 2021-07-08 2021-07-08 Cloth surface defect detection device and method based on machine vision

Publications (1)

Publication Number Publication Date
CN113777030A true CN113777030A (en) 2021-12-10

Family

ID=78835918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110765759.9A Pending CN113777030A (en) 2021-07-08 2021-07-08 Cloth surface defect detection device and method based on machine vision

Country Status (1)

Country Link
CN (1) CN113777030A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114170226A (en) * 2022-01-24 2022-03-11 谱为科技(常州)有限公司 Linen detection method and device based on image enhancement and convolutional neural network
CN114332069A (en) * 2022-01-05 2022-04-12 合肥工业大学 Machine vision-based connector detection method and device
CN114441545A (en) * 2022-03-14 2022-05-06 无锡职业技术学院 Height-adaptive winding visual detection platform and method
CN114627111A (en) * 2022-05-12 2022-06-14 南通英伦家纺有限公司 Textile defect detection and identification device
CN116718616A (en) * 2023-08-04 2023-09-08 苏州视谷视觉技术有限公司 Machine vision detection system and detection method for flaw detection
CN117152545A (en) * 2023-10-31 2023-12-01 江苏启宸新材料有限公司 Water thorn non-woven fabrics yield management system
CN117593295A (en) * 2024-01-18 2024-02-23 东莞市立时电子有限公司 Nondestructive testing method for production defects of mobile phone data line

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268505A (en) * 2014-09-12 2015-01-07 河海大学常州校区 Automatic cloth defect point detection and recognition device and method based on machine vision
CN107835337A (en) * 2017-10-11 2018-03-23 北京中科慧眼科技有限公司 Black and white area array CCD camera method for correcting flat field and system
CN109613023A (en) * 2019-01-28 2019-04-12 西南大学 A kind of fruit surface defect rapid detection method of regional luminance adaptively correcting
WO2019104767A1 (en) * 2017-11-28 2019-06-06 河海大学常州校区 Fabric defect detection method based on deep convolutional neural network and visual saliency
CN111652319A (en) * 2020-06-09 2020-09-11 创新奇智(广州)科技有限公司 Cloth defect detection method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268505A (en) * 2014-09-12 2015-01-07 河海大学常州校区 Automatic cloth defect point detection and recognition device and method based on machine vision
CN107835337A (en) * 2017-10-11 2018-03-23 北京中科慧眼科技有限公司 Black and white area array CCD camera method for correcting flat field and system
WO2019104767A1 (en) * 2017-11-28 2019-06-06 河海大学常州校区 Fabric defect detection method based on deep convolutional neural network and visual saliency
CN109613023A (en) * 2019-01-28 2019-04-12 西南大学 A kind of fruit surface defect rapid detection method of regional luminance adaptively correcting
CN111652319A (en) * 2020-06-09 2020-09-11 创新奇智(广州)科技有限公司 Cloth defect detection method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孟然: "基于机器视觉的工件特征识别与分类方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 2, pages 1 - 96 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114332069A (en) * 2022-01-05 2022-04-12 合肥工业大学 Machine vision-based connector detection method and device
CN114332069B (en) * 2022-01-05 2024-02-20 合肥工业大学 Connector detection method and device based on machine vision
CN114170226A (en) * 2022-01-24 2022-03-11 谱为科技(常州)有限公司 Linen detection method and device based on image enhancement and convolutional neural network
CN114170226B (en) * 2022-01-24 2022-08-19 谱为科技(常州)有限公司 Linen detection method and device based on image enhancement and convolutional neural network
CN114441545A (en) * 2022-03-14 2022-05-06 无锡职业技术学院 Height-adaptive winding visual detection platform and method
CN114627111A (en) * 2022-05-12 2022-06-14 南通英伦家纺有限公司 Textile defect detection and identification device
CN114627111B (en) * 2022-05-12 2022-07-29 南通英伦家纺有限公司 Textile defect detection and identification device
CN116718616A (en) * 2023-08-04 2023-09-08 苏州视谷视觉技术有限公司 Machine vision detection system and detection method for flaw detection
CN116718616B (en) * 2023-08-04 2023-11-03 苏州视谷视觉技术有限公司 Machine vision detection system and detection method for flaw detection
CN117152545A (en) * 2023-10-31 2023-12-01 江苏启宸新材料有限公司 Water thorn non-woven fabrics yield management system
CN117593295A (en) * 2024-01-18 2024-02-23 东莞市立时电子有限公司 Nondestructive testing method for production defects of mobile phone data line

Similar Documents

Publication Publication Date Title
CN113777030A (en) Cloth surface defect detection device and method based on machine vision
CN110349126B (en) Convolutional neural network-based marked steel plate surface defect detection method
WO2021143343A1 (en) Method and device for testing product quality
CN109191421B (en) Visual detection method for pits on circumferential surface of cylindrical lithium battery
CN110403232B (en) Cigarette quality detection method based on secondary algorithm
WO2021168733A1 (en) Defect detection method and apparatus for defect image, and computer-readable storage medium
CN111127448B (en) Method for detecting air spring fault based on isolated forest
CN113706490B (en) Wafer defect detection method
CN115100206B (en) Printing defect identification method for textile with periodic pattern
CN111667475B (en) Machine vision-based Chinese date grading detection method
CN115131353B (en) Flat screen printing textile production abnormity identification and positioning method and system
CN116228651A (en) Cloth defect detection method, system, equipment and medium
CN110781913A (en) Zipper cloth belt defect detection method
CN106353340A (en) Surface defect detection method for rod-like high-reflectance part
CN111951218A (en) Lipstick quality inspection system of mixed deep learning model
WO2021109011A1 (en) Intelligent capacitor internal defect detection method based on ultrasound image
CN113962929A (en) Photovoltaic cell assembly defect detection method and system and photovoltaic cell assembly production line
CN110376211B (en) Wet-process-gummed synthetic leather hemming on-line detection device and method
CN109886912A (en) A kind of thrust bearing retainer detection method of surface flaw
CN117036259A (en) Metal plate surface defect detection method based on deep learning
CN116091506A (en) Machine vision defect quality inspection method based on YOLOV5
Huang et al. Mango surface defect detection based on HALCON
CN115631488A (en) Jetson Nano-based fruit maturity nondestructive testing method and system
CN115457323A (en) Visual inspection system-based method for classifying non-uniform surface defects of mobile phone glass screen
CN114820453A (en) Method for detecting surface flaws of packaged filament based on deep learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination