CN115131348A - A method and system for detecting surface defects of textiles - Google Patents

A method and system for detecting surface defects of textiles Download PDF

Info

Publication number
CN115131348A
CN115131348A CN202211044200.8A CN202211044200A CN115131348A CN 115131348 A CN115131348 A CN 115131348A CN 202211044200 A CN202211044200 A CN 202211044200A CN 115131348 A CN115131348 A CN 115131348A
Authority
CN
China
Prior art keywords
sliding window
image
length
probability
frequency
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
Application number
CN202211044200.8A
Other languages
Chinese (zh)
Other versions
CN115131348B (en
Inventor
唐琴
华真珍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haimen Ximanting Textile Co ltd
Original Assignee
Haimen Ximanting Textile Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Haimen Ximanting Textile Co ltd filed Critical Haimen Ximanting Textile Co ltd
Priority to CN202211044200.8A priority Critical patent/CN115131348B/en
Publication of CN115131348A publication Critical patent/CN115131348A/en
Application granted granted Critical
Publication of CN115131348B publication Critical patent/CN115131348B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30124Fabrics; Textile; Paper

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Treatment Of Fiber Materials (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention discloses a method for detecting surface defects of textiles, relates to the field of artificial intelligence, and is mainly used for detecting broken threads of the textiles. The method comprises the following steps: acquiring a gray level image of the surface of the textile and preprocessing the gray level image; acquiring the maximum frequency point pair length in each direction in the gray level image, and calculating the point pair period length probability in each direction; acquiring the period length in the period extending direction, setting sliding window parameters to slide the gray level image, acquiring a frequency domain space image of each sliding window image, acquiring an intersection frequency value of the sliding window images, filtering each sliding window image, calculating the contrast value of each pixel point in each sliding window, and acquiring high-contrast pixel points in each sliding window; and calculating the defect probability of each sliding window, and judging whether the sliding window image has defects according to the defect probability. According to the technical means provided by the invention, the interference of the printing texture of the textile can be overcome, the defect area can be accurately positioned, and the detection efficiency is effectively improved.

Description

一种纺织品表面缺陷的检测方法及系统A method and system for detecting surface defects of textiles

技术领域technical field

本发明涉及人工智能领域,具体涉及一种纺织品表面缺陷的检测方法及系统。The invention relates to the field of artificial intelligence, in particular to a method and system for detecting surface defects of textiles.

背景技术Background technique

在纺织品表面缺陷的检测过程中,由于纺织品自身纹理的干扰,导致检测出的缺陷不够精确,无法精确的定位出纺织品表面缺陷,本发明设计一种纺织品表面缺陷的检测方法,获取精确的缺陷位置,便于后续的纺织品修复处理。During the detection of textile surface defects, due to the interference of the texture of the textile itself, the detected defects are not accurate enough, and the textile surface defects cannot be accurately located. The invention designs a detection method for textile surface defects to obtain accurate defect positions. , which is convenient for subsequent textile repair processing.

由于纹理和颜色的干扰导致常规的阈值分割和边缘检测方法不能检测出纺织品缺陷位置。常规的滤波检测方法也无法简单的获取背景图案的频段,导致需花费大量时间来进行频段判定。Due to the interference of texture and color, conventional threshold segmentation and edge detection methods cannot detect textile defect locations. The conventional filter detection method cannot simply obtain the frequency band of the background pattern, so it takes a lot of time to determine the frequency band.

发明内容SUMMARY OF THE INVENTION

本发明提供一种纺织品表面缺陷的检测方法及系统,以解决现有的问题,包括:获取纺织品表面灰度图像并进行预处理;获取灰度图像中各个方向上最大频率点对长度,计算每个方向的点对周期长度概率;获取周期延伸方向上的周期长度,设置滑窗参数对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,获取滑窗图像的交集频率值对每个滑窗图像进行滤波处理,计算各个滑窗内每个像素点的对比度值,获取每个滑窗中的高对比度像素点;计算每个滑窗的缺陷概率,根据缺陷概率判断滑窗图像是否存在缺陷。The present invention provides a method and system for detecting surface defects of textiles, so as to solve the existing problems, including: acquiring a grayscale image of the textile surface and performing preprocessing; Point-to-cycle length probability in each direction; obtain the cycle length in the extension direction of the cycle, set the sliding window parameters to perform sliding window on the grayscale image, obtain the frequency domain space image of each sliding window image, and obtain the intersection frequency of the sliding window images Filter each sliding window image, calculate the contrast value of each pixel in each sliding window, and obtain high-contrast pixels in each sliding window; calculate the defect probability of each sliding window, and judge the sliding window according to the defect probability. Whether the window image is defective.

根据本发明提出的技术手段,通过分析图像中的点对纹理信息得到纺织品的纹理周期信息,利用周期信息设置滑窗参数,从而进行进一步的滤波处理,能够克服纺织品自身印花纹理的干扰,精确的定位出缺陷区域,从而有效提升了检测效率和生产质量。According to the technical means proposed in the present invention, the texture period information of the textile is obtained by analyzing the point-to-texture information in the image, and the sliding window parameters are set by using the period information, so as to perform further filtering processing, which can overcome the interference of the printing texture of the textile itself, and accurately Defective areas are located, thereby effectively improving inspection efficiency and production quality.

本发明采用如下技术方案,一种纺织品表面缺陷的检测方法,包括:The present invention adopts the following technical solutions, a method for detecting surface defects of textiles, comprising:

获取纺织品表面灰度图像,并对所述灰度图像进行预处理获得梯度图像。A grayscale image of the textile surface is acquired, and a gradient image is obtained by preprocessing the grayscale image.

获取梯度图像中每一个像素点在每个方向上两两像素点形成的点对,利用各个方向上最大频率点对所对应的点对长度计算所述灰度图像每个方向的点对周期长度概率。Obtain the point pair formed by each pixel in each direction in each direction in the gradient image, and use the point pair length corresponding to the maximum frequency point pair in each direction to calculate the point pair period length in each direction of the grayscale image. probability.

将所有点对得到的周期长度概率最大值所对应的方向作为周期的延申方向,获取周期延申方向上的周期长度,根据所述周期长度以及周期延申方向设置滑窗参数。The direction corresponding to the maximum cycle length probability obtained by all point pairs is used as the extension direction of the cycle, the cycle length in the cycle extension direction is obtained, and the sliding window parameters are set according to the cycle length and the cycle extension direction.

利用设定参数的窗口对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,根据两两滑窗的频域空间交集得到对应两个滑窗图像的交集频率值。Sliding the grayscale image by using the window of the set parameters to obtain the frequency domain space image of each sliding window image, and obtaining the intersection frequency value of the corresponding two sliding window images according to the frequency domain space intersection of the two sliding windows.

利用每一个滑窗图像与其它滑窗图像的交集频率值分别对该滑窗图像进行滤波处理获得该滑窗图像在不同交集频率值滤波处理后的滤波图像。Using the intersection frequency value of each sliding window image and other sliding window images to filter the sliding window image respectively to obtain filtered images of the sliding window image after filtering processing at different intersection frequency values.

利用每一个滑窗图像对应的所有滤波图像中每个像素点的对比度值,计算该滑窗图像的缺陷概率,根据所述缺陷概率判断该滑窗图像是否存在缺陷。Using the contrast value of each pixel in all the filtered images corresponding to each sliding window image, the defect probability of the sliding window image is calculated, and whether the sliding window image has defects is judged according to the defect probability.

进一步的,一种纺织品表面缺陷的检测方法,计算所述灰度图像每个方向的点对周期长度概率的方法如下:Further, a method for detecting surface defects of textiles, the method for calculating the point-to-period length probability of each direction of the grayscale image is as follows:

利用起始点与终止点之间的欧氏距离计算所述灰度图像中第k行点对在每个方向上的点对长度,获取第s个方向上最大频率对应的行点对长度

Figure 942700DEST_PATH_IMAGE001
;Use the Euclidean distance between the starting point and the ending point to calculate the point pair length of the kth row point pair in each direction in the grayscale image, and obtain the row point pair length corresponding to the maximum frequency in the sth direction
Figure 942700DEST_PATH_IMAGE001
;

同理,计算从第k行出发与第s个方向垂直方向上的所有点对长度得到列点对长度,获取对应方向上频率最大的列点对长度

Figure 954780DEST_PATH_IMAGE002
;In the same way, calculate the length of all point pairs in the vertical direction starting from the kth row and the sth direction to obtain the length of the column point pair, and obtain the length of the column point pair with the highest frequency in the corresponding direction.
Figure 954780DEST_PATH_IMAGE002
;

计算第s个方向的周期长度概率的表达式为:The expression for calculating the cycle length probability in the s-th direction is:

Figure DEST_PATH_IMAGE003
Figure DEST_PATH_IMAGE003

其中,

Figure 655889DEST_PATH_IMAGE004
表示从第k行出发垂直于第s个角度方向上频率最大的列点对长度,
Figure 614880DEST_PATH_IMAGE005
从第k行点对出发的第s个角度方向为第一行,平行向下i行的点对在第s个方向上的最大频率点对长度,
Figure 22727DEST_PATH_IMAGE001
表示第k行点对在第s个方向上的最大频率点对长度,N表示共有N行点对,
Figure 907507DEST_PATH_IMAGE006
表示所述灰度图像第s个方向上的点对周期长度概率。in,
Figure 655889DEST_PATH_IMAGE004
Indicates the length of the column point pair with the largest frequency in the direction perpendicular to the s-th angle starting from the k-th row,
Figure 614880DEST_PATH_IMAGE005
The s-th angular direction starting from the point pair in the k-th row is the first row, and the maximum frequency point pair length in the s-th direction of the point pair in the i-row parallel to the downward direction,
Figure 22727DEST_PATH_IMAGE001
Indicates the maximum frequency point pair length of the k-th row point pair in the s-th direction, and N represents a total of N rows of point pairs,
Figure 907507DEST_PATH_IMAGE006
represents the point-to-period length probability in the s-th direction of the grayscale image.

进一步的,一种纺织品表面缺陷的检测方法,根据所述周期长度以及周期延申方向设置滑窗参数的方法如下:Further, a method for detecting surface defects of textiles, the method for setting sliding window parameters according to the period length and the period extension direction is as follows:

获取周期长度概率最大的角度方向

Figure 263621DEST_PATH_IMAGE007
作为周期的延申方向,获取周期长度概率最大的行
Figure 790417DEST_PATH_IMAGE008
作为周期始点,选取从
Figure 787192DEST_PATH_IMAGE008
行出发的第
Figure 875496DEST_PATH_IMAGE007
个角度方向直线的最大频率点对长度
Figure 957722DEST_PATH_IMAGE009
为周期行长度,将垂直于从第
Figure 22629DEST_PATH_IMAGE008
行出发的第
Figure 640955DEST_PATH_IMAGE007
个角度方向的角度方向直线上的最大频率点对长度
Figure 398695DEST_PATH_IMAGE010
作为周期列长度;Get the angular direction with the highest probability of period length
Figure 263621DEST_PATH_IMAGE007
As the extension direction of the cycle, get the row with the highest probability of cycle length
Figure 790417DEST_PATH_IMAGE008
As the cycle start point, choose from
Figure 787192DEST_PATH_IMAGE008
the first
Figure 875496DEST_PATH_IMAGE007
The maximum frequency point pair length of a straight line in an angular direction
Figure 957722DEST_PATH_IMAGE009
is the period line length, which will be perpendicular to the
Figure 22629DEST_PATH_IMAGE008
the first
Figure 640955DEST_PATH_IMAGE007
The maximum frequency point pair length on the angular direction straight line in each angular direction
Figure 398695DEST_PATH_IMAGE010
as the period column length;

根据周期始点、周期长度和周期延申方向获取布匹中滑窗的初始位置

Figure 233796DEST_PATH_IMAGE011
,滑窗尺寸为
Figure 72701DEST_PATH_IMAGE012
,滑窗的滑动方向为
Figure 44069DEST_PATH_IMAGE013
方向,滑窗的滑动步长为
Figure 972710DEST_PATH_IMAGE014
。Obtain the initial position of the sliding window in the cloth according to the cycle start point, cycle length and cycle extension direction
Figure 233796DEST_PATH_IMAGE011
, the sliding window size is
Figure 72701DEST_PATH_IMAGE012
, the sliding direction of the sliding window is
Figure 44069DEST_PATH_IMAGE013
direction, the sliding step size of the sliding window is
Figure 972710DEST_PATH_IMAGE014
.

进一步的,一种纺织品表面缺陷的检测方法,获取对应两个滑窗图像的交集频率值的方法为:Further, in a method for detecting surface defects of textiles, the method for obtaining the intersection frequency value corresponding to two sliding window images is:

对各个滑窗图像进行傅里叶变化得到对应滑窗图像的频域空间图像,将任意两两滑窗的频域空间进行交集处理,得到对应两个滑窗图像的交集频率值。Fourier transform is performed on each sliding window image to obtain the frequency domain space image of the corresponding sliding window image, and the frequency domain space of any pair of sliding windows is intersected to obtain the intersection frequency value corresponding to the two sliding window images.

进一步的,一种纺织品表面缺陷的检测方法,每一个滑窗图像对应的所有滤波图像中每个像素点的对比度值包括:Further, in a method for detecting surface defects of textiles, the contrast value of each pixel in all filtered images corresponding to each sliding window image includes:

通过8邻域像素计算每个滑窗中各个像素点的对比度值,获取所有对比度值大于第一阈值

Figure 525133DEST_PATH_IMAGE015
的像素点,将所述对比度大于第一阈值的像素点作为高对比度像素点。Calculate the contrast value of each pixel in each sliding window through 8 neighbor pixels, and obtain all contrast values greater than the first threshold
Figure 525133DEST_PATH_IMAGE015
The pixels with the contrast greater than the first threshold are regarded as high-contrast pixels.

进一步的,一种纺织品表面缺陷的检测方法,根据每个滑窗中高对比度像素点的个数计算对应每个滑窗的缺陷概率,表达式为:Further, a method for detecting surface defects of textiles calculates the defect probability corresponding to each sliding window according to the number of high-contrast pixel points in each sliding window, and the expression is:

Figure 197423DEST_PATH_IMAGE016
Figure 197423DEST_PATH_IMAGE016

其中,

Figure DEST_PATH_IMAGE017
表示利用第i个滑窗和第j个滑窗的频率交集对第i个滑窗的滤波后的滑窗图像内的第e个高对比度像素8邻域内高对比度像素个数,
Figure 118237DEST_PATH_IMAGE018
表示该滑窗内高对比度像素的总个数,
Figure 483359DEST_PATH_IMAGE019
表示利用第i个滑窗和第j个滑窗的频率交集对第i个滑窗的滤波后的滑窗图像的缺陷概率。in,
Figure DEST_PATH_IMAGE017
Represents the number of high-contrast pixels in the neighborhood of the e-th high-contrast pixel 8 in the filtered sliding-window image of the i-th sliding window using the frequency intersection of the i-th sliding window and the j-th sliding window,
Figure 118237DEST_PATH_IMAGE018
represents the total number of high-contrast pixels in the sliding window,
Figure 483359DEST_PATH_IMAGE019
Represents the defect probability of the filtered sliding window image of the ith sliding window using the frequency intersection of the ith sliding window and the jth sliding window.

进一步的,一种纺织品表面缺陷的检测方法,计算对应每个滑窗的缺陷概率之后,还包括:Further, a method for detecting surface defects of textiles, after calculating the defect probability corresponding to each sliding window, further includes:

根据第i个滑窗和每个滑窗的频率交集对第i个滑窗的滤波后的滑窗缺陷概率计算第i个滑窗的综合缺陷概率,表达式为:According to the frequency intersection of the ith sliding window and each sliding window, the comprehensive defect probability of the ith sliding window is calculated on the filtered sliding window defect probability of the ith sliding window, and the expression is:

Figure 856834DEST_PATH_IMAGE020
Figure 856834DEST_PATH_IMAGE020

其中,

Figure 332815DEST_PATH_IMAGE021
表示利用第i个与第j个滑窗交集对第i个滑窗滤波后的滑窗图像的缺陷概率,
Figure 13195DEST_PATH_IMAGE022
表示利用第i个与第k个滑窗的频率交集对第k个滑窗的滤波得到滤波后滑窗图像的缺陷概率,Q表示滑窗的个数,
Figure 785104DEST_PATH_IMAGE023
表示第i个滑窗的综合缺陷概率。in,
Figure 332815DEST_PATH_IMAGE021
represents the defect probability of the sliding window image filtered by the ith sliding window using the intersection of the ith and the jth sliding window,
Figure 13195DEST_PATH_IMAGE022
Represents the defect probability of the filtered sliding window image obtained by filtering the k-th sliding window by the frequency intersection of the i-th and the k-th sliding window, Q represents the number of sliding windows,
Figure 785104DEST_PATH_IMAGE023
Represents the comprehensive defect probability of the i-th sliding window.

一种纺织品表面缺陷的检测系统,包括图像预处理单元、第一计算单元、第二计算单元、第三计算单元、第四计算单元以及缺陷检测单元;A detection system for textile surface defects, comprising an image preprocessing unit, a first calculation unit, a second calculation unit, a third calculation unit, a fourth calculation unit and a defect detection unit;

图像预处理单元,用于获取纺织品表面灰度图像,并对所述灰度图像进行预处理获得梯度图像;an image preprocessing unit, configured to obtain a grayscale image of the surface of the textile, and preprocess the grayscale image to obtain a gradient image;

第一计算单元,用于获取梯度图像中每一个像素点在每个方向上两两像素点形成的点对,利用各个方向上最大频率点对所对应的点对长度计算所述灰度图像每个方向的点对周期长度概率;The first calculation unit is used to obtain the point pairs formed by each pixel in each direction in each direction in the gradient image, and use the point pair length corresponding to the maximum frequency point pair in each direction to calculate each point pair in the grayscale image. point-to-period length probability in each direction;

第二计算单元,用于将所有点对得到的周期长度概率最大值所对应的方向作为周期的延申方向,获取周期延申方向上的周期长度,根据所述周期长度以及周期延申方向设置滑窗参数;The second calculation unit is configured to use the direction corresponding to the maximum value of the cycle length probability obtained by all point pairs as the extension direction of the cycle, obtain the cycle length in the cycle extension direction, and set the cycle length according to the cycle length and the cycle extension direction. Sliding window parameters;

第三计算单元,用于利用设定参数的窗口对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,根据两两滑窗的频域空间交集得到对应两个滑窗图像的交集频率值;The third computing unit is configured to perform sliding window on the grayscale image by using the window of the set parameter, obtain the frequency domain space image of each sliding window image, and obtain the corresponding two sliding windows according to the frequency domain space intersection of the two sliding windows. The intersection frequency value of the image;

第四计算单元,用于利用每一个滑窗图像与其它滑窗图像的交集频率值分别对该滑窗图像进行滤波处理获得该滑窗图像在不同交集频率值滤波处理后的滤波图像;The 4th calculation unit, is used for utilizing the intersection frequency value of each sliding window image and other sliding window images to carry out filtering processing to this sliding window image respectively to obtain the filtered image of this sliding window image after filtering processing of different intersection frequency values;

缺陷检测单元,用于利用每一个滑窗图像对应的所有滤波图像中每个像素点的对比度值,计算该滑窗图像的缺陷概率,根据所述缺陷概率判断该滑窗图像是否存在缺陷。The defect detection unit is configured to use the contrast value of each pixel in all the filtered images corresponding to each sliding window image to calculate the defect probability of the sliding window image, and judge whether the sliding window image has defects according to the defect probability.

本发明的有益效果是:根据本发明提出的技术手段,通过分析图像中的点对纹理信息得到纺织品的纹理周期信息,利用周期信息设置滑窗参数,从而进行进一步的滤波处理,能够克服纺织品自身印花纹理的干扰,精确的定位出缺陷区域,从而有效提升了检测效率和生产质量。The beneficial effects of the present invention are: according to the technical means proposed by the present invention, the texture period information of the textile is obtained by analyzing the point-to-texture information in the image, and the sliding window parameters are set by using the period information, so as to perform further filtering processing, which can overcome the textile itself. The interference of the printing texture can accurately locate the defective area, thereby effectively improving the detection efficiency and production quality.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1为本发明实施例的一种纺织品表面缺陷检测方法结构示意图;1 is a schematic structural diagram of a method for detecting surface defects of textiles according to an embodiment of the present invention;

图2为本发明实施例的另一种纺织品表面缺陷检测方法结构示意图;2 is a schematic structural diagram of another textile surface defect detection method according to an embodiment of the present invention;

图3为本发明实施例的一种纺织品表面缺陷检测系统流程示意图。FIG. 3 is a schematic flowchart of a textile surface defect detection system according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

实施例1Example 1

如图1所示,给出了本发明实施例的一种纺织品表面缺陷检测方法及系统结构示意图,包括:As shown in FIG. 1, a schematic diagram of a textile surface defect detection method and a system structure according to an embodiment of the present invention is given, including:

101.获取纺织品表面灰度图像,并对所述灰度图像进行预处理。101. Acquire a grayscale image of the textile surface, and preprocess the grayscale image.

本实施例所针对的情景为:在纹理周期性相同(注:颜色周期可能不同)的布匹生产线上方设置相机,当布匹运行至该相机下侧时,采集布匹图片,通过处理布匹图片来实现布匹的经纬线的断裂现象。The scenario for this embodiment is: a camera is set above the cloth production line with the same texture periodicity (note: the color period may be different), when the cloth runs to the lower side of the camera, the cloth picture is collected, and the cloth picture is processed by processing the cloth picture. The breakage of the latitude and longitude lines.

将采集的图像从RGB颜色空间转化为灰度化图像,对灰度图像预处理的操作包括:Convert the collected image from the RGB color space to a grayscale image, and the preprocessing operations for the grayscale image include:

为了获取布匹印花纹理的周期性信息,防止布匹经纬线纹理的干扰,需要利用低通滤波器把布匹经纬线纹理去除,利用sober算子处理滤波图像得到梯度图像。In order to obtain the periodic information of the cloth printing texture and prevent the interference of the warp and weft texture of the cloth, it is necessary to use a low-pass filter to remove the warp and weft texture of the cloth, and use the sober operator to process the filtered image to obtain a gradient image.

102.获取所述灰度图像中每个方向的点对,根据各个方向上最大频率点对长度计算所述灰度图像每个方向的点对周期长度概率。102. Acquire a point pair in each direction in the grayscale image, and calculate a point pair period length probability in each direction of the grayscale image according to the maximum frequency point pair length in each direction.

从第k行第一个非零梯度坐标点出发,在第

Figure 550935DEST_PATH_IMAGE024
个角度方向上,将同梯度值的像素组成一个点对,将该点对记作
Figure 565027DEST_PATH_IMAGE025
,
Figure 884536DEST_PATH_IMAGE026
分别表示该点对的起始位置和终止位置。Starting from the first non-zero gradient coordinate point in the kth row, in the kth row
Figure 550935DEST_PATH_IMAGE024
In each angular direction, the pixels with the same gradient value form a point pair, and the point pair is recorded as
Figure 565027DEST_PATH_IMAGE025
,
Figure 884536DEST_PATH_IMAGE026
represent the start and end positions of the point pair, respectively.

需要说明的是,一个像素可以具有多个点对。例如在作为

Figure 591461DEST_PATH_IMAGE027
处梯度角度值为23度,在该像素
Figure 844587DEST_PATH_IMAGE024
方向上还有6个像素具有23梯度角度,因而从坐标
Figure 898256DEST_PATH_IMAGE027
处出发的点对个数为7。It should be noted that a pixel can have multiple point pairs. For example as
Figure 591461DEST_PATH_IMAGE027
The gradient angle value is 23 degrees at this pixel
Figure 844587DEST_PATH_IMAGE024
There are also 6 pixels in the direction with 23 gradient angles, so from the coordinates
Figure 898256DEST_PATH_IMAGE027
The number of starting point pairs is 7.

统计第k行的第

Figure 287649DEST_PATH_IMAGE028
角度方向的点对长度:统计第k行的第s角度方向的各点对长度的点对频率,获取最大频率对应的点对长度
Figure 634317DEST_PATH_IMAGE029
。类比该方式得到第s角度方向上其余行的最大频率点对长度。Count the kth row
Figure 287649DEST_PATH_IMAGE028
Point-to-point length in the angular direction: Count the point-to-frequency of each point-to-length in the s-th angular direction of the k-th row, and obtain the point-to-point length corresponding to the maximum frequency
Figure 634317DEST_PATH_IMAGE029
. By analogy with this method, the maximum frequency point pair lengths of the remaining rows in the s-th angle direction are obtained.

获取垂直于从第k行出发的第s个角度的角度方向,类比第k行的第s个角度方向点对长度求解方法得到该方向的频率最高的点对长度

Figure 141784DEST_PATH_IMAGE030
。Obtain the angular direction perpendicular to the s-th angle from the k-th line, and obtain the point-to-length with the highest frequency in this direction by analogy with the s-th angle direction point-to-length solution method in the k-th line
Figure 141784DEST_PATH_IMAGE030
.

103.将点对周期长度概率最大值对应的方向作为周期的延申方向,获取周期延伸方向上的周期长度,根据所述周期长度以及周期延申方向设置滑窗参数。103. Take the direction corresponding to the maximum value of the point-to-period length probability as the extension direction of the period, obtain the period length in the period extension direction, and set the sliding window parameters according to the period length and the period extension direction.

选取周期长度概率最大的角度方向

Figure 497679DEST_PATH_IMAGE031
作为周期的延申方向,选取该方向上周期长度概率最大的行
Figure 7158DEST_PATH_IMAGE032
作为周期始点,选取从
Figure 26192DEST_PATH_IMAGE032
行出发的第
Figure 253911DEST_PATH_IMAGE031
个角度方向直线的点对长度
Figure 147917DEST_PATH_IMAGE033
为周期行长度,选取垂直于从第
Figure 273087DEST_PATH_IMAGE032
行出发的第
Figure 961558DEST_PATH_IMAGE031
个角度方向的角度方向直线上的点对长度
Figure 676573DEST_PATH_IMAGE034
作为列点对长度。Select the angular direction with the greatest probability of period length
Figure 497679DEST_PATH_IMAGE031
As the extension direction of the cycle, select the row with the largest cycle length probability in this direction
Figure 7158DEST_PATH_IMAGE032
As the cycle start point, choose from
Figure 26192DEST_PATH_IMAGE032
the first
Figure 253911DEST_PATH_IMAGE031
point-to-point length of a straight line in an angular direction
Figure 147917DEST_PATH_IMAGE033
is the period line length, choose perpendicular to the
Figure 273087DEST_PATH_IMAGE032
the first
Figure 961558DEST_PATH_IMAGE031
point pair length on the angular direction straight line in an angular direction
Figure 676573DEST_PATH_IMAGE034
as column point pair length.

由于布匹的纹理呈现周期性变化,因而需要根据周期参数设置滑窗参数。Since the texture of the cloth changes periodically, the sliding window parameters need to be set according to the period parameters.

104.对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,根据两两滑窗的频域空间交集得到对应两个滑窗图像的交集频率值。104. Perform a sliding window on the grayscale image, obtain the frequency domain space image of each sliding window image, and obtain the intersection frequency value of the corresponding two sliding window images according to the frequency domain space intersection of the two sliding windows.

将各滑窗图像进行傅里叶变化得到频域空间图像,将任意两两滑窗的频域空间进行交集集处理得到两图像的交集频率值集合,利用交集频率集合对对应两个滑窗图像分别进行滤波处理得到滤波后图像。Fourier transform each sliding window image to obtain a frequency domain space image, and perform intersection processing on the frequency domain space of any pair of sliding windows to obtain the intersection frequency value set of the two images, and use the intersection frequency set to correspond to the two sliding window images. Perform filtering respectively to obtain filtered images.

通过该方式即可得到基于滑窗的其余滑窗滤波图像。In this way, the remaining sliding window filtering images based on the sliding window can be obtained.

105.根据所述交集频率值对每个滑窗图像进行滤波处理,计算滤波处理后的各个滑窗内每个像素点的对比度值,获取每个滑窗中对比度值大于第一阈值的像素点作为高对比度像素点。105. Perform filtering processing on each sliding window image according to the intersection frequency value, calculate the contrast value of each pixel in each sliding window after filtering, and obtain the pixel whose contrast value is greater than the first threshold in each sliding window. as high-contrast pixels.

通过8邻域像素计算出各像素的对比度值,通过对比度值分割出可能缺陷区域,即对比度大于设定阈值

Figure 875735DEST_PATH_IMAGE035
的像素集合。The contrast value of each pixel is calculated by 8 neighboring pixels, and the possible defect area is segmented by the contrast value, that is, the contrast is greater than the set threshold
Figure 875735DEST_PATH_IMAGE035
pixel collection.

106.根据每个滑窗中高对比度像素点的个数计算对应每个滑窗的缺陷概率,根据所述缺陷概率判断对应滑窗图像是否存在缺陷。106. Calculate the defect probability corresponding to each sliding window according to the number of high-contrast pixel points in each sliding window, and judge whether the corresponding sliding window image has defects according to the defect probability.

由于每个滑窗内包含完整的单周期印花图案,因而有过不存在缺陷滤波后的图像较为平滑。在存在缺陷时,缺陷区域存在一些纹理信息,其他区域的纹理信息较少,较为平滑,因而基于该特征来评估各滑窗内缺陷概率。Since each sliding window contains a complete single-cycle printing pattern, the filtered image with no defects is smoother. When there is a defect, there is some texture information in the defect area, and the texture information in other areas is less and smoother, so the defect probability in each sliding window is evaluated based on this feature.

为了防止单个窗口评估印刷缺陷的精度低的问题,因而需再结合滑窗集合的滤波效果来综合评估各滑窗的综合缺陷概率。In order to prevent the problem of low accuracy in evaluating printing defects by a single window, it is necessary to comprehensively evaluate the comprehensive defect probability of each sliding window in combination with the filtering effect of the sliding window set.

通过缺陷概率筛选出可能存在缺陷滑窗,当滑窗的缺陷概率

Figure 94227DEST_PATH_IMAGE036
时认为该滑窗存在缺陷。The possible defect sliding window is screened out by the defect probability, when the defect probability of the sliding window
Figure 94227DEST_PATH_IMAGE036
The sliding window is considered defective.

根据本发明提出的技术手段,通过分析图像中的点对纹理信息得到纺织品的纹理周期信息,利用周期信息设置滑窗参数,从而进行进一步的滤波处理,能够克服纺织品自身印花纹理的干扰,精确的定位出缺陷区域,从而有效提升了检测效率和生产质量。According to the technical means proposed in the present invention, the texture period information of the textile is obtained by analyzing the point-to-texture information in the image, and the sliding window parameters are set by using the period information, so as to perform further filtering processing, which can overcome the interference of the printing texture of the textile itself, and accurately Defective areas are located, thereby effectively improving inspection efficiency and production quality.

实施例2Example 2

如图2所示,给出了本发明实施例另一种纺织品表面缺陷检测方法及系统,包括:As shown in FIG. 2 , another method and system for detecting surface defects of textiles according to an embodiment of the present invention is provided, including:

201.获取纺织品表面灰度图像,并对所述灰度图像进行预处理。201. Acquire a grayscale image of a textile surface, and preprocess the grayscale image.

本实施例需要根据采集的布匹图像来实现布匹的缺陷检测,所以需要先采集布匹图像,分割出布匹区域。In this embodiment, the defect detection of the cloth needs to be realized according to the collected cloth image, so the cloth image needs to be collected first to segment the cloth area.

在纺织品生产线正上方设置相机,相机每间隔一段时间拍摄一张图片,相机的间隔时间可以根据相机视角宽度和生产线运行速度来设置。A camera is set right above the textile production line, and the camera takes a picture at intervals. The interval time of the camera can be set according to the width of the camera's viewing angle and the running speed of the production line.

将采集的图像从RGB颜色空间转化为灰度化图像。Convert the acquired image from the RGB color space to a grayscale image.

纺织品的花式各式各样,为了让系统能够使用与各种情况,增强其泛化能力,所以本发明采用DNN语义分割的方式来识别分割图像中的布匹区域。There are various styles of textiles. In order to enable the system to be used in various situations and enhance its generalization ability, the present invention adopts the DNN semantic segmentation method to identify the cloth area in the segmented image.

该DNN网络的相关内容如下:The relevant content of the DNN network is as follows:

使用的数据集为俯视采集的纺织品图像数据集。The dataset used is a textile image dataset collected from overhead.

需要分割的像素,共分为两类,即训练集对应标签标注过程为:单通道的语义标签,对应位置像素属于背景类的标注为0,属于布匹的标注为1。The pixels that need to be segmented are divided into two categories, that is, the corresponding label labeling process of the training set is: single-channel semantic label, the label of the corresponding position pixel belonging to the background class is 0, and the label belonging to the cloth is 1.

网络的任务是分类,所以使用的loss函数为交叉熵损失函数。The task of the network is to classify, so the loss function used is the cross entropy loss function.

为了获取布匹印花纹理的周期性信息,防止布匹经纬线纹理的干扰,需要利用低通滤波器把布匹经纬线纹理去除。In order to obtain the periodic information of the cloth printing texture and prevent the interference of the cloth warp and weft texture, it is necessary to use a low-pass filter to remove the cloth warp and weft texture.

利用尺度为

Figure 219178DEST_PATH_IMAGE037
的高斯滤波器对布匹灰度图像
Figure 155910DEST_PATH_IMAGE038
进行滤波处理,得到处理后图片
Figure 814555DEST_PATH_IMAGE039
。The scale used is
Figure 219178DEST_PATH_IMAGE037
Gaussian filter for cloth grayscale images
Figure 155910DEST_PATH_IMAGE038
Perform filtering to get the processed image
Figure 814555DEST_PATH_IMAGE039
.

利用sober算子处理图像

Figure 389018DEST_PATH_IMAGE040
得到梯度图像
Figure 419291DEST_PATH_IMAGE041
.Image processing with sober operator
Figure 389018DEST_PATH_IMAGE040
get gradient image
Figure 419291DEST_PATH_IMAGE041
.

202.获取所述灰度图像中每个方向的点对,根据各个方向上最大频率点对长度计算所述灰度图像每个方向的点对周期长度概率。202. Acquire a point pair in each direction in the grayscale image, and calculate a point pair period length probability in each direction of the grayscale image according to the maximum frequency point pair length in each direction.

以水平向右为0度角度方向集合,以1为角度间隔,得到360个角度方向集合。Taking the horizontal to the right as the 0 degree angle direction set, and taking 1 as the angle interval, 360 angle direction sets are obtained.

从第k行第一个非零梯度坐标点出发,在第

Figure 843319DEST_PATH_IMAGE024
个角度方向上,将同梯度值的像素组成一个点对,将该点对记作
Figure 378425DEST_PATH_IMAGE025
,
Figure 571509DEST_PATH_IMAGE026
分别表示该点对的起始位置和终止位置。注:一个像素可以具有多个点对。例如在作为
Figure 772683DEST_PATH_IMAGE027
处梯度角度值为23度,在该像素
Figure 684007DEST_PATH_IMAGE024
方向上还有6个像素具有23梯度角度,因而从坐标
Figure 763084DEST_PATH_IMAGE027
处出发的点对个数为7。通过该方式得到点对集合
Figure 76254DEST_PATH_IMAGE042
。Starting from the first non-zero gradient coordinate point in the kth row, in the kth row
Figure 843319DEST_PATH_IMAGE024
In each angular direction, the pixels with the same gradient value form a point pair, and the point pair is recorded as
Figure 378425DEST_PATH_IMAGE025
,
Figure 571509DEST_PATH_IMAGE026
represent the start and end positions of the point pair, respectively. Note: A pixel can have multiple point pairs. For example as
Figure 772683DEST_PATH_IMAGE027
The gradient angle value is 23 degrees at this pixel
Figure 684007DEST_PATH_IMAGE024
There are also 6 pixels in the direction with 23 gradient angles, so from the coordinates
Figure 763084DEST_PATH_IMAGE027
The number of starting point pairs is 7. Get the set of point pairs in this way
Figure 76254DEST_PATH_IMAGE042
.

类比该方式得到其余行的第s角度方向上的点对。By analogy with this method, the point pairs in the s-th angle direction of the remaining rows are obtained.

统计第k行的第

Figure 713908DEST_PATH_IMAGE028
角度方向的点对长度:统计第k行的第s角度方向的各点对长度的点对频率,获取最大频率对应的点对长度
Figure 879573DEST_PATH_IMAGE029
。类比该方式得到第s角度方向上其余行的最大频率点对长度。Count the kth row
Figure 713908DEST_PATH_IMAGE028
Point-to-point length in the angular direction: Count the point-to-frequency of each point-to-length in the s-th angular direction of the k-th row, and obtain the point-to-point length corresponding to the maximum frequency
Figure 879573DEST_PATH_IMAGE029
. By analogy with this method, the maximum frequency point pair lengths of the remaining rows in the s-th angle direction are obtained.

计算垂直从k行出发的第s个角度的角度方向得到列点对长度:获取垂直于从第k行出发的第s个角度的角度方向,类比第k行的第s个角度方向点对长度求解方法得到该方向的频率最高的点对长度

Figure 260875DEST_PATH_IMAGE030
。Calculate the angle direction perpendicular to the s-th angle starting from the k-th row to get the length of the column point pair: Get the angle direction perpendicular to the s-th angle starting from the k-th row, analogous to the s-th angle direction point pair length from the k-th row The solution method obtains the length of the point pair with the highest frequency in this direction
Figure 260875DEST_PATH_IMAGE030
.

计算所述灰度图像每个方向的点对周期长度概率的方法如下:The method for calculating the point-to-period length probability of each direction of the grayscale image is as follows:

利用起始点与终止点之间的欧氏距离计算所述灰度图像中第k行点对在每个方向上的点对长度,获取第s个方向上最大频率对应的行点对长度

Figure 428552DEST_PATH_IMAGE001
;Use the Euclidean distance between the starting point and the ending point to calculate the point pair length of the kth row point pair in each direction in the grayscale image, and obtain the row point pair length corresponding to the maximum frequency in the sth direction
Figure 428552DEST_PATH_IMAGE001
;

同理,计算从第k行出发与第s个方向垂直方向上的所有点对长度得到列点对长度,获取每个方向上频率最大的列点对长度

Figure 472993DEST_PATH_IMAGE002
;In the same way, calculate the length of all point pairs in the vertical direction starting from the kth row and the sth direction to obtain the length of the column point pair, and obtain the length of the column point pair with the largest frequency in each direction.
Figure 472993DEST_PATH_IMAGE002
;

计算第s个方向的周期长度概率的表达式为:The expression for calculating the cycle length probability in the s-th direction is:

Figure 93330DEST_PATH_IMAGE043
Figure 93330DEST_PATH_IMAGE043

其中,

Figure 12745DEST_PATH_IMAGE004
表示从第k行出发垂直于第s个角度方向上频率最大的列点对长度,
Figure 34928DEST_PATH_IMAGE005
从第k行点对出发的第s个角度方向为第一行,平行向下i行的点对在第s个方向上的最大频率点对长度,
Figure 775570DEST_PATH_IMAGE001
表示第k行点对在第s个方向上的最大频率点对长度,N表示共有N行点对,
Figure 883203DEST_PATH_IMAGE006
表示所述灰度图像第s个方向上的点对周期长度概率。in,
Figure 12745DEST_PATH_IMAGE004
Indicates the length of the column point pair with the largest frequency in the direction perpendicular to the s-th angle starting from the k-th row,
Figure 34928DEST_PATH_IMAGE005
The s-th angular direction starting from the point pair in the k-th row is the first row, and the maximum frequency point pair length in the s-th direction of the point pair in the i-row parallel to the downward direction,
Figure 775570DEST_PATH_IMAGE001
Indicates the maximum frequency point pair length of the k-th row point pair in the s-th direction, and N represents a total of N rows of point pairs,
Figure 883203DEST_PATH_IMAGE006
represents the point-to-period length probability in the s-th direction of the grayscale image.

203.将点对周期长度概率最大值对应的方向作为周期的延申方向,获取周期延伸方向上的周期长度,根据所述周期长度以及周期延申方向设置滑窗参数。203. Use the direction corresponding to the maximum value of the point-to-period length probability as the extension direction of the period, obtain the period length in the period extension direction, and set the sliding window parameters according to the period length and the period extension direction.

根据所述周期长度以及周期延申方向设置滑窗参数的方法如下:The method for setting the sliding window parameters according to the period length and the period extension direction is as follows:

获取周期长度概率最大的角度方向

Figure 606308DEST_PATH_IMAGE007
作为周期的延申方向,获取周期长度概率最大的行
Figure 984462DEST_PATH_IMAGE008
作为周期始点,选取从
Figure 400400DEST_PATH_IMAGE008
行出发的第
Figure 995329DEST_PATH_IMAGE007
个角度方向直线的最大频率点对长度
Figure 758011DEST_PATH_IMAGE009
为周期行长度,将垂直于从第
Figure 489207DEST_PATH_IMAGE008
行出发的第
Figure 76046DEST_PATH_IMAGE007
个角度方向的角度方向直线上的最大频率点对长度
Figure 659736DEST_PATH_IMAGE010
作为周期列长度;Get the angular direction with the highest probability of period length
Figure 606308DEST_PATH_IMAGE007
As the extension direction of the cycle, get the row with the highest probability of cycle length
Figure 984462DEST_PATH_IMAGE008
As the cycle start point, choose from
Figure 400400DEST_PATH_IMAGE008
the first
Figure 995329DEST_PATH_IMAGE007
The maximum frequency point pair length of a straight line in an angular direction
Figure 758011DEST_PATH_IMAGE009
is the period line length, which will be perpendicular to the
Figure 489207DEST_PATH_IMAGE008
the first
Figure 76046DEST_PATH_IMAGE007
The maximum frequency point pair length on the angular direction straight line in each angular direction
Figure 659736DEST_PATH_IMAGE010
as the period column length;

根据周期始点、周期长度和周期延申方向获取布匹中滑窗的初始位置

Figure 724644DEST_PATH_IMAGE011
,滑窗尺寸为
Figure 310347DEST_PATH_IMAGE012
,滑窗的滑动方向为
Figure 68087DEST_PATH_IMAGE013
方向,滑窗的滑动步长为
Figure 156652DEST_PATH_IMAGE014
。Obtain the initial position of the sliding window in the cloth according to the cycle start point, cycle length and cycle extension direction
Figure 724644DEST_PATH_IMAGE011
, the sliding window size is
Figure 310347DEST_PATH_IMAGE012
, the sliding direction of the sliding window is
Figure 68087DEST_PATH_IMAGE013
direction, the sliding step size of the sliding window is
Figure 156652DEST_PATH_IMAGE014
.

2041.对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,根据两两滑窗的频域空间交集得到对应两个滑窗图像的交集频率值。2041. Perform a sliding window on the grayscale image, obtain the frequency domain space image of each sliding window image, and obtain the intersection frequency value of the corresponding two sliding window images according to the frequency domain space intersection of the two sliding windows.

获取对应两个滑窗图像的交集频率值的方法为:The method to obtain the intersection frequency value corresponding to two sliding window images is as follows:

对各个滑窗图像进行傅里叶变化得到对应滑窗图像的频域空间图像,将任意两两滑窗的频域空间进行交集处理,得到对应两个滑窗图像的交集频率值。Fourier transform is performed on each sliding window image to obtain the frequency domain space image of the corresponding sliding window image, and the frequency domain space of any pair of sliding windows is intersected to obtain the intersection frequency value corresponding to the two sliding window images.

2042.根据所述交集频率值对每个滑窗图像进行滤波处理,计算滤波处理后的各个滑窗内每个像素点的对比度值,获取每个滑窗中对比度值大于第一阈值的像素点作为高对比度像素点。2042. Perform filtering processing on each sliding window image according to the intersection frequency value, calculate the contrast value of each pixel in each sliding window after the filtering processing, and obtain pixels whose contrast value is greater than the first threshold in each sliding window as high-contrast pixels.

获取每个滑窗中对比度值大于第一阈值的像素点作为高对比度像素点的方法为:The method for obtaining the pixels whose contrast value is greater than the first threshold in each sliding window as high-contrast pixels is:

通过8邻域像素计算每个滑窗中各个像素点的对比度值,获取所有对比度值大于第一阈值

Figure 25250DEST_PATH_IMAGE015
的像素点,将所述对比度大于第一阈值的像素点作为高对比度像素点。Calculate the contrast value of each pixel in each sliding window through 8 neighbor pixels, and obtain all contrast values greater than the first threshold
Figure 25250DEST_PATH_IMAGE015
The pixels with the contrast greater than the first threshold are regarded as high-contrast pixels.

2043.根据每个滑窗中高对比度像素点的个数计算对应每个滑窗的缺陷概率,根据所述缺陷概率判断对应滑窗图像是否存在缺陷。2043. Calculate the defect probability corresponding to each sliding window according to the number of high-contrast pixel points in each sliding window, and determine whether the corresponding sliding window image has defects according to the defect probability.

由于每个滑窗内包含完整的单周期印花图案,因而有过不存在缺陷滤波后的图像较为平滑。在存在缺陷时,缺陷区域存在一些纹理信息,其他区域的纹理信息较少,较为平滑,因而基于该特征来评估各滑窗内缺陷概率。Since each sliding window contains a complete single-cycle printing pattern, the filtered image with no defects is smoother. When there is a defect, there is some texture information in the defect area, and the texture information in other areas is less and smoother, so the defect probability in each sliding window is evaluated based on this feature.

根据每个滑窗中高对比度像素点的个数计算对应每个滑窗的缺陷概率,表达式为:Calculate the defect probability corresponding to each sliding window according to the number of high-contrast pixels in each sliding window, and the expression is:

Figure 996617DEST_PATH_IMAGE044
Figure 996617DEST_PATH_IMAGE044

其中,

Figure 161145DEST_PATH_IMAGE017
表示利用第i个滑窗和第j个滑窗的频率交集对第i个滑窗的滤波后的滑窗图像内的第e个高对比度像素8邻域内高对比度像素个数,
Figure 217963DEST_PATH_IMAGE018
表示该滑窗内高对比度像素的总个数,
Figure 624673DEST_PATH_IMAGE019
表示利用第i个滑窗和第j个滑窗的频率交集对第i个滑窗的滤波后的滑窗图像的缺陷概率,
Figure 952012DEST_PATH_IMAGE045
表示利用第i个与第j个滑窗的频率交集对第i个滑窗滤波得到的滤波后滑窗图像中的缺陷概率值,该值越大说明该滑窗内纹理区域集中分布,因而也说明该滑窗内存在缺陷的概率较大。in,
Figure 161145DEST_PATH_IMAGE017
Represents the number of high-contrast pixels in the neighborhood of the e-th high-contrast pixel 8 in the filtered sliding-window image of the i-th sliding window using the frequency intersection of the i-th sliding window and the j-th sliding window,
Figure 217963DEST_PATH_IMAGE018
represents the total number of high-contrast pixels in the sliding window,
Figure 624673DEST_PATH_IMAGE019
represents the defect probability of the filtered sliding window image of the ith sliding window using the frequency intersection of the ith sliding window and the jth sliding window,
Figure 952012DEST_PATH_IMAGE045
Indicates the defect probability value in the filtered sliding window image obtained by filtering the i-th sliding window using the frequency intersection of the i-th and the j-th sliding window. It shows that there is a high probability of defects in the sliding window.

为了防止单个窗口评估印刷缺陷的精度低的问题,因而需再结合滑窗集合的滤波效果来综合评估各滑窗的综合缺陷概率,计算对应每个滑窗的缺陷概率之后,还包括:In order to prevent the problem of low accuracy in evaluating printing defects in a single window, it is necessary to combine the filtering effect of the sliding window set to comprehensively evaluate the comprehensive defect probability of each sliding window. After calculating the defect probability corresponding to each sliding window, it also includes:

根据第i个滑窗和每个滑窗的频率交集对第i个滑窗的滤波后的滑窗缺陷概率计算第i个滑窗的综合缺陷概率,表达式为:According to the frequency intersection of the ith sliding window and each sliding window, the comprehensive defect probability of the ith sliding window is calculated on the filtered sliding window defect probability of the ith sliding window, and the expression is:

Figure 51555DEST_PATH_IMAGE046
Figure 51555DEST_PATH_IMAGE046

其中,

Figure 861248DEST_PATH_IMAGE021
表示利用第i个与第j个滑窗交集对第i个滑窗滤波后的滑窗图像的缺陷概率,
Figure 838693DEST_PATH_IMAGE022
表示利用第i个与第k个滑窗的频率交集对第k个滑窗的得到滤波后滑窗图像的缺陷概率,Q表示滑窗的个数,
Figure 784652DEST_PATH_IMAGE023
表示第i个滑窗的综合缺陷概率,当第i个滑窗的存在缺陷时,该滑窗与其他滑窗存在较大的频域差异,因而利用其余滑窗与该滑窗交集对该滑窗进行滤波后就会将缺陷区域暴漏出来,因而滤波后滑窗内缺陷概率较大,
Figure 55097DEST_PATH_IMAGE047
表示滤波后第i个滑窗的缺陷概率均值,该值越大,说明第i个滑窗区域存在缺陷的概率越大,
Figure 582112DEST_PATH_IMAGE022
表示利用第i个与第k个滑窗的频率交集对第k个滑窗的滤波得到滤波后滑窗图像的缺陷概率,该值越大,说明第i个滑窗图像由于缺陷导致部分频率丢失导致该滑窗与其他滑窗的存在一定的频率差异,因而通过频率交集滤波导致部分布匹本身纹理信息没有被滤波去除,因而会被误识为缺陷,其缺陷概率提高。
Figure 65046DEST_PATH_IMAGE023
表示第i个滑窗的缺陷概率。in,
Figure 861248DEST_PATH_IMAGE021
represents the defect probability of the sliding window image filtered by the ith sliding window using the intersection of the ith and the jth sliding window,
Figure 838693DEST_PATH_IMAGE022
Indicates the defect probability of the filtered sliding window image obtained by using the frequency intersection of the i-th and the k-th sliding window for the k-th sliding window, Q represents the number of sliding windows,
Figure 784652DEST_PATH_IMAGE023
Represents the comprehensive defect probability of the i-th sliding window. When the i-th sliding window has defects, there is a large frequency domain difference between this sliding window and other sliding windows, so the intersection of the remaining sliding windows and this sliding window is used for this sliding window. After the window is filtered, the defect area will be exposed, so the probability of defects in the sliding window after filtering is relatively large.
Figure 55097DEST_PATH_IMAGE047
Represents the mean value of the defect probability of the i-th sliding window after filtering. The larger the value, the greater the probability of defects in the i-th sliding window area.
Figure 582112DEST_PATH_IMAGE022
Indicates the defect probability of the filtered sliding window image obtained by filtering the k-th sliding window using the frequency intersection of the i-th and the k-th sliding window. As a result, there is a certain frequency difference between the sliding window and other sliding windows. Therefore, through frequency intersection filtering, the texture information of part of the cloth itself is not filtered and removed, so it will be mistakenly recognized as a defect, and its defect probability is increased.
Figure 65046DEST_PATH_IMAGE023
represents the defect probability of the i-th sliding window.

通过缺陷概率筛选出可能存在缺陷滑窗,当滑窗的缺陷概率

Figure 131091DEST_PATH_IMAGE036
时认为该滑窗存在缺陷,根据经验该阈值
Figure 73902DEST_PATH_IMAGE048
通常取0.7。The possible defect sliding window is screened out by the defect probability, when the defect probability of the sliding window
Figure 131091DEST_PATH_IMAGE036
When the sliding window is considered defective, according to experience, the threshold
Figure 73902DEST_PATH_IMAGE048
Usually 0.7 is taken.

该滑窗内高对比度像素区域即为缺陷区域。The high-contrast pixel area in the sliding window is the defect area.

如图3所示,公开了本实施例的一种纺织品表面缺陷的检测系统,包括图像预处理单元、第一计算单元、第二计算单元、第三计算单元、第四计算单元以及缺陷检测单元;As shown in FIG. 3 , a detection system for textile surface defects in this embodiment is disclosed, including an image preprocessing unit, a first calculation unit, a second calculation unit, a third calculation unit, a fourth calculation unit, and a defect detection unit ;

图像预处理单元,用于获取纺织品表面灰度图像,并对所述灰度图像进行预处理获得梯度图像;an image preprocessing unit, configured to obtain a grayscale image of the surface of the textile, and preprocess the grayscale image to obtain a gradient image;

第一计算单元,用于获取梯度图像中每一个像素点在每个方向上两两像素点形成的点对,利用各个方向上最大频率点对所对应的点对长度计算所述灰度图像每个方向的点对周期长度概率;The first calculation unit is used to obtain the point pairs formed by each pixel in each direction in each direction in the gradient image, and use the point pair length corresponding to the maximum frequency point pair in each direction to calculate each point pair in the grayscale image. point-to-period length probability in each direction;

第二计算单元,用于将所有点对得到的周期长度概率最大值所对应的方向作为周期的延申方向,获取周期延申方向上的周期长度,根据所述周期长度以及周期延申方向设置滑窗参数;The second calculation unit is configured to use the direction corresponding to the maximum value of the cycle length probability obtained by all point pairs as the extension direction of the cycle, obtain the cycle length in the cycle extension direction, and set the cycle length according to the cycle length and the cycle extension direction. Sliding window parameters;

第三计算单元,用于利用设定参数的窗口对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,根据两两滑窗的频域空间交集得到对应两个滑窗图像的交集频率值;The third computing unit is configured to perform sliding window on the grayscale image by using the window of the set parameter, obtain the frequency domain space image of each sliding window image, and obtain the corresponding two sliding windows according to the frequency domain space intersection of the two sliding windows. The intersection frequency value of the image;

第四计算单元,用于利用每一个滑窗图像与其它滑窗图像的交集频率值分别对该滑窗图像进行滤波处理获得该滑窗图像在不同交集频率值滤波处理后的滤波图像;The 4th calculation unit, is used for utilizing the intersection frequency value of each sliding window image and other sliding window images to carry out filtering processing to this sliding window image respectively to obtain the filtered image of this sliding window image after filtering processing of different intersection frequency values;

缺陷检测单元,用于利用每一个滑窗图像对应的所有滤波图像中每个像素点的对比度值,计算该滑窗图像的缺陷概率,根据所述缺陷概率判断该滑窗图像是否存在缺陷。The defect detection unit is configured to use the contrast value of each pixel in all the filtered images corresponding to each sliding window image to calculate the defect probability of the sliding window image, and judge whether the sliding window image has defects according to the defect probability.

根据本发明提出的技术手段,通过分析图像中的点对纹理信息得到纺织品的纹理周期信息,利用周期信息设置滑窗参数,从而进行进一步的滤波处理,能够克服纺织品自身印花纹理的干扰,精确的定位出缺陷区域,从而有效提升了检测效率和生产质量。According to the technical means proposed in the present invention, the texture period information of the textile is obtained by analyzing the point-to-texture information in the image, and the sliding window parameters are set by using the period information, so as to perform further filtering processing, which can overcome the interference of the printing texture of the textile itself, and accurately Defective areas are located, thereby effectively improving inspection efficiency and production quality.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发滤波明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the filter of the present invention. within the scope of protection.

Claims (8)

1.一种纺织品表面缺陷的检测方法,其特征在于,包括:1. a detection method of textile surface defect, is characterized in that, comprises: 获取纺织品表面灰度图像,并对所述灰度图像进行预处理获得梯度图像;obtaining a grayscale image of the textile surface, and preprocessing the grayscale image to obtain a gradient image; 获取梯度图像中每一个像素点在每个方向上两两像素点形成的点对,利用各个方向上最大频率点对所对应的点对长度计算所述灰度图像每个方向的点对周期长度概率;Obtain the point pair formed by each pixel in each direction in each direction in the gradient image, and use the point pair length corresponding to the maximum frequency point pair in each direction to calculate the point pair period length in each direction of the grayscale image. probability; 将所有点对得到的周期长度概率最大值所对应的方向作为周期的延申方向,获取周期延申方向上的周期长度,根据所述周期长度以及周期延申方向设置滑窗参数;The direction corresponding to the maximum value of the cycle length probability obtained by all point pairs is used as the extension direction of the cycle, the cycle length in the cycle extension direction is obtained, and the sliding window parameters are set according to the cycle length and the cycle extension direction; 利用设定参数的窗口对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,根据两两滑窗的频域空间交集得到对应两个滑窗图像的交集频率值;Use the window of the set parameter to perform sliding window on the grayscale image, obtain the frequency domain space image of each sliding window image, and obtain the intersection frequency value of the corresponding two sliding window images according to the frequency domain space intersection of the two sliding windows; 利用每一个滑窗图像与其它滑窗图像的交集频率值分别对该滑窗图像进行滤波处理获得该滑窗图像在不同交集频率值滤波处理后的滤波图像;Use the intersection frequency value of each sliding window image and other sliding window images to filter the sliding window image to obtain the filtered image of the sliding window image after filtering processing at different intersection frequency values; 利用每一个滑窗图像对应的所有滤波图像中每个像素点的对比度值,计算该滑窗图像的缺陷概率,根据所述缺陷概率判断该滑窗图像是否存在缺陷。Using the contrast value of each pixel in all the filtered images corresponding to each sliding window image, the defect probability of the sliding window image is calculated, and whether the sliding window image has defects is judged according to the defect probability. 2.根据权利要求1所述的一种纺织品表面缺陷的检测方法,其特征在于,计算所述灰度图像每个方向的点对周期长度概率的方法如下:2. The detection method of a textile surface defect according to claim 1, wherein the method for calculating the point-to-period length probability of each direction of the grayscale image is as follows: 利用起始点与终止点之间的欧氏距离计算所述灰度图像中第k行点对在每个方向上的点对长度,获取第s个方向上最大频率对应的行点对长度
Figure 178179DEST_PATH_IMAGE001
Use the Euclidean distance between the starting point and the ending point to calculate the point pair length of the kth row point pair in each direction in the grayscale image, and obtain the row point pair length corresponding to the maximum frequency in the sth direction
Figure 178179DEST_PATH_IMAGE001
;
同理,计算从第k行出发与第s个方向垂直方向上的所有点对长度得到列点对长度,获取对应方向上频率最大的列点对长度
Figure 199224DEST_PATH_IMAGE002
In the same way, calculate the length of all point pairs in the vertical direction starting from the kth row and the sth direction to obtain the length of the column point pair, and obtain the length of the column point pair with the highest frequency in the corresponding direction.
Figure 199224DEST_PATH_IMAGE002
;
计算第s个方向的周期长度概率的表达式为:The expression for calculating the cycle length probability in the s-th direction is:
Figure 588618DEST_PATH_IMAGE003
Figure 588618DEST_PATH_IMAGE003
其中,
Figure 935285DEST_PATH_IMAGE004
表示从第k行出发垂直于第s个角度方向上频率最大的列点对长度,
Figure 911594DEST_PATH_IMAGE005
从第k行点对出发的第s个角度方向为第一行,平行向下i行的点对在第s个方向上的最大频率点对长度,
Figure 1909DEST_PATH_IMAGE001
表示第k行点对在第s个方向上的最大频率点对长度,N表示共有N行点对,
Figure 980230DEST_PATH_IMAGE006
表示所述灰度图像第s个方向上的点对周期长度概率。
in,
Figure 935285DEST_PATH_IMAGE004
Indicates the length of the column point pair with the largest frequency in the direction perpendicular to the s-th angle starting from the k-th row,
Figure 911594DEST_PATH_IMAGE005
The s-th angular direction starting from the point pair in the k-th row is the first row, and the maximum frequency point pair length in the s-th direction of the point pair in the i-row parallel to the downward direction,
Figure 1909DEST_PATH_IMAGE001
Indicates the maximum frequency point pair length of the k-th row point pair in the s-th direction, and N represents a total of N rows of point pairs,
Figure 980230DEST_PATH_IMAGE006
represents the point-to-period length probability in the s-th direction of the grayscale image.
3.根据权利要求2所述的一种纺织品表面缺陷的检测方法,其特征在于,根据所述周期长度以及周期延申方向设置滑窗参数的方法如下:3. the detection method of a kind of textile surface defect according to claim 2, is characterized in that, the method for setting sliding window parameter according to described period length and period extension direction is as follows: 获取周期长度概率最大的角度方向
Figure 497799DEST_PATH_IMAGE007
作为周期的延申方向,获取周期长度概率最大的行
Figure 961403DEST_PATH_IMAGE008
作为周期始点,选取从
Figure 324252DEST_PATH_IMAGE008
行出发的第
Figure 422658DEST_PATH_IMAGE007
个角度方向直线的最大频率点对长度
Figure 845549DEST_PATH_IMAGE009
为周期行长度,将垂直于从第
Figure 796449DEST_PATH_IMAGE008
行出发的第
Figure 697409DEST_PATH_IMAGE007
个角度方向的角度方向直线上的最大频率点对长度
Figure 915901DEST_PATH_IMAGE010
作为周期列长度;
Get the angular direction with the highest probability of period length
Figure 497799DEST_PATH_IMAGE007
As the extension direction of the cycle, get the row with the highest probability of cycle length
Figure 961403DEST_PATH_IMAGE008
As the cycle start point, choose from
Figure 324252DEST_PATH_IMAGE008
the first
Figure 422658DEST_PATH_IMAGE007
The maximum frequency point pair length of a straight line in an angular direction
Figure 845549DEST_PATH_IMAGE009
is the period line length, which will be perpendicular to the
Figure 796449DEST_PATH_IMAGE008
the first
Figure 697409DEST_PATH_IMAGE007
The maximum frequency point pair length on the angular direction straight line in each angular direction
Figure 915901DEST_PATH_IMAGE010
as the period column length;
根据周期始点、周期长度和周期延申方向获取布匹中滑窗的初始位置
Figure 509694DEST_PATH_IMAGE011
,滑窗尺寸为
Figure 180846DEST_PATH_IMAGE012
,滑窗的滑动方向为
Figure 912261DEST_PATH_IMAGE013
方向,滑窗的滑动步长为
Figure 719680DEST_PATH_IMAGE014
Obtain the initial position of the sliding window in the cloth according to the cycle start point, cycle length and cycle extension direction
Figure 509694DEST_PATH_IMAGE011
, the sliding window size is
Figure 180846DEST_PATH_IMAGE012
, the sliding direction of the sliding window is
Figure 912261DEST_PATH_IMAGE013
direction, the sliding step size of the sliding window is
Figure 719680DEST_PATH_IMAGE014
.
4.根据权利要求1所述的一种纺织品表面缺陷的检测方法,其特征在于,获取对应两个滑窗图像的交集频率值的方法为:4. the detection method of a kind of textile surface defect according to claim 1, is characterized in that, the method that obtains the intersection frequency value of corresponding two sliding window images is: 对各个滑窗图像进行傅里叶变化得到对应滑窗图像的频域空间图像,将任意两两滑窗的频域空间进行交集处理,得到对应两个滑窗图像的交集频率值。Fourier transform is performed on each sliding window image to obtain the frequency domain space image of the corresponding sliding window image, and the frequency domain space of any pair of sliding windows is intersected to obtain the intersection frequency value corresponding to the two sliding window images. 5.根据权利要求1所述的一种纺织品表面缺陷的检测方法,其特征在于,每一个滑窗图像对应的所有滤波图像中每个像素点的对比度值包括:5. The detection method of a textile surface defect according to claim 1, wherein the contrast value of each pixel in all the filtered images corresponding to each sliding window image comprises: 通过8邻域像素计算每个滑窗中各个像素点的对比度值,获取所有对比度值大于第一阈值
Figure 749953DEST_PATH_IMAGE015
的像素点,将所述对比度大于第一阈值的像素点作为高对比度像素点。
Calculate the contrast value of each pixel in each sliding window through 8 neighbor pixels, and obtain all contrast values greater than the first threshold
Figure 749953DEST_PATH_IMAGE015
The pixels with the contrast greater than the first threshold are regarded as high-contrast pixels.
6.根据权利要求5所述的一种纺织品表面缺陷的检测方法,其特征在于,根据每个滑窗中高对比度像素点的个数计算对应每个滑窗的缺陷概率,表达式为:6. The detection method of a textile surface defect according to claim 5, wherein the defect probability corresponding to each sliding window is calculated according to the number of high-contrast pixel points in each sliding window, and the expression is:
Figure 908402DEST_PATH_IMAGE016
Figure 908402DEST_PATH_IMAGE016
其中,
Figure 918208DEST_PATH_IMAGE017
表示利用第i个滑窗和第j个滑窗的频率交集对第i个滑窗的滤波后的滑窗图像内的第e个高对比度像素8邻域内高对比度像素个数,
Figure 845713DEST_PATH_IMAGE018
表示该滑窗内高对比度像素的总个数,
Figure 46887DEST_PATH_IMAGE019
表示利用第i个滑窗和第j个滑窗的频率交集对第i个滑窗的滤波后的滑窗图像的缺陷概率。
in,
Figure 918208DEST_PATH_IMAGE017
Represents the number of high-contrast pixels in the neighborhood of the e-th high-contrast pixel 8 in the filtered sliding-window image of the i-th sliding window using the frequency intersection of the i-th sliding window and the j-th sliding window,
Figure 845713DEST_PATH_IMAGE018
represents the total number of high-contrast pixels in the sliding window,
Figure 46887DEST_PATH_IMAGE019
Represents the defect probability of the filtered sliding window image of the ith sliding window using the frequency intersection of the ith sliding window and the jth sliding window.
7.根据权利要求6所述的一种纺织品表面缺陷的检测方法,其特征在于,计算对应每个滑窗的缺陷概率之后,还包括:7. The detection method of a textile surface defect according to claim 6, characterized in that, after calculating the defect probability corresponding to each sliding window, further comprising: 根据第i个滑窗和每个滑窗的频率交集对第i个滑窗的滤波后的滑窗缺陷概率计算第i个滑窗的综合缺陷概率,表达式为:According to the frequency intersection of the ith sliding window and each sliding window, the comprehensive defect probability of the ith sliding window is calculated on the filtered sliding window defect probability of the ith sliding window, and the expression is:
Figure 692632DEST_PATH_IMAGE020
Figure 692632DEST_PATH_IMAGE020
其中,
Figure 506130DEST_PATH_IMAGE021
表示利用第i个与第j个滑窗交集对第i个滑窗滤波后的滑窗图像的缺陷概率,
Figure 553720DEST_PATH_IMAGE022
表示利用第i个与第k个滑窗的频率交集对第k个滑窗的滤波得到滤波后滑窗图像的缺陷概率,Q表示滑窗的个数,
Figure 925796DEST_PATH_IMAGE023
表示第i个滑窗的综合缺陷概率。
in,
Figure 506130DEST_PATH_IMAGE021
represents the defect probability of the sliding window image filtered by the ith sliding window using the intersection of the ith and the jth sliding window,
Figure 553720DEST_PATH_IMAGE022
Represents the defect probability of the filtered sliding window image obtained by filtering the k-th sliding window by the frequency intersection of the i-th and the k-th sliding window, Q represents the number of sliding windows,
Figure 925796DEST_PATH_IMAGE023
Represents the comprehensive defect probability of the i-th sliding window.
8.一种纺织品表面缺陷的检测系统,其特征在于,包括图像预处理单元、第一计算单元、第二计算单元、第三计算单元、第四计算单元以及缺陷检测单元;8. A detection system for textile surface defects, comprising an image preprocessing unit, a first calculation unit, a second calculation unit, a third calculation unit, a fourth calculation unit and a defect detection unit; 图像预处理单元,用于获取纺织品表面灰度图像,并对所述灰度图像进行预处理获得梯度图像;an image preprocessing unit, configured to obtain a grayscale image of the surface of the textile, and preprocess the grayscale image to obtain a gradient image; 第一计算单元,用于获取梯度图像中每一个像素点在每个方向上两两像素点形成的点对,利用各个方向上最大频率点对所对应的点对长度计算所述灰度图像每个方向的点对周期长度概率;The first calculation unit is used to obtain the point pairs formed by each pixel in each direction in each direction in the gradient image, and use the point pair length corresponding to the maximum frequency point pair in each direction to calculate each point pair in the grayscale image. point-to-period length probability in each direction; 第二计算单元,用于将所有点对得到的周期长度概率最大值所对应的方向作为周期的延申方向,获取周期延申方向上的周期长度,根据所述周期长度以及周期延申方向设置滑窗参数;The second calculation unit is configured to use the direction corresponding to the maximum value of the cycle length probability obtained by all point pairs as the extension direction of the cycle, obtain the cycle length in the cycle extension direction, and set the cycle length according to the cycle length and the cycle extension direction. Sliding window parameters; 第三计算单元,用于利用设定参数的窗口对所述灰度图像进行滑窗,获取各个滑窗图像的频域空间图像,根据两两滑窗的频域空间交集得到对应两个滑窗图像的交集频率值;The third computing unit is configured to perform sliding window on the grayscale image by using the window of the set parameter, obtain the frequency domain space image of each sliding window image, and obtain the corresponding two sliding windows according to the frequency domain space intersection of the two sliding windows. The intersection frequency value of the image; 第四计算单元,用于利用每一个滑窗图像与其它滑窗图像的交集频率值分别对该滑窗图像进行滤波处理获得该滑窗图像在不同交集频率值滤波处理后的滤波图像;The 4th calculation unit, is used for utilizing the intersection frequency value of each sliding window image and other sliding window images to carry out filtering processing to this sliding window image respectively to obtain the filtered image of this sliding window image after filtering processing of different intersection frequency values; 缺陷检测单元,用于利用每一个滑窗图像对应的所有滤波图像中每个像素点的对比度值,计算该滑窗图像的缺陷概率,根据所述缺陷概率判断该滑窗图像是否存在缺陷。The defect detection unit is configured to use the contrast value of each pixel in all the filtered images corresponding to each sliding window image to calculate the defect probability of the sliding window image, and judge whether the sliding window image has defects according to the defect probability.
CN202211044200.8A 2022-08-30 2022-08-30 Method and system for detecting textile surface defects Active CN115131348B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211044200.8A CN115131348B (en) 2022-08-30 2022-08-30 Method and system for detecting textile surface defects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211044200.8A CN115131348B (en) 2022-08-30 2022-08-30 Method and system for detecting textile surface defects

Publications (2)

Publication Number Publication Date
CN115131348A true CN115131348A (en) 2022-09-30
CN115131348B CN115131348B (en) 2022-11-15

Family

ID=83387648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211044200.8A Active CN115131348B (en) 2022-08-30 2022-08-30 Method and system for detecting textile surface defects

Country Status (1)

Country Link
CN (1) CN115131348B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115861310A (en) * 2023-02-23 2023-03-28 深圳市富安娜艺术家居有限公司 Method for detecting spinning defects on surface of bed sheet
CN116721101A (en) * 2023-08-09 2023-09-08 山东华航高分子材料有限公司 Defect detection method for surface wave flow marks of plastic part
CN116949732A (en) * 2023-09-20 2023-10-27 济宁华晟服装股份有限公司 Efficient ironing method for clothing production
CN117132593A (en) * 2023-10-25 2023-11-28 济宁华晟服装股份有限公司 Cloth roughness detection method for resisting periodic texture influence

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114445387A (en) * 2022-01-29 2022-05-06 泗阳富艺木业股份有限公司 Fiberboard quality classification method based on machine vision
CN114627111A (en) * 2022-05-12 2022-06-14 南通英伦家纺有限公司 Textile defect detection and identification device
CN114723705A (en) * 2022-03-31 2022-07-08 海门市恒创织带有限公司 Cloth flaw detection method based on image processing
CN114820610A (en) * 2022-06-29 2022-07-29 数聚(山东)医疗科技有限公司 Image processing-based defect detection method for new material medical instrument
CN114820631A (en) * 2022-07-04 2022-07-29 南通中豪超纤制品有限公司 Fabric defect detection method capable of resisting texture interference
CN114842007A (en) * 2022-07-04 2022-08-02 南通东德纺织科技有限公司 Textile wear defect detection method based on image processing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114445387A (en) * 2022-01-29 2022-05-06 泗阳富艺木业股份有限公司 Fiberboard quality classification method based on machine vision
CN114723705A (en) * 2022-03-31 2022-07-08 海门市恒创织带有限公司 Cloth flaw detection method based on image processing
CN114627111A (en) * 2022-05-12 2022-06-14 南通英伦家纺有限公司 Textile defect detection and identification device
CN114820610A (en) * 2022-06-29 2022-07-29 数聚(山东)医疗科技有限公司 Image processing-based defect detection method for new material medical instrument
CN114820631A (en) * 2022-07-04 2022-07-29 南通中豪超纤制品有限公司 Fabric defect detection method capable of resisting texture interference
CN114842007A (en) * 2022-07-04 2022-08-02 南通东德纺织科技有限公司 Textile wear defect detection method based on image processing

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115861310A (en) * 2023-02-23 2023-03-28 深圳市富安娜艺术家居有限公司 Method for detecting spinning defects on surface of bed sheet
CN116721101A (en) * 2023-08-09 2023-09-08 山东华航高分子材料有限公司 Defect detection method for surface wave flow marks of plastic part
CN116721101B (en) * 2023-08-09 2023-10-20 山东华航高分子材料有限公司 Defect detection method for surface wave flow marks of plastic part
CN116949732A (en) * 2023-09-20 2023-10-27 济宁华晟服装股份有限公司 Efficient ironing method for clothing production
CN116949732B (en) * 2023-09-20 2023-12-08 济宁华晟服装股份有限公司 Efficient ironing method for clothing production
CN117132593A (en) * 2023-10-25 2023-11-28 济宁华晟服装股份有限公司 Cloth roughness detection method for resisting periodic texture influence
CN117132593B (en) * 2023-10-25 2024-03-26 济宁华晟服装股份有限公司 Cloth roughness detection method for resisting periodic texture influence

Also Published As

Publication number Publication date
CN115131348B (en) 2022-11-15

Similar Documents

Publication Publication Date Title
CN115131348B (en) Method and system for detecting textile surface defects
CN111179225B (en) Test paper surface texture defect detection method based on gray gradient clustering
CN109816644B (en) An automatic detection system for bearing defects based on multi-angle light source images
CN113646801B (en) Defect detection method, device and computer readable storage medium for defect image
CN109242853B (en) An intelligent detection method for PCB defects based on image processing
CN115100206B (en) Printing defect identification method for textile with periodic pattern
CN115330784B (en) Cloth surface defect detection method
CN107123114A (en) A kind of cloth defect inspection method and device based on machine learning
WO2021109697A1 (en) Character segmentation method and apparatus, and computer-readable storage medium
CN103866551B (en) Based on the fabric skew quick detecting method of machine vision
CN106780464A (en) A kind of fabric defect detection method based on improvement Threshold segmentation
CN114723705A (en) Cloth flaw detection method based on image processing
CN113838038B (en) Carbon fiber cloth cover defect detection method and device, electronic equipment and storage medium
CN115330770B (en) Cloth area type defect identification method
CN116228651A (en) Cloth defect detection method, system, equipment and medium
CN117830287A (en) Circuit board on-line detection and re-judgment algorithm
CN111583202A (en) Method and device for detecting wool yarns
CN113192061A (en) LED package appearance detection image extraction method and device, electronic equipment and storage medium
CN104392203A (en) A Method of Spot-Stripe Noise Detection Based on Video Analysis
CN110853077B (en) An Adaptive Feature Extraction Method for Infrared Dynamic Frames Based on Morphology Change Estimation
CN105699386B (en) An automatic cloth inspection and marking method using a contact image sensor
CN118644484B (en) Intelligent defect detection method for household textile
CN115131353A (en) Flat screen printing textile production abnormity identification and positioning method and system
CN105738376B (en) A kind of automatic cloth inspecting machine using contact-type image sensor
CN110516725B (en) Detection method of plank stripe spacing and color based on machine 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