CN114627117A - Knitted fabric defect detection method and system based on projection method - Google Patents

Knitted fabric defect detection method and system based on projection method Download PDF

Info

Publication number
CN114627117A
CN114627117A CN202210516874.7A CN202210516874A CN114627117A CN 114627117 A CN114627117 A CN 114627117A CN 202210516874 A CN202210516874 A CN 202210516874A CN 114627117 A CN114627117 A CN 114627117A
Authority
CN
China
Prior art keywords
fabric
window
detected
slide block
curve
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
CN202210516874.7A
Other languages
Chinese (zh)
Other versions
CN114627117B (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.)
Qidong Hongsheng Textile Co ltd
Original Assignee
Qidong Hongsheng 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 Qidong Hongsheng Textile Co ltd filed Critical Qidong Hongsheng Textile Co ltd
Priority to CN202210516874.7A priority Critical patent/CN114627117B/en
Publication of CN114627117A publication Critical patent/CN114627117A/en
Application granted granted Critical
Publication of CN114627117B publication Critical patent/CN114627117B/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
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • 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

Abstract

The invention relates to the technical field of image processing, in particular to a knitted fabric defect detection method and system based on a projection method. The method comprises the following steps: obtaining a first slide block, a second slide block and a third slide block on a gray image of the fabric to be detected, wherein the first slide block and the third slide block form a suspected defect area, and judging whether the suspected defect area is a defect area or not by utilizing a warp curve and a weft curve of the third slide block obtained by a projection method; if the warp and weft curves between the third sliding blocks in the defect area are similar, the defect area is the same area; and taking a window in which the defect area in the gray image of the fabric to be detected is completely detected as an optimal window, and detecting the defects of the fabric by using the optimal window. The invention respectively detects the warp direction and the weft direction of the fabric by a projection method, improves the precision of fabric defect detection, simultaneously determines the optimal window for detection, reduces the calculated amount and improves the detection efficiency.

Description

Knitted fabric defect detection method and system based on projection method
Technical Field
The invention relates to the technical field of image processing, in particular to a knitted fabric defect detection method and system based on a projection method.
Background
In the production process of textiles, due to the fact that the varieties of fabrics are various and the state characteristics of defects of the fabrics are various due to the reasons of process, manpower, raw materials and the like, the prior art has relatively extensive and intensive research on the development of an automatic detection system of the defects of the fabrics, the defects of the fabrics are often detected by utilizing the mean value of the gray values of defect areas of the defects and the mean value of the gray values of normal areas, but the method has insufficient adaptability to the interference of noise and the similarity and diversity of the texture of the fabrics, and meanwhile, some defects of the fabrics cannot be accurately detected after the mean value of the gray values of the whole fabric image, and even some defects can be missed.
Disclosure of Invention
In order to solve the above technical problems, the present invention aims to provide a method and a system for detecting defects of knitted fabrics based on a projection method, wherein the adopted technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for detecting defects in a knitted fabric based on a projection method. The method comprises the following steps: obtaining a fabric image to be detected and graying to obtain a gray image of the fabric to be detected; traversing the gray level image of the fabric to be detected by using windows with different scales to obtain a plurality of sliding blocks, wherein the traversing step length is the side length of the window;
recording the slide blocks with difference in gray average value of the slide blocks at the same position in the gray image of the fabric to be detected and the normal gray image of the fabric as first slide blocks, and recording the slide blocks without difference as second slide blocks; taking the first slide block as a central slide block, and recording the central slide block as a third slide block if the adjacent slide blocks do not have the second slide block; the slide blocks of the first slide block and the third slide block form a suspected defect area, and the third slide block is a slide block in the suspected defect area;
fitting projection values of the third slider in the warp direction and the weft direction respectively to obtain a warp direction curve and a weft direction curve, wherein the projection values are gray level average values of pixel points of each row in each upward row or each upward row in the weft direction; if the similarity of the radial curve and the latitudinal curve of the suspected defect area corresponding to the corresponding position of the normal fabric gray level image is smaller than a preset threshold value, the suspected defect area is a defect area; if the warp and weft curves between the third sliding blocks in the defect area are similar, the defect area is the same area; and when the number of the defect areas is not increased along with the reduction of the size of the sliding window, the window with the corresponding size is the optimal window, and the defects of the fabric are detected by utilizing the optimal window.
Preferably, the window slides on the gray image of the fabric to be detected in the horizontal direction, a slider is obtained at each sliding position of the window, and the size of the slider is the same as that of the window.
Preferably, the windows of different dimensions comprise: setting an initial scale of a window, wherein the scale of the window is continuously reduced along with the traversal times of the fabric gray level image to be detected, and the traversal times are the detection times of the fabric gray level image to be detected.
Preferably, the step of marking the slider with the difference in the gray average value of the sliders at the same position in the gray image of the fabric to be detected and the normal gray image of the fabric as the first slider, and the step of marking the slider without difference as the second slider comprises the following steps: calculating the ratio of the gray average value of pixel points in a sliding block on the gray image of the fabric to be detected to the gray average value of the sliding block at the same position in the gray image of the normal fabric; and setting a first threshold, recording the slide block on the gray image of the fabric to be detected as a first slide block if the ratio is smaller than the first threshold, and recording the slide block on the gray image of the fabric to be detected as a second slide block if the ratio is not smaller than the first threshold.
Preferably, fitting the projection value of the third slider in the warp direction to obtain a warp direction curve includes; performing warp projection on the pixel points in the third sliding block to obtain projection values of all rows of pixel points in the warp upper sliding block, wherein the projection values are the mean values of gray values of all rows of pixel points; and fitting the projection values corresponding to the pixel points of each column to obtain a longitudinal curve.
Preferably, the step of obtaining the similarity between the warp curves and the weft curves of the suspected defect areas corresponding to the corresponding positions of the gray level images of the normal fabric comprises the following steps: obtaining a matched coordinate point by using a DTW algorithm to obtain a warp curve of the third sliding block and a warp curve of the sliding block at the same position of the gray level image of the normal fabric, and simultaneously obtaining the minimum distance of the matched coordinate point; carrying out weighted summation on the mean value and the variance of the distances of all matched coordinate points of the meridional curve to obtain the difference degree of the meridional curve; and similarly, obtaining the difference degree of the weft curves, wherein the reciprocal of the difference degree of the warp curves and the difference degree of the weft curves is the similarity of the warp curves and the weft curves in the third slide block at the same position of the gray level image of the normal fabric in the suspected defect area.
Preferably, if the warp and weft curves of the third slide block in the defect area are similar, the defect area is the same area and comprises: calculating the similarity of warp curves and weft curves between the third sliding blocks in the defect areas of the defects; and setting a second threshold, if the similarity of the warp curves and the weft curves is greater than the second threshold, the warp curves and the weft curves of the third sliding blocks in the defect areas are similar, and the defect areas are the same.
Preferably, when the number of defect areas no longer increases with the decrease of the sliding window dimension, the window of the corresponding dimension is an optimal window, and the detecting the defects of the fabric by using the optimal window comprises the following steps: traversing the gray level images of the fabrics to be detected by using windows with different scales to obtain the number of defect areas; fitting the number of defect areas corresponding to different scales of the window to obtain a defect area number curve, wherein the abscissa of the curve is the scale of the window, and the ordinate of the curve is the number of defect areas detected by the window with the corresponding scale; when the number curve of the defects tends to be stable, namely the window scale corresponding to the number of the defect areas of the defects is not changed is the optimal scale; and the optimal scale corresponding window is an optimal sliding window, and the optimal sliding window is utilized to detect the fabric.
In a second aspect, another embodiment of the present invention provides a system for detecting defects in knitted fabric based on projection. The system comprises: the sliding block acquisition module is used for acquiring a fabric image to be detected and graying the fabric image to be detected to obtain a gray image of the fabric to be detected; traversing the gray level image of the fabric to be detected by using windows with different scales to obtain a plurality of sliding blocks, wherein the traversing step length is the side length of the window;
the suspected defect area acquisition module is used for recording a slide block with difference in gray average value of slide blocks at the same position in the gray image of the fabric to be detected and the gray image of the normal fabric as a first slide block and recording a slide block without difference as a second slide block; taking the first sliding block as a central sliding block, and if the second sliding block does not exist in the adjacent sliding blocks, marking the central sliding block as a third sliding block; the slide blocks of the first slide block and the third slide block form a suspected defect area, and the third slide block is a slide block in the suspected defect area;
the optimal sliding window acquisition module is used for fitting the projection values of the third slider in the warp direction and the weft direction respectively to obtain a warp direction curve and a weft direction curve, wherein the projection values are gray level average values of pixel points of each row in the warp direction and each column in the weft direction; if the similarity of the radial curve and the latitudinal curve of the suspected defect area corresponding to the corresponding position of the normal fabric gray image is less than a preset threshold value, the suspected defect area is a defect area; if the warp and weft curves between the third sliding blocks in the defect area are similar, the defect area is the same area; and when the number of the defect areas is not increased along with the reduction of the size of the sliding window, the window with the corresponding size is the optimal window, and the defects of the fabric are detected by utilizing the optimal window.
Preferably, the optimal sliding window acquisition module is further configured to detect the gray level image of the fabric to be detected by traversing windows of different scales, so as to obtain the number of defect areas; fitting the number of defect areas corresponding to different scales of the window to obtain a defect area number curve, wherein the abscissa of the curve is the scale of the window, and the ordinate of the curve is the number of defect areas detected by the window with the corresponding scale; when the number curve of the defects tends to be stable, namely the window scale corresponding to the number of the defect areas of the defects is not changed is the optimal scale; and the optimal scale corresponding window is an optimal sliding window, and the optimal sliding window is utilized to detect the fabric.
The embodiment of the invention at least has the following beneficial effects: compared with the method for detecting the defects of the fabric by processing the gray value of the whole image, the method for detecting the defects of the fabric detects the defects of the fabric by further utilizing the characteristic change of the pixel points after the pixel points in the sliding window are subjected to warp and weft projection on the basis of judging whether the fabric has the defects by utilizing the gray value of the pixel points in the sliding window, so that the detection process is more refined, and the detection efficiency is improved; meanwhile, the sliding window with the minimum dimension for detecting all the defect areas is determined according to different numbers of the defect areas detected by different windows, so that the defects of the fabric can be completely detected, the detection calculated amount is reduced, and the detection efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a knitted fabric defect detection method based on a projection method.
Figure 2 is a graph of the number of defective areas.
Detailed Description
In order to further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the embodiments, structures, features and effects of the method and system for detecting defects of knitted fabric based on projection method according to the present invention is provided with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of a knitted fabric defect detection method based on a projection method in detail with reference to the accompanying drawings.
Example 1
The main application scenarios of the invention are as follows: in the production process of the fabric, the produced fabric is subjected to defect detection, and the fabric with the detected defects is subjected to secondary treatment.
Referring to fig. 1, a flowchart of a method for detecting defects of a knitted fabric based on a projection method according to an embodiment of the present invention is shown, where the method includes the following steps:
the method comprises the following steps: obtaining a fabric image to be detected and graying to obtain a gray image of the fabric to be detected; and traversing the gray level image of the fabric to be detected by using windows with different scales to obtain a plurality of sliding blocks, wherein the traversing step length is the side length of the window.
The method comprises the steps of collecting an image of the fabric in the production process, graying the image to obtain a grayed image of the fabric to be detected, wherein in order to enable the image to be clear and convenient to detect, the image collected by the embodiment has a resolution of 1200dpi, the size of the collected image is n multiplied by n, and n is the number of pixel points. While obtaining a normal fabric gray-scale image without defects.
The window is set to slide on the fabric image, in this embodiment, the size of the window is determined by the number of pixels in the sliding window and the resolution, and the unit of the resolution is given as dpi. dpi indicates the number of pixels per inch of length, e.g., when the number of pixels in the sliding window is 100 × 100, the given resolution is 1200 dpi. 1200dpi indicates that there are 1200 pixels in one inch of length, and the size of one pixel can be obtained:
Figure DEST_PATH_IMAGE002
and if there are 100 × 100 pixels in the window, the side length of the window can be determined as follows:
Figure DEST_PATH_IMAGE004
. In this embodiment, the initial dimension of the window is set to
Figure DEST_PATH_IMAGE006
The scale of the sliding window is continuously updated, namely the sliding window with one scale detects the gray level image of the fabric to be detected once; the updating process of the dimension of the window is a continuously decreasing process, such as the current dimension being
Figure 760510DEST_PATH_IMAGE006
After the sliding window detects the gray level image of the fabric to be detected, the scale of the sliding window for next detection is
Figure DEST_PATH_IMAGE008
The embodiment takes the dimension as
Figure DEST_PATH_IMAGE010
The sliding window is used as an example, the window slides on the gray image to be detected by taking the side length of the window as a step length, a sliding block is obtained when the window slides one position each time, and the scale of the sliding block is the same as that of the window. Similarly using the scale of
Figure 818596DEST_PATH_IMAGE010
The window (a) slides in the normal fabric gray image to obtain the slider in the normal gray image.
Step two: recording the slide block with difference in the gray average value of the slide blocks at the same position in the gray image of the fabric to be detected and the normal gray image of the fabric as a first slide block, and recording the slide block without difference as a second slide block; taking the first slide block as a central slide block, and recording the central slide block as a third slide block if the adjacent slide blocks do not have the second slide block; and the third slide block is a slide block in the suspected defect area.
Calculating the average gray value of each sliding block in the gray image of the fabric to be detected:
Figure DEST_PATH_IMAGE012
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE014
the average gray value of the sliding block in the gray image of the fabric to be detected;
Figure DEST_PATH_IMAGE016
expressing the gray value of the ith pixel point in the slider in the gray image of the fabric to be detected;
Figure DEST_PATH_IMAGE018
to representThe number of pixel points in the slider.
Similarly, the average gray value of the pixel points of the sliding block in the normal fabric gray image is obtained
Figure DEST_PATH_IMAGE020
Obtaining the ratio of the average gray value of the slider in the gray image of the fabric to be detected to the average gray value of the pixel points of the slider at the same position in the gray image of the normal fabric:
Figure DEST_PATH_IMAGE022
setting a first threshold, preferably, the first threshold in this embodiment is 0.95, if the ratio of the average gray value of a certain slider in the gray-scale image of the fabric to be detected to the average gray value of the pixel points of the slider at the same position in the gray-scale image of the normal fabric is smaller than the average gray value of the pixel points of the slider at the same position in the gray-scale image of the fabric to be detected
Figure DEST_PATH_IMAGE024
If the value is smaller than the first threshold value, recording the slide block in the gray level image of the fabric to be detected as a first slide block; if the ratio of the average gray value of a certain slider in the gray image of the fabric to be detected to the average gray value of the pixel points of the slider at the same position in the gray image of the normal fabric
Figure 224431DEST_PATH_IMAGE024
If the sliding block is larger than the first threshold value, recording the sliding block in the gray level image of the fabric to be detected as a second sliding block; the same position is that the positions of the sliders in the gray level image of the fabric to be detected and the normal gray level image of the fabric are the same, for example, the positions of the first slider obtained when the window slides in the gray level image of the fabric to be detected and the first slider obtained in the gray level image of the normal fabric are the same, and the gray level average value of the sliders in the same position is selected for comparison so as to reduce the interference of other factors on the comparison, such as the texture of the fabric.
After marking the sliding blocks in the gray level image of the fabric to be detected, taking the first sliding block as a central sliding block to search for the sliding blocks in the eight adjacent areas, and if the sliding blocks in the eight adjacent areas have the sliding blocks marked as second sliding blocks, keeping the central sliding block unchanged; and if the slide blocks in the eight adjacent areas are not marked as the slide blocks of the second slide block when the first slide block is used as the central slide block, changing and marking the first slide block as a third slide block. After eight-neighborhood searching is carried out on all the first sliding blocks in the gray scale image to be detected, the first sliding blocks and the third sliding blocks in the image form a plurality of suspected defect areas.
Step three: fitting projection values of the third slider in the warp direction and the weft direction respectively to obtain a warp direction curve and a weft direction curve, wherein the projection values are gray level average values of pixel points of each upward row of the warp direction or each upward row of the weft direction; if the similarity of the radial curve and the latitudinal curve of the suspected defect area corresponding to the corresponding position of the normal fabric gray level image is smaller than a preset threshold value, the suspected defect area is a defect area; if the warp and weft curves between the third sliding blocks in the defect area are similar, the defect area is the same area; and when the number of the defect areas is not increased along with the reduction of the size of the sliding window, the window with the corresponding size is the optimal window, and the defects of the fabric are detected by utilizing the optimal window.
Whether the suspected fabric defect area in the gray image of the fabric to be detected is the fabric defect area or not needs to be judged more accurately by a projection method. Performing radial projection on the pixel points in the third slider to obtain an average gray value of each row of pixel points during radial projection, wherein the average gray value is a projection value of the third slider during radial projection, and the formula is as follows:
Figure DEST_PATH_IMAGE026
wherein, the first and the second end of the pipe are connected with each other,
Figure DEST_PATH_IMAGE028
representing projection values corresponding to pixel points of each column when performing radial projection; m represents the number of pixel points in each column,
Figure DEST_PATH_IMAGE030
Figure DEST_PATH_IMAGE032
expressing the gray value of each row of pixel points; x denotes the number of rows in the third slider and y denotes the number of columns in the third slider. Fitting by using the projection value of the radial projection and the corresponding column number to obtain a radial curve of the third slider
Figure DEST_PATH_IMAGE034
And simultaneously, carrying out latitudinal projection on the pixel points in the third sliding block, wherein the projection value is expressed by a formula as follows:
Figure DEST_PATH_IMAGE036
wherein y represents the number of rows of the third slider performing the latitudinal projection, and x represents the number of columns in the slider when the third slider performs the latitudinal projection. Similarly, fitting is carried out by utilizing the projection value of the latitudinal projection and the corresponding line number to obtain the latitudinal curve of the third slider
Figure DEST_PATH_IMAGE038
Obtaining a warp curve obtained when the slider in the normal gray image and at the same position as the third slider are projected by the method for obtaining the third slider in the gray image of the fabric to be detected
Figure DEST_PATH_IMAGE040
And the latitudinal curve
Figure DEST_PATH_IMAGE042
. By curve in the warp direction
Figure 935421DEST_PATH_IMAGE034
And curve in the warp direction
Figure 953056DEST_PATH_IMAGE040
For example, matching coordinate points in the curve are obtained by using the DTW algorithm, and the minimum distance between the matching coordinate points is recorded as
Figure DEST_PATH_IMAGE044
Obtaining a meridional curve using the variance and mean of the distances between paired coordinate points
Figure 854147DEST_PATH_IMAGE034
And curve in the warp direction
Figure 652339DEST_PATH_IMAGE040
Degree of difference of (a):
Figure DEST_PATH_IMAGE046
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE048
is the average of the distances between paired coordinate points,
Figure DEST_PATH_IMAGE050
also represents the average of the distances between paired coordinate points,
Figure DEST_PATH_IMAGE052
is the variance of the distance between paired coordinate points;
Figure 369015DEST_PATH_IMAGE044
the distance between the ith paired coordinate points; e is the number of coordinate points of the matched pair;
Figure DEST_PATH_IMAGE054
a weight that is the mean of the distances between paired coordinate points,
Figure DEST_PATH_IMAGE056
is the weight of the variance of the distance between paired coordinate points, preferably,
Figure 615058DEST_PATH_IMAGE054
the value of (a) is 0.5,
Figure 811684DEST_PATH_IMAGE056
is 0.5. It is composed ofThe mean value of the distance between the coordinate points in the middle pair represents the difference of the gray values on the two warp curves, the variance represents the difference of the shapes of the two warp curves, and both are inversely proportional to the overall similarity of the two warp curves, i.e. when the mean value is smaller, the variance is smaller, the warp curve is smaller
Figure 97172DEST_PATH_IMAGE034
And curve in the warp direction
Figure 240708DEST_PATH_IMAGE040
The higher the degree of similarity, the lower the degree of difference.
Simultaneously obtaining the latitudinal curve in the third slide block in the gray level image of the fabric to be detected
Figure 295252DEST_PATH_IMAGE038
Latitudinal curve of slide block at same position in gray level image of normal fabric
Figure 361647DEST_PATH_IMAGE042
Degree of similarity of (2)
Figure DEST_PATH_IMAGE058
(ii) a According to the degree of similarity of warp curves
Figure DEST_PATH_IMAGE060
Similarity to weft curve
Figure 744218DEST_PATH_IMAGE058
Obtaining the similarity of warp curves and weft curves of a third slide block in the gray image of the fabric to be detected and a slide block at the same position in the gray image of the normal fabric:
Figure DEST_PATH_IMAGE062
setting a preset threshold value to be 0.1, and if the similarity between a warp curve and a weft curve is less than 0.1, determining that a defect exists at the position of the third slide block in the gray level image of the fabric to be detected; and if the third slide blocks contained in the suspected defect area are determined to have defects, the suspected defect area is the defect area.
Meanwhile, whether the third sliding blocks in the defect areas of the defects are similar or not is determined by using a projection method, and the similarity omega of the warp curve and the weft curve between the third sliding blocks in the defect areas of the defects is calculated by using a method for calculating the similarity of the warp curve and the weft curve of the third sliding blocks in the gray image of the fabric to be detected and the sliding blocks at the same positions in the gray image of the normal fabric. And setting a second threshold, preferably setting the second threshold to be 0.9, and if the similarity ω of the warp curves and the weft curves between the third sliders in the defect area is greater than the second threshold, and at this time, the warp curves and the weft curves between the third sliders in the defect area are both similar, then the defect area is the same defect area, and the third sliders in the defect area are not all completely similar, then taking the number of the dissimilar third sliders as the number of defect areas included in the defect area.
Obtaining
Figure 222604DEST_PATH_IMAGE010
The number of defect areas detected by a sliding window of a scale is obtained, the number of defect areas in a to-be-detected fabric gray image detected by the sliding window of each scale is obtained, the scale of the sliding window is taken as an abscissa, the number of the detected defect areas in the to-be-detected fabric gray image is taken as an ordinate fitting curve to obtain a defect area number curve, when the number of the defect areas is not increased, namely when the scale corresponding to a break point with the slope k of the defect area number curve being 0 is an optimal scale, namely the scale corresponding to a Z point in a defect area number curve graph of FIG. 2 is taken as an optimal sliding window, the sliding window under the scale is the optimal sliding window.
In the actual production process, the determined optimal sliding window is combined with the gray value in the window to detect the fabric produced by the production line by using a projection method, and when the defect of the produced fabric is found, the produced fabric is recovered to carry out secondary treatment.
Example 2
The present embodiment provides a system embodiment. A knitted fabric defect detection system based on a projection method comprises the following components: the sliding block acquisition module is used for acquiring a to-be-detected fabric image and graying the to-be-detected fabric image to obtain a to-be-detected fabric grayscale image; traversing the gray level image of the fabric to be detected by using windows with different scales to obtain a plurality of sliding blocks, wherein the traversing step length is the side length of the window;
the suspected defect area acquisition module is used for recording a slide block with difference in gray average value of slide blocks at the same position in the gray image of the fabric to be detected and the gray image of the normal fabric as a first slide block and recording a slide block without difference as a second slide block; taking the first slide block as a central slide block, and recording the central slide block as a third slide block if the adjacent slide blocks do not have the second slide block; the slide blocks of the first slide block and the third slide block form a suspected defect area, and the third slide block is a slide block in the suspected defect area;
the optimal sliding window acquisition module is used for fitting the projection values of the third slider in the warp direction and the weft direction respectively to obtain a warp direction curve and a weft direction curve, wherein the projection values are gray level average values of pixel points in each row in the warp direction or each row in the weft direction; if the similarity of the radial curve and the latitudinal curve of the suspected defect area corresponding to the corresponding position of the gray level image of the normal fabric is smaller than a preset threshold value, the suspected defect area is a defect area; if the warp and weft curves between the third sliding blocks in the defect area are similar, the defect area is the same area; and when the number of the defect areas is not increased along with the reduction of the size of the sliding window, the window with the corresponding size is the optimal window, and the defects of the fabric are detected by utilizing the optimal window.
Preferably, the optimal sliding window acquisition module is further configured to detect a gray level image of the fabric to be detected by traversing windows of different scales, so as to obtain the number of defect areas; fitting the number of the defect areas corresponding to different scales of the window to obtain a defect area number curve, wherein the abscissa of the curve is the scale of the window, and the ordinate of the curve is the number of the defect areas detected by the window with the corresponding scale; when the number curve of the defects tends to be stable, namely the window scale corresponding to the number of the defect areas of the defects is not changed is the optimal scale; and the optimal scale corresponding window is an optimal sliding window, and the optimal sliding window is utilized to detect the fabric.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents, improvements, etc. within the spirit and scope of the present invention.

Claims (10)

1. A knitted fabric defect detection method based on a projection method is characterized by comprising the following steps: obtaining a fabric image to be detected and graying to obtain a gray image of the fabric to be detected; traversing the gray level image of the fabric to be detected by using windows with different scales to obtain a plurality of sliders, wherein the traversing step length is the side length of the window;
recording the slide blocks with difference in gray average value of the slide blocks at the same position in the gray image of the fabric to be detected and the normal gray image of the fabric as first slide blocks, and recording the slide blocks without difference as second slide blocks; taking the first slide block as a central slide block, and recording the central slide block as a third slide block if the adjacent slide blocks do not have the second slide block; the slide blocks of the first slide block and the third slide block form a suspected defect area, and the third slide block is a slide block in the suspected defect area;
fitting projection values of the third slider in the warp direction and the weft direction respectively to obtain a warp direction curve and a weft direction curve, wherein the projection values are gray level average values of pixel points of each row in each upward row or each upward row in the weft direction; if the similarity of the radial curve and the latitudinal curve of the suspected defect area corresponding to the corresponding position of the normal fabric gray image is less than a preset threshold value, the suspected defect area is a defect area; if the warp and weft curves between the third sliding blocks in the defect area are similar, the defect area is the same area; and when the number of the defect areas is not increased along with the reduction of the size of the sliding window, the window with the corresponding size is the optimal window, and the defects of the fabric are detected by utilizing the optimal window.
2. The method for detecting defects of knitted fabrics based on a projection method according to claim 1, wherein the traversing the gray-scale image of the fabric to be detected by using the windows with different scales to obtain a plurality of sliders comprises: the window slides on the gray level image of the fabric to be detected in the horizontal direction, a sliding block is obtained when the window slides at each position, and the size of the sliding block is the same as that of the window.
3. The method for detecting defects of knitted fabric based on projection method as claimed in claim 1, wherein the windows with different dimensions comprise: setting an initial scale of a window, wherein the scale of the window is continuously reduced along with the traversal times of the fabric gray level image to be detected, and the traversal times are the detection times of the fabric gray level image to be detected.
4. The method for detecting defects of knitted fabrics based on the projection method as claimed in claim 1, wherein the step of marking the slider with difference in gray average value of the sliders at the same position in the gray image of the fabric to be detected and the gray image of the normal fabric as a first slider and the step of marking the slider without difference as a second slider comprises the steps of: calculating the ratio of the gray average value of pixel points in a sliding block on the gray image of the fabric to be detected to the gray average value of the sliding block at the same position in the gray image of the normal fabric; and setting a first threshold, recording the slide block on the gray image of the fabric to be detected as a first slide block if the ratio is smaller than the first threshold, and recording the slide block on the gray image of the fabric to be detected as a second slide block if the ratio is not smaller than the first threshold.
5. The method for detecting defects of knitted fabric based on the projection method as claimed in claim 1, wherein the step of fitting the projection value of the third slide block in the warp direction to obtain a warp direction curve comprises; performing warp projection on the pixel points in the third sliding block to obtain projection values of all rows of pixel points in the warp upper sliding block, wherein the projection values are the mean values of gray values of all rows of pixel points; and fitting the projection values corresponding to the pixel points of each column to obtain a longitudinal curve.
6. The method for detecting defects of knitted fabrics based on projection method according to claim 1, characterized in that the step of obtaining the similarity of the warp direction curve and the weft direction curve of the suspected defect area corresponding to the corresponding position of the gray scale image of the normal fabric comprises: obtaining a matched coordinate point by using a DTW algorithm to obtain a warp curve of the third sliding block and a warp curve of the sliding block at the same position of the gray level image of the normal fabric, and simultaneously obtaining the minimum distance of the matched coordinate point; carrying out weighted summation on the mean value and the variance of the distances of all matched coordinate points of the meridional curve to obtain the difference degree of the meridional curve; and similarly, obtaining the difference degree of the weft curves, wherein the reciprocal of the difference degree of the warp curves and the difference degree of the weft curves is the similarity of the warp curves and the weft curves in the third slide block at the same position of the gray level image of the normal fabric in the suspected defect area.
7. The method according to claim 1, wherein the step of identifying the defective area as the same area if the warp and weft curves of the third blocks in the defective area are similar comprises: calculating the similarity of warp curves and weft curves between the third sliding blocks in the defect areas of the defects; and setting a second threshold, if the similarity of the warp curves and the weft curves is greater than the second threshold, the warp curves and the weft curves of the third sliding blocks in the defect areas are similar, and the defect areas are the same.
8. The method for detecting defects of knitted fabrics based on projection method according to claim 1, wherein when the number of defect areas no longer increases with the decrease of the dimension of the sliding window, the window of the corresponding dimension is the optimal window, and the detecting the defects of the knitted fabrics by using the optimal window comprises: traversing and detecting the gray level image of the fabric to be detected by using windows with different scales to obtain the number of defect areas; fitting the number of defect areas corresponding to different scales of the window to obtain a defect area number curve, wherein the abscissa of the curve is the scale of the window, and the ordinate of the curve is the number of defect areas detected by the window with the corresponding scale; when the number curve of the defects tends to be stable, namely the window scale corresponding to the number of the defect areas of the defects is not changed is the optimal scale; and the optimal scale corresponding window is an optimal sliding window, and the optimal sliding window is utilized to detect the fabric.
9. A knitted fabric defect detection system based on a projection method is characterized by comprising the following components: the sliding block acquisition module is used for acquiring a to-be-detected fabric image and graying the to-be-detected fabric image to obtain a to-be-detected fabric grayscale image; traversing the gray level image of the fabric to be detected by using windows with different scales to obtain a plurality of sliding blocks, wherein the traversing step length is the side length of the window;
the suspected defect area acquisition module is used for recording the slide blocks with difference in gray average value of the slide blocks at the same positions in the gray image of the fabric to be detected and the gray image of the normal fabric as first slide blocks, and recording the slide blocks without difference as second slide blocks; taking the first slide block as a central slide block, and recording the central slide block as a third slide block if the adjacent slide blocks do not have the second slide block; the slide blocks of the first slide block and the third slide block form a suspected defect area, and the third slide block is a slide block in the suspected defect area;
the optimal sliding window acquisition module is used for fitting the projection values of the third slider in the warp direction and the weft direction respectively to obtain a warp direction curve and a weft direction curve, wherein the projection values are gray level average values of pixel points in each row in the warp direction or each row in the weft direction; if the similarity of the radial curve and the latitudinal curve of the suspected defect area corresponding to the corresponding position of the normal fabric gray image is less than a preset threshold value, the suspected defect area is a defect area; if the warp and weft curves between the third sliding blocks in the defect area are similar, the defect area is the same area; and when the number of the defect areas is not increased along with the reduction of the scale of the sliding window, the window with the corresponding scale is an optimal window, and the defects of the fabric are detected by utilizing the optimal window.
10. The knitted fabric defect detection system based on the projection method according to claim 9, wherein the optimal sliding window acquisition module is further configured to detect the gray level image traversal of the knitted fabric to be detected by using windows with different scales to obtain the number of defect areas; fitting the number of defect areas corresponding to different scales of the window to obtain a defect area number curve, wherein the abscissa of the curve is the scale of the window, and the ordinate of the curve is the number of defect areas detected by the window with the corresponding scale; when the number curve of the defects tends to be stable, namely the window scale corresponding to the number of the defect areas of the defects is not changed is the optimal scale; and the optimal scale corresponding window is an optimal sliding window, and the optimal sliding window is utilized to detect the fabric.
CN202210516874.7A 2022-05-13 2022-05-13 Knitted fabric defect detection method and system based on projection method Active CN114627117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210516874.7A CN114627117B (en) 2022-05-13 2022-05-13 Knitted fabric defect detection method and system based on projection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210516874.7A CN114627117B (en) 2022-05-13 2022-05-13 Knitted fabric defect detection method and system based on projection method

Publications (2)

Publication Number Publication Date
CN114627117A true CN114627117A (en) 2022-06-14
CN114627117B CN114627117B (en) 2022-07-15

Family

ID=81906983

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210516874.7A Active CN114627117B (en) 2022-05-13 2022-05-13 Knitted fabric defect detection method and system based on projection method

Country Status (1)

Country Link
CN (1) CN114627117B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114782416A (en) * 2022-06-16 2022-07-22 启东市固德防水布有限公司 Textile quality detection method and system based on image recognition
CN114998333A (en) * 2022-08-02 2022-09-02 山东第一医科大学(山东省医学科学院) Computer vision detection method and system for light source characteristics
CN115082460A (en) * 2022-08-18 2022-09-20 聊城市恒丰电子有限公司 Weaving production line quality monitoring method and system
CN115115615A (en) * 2022-07-26 2022-09-27 南通好心情家用纺织品有限公司 Textile fabric quality evaluation method and system based on image recognition
CN115239704A (en) * 2022-09-19 2022-10-25 南通友联新材料科技有限公司 Accurate detection and repair method for wood surface defects
CN115311298A (en) * 2022-10-12 2022-11-08 南通舒芯居纺织品有限公司 Textile quality detection method
CN115311300A (en) * 2022-10-12 2022-11-08 南通美乐柯材料科技有限公司 Saw blade defect detection method
CN115319979A (en) * 2022-10-12 2022-11-11 江苏明锋食品有限公司 Gum dipping control method for protective gloves
CN116740065B (en) * 2023-08-14 2023-11-21 山东伟国板业科技有限公司 Quick tracing method and system for defective products of artificial board based on big data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354847A (en) * 2015-11-10 2016-02-24 浙江大学 Fruit surface defect detection method based on adaptive segmentation of sliding comparison window
CN108414525A (en) * 2018-01-30 2018-08-17 广东溢达纺织有限公司 Fabric defect detection method, device, computer equipment and storage medium
CN110084246A (en) * 2019-04-17 2019-08-02 江南大学 A kind of yarn dyed fabric fault automatic identifying method
CN113989542A (en) * 2021-09-27 2022-01-28 浙江大学绍兴微电子研究中心 Texture image defect classification system and method based on multi-resolution feature fusion

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354847A (en) * 2015-11-10 2016-02-24 浙江大学 Fruit surface defect detection method based on adaptive segmentation of sliding comparison window
CN108414525A (en) * 2018-01-30 2018-08-17 广东溢达纺织有限公司 Fabric defect detection method, device, computer equipment and storage medium
CN110084246A (en) * 2019-04-17 2019-08-02 江南大学 A kind of yarn dyed fabric fault automatic identifying method
CN113989542A (en) * 2021-09-27 2022-01-28 浙江大学绍兴微电子研究中心 Texture image defect classification system and method based on multi-resolution feature fusion

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李玲玲: "基于滑动窗口的遥感图像人造目标检测算法", 《厦门大学学报》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114782416A (en) * 2022-06-16 2022-07-22 启东市固德防水布有限公司 Textile quality detection method and system based on image recognition
CN114782416B (en) * 2022-06-16 2023-09-05 济宁爱丝制衣股份有限公司 Textile quality detection method and system based on image recognition
CN115115615A (en) * 2022-07-26 2022-09-27 南通好心情家用纺织品有限公司 Textile fabric quality evaluation method and system based on image recognition
CN115115615B (en) * 2022-07-26 2022-12-13 南通好心情家用纺织品有限公司 Textile fabric quality evaluation method and system based on image recognition
CN114998333A (en) * 2022-08-02 2022-09-02 山东第一医科大学(山东省医学科学院) Computer vision detection method and system for light source characteristics
CN114998333B (en) * 2022-08-02 2022-10-25 山东第一医科大学(山东省医学科学院) Computer vision detection method and system for light source characteristics
CN115082460A (en) * 2022-08-18 2022-09-20 聊城市恒丰电子有限公司 Weaving production line quality monitoring method and system
CN115239704A (en) * 2022-09-19 2022-10-25 南通友联新材料科技有限公司 Accurate detection and repair method for wood surface defects
CN115311298A (en) * 2022-10-12 2022-11-08 南通舒芯居纺织品有限公司 Textile quality detection method
CN115311300A (en) * 2022-10-12 2022-11-08 南通美乐柯材料科技有限公司 Saw blade defect detection method
CN115319979A (en) * 2022-10-12 2022-11-11 江苏明锋食品有限公司 Gum dipping control method for protective gloves
CN116740065B (en) * 2023-08-14 2023-11-21 山东伟国板业科技有限公司 Quick tracing method and system for defective products of artificial board based on big data

Also Published As

Publication number Publication date
CN114627117B (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN114627117B (en) Knitted fabric defect detection method and system based on projection method
CN114937055B (en) Image self-adaptive segmentation method and system based on artificial intelligence
CN114140462B (en) Bearing wear degree assessment method based on image processing
CN115829883A (en) Surface image denoising method for dissimilar metal structural member
CN114638827B (en) Visual detection method and device for impurities of lubricating oil machinery
CN107092871B (en) Remote sensing image building detection method based on multiple dimensioned multiple features fusion
CN114758185B (en) Injection molding parameter control method and system based on gray level chromatic aberration
CN114820773B (en) Silo transport vehicle carriage position detection method based on computer vision
CN110533686B (en) Method and system for judging whether line frequency of linear array camera is matched with object motion speed
CN111353993A (en) Thread angle measuring method based on machine vision
US20050140664A1 (en) Image angle detection device and scan line interpolation device having the same
CN114782329A (en) Bearing defect damage degree evaluation method and system based on image processing
CN112378350B (en) Flatness detection method for PIN PIN of network transformer
CN115115637B (en) Cloth defect detection method based on image pyramid thought
CN116385450A (en) PS sheet wear resistance detection method based on image processing
CN112465895A (en) Bubble volume calculation method in air tightness detection based on computer vision
CN116309671B (en) Geosynthetic fabric quality detection system
CN116416268B (en) Method and device for detecting edge position of lithium battery pole piece based on recursion dichotomy
CN114881965A (en) Wood board joint detection method based on artificial intelligence and image processing
CN115311289A (en) Method for detecting oil stain defects of plain-color cloth
CN113989542A (en) Texture image defect classification system and method based on multi-resolution feature fusion
CN1215286A (en) Motion compensation device and method matched by gradient mode
US4876729A (en) Method of identifying objects
CN117058137B (en) Visual inspection method for production quality of laminated glass
CN115861220A (en) Cold-rolled strip steel surface defect detection method and system based on improved SSD algorithm

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