A quality detection method for cashmere products

By performing superpixel segmentation and merging on the grayscale images of cashmere product surfaces and combining them with a pre-trained cashmere quality detection model, the problem of low accuracy in cashmere product quality detection is solved, achieving more accurate quality assessment.

CN120318215BActive Publication Date: 2025-09-05SHAANXI TUOCHENG CASHMERE IND TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510612129.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-09-05
Estimated Expiration
2045-05-13

AI Technical Summary

Technical Problem

The accuracy of cashmere product quality detection in the existing technology is low, and it is difficult to effectively identify cashmere products with diverse texture features, resulting in a high misjudgment rate.

Method used

By performing superpixel segmentation on the surface grayscale image of the cashmere product to be inspected, merging pixel blocks with high similarity, and using a pre-trained cashmere quality inspection model for inspection, the similarity of shape and grayscale features is combined to reduce the impact of over-segmentation.

Benefits of technology

It improves the accuracy of cashmere product quality inspection, reduces misjudgment, and ensures the integrity of cashmere fiber characteristics and the reliability of inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318215B_ABST
    Figure CN120318215B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image data processing technology, and in particular to a method for quality inspection of cashmere products. The method comprises: obtaining a first grayscale image of the surface of a cashmere product to be inspected, and performing superpixel segmentation on the first grayscale image to obtain a plurality of pixel blocks; determining the shape similarity and grayscale feature similarity between the first pixel block and the second pixel block to determine a target parameter value between the first pixel block and the second pixel block; when the target parameter value is less than a preset parameter threshold, merging the first pixel block and the second pixel block to obtain a second grayscale image; and inputting the second grayscale image into a pre-trained cashmere quality inspection model to obtain a quality inspection result for the second grayscale image. Through the above technical solution, more accurate quality inspection results for the cashmere products to be inspected can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image data processing, and in particular to a quality detection method for cashmere products. Background Art

[0002] Cashmere is a layer of fine wool that grows on the outer skin of goats. Because cashmere has good warmth retention and soft feel, it is often used to make cashmere products such as cashmere sweaters, cashmere coats, cashmere shirts, cashmere trousers, cashmere scarves, cashmere shawls, cashmere gloves and cashmere hats.

[0003] In order to achieve quality inspection of textiles including cashmere products, in related technologies, for example, a Chinese patent application document with publication number CN111784691A, a textile defect detection method is provided, including: obtaining texture feature data of the fabric in the surface image of a defective textile; obtaining texture feature data of the fabric in the surface image of a qualified textile; a first detection camera shoots the surface of the produced textile, and if the threshold value of the texture feature data of the shot image is not greater than the threshold value of the texture feature data of the qualified product image, the product is judged to be a qualified product; if the threshold value of the texture feature data of the shot image is greater than the threshold value of the texture feature data of the qualified product image, a second detection camera is started to shoot the surface of the produced textile again, and the image shot by the second camera is compared again with the threshold value of the texture feature data of the defective product, and if the comparison result shows that it is not greater than the threshold value of the texture feature data of the defective product, the product is judged to be a defective product.

[0004] When conducting quality inspection on cashmere products, the texture features on the surface of cashmere products may be quite diverse. Comparing the texture features of the product to be inspected with those of qualified products, or comparing the texture features of the product to be inspected with those of defective products, makes it difficult to effectively inspect the quality of cashmere products, and the accuracy of quality inspection on cashmere products is low. Summary of the Invention

[0005] To overcome the problem of low accuracy in quality inspection of cashmere products in the related art, the present application provides a quality inspection method for cashmere products, comprising: obtaining a first grayscale image of a surface of a cashmere product to be inspected, and performing superpixel segmentation on the first grayscale image to obtain a plurality of pixel blocks; determining shape similarity between a first pixel block and a second pixel block, and determining grayscale feature similarity between the first pixel block and the second pixel block; the first pixel block and the second pixel block are adjacent pixel blocks among the plurality of pixel blocks; determining a first distance between the first pixel block and the second pixel block, and determining a target parameter value between the first pixel block and the second pixel block based on the first distance, the shape similarity, and the grayscale feature similarity, the target parameter value being used to characterize the probability that the first pixel block and the second pixel block belong to different cashmere fibers; when the target parameter value is less than a preset parameter threshold, merging the first pixel block and the second pixel block into the same pixel block to obtain a second grayscale image after the pixel blocks are merged; and inputting the second grayscale image into a pre-trained cashmere quality inspection model to obtain a quality inspection result of the second grayscale image output by the cashmere quality inspection model.

[0006] In this way, the first grayscale image of the surface of the cashmere product to be inspected is subjected to superpixel segmentation to obtain multiple pixel blocks, and two pixel blocks adjacent to each other and with a probability of belonging to different cashmere fibers less than a preset parameter threshold are merged into the same pixel block to obtain a second grayscale image after the pixel block merging operation. The characteristics of the cashmere fiber can be better reflected in the second grayscale image. Therefore, a more accurate quality inspection result of the cashmere product to be inspected can be obtained using the second grayscale image.

[0007] Optionally, the superpixel segmentation of the first grayscale image to obtain multiple pixel blocks includes: determining the texture feature value of the target pixel point in the first grayscale image, wherein the texture feature value is determined based on the LBP value of the pixel point within the neighborhood of the target pixel point; and performing superpixel segmentation on the first grayscale image to obtain multiple pixel blocks based on the texture feature value of the pixel point in the first grayscale image.

[0008] In this way, since the LBP value has rotation invariance and grayscale invariance, the texture feature value obtained by using the LBP value can better characterize the texture feature of the target pixel point.

[0009] Optionally, the texture feature value of the target pixel is determined by: ;in, Represents the texture feature value of the target pixel, represents the LBP value of the i-th pixel in the neighborhood of the target pixel, B represents the mean LBP value of the pixels in the neighborhood, and n represents the number of pixels in the neighborhood. Indicates the maximum LBP value of the pixel within the neighborhood. Indicates the minimum LBP value of the pixel points in the neighborhood.

[0010] In this way, the LBP value in the neighborhood of the target pixel in the image can reflect the higher the texture complexity of the area where the target pixel is located. Therefore, the texture feature value of the target pixel can better describe the texture of the target pixel.

[0011] Optionally, based on the texture eigenvalues ​​of the pixel points in the first grayscale image, superpixel segmentation is performed on the first grayscale image to obtain multiple pixel blocks, including: based on the texture eigenvalues ​​of the pixel points in the first grayscale image and the distance between the pixel points, superpixel segmentation is performed on the first grayscale image to obtain multiple pixel blocks; the same pixel block includes multiple pixel points that are adjacent to each other and have similar texture eigenvalues.

[0012] Optionally, determining the shape similarity between the first pixel block and the second pixel block includes: , where P is the shape similarity between the first pixel block and the second pixel block, and exp is an exponential function with a natural constant as the base. is the distance between the ath edge pixel point in the first pixel block and the seed point of the first pixel block, is the number of edge pixels in the first pixel block, is the distance between the bth edge pixel point in the second pixel block and the seed point of the second pixel block, is the number of edge pixels in the second pixel block, To take the absolute value operation.

[0013] Optionally, determining the grayscale feature similarity between the first pixel block and the second pixel block includes: , where Q is the grayscale feature similarity between the first pixel block and the second pixel block, and exp is an exponential function with a natural constant as the base. is the grayscale value of the d-th boundary pixel in the first pixel block, is the number of boundary pixels in the first pixel block, is the grayscale value of the e-th boundary pixel in the second pixel block, is the number of boundary pixels in the second pixel block, To take the absolute value operation.

[0014] In this way, excessive segmentation of the cashmere fibers in the first grayscale image can be avoided by using the grayscale feature similarity between the first pixel blocks.

[0015] Optionally, determining the target parameter value between the first pixel block and the second pixel block according to the first distance, the shape similarity, and the grayscale feature similarity includes: ; Wherein, S is the target parameter value between the first pixel block and the second pixel block, D is the first distance between the first pixel block and the second pixel block, exp is an exponential function with a natural constant as the base, P is the shape similarity between the first pixel block and the second pixel block, and Q is the grayscale feature similarity between the first pixel block and the second pixel block.

[0016] Optionally, the cashmere quality detection model is obtained by: obtaining a training sample set and a test set corresponding to the training sample set, the training sample set including a grayscale image of the surface of the cashmere product, and the test set including quality detection results obtained by pre-performing quality inspection on the grayscale image of the surface of the cashmere product; using the training sample set and the test set, training a pre-constructed initial quality detection model to obtain a trained cashmere quality detection model.

[0017] In this way, by training the pre-built initial quality inspection model, a cashmere quality inspection model is obtained, and the quality inspection of the cashmere products to be inspected can be realized through the pre-deployed cashmere quality inspection model, thereby reducing the labor intensity of subsequent quality inspection of the cashmere products to be inspected.

[0018] Optionally, the method further includes: when the quality test result indicates that the quality of the cashmere product to be tested is unqualified, prompting that the quality of the cashmere product to be tested is unqualified.

[0019] Optionally, the method further includes: when the quality test result indicates that the quality of the cashmere product to be tested is qualified, prompting that the quality of the cashmere product to be tested is qualified.

[0020] The technical solution provided by the embodiments of the present application may include the following beneficial effects: performing super-pixel segmentation on the first grayscale image of the surface of the cashmere product to be inspected to obtain multiple pixel blocks, determining the target parameter value between the first pixel block and the second pixel block in the multiple pixel blocks, the target parameter value is used to characterize the probability that the first pixel block and the second pixel block belong to different cashmere fibers, and when the target parameter value is less than a preset parameter threshold, the first pixel block and the second pixel block can be merged into the same pixel block to obtain a second grayscale image, the characteristics of the cashmere fiber can be better reflected in the second grayscale image, and the second grayscale image can be input into a pre-trained cashmere quality detection model to obtain a more accurate quality detection result for the cashmere product to be inspected.

[0021] At the same time, compared with directly comparing the texture features of the cashmere image with the pre-set texture feature threshold, since the pre-trained cashmere quality detection model can learn the texture features of cashmere in more complex scenarios, it can better realize the detection of cashmere quality and obtain more accurate quality detection results for cashmere products.

[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 The figure is a flow chart of a method for detecting the quality of cashmere products according to an exemplary embodiment. DETAILED DESCRIPTION

[0024] First, a brief introduction is given to the application scenario of the embodiment of the present application. In the application scenario of the present application, in order to facilitate the automated detection of cashmere products, an image acquisition device can be used to capture the surface image of the cashmere product, and the texture features of the surface image of the cashmere product can be compared with a pre-set texture feature threshold. However, the texture features of cashmere products may be more diverse, and it is difficult to achieve more accurate quality detection of cashmere products through the pre-set texture feature threshold, and the accuracy of quality detection of cashmere products is low.

[0025] For example, since the texture features of cashmere products may be quite diverse, when using a pre-set texture feature threshold to perform quality inspection on cashmere products, cashmere products that do not have defects may be mistakenly judged as defective, resulting in waste of cashmere products; or, cashmere products that have defects may be mistakenly judged as non-defective.

[0026] In response to the above technical problems, an embodiment of the present application provides a quality inspection method for cashmere products, which performs superpixel segmentation on a first grayscale image of the surface of the cashmere product to be inspected to obtain multiple pixel blocks, and determines a target parameter value between a first pixel block and a second pixel block in the multiple pixel blocks. The target parameter value is used to characterize the probability that the first pixel block and the second pixel block belong to different cashmere fibers. When the target parameter value is less than a preset parameter threshold, the first pixel block and the second pixel block can be merged into the same pixel block to obtain a second grayscale image. The characteristics of the cashmere fiber can be better reflected in the second grayscale image. The second grayscale image is input into a pre-trained cashmere quality inspection model to obtain a more accurate quality inspection result for the cashmere product to be inspected.

[0027] At the same time, compared with directly comparing the texture features of the cashmere image with the pre-set texture feature threshold, since the pre-trained cashmere quality detection model can learn the texture features of cashmere in more complex scenarios, it can better realize the detection of cashmere quality and obtain more accurate quality detection results for cashmere products.

[0028] Figure 1is a flow chart of a cashmere product quality inspection method according to an exemplary embodiment, which can be applied to cashmere product quality inspection equipment, such as Figure 1 As shown, the method includes the following steps.

[0029] In step S101, a first grayscale image of the surface of the cashmere product to be inspected is acquired, and superpixel segmentation is performed on the first grayscale image to obtain a plurality of pixel blocks.

[0030] For example, an image acquisition device can be set up near the production line of cashmere products, and the grayscale image of the surface of the cashmere products during the production process can be obtained by the image acquisition device, so as to realize the quality inspection of the cashmere products in the production process; for another example, the grayscale image of the surface of the finished cashmere products can be captured by the image acquisition device, so as to realize the quality inspection of the finished cashmere products, for example, sampling inspection or full inspection of cashmere products can be realized.

[0031] An image can be segmented into multiple pixel blocks by performing superpixel segmentation on the image. The same pixel block includes multiple pixels with similar characteristics such as color, texture, and brightness, and the segmented pixel blocks can be called superpixels.

[0032] When performing superpixel segmentation on an image, multiple seed points can usually be pre-set in the image. The non-seed points in the image are divided according to the similarity between the non-seed points and the seed points in color, texture, brightness and other features to obtain the pixel blocks corresponding to the seed points, that is, to determine the superpixels corresponding to the seed points, and realize superpixel segmentation of the image.

[0033] Among them, the superpixel segmentation of the image can be achieved through algorithms such as the SLIC (Simple Linear Iterative Clustering) algorithm, the SEEDS algorithm, and the K-means clustering algorithm to obtain multiple pixel blocks in the image after superpixel segmentation.

[0034] By performing super-pixel segmentation on the first grayscale image to obtain a plurality of pixel blocks, it is possible to process the pixel blocks individually. Super-pixel segmentation can facilitate the correspondence between the obtained pixel blocks and the cashmere fibers.

[0035] In step S102 , the shape similarity between the first pixel block and the second pixel block is determined, and the grayscale feature similarity between the first pixel block and the second pixel block is determined.

[0036] The first pixel block and the second pixel block are adjacent pixel blocks among the plurality of pixel blocks. The first pixel block and the second pixel block may correspond to two different cashmere fibers, respectively; or, after superpixel segmentation of the first grayscale image, the plurality of pixel blocks obtained may be over-segmented, resulting in the same cashmere fiber being segmented into different pixel blocks, forming the first pixel block and the second pixel block.

[0037] When a complete cashmere fiber superpixel is segmented into multiple segments of cashmere fiber, originally qualified cashmere fiber products may be mistakenly judged as unqualified cashmere fiber products, affecting the accuracy of quality inspection of cashmere products. Therefore, the shape similarity between the first pixel block and the second pixel block can be determined, and the grayscale feature similarity between the first pixel block and the second pixel block can be determined to determine whether the first pixel block and the second pixel block are the result of over-segmentation of the same cashmere fiber.

[0038] In one embodiment, determining the shape similarity between the first pixel block and the second pixel block includes: , where P is the shape similarity between the first pixel block and the second pixel block, and exp is an exponential function with a natural constant as the base. is the distance between the ath edge pixel point in the first pixel block and the seed point of the first pixel block, is the number of edge pixels in the first pixel block, is the distance between the bth edge pixel point in the second pixel block and the seed point of the second pixel block, is the number of edge pixels in the second pixel block, To take the absolute value operation.

[0039] The superpixel segmentation of the image is performed based on the seed points. The pixel blocks obtained after superpixel segmentation are the pixel areas where the seed points are located. The distances between the edge pixel points of the pixel blocks and the seed points of the pixel blocks may reflect the shape characteristics of the pixel blocks. Therefore, the similarity of the shape characteristics of the two pixel blocks can be characterized by the similarity of the distances between the edge pixel points of the two pixel blocks and the seed points of the two pixel blocks.

[0040] The more similar the first pixel block and the second pixel block are in shape features, for example, the more similar the first pixel block and the second pixel block are in shape and size, the greater the shape similarity between the first pixel block and the second pixel block; conversely, the lower the similarity between the first pixel block and the second pixel block in shape and size, the smaller the shape similarity between the first pixel block and the second pixel block; by determining the shape similarity between the first pixel block and the second pixel block, it is helpful to subsequently determine whether to perform regional merging on the first pixel block and the second pixel block to obtain a more accurate quality detection result.

[0041] In one embodiment, determining the grayscale feature similarity between the first pixel block and the second pixel block includes: , where Q is the grayscale feature similarity between the first pixel block and the second pixel block, and exp is an exponential function with a natural constant as the base. is the grayscale value of the d-th boundary pixel in the first pixel block, is the number of boundary pixels in the first pixel block, is the grayscale value of the e-th boundary pixel in the second pixel block, is the number of boundary pixels in the second pixel block, To take the absolute value operation.

[0042] When performing superpixel segmentation on the first grayscale image, the superpixel segmentation is performed based on seed points. Since the pre-set seed points may be adjacent to each other, the same pixel area with similar grayscale features in the first grayscale image may be segmented into two or more pixel blocks. For example, the same cashmere fiber may be segmented into multiple different cashmere fibers, affecting the quality assessment results of cashmere products.

[0043] The boundary pixel points in the pixel block are the pixel points located at the boundary of the pixel block, and the non-boundary pixel points in the pixel block are other pixel points located within the boundary pixel points in the pixel block; the grayscale feature similarity between the first pixel block and the second pixel block can characterize the degree of similarity in grayscale features between the boundary pixel points in the first pixel block and the boundary pixel points in the second pixel block.

[0044] Since the same cashmere fiber has similar characteristics at the local boundary pixel points, determining the similarity of the grayscale values ​​of the boundary pixel points in two adjacent pixel blocks helps to determine the complete cashmere fiber that is segmented into multiple pixel blocks during the superpixel segmentation process.

[0045] In this way, by determining the grayscale feature similarity between the first pixel blocks, it is helpful to determine whether there is over-segmentation of the cashmere fibers in the first grayscale image, so as to obtain a more accurate quality detection result for the cashmere product.

[0046] In step S103 , a first distance between the first pixel block and the second pixel block is determined, and a target parameter value between the first pixel block and the second pixel block is determined based on the first distance, shape similarity, and grayscale feature similarity.

[0047] The target parameter value is used to represent the probability that the first pixel block and the second pixel block belong to different cashmere fibers.

[0048] In one embodiment, determining a target parameter value between the first pixel block and the second pixel block based on the first distance, the shape similarity, and the grayscale feature similarity includes: ; Wherein, S is the target parameter value between the first pixel block and the second pixel block, D is the first distance between the first pixel block and the second pixel block, exp is an exponential function with a natural constant as the base, P is the shape similarity between the first pixel block and the second pixel block, and Q is the grayscale feature similarity between the first pixel block and the second pixel block.

[0049] The first distance between the first pixel block and the second pixel block may refer to the distance between the central pixel point of the first pixel block and the central pixel point of the second pixel point; the larger the first distance between the first pixel block and the second pixel block, the higher the probability that the first pixel block and the second pixel block are located on different cashmere fibers; conversely, the smaller the first distance between the first pixel block and the second pixel block, the lower the probability that the first pixel block and the second pixel block are located on different cashmere fibers.

[0050] In this way, the target parameter value between the first pixel block and the second pixel block is determined based on the first distance, shape similarity and grayscale feature similarity. The obtained target parameter value can better characterize the probability that the first pixel block and the second pixel block belong to different cashmere fibers.

[0051] In step S104 , when the target parameter value is less than the preset parameter threshold, the first pixel block and the second pixel block are merged into the same pixel block to obtain a second grayscale image after the pixel blocks are merged.

[0052] The target parameter value is determined based on the first distance, shape similarity, and grayscale feature similarity. The target parameter value is used to characterize the probability that the first pixel block and the second pixel block belong to different cashmere fibers. The larger the target parameter value between the first pixel block and the second pixel block, the larger the distance between the first pixel block and the second pixel block, or the lower the shape similarity between the first pixel block and the second pixel block, or the lower the grayscale feature similarity between the first pixel block and the second pixel block. Therefore, the probability that the first pixel block and the second pixel block are obtained by segmenting different cashmere fibers is higher, or the probability that the first pixel block and the second pixel block are obtained by over-segmentation of the same cashmere fiber is lower.

[0053] On the contrary, the smaller the target parameter value between the first pixel block and the second pixel block, the lower the probability that the first pixel block and the second pixel block are obtained by segmenting different cashmere fibers, or the higher the probability that the first pixel block and the second pixel block are obtained by over-segmentation of the same cashmere fiber.

[0054] When the target parameter value is less than the preset parameter threshold, the first pixel block and the second pixel block are merged into the same pixel block, which can avoid the adverse impact of the same cashmere fiber being excessively divided into different pixel blocks on the quality inspection results, thereby obtaining more accurate quality inspection results for cashmere products.

[0055] When the region merging of the first pixel block and the second pixel block is completed, two adjacent pixel blocks, for example, the third pixel block and the fourth pixel block, may be newly determined from the plurality of pixel blocks that have not been region-merged.

[0056] With reference to the process of determining the target parameter value between the first pixel block and the second pixel block, the target parameter value between the third pixel block and the fourth pixel block can be determined, so that when the target parameter value between the third pixel block and the fourth pixel block is less than the preset parameter threshold, the third pixel block and the fourth pixel block can be merged into the same pixel block, thereby realizing the merging of two adjacent pixel blocks whose target parameter values ​​are less than the preset parameter threshold among multiple pixel blocks in the first grayscale image, so as to avoid the influence of over-segmentation that may exist in the superpixel segmentation process on the quality detection results.

[0057] When the target parameter values ​​between any two adjacent pixel blocks in the first grayscale image are greater than or equal to the preset parameter threshold, it means that after the merging operation of the pixel blocks in the first grayscale image, all pixel blocks that actually belong to the same cashmere fiber have been merged into the same pixel block, and the first grayscale image after the pixel block merging operation can be used as the second grayscale image.

[0058] The value of the preset parameter threshold can be set according to actual conditions. For example, when the value range of the target parameter value is between 0 and 1, the preset parameter threshold can be set between 0.1 and 0.25.

[0059] In step S105, the second grayscale image is input into a pre-trained cashmere quality detection model to obtain a quality detection result of the second grayscale image output by the cashmere quality detection model.

[0060] The quality of cashmere products is usually affected by parameters such as the integrity, length and width of cashmere fibers. Compared with directly inputting the first grayscale image of the surface of the cashmere product to be inspected into the cashmere quality detection model, the second grayscale image is input into the pre-trained cashmere quality detection model. The second grayscale image includes pixel blocks obtained after superpixel segmentation of the first grayscale image. Therefore, it is more convenient to detect parameters such as the integrity, length and width of cashmere fibers, so as to obtain quality detection results of cashmere products.

[0061] At the same time, since the second grayscale image is obtained by regional merging of adjacent pixel blocks in the first grayscale image whose target parameter values ​​are less than the preset parameter threshold, the target parameter value can represent the probability that the adjacent pixel blocks belong to different cashmere fibers. Therefore, the cashmere fibers in the second grayscale image are less over-segmented, or the over-segmentation of cashmere fibers is avoided in the second grayscale image. Inputting the second grayscale image into the cashmere quality detection model can more conveniently realize the detection of parameters such as the integrity, length and width of cashmere fibers, so as to obtain quality detection results of cashmere products.

[0062] The quality test results of cashmere products may be quality scores or quality evaluation grades of cashmere products, and the quality scores or quality evaluation grades are used to represent the quality of cashmere products.

[0063] In one embodiment, if the quality test result indicates that the quality of the cashmere product to be tested is unqualified, it can be prompted that the quality of the cashmere product to be tested is unqualified.

[0064] For example, when the quality score of the cashmere product to be tested is less than a preset score, or when the quality grade of the cashmere product to be tested is less than a preset grade, the cashmere product quality inspection equipment can output prompt information such as audio, light, and text to indicate that there is an abnormality in the quality of the cashmere product.

[0065] Alternatively, when the quality inspection result indicates that the quality of the cashmere products to be inspected is unqualified, the cashmere product quality inspection equipment can also send a control instruction to the sorting equipment to enable the sorting equipment to sort the unqualified cashmere products to avoid confusion between qualified and unqualified products.

[0066] In one embodiment, the cashmere quality detection model is obtained by: obtaining a training sample set and a test set corresponding to the training sample set, the training sample set including a grayscale image of the surface of a cashmere product, and the test set including quality detection results obtained by pre-performing quality detection on the grayscale image of the surface of the cashmere product; using the training sample set and the test set, training a pre-constructed initial quality detection model to obtain a trained cashmere quality detection model.

[0067] For example, a surface grayscale image of a cashmere product can be collected, and the quality inspection of the cashmere product can be performed in advance to obtain the quality inspection results. The surface grayscale image of the cashmere product and the quality inspection results of the corresponding cashmere product can be used to train a pre-constructed initial quality inspection model. If the training process meets the preset conditions, the model obtained by training will be used as the cashmere quality inspection model.

[0068] The quality and purity of cashmere products can be determined by conducting tensile strength tests and abrasion resistance tests on cashmere products in advance, or by observing the morphology, diameter and surface characteristics of cashmere fibers under a microscope, thereby obtaining quality inspection results for cashmere products in advance.

[0069] In this way, by training the pre-built initial quality inspection model, a cashmere quality inspection model is obtained, and the quality inspection of the cashmere products to be inspected can be realized through the pre-deployed cashmere quality inspection model, thereby reducing the labor intensity of subsequent quality inspection of the cashmere products to be inspected.

[0070] Through the quality inspection method for cashmere products provided in the embodiment of the present application, super-pixel segmentation is performed on the first grayscale image of the surface of the cashmere product to be inspected to obtain multiple pixel blocks, and a target parameter value between the first pixel block and the second pixel block in the multiple pixel blocks is determined. The target parameter value is used to characterize the probability that the first pixel block and the second pixel block belong to different cashmere fibers. When the target parameter value is less than a preset parameter threshold, the first pixel block and the second pixel block can be merged into the same pixel block to obtain a second grayscale image. The characteristics of the cashmere fiber can be better reflected in the second grayscale image. The second grayscale image is input into a pre-trained cashmere quality inspection model to obtain a more accurate quality inspection result of the cashmere product to be inspected.

[0071] At the same time, compared with directly comparing the texture features of the cashmere image with the pre-set texture feature threshold, since the pre-trained cashmere quality detection model can learn the texture features of cashmere in more complex scenarios, it can better realize the detection of cashmere quality and obtain more accurate quality detection results for cashmere products.

[0072] In one embodiment, superpixel segmentation is performed on a first grayscale image to obtain multiple pixel blocks, including: determining a texture feature value of a target pixel point in the first grayscale image, wherein the texture feature value is determined based on the LBP value of the pixel point within the neighborhood of the target pixel point; and superpixel segmentation is performed on the first grayscale image based on the texture feature value of the pixel point in the first grayscale image to obtain multiple pixel blocks.

[0073] The neighborhood range can be the range formed by the target pixel as the center. For example, the size of the neighborhood range can be 5×5 or 7×7. The LBP (Local Binary Pattern) value is an operator used to describe the local texture features of an image. The LBP value is determined based on the grayscale values ​​of the pixel and other pixels in its neighborhood.

[0074] The steps for calculating the LBP value of the target pixel in the grayscale image include: comparing the grayscale value of the target pixel with that of other pixels in the neighborhood. If the grayscale value of other pixels in the neighborhood is greater than or equal to the grayscale value of the target pixel, the position of the other pixel is marked as 1; on the contrary, if the grayscale value of the other pixel is less than the grayscale value of the target pixel, the position of the other pixel is marked as 0.

[0075] Based on the comparison of the grayscale value of the target pixel with the grayscale values ​​of other pixels in the neighborhood, a binary number can be generated for each pixel in the neighborhood. These binary numbers are arranged in a clockwise or counterclockwise direction to form a binary sequence. This binary sequence is converted from binary to decimal, and the decimal value obtained is the LBP value of the target pixel.

[0076] For example, if there are 8 other pixels in the neighborhood of the target pixel, the comparison result of the grayscale values ​​of the 8 other pixels in the neighborhood of the target pixel and the target pixel can be [0, 1, 1, 0, 0, 0, 1, 1], where the first digit in the comparison result is 0, indicating that the grayscale value of the first pixel compared with the grayscale value of the target pixel is smaller than the grayscale value of the target pixel. The LBP code corresponding to the comparison result is 01100011. Converting 01100011 from binary to decimal is 103, which is the LBP value of the target pixel.

[0077] Since the LBP value has rotation invariance and grayscale invariance, it can better describe the characteristics of the target pixel point. The texture feature value of the target pixel point in the first grayscale image is determined based on the LBP value of the pixel points in the neighborhood of the target pixel point. Therefore, the obtained texture feature value can better characterize the texture characteristics of the target pixel point.

[0078] In one embodiment, the texture feature value of the target pixel is determined by: ;in, Represents the texture feature value of the target pixel, represents the LBP value of the i-th pixel in the neighborhood of the target pixel, B represents the mean LBP value of the pixels in the neighborhood, and n represents the number of pixels in the neighborhood. Indicates the maximum LBP value of the pixel within the neighborhood. Indicates the minimum LBP value of the pixel points in the neighborhood.

[0079] The difference between the maximum LBP value of the pixels in the neighborhood range and the minimum LBP value of the pixels in the neighborhood range can be used to characterize the amplitude of the change in the LBP value of the pixels in the neighborhood range of the target pixel point; by comparing the average value of the LBP value of the pixels in the neighborhood range with the LBP value of the pixels in the neighborhood range, the frequency of change in the LBP value of the pixels in the neighborhood range of the target pixel point can be characterized. Therefore, the texture feature value in the embodiment of the present application can better characterize the degree of change in the LBP value of the pixels in the neighborhood range.

[0080] The greater the degree of change in the LBP value within the neighborhood of the target pixel in the image, the higher the texture complexity of the area where the target pixel is located. Since the LBP value of the pixel point has rotation invariance and grayscale invariance, the texture feature value of the target pixel point can better describe the texture of the target pixel point, so as to realize the superpixel segmentation of the first grayscale image and reduce the over-segmentation of the superpixel segmentation process of the first grayscale image.

[0081] In one embodiment, superpixel segmentation is performed on the first grayscale image according to texture feature values ​​of pixel points in the first grayscale image to obtain multiple pixel blocks, including: superpixel segmentation is performed on the first grayscale image according to texture feature values ​​of pixel points in the first grayscale image and distances between pixel points to obtain multiple pixel blocks; the same pixel block includes multiple pixel points that are adjacent to each other and have similar texture feature values.

[0082] Since the texture feature value of a pixel point can better represent the texture feature of the pixel point than the grayscale value of the pixel point, superpixel segmentation of the first grayscale image can be better achieved according to the texture feature value of the pixel point in the first grayscale image.

[0083] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein, and the description and examples are to be considered merely as exemplary.

[0084] It will be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A method for detecting the quality of cashmere products, characterized in that: include: Acquire a first grayscale image of the surface of the cashmere product to be inspected, and perform superpixel segmentation on the first grayscale image to obtain a plurality of pixel blocks; Determining shape similarity between the first pixel block and the second pixel block, and determining grayscale feature similarity between the first pixel block and the second pixel block; The first pixel block and the second pixel block are adjacent pixel blocks among a plurality of pixel blocks; Determining a first distance between the first pixel block and the second pixel block, and determining a target parameter value between the first pixel block and the second pixel block based on the first distance, shape similarity, and grayscale feature similarity, where the target parameter value is used to represent the probability that the first pixel block and the second pixel block belong to different cashmere fibers; When the target parameter value is less than a preset parameter threshold, merging the first pixel block and the second pixel block into the same pixel block to obtain a second grayscale image after the pixel blocks are merged; Inputting the second grayscale image into a pre-trained cashmere quality detection model to obtain a quality detection result of the second grayscale image output by the cashmere quality detection model; The step of performing superpixel segmentation on the first grayscale image to obtain a plurality of pixel blocks includes: Determine a texture feature value of a target pixel in the first grayscale image, wherein the texture feature value is determined based on LBP values ​​of pixels within a neighborhood of the target pixel; Performing superpixel segmentation on the first grayscale image to obtain a plurality of pixel blocks according to texture feature values ​​of pixel points in the first grayscale image; The texture feature value of the target pixel is determined by: ;in, Represents the texture feature value of the target pixel, represents the LBP value of the i-th pixel in the neighborhood of the target pixel, B represents the mean LBP value of the pixels in the neighborhood, and n represents the number of pixels in the neighborhood. Indicates the maximum LBP value of the pixel within the neighborhood. Indicates the minimum LBP value of the pixel points in the neighborhood.

2. The method for detecting the quality of cashmere products according to claim 1, wherein: According to texture feature values ​​of pixels in the first grayscale image, superpixel segmentation is performed on the first grayscale image to obtain a plurality of pixel blocks, including: According to the texture feature values ​​of the pixels in the first grayscale image and the distances between the pixels, the first grayscale image is superpixel segmented to obtain a plurality of pixel blocks; the same pixel block includes a plurality of pixels that are adjacent to each other and have similar texture feature values.

3. The method for detecting the quality of cashmere products according to claim 1, wherein: Determining shape similarity between the first pixel block and the second pixel block includes: , where P is the shape similarity between the first pixel block and the second pixel block, and exp is an exponential function with a natural constant as the base. is the distance between the ath edge pixel point in the first pixel block and the seed point of the first pixel block, is the number of edge pixels in the first pixel block, is the distance between the bth edge pixel point in the second pixel block and the seed point of the second pixel block, is the number of edge pixels in the second pixel block, To take the absolute value operation.

4. The method for detecting the quality of cashmere products according to claim 1, wherein: Determining a grayscale feature similarity between the first pixel block and the second pixel block includes: , where Q is the grayscale feature similarity between the first pixel block and the second pixel block, and exp is an exponential function with a natural constant as the base. is the grayscale value of the d-th boundary pixel in the first pixel block, is the number of boundary pixels in the first pixel block, is the grayscale value of the e-th boundary pixel in the second pixel block, is the number of boundary pixels in the second pixel block, To take the absolute value operation.

5. The method for detecting the quality of cashmere products according to claim 1, wherein: The determining of a target parameter value between the first pixel block and the second pixel block according to the first distance, the shape similarity, and the grayscale feature similarity includes: ; Wherein, S is the target parameter value between the first pixel block and the second pixel block, D is the first distance between the first pixel block and the second pixel block, exp is an exponential function with a natural constant as the base, P is the shape similarity between the first pixel block and the second pixel block, and Q is the grayscale feature similarity between the first pixel block and the second pixel block.

6. The method for detecting the quality of cashmere products according to claim 1, wherein: The cashmere quality detection model is obtained by the following method: Obtaining a training sample set and a test set corresponding to the training sample set, wherein the training sample set includes a grayscale image of a surface of a cashmere product, and the test set includes a quality inspection result obtained by pre-performing a quality inspection on the grayscale image of the surface of the cashmere product; The pre-built initial quality detection model is trained using the training sample set and the test set to obtain a trained cashmere quality detection model.

7. The method for detecting the quality of cashmere products according to claim 1, characterized in that: The method further comprises: In the case where the quality test result indicates that the quality of the cashmere product to be tested is unqualified, it is indicated that the quality of the cashmere product to be tested is unqualified.

8. The method for detecting the quality of cashmere products according to claim 1, wherein: The method further comprises: In the case that the quality test result indicates that the quality of the cashmere product to be tested is qualified, it is indicated that the quality of the cashmere product to be tested is qualified.

Citation Information

Patent Citations

  • Textile defect detection method

    CN111784691A

  • Cloth defect detection method and device

    CN111929327A

  • Image segmentation method based on superpixel region merging

    CN117611620A

  • Rock debris particle image instance segmentation method under white light condition

    CN119027435A