CN115423807B - Cloth defect detection method based on outlier detection - Google Patents
Cloth defect detection method based on outlier detection Download PDFInfo
- Publication number
- CN115423807B CN115423807B CN202211373105.2A CN202211373105A CN115423807B CN 115423807 B CN115423807 B CN 115423807B CN 202211373105 A CN202211373105 A CN 202211373105A CN 115423807 B CN115423807 B CN 115423807B
- Authority
- CN
- China
- Prior art keywords
- value
- sequence
- abnormal
- local outlier
- outlier
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/54—Extraction of image or video features relating to texture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/56—Extraction of image or video features relating to colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The invention relates to the technical field of image processing, in particular to a cloth defect detection method based on outlier detection. The method comprises the steps of carrying out gray scale abnormality detection on a line average value sequence and a column average value sequence of a cloth gray scale image through an LOF outlier detection method so as to determine an image abnormal area, carrying out iterative updating on a distance measurement mode in the LOF outlier detection method according to the image abnormal area so as to obtain an optimal distance measurement mode, and determining the optimal abnormal area in the cloth gray scale image in the optimal distance measurement mode of the LOF outlier detection, so that self-adaptive defect detection according to the gray scale characteristics and the texture characteristics of the cloth is realized, and the accuracy of the cloth defect detection is improved.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a cloth defect detection method based on outlier detection.
Background
Because the cloth is woven, certain woven textures exist in the whole cloth, and in addition, patterns and the like exist additionally on a plurality of pieces of cloth, which further aggravates the texture degree of the whole cloth, in the process of detecting the defects of the cloth by utilizing an edge detection technology in the prior art, because the defects of the cloth are influenced by the cloth textures, a large amount of operations are needed to judge which edge characteristic points are points on real cloth defects and which are edge characteristic points correspondingly generated by the cloth textures after edge detection, and for weak defects in some pieces of cloth, due to the interference of the cloth textures, the points corresponding to the defects are difficult to accurately find out from the edge characteristic points after edge detection, so that the accuracy of detecting the cloth defects in the prior art is insufficient.
Disclosure of Invention
The invention provides a cloth defect detection method based on outlier detection, which is used for solving the technical problem that cloth defect detection in the prior art is not accurate enough, and adopts the following technical scheme:
the invention discloses a cloth defect detection method based on outlier detection, which comprises the following steps:
acquiring a cloth gray image;
calculating the row average gray value of each row and the column average gray value of each column on the cloth gray image to obtain a row average gray value sequence and a column average gray value sequence, and determining the primary direction and the secondary direction of the defect abnormal degree and the distance measuring mode of the LOF from the cluster point detection according to the row average gray value sequence and the column average gray value sequence;
performing LOF outlier detection on the average gray value sequences corresponding to the primary direction and the secondary direction respectively, and determining the abnormal degree of the primary direction and the secondary direction so as to determine an image abnormal region;
determining the optimal distance measurement mode of LOF outlier detection according to the determined image abnormal area;
and determining the optimal abnormal area in the gray level image of the cloth according to the optimal distance measurement mode of LOF outlier detection, and completing the cloth defect detection.
The invention has the beneficial effects that:
according to the method, gray level abnormality detection is carried out on the line average value sequence and the column average value sequence of the cloth gray level image through an LOF outlier detection method so as to determine an image abnormal area, iterative updating is carried out on a distance measurement mode in the LOF outlier detection method according to the image abnormal area so as to obtain an optimal distance measurement mode, the optimal abnormal area in the cloth gray level image is determined in the optimal distance measurement mode of the LOF outlier detection, self-adaptive defect detection according to the gray level characteristics and the texture characteristics of the cloth is achieved, and the accuracy of the cloth defect detection is improved.
Further, the method for determining the primary direction and the secondary direction of the defect abnormal degree comprises the following steps:
wherein, the first and the second end of the pipe are connected with each other,andrespectively representing a row score and a column score for determining a main direction of a defect abnormality degree,andrespectively represent the maxima in the row-averaged gray value sequence and the column-averaged gray value sequence,andrespectively representing the variances of the row average gray value sequence and the column average gray value sequence;
the direction corresponding to the larger value of the row score and the column score is used as the primary direction of the defect abnormality degree, and the other direction is used as the secondary direction.
Further, the method for determining the degree of abnormality of the primary direction and the secondary direction includes:
performing LOF outlier detection on the average gray value sequence corresponding to the main direction to obtain a local outlier factor sequence:
wherein the content of the first and second substances,indicating the sequence of local outlier factors corresponding to the dominant direction,representing the ith local outlier in the sequence of local outlier factors corresponding to the dominant direction,representing the total number of local outlier factors in the local outlier factor sequence corresponding to the main direction;
will be provided withMedian value greater thanThe values of (a) are extracted and normalized as the degree of anomaly in the main direction:
wherein the content of the first and second substances,the local outlier factor which is greater than 1 in the local outlier factor sequence corresponding to the main direction and is normalized is represented,represents the jth local outlier factor greater than 1 in the sequence of local outlier factors corresponding to the dominant direction,represents the minimum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction,representing the maximum value in the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction;
carrying out LOF outlier detection on the average gray value sequence corresponding to the secondary direction to obtain a local outlier factor sequence:
wherein the content of the first and second substances,representing the sequence of local outlier factors corresponding to the secondary direction,represents the p-th local outlier factor in the sequence of local outlier factors corresponding to the secondary direction,representing the total number of local outlier factors in the local outlier factor sequence corresponding to the secondary direction;
will be provided withMedian value greater thanThe value of (a) is extracted and normalized as the degree of abnormality in the secondary direction:
wherein the content of the first and second substances,the local outlier factor which is greater than 1 in the local outlier factor sequence corresponding to the secondary direction and is normalized is represented,represents the qth local outlier factor larger than 1 in the sequence of local outlier factors corresponding to the dominant direction,represents the minimum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the secondary direction,the maximum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction is represented.
Further, the method for determining the image abnormal region comprises the following steps:
for degree of abnormalityThe abnormal degree of each pixel point in the rows or the columns is marked as the abnormal degree which is not equal to 0Then, the secondary abnormal degree corresponding to the row or the line where each pixel point in the rows or the columns is located is used as the secondary weight of the pixel point;
then determining the comprehensive abnormal degree of each pixel point in the cloth gray level image:
wherein, the first and the second end of the pipe are connected with each other,representing pixel pointsThe degree of comprehensive abnormality of (a),the degree of abnormality of the pixel points is represented,representing the secondary weight of the pixel point;
making a mask image of the cloth gray image, marking the pixel values of all the pixels with nonzero comprehensive abnormal degree value as 255, marking the pixel values of the pixels with zero comprehensive abnormal degree value as 0, performing connected domain processing on the mask image, and marking all the obtained connected domains as image abnormal regions.
Further, the method for determining the optimal distance measure for detecting the LOF outliers comprises the following steps:
setting an initial value of a K value and an adjustment step length of the K value in LOF outlier detection, increasing the K value according to the adjustment step length, then calculating a new image abnormal area by using the new K value, and when the number change value of the new image abnormal area is smaller than the number change threshold compared with the number change threshold of the previous image abnormal area, taking the new K value after the adjustment at the moment as an optimal distance measurement mode of the LOF outlier detection.
Drawings
FIG. 1 is a flow chart of the method for detecting cloth defects based on outlier detection according to the present invention.
Detailed Description
The conception of the invention is as follows:
the method comprises the steps of firstly determining the abnormal degree of each line and each column on a gray level image of the cloth, determining the primary direction and the secondary direction of the abnormal degree of the defect and the distance measurement mode of LOF outlier detection, then respectively carrying out LOF outlier detection on the average gray level value sequence of the lines or the columns in the primary direction and the secondary direction to determine the abnormal degree of the primary direction and the secondary direction so as to determine an abnormal area of the image, then obtaining the optimal distance measurement mode according to the distance measurement mode of the determined abnormal area of the image on the LOF outlier detection, carrying out the LOF outlier detection again in the optimal distance measurement mode to obtain the optimal abnormal area, and completing the accurate detection of the cloth defect.
The following describes a cloth defect detection method based on outlier detection in detail with reference to the drawings and embodiments.
The method comprises the following steps:
the invention discloses an embodiment of a cloth defect detection method based on outlier detection, which has the overall flow as shown in figure 1 and comprises the following specific processes:
the method comprises the following steps of obtaining a cloth image, and carrying out gray processing to obtain a cloth gray image.
The method comprises the steps of shooting cloth by using related image acquisition electronic equipment, shooting the cloth by using an industrial camera in the embodiment, obtaining a cloth image, and performing graying processing on the cloth image to obtain a gray image of the cloth correspondingly.
And step two, calculating the row average gray value of each row and the column average gray value of each column on the cloth gray image, correspondingly obtaining a row average gray value sequence and a column average gray value sequence, and determining the primary and secondary directions of the defect abnormal degree and the distance measuring mode of LOF outlier detection according to the row average gray value sequence and the column average gray value sequence.
On the obtained cloth gray image, the gray value of the pixel point on each line is averaged, so that each line can obtain a line average gray value, and all the lines can form a line average gray value sequence corresponding to the obtained line average gray values; similarly, the gray value of the pixel point on each row is averaged, so that each row can obtain a row average gray value, and the row average gray value sequence can be formed by all the rows corresponding to the obtained row average gray value.
1. The primary direction of the defect anomaly is determined.
Since there is a process of integrating the defect abnormal degrees in the two directions after judging the defect abnormal degrees in the two directions of the cloth gray image, if the defect in the cloth gray image is biased to the vertical direction, the defect cannot be obviously represented according to the row average gray value sequence, and if the defect is biased to the horizontal direction, the defect cannot be obviously represented in the column average gray value sequence. The defect needs to be determined in the main direction of the row or column.
The main direction and the secondary direction of the degree of abnormality can be determined by the extreme value and the variance inside the row average gray-scale value sequence and the column average gray-scale value sequence.
The reason is that extreme cases in the sequence may account for some significant pixel information in a row or column, and the variance of the sequence may express the degree of dispersion of the sequence. In the average gray scale value of the row or the column of the cloth image, if the value of the extreme value is higher and the data is more discrete, most information of the defect can be more easily judged in the direction, and the corresponding direction is the main direction of the abnormal degree of the defect.
Calculating a row score and a column score for determining a main direction of the defect abnormal degree according to the respective sequence maximum values and the sequence variances of the row average gray value sequence and the column average gray value sequence:
wherein the content of the first and second substances,andrespectively representing a row score and a column score for determining a main direction of a defect abnormality degree,andrespectively represent the maxima in the row-averaged gray value sequence and the column-averaged gray value sequence,andthe variance of the row-average gray-scale value sequence and the column-average gray-scale value sequence is represented respectively.
The direction corresponding to the larger value of the row score and the column score is used as the primary direction of the defect abnormality degree, and the other direction is used as the secondary direction.
2. Determining the distance measure of LOF outlier detection.
A distance measure is needed in LOF outlier detection, and a one-dimensional sequence is processed in the invention. Therefore, it is necessary to explain a distance measurement manner of the one-dimensional data processed in the scene, in which the distance of the one-dimensional sequence is measured by a numerical value of the gray value. In the outlier detection, the first outlier detection is carried out through the gray value according to the sequence of the numerical values in the sequence as the basis for judging the sequenceAnd measuring the distance.
In the case of LOF outlier detection,the values represent a measure of the distance of the neighborhood in outlier detection. When in useIf the values are selected differently, the effect of detecting outliers will be different. To ensure the invention can be properly passedValues to perform outlier detection. Here by setting the initialAfter the abnormal degree of the pixel point is obtained, the value is obtained and the abnormal degree of the pixel point is used for obtaining the valueJudging whether the value is good or bad, and comparing the judged resultThe values are iteratively changed until a suitable one is foundThe value is obtained.
And step three, performing LOF outlier detection on the average gray value sequences corresponding to the primary direction and the secondary direction respectively, and determining the abnormal degree of the primary direction and the secondary direction so as to determine an image abnormal area.
If the primary direction of the degree of defect anomaly is the column direction, then for a sequence of column-averaged gray values, each value in the sequence represents a mean value of the gray scale of a column, and then for an outlier in the sequence of column-averaged gray values, it represents that the column in the image represented by the outlier is outlier, i.e., anomalous. Then the degree of outlier of an outlier in the sequence of column mean gray values can be calculated by an outlier detection algorithm to characterize the degree of outlier of a column in the image.
a. The degree of abnormality of the principal direction is determined.
By passingCalculating the local outlier factor of each element in the average gray value sequence corresponding to the main direction, and recording the local outlier factors into a sequence in a one-to-one correspondence mode:
wherein the content of the first and second substances,indicating the office to which the main direction correspondsThe sequence of the partial outlier factor is,representing the ith local outlier in the sequence of local outlier factors corresponding to the dominant direction,representing the total number of local outlier factors in the sequence of local outlier factors corresponding to the dominant direction.
For each local outlier in the sequence of local outlier factors corresponding to the dominant direction:
if the LOF outlier factor is close to the valueThe neighborhood point density of the point is similar, and the point and the neighborhood are probably in the same cluster.
If the LOF outlier factor has a value less thanIt is indicated that the density of this point is higher than the density of the neighboring points, and this point is a dense point.
If the LOF outlier factor value is greater thanIt is stated that this point is less dense than its neighbors, which may be outliers.
The abnormal degree of each column in the image is obtained through the local outlier factor:
by the nature of the local outlier factor, the numerical value of the local outlier factor is larger thanIn time, it is necessary to give the numerical value an abnormal degree, which is increasing as the numerical value increases. Will be provided withMedian value greater thanThe values of (a) are extracted and normalized as the degree of anomaly in the main direction:
wherein, the first and the second end of the pipe are connected with each other,the local outlier factor which is greater than 1 in the local outlier factor sequence corresponding to the main direction and is normalized is represented,represents the jth local outlier factor greater than 1 in the sequence of local outlier factors corresponding to the dominant direction,represents the minimum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction,the maximum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction is represented.
b. The degree of abnormality in the secondary direction is determined.
In the above-described primary direction determination, the primary direction and the secondary direction are determined by preliminary sequence information. This step is to obtain a secondary weight of the degree of abnormality by the secondary direction. Since the main defects in the image are more likely to be present in the main direction. If the defect is one that is biased to be vertical. Then the more important role of the degree of abnormality in the secondary direction is to determine the specific defective region rather than to make the determination of the degree of abnormality.
Outlier detection for secondary directions because of basic information by lines and columns in the direction determination processThe score of the basic information is obtained, the degree of the score indicates the amount of the information contained, the information contained in the secondary direction is less, and the outlier of the secondary direction can be better detected, so the initial point isThe value should be set smaller than the primary direction, and the secondary direction is detected from the initial outlierValue set toSatisfy the following requirementsSince the numerical value is set so that outliers can be detected, this embodiment is preferable。
By passingCalculating the local outlier factor of each element in the average gray value sequence corresponding to the secondary direction, and recording the LOF local outlier factor of each element as:
wherein the content of the first and second substances,representing the sequence of local outlier factors corresponding to the secondary direction,represents the p-th local outlier factor in the sequence of local outlier factors corresponding to the secondary direction,representing the total number of local outlier factors in the sequence of local outlier factors corresponding to the secondary direction.
Likewise, willMedian value greater thanThe value of (a) is extracted and normalized as the degree of abnormality in the secondary direction:
wherein the content of the first and second substances,the local outlier factor which is greater than 1 in the local outlier factor sequence corresponding to the secondary direction and is normalized is represented,represents the qth local outlier factor larger than 1 in the sequence of local outlier factors corresponding to the dominant direction,represents the minimum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the secondary direction,the maximum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction is represented.
c. And determining the comprehensive abnormal degree according to the abnormal degrees of the primary direction and the secondary direction, thereby determining the abnormal region.
After the degree of abnormality of the primary direction and the secondary direction is obtained, an abnormal region in the image can be determined.
For degree of abnormalityThe abnormal degree of each pixel point in the rows or the columns is marked as the abnormal degree which is not equal to 0Then, the secondary abnormal degree corresponding to the row or line where each pixel point in the rows or columns is located is used as the secondary weight of the pixel point.
Then determining the comprehensive abnormal degree of each pixel point in the cloth gray level image:
wherein the content of the first and second substances,representing pixelsThe degree of comprehensive abnormality of (a),the degree of abnormality of the pixel points is represented,representing the secondary weight of the pixel.
When the outliers in the average gray-level sequence corresponding to the primary direction indicate that the rows or columns corresponding to the primary direction are abnormal, some of the pixels in the rows or columns corresponding to the primary direction may not be abnormal in the secondary direction by the time of the secondary weight determination, and at this time, the outliers in the average gray-level sequence corresponding to the primary direction indicate that the rows or columns corresponding to the primary direction are abnormalAnd for normalized degree of abnormality, the value is in the intervalIn (1). So as to pass throughTo calculate its effect on the main direction.
The abnormal degree of the pixel points in the abnormal row or column in the row or column corresponding to the main direction in the cloth gray image is obtained through the method, and then the abnormal area in the image is obtained through the abnormal degree of the pixel points in the neighborhood information of the pixel points.
And for the judgment of the abnormal region in the image, determining the abnormal region to which each pixel point with the abnormal degree belongs by a connected domain calculation method taking the abnormal degree as a standard.
Example (c): if there is an abnormal column in the abnormal detectionThe order of the secondary weights of the rows of the pixel points isThen, the sequence of the abnormal regions is judged as the pixel point。
And (3) connected domain calculation: making image mask marking all pixel point with non-zero synthetic abnormal degree value as pixel valueMarking the pixel value of the pixel point with the comprehensive abnormal degree value of zero as. To this mask imageAnd processing the connected domains, and marking all the obtained connected domains as abnormal regions in the image.
And step four, determining the optimal distance measurement mode for LOF outlier detection through the determined image abnormal area.
At the beginning of acquisitionIn the abnormal regions determined by the values, all the abnormal regions are recorded as:
and calculating the number of pixel points in all abnormal regions and the average value of the abnormal degree of the pixel points, and taking the average value of the abnormal degree as the abnormal degree of the abnormal region. For theAdjustment of the value, known ifIf the value is too large for the abnormality detection sequence, there are fewer abnormal points and the number of abnormal regions is reduced, and it is difficult to identify the abnormal regionsIf the value is too small for the sequence of abnormality detection, the number of abnormal points is too large, and the number of abnormal regions is increased. For the cloth image with texture, the normal texture change is not judged as an abnormal value, if the abnormal value occurs, the original texture is damaged, and the gray value becomes abnormal large or abnormal large for the gray value of the line and column of the imageIf the anomaly is small, the row or column is determined to be an abnormal value.
Based on the above principle, the following evaluation expectations are made for the merits of the abnormal area:
if the number of abnormal regions changes, the abnormal regions are considered to beThe value needs to be changed and can be increasedThe value is obtained. When the number of abnormal regions is not changedThe value is stable, and this can be achievedValue as optimumThe value is obtained.
After the adjustment method is determined, adjustment is performed by referring to the abnormal area information detected for the first time.
The number of abnormal regions in the image is recorded asNamely the number of the connected domains of the abnormal pixel points in the image.
In view of the fact thatWhen the value is small, more abnormal points can be detected, and setting the initial value to be smaller can make the value smallerThe determination of the value iteration process is more accurate, so this embodiment will be the initial oneThe value is set to 3.
Will be provided withThe step size of the adjustment of the value is set to 1, i.e. if an adjustment is required, either an increase or a decrease, will be made each timeThe value is incremented by one.
The process is iterated untilWhen the number of abnormal regions detected after the change of the value is not changed or the change of the number of abnormal regions is smaller than the threshold value of the change of the numberValue as optimumValue, optimumThe value is also the best distance measure for LOF outlier detection.
And step five, determining the optimal abnormal area in the gray level image of the cloth according to the optimal distance measurement mode of the LOF outlier detection, and finishing the cloth defect detection.
By obtaining optimalityAnd determining abnormal areas in the cloth gray level image. And carrying out special defect detection on the obtained abnormal area pixel points, and determining the types of the defects according to the distribution characteristics and the pixel values of the pixel points. And matching the common defects in the cloth according to the characteristics of the defects to obtain the defect types of the abnormal areas so as to realize defect detection. In the defect detection process, the abnormal region is extracted, so that the influence of other pixel points in the cloth image is avoided, and the defect type of the region can be determined independently.
So far, the gray level image can be optimized in the cloth gray level imageAnd obtaining the position and the defect type of the defect in the cloth according to the determined defect area, and finishing the cloth defect detection.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; the modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application, and are included in the protection scope of the present application.
Claims (2)
1. A cloth defect detection method based on outlier detection is characterized by comprising the following steps:
acquiring a cloth gray image;
calculating the row average gray value of each row and the column average gray value of each column on the cloth gray image to obtain a row average gray value sequence and a column average gray value sequence, and determining the primary direction and the secondary direction of the defect abnormal degree and the distance measuring mode of the LOF from the cluster point detection according to the row average gray value sequence and the column average gray value sequence;
respectively carrying out LOF outlier detection on the average gray value sequences corresponding to the primary direction and the secondary direction, and determining the abnormal degrees of the primary direction and the secondary direction so as to determine an image abnormal region;
determining the optimal distance measurement mode of LOF outlier detection according to the determined image abnormal area;
determining an optimal abnormal area in the gray level image of the cloth according to an optimal distance measurement mode of LOF outlier detection, and completing cloth defect detection;
the method for determining the primary direction and the secondary direction of the defect abnormal degree comprises the following steps:
wherein the content of the first and second substances,andrespectively representing a row score and a column score for determining a main direction of a defect abnormality degree,andrespectively representing maxima in the row-averaged gray value sequence and the column-averaged gray value sequence,andrespectively representing the variances of the row average gray value sequence and the column average gray value sequence;
taking the direction corresponding to the larger value of the row fraction and the column fraction as the main direction of the defect abnormal degree, and taking the other direction as the secondary direction;
the method for determining the abnormal degree of the main direction and the secondary direction comprises the following steps:
performing LOF outlier detection on the average gray value sequence corresponding to the main direction to obtain a local outlier factor sequence:
wherein the content of the first and second substances,indicating the sequence of local outlier factors corresponding to the dominant direction,representing the ith local outlier in the sequence of local outlier factors corresponding to the dominant direction,representing the total number of local outlier factors in the local outlier factor sequence corresponding to the main direction;
will be provided withMedian value greater thanThe values of (a) are extracted and normalized as the degree of anomaly in the main direction:
wherein the content of the first and second substances,the local outlier factor which is greater than 1 in the local outlier factor sequence corresponding to the main direction and is normalized is represented,represents the jth local outlier factor greater than 1 in the sequence of local outlier factors corresponding to the dominant direction,represents the minimum value of local outlier factors larger than 1 in the sequence of local outlier factors corresponding to the main direction,representing the maximum value of local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction;
carrying out LOF outlier detection on the average gray value sequence corresponding to the secondary direction to obtain a local outlier factor sequence:
wherein the content of the first and second substances,representing the sequence of local outlier factors corresponding to the secondary direction,represents the p-th local outlier factor in the sequence of local outlier factors corresponding to the secondary direction,representing the total number of local outlier factors in the local outlier factor sequence corresponding to the secondary direction;
will be provided withMedian value greater thanThe value of (a) is extracted and normalized as the degree of abnormality in the secondary direction:
wherein the content of the first and second substances,the local outlier factor which is greater than 1 in the local outlier factor sequence corresponding to the secondary direction and is normalized is represented,represents the qth local outlier factor larger than 1 in the sequence of local outlier factors corresponding to the dominant direction,represents the minimum value of the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the secondary direction,representing the maximum value in the local outlier factors larger than 1 in the local outlier factor sequence corresponding to the main direction;
the method for determining the abnormal region of the image comprises the following steps:
for degree of abnormalityThe abnormal degree of each pixel point in the rows or the columns is marked as the abnormal degree which is not equal to 0Then, the secondary abnormal degree corresponding to the row or the line where each pixel point in the rows or the columns is located is used as the secondary weight of the pixel point;
then determining the comprehensive abnormal degree of each pixel point in the cloth gray level image:
wherein the content of the first and second substances,representing pixel pointsThe degree of comprehensive abnormality of (a),the degree of abnormality of the pixel points is represented,representing the secondary weight of the pixel point;
making a mask image of the cloth gray image, marking the pixel values of all the pixels with nonzero comprehensive abnormal degree value as 255, marking the pixel values of the pixels with zero comprehensive abnormal degree value as 0, performing connected domain processing on the mask image, and marking all the obtained connected domains as image abnormal regions.
2. The cloth defect detection method based on outlier detection as claimed in claim 1, wherein said method for determining the best distance measure for LOF outlier detection is:
setting an initial value of a K value and an adjustment step length of the K value in LOF outlier detection, increasing the K value according to the adjustment step length, then calculating a new image abnormal area by using the new K value, and when the number change value of the new image abnormal area is smaller than the number change threshold compared with the number change threshold of the previous image abnormal area, taking the new K value after the adjustment at the moment as an optimal distance measurement mode of the LOF outlier detection.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211373105.2A CN115423807B (en) | 2022-11-04 | 2022-11-04 | Cloth defect detection method based on outlier detection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211373105.2A CN115423807B (en) | 2022-11-04 | 2022-11-04 | Cloth defect detection method based on outlier detection |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115423807A CN115423807A (en) | 2022-12-02 |
CN115423807B true CN115423807B (en) | 2023-03-24 |
Family
ID=84207429
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211373105.2A Active CN115423807B (en) | 2022-11-04 | 2022-11-04 | Cloth defect detection method based on outlier detection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115423807B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117314894B (en) * | 2023-11-27 | 2024-03-29 | 深圳市金三维实业有限公司 | Method for rapidly detecting defects of watch bottom cover |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114926436A (en) * | 2022-05-20 | 2022-08-19 | 南通沐沐兴晨纺织品有限公司 | Defect detection method for periodic pattern fabric |
CN115100200A (en) * | 2022-08-24 | 2022-09-23 | 南通光烁通信设备有限公司 | Optical fiber defect detection method and system based on optical means |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8559730B2 (en) * | 2010-09-15 | 2013-10-15 | Foveon, Inc. | Method for detecting pixel outliers |
CN110865260A (en) * | 2019-11-29 | 2020-03-06 | 南京信息工程大学 | Method for monitoring and evaluating MOV actual state based on outlier detection |
SE1930421A1 (en) * | 2019-12-30 | 2021-07-01 | Unibap Ab | Method and means for detection of imperfections in products |
CN112184725B (en) * | 2020-09-21 | 2024-02-02 | 东南大学 | Method for extracting center of structured light bar of asphalt pavement image |
CN113963042B (en) * | 2021-12-21 | 2022-03-15 | 派立锐汽车零部件(武汉)有限公司 | Metal part defect degree evaluation method based on image processing |
-
2022
- 2022-11-04 CN CN202211373105.2A patent/CN115423807B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114926436A (en) * | 2022-05-20 | 2022-08-19 | 南通沐沐兴晨纺织品有限公司 | Defect detection method for periodic pattern fabric |
CN115100200A (en) * | 2022-08-24 | 2022-09-23 | 南通光烁通信设备有限公司 | Optical fiber defect detection method and system based on optical means |
Also Published As
Publication number | Publication date |
---|---|
CN115423807A (en) | 2022-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114937055B (en) | Image self-adaptive segmentation method and system based on artificial intelligence | |
CN115018828B (en) | Defect detection method for electronic component | |
CN115294113B (en) | Quality detection method for wood veneer | |
CN115439481B (en) | Deaerator welding quality detection method based on image processing | |
CN115829883A (en) | Surface image denoising method for dissimilar metal structural member | |
CN106920219A (en) | Article defect detection method, image processing system and computer readable recording medium | |
CN115311303B (en) | Textile warp and weft defect detection method | |
CN116091504B (en) | Connecting pipe connector quality detection method based on image processing | |
CN115423807B (en) | Cloth defect detection method based on outlier detection | |
CN108520514A (en) | Printed circuit board electronics member device consistency detecting method based on computer vision | |
CN111563896B (en) | Image processing method for detecting abnormality of overhead line system | |
CN116703251B (en) | Rubber ring production quality detection method based on artificial intelligence | |
CN112508950B (en) | Anomaly detection method and device | |
CN116228780B (en) | Silicon wafer defect detection method and system based on computer vision | |
US7352901B2 (en) | Contour inspection method and apparatus | |
CN115049671A (en) | Cloth surface defect detection method and system based on computer vision | |
CN116883412B (en) | Graphene far infrared electric heating equipment fault detection method | |
CN115797473B (en) | Concrete forming evaluation method for civil engineering | |
CN117808796B (en) | Gear surface damage detection method based on computer vision | |
CN115311286A (en) | Dyeing defect identification method for dyed textiles | |
CN116152224B (en) | Dead pixel detection method for computer display | |
CN112561875A (en) | Photovoltaic cell panel coarse grid detection method based on artificial intelligence | |
CN111126371B (en) | Coarse pointer dial reading method based on image processing | |
CN115855961B (en) | Distribution box fault detection method used in operation | |
CN116168024A (en) | Corrugated paper production quality real-time detection method based on computer vision |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230724 Address after: 277600 South Building in Xinyuan Industrial Park, Liuzhuang Town, Weishan County, Jining City, Shandong Province Patentee after: Shandong Pengmin Clothing Co.,Ltd. Address before: 277600 Xinyuan Industrial Park, west of 104 Provincial Road, Liuzhuang Town, Weishan County, Jining City, Shandong Province Patentee before: Shandong Yimin Clothing Co.,Ltd. |
|
TR01 | Transfer of patent right |