CN115311267A - Method for detecting abnormity of check fabric - Google Patents
Method for detecting abnormity of check fabric Download PDFInfo
- Publication number
- CN115311267A CN115311267A CN202211231722.9A CN202211231722A CN115311267A CN 115311267 A CN115311267 A CN 115311267A CN 202211231722 A CN202211231722 A CN 202211231722A CN 115311267 A CN115311267 A CN 115311267A
- Authority
- CN
- China
- Prior art keywords
- gray
- curve
- abnormal
- difference
- pixel
- 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.)
- Granted
Links
- 239000004744 fabric Substances 0.000 title claims abstract description 51
- 238000000034 method Methods 0.000 title claims abstract description 31
- 230000002159 abnormal effect Effects 0.000 claims abstract description 111
- 238000004364 calculation method Methods 0.000 claims description 18
- 239000000126 substance Substances 0.000 claims description 14
- 230000005856 abnormality Effects 0.000 claims description 4
- 238000001514 detection method Methods 0.000 abstract description 11
- 238000004519 manufacturing process Methods 0.000 abstract description 4
- 238000013473 artificial intelligence Methods 0.000 abstract 1
- 230000007547 defect Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000009499 grossing Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 239000002131 composite material Substances 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 241001270131 Agaricus moelleri Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000002994 raw material Substances 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004753 textile Substances 0.000 description 1
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
- G06T7/0004—Industrial image inspection
- G06T7/0008—Industrial image inspection checking presence/absence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/40—Analysis of texture
- G06T7/41—Analysis of texture based on statistical description of texture
- G06T7/44—Analysis of texture based on statistical description of texture using image operators, e.g. filters, edge density metrics or local histograms
-
- 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/762—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
- G06V10/763—Non-hierarchical techniques, e.g. based on statistics of modelling distributions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30124—Fabrics; Textile; Paper
-
- 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)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Probability & Statistics with Applications (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Multimedia (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of data processing, in particular to a method for detecting abnormity of a check fabric. The method is a method for identifying by using electronic equipment, and the abnormal detection of the check fabric is finished by using an artificial intelligence system in the production field. Firstly, acquiring a check fabric image by using a camera, and carrying out data processing on the check fabric image to obtain smooth images under different window radiuses; and carrying out data processing on the smooth image to obtain the curve difference degree of the corresponding gray value curve, further obtaining the abnormal probability of each curve, and carrying out abnormal judgment on the check fabric image based on the abnormal probability, so that the error generated by directly carrying out abnormal detection on the image is reduced, and the dependency of a mean shift clustering algorithm on the window radius is reduced.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a method for detecting abnormity of a check fabric.
Background
During the production of the textile, the defects of warp deviation, weft deviation, warp doubling, dimensional doubling, flash and the like can be caused due to the equipment, the used raw materials, the operation technology and the like, and if the abnormalities are not detected in time, the subsequent operation is directly influenced, so that the serious loss is caused.
The prior art generally uses an edge detection or threshold segmentation method to detect the abnormity, but due to the characteristics of the check fabric, the interference of the warp and weft yarns can affect the abnormity detection. The selection requirement on the threshold is high, and different thresholds have different effects. When the image is subjected to smoothing processing and then abnormal detection is carried out, a mean shift clustering algorithm is generally used, the selection requirement of the mean shift clustering algorithm on the radius of a window is high, image information is lost when the radius is too large, subsequent abnormal detection is influenced, convergence speed is too low when the radius is too small, and calculation redundancy is caused by some unnecessary information in the image.
Disclosure of Invention
In order to solve the above technical problems, an object of the present invention is to provide a method for detecting an anomaly in a check fabric, which adopts the following technical scheme:
acquiring a check fabric image, extracting a check area in the check fabric image, and graying the check area to obtain a check gray area;
acquiring a window radius range, and performing mean shift clustering processing on the ruled gray area by adopting different window radii to obtain smooth images under different window radii;
constructing a gray value curve according to the gray values of the pixel points in each line on the smooth image, and classifying the gray value curve into different categories according to periodicity; calculating the pixel point difference degree of each pixel point on the gray value curve in each category according to the difference of the gray value curves in each category; calculating to obtain the curve difference degree of the curve by combining the pixel point difference degree of each pixel point on the curve;
obtaining the difference value of pixel values of pixel points at the same position of the same row of gray value curves in the smooth image under different window radiuses, and constructing a difference value sequence; based on the difference value sequence, calculating the abnormal probability according to the approximation degree of the gray value curve at the same position in the smooth image under different window radiuses; and carrying out abnormity judgment on the check fabric image based on the abnormity probability.
Preferably, the radius range of the acquisition window includes:
calculating the gradient value of each pixel point in the gray scale area of the ruled line by using a sobel operator, taking the pixel points with the gradient values larger than a preset gradient threshold value as the ruled line points, extracting each row of ruled line points, and obtaining the shortest distance between the ruled line points;
extracting pixel values of pixel points in each row in a ruled grain gray area, taking a first point at the upper left corner in the ruled grain gray area as an initial point of a ruled grain texture area, acquiring gray values of pixel points in eight neighborhoods corresponding to the initial point, merging the pixel points in the eight neighborhoods into the ruled grain texture area if the gray values of the pixel points in the eight neighborhoods are less than or equal to a preset gray threshold value, stopping until the gray values of the pixel points in the eight neighborhoods are greater than the preset gray threshold value, traversing all the points in the ruled grain gray area, and obtaining a plurality of ruled grain texture areas; taking the square of the number of the pixel points in the minimum grid texture area as the longest distance;
and taking the shortest distance as the left end point of the interval of the window radius range, and taking the longest distance as the right end point of the interval of the window radius range to obtain the window radius range.
Preferably, the dividing of the gray value curves into different categories according to the periodicity includes:
dividing all the gray value curves into a plurality of categories according to the similarity degree;
the calculation formula of the similarity degree is as follows:
wherein, the first and the second end of the pipe are connected with each other,the similarity degree of the gray value curve corresponding to the ith row and the gray value curve corresponding to the jth row is obtained;expressing the number of pixel points of each line;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;
and classifying the gray value curves with the similarity degree larger than a preset similarity threshold value into the same category, and traversing all the gray value curves to obtain a plurality of categories.
Preferably, the calculating the difference degree of the pixel points of each pixel point on the gray value curve in each category according to the difference of the gray value curves in each category includes:
the calculation formula of the pixel point difference degree is as follows:
wherein the content of the first and second substances,the difference degree of the pixel points;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;the number of termination rows for a category;the starting row number of the category;the sum of the gray values of the pixel points corresponding to the same column number and different line numbers.
Preferably, the calculating the difference degree of the pixel points of each pixel point on the combination curve to obtain the curve difference degree of the curve includes:
the calculation formula of the curve difference degree is as follows:
wherein the content of the first and second substances,the degree of curve difference;is an exponential function with a natural constant as a base number;the difference degree of the pixel point corresponding to the nth pixel point on the gray value curve is obtained;the number of pixels corresponding to the gray value curve.
Preferably, the calculating the anomaly probability from the approximation degree of the same-position curve in the smoothed images under different window radii based on the difference sequence includes:
subtracting every two adjacent elements in the difference sequence to obtain the difference value of the adjacent elements, and constructing an abnormal sequence;
the calculation formula of the pixel point abnormal probability is as follows:
wherein the content of the first and second substances,the abnormal probability of the pixel point corresponding to the ith element in the abnormal sequence is obtained;is a maximum function;is a minimum function;is an abnormal sequence;is the maximum value in the abnormal sequence;is the minimum value in the abnormal sequence;is the ith element in the abnormal sequence;
calculating the abnormal probability of the curve according to the abnormal probability of the pixel points;
the calculation formula of the abnormal probability is as follows:
wherein, the first and the second end of the pipe are connected with each other,is the probability of anomaly;the abnormal probability of the pixel points is larger than a preset first threshold valueThe number of corresponding pixel points;the abnormal probability of the pixel point corresponding to the ith element in the abnormal sequence is obtained;the number of the abnormal probability of the pixel points is larger than a preset first threshold value.
Preferably, the determining the abnormality of the check fabric image based on the abnormality probability includes:
when the abnormal probability is larger than a preset abnormal threshold value, the image of the check fabric is considered to be abnormal; and when the abnormal probability is less than or equal to a preset abnormal threshold value, the image of the check fabric is considered to be normal.
The embodiment of the invention at least has the following beneficial effects:
the invention relates to the technical field of data processing. Acquiring a check fabric image, extracting a check area in the check fabric image, and graying the check area to obtain a check gray area; acquiring a window radius range, and performing mean shift clustering processing on the ruled gray area by adopting different window radii to obtain smooth images under different window radii; constructing a gray value curve according to the gray values of the pixel points in each row on the smooth image, and classifying the gray value curve into different categories according to periodicity; calculating the pixel point difference degree of each pixel point on the gray value curve in each category according to the difference of the gray value curves in each category; calculating to obtain the curve difference degree of the curve by combining the pixel point difference degree of each pixel point on the curve; obtaining the difference value of pixel values of pixel points at the same position of the same row of gray value curves in the smooth image under different window radiuses, and constructing a difference value sequence; based on the difference sequence, calculating the abnormal probability according to the approximation degree of the gray value curve at the same position in the smooth image under different window radiuses; and carrying out abnormity judgment on the check fabric image based on the abnormity probability. According to the method, the clustering effects under different window radiuses are analyzed, the abnormal probability is obtained by combining the gray value distribution characteristics of the image, the abnormal detection is further carried out on the image, errors generated by directly carrying out the abnormal detection on the image are reduced, and the dependency of a mean shift clustering algorithm on the window radiuses is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for detecting an anomaly in a check fabric according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined purpose, the following detailed description of the method for detecting an abnormal condition of a check fabric according to the present invention, the specific implementation manner, structure, features and effects thereof will be given with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The embodiment of the invention provides a specific implementation method of an abnormity detection method of a check fabric, which is suitable for xx. And placing a camera on the production line of the check fabric in the scene. The method aims to solve the problems that the selection requirement of a mean shift clustering algorithm on the radius of a window is high, image information is lost when the radius is too large, subsequent abnormal detection is influenced, the convergence speed is too low when the radius is too small, and calculation redundancy is caused by some unnecessary information in the image. The method comprises the steps of preprocessing the acquired ruled fabric image of the ruled fabric, acquiring smooth images under different clustering window radiuses, obtaining abnormal probability according to the gray value distribution rule of the image, and further carrying out abnormal detection on the image according to the abnormal probability.
The following specifically describes a specific scheme of the method for detecting the anomaly of the check fabric provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a flow chart of the steps of a method for detecting an anomaly in a check fabric according to an embodiment of the present invention is shown, the method includes the following steps:
step S100, acquiring a check fabric image, extracting a check area in the check fabric image, and graying the check area to obtain a check gray area.
The collecting device is arranged above the production line, the produced check fabric image of the check fabric is collected, the influences of illumination, noise and the like are avoided during collection, and the collected check fabric image is an RGB image. And removing the background area by using a neural network method, and extracting the grid pattern area in the grid pattern fabric image. It should be noted that, the method of using a neural network to remove the background area is the prior art, and is not described herein again.
And carrying out weighted average graying processing on the obtained ruled grain area to obtain a ruled grain gray area. Thus, a gray scale map of the ruled region, namely, a ruled gray scale region, is obtained.
And S200, acquiring a window radius range, and performing mean shift clustering processing on the ruled line gray level area by adopting different window radii to obtain smooth images under different window radii.
As for the mean shift clustering algorithm, the selection of the window radius directly influences the quality of the image after smoothing, if the window radius is too large, part of clusters can be lost, image information is lost, and subsequent abnormal detection is influenced. If the window radius is too small, some unnecessary clusters will be generated, which not only affects the subsequent determination, but also increases the unnecessary calculation amount. Firstly, obtaining the radius range of a window, further obtaining smooth images under different windows, and then analyzing the images by combining defect characteristics, further obtaining the abnormal probability.
The specific process of acquiring the abnormal probability comprises the following steps: (1) And obtaining the radius range of the window to obtain smooth images under different windows. (2) And obtaining the abnormal probability according to the distribution rule of the gray value of the image.
Firstly, obtaining a window radius range to obtain smooth images under different window radii, specifically:
the logic is that due to the fact that the dependency of the mean shift clustering algorithm on the window radius is high, a large amount of information of the image can be lost due to the improper window radius, and the window radius range needs to be obtained according to the image characteristics.
The ruled-grain gray area is a gray map, and when mean shift clustering processing is carried out, the sample space is a one-dimensional gray value.
The purpose of the mean shift clustering processing on the gray scale area of the grid pattern is to remove the influence of the fine grid pattern in the image, and the fine grid pattern is processed smoothly without destroying other original information in the image.
The difference between the pixel points at the grid and the periphery is large, and the pixel points at the grid in the image can be extracted by a method of setting a gradient threshold.
Calculating the gradient value of each pixel point in the gray scale region of the ruled lines by using a sobel operator, taking the pixel points with the gradient values larger than a preset gradient threshold value as the ruled lines, extracting each row of ruled lines, and obtaining the shortest distance between the ruled lines. Namely, the sobel operator is used for calculating the gradient value of each pixel point in the gridlike gray area, and a gradient threshold value D is preset. In the embodiment of the present invention, the value of the preset gradient threshold is 0.1, and in other embodiments, an implementer may adjust the value according to an actual situation. And marking all pixel points which are larger than the threshold value in the grid line gray area as grid line points. Extracting the grid points of each row, and recording the shortest distance between every two grid points as。
The original information in the image cannot be destroyed when the image is subjected to mean shift clustering processing. The length of the smallest ruled texture region in the graph is the largest window radius, specifically: extracting pixel values of pixel points in each row in a ruled grain gray area, taking a first point at the upper left corner in the ruled grain gray area as an initial point of a ruled grain texture area, acquiring gray values of pixel points in eight neighborhoods corresponding to the initial point, merging the pixel points in the eight neighborhoods into the ruled grain texture area if the gray values of the pixel points in the eight neighborhoods are less than or equal to a preset gray threshold value, stopping until the gray values of the pixel points in the eight neighborhoods are greater than the preset gray threshold value, traversing all the points in the ruled grain gray area, and obtaining a plurality of ruled grain texture areas; and taking the square of the number of the pixel points in the minimum grid texture area as the longest distance, wherein the longest distance is also the maximum window radius. In the embodiment of the present invention, the value of the preset gray threshold is 5, and in other embodiments, an implementer may adjust the value according to actual conditions. It should be noted that, the decimal fraction obtained by squaring the number of pixels in the minimum ruled texture region is subjected to rounding operation.
That is, extracting the gray value of each row, presetting a gray threshold K, using the first point at the upper left corner in the graph as a starting point, searching the gray value of 8 neighborhoods of the graph, if the gray value is smaller than the threshold, merging the point into the 8 neighborhoods until the point larger than the threshold appears in the 8 neighborhoods, recording the number of pixel points in the check texture area as L, traversing all the points in the graph to obtain a setMemory for recordingSince the square is a decimal, the rounding operation is required.
After obtaining the longest distance and the shortest distance, taking the shortest distance as the left end point of the window radius range, taking the longest distance as the right end point of the window radius range, obtaining the window radius range, and recording the window radius range as ()。
Thus, a window radius range is obtained.
And performing mean shift clustering processing on the ruled line gray level region by adopting different window radiuses according to the obtained window radius range to obtain smooth images under different window radiuses. It should be noted that the mean shift clustering algorithm is prior art and is not described herein too much.
Step S300, constructing a gray value curve by gray values of pixel points in each line of the smooth image, and classifying the gray value curve into different categories according to periodicity; calculating the pixel point difference degree of each pixel point on the gray value curve in each category according to the difference of the gray value curves in each category; and calculating to obtain the curve difference degree of the curve by combining the pixel point difference degree of each pixel point on the curve.
Further, obtaining the abnormal probability according to the distribution rule of the gray value of the image. Before obtaining the abnormal probability, analyzing the smooth image according to the difference of the gray values of the pixel points of each line on the smooth image, specifically:
the logic is that the abnormal area can be obtained according to the characteristic because the gray value of the abnormal area on the image has sudden change, and then the abnormal probability is obtained through the difference between the noise generated by the mean shift algorithm and the abnormal defect.
The ruled gray scales are firstly divided into different categories. The reason is that the grid texture gray scale areas are periodically distributed, and the grid texture gray scale areas are periodically divided into different areas according to the image and then are subjected to subsequent processing.
Acquiring a gray value curve of pixel points in each line, and classifying the curves into different categories according to periodicity:
the periodic characteristics of the image are reflected in the gray value curves, namely the similarity degree of the two curves, and all the gray value curves can be divided into a plurality of categories according to the similarity degree. The calculation formula of the similarity degree is as follows:
wherein the content of the first and second substances,the similarity degree of the gray value curve corresponding to the ith row and the gray value curve corresponding to the jth row is obtained;expressing the number of pixel points of each line;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point.
The formula logic is that the similarity degree rate of the two curves is equal to the average value of the space distance of the corresponding points of the two curves.
Indicates the similarity degree of the two curves, and when the two curves are more similar, the two curves belong to the same region in the figure, and the timeThe smaller the value. On the contrary, the method can be used for carrying out the following steps,the larger the value, the less similar the two curves.
Similarity is determined for all curvesAnd are combined toAnd carrying out normalization operation, and updating the similarity degree into the normalized similarity degree. And classifying the gray value curves with the similarity degrees larger than a preset similarity threshold into the same category, and traversing all the gray value curves to obtain a plurality of categories.In the embodiment of the present invention, the value of the preset similarity threshold is 0.7, and in other embodiments, an implementer may adjust the value according to an actual situation. And obtaining curves of different types, and analyzing the images into different areas according to periodicity.
Further, a possible abnormal area is acquired. In the smoothed image, if the number of points where the gray value of a certain region has abnormal fluctuation is more, it indicates that the region may be an abnormal region.
After the image is processed by using the mean shift clustering algorithm, the tiny stripes in the image of the check fabric are blurred and smoothed. When a possible abnormal area appears in the image, abnormal fluctuation occurs in the gray value of the edge of the area, and the image period characteristic is damaged.
The possible abnormal area is obtained by analyzing the difference degree of each class curve. Due to the irregular shapes of the abnormal region and the noise region, abnormal fluctuation appears on the gray value curve.
The difference degree of the curves in each category can be analyzed to obtain a possible defect area, the difference degree of each pixel point on the curves is calculated at the moment, and the difference degree of the pixel points of each pixel point on the gray value curves in the categories is calculated according to the difference of the gray value curves in each category. The calculation formula of the pixel point difference degree is as follows:
wherein the content of the first and second substances,the difference degree of the pixel points;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;the number of termination rows for a category;the starting row number of the category;the sum of the gray values of the pixel points corresponding to the same column number and different line numbers.
Wherein the content of the first and second substances,the gray value of the pixel points corresponding to the same column number and different line numbers is averaged. Since the difference may be negative, the resulting degree of difference is processed in absolute terms.
The formula logic is that the difference degree of each point on the curve is equal to the gray value of the point minus the average value of the gray value sum of the points with the same column number and different row numbers. The pixel point difference degree of each pixel point on the curve is obtained.
The calculation formula of the curve difference degree is as follows:
wherein the content of the first and second substances,the degree of curve difference;is an exponential function with a natural constant as a base number;the difference degree of the pixel points corresponding to the nth pixel point on the gray value curve is obtained;the number of the pixel points corresponding to the gray value curve.
Wherein the content of the first and second substances,is the sum of the degrees of difference at each point on the curve,the threshold value setting is convenient for the normalization operation of the difference degree sum of each point on the curve.
And when the obtained curve difference degree Q is larger than a preset curve difference degree threshold value, determining that the abnormal area is possible. And performing subsequent analysis, and judging as a normal area when the obtained difference degree Q is less than or equal to a preset curve difference degree threshold value, and not participating in the subsequent analysis. In the embodiment of the present invention, the value of the preset curve difference degree threshold is 0.7, and in other embodiments, an implementer may adjust the value according to an actual situation.
Step S400, obtaining the difference value of pixel points at the same position of the same row of gray value curves in the smooth image under different window radiuses, and constructing a difference value sequence; based on the difference sequence, calculating the abnormal probability according to the approximation degree of the gray value curve at the same position in the smooth image under different window radiuses; and carrying out abnormity judgment on the check fabric image based on the abnormity probability.
Noise points are generated when the mean shift clustering algorithm performs a smoothing operation on the image, and the region formed by the noise points can be divided into abnormal regions. Therefore, it is not accurate to judge only the pictures at each radius. The influence of noise points needs to be eliminated by combining the difference information of different images so as to obtain the abnormal probability.
The distribution positions of noise points in the smooth images obtained under different window radius processing are different. And for the abnormal region, the position is the same under different window radii. The approximation of the same position curve in the processed images at different window radii can be analyzed.
Obtaining different window halvesAnd constructing a difference sequence by the difference of the pixel values of the pixel points at the same positions of the same row of the gray value curve in the smooth image under the path. That is, the i-th row gray value curve in the smooth image with different window sizes is obtained, and the difference value sequence is obtained by subtracting the corresponding positions two by twoWherein n represents the number of pixels in each row.
Based on the difference sequence, calculating the abnormal probability according to the approximation degree of the gray value curve at the same position in the smooth image under different window radiuses, specifically: subtracting adjacent elements in the difference sequence pairwise to obtain the difference of the adjacent elements, and constructing an abnormal sequence. When a noise area appears, the difference of pixel points at the same position in different smooth images is large, namely, the difference is large. When abnormal areas appear, the difference of pixel points at the same position in different smooth images is small, and the difference is small.
According to the analysis, the approximation degree of the curve at the same position can be used as the abnormal probability, and the abnormal probability of the pixel points of each pixel point corresponding to the curve is calculated. The calculation formula of the pixel point abnormal probability is as follows:
wherein the content of the first and second substances,the abnormal probability of the pixel point corresponding to the ith element in the abnormal sequence is obtained;is a maximum function;is a minimum function;is an abnormal sequence;is the maximum value in the abnormal sequence;is the minimum value in the abnormal sequence;is the ith element in the exception sequence.
The approximation degree of the same position is embodied, namely the abnormal probability of the pixel point, if the value belongs to the abnormal area,the size of the composite material is small,the value approaches 1; in the case of a noise region, the noise region,the size of the composite material is larger,the value approaches 0.
A first threshold is preset, and in the embodiment of the present invention, a value of the preset first threshold is 0.6. And when the abnormal probability of the pixel point is greater than a preset first threshold, judging that the pixel point is abnormal, and when the abnormal probability of the pixel point is less than or equal to the preset first threshold, judging that the pixel point is normal. Further, the abnormal probability of the curve is calculated according to the abnormal probability of the pixel points.
The calculation formula of the abnormal probability is as follows:
wherein the content of the first and second substances,is the anomaly probability;the abnormal probability of the pixel points is larger than a preset first threshold valueThe number of corresponding pixel points;the abnormal probability of the pixel point corresponding to the ith element in the abnormal sequence is obtained;the number of the abnormal probability of the pixel points is larger than a preset first threshold value.
When the abnormal probability is larger than a preset abnormal threshold value, the image of the check fabric is considered to be abnormal; and when the abnormal probability is less than or equal to a preset abnormal threshold value, the image of the check fabric is considered to be normal. In the embodiment of the invention, the value of the preset abnormal threshold is 0.7.
In summary, the present invention relates to the field of data processing technology. Acquiring a check fabric image, extracting a check area in the check fabric image, and graying the check area to obtain a check gray area; acquiring a window radius range, and performing mean shift clustering processing on the ruled texture gray area by adopting different window radii to obtain smooth images under different window radii; constructing a gray value curve according to the gray values of the pixel points in each row on the smooth image, and classifying the gray value curve into different categories according to periodicity; calculating the pixel point difference degree of each pixel point on the gray value curve in each category according to the difference of the gray value curves in each category; calculating to obtain the curve difference degree of the curve by combining the pixel point difference degree of each pixel point on the curve; acquiring the difference value of pixel values of pixel points at the same position of the same row of gray value curves in the smooth image under different window radiuses, and constructing a difference value sequence; based on the difference sequence, calculating the abnormal probability according to the approximation degree of the gray value curve at the same position in the smooth image under different window radiuses; and carrying out abnormity judgment on the check fabric image based on the abnormity probability.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. The processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (7)
1. A method for detecting an abnormality of a check fabric, the method comprising the steps of:
acquiring a check fabric image, extracting a check area in the check fabric image, and graying the check area to obtain a check gray area;
acquiring a window radius range, and performing mean shift clustering processing on the ruled gray area by adopting different window radii to obtain smooth images under different window radii;
constructing a gray value curve according to the gray values of the pixel points in each row on the smooth image, and classifying the gray value curve into different categories according to periodicity; calculating the pixel point difference degree of each pixel point on the gray value curve in each category according to the difference of the gray value curves in each category; calculating to obtain the curve difference degree of the curve by combining the pixel point difference degree of each pixel point on the curve;
acquiring the difference value of pixel values of pixel points at the same position of the same row of gray value curves in the smooth image under different window radiuses, and constructing a difference value sequence; based on the difference sequence, calculating the abnormal probability according to the approximation degree of the gray value curve at the same position in the smooth image under different window radiuses; and carrying out abnormity judgment on the check fabric image based on the abnormity probability.
2. The method for detecting the anomaly of the check fabric according to claim 1, wherein the obtaining of the window radius range comprises:
calculating the gradient value of each pixel point in the gray scale area of the ruled line by using a sobel operator, taking the pixel points with the gradient values larger than a preset gradient threshold value as the ruled line points, extracting each row of ruled line points, and obtaining the shortest distance between the ruled line points;
extracting pixel values of pixel points in each row in a ruled grain gray area, taking a first point at the upper left corner in the ruled grain gray area as an initial point of a ruled grain texture area, acquiring gray values of pixel points in eight neighborhoods corresponding to the initial point, merging the pixel points in the eight neighborhoods into the ruled grain texture area if the gray values of the pixel points in the eight neighborhoods are less than or equal to a preset gray threshold value, stopping until the gray values of the pixel points in the eight neighborhoods are greater than the preset gray threshold value, traversing all the points in the ruled grain gray area, and obtaining a plurality of ruled grain texture areas; taking the square of the number of the pixel points in the minimum grid texture area as the longest distance;
and taking the shortest distance as the left end point of the window radius range, and taking the longest distance as the right end point of the window radius range to obtain the window radius range.
3. The method for detecting the anomaly of the check fabric according to claim 1, wherein the classification of the gray value curves into different categories according to periodicity comprises the following steps:
dividing all the gray value curves into a plurality of categories according to the similarity degree;
the calculation formula of the similarity degree is as follows:
wherein, the first and the second end of the pipe are connected with each other,the similarity degree of the gray value curve corresponding to the ith row and the gray value curve corresponding to the jth row is obtained;expressing the number of pixel points of each line;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;
and classifying the gray value curves with the similarity degree larger than a preset similarity threshold value into the same category, and traversing all the gray value curves to obtain a plurality of categories.
4. The method according to claim 1, wherein the calculating the difference degree of the pixel points of each pixel point on the gray value curve in each category according to the difference of the gray value curves in each category comprises:
the calculation formula of the pixel point difference degree is as follows:
wherein the content of the first and second substances,the difference degree of the pixel points;the abscissa in the gray scale area of the grid pattern isOn the ordinate ofThe gray value of the pixel point;the number of termination rows for a category;the starting row number of the category;the sum of the gray values of the pixel points corresponding to the same column number and different line numbers.
5. The method according to claim 1, wherein the step of calculating the curve difference degree of the curve according to the pixel point difference degree of each pixel point on the combination curve comprises:
the calculation formula of the curve difference degree is as follows:
wherein the content of the first and second substances,the degree of curve difference;is an exponential function with a natural constant as a base number;the difference degree of the pixel points corresponding to the nth pixel point on the gray value curve is obtained;the number of pixels corresponding to the gray value curve.
6. The method for detecting the anomaly of the check fabric according to claim 1, wherein the calculating the anomaly probability from the approximation degree of the curve at the same position in the smooth image under different window radiuses based on the difference sequence comprises:
subtracting every two adjacent elements in the difference sequence to obtain the difference value of the adjacent elements, and constructing an abnormal sequence;
the calculation formula of the abnormal probability of the pixel point is as follows:
wherein the content of the first and second substances,the abnormal probability of the pixel point corresponding to the ith element in the abnormal sequence is obtained;is a maximum function;is a minimum function;is an abnormal sequence;is the maximum value in the abnormal sequence;is the minimum value in the abnormal sequence;is the ith element in the abnormal sequence;
calculating the abnormal probability of the curve according to the abnormal probability of the pixel points;
the calculation formula of the abnormal probability is as follows:
wherein the content of the first and second substances,is the anomaly probability;the abnormal probability of the pixel points is larger than a preset first threshold valueThe number of corresponding pixel points;the abnormal probability of the pixel point corresponding to the ith element in the abnormal sequence is obtained;is largeAnd presetting the number of the abnormal probability of the pixel points with the first threshold value.
7. The method for detecting the anomaly of the check fabric according to claim 1, wherein the step of judging the anomaly of the check fabric image based on the anomaly probability comprises the following steps:
when the abnormal probability is larger than a preset abnormal threshold value, the image of the check fabric is considered to be abnormal; and when the abnormal probability is less than or equal to a preset abnormal threshold value, the image of the check fabric is considered to be normal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211231722.9A CN115311267B (en) | 2022-10-10 | 2022-10-10 | Method for detecting abnormity of check fabric |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211231722.9A CN115311267B (en) | 2022-10-10 | 2022-10-10 | Method for detecting abnormity of check fabric |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115311267A true CN115311267A (en) | 2022-11-08 |
CN115311267B CN115311267B (en) | 2023-04-14 |
Family
ID=83867664
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211231722.9A Active CN115311267B (en) | 2022-10-10 | 2022-10-10 | Method for detecting abnormity of check fabric |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115311267B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116109633A (en) * | 2023-04-12 | 2023-05-12 | 山东金帝精密机械科技股份有限公司 | Window detection method and device for bearing retainer |
CN116523913A (en) * | 2023-07-03 | 2023-08-01 | 惠州市金思维科技有限公司 | Intelligent detection method for quality of screw rod |
CN116721105A (en) * | 2023-08-11 | 2023-09-08 | 山东淼珠生物科技有限公司 | Explosive bead production abnormality online detection method based on artificial intelligence |
CN117974639A (en) * | 2024-03-28 | 2024-05-03 | 山东正为新材料科技有限公司 | Sealant abnormal state detection method based on image data |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220236196A1 (en) * | 2021-01-26 | 2022-07-28 | Changxin Memory Technologies, Inc. | Methods for determining focus spot window and judging whether wafer needs to be reworked |
CN114926436A (en) * | 2022-05-20 | 2022-08-19 | 南通沐沐兴晨纺织品有限公司 | Defect detection method for periodic pattern fabric |
CN115115615A (en) * | 2022-07-26 | 2022-09-27 | 南通好心情家用纺织品有限公司 | Textile fabric quality evaluation method and system based on image recognition |
-
2022
- 2022-10-10 CN CN202211231722.9A patent/CN115311267B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220236196A1 (en) * | 2021-01-26 | 2022-07-28 | Changxin Memory Technologies, Inc. | Methods for determining focus spot window and judging whether wafer needs to be reworked |
CN114926436A (en) * | 2022-05-20 | 2022-08-19 | 南通沐沐兴晨纺织品有限公司 | Defect detection method for periodic pattern fabric |
CN115115615A (en) * | 2022-07-26 | 2022-09-27 | 南通好心情家用纺织品有限公司 | Textile fabric quality evaluation method and system based on image recognition |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116109633A (en) * | 2023-04-12 | 2023-05-12 | 山东金帝精密机械科技股份有限公司 | Window detection method and device for bearing retainer |
CN116523913A (en) * | 2023-07-03 | 2023-08-01 | 惠州市金思维科技有限公司 | Intelligent detection method for quality of screw rod |
CN116523913B (en) * | 2023-07-03 | 2023-11-03 | 惠州市金思维科技有限公司 | Intelligent detection method for quality of screw rod |
CN116721105A (en) * | 2023-08-11 | 2023-09-08 | 山东淼珠生物科技有限公司 | Explosive bead production abnormality online detection method based on artificial intelligence |
CN116721105B (en) * | 2023-08-11 | 2023-10-20 | 山东淼珠生物科技有限公司 | Explosive bead production abnormality online detection method based on artificial intelligence |
CN117974639A (en) * | 2024-03-28 | 2024-05-03 | 山东正为新材料科技有限公司 | Sealant abnormal state detection method based on image data |
Also Published As
Publication number | Publication date |
---|---|
CN115311267B (en) | 2023-04-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115311267B (en) | Method for detecting abnormity of check fabric | |
CN115311292B (en) | Strip steel surface defect detection method and system based on image processing | |
CN114972357B (en) | Roller surface defect detection method and system based on image processing | |
CN116168026B (en) | Water quality detection method and system based on computer vision | |
CN109035195B (en) | Fabric defect detection method | |
CN107437243B (en) | Tire impurity detection method and device based on X-ray image | |
CN116843688B (en) | Visual detection method for quality of textile | |
CN114549522A (en) | Textile quality detection method based on target detection | |
CN116977358B (en) | Visual auxiliary detection method for corrugated paper production quality | |
CN115294140A (en) | Hardware part defect detection method and system | |
CN115115637B (en) | Cloth defect detection method based on image pyramid thought | |
CN115131348B (en) | Method and system for detecting textile surface defects | |
CN116152242B (en) | Visual detection system of natural leather defect for basketball | |
CN115082458B (en) | Textile material defect analysis method based on gray level run matrix | |
CN116309577B (en) | Intelligent detection method and system for high-strength conveyor belt materials | |
CN115359053A (en) | Intelligent detection method and system for defects of metal plate | |
CN115240146B (en) | Intelligent machine tool assembly acceptance method based on computer vision | |
CN114841938A (en) | Fabric snagging defect detection method | |
CN115100214A (en) | Textile quality detection method based on image processing | |
CN114677376A (en) | Method and system for testing defects in production of woven belts based on illumination pretreatment | |
CN116452589A (en) | Intelligent detection method for surface defects of artificial board based on image processing | |
CN117333489A (en) | Film damage detection device and detection system | |
CN115049651A (en) | Metal plate stamping abnormity detection method | |
CN117036314A (en) | Method for detecting oxidation area of high-density flexible IC substrate | |
CN118037722B (en) | Copper pipe production defect detection method and system |
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 | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A method for detecting anomalies in checkered fabrics Effective date of registration: 20231124 Granted publication date: 20230414 Pledgee: Jiangsu Tongzhou Huashang Rural Bank Co.,Ltd. Pledgor: Nantong Yiyaochen Textile Technology Co.,Ltd. Registration number: Y2023980067241 |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right |