A grey cloth foreign matter identification method, system, computer device, and storage medium
By converting the fabric image from RGB to HSV color space and dividing it into a nine-grid layout, calculating LBP feature values and gradient histograms, and combining this with an SVM classifier, the problem of misidentification of foreign objects on the loom was solved, and the identification accuracy was improved.
Patent Information
- Application Number
- CN202210958843.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-10
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-08-10
AI Technical Summary
On the loom, foreign objects are mistakenly identified as defects, affecting the normal operation of the weaving inspection equipment. Existing technology makes it difficult to effectively distinguish between foreign objects and normal textures on the fabric.
The fabric image is converted from RGB color space to HSV color space, divided into a nine-grid layout, and the LBP feature values of the H, S, and V channels of each region are calculated and rotated. Foreign objects in the fabric image are identified by classifying them using the LBP feature values of the S and V channels, and then classified using an SVM linear classifier.
It enables effective identification of foreign objects in fabric images, reduces the false identification rate, and improves the accuracy of weaving inspection equipment.
Smart Images

Figure CN115272770B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of foreign object identification technology, and more specifically, to a method, system, computer device, and storage medium for identifying foreign objects in raw fabric. Background Technology
[0002] In the process of defect detection on a loom, in addition to detecting defects in the greige fabric, it is also necessary to eliminate external interference during the defect detection process. In the process of inspecting the loom by the loom operator in the weaving workshop, flashlights and other debris are often placed on the fabric surface of the loom. After these non-fabric surface objects are placed on the fabric surface, they will have a significant impact on the weaving and inspection equipment. They are often recalled as defects woven in by foreign objects, but in fact, foreign objects are not defects. This has a significant impact on the weaving and inspection robot, so there is still room for improvement. Summary of the Invention
[0003] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a method, system, computer equipment and storage medium for identifying foreign objects on fabric, which has the advantage of being able to identify foreign objects on fabric.
[0004] The above-mentioned technical objective of the present invention is achieved through the following technical solution: a method for identifying foreign objects in greige fabric, comprising:
[0005] Convert the RGB values of the raw fabric image to HSV values in the HSV color space;
[0006] The fabric image is divided into a nine-grid layout, and the LBP feature values of the H, S, and V channels of the fabric image in each nine-grid layout are calculated.
[0007] Rotate the LBP feature values of the fabric images in each of the nine grids in the H, S and V channels to obtain the corresponding rotation-invariant LBP feature values;
[0008] Based on each rotation-invariant LBP eigenvalue, plot the gradient histograms of the H, S, and V channels of the fabric image in each of the nine grids.
[0009] The gradient histograms corresponding to the H, S, and V channels of the fabric images in each of the nine grids are normalized to obtain the feature vector of the fabric image.
[0010] Based on the feature vector of the fabric image, an SVM linear classifier is used to classify and identify foreign objects in the fabric image.
[0011] Optionally, the step of dividing the fabric image into a nine-grid layout and calculating the LBP feature values of the H, S, and V channels of the fabric image within each nine-grid layout in the HSV color space includes:
[0012] Divide the greige fabric image into a nine-grid structure to obtain nine greige fabric image blocks;
[0013] Divide each fabric pattern into a nine-grid layout to obtain nine fabric regions corresponding to each fabric pattern.
[0014] The LBP values of the nine fabric regions in each fabric patch in the HV color space are calculated to obtain the LBP feature values of each fabric patch in the H channel.
[0015] The LBP values of the nine fabric regions in each fabric patch in the S channel of the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the S channel.
[0016] The LBP values of the V channel corresponding to the nine fabric regions in each fabric patch in the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the V channel.
[0017] Optionally, rotating the LBP feature values of the fabric images within each 3x3 grid in the H, S, and V channels to obtain the corresponding rotation-invariant LBP feature values includes:
[0018] Rotate the LBP feature values of the nine fabric regions in each fabric block in the H channel to obtain the rotation-invariant LBP feature values of the nine fabric regions in the H channel of the corresponding fabric block.
[0019] Rotate the LBP feature values of the nine fabric regions in the S channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the S channel of the corresponding fabric block.
[0020] Rotate the LBP feature values of the nine fabric regions in the V channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the V channel of the corresponding fabric block.
[0021] Optionally, the step of drawing gradient histograms for the H, S, and V channels of the fabric image within each nine-grid based on each rotation-invariant LBP feature value includes:
[0022] The gradient histogram corresponding to the H channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the H channel.
[0023] The gradient histogram corresponding to the S channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the S channel.
[0024] The gradient histogram corresponding to the V channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the V channel.
[0025] Optionally, the step of normalizing the gradient histograms corresponding to the H, S, and V channels of the fabric images within each nine-grid image to obtain the feature vector of the fabric image includes:
[0026] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the H channel to obtain the corresponding gradient histogram feature vector of the H channel.
[0027] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the S channel to obtain the corresponding gradient histogram feature vector of the S channel.
[0028] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the V channel to obtain the corresponding gradient histogram feature vector of the V channel.
[0029] The feature vector of the fabric image is obtained by combining the gradient histogram feature vectors of the H channel, S channel, and V channel.
[0030] Optionally, the step of classifying the fabric image using an SVM linear classifier based on the feature vector of the fabric image to identify foreign objects in the fabric image includes:
[0031] Generate the SVM decision boundary based on the feature vector of the fabric image;
[0032] The fabric image is divided into fabric region and foreign object region by SVM decision boundary.
[0033] A foreign object recognition system for raw fabric includes: a space conversion module for converting the RGB values of a raw fabric image into HSV values in the HSV color space;
[0034] The LBP extraction module is used to divide the fabric image into a nine-grid layout and calculate the LBP feature values of the H, S, and V channels of the fabric image in each nine-grid layout in the HSV color space.
[0035] The LBP rotation module is used to rotate the LBP feature values of the fabric images in each of the nine grids in the H, S and V channels to obtain the corresponding rotation-invariant LBP feature values.
[0036] The histogram drawing module is used to draw the gradient histograms of the H, S and V channels of the fabric images in each of the nine grids based on each rotation-invariant LBP feature value.
[0037] The histogram normalization module is used to normalize the gradient histograms corresponding to the H, S, and V channels of the fabric images in each of the nine grids, and obtain the feature vector of the fabric image.
[0038] The foreign object recognition module is used to classify foreign objects in the fabric image using an SVM linear classifier based on the feature vector of the fabric image.
[0039] Optionally, the LBP extraction module includes:
[0040] Image division unit is used to divide the greige fabric image into a nine-grid structure to obtain nine greige fabric image blocks;
[0041] The area division unit is used to divide each fabric pattern block into a nine-grid structure to obtain nine fabric regions corresponding to each fabric pattern block.
[0042] The H channel extraction unit is used to calculate the LBP values of the H channel corresponding to the nine fabric regions in each fabric patch in the HSV color space, and obtain the LBP feature value of each fabric patch in the H channel.
[0043] The S-channel extraction unit is used to calculate the LBP values of the corresponding S-channel in the HSV color space for the nine fabric regions in each fabric patch, and to obtain the LBP feature value of each fabric patch in the S-channel.
[0044] The V channel extraction unit is used to calculate the LBP values of the corresponding V channels in the HSV color space for the nine fabric regions in each fabric patch, so as to obtain the LBP feature values of each fabric patch in the V channel.
[0045] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.
[0046] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0047] In summary, the present invention has the following beneficial effects: The RGB values of the fabric image are converted to HSV values; then the fabric image is segmented into several small color intervals, and the LBP feature values of the H, S, and V channels within each 3x3 grid are calculated; the LBP feature values of each 3x3 grid are then rotated, and the smallest LBP feature value is identified based on LBP rotation invariance and recorded as the rotation-invariant LBP feature value; gradient histograms are then plotted for the H, S, and V channels of the fabric image and normalized to obtain the corresponding feature vectors; these feature vectors are then input into an SVM linear classifier to perform feature segmentation on the fabric image, thereby identifying foreign objects within the fabric image. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the process of the present invention;
[0049] Figure 2 This is a structural block diagram of the present invention during assembly;
[0050] Figure 3 This is an internal structural diagram of a computer device in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Several embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.
[0052] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature.
[0053] In this invention, unless otherwise expressly specified and limited, "above" or "below" a second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of a second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" of a second feature includes the first feature being directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature. The terms "vertical," "horizontal," "left," "right," "above," "below," and similar expressions are for illustrative purposes only and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed or operated in a specific orientation, and therefore should not be construed as limiting the invention.
[0054] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0055] This invention provides a method for identifying foreign objects in raw fabric, such as... Figure 1 As shown, it includes:
[0056] Step 100: Convert the RGB values of the fabric image to HSV values in the HSV color space;
[0057] Step 200: Divide the fabric image into a nine-grid layout and calculate the LBP feature values of the H, S, and V channels of the fabric image in each nine-grid layout in the HSV color space.
[0058] Step 300: Rotate the LBP feature values of the fabric images in each of the nine grids in the H, S and V channels to obtain the corresponding rotation-invariant LBP feature values.
[0059] Step 400: Draw the gradient histograms of the H, S and V channels of the fabric images in each of the nine grids based on each rotation-invariant LBP eigenvalue.
[0060] Step 500: Normalize the gradient histograms corresponding to the H, S, and V channels of the fabric images in each of the nine grids to obtain the feature vector of the fabric image.
[0061] Step 600: Classify the fabric image using an SVM linear classifier based on the feature vector of the fabric image to identify foreign objects in the fabric image.
[0062] In practical applications, the HSV color space is also known as the hexagonal pyramid model. It uses angles to measure hue (H), with a value range of 0 to 360 degrees. Saturation (S) indicates how close a color is to a spectral color. Brightness (V) indicates the lightness of a color. For light source color, the brightness value is related to the brightness of the light source. For object color, the value is related to the projection and reflection ratios of the object.
[0063] The texture of normal fabric is a periodically repeating texture, while the texture of foreign objects differs significantly from that of the fabric surface. Since the HSV color space is closer to people's subjective perception of color than the RGB color space, the RGB values of the fabric image are converted to HSV values. Then, the fabric image is segmented into several small color intervals, and the LBP feature values of the H, S, and V channels within each 3x3 grid are calculated. The LBP feature values of each 3x3 grid are then rotated, and the smallest LBP feature value is identified based on LBP rotation invariance and recorded as the rotation-invariant LBP feature value. Gradient histograms are then plotted for the H, S, and V channels of the fabric image and normalized to obtain the corresponding feature vectors. These feature vectors are then input into an SVM linear classifier to segment the fabric image and identify foreign objects within it.
[0064] Further, the step of dividing the fabric image into a nine-grid layout and calculating the LBP feature values of the H, S, and V channels of the fabric image within each nine-grid layout in the HSV color space includes:
[0065] Divide the greige fabric image into a nine-grid structure to obtain nine greige fabric image blocks;
[0066] Divide each fabric pattern into a nine-grid layout to obtain nine fabric regions corresponding to each fabric pattern.
[0067] The LBP values of the nine fabric regions in each fabric patch in the HV color space are calculated to obtain the LBP feature values of each fabric patch in the H channel.
[0068] The LBP values of the nine fabric regions in each fabric patch in the S channel of the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the S channel.
[0069] The LBP values of the V channel corresponding to the nine fabric regions in each fabric patch in the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the V channel.
[0070] In practical applications, each fabric pattern is first divided into nine fabric patterns to form a large nine-square grid. Then, each fabric pattern is divided into nine fabric regions to form corresponding smaller nine-square grids. Next, the eigenvalues corresponding to the H, S, and V channels of each fabric region are obtained. Then, based on the eigenvalues corresponding to the H, S, and V channels of each fabric region, the LBP eigenvalues of each fabric pattern in the H, S, and V channels can be calculated.
[0071] Optionally, rotating the LBP feature values of the fabric images within each 3x3 grid in the H, S, and V channels to obtain the corresponding rotation-invariant LBP feature values includes:
[0072] Rotate the LBP feature values of the nine fabric regions in each fabric block in the H channel to obtain the rotation-invariant LBP feature values of the nine fabric regions in the H channel of the corresponding fabric block.
[0073] Rotate the LBP feature values of the nine fabric regions in the S channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the S channel of the corresponding fabric block.
[0074] Rotate the LBP feature values of the nine fabric regions in the V channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the V channel of the corresponding fabric block.
[0075] In practical applications, since LBP has rotation invariance, the eigenvalues of the nine fabric regions in each fabric block are rotated in the H, S, and V channels respectively to obtain the minimum values of the nine fabric regions in each fabric block in the H, S, and V channels respectively. These are the rotation-invariant LBP eigenvalues of the nine fabric regions in the corresponding fabric block in the H, S, and V channels respectively.
[0076] Optionally, the step of drawing gradient histograms for the H, S, and V channels of the fabric image within each nine-grid based on each rotation-invariant LBP eigenvalue includes:
[0077] The gradient histogram corresponding to the H channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the H channel.
[0078] The gradient histogram corresponding to the S channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the S channel.
[0079] The gradient histogram corresponding to the V channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the V channel.
[0080] In practical applications, since each fabric patch consists of nine fabric regions, and each fabric image consists of nine fabric patches, each fabric image has eight sampling points, which can form a feature value range of 0 to 255. By statistically analyzing each feature value in each fabric image and plotting a histogram corresponding to each feature value and its quantity, the gradient histograms corresponding to the H channel, S channel, and V channel can be obtained.
[0081] Further, the gradient histograms corresponding to the H, S, and V channels of the fabric images within each nine-grid area are normalized to obtain the feature vector of the fabric image, including:
[0082] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the H channel to obtain the corresponding gradient histogram feature vector of the H channel.
[0083] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the S channel to obtain the corresponding gradient histogram feature vector of the S channel.
[0084] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the V channel to obtain the corresponding gradient histogram feature vector of the V channel.
[0085] The feature vector of the fabric image is obtained by combining the gradient histogram feature vectors of the H channel, S channel, and V channel.
[0086] In practical applications, the eigenvalue range of 0 to 255 is reduced to [0, 32) and normalized to obtain a statistical histogram of eigenvalues in [0, 32). Connecting the eigenvalues in the statistical histogram yields the corresponding H, S, and V channel eigenvectors. Since there are a total of 3 channels, 9 grids, and 32 eigenvalues, a 3*9*32 dimensional eigenvector can be obtained.
[0087] Further, the step of classifying the fabric image using an SVM linear classifier based on its feature vector to identify foreign objects in the fabric image includes:
[0088] Generate the SVM decision boundary based on the feature vector of the fabric image;
[0089] The fabric image is divided into fabric region and foreign object region by SVM decision boundary.
[0090] In practical applications, the SVM linear classifier can divide the features in an image and generate a corresponding hyperplane based on the feature vector as a decision boundary. This separates foreign objects from fabric in the image, classifying the foreign object into the foreign object region and the fabric into the greige fabric region, thus completing the identification of the foreign object.
[0091] like Figure 2 As shown, the present invention also provides a foreign object identification system for greige fabric, comprising:
[0092] The space conversion module 10 is used to convert the RGB values of the fabric image into HSV values in the HSV color space;
[0093] LBP extraction module 20 is used to divide the fabric image into a nine-grid layout and calculate the LBP feature values of the H channel, S channel and V channel of the fabric image in each nine-grid layout in the HSV color space.
[0094] LBP rotation module 30 is used to rotate the LBP feature values of the fabric images in each of the nine grids in the H channel, S channel and V channel to obtain the corresponding rotation-invariant LBP feature values.
[0095] The histogram drawing module 40 is used to draw the gradient histograms of the H, S and V channels of the fabric images in each of the nine grids according to each rotation-invariant LBP feature value.
[0096] The histogram normalization module 50 is used to normalize the gradient histograms corresponding to the H, S and V channels of the fabric images in each nine-grid to obtain the feature vector of the fabric image.
[0097] The foreign object recognition module 60 is used to classify foreign objects in the fabric image by using an SVM linear classifier based on the feature vector of the fabric image.
[0098] Furthermore, the LBP extraction module 20 includes:
[0099] Image division unit is used to divide the greige fabric image into a nine-grid structure to obtain nine greige fabric image blocks;
[0100] The area division unit is used to divide each fabric pattern block into a nine-grid structure to obtain nine fabric regions corresponding to each fabric pattern block.
[0101] The H channel extraction unit is used to calculate the LBP values of the H channel corresponding to the nine fabric regions in each fabric patch in the HSV color space, and obtain the LBP feature value of each fabric patch in the H channel.
[0102] The S-channel extraction unit is used to calculate the LBP values of the corresponding S-channel in the HSV color space for the nine fabric regions in each fabric patch, and obtain the LBP feature value of each fabric patch in the S-channel.
[0103] The V channel extraction unit is used to calculate the LBP values of the V channel corresponding to the nine fabric regions in each fabric patch in the HSV color space, so as to obtain the LBP feature value of each fabric patch in the V channel.
[0104] Furthermore, the LBP rotation module includes:
[0105] The H-channel rotation unit is used to rotate the LBP feature values of the nine fabric regions in each fabric block in the H-channel to obtain the rotation-invariant LBP feature values of the nine fabric regions in the H-channel of the corresponding fabric block.
[0106] The S-channel rotation unit is used to rotate the LBP feature values of the nine fabric regions in each fabric block in the S-channel to obtain the rotation-invariant LBP feature values of the nine fabric regions in the corresponding fabric block in the S-channel.
[0107] The V-channel rotation unit is used to rotate the LBP feature values of the nine fabric regions in each fabric block in the V-channel to obtain the rotation-invariant LBP feature values of the nine fabric regions in the corresponding fabric block in the V-channel.
[0108] Furthermore, the histogram drawing module includes:
[0109] The H-channel plotting unit is used to plot the gradient histogram corresponding to the H-channel based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric block in the H-channel.
[0110] The S-channel plotting unit is used to plot the gradient histogram corresponding to the S-channel based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric block in the S-channel.
[0111] The V-channel plotting unit is used to plot the gradient histogram corresponding to the V-channel based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric block.
[0112] Furthermore, the histogram normalization module includes:
[0113] The H-channel normalization unit is used to normalize the gradient histogram of the nine fabric regions in each fabric block within the interval [0, 32) of the H-channel, and obtain the corresponding gradient histogram feature vector of the H-channel.
[0114] The S-channel normalization unit is used to normalize the gradient histogram of the nine fabric regions in each fabric patch within the interval [0, 32) of the S-channel, and obtain the corresponding gradient histogram feature vector of the S-channel.
[0115] The V-channel normalization unit is used to normalize the gradient histogram of the nine fabric regions in each fabric patch within the interval [0, 32) of the V-channel, and obtain the corresponding gradient histogram feature vector of the V-channel.
[0116] The histogram merging unit is used to combine the gradient histogram feature vectors of the H channel, the S channel, and the V channel to obtain the feature vector of the fabric image.
[0117] Furthermore, the foreign object identification module includes:
[0118] The boundary generation unit is used to generate the SVM decision boundary based on the feature vector of the fabric image.
[0119] The image segmentation unit is used to segment the fabric image using SVM decision boundaries to obtain the fabric region and the foreign object region.
[0120] For specific limitations regarding a foreign object identification system for greige fabric, please refer to the limitations of a foreign object identification method for greige fabric described above, which will not be repeated here. Each module in the aforementioned foreign object identification system for greige fabric can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0121] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the computer program is executed by the processor, it implements a method for identifying foreign objects in fabric.
[0122] Those skilled in the art will understand that Figure 3The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0123] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps: converting the RGB values of a fabric image into HSV values in the HSV color space;
[0124] The fabric image is divided into a nine-grid layout, and the LBP feature values of the H, S, and V channels of the fabric image in each nine-grid layout are calculated.
[0125] Rotate the LBP feature values of the fabric images in each of the nine grids in the H, S and V channels to obtain the corresponding rotation-invariant LBP feature values;
[0126] Based on each rotation-invariant LBP eigenvalue, plot the gradient histograms of the H, S, and V channels of the fabric image in each of the nine grids.
[0127] The gradient histograms corresponding to the H, S, and V channels of the fabric images in each of the nine grids are normalized to obtain the feature vector of the fabric image.
[0128] Based on the feature vector of the fabric image, an SVM linear classifier is used to classify and identify foreign objects in the fabric image.
[0129] In one embodiment, dividing the fabric image into a nine-grid layout and calculating the LBP feature values of the H, S, and V channels of the fabric image within each nine-grid layout in the HSV color space includes:
[0130] Divide the greige fabric image into a nine-grid structure to obtain nine greige fabric image blocks;
[0131] Divide each fabric pattern into a nine-grid layout to obtain nine fabric regions corresponding to each fabric pattern.
[0132] The LBP values of the nine fabric regions in each fabric patch in the HV color space are calculated to obtain the LBP feature values of each fabric patch in the H channel.
[0133] The LBP values of the nine fabric regions in each fabric patch in the S channel of the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the S channel.
[0134] The LBP values of the V channel corresponding to the nine fabric regions in each fabric patch in the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the V channel.
[0135] In one embodiment, rotating the LBP feature values of the fabric images within each nine-grid area in the H, S, and V channels to obtain the corresponding rotation-invariant LBP feature values includes:
[0136] Rotate the LBP feature values of the nine fabric regions in each fabric block in the H channel to obtain the rotation-invariant LBP feature values of the nine fabric regions in the H channel of the corresponding fabric block.
[0137] Rotate the LBP feature values of the nine fabric regions in the S channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the S channel of the corresponding fabric block.
[0138] Rotate the LBP feature values of the nine fabric regions in the V channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the V channel of the corresponding fabric block.
[0139] In one embodiment, the step of drawing gradient histograms for the H, S, and V channels of the fabric image within each nine-grid based on each rotation-invariant LBP eigenvalue includes:
[0140] The gradient histogram corresponding to the H channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the H channel.
[0141] The gradient histogram corresponding to the S channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the S channel.
[0142] The gradient histogram corresponding to the V channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the V channel.
[0143] In one embodiment, the normalization of the gradient histograms corresponding to the H, S, and V channels of the fabric images within each nine-grid layout to obtain the feature vector of the fabric image includes:
[0144] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the H channel to obtain the corresponding gradient histogram feature vector of the H channel.
[0145] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the S channel to obtain the corresponding gradient histogram feature vector of the S channel.
[0146] The gradient histogram of the nine fabric regions in each fabric patch is normalized in the interval [0, 32) of the V channel to obtain the corresponding gradient histogram feature vector of the V channel.
[0147] The feature vector of the fabric image is obtained by combining the gradient histogram feature vectors of the H channel, S channel, and V channel.
[0148] In one embodiment, classifying the fabric image using an SVM linear classifier based on its feature vector to identify foreign objects in the fabric image includes:
[0149] Generate the SVM decision boundary based on the feature vector of the fabric image;
[0150] The fabric image is divided into fabric region and foreign object region by SVM decision boundary.
[0151] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0152] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for identifying foreign matter on a cloth, characterized by, include: Convert the RGB values of the raw fabric image to HSV values in the HSV color space; The fabric image is divided into a nine-grid layout, and the LBP feature values of the H, S, and V channels of the fabric image in each nine-grid layout are calculated. Rotate the LBP feature values of the fabric images in each of the nine grids in the H, S and V channels to obtain the corresponding rotation-invariant LBP feature values; Based on each rotation-invariant LBP eigenvalue, plot the gradient histograms of the H, S, and V channels of the fabric image in each of the nine grids. The gradient histograms corresponding to the H, S, and V channels of the fabric images in each of the nine grids are normalized to obtain the feature vector of the fabric image. Based on the feature vector of the fabric image, an SVM linear classifier is used to classify and identify foreign objects in the fabric image. The process of dividing the fabric image into a nine-grid layout and calculating the LBP feature values of the H, S, and V channels of the fabric image within each nine-grid in the HSV color space includes: Divide the greige fabric image into a nine-grid structure to obtain nine greige fabric image blocks; Divide each fabric pattern into a nine-grid layout to obtain nine fabric regions corresponding to each fabric pattern. The LBP values of the nine fabric regions in each fabric patch in the HV color space are calculated to obtain the LBP feature values of each fabric patch in the H channel. The LBP values of the nine fabric regions in each fabric patch in the S channel of the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the S channel. The LBP values of the V channel corresponding to the nine fabric regions in each fabric patch in the HSV color space are calculated to obtain the LBP feature value of each fabric patch in the V channel.
2. The method of claim 1, wherein, The process of rotating the LBP feature values of the fabric images within each nine-grid area in the H, S, and V channels to obtain the corresponding rotation-invariant LBP feature values includes: Rotate the LBP feature values of the nine fabric regions in each fabric block in the H channel to obtain the rotation-invariant LBP feature values of the nine fabric regions in the H channel of the corresponding fabric block. Rotate the LBP feature values of the nine fabric regions in the S channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the S channel of the corresponding fabric block. Rotate the LBP feature values of the nine fabric regions in the V channel of each fabric block to obtain the rotation-invariant LBP feature values of the nine fabric regions in the V channel of the corresponding fabric block.
3. The method of claim 2, wherein, The step of plotting the gradient histograms for the H, S, and V channels of the fabric image within each nine-grid based on each rotation-invariant LBP eigenvalue includes: The gradient histogram corresponding to the H channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the H channel. The gradient histogram corresponding to the S channel is plotted based on the rotation-invariant LBP eigenvalues of the nine fabric regions in each fabric patch in the S channel. The gradient histogram corresponding to the V channel is drawn according to the rotation invariant LBP feature value of the nine cloth regions in each cloth patch in the V channel.
4. The method of claim 3, wherein, The H channel, the S channel and the V channel of the cloth picture in each nine-square grid are normalized to obtain the feature vector of the cloth picture, including: The gradient histogram of the nine cloth regions in each cloth patch in the H channel is normalized in the interval [0, 32] to obtain the gradient histogram feature vector of the corresponding H channel; The gradient histogram of the nine cloth regions in each cloth patch in the S channel is normalized in the interval [0, 32] to obtain the gradient histogram feature vector of the corresponding S channel; The gradient histogram of the nine cloth regions in each cloth patch in the V channel is normalized in the interval [0, 32] to obtain the gradient histogram feature vector of the corresponding V channel; The gradient histogram feature vector of the H channel, the gradient histogram feature vector of the S channel and the gradient histogram feature vector of the V channel are combined to obtain the feature vector of the cloth picture.
5. The method of claim 4, wherein, The feature vector of the cloth picture is classified by the SVM linear classifier to identify the foreign matter in the cloth picture, including: An SVM decision boundary is generated according to the feature vector of the cloth picture; The cloth picture is divided by the SVM decision boundary to obtain the cloth region and the foreign matter region.
6. A fabric foreign object recognition system characterized by comprising: It includes: A space conversion module for converting the RGB value of the cloth picture into the HSV value in the HSV color space; An LBP extraction module for dividing the cloth picture into nine-square grids and calculating the LBP feature value of the H channel, the S channel and the V channel of the cloth picture in the HSV color space in each nine-square grid; An LBP rotation module for rotating the LBP feature value of the H channel, the S channel and the V channel of the cloth picture in each nine-square grid to obtain the rotation invariant LBP feature value; A histogram drawing module for drawing the gradient histogram of the H channel, the S channel and the V channel of the cloth picture in each nine-square grid according to the rotation invariant LBP feature value; A histogram normalization module for normalizing the gradient histogram of the H channel, the S channel and the V channel of the cloth picture in each nine-square grid to obtain the feature vector of the cloth picture; A foreign matter identification module for classifying the feature vector of the cloth picture by the SVM linear classifier to identify the foreign matter in the cloth picture; The LBP extraction module includes: A picture division unit for dividing the cloth picture into nine-square grids to obtain nine cloth patches; A region division unit for dividing each cloth patch into nine-square grids to obtain the nine cloth regions corresponding to each cloth patch; An H channel extraction unit for calculating the LBP value of the H channel corresponding to the nine cloth regions in each cloth patch in the HSV color space to obtain the LBP feature value of each cloth patch in the H channel; An S channel extraction unit is configured to calculate LBP values of S channels corresponding to the nine cloth regions in each cloth patch in the HSV color space, to obtain LBP characteristic values of each cloth patch in the S channel. A V channel extraction unit is configured to calculate LBP values of V channels corresponding to the nine cloth regions in each cloth patch in the HSV color space, to obtain LBP characteristic values of each cloth patch in the V channel. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.
8. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Improved gradient histogram feature extraction algorithm based on texture trend and its application method
CN109508723A
Face recognition method and device, computer equipment and storage medium
CN110084135A