CN103489182B - A kind of fabric defects detection method based on image projection and svd - Google Patents
A kind of fabric defects detection method based on image projection and svd Download PDFInfo
- Publication number
- CN103489182B CN103489182B CN201310401043.6A CN201310401043A CN103489182B CN 103489182 B CN103489182 B CN 103489182B CN 201310401043 A CN201310401043 A CN 201310401043A CN 103489182 B CN103489182 B CN 103489182B
- Authority
- CN
- China
- Prior art keywords
- subwindow
- projection
- sub
- sequence
- matrix
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 239000004744 fabric Substances 0.000 title claims abstract description 48
- 238000001514 detection method Methods 0.000 title claims abstract description 43
- 230000007547 defect Effects 0.000 title claims abstract description 37
- 239000011159 matrix material Substances 0.000 claims abstract description 58
- 239000013598 vector Substances 0.000 claims abstract description 25
- 238000012549 training Methods 0.000 claims abstract description 18
- 238000000034 method Methods 0.000 claims abstract description 14
- 230000001186 cumulative effect Effects 0.000 claims description 14
- 238000005315 distribution function Methods 0.000 claims description 14
- 238000012360 testing method Methods 0.000 claims description 11
- 238000013519 translation Methods 0.000 claims description 8
- 239000004753 textile Substances 0.000 claims description 5
- 238000000354 decomposition reaction Methods 0.000 abstract description 26
- 230000002950 deficient Effects 0.000 description 2
- 238000010191 image analysis Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Landscapes
- Treatment Of Fiber Materials (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
本发明涉及一种基于图像投影和奇异值分解的织物瑕疵检测方法。在训练阶段首先将无瑕疵织物图像样本有重叠地划分成正方形子窗口;然后将所得子窗口分别沿纵横方向投影,得到联合投影序列;最后对联合投影序列所组成的矩阵实施奇异值分解,提取基向量;在检测阶段,将待检测织物图像样本无重叠地分割划分成正方形子窗口;同时将子窗口沿纵横方向的投影,得到联合投影序列;应用基向量对所得的联合投影序列进行重构,并通过重构误差来判定子窗口是否包含瑕疵。本发明充分利用了织物纹理及瑕疵的经纬取向特征,通过对纵横方向投影所得序列进行分析,不仅大大降低了方法的复杂性,而且对不同织物纹理和瑕疵类型有较强的适应性,尤其是对线性瑕疵。The invention relates to a fabric defect detection method based on image projection and singular value decomposition. In the training stage, firstly, the flawless fabric image sample is divided into square sub-windows with overlapping; then the obtained sub-windows are projected along the vertical and horizontal directions respectively to obtain the joint projection sequence; finally, the singular value decomposition is performed on the matrix composed of the joint projection sequence to extract Base vector; in the detection stage, the fabric image sample to be detected is divided into square sub-windows without overlap; at the same time, the sub-windows are projected along the vertical and horizontal directions to obtain a joint projection sequence; the basis vector is used to reconstruct the resulting joint projection sequence , and use the reconstruction error to determine whether the sub-window contains defects. The invention makes full use of the warp and weft orientation characteristics of fabric texture and flaws, and analyzes the sequence obtained by projection in the vertical and horizontal directions, which not only greatly reduces the complexity of the method, but also has strong adaptability to different fabric textures and flaw types, especially against linear artifacts.
Description
技术领域technical field
本发明属图像分析处理领域,本发明涉及一种基于图像投影和奇异值分解的织物瑕疵检测方法,应用于纺织品表面质量自动检测与控制领域。The invention belongs to the field of image analysis and processing, and relates to a fabric flaw detection method based on image projection and singular value decomposition, which is applied to the field of automatic detection and control of textile surface quality.
背景技术Background technique
设矩阵A是m×n的矩阵,奇异值分解(SVD)可以把矩阵A分解成U,Σ和V三个矩阵。其中矩阵U是m×n的正交矩阵,矩阵V是n×n的正交矩阵,矩阵Σ是m×n的矩阵,其对角线以外的元素全部为零,即矩阵Σ=diag(σ1,σ2,…,σr)为对角矩阵,r为矩阵A的秩,σ1,σ2,…,σr为A矩阵的奇异值。矩阵U和V分别称为左奇异矩阵和右奇异矩阵,矩阵Σ的对角线上的元素依次呈递减顺序,即:σ1≥σ2≥…≥σr≥0。Assuming that matrix A is an m×n matrix, singular value decomposition (SVD) can decompose matrix A into three matrices U, Σ and V. Among them, matrix U is an orthogonal matrix of m×n, matrix V is an orthogonal matrix of n×n, matrix Σ is a matrix of m×n, and the elements outside its diagonal are all zero, that is, matrix Σ=diag(σ 1 , σ 2 , ..., σ r ) is a diagonal matrix, r is the rank of matrix A, σ 1 , σ 2 , ..., σ r is the singular value of A matrix. The matrices U and V are called left singular matrix and right singular matrix respectively, and the elements on the diagonal of matrix Σ are in descending order, namely: σ 1 ≥σ 2 ≥…≥σ r ≥0.
将矩阵Σ的对角元素设定为σk+1=σk+2=…=σr=0,得到矩阵A在秩k(k<r)下的重构其重构误差使用Frobenius范数可表述为:Set the diagonal elements of the matrix Σ to σ k+1 =σ k+2 =…=σ r =0 to obtain the reconstruction of matrix A under rank k (k<r) Using the Frobenius norm, its reconstruction error can be expressed as:
由上式可以看出,通过奇异值分解得到的是A矩阵的最优低秩下的重构。在图像分析领域,奇异值分解主要用于图像的压缩、重构和恢复等。It can be seen from the above formula that the singular value decomposition obtained is the optimal low-rank reconstruction of the A matrix. In the field of image analysis, singular value decomposition is mainly used for image compression, reconstruction and restoration.
在织物瑕疵检测领域,Tomczak和Mosorov(2006)采用经SVD分解后所得的最大的奇异值进行织物瑕疵检测。Chen和Feng(2010)提取了奇异值均值作为特征进行瑕疵判别。Mak和(2010)对织物样本实施SVD,提取左奇异矩阵每列作为特征子图像,并通过将待检测图像样本投影到特征子图像,计算所得的投影值的平方和作为瑕疵判别指标。In the field of fabric defect detection, Tomczak and Mosorov (2006) used the largest singular value obtained after SVD decomposition to detect fabric defects. Chen and Feng (2010) extracted the singular value mean as a feature for flaw discrimination. Mak and (2010) implemented SVD on the fabric samples, extracted each column of the left singular matrix as a feature sub-image, and projected the image sample to be detected to the feature sub-image, and calculated the sum of the squares of the projected values as a flaw discrimination index.
值得注意的是,以上研究者均是直接在原织物图像上进行SVD,然后提取相应特征进行瑕疵检测,并没有对原图像进行投影操作且并未充分利用SVD的低秩重构性质。It is worth noting that the above researchers all directly performed SVD on the original fabric image, and then extracted the corresponding features for flaw detection, did not perform projection operations on the original image and did not make full use of the low-rank reconstruction properties of SVD.
发明内容Contents of the invention
本发明的目的就是克服现有算法的不足,提高算法的对不同纹理和瑕疵适应性和实时性,提出一种基于图像投影和奇异值分解的织物瑕疵检测方法。The purpose of the present invention is to overcome the shortcomings of existing algorithms, improve the adaptability and real-time performance of the algorithm to different textures and defects, and propose a fabric defect detection method based on image projection and singular value decomposition.
本发明的一种基于图像投影和奇异值分解的织物瑕疵检测方法包括以下步骤:A kind of fabric defect detection method based on image projection and singular value decomposition of the present invention comprises the following steps:
(1)训练阶段;(1) Training stage;
将无瑕疵织物图像样本有重叠地划分成正方形子窗口,并将子窗口分别沿纵横方向投影,得到联合投影序列;然后将所得的联合投影序列组成一个矩阵,并对该矩阵实施奇异值分解,提取基向量;Divide the flawless fabric image sample into square sub-windows with overlapping, and project the sub-windows along the vertical and horizontal directions respectively to obtain a joint projection sequence; then form a matrix with the obtained joint projection sequence, and perform singular value decomposition on the matrix, extract basis vector;
(2)检测阶段;(2) Detection stage;
将待检测织物图像样本连续无重叠地分割划分成正方形子窗口,并将子窗口沿纵横方向的投影,得到联合投影序列y;应用(1)中所得的基向量的对y进行重构,得到y的重构计算重构误差并通过重构误差来判定子窗口是否包含瑕疵;The fabric image sample to be detected is continuously divided into square sub-windows without overlapping, and the sub-windows are projected along the vertical and horizontal directions to obtain the joint projection sequence y; the base vector pair y obtained in (1) is used to reconstruct y to obtain refactoring of y Calculate reconstruction error And judge whether the sub-window contains defects by reconstructing the error;
具体实现如下:The specific implementation is as follows:
在训练阶段,将所述的无瑕疵织物图像样本有重叠地划分成大小为w×w的正方形子窗口,其中8像素≤w≤64像素;所述有重叠地划分是指在同一行中,后一个子窗口是前一个子窗口横向平移步长s得到,相邻子窗口之间有重叠部分,所述重叠部分的横向长度为w-s,在相邻行中,下一行的子窗口是上一行的子窗口纵向平移步长s得到,相邻子窗口之间有重叠部分,所述重叠部分的纵向长度为w-s,其中1≤s<w;In the training phase, the flawless fabric image samples are divided into square sub-windows with a size of w×w in an overlapping manner, wherein 8 pixels≤w≤64 pixels; the overlapping division means that they are in the same row, The latter sub-window is obtained by translating the previous sub-window with a horizontal translation step s. There is an overlap between adjacent sub-windows. The horizontal length of the overlapping portion is w-s. In the adjacent row, the sub-window of the next row is the previous row The sub-windows of the sub-windows are vertically translated with a step length s, and there are overlapping parts between adjacent sub-windows, and the longitudinal length of the overlapping parts is w-s, where 1≤s<w;
将子窗口分别沿纵横方向投影,即计算子窗口中每列和每行的所有像素点灰度值的平均值,得到两个投影序列;然后将所得的两个投影序列相接后得到联合投影序列;Project the sub-windows along the vertical and horizontal directions respectively, that is, calculate the average value of the gray value of all pixels in each column and each row in the sub-window to obtain two projection sequences; then connect the obtained two projection sequences to obtain a joint projection sequence;
将所有子窗口对应的联合投影序列作为矩阵的列排列为一个矩阵,并对所得的矩阵实施奇异值分解;提取左奇异矩阵的前k列作为基向量D,即D=[d1,d2,…,dk],其中d1,d2,…,dk为左奇异矩阵的前1到k列的列向量,且有4≤k≤16;Arrange the joint projection sequences corresponding to all sub-windows as the columns of the matrix into a matrix, and perform singular value decomposition on the obtained matrix; extract the first k columns of the left singular matrix as the base vector D, that is, D=[d 1 , d 2 ,...,d k ], where d 1 , d 2 ,..., d k are the column vectors of the first 1 to k columns of the left singular matrix, and 4≤k≤16;
在检测阶段,将待检测织物图像样本连续无重叠地划分成大小为w×w的正方形子窗口,其中8像素≤w≤64像素;然后按照训练阶段的方法,将子窗口分别沿纵横向投影,得到联合投影序列;应用所述基向量对检测阶段所得的联合投影序列进行重构,并通过计算其所得的重构误差E来判定子窗口是否包含瑕疵。In the detection stage, the fabric image sample to be detected is continuously divided into square sub-windows with a size of w×w, where 8 pixels≤w≤64 pixels; and then the sub-windows are projected along the vertical and horizontal directions respectively according to the method of the training stage , to obtain a joint projection sequence; apply the basis vector to reconstruct the joint projection sequence obtained in the detection stage, and determine whether the sub-window contains defects by calculating the reconstruction error E obtained therefrom.
作为优选的技术方案:As a preferred technical solution:
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的织物为位深度为8位的灰度图像。According to the fabric defect detection method based on image projection and singular value decomposition, the fabric is a grayscale image with a bit depth of 8 bits.
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的重构是指在最小平方误差下所得的重构。As mentioned above, a fabric defect detection method based on image projection and singular value decomposition, the reconstruction refers to the reconstruction obtained under the minimum square error.
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的通过重构误差来判定子窗口是否包含瑕疵是指当重构误差超过预先设定的阈值则认为子窗口包含瑕疵;阈值的确定:首先对无瑕疵织物进行测试,得到其重构误差E的累计分布函数,然后选取对应于其累计分布函数95%的重构误差值作为阈值。As mentioned above, a fabric defect detection method based on image projection and singular value decomposition, the described reconstruction error to determine whether the sub-window contains defects means that when the reconstruction error exceeds a preset threshold, it is considered that the sub-window contains Defects; Determination of the threshold: First, test the non-defective fabric to obtain the cumulative distribution function of its reconstruction error E, and then select the reconstruction error value corresponding to 95% of its cumulative distribution function as the threshold.
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的联合投影序列,是指将沿纵横方向投影所得的两个投影序列,一个在前,另一个在后或一个在后,另一个在前以首尾相接的方式所得的序列。As mentioned above, a fabric defect detection method based on image projection and singular value decomposition, the joint projection sequence refers to the two projection sequences obtained by projecting along the vertical and horizontal directions, one in front, the other in the back or a After the other, the sequence obtained in an end-to-end manner.
有益效果:Beneficial effect:
1、本发明通过实施纵横方向投影得到联合序列的预处理方法,大大降低了方法的计算复杂性,提高了方法的实时性;1. The present invention obtains the preprocessing method of the joint sequence by implementing vertical and horizontal direction projection, which greatly reduces the computational complexity of the method and improves the real-time performance of the method;
2、本发明的方法对光照不匀不敏感,鲁棒性较好;2. The method of the present invention is not sensitive to uneven illumination and has better robustness;
3、方法对不同织物纹理和瑕疵类型有较强的适应性,尤其是对线性瑕疵。3. The method has strong adaptability to different fabric textures and defect types, especially for linear defects.
附图说明Description of drawings
图1w×w的窗口的划分The division of the window in Figure 1w×w
图2横向重叠窗口的划分Figure 2 Division of horizontal overlapping windows
图3纵向重叠窗口的划分Figure 3 Division of vertical overlapping windows
图4本发明所用瑕疵试验图像Figure 4 is the used defect test image of the present invention
图5对试验图像图4的最终检测结果Figure 5 is the final detection result of the test image Figure 4
图6本发明所用瑕疵试验图像Fig. 6 image of flaw test used in the present invention
图7对试验图像图6的最终检测结果Figure 7 is the final detection result of the test image Figure 6
图8本发明所用瑕疵试验图像Fig. 8 image of defect test used in the present invention
图9对试验图像图8的最终检测结果Figure 9 is the final detection result of the test image Figure 8
图10本发明所用瑕疵试验图像Fig. 10 image of defect test used in the present invention
图11对试验图像图10的最终检测结果Figure 11 The final detection results of the test image Figure 10
具体实施方式detailed description
下面结合具体实施方式,进一步阐述本发明。应理解,这些实施例仅用于说明本发明而不用于限制本发明的范围。此外应理解,在阅读了本发明讲授的内容之后,本领域技术人员可以对本发明作各种改动或修改,这些等价形式同样落于本申请所附权利要求书所限定的范围。The present invention will be further described below in combination with specific embodiments. It should be understood that these examples are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the teachings of the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the appended claims of the present application.
本发明的一种基于图像投影和奇异值分解的织物瑕疵检测方法包括以下步骤:A kind of fabric defect detection method based on image projection and singular value decomposition of the present invention comprises the following steps:
(1)训练阶段;(1) Training stage;
将无瑕疵织物图像样本有重叠地划分成正方形子窗口,并将子窗口分别沿纵横方向投影,得到联合投影序列;然后将所得的联合投影序列组成一个矩阵,并对该矩阵实施奇异值分解,提取基向量;Divide the flawless fabric image sample into square sub-windows with overlapping, and project the sub-windows along the vertical and horizontal directions respectively to obtain a joint projection sequence; then form a matrix with the obtained joint projection sequence, and perform singular value decomposition on the matrix, extract basis vector;
(2)检测阶段;(2) Detection stage;
将待检测织物图像样本连续无重叠地分割划分成正方形子窗口,并将子窗口沿纵横方向的投影,得到联合投影序列y;应用(1)中所得的基向量的对y进行重构,得到y的重构计算重构误差并通过重构误差来判定子窗口是否包含瑕疵;The fabric image sample to be detected is continuously divided into square sub-windows without overlapping, and the sub-windows are projected along the vertical and horizontal directions to obtain the joint projection sequence y; the base vector pair y obtained in (1) is used to reconstruct y to obtain refactoring of y Calculate reconstruction error And judge whether the sub-window contains defects by reconstructing the error;
具体实现如下:The specific implementation is as follows:
在训练阶段,将所述的无瑕疵织物图像样本有重叠地划分成大小为w×w的正方形子窗口,其中8像素≤w≤64像素;所述有重叠地划分是指在同一行中,后一个子窗口是前一个子窗口横向平移步长s得到,相邻子窗口之间有重叠部分,所述重叠部分的横向长度为w-s,在相邻行中,下一行的子窗口是上一行的子窗口纵向平移步长s得到,相邻子窗口之间有重叠部分,所述重叠部分的纵向长度为w-s,其中1≤s<w;In the training phase, the flawless fabric image samples are divided into square sub-windows with a size of w×w in an overlapping manner, wherein 8 pixels≤w≤64 pixels; the overlapping division means that they are in the same row, The latter sub-window is obtained by translating the previous sub-window with a horizontal translation step s. There is an overlap between adjacent sub-windows. The horizontal length of the overlapping portion is w-s. In the adjacent row, the sub-window of the next row is the previous row The sub-windows of the sub-windows are vertically translated with a step length s, and there are overlapping parts between adjacent sub-windows, and the longitudinal length of the overlapping parts is w-s, where 1≤s<w;
将子窗口分别沿纵横方向投影,即计算子窗口中每列和每行的所有像素点灰度值的平均值,得到两个投影序列;然后将所得的两个投影序列相接后得到联合投影序列;Project the sub-windows along the vertical and horizontal directions respectively, that is, calculate the average value of the gray value of all pixels in each column and each row in the sub-window to obtain two projection sequences; then connect the obtained two projection sequences to obtain a joint projection sequence;
将所有子窗口对应的联合投影序列作为矩阵的列排列为一个矩阵,并对所得的矩阵实施奇异值分解;提取左奇异矩阵的前k列作为基向量D,即D=[d1,d2,…,dk],其中d1,d2,…,dk为左奇异矩阵的前1到k列的列向量,且有4≤k≤16;Arrange the joint projection sequences corresponding to all sub-windows as the columns of the matrix into a matrix, and perform singular value decomposition on the obtained matrix; extract the first k columns of the left singular matrix as the base vector D, that is, D=[d 1 , d 2 ,...,d k ], where d 1 , d 2 ,..., d k are the column vectors of the first 1 to k columns of the left singular matrix, and 4≤k≤16;
在检测阶段,将待检测织物图像样本连续无重叠地划分成大小为w×w的正方形子窗口,其中8像素≤w≤64像素;然后按照训练阶段的方法,将子窗口分别沿纵横向投影,得到联合投影序列;应用所述基向量对检测阶段所得的联合投影序列进行重构,并通过计算其所得的重构误差E来判定子窗口是否包含瑕疵。In the detection stage, the fabric image sample to be detected is continuously divided into square sub-windows with a size of w×w, where 8 pixels≤w≤64 pixels; and then the sub-windows are projected along the vertical and horizontal directions respectively according to the method of the training stage , to obtain a joint projection sequence; apply the basis vector to reconstruct the joint projection sequence obtained in the detection stage, and determine whether the sub-window contains defects by calculating the reconstruction error E obtained therefrom.
作为优选的技术方案:As a preferred technical solution:
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的织物为位深度为8位的灰度图像。According to the fabric defect detection method based on image projection and singular value decomposition, the fabric is a grayscale image with a bit depth of 8 bits.
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的重构是指在最小平方误差下所得的重构。As mentioned above, a fabric defect detection method based on image projection and singular value decomposition, the reconstruction refers to the reconstruction obtained under the minimum square error.
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的通过重构误差来判定子窗口是否包含瑕疵是指当重构误差超过预先设定的阈值则认为子窗口包含瑕疵;阈值的确定:首先对无瑕疵织物进行测试,得到其重构误差E的累计分布函数,然后选取对应于其累计分布函数95%的重构误差值作为阈值。As mentioned above, a fabric defect detection method based on image projection and singular value decomposition, the described reconstruction error to determine whether the sub-window contains defects means that when the reconstruction error exceeds a preset threshold, it is considered that the sub-window contains Defects; Determination of the threshold: First, test the non-defective fabric to obtain the cumulative distribution function of its reconstruction error E, and then select the reconstruction error value corresponding to 95% of its cumulative distribution function as the threshold.
如上所述的一种基于图像投影和奇异值分解的织物瑕疵检测方法,所述的联合投影序列,是指将沿纵横方向投影所得的两个投影序列,一个在前,另一个在后或一个在后,另一个在前以首尾相接的方式所得的序列。As mentioned above, a fabric defect detection method based on image projection and singular value decomposition, the joint projection sequence refers to the two projection sequences obtained by projecting along the vertical and horizontal directions, one in front, the other in the back or a After the other, the sequence obtained in an end-to-end manner.
实施例1Example 1
训练阶段:Training phase:
(1)将无瑕疵织物图像有重叠地划分成大小为32×32(像素)正方形的子窗口,横向和纵向平移步长皆为1像素,其子窗口划分示意图,如图1、图2和图3所示;(1) Divide the flawless fabric image into sub-windows with a size of 32×32 (pixels) in an overlapping manner, and the horizontal and vertical translation steps are both 1 pixel. As shown in Figure 3;
(2)将子窗口分别沿纵横方向投影,即计算子窗口中每列和每行的所有像素点灰度值的平均值,得到两个投影序列;然后,将所得的两个投影序列相接后得到联合投影序列;(2) Project the sub-windows along the vertical and horizontal directions respectively, that is, calculate the average value of the gray value of all pixels in each column and each row in the sub-window, and obtain two projection sequences; then, connect the obtained two projection sequences After that, the joint projection sequence is obtained;
(3)将所有子窗口对应的联合投影序列作为矩阵的列排列为一个矩阵,并对所得的矩阵实施奇异值分解;提取左奇异矩阵的前4列作为基向量D。(3) Arrange the joint projection sequences corresponding to all sub-windows as the columns of the matrix into a matrix, and perform singular value decomposition on the obtained matrix; extract the first 4 columns of the left singular matrix as the base vector D.
阈值的确定:首先对无瑕疵织物进行测试,得到其重构误差E的累计分布函数,然后选取对应于其累计分布函数为95%时的重构误差值作为阈值,所用阈值为17。Determination of the threshold: Firstly, the flawless fabric is tested to obtain the cumulative distribution function of its reconstruction error E, and then the reconstruction error value corresponding to the cumulative distribution function of 95% is selected as the threshold, and the threshold used is 17.
检测阶段detection stage
(1)将待检测图像,如图4所示,连续无重叠地划分成大小为32×32(像素)正方形的子窗口;(1) The image to be detected, as shown in Figure 4, is continuously divided into sub-windows with a size of 32×32 (pixels) square;
(2)按照训练阶段的方法,将子窗口分别沿纵横向投影,得到联合投影序列;(2) According to the method in the training phase, the sub-windows are projected vertically and horizontally respectively to obtain a joint projection sequence;
(3)应用所述基向量对检测阶段所得的联合投影序列进行重构,并通过计算其所得的重构误差E来判定子窗口是否包含瑕疵,实际检测结果如图5所示,其中黑色方框表示被判定为包含瑕疵的子窗口。(3) Apply the base vector to reconstruct the joint projection sequence obtained in the detection stage, and determine whether the sub-window contains defects by calculating the reconstruction error E obtained. The actual detection results are shown in Figure 5, where the black square Boxes represent subwindows judged to contain blemishes.
实施例2Example 2
训练阶段:Training phase:
(1)将无瑕疵织物图像有重叠地划分成大小为32×32(像素)正方形的子窗口,横向和纵向平移步长皆为1像素,其子窗口划分示意图,如图1、图2和图3所示;(1) Divide the flawless fabric image into sub-windows with a size of 32×32 (pixels) in an overlapping manner, and the horizontal and vertical translation steps are both 1 pixel. As shown in Figure 3;
(2)将子窗口分别沿纵横方向投影,即计算子窗口中每列和每行的所有像素点灰度值的平均值,得到两个投影序列;然后,将所得的两个投影序列相接后得到联合投影序列;(2) Project the sub-windows along the vertical and horizontal directions respectively, that is, calculate the average value of the gray value of all pixels in each column and each row in the sub-window, and obtain two projection sequences; then, connect the obtained two projection sequences After that, the joint projection sequence is obtained;
(3)将所有子窗口对应的联合投影序列作为矩阵的列排列为一个矩阵,并对所得的矩阵实施奇异值分解;提取左奇异矩阵的前16列作为基向量D。(3) Arrange the joint projection sequences corresponding to all sub-windows as the columns of the matrix into a matrix, and perform singular value decomposition on the obtained matrix; extract the first 16 columns of the left singular matrix as the base vector D.
阈值的确定:首先对无瑕疵织物进行测试,得到其重构误差E的累计分布函数,然后选取对应于其累计分布函数为95%时的重构误差值作为阈值,所用阈值为27。Determination of the threshold: Firstly, the flawless fabric is tested to obtain the cumulative distribution function of its reconstruction error E, and then the reconstruction error value corresponding to the cumulative distribution function of 95% is selected as the threshold, and the threshold used is 27.
检测阶段detection stage
(1)将待检测图像,如图6所示,连续无重叠地划分成大小为32×32(像素)正方形的子窗口;(1) The image to be detected, as shown in Figure 6, is continuously divided into sub-windows with a size of 32×32 (pixels) square;
(2)按照训练阶段的方法,将子窗口分别沿纵横向投影,得到联合投影序列;(2) According to the method in the training phase, the sub-windows are projected vertically and horizontally respectively to obtain a joint projection sequence;
(3)应用所述基向量对检测阶段所得的联合投影序列进行重构,并通过计算其所得的重构误差E来判定子窗口是否包含瑕疵,实际检测结果如图7所示,其中黑色方框表示被判定为包含瑕疵的子窗口。(3) Apply the base vector to reconstruct the joint projection sequence obtained in the detection stage, and determine whether the sub-window contains defects by calculating the reconstruction error E obtained. The actual detection results are shown in Figure 7, where the black square Boxes represent subwindows judged to contain blemishes.
实施例3Example 3
训练阶段:Training phase:
(1)将无瑕疵织物图像有重叠地划分成大小为32×32(像素)正方形的子窗口,横向和纵向平移步长皆为31像素,其子窗口划分示意图,如图1、图2和图3所示;(1) Divide the flawless fabric image into sub-windows with a size of 32×32 (pixels) in an overlapping manner, and the horizontal and vertical translation steps are both 31 pixels. As shown in Figure 3;
(2)将子窗口分别沿纵横方向投影,即计算子窗口中每列和每行的所有像素点灰度值的平均值,得到两个投影序列;然后,将所得的两个投影序列相接后得到联合投影序列;(2) Project the sub-windows along the vertical and horizontal directions respectively, that is, calculate the average value of the gray value of all pixels in each column and each row in the sub-window, and obtain two projection sequences; then, connect the obtained two projection sequences After that, the joint projection sequence is obtained;
(3)将所有子窗口对应的联合投影序列作为矩阵的列排列为一个矩阵,并对所得的矩阵实施奇异值分解;提取左奇异矩阵的前4列作为基向量D。(3) Arrange the joint projection sequences corresponding to all sub-windows as the columns of the matrix into a matrix, and perform singular value decomposition on the obtained matrix; extract the first 4 columns of the left singular matrix as the base vector D.
阈值的确定:首先对无瑕疵织物进行测试,得到其重构误差E的累计分布函数,然后选取对应于其累计分布函数为95%时的重构误差值作为阈值,所用阈值为28。Determination of the threshold: Firstly, the flawless fabric is tested to obtain the cumulative distribution function of its reconstruction error E, and then the reconstruction error value corresponding to the cumulative distribution function of 95% is selected as the threshold, and the threshold used is 28.
检测阶段detection stage
(1)将待检测图像,如图8所示,连续无重叠地划分成大小为32×32(像素)正方形的子窗口;(1) Divide the image to be detected, as shown in Figure 8, into sub-windows with a size of 32×32 (pixels) in a continuous and non-overlapping manner;
(2)按照训练阶段的方法,将子窗口分别沿纵横向投影,得到联合投影序列;(2) According to the method in the training phase, the sub-windows are projected vertically and horizontally respectively to obtain a joint projection sequence;
(3)应用所述基向量对检测阶段所得的联合投影序列进行重构,并通过计算其所得的重构误差E来判定子窗口是否包含瑕疵,实际检测结果如图9所示,其中黑色方框表示被判定为包含瑕疵的子窗口。(3) Apply the base vector to reconstruct the joint projection sequence obtained in the detection stage, and determine whether the sub-window contains defects by calculating the reconstruction error E obtained. The actual detection results are shown in Figure 9, where the black square Boxes represent subwindows judged to contain blemishes.
实施例4Example 4
训练阶段:Training phase:
(1)将无瑕疵织物图像有重叠地划分成大小为32×32(像素)正方形的子窗口,横向和纵向平移步长皆为31像素,其子窗口划分示意图,如图1、图2和图3所示;(1) Divide the flawless fabric image into sub-windows with a size of 32×32 (pixels) in an overlapping manner, and the horizontal and vertical translation steps are both 31 pixels. As shown in Figure 3;
(2)将子窗口分别沿纵横方向投影,即计算子窗口中每列和每行的所有像素点灰度值的平均值,得到两个投影序列;然后,将所得的两个投影序列相接后得到联合投影序列;(2) Project the sub-windows along the vertical and horizontal directions respectively, that is, calculate the average value of the gray value of all pixels in each column and each row in the sub-window, and obtain two projection sequences; then, connect the obtained two projection sequences After that, the joint projection sequence is obtained;
(3)将所有子窗口对应的联合投影序列作为矩阵的列排列为一个矩阵,并对所得的矩阵实施奇异值分解;提取左奇异矩阵的前16列作为基向量D。(3) Arrange the joint projection sequences corresponding to all sub-windows as the columns of the matrix into a matrix, and perform singular value decomposition on the obtained matrix; extract the first 16 columns of the left singular matrix as the base vector D.
阈值的确定:首先对无瑕疵织物进行测试,得到其重构误差E的累计分布函数,然后选取对应于其累计分布函数为95%时的重构误差值作为阈值,所用阈值为17。Determination of the threshold: Firstly, the flawless fabric is tested to obtain the cumulative distribution function of its reconstruction error E, and then the reconstruction error value corresponding to the cumulative distribution function of 95% is selected as the threshold, and the threshold used is 17.
检测阶段detection stage
(1)将待检测图像,如图10所示,连续无重叠地划分成大小为32×32(像素)正方形的子窗口;(1) The image to be detected, as shown in Figure 10, is continuously divided into sub-windows with a size of 32×32 (pixels) square;
(2)按照训练阶段的方法,将子窗口分别沿纵横向投影,得到联合投影序列;(2) According to the method in the training phase, the sub-windows are projected vertically and horizontally respectively to obtain a joint projection sequence;
(3)应用所述基向量对检测阶段所得的联合投影序列进行重构,并通过计算其所得的重构误差E来判定子窗口是否包含瑕疵,实际检测结果如图11所示,其中黑色方框表示被判定为包含瑕疵的子窗口。(3) Apply the base vector to reconstruct the joint projection sequence obtained in the detection stage, and determine whether the sub-window contains defects by calculating the reconstruction error E obtained. The actual detection results are shown in Figure 11, where the black square Boxes represent subwindows judged to contain blemishes.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310401043.6A CN103489182B (en) | 2013-09-05 | 2013-09-05 | A kind of fabric defects detection method based on image projection and svd |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310401043.6A CN103489182B (en) | 2013-09-05 | 2013-09-05 | A kind of fabric defects detection method based on image projection and svd |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103489182A CN103489182A (en) | 2014-01-01 |
CN103489182B true CN103489182B (en) | 2016-04-20 |
Family
ID=49829380
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310401043.6A Active CN103489182B (en) | 2013-09-05 | 2013-09-05 | A kind of fabric defects detection method based on image projection and svd |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103489182B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105426902B (en) * | 2015-09-16 | 2019-06-25 | 西安印钞有限公司 | Money quality detecting system and method based on deformation recovery technique |
CN107194920B (en) * | 2017-05-19 | 2019-07-19 | 山东财经大学 | A tire defect detection method based on singular value decomposition |
CN109345548B (en) * | 2018-10-23 | 2021-08-13 | 江南大学 | A Fabric Defect Segmentation Method Based on Total Variation |
CN110610484B (en) * | 2019-08-21 | 2022-04-12 | 西安理工大学 | A method for detecting the quality of printing dots based on rotational projection transformation |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20110124090A (en) * | 2010-05-10 | 2011-11-16 | 동우 화인켐 주식회사 | Quality Determination System and Method of Polarizing Film Disc |
CN102867299A (en) * | 2012-08-09 | 2013-01-09 | 东华大学 | Image analysis method based on singular value decomposition and method applied to defect detection of fabric |
CN102938151A (en) * | 2012-11-22 | 2013-02-20 | 中国人民解放军电子工程学院 | Method for detecting anomaly of hyperspectral image |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0742431B1 (en) * | 1995-05-10 | 2000-03-15 | Mahlo GmbH & Co. KG | Method and apparatus for detecting flaws in moving fabrics or the like |
-
2013
- 2013-09-05 CN CN201310401043.6A patent/CN103489182B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20110124090A (en) * | 2010-05-10 | 2011-11-16 | 동우 화인켐 주식회사 | Quality Determination System and Method of Polarizing Film Disc |
CN102867299A (en) * | 2012-08-09 | 2013-01-09 | 东华大学 | Image analysis method based on singular value decomposition and method applied to defect detection of fabric |
CN102938151A (en) * | 2012-11-22 | 2013-02-20 | 中国人民解放军电子工程学院 | Method for detecting anomaly of hyperspectral image |
Also Published As
Publication number | Publication date |
---|---|
CN103489182A (en) | 2014-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103473769B (en) | A kind of fabric defects detection method based on svd | |
CN103489182B (en) | A kind of fabric defects detection method based on image projection and svd | |
CN101256157B (en) | Surface defect detection method and device | |
CN106650770A (en) | Mura defect detection method based on sample learning and human visual characteristics | |
CN102867299B (en) | Image analysis method based on singular value decomposition and method applied to defect detection of fabric | |
CN105913396A (en) | Noise estimation-based image edge preservation mixed de-noising method | |
CN104008528B (en) | Nonuniform illumination Underwater Target Detection image enchancing method based on Threshold segmentation | |
CN104458766B (en) | A kind of cloth surface flaw detection method based on structural texture method | |
CN103646248B (en) | Foreign matter detecting method based on binocular line array CCD automobile chassis imaging | |
CN104809461A (en) | License plate recognition method and system combining sequence image super-resolution reconstruction | |
CN101976442B (en) | Fractal profile and Sobel operator filtering detail mixed feature vector extraction method for representing fabric texture | |
CN104778692A (en) | Fabric defect detection method based on sparse representation coefficient optimization | |
CN101976440B (en) | Sobel operator-based extraction method of profile and detail composite characteristic vector used for representing fabric texture | |
CN112288726A (en) | Method for detecting foreign matters on belt surface of underground belt conveyor | |
CN103247049A (en) | SMT (Surface Mounting Technology) welding spot image segmentation method | |
CN103473770B (en) | A kind of linear textiles flaw detection method based on rectangular window projection and singular value decomposition | |
CN109345548B (en) | A Fabric Defect Segmentation Method Based on Total Variation | |
Ma et al. | An algorithm for fabric defect detection based on adaptive canny operator | |
CN111915552B (en) | Method for detecting internal defects of solar cell | |
CN101976441A (en) | Method for extracting Sobel operator filtering profile for representing fabric texture and fractal detail mixed characteristic vector | |
CN107705284B (en) | Bayesian small sample learning-based surface defect detection method | |
CN116664421A (en) | Spacecraft image shadow removing method based on multi-illumination angle image fusion | |
CN110322437B (en) | A Fabric Defect Detection Method Based on Autoencoder and BP Neural Network | |
CN110687123A (en) | Rail defect detection method based on image reconstruction and block threshold segmentation | |
CN114565567A (en) | Defect detection method and device for complex textured lace cloth |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |