Shoe and boot raw material quality inspection method based on machine vision
By applying machine vision technology in leather quality inspection, regional division and cluster analysis of leather surface grayscale images are performed, and abnormality correction is combined with corner point detection and grayscale value differences to solve the problem of leather with rich texture in the existing technology. The problem of inaccurate detection is eliminated and higher detection accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202411652410.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-19
AI Technical Summary
When using leather with rich textures, existing leather quality detection methods are difficult to accurately identify defects, resulting in inaccurate detection results.
Using a detection method based on machine vision, through regional division and cluster analysis of the leather surface grayscale image, the original abnormality degree of the sub-region is calculated, and the corner point detection and gray value difference are used as correction factors to correct the abnormality degree to complete Leather quality testing.
It improves the accuracy and reliability of leather quality inspection, can more accurately identify defects and texture features on the leather surface, and reduces subjective errors in manual inspection.
Smart Images

Figure CN119151941B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of leather inspection, and more specifically, to a method for inspecting the quality of raw materials for shoes and boots based on machine vision. Background Art
[0002] Leather is an indispensable material in footwear manufacturing, and its quality is directly related to the performance and appearance of the final product. Defects in natural leather or in the leather-making process may have an adverse effect on the quality of footwear. In the leather-making process, defects such as looseness, tube wrinkles, cracks and coarse grains will affect the quality of leather. Looseness and tube wrinkles may cause the leather to become wrinkled or uneven during use, which not only affects the appearance of the leather, but also reduces the comfort of wearing. Cracks and coarse grains may weaken the strength and durability of the leather.
[0003] The existing Chinese patent application document with publication number CN117830237A discloses a defect detection method and an intelligent leather defect detection system. The method includes placing the leather on a defect detector when defect detection is performed on the leather, and the defect detection device collects images of the leather; performing image processing on the collected leather image, and marking the image after image processing as a target leather image; performing comparative detection on the target leather image and a standard leather image, wherein the comparative detection content includes scratch detection, crack detection, indentation detection and contamination detection, and marking the detection result as target detection data; performing leather qualification rate judgment on the target detection data, and determining whether the leather is a qualified finished leather according to the judgment result.
[0004] However, when the leather material is smooth and has no texture, the surface defects of the leather can be easily identified or segmented. However, for leather with rich texture, it is difficult to identify defects. The above application documents do not take into account the impact of the leather's own texture on the judgment of defects, which may result in inaccurate leather quality inspection results. Summary of the invention
[0005] In order to solve the problem of inaccurate leather quality detection results, the present invention proposes a shoe raw material quality detection method based on machine vision.
[0006] The present invention discloses a shoe raw material quality detection method based on machine vision, comprising: dividing an acquired leather surface grayscale image into regions to obtain a plurality of sub-regions, clustering the sub-regions to obtain clustering results, and calculating the original abnormality of a target sub-region according to the clustering results, wherein the target sub-region is any sub-region; obtaining the corner points of the target sub-region by corner point detection, and calculating the edge complexity of the target sub-region according to the corner points; using the edge complexity and the grayscale value difference as correction factors, correcting the original abnormality to obtain the final abnormality, and completing the leather quality detection; wherein the final abnormality satisfies the relationship:
[0007] , represents the final abnormality, represents the original abnormality, represents the edge complexity, represents the mean gray value of the sub-region, Represents the mean grayscale value of the leather surface grayscale image, Indicates the extreme grayscale value of the leather surface grayscale image.
[0008] It can quantify the microscopic features of the leather surface from different angles, including texture uniformity, edge complexity, and grayscale consistency. By calculating the original abnormality and combining edge complexity and grayscale value differences as correction factors, it can more accurately evaluate the quality of the leather, thereby improving the accuracy and reliability of detection.
[0009] Preferably, obtaining multiple sub-regions includes: using edge detection on the grayscale value of the leather surface to obtain an initial region; taking the edges in the initial region that do not constitute a closed region as edges to be divided, and calculating the shortest distance from each endpoint of the edge to be divided to the edge of the initial region, and when the shortest distance is less than a preset threshold, connecting the endpoint corresponding to the shortest distance to the edge of the initial region, and the connecting line is the shortest distance; traversing all endpoints in all initial regions, completing region division, and obtaining multiple sub-regions.
[0010] Image processing technology is used to capture the microstructure and texture features of the leather surface, and the initial area of the leather surface is determined by edge detection. Then, by calculating the shortest distance from the edge endpoints to be divided to the edge of the area, these endpoints are connected to the edge to form closed sub-areas. Not only can it identify obvious large defects on the leather surface, but it can also subdivide smaller sub-areas, which may contain minor anomalies.
[0011] Preferably, clustering the sub-regions to obtain clustering results includes: taking the number of pixels contained in the sub-region as the area, and taking the number of pixels on the edge of the sub-region as the perimeter; taking the normalized area, the normalized perimeter-to-area ratio and the normalized number of corner points as size feature vectors, mapping the size feature vectors into three-dimensional space, and using mean shift to cluster the sub-regions to obtain clustering results.
[0012] The normalized area and perimeter area ratio can characterize the shape characteristics of the sub-region, while the normalized number of corner points reflects the complexity of the sub-region. The combination of these parameters enables the clustering results to more accurately reflect the microstructure and texture characteristics of the leather surface. The mean shift algorithm identifies the center of the cluster by continuously moving the center of the probability density function until the best fit is obtained. This process is not affected by the initial cluster center, which increases the robustness of the clustering results.
[0013] Preferably, clustering the sub-regions to obtain clustering results further comprises: taking the number of pixels contained in the sub-region as the area; and clustering the sub-regions using a density clustering algorithm according to the area to obtain clustering results.
[0014] Preferably, calculating the original abnormality includes: taking the cluster where the target sub-region is located as the target cluster, taking the distance between the target sub-region and the center point of the target cluster as the deviation distance, and taking the ratio of the deviation distance to the maximum value of the intra-cluster distance as the original abnormality.
[0015] Preferably, calculating the original abnormality also includes: taking the cluster where the target sub-region is located as the target cluster, taking the cluster containing the largest number of sub-regions as the dense cluster, and taking the distance between the target sub-region and the center point of the target cluster as the deviation distance; the original abnormality satisfies the relationship:
[0016] , represents the original abnormality, Indicates the number of sub-regions of the target cluster, represents the number of sub-regions of dense clusters, Indicates the deviation distance. Indicates the maximum distance within a cluster.
[0017] It can quantify the relative position and distribution density of sub-regions in the clustering space, thereby evaluating their deviation from the overall data set.
[0018] Preferably, calculating the edge complexity includes: constructing a coordinate system for the grayscale image of the leather surface, obtaining the position coordinates of each corner point of the target sub-area, arranging all corner points according to a preset direction, calculating the length between any two corner points, and constructing a length sequence; normalizing the first-order difference of the length sequence as the edge complexity.
[0019] Preferably, the edge complexity of the target sub-region also satisfies the relationship:
[0020] , represents the edge complexity, Indicates Corner points and The length between the corner points, Indicates Corner points and The length between the corner points, represents the total number of corner points, Indicates the number of corner points whose internal angle is greater than the straight angle. Indicates The internal angle of the corner points, Represents the normalization function.
[0021] By comprehensively considering the difference between the left and right edges of each corner point and the internal angle of the corner point to quantify edge complexity, the microscopic unevenness and texture characteristics of the leather surface can be captured. The difference in length between the left and right edges of a corner point reflects the symmetry of the edges on both sides. If the internal angle is greater than the straight angle, it means that the direction of the edge at the corner point has changed dramatically, forming an inward bend. The normal texture on leather is generally a polygon, and there is no inward bend. Therefore, if the internal angle is greater than the straight angle, it means that the edge at the corner point is likely to be a defect. The more corner points with internal angles greater than the straight angle, the greater the edge complexity of the target sub-region.
[0022] Beneficial effects of the present invention:
[0023] 1. The present invention performs automated detection on the surface quality of leather. First, by performing regional division and cluster analysis on the grayscale value of the leather surface image, the subtle differences in the leather surface texture can be accurately captured, and the normal texture of the leather and potential defects can be effectively distinguished. This process not only reduces the subjective errors that may occur in traditional manual detection, but also ensures high-throughput quality detection. Secondly, by correcting the edge complexity and grayscale differences, the abnormality of the leather surface in different areas is further analyzed, which can eliminate the misjudgment caused by the texture itself and accurately identify surface damage, cracks or other irregular defects.
[0024] 2. The present invention can reasonably evaluate the quality abnormality of the leather area through the calculation of the final abnormality, and realize more accurate defect identification. At the same time, the introduction of parameters such as size feature vector, corner point detection and density clustering algorithm in cluster analysis enhances the ability to identify abnormalities of various types of leather surface features (such as texture, thickness changes, etc.).
[0025] 3. The present invention can efficiently and accurately complete the quality inspection of shoe raw materials, significantly improve production efficiency and reduce labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0027] Figure 1 It is a flow chart of a method for detecting shoe raw material quality based on machine vision according to an embodiment of the present invention.
[0028] Figure 2 It is a grayscale image of the leather surface of the shoe raw material quality detection method based on machine vision in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0030] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0031] The present invention provides a method for detecting the quality of shoe raw materials based on machine vision. Figure 1 As shown, the shoe raw material quality detection method based on machine vision includes steps S1 to S3, which are described in detail below.
[0032] S1, dividing the obtained leather surface grayscale image into regions to obtain multiple sub-regions, clustering the sub-regions to obtain clustering results, and calculating the original abnormality of the target sub-region according to the clustering results.
[0033] In one embodiment, in order to perform leather quality inspection, the RGB (Red Green Blue) image of the leather to be inspected is first collected. During the collection, a high-resolution camera is usually used to shoot the leather sample under controlled lighting conditions to ensure that the image can clearly capture the texture and surface features of the leather. After the collection is completed, the leather RGB image is grayed to obtain a grayscale image of the leather surface. This conversion process can reduce the computational complexity while retaining key information in the image, such as texture and edges, which is crucial for subsequent image processing and analysis. Through graying, we can focus more on the texture details of the leather, laying a solid foundation for subsequent steps such as region segmentation, feature extraction, and defect detection. Figure 2 Shown is a grayscale image of the leather surface.
[0034] The initial area is obtained by using edge detection on the grayscale value of the leather surface; the edges in the initial area that do not constitute a closed area are taken as edges to be divided, and the shortest distance from each endpoint of the edge to be divided to the edge of the initial area is calculated respectively. When the shortest distance is less than a preset threshold, the endpoint corresponding to the shortest distance is connected to the edge of the initial area, and the connecting line is the shortest distance; all endpoints in all initial areas are traversed to complete the area division and obtain multiple sub-areas.
[0035] Exemplarily, for any edge to be divided, the preset threshold is set to one tenth of the perimeter of the edge including any edge to be divided.
[0036] The number of pixels contained in the sub-region is taken as the area, and the number of pixels on the edge of the sub-region is taken as the perimeter; the normalized area, the normalized perimeter-area ratio and the normalized number of corner points are taken as the size feature vector, the size feature vector is mapped into three-dimensional space, and the sub-regions are clustered using mean shift to obtain the clustering results.
[0037] It should be noted that the area can reflect the size of the sub-region, and the perimeter-to-area ratio can reflect the compactness and flatness of the sub-region shape. For example, the perimeter-to-area ratio of a circle is the smallest among all geometric figures. A sub-region with a simple shape can be surrounded by a relatively short perimeter to cover the area it occupies. The closer the sub-region is to a circle, the smaller the perimeter-to-area ratio is, and the more the sub-region is elongated, the larger the perimeter-to-area ratio is.
[0038] The cluster where the target sub-region is located is taken as the target cluster, the distance between the target sub-region and the center point of the target cluster is taken as the deviation distance, and the ratio of the deviation distance to the maximum value of the intra-cluster distance is taken as the original abnormality.
[0039] In one embodiment, region growing is used to divide the leather surface grayscale image into regions. Region growing is a well-known technique for those skilled in the art and will not be described in detail herein.
[0040] In one embodiment, clustering the sub-regions to obtain clustering results further includes: taking the number of pixels contained in the sub-region as the area; and clustering the sub-regions using a density clustering algorithm according to the area to obtain clustering results.
[0041] In one embodiment, the original abnormality degree further includes: taking the cluster where the target sub-region is located as the target cluster, taking the cluster containing the largest number of sub-regions as the dense cluster, and taking the distance between the target sub-region and the center point of the target cluster as the deviation distance.
[0042] The original abnormality satisfies the relationship: , represents the original abnormality, Indicates the number of sub-regions of the target cluster, represents the number of sub-regions of dense clusters, Indicates the deviation distance. Indicates the maximum distance within a cluster.
[0043] It reflects the overall abnormality of the cluster. The more sub-regions a cluster contains, the more frequently the regional texture represented by the cluster appears in the grayscale image of the entire leather surface. The higher the credibility of the cluster, the smaller the overall abnormality.
[0044] S2, using corner point detection to obtain the corner points of the target sub-region, and calculating the edge complexity of the target sub-region based on the corner points.
[0045] In one embodiment, a coordinate system is constructed for the grayscale image of the leather surface to obtain the position coordinates of each corner point of the target sub-area, all corner points are arranged in a preset direction, the length between any two corner points is calculated, and a length sequence is constructed; the first-order difference of the length sequence is normalized as the edge complexity.
[0046] It should be noted that the corner point at the upper left corner of the target sub-region is taken as the first element in the position sequence, and all corner points in the target sub-region are arranged in a clockwise direction, and the length between two corner points is calculated to obtain a length sequence. The first-order difference of the length sequence is calculated, that is, the difference between two adjacent elements in the length sequence.
[0047] Exemplarily, the preset direction may be clockwise or counterclockwise.
[0048] In one embodiment, the edge complexity of the target sub-region also satisfies the relationship:
[0049] , represents the edge complexity, Indicates Corner points and The length between the corner points, Indicates Corner points and The length between the corner points, represents the total number of corner points, Indicates the number of corner points whose internal angle is greater than the straight angle. Indicates The internal angle of the corner points, Represents the normalization function.
[0050] It should be noted that Indicates The difference in length of the left and right edges of a corner point reflects the symmetry of the edges on both sides. It indicates the number of corner points whose internal angle is greater than the straight angle. If the internal angle is greater than the straight angle (i.e. 180 degrees), it means that the direction of the edge at the corner point has changed dramatically, forming an inward bend. The normal texture on leather is generally polygonal (triangular, quadrilateral, pentagon, etc.), and there is no inward bend. Therefore, if the internal angle is greater than the straight angle, it means that the edge at the corner point is likely to be defective.
[0051] S3, taking the edge complexity and gray value difference as correction factors, corrects the original abnormality to obtain the final abnormality and completes the leather quality detection.
[0052] In one embodiment, the final abnormality satisfies the relationship:
[0053] , represents the final abnormality, represents the original abnormality, represents the edge complexity, represents the mean gray value of the sub-region, Represents the mean grayscale value of the leather surface grayscale image, Indicates the extreme grayscale value of the leather surface grayscale image.
[0054] It should be noted that the greater the edge complexity, the greater the probability that the target sub-region is abnormal, and the smaller the correction factor, the more the original abnormality can be amplified. Similarly, the greater the difference between the mean gray value of the target sub-region and the mean gray value of the leather surface grayscale image, the greater the probability that the target sub-region is abnormal, and the smaller the correction factor, the more the original abnormality can be amplified.
[0055] The final abnormality degree of each sub-region is obtained by traversal. When the abnormality degree is greater than the preset abnormal threshold, the sub-region is marked as an abnormal region, and the proportion of abnormal regions is counted, that is, the ratio of abnormal regions to the total number of sub-regions. When the ratio is greater than the preset proportion threshold, it means that the quality of the entire leather is unqualified.
[0056] Exemplarily, the preset abnormality threshold is set to 0.8, and the preset proportion threshold is set to 0.1. Both the preset abnormality threshold and the preset proportion threshold can be set by those skilled in the art according to the usage of leather.
[0057] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0058] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting the quality of shoe raw materials based on machine vision, characterized in that: include: The obtained leather surface grayscale image is divided into regions to obtain multiple sub-regions, and the sub-regions are clustered to obtain clustering results. The original abnormality of the target sub-region is calculated according to the clustering results. The target sub-region is any sub-region, and the original abnormality includes: The cluster where the target sub-region is located is taken as the target cluster, the distance between the target sub-region and the center point of the target cluster is taken as the deviation distance, and the ratio of the deviation distance to the maximum value of the intra-cluster distance is taken as the original abnormality; Corner point detection is used to obtain the corner points of the target sub-region, and the edge complexity of the target sub-region is calculated based on the corner points. The edge complexity includes: Construct a coordinate system for the grayscale image of the leather surface, obtain the position coordinates of each corner point of the target sub-area, arrange all corner points in a preset direction, calculate the length between any two corner points, and construct a length sequence; Normalize the first-order difference of the length sequence as the marginal complexity; The edge complexity and gray value difference are used as correction factors to correct the original abnormality to obtain the final abnormality and complete the leather quality inspection; Among them, the final abnormality satisfies the relationship: , represents the final abnormality, represents the original abnormality, represents the edge complexity, represents the mean gray value of the sub-region, Represents the mean grayscale value of the leather surface grayscale image, Indicates the extreme grayscale value of the leather surface grayscale image.
2. The method for detecting the quality of shoe materials based on machine vision according to claim 1, characterized in that: The obtaining of multiple sub-areas comprises: Use edge detection on the gray value of the leather surface to obtain the initial area; The edges in the initial area that do not form a closed area are taken as the edges to be divided, and the shortest distance from each endpoint of the edge to be divided to the edge of the initial area is calculated. When the shortest distance is less than a preset threshold, the endpoint corresponding to the shortest distance is connected to the edge of the initial area, and the connecting line is the shortest distance; Traverse all endpoints in all initial regions, complete region division, and obtain multiple sub-regions.
3. The method for detecting shoe material quality based on machine vision according to claim 1, characterized in that: The clustering of the sub-regions to obtain the clustering result includes: The number of pixels contained in the sub-region is taken as the area, and the number of pixels on the edge of the sub-region is taken as the perimeter; The normalized area, the normalized perimeter-to-area ratio and the normalized number of corner points are used as size feature vectors. The size feature vectors are mapped into three-dimensional space, and mean shift is used to cluster sub-regions to obtain clustering results.
4. The method for detecting shoe material quality based on machine vision according to claim 1, characterized in that: The clustering of the sub-regions to obtain clustering results further comprises: The number of pixels contained in the sub-region is taken as the area; The sub-regions are clustered according to their areas using a density clustering algorithm to obtain clustering results.
5. The method for detecting shoe material quality based on machine vision according to claim 1, characterized in that: Calculating the original abnormality also includes: The cluster where the target sub-region is located is taken as the target cluster, the cluster containing the largest number of sub-regions is taken as the dense cluster, and the distance between the target sub-region and the center point of the target cluster is taken as the deviation distance; The original abnormality satisfies the relationship: , represents the original abnormality, Indicates the number of sub-regions of the target cluster, represents the number of sub-regions of dense clusters, Indicates the deviation distance. Indicates the maximum distance within a cluster.
6. The method for detecting shoe material quality based on machine vision according to claim 1, characterized in that: The edge complexity of the target sub-region also satisfies the relationship: , represents the edge complexity, Indicates Corner points and The length between the corner points, Indicates Corner points and The length between the corner points, represents the total number of corner points, Indicates the number of corner points whose internal angle is greater than the straight angle. Indicates The internal angle of the corner points, Represents the normalization function.
Citation Information
Patent Citations
Defect detection method and intelligent leather defect detection system
CN117830237A
Sensor shell defect detection method based on artificial intelligence
CN114882026A
Corrugated board quality detection method based on image vision
CN115294123A