A visual inspection method for processing quality of bicycle saddle leather
By analyzing the approximation degree and lighting differences in the edge points in the grayscale image of the bicycle saddle leather surface, we can determine the edge points of suspected defects, which solves the problem of difficulty in detecting the leather surface and improves the accuracy and reliability of the detection results.
Patent Information
- Application Number
- CN202411245444.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Defect detection of bicycle saddle leather surface is difficult to accurately analyze, and is affected by ambient light, shadows and reflections, resulting in inaccurate quality detection results.
By acquiring edge points in the grayscale image of the leather surface, analyzing the approximation degree and illumination difference between edge points, determining the edge points of suspected defects, and performing quality detection based on the grayscale deviation and distribution.
The impact of light and reflection on the detection results is reduced, and the accuracy of defect points and the reliability of the detection results are improved.
Smart Images

Figure CN118762016B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of defect detection, and in particular to a method for visually detecting the processing quality of bicycle saddle leather. Background Art
[0002] The quality of bicycle saddle leather affects the comfort, durability and safety of bicycles. Bicycle leather saddles are durable and have good shock absorption. However, if cracks, scratches or deformations occur in the leather processing of bicycle saddles, the service life of the saddle will be affected and maintenance will be difficult. It will also bring potential safety hazards during riding. Therefore, quality inspection of bicycle saddles is very important in the production process.
[0003] In the usual method of defect detection by comparing and analyzing the acquired image with the standard image, due to the surface unevenness of the bicycle saddle, the process of the leather surface image will be affected by various factors such as ambient lighting, shadows or reflections, which greatly affects the judgment between the standard and the leather saddle surface. In addition, the leather saddle surface has complex and irregular texture features, which makes it more difficult to accurately analyze the defective parts in the saddle leather surface, affecting the quality inspection results. Summary of the invention
[0004] In order to solve the technical problem that it is difficult to accurately analyze the defective parts on the surface of saddle leather in the prior art, which affects the quality inspection results, the purpose of the present invention is to provide a visual inspection method for the processing quality of bicycle saddle leather. The technical scheme adopted is as follows:
[0005] The present invention provides a method for visually inspecting the processing quality of bicycle saddle leather, the method comprising:
[0006] Obtain edge points in the grayscale image of the leather surface of a bicycle saddle;
[0007] Between each edge point and each other edge point, the degree of similarity between each edge point and each other edge point is obtained according to the numerical similarity and distribution aggregation of the local grayscale deviation and the distribution similarity of the local edge points;
[0008] Between each edge point and each other edge point, according to the grayscale distribution deviation degree and the grayscale distribution range contrast degree within the preset neighborhood range, the illumination difference influence of each edge point and each other edge point is obtained;
[0009] Based on the approximation of each edge point to all other edge points and the influence of illumination differences, suspected defective edge points are determined from all edge points; quality inspection is performed based on the distribution of suspected defective edge points in the grayscale image of the leather surface.
[0010] Furthermore, the method for obtaining the degree of approximation includes:
[0011] The pixel points of each edge point within the preset local range are used as the local pixel points of each edge point; between each edge point and each other edge point, the grayscale deviation of each local pixel point is obtained according to the grayscale difference between the local pixel points at the same distribution position;
[0012] Between each edge point and each other edge point, according to the numerical chaotic distribution of the grayscale deviations of all local pixels, the numerical distribution index of each edge point and each other edge point is obtained;
[0013] Between each edge point and each other edge point, according to the value of the grayscale deviation of the local pixel points and the distribution of the distance between the local pixel points, the distribution discrete index of each edge point and each other edge point is obtained;
[0014] Between each edge point and each other edge point, the difference between the total number of edge points in a preset local range is used as an edge distribution indicator between each edge point and each other edge point;
[0015] The degree of similarity between each edge point and each other edge point is obtained by combining the numerical distribution index, distribution dispersion index and marginal distribution index of each edge point with each other edge point; the numerical distribution index and marginal distribution index are negatively correlated with the degree of similarity, and the distribution dispersion index is positively correlated with the degree of similarity.
[0016] Furthermore, the grayscale deviation acquisition method includes:
[0017] Arrange local pixel points of each edge point within a preset local range according to a preset arrangement order to obtain a local pixel sequence of each edge point;
[0018] Between each edge point and the local pixel sequences of each other edge point, the grayscale difference of the local pixel points having the same index value is used as the grayscale deviation of the local pixel point corresponding to the index value.
[0019] Furthermore, the method for obtaining the distribution dispersion index includes:
[0020] Between each edge point and each other edge point, the upper quartile of the grayscale deviation of all local pixels is used as the deviation benchmark; the local pixels whose grayscale deviation is greater than the upper quartile are regarded as abnormal pixels between each edge point and each other edge point;
[0021] In the preset local range of edge points, the accumulated value of the distance between two different abnormal pixel points is used as the distribution discrete index of each edge point and each other edge point.
[0022] Furthermore, the method for obtaining the influence of illumination difference includes:
[0023] Between each edge point and each other edge point, according to the similarity of the gray level distribution trend within the preset neighborhood range, the illumination deviation between each edge point and each other edge point is obtained;
[0024] Between each edge point and each other edge point, according to the difference between the maximum gray level and the minimum gray level within a preset neighborhood range, a range contrast between each edge point and each other edge point is obtained;
[0025] The illumination difference impact of each edge point on the other edge points is obtained by combining the illumination deviation and range contrast between each edge point and each other edge point.
[0026] Furthermore, the method for obtaining the illumination deviation comprises:
[0027] Obtain a grayscale histogram of each edge point within a preset neighborhood range, perform curve fitting on the data in the grayscale histogram, and obtain a neighborhood distribution curve for each edge point;
[0028] Between each edge point and each other edge point, the DTW value between the neighborhood distribution curves is used as the illumination deviation between each edge point and each other edge point.
[0029] Furthermore, the method for acquiring the range contrast includes:
[0030] The gray level range of each edge point is taken as the gray level range of each edge point within the preset neighborhood range;
[0031] The difference in grayscale range between each edge point and each other edge point is taken as the range deviation; the difference between the minimum grayscales is taken as the lower limit deviation; the difference between the maximum grayscales is taken as the upper limit deviation;
[0032] Between each edge point and every other edge point, the range contrast of each edge point and every other edge point is obtained according to the range deviation, lower limit deviation and upper limit deviation; the range deviation is negatively correlated with the range contrast, and the lower limit deviation and upper limit deviation are both positively correlated with the range contrast.
[0033] Furthermore, the method for obtaining the suspected defect edge point includes:
[0034] Combining the approximation degree of each edge point to each other edge point and the influence of illumination difference, the credible approximation degree of each edge point to each other edge point is obtained;
[0035] Combine the credible approximation of each edge point with all other edge points to obtain the normal possibility of each edge point;
[0036] When the normal probability of an edge point is less than a preset normal threshold, the corresponding edge point is regarded as a suspected defect edge point.
[0037] Furthermore, the quality inspection is performed according to the distribution of suspected defect edge points in the grayscale image of the leather surface, including:
[0038] The total number of suspected defect edge points in the leather surface grayscale image is taken as the number of defects in the leather surface grayscale image;
[0039] According to the local distance distribution between the edge points of suspected defects in the grayscale image of the leather surface, the defect distribution degree of the grayscale image of the leather surface is obtained;
[0040] Combining the defect quantity and defect distribution of the grayscale image of the leather surface, the defect degree of the leather surface is obtained;
[0041] When the defect degree is greater than a preset quality threshold, the leather surface of the corresponding bicycle saddle is marked as unqualified.
[0042] Furthermore, the method for obtaining the defect distribution degree includes:
[0043] The other suspected defect edge points within the preset neighborhood range of each suspected defect edge point are used as neighborhood defect edge points of the suspected defect edge point;
[0044] Count the total number of defect edge points in the neighborhood and obtain the local number distribution of each suspected defect edge point;
[0045] Negatively correlate the sum of the distances between each suspected defect edge point and each neighboring defect edge point to serve as the local distance distribution of each suspected defect edge point;
[0046] The product of the local quantity distribution and the local distance distribution of each suspected defect edge point is taken as the defect aggregation degree of each suspected defect edge point;
[0047] The average value of the defect aggregation degree of all suspected defect edge points is taken as the defect distribution degree of the leather surface grayscale image.
[0048] The present invention has the following beneficial effects:
[0049] The present invention considers that the overall similarity between the edge features of the leather texture and the defective part in the image is different, and the defect possibility is analyzed through the approximation between the edge points. First, the numerical similarity and distribution aggregation of the local grayscale deviation between the edge points, as well as the local edge distribution analysis, are analyzed to obtain the approximation degree. Considering that the local reflection in the saddle surface image will bring local grayscale deviation like the defective part, so the single local grayscale deviation cannot reflect the difference in defect characterization, the numerical distribution characteristics of the deviation and the continuous characteristics of the local edge are considered to reduce the influence of the reflection on the approximation degree analysis and improve the accuracy of subsequent defect determination. Further, the overall grayscale distribution between the edge points in the neighborhood is analyzed, considering the problem that the approximation at different edges may be unrealistic due to illumination, and the influence of illumination difference is obtained, so as to adjust the approximation degree in the subsequent defect analysis between the edges. Finally, the approximation degree of each edge point and all edge points and the influence of illumination difference are combined to determine the suspected defect edge points that may have abnormalities, reduce the differences caused by reflection and illumination, improve the accuracy of defect point screening, and perform quality inspection based on the distribution of suspected defect edge points. The present invention reduces the influence of collected light caused by uneven saddle through local grayscale deviation of edge points, local edge distribution and grayscale distribution, so that defect determination is more accurate and the result of quality inspection is more reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A flow chart of a method for visually inspecting the processing quality of bicycle saddle leather provided by one embodiment of the present invention;
[0052] Figure 2 A grayscale schematic diagram of leather texture provided by an embodiment of the present invention;
[0053] Figure 3 A grayscale schematic diagram of a leather surface scratch defect provided by an embodiment of the present invention;
[0054] Figure 4 A flow chart of a method for obtaining a degree of similarity provided by an embodiment of the present invention;
[0055] Figure 5 A flow chart of a method for obtaining the influence of illumination differences provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a bicycle saddle leather processing quality visual inspection method proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0057] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0058] The specific scheme of the visual inspection method for processing quality of bicycle saddle leather provided by the present invention is described in detail below with reference to the accompanying drawings.
[0059] See also Figure 1 , which shows a flow chart of a method for visually inspecting the processing quality of bicycle saddle leather provided by an embodiment of the present invention, the method comprising the following steps:
[0060] S1: Obtain edge points in the grayscale image of the leather surface of a bicycle saddle.
[0061] In an embodiment of the present invention, an image of the leather surface of a bicycle saddle on a conveyor belt is obtained by an industrial camera, and image preprocessing is performed to obtain a grayscale image of the leather surface. In an embodiment of the present invention, the image preprocessing process may specifically include image grayscale processing, filtering and denoising processing, and background removal processing. It should be noted that the image preprocessing process is a technical means well known to those skilled in the art, and specifically grayscale weighting method may be used for grayscale conversion, bilateral filtering method for filtering and denoising, and background difference method for background removal, etc., which will not be described in detail here.
[0062] Since the leather surface of a bicycle saddle needs to take into account the breathability and shock absorption effect of riding, the leather texture is usually finer. Figure 2 , which shows a grayscale diagram of leather texture provided by an embodiment of the present invention. The edge points in the grayscale features of the leather surface are obtained through the edge detection algorithm. Slight scratches or cracks may appear on the leather surface due to processing. These defects often appear as lines extending in a certain direction and have a certain difference in color from the normal leather color. Therefore, the defects can be analyzed from the edge points through edge detection. Please refer to Figure 3 , which shows a grayscale schematic diagram of a leather surface scratch defect provided by an embodiment of the present invention. It should be noted that the edge detection algorithm is a well-known technical means well known to those skilled in the art, and is not limited or elaborated herein.
[0063] S2: Between each edge point and each other edge point, the degree of similarity between each edge point and each other edge point is obtained according to the numerical similarity and distribution clustering of the local grayscale deviations and the distribution similarity of the local edge points.
[0064] Since the leather surface has certain textures, the normal leather texture has a high similarity, and the grayscale performance of the pixels around the texture edge pixels at different locations on the leather surface is also similar. However, the defect position does not have the characteristics similar to other textures, and the performance of the pixels in the local range is also different from the normal texture. Therefore, the approximation degree of the edge points is analyzed through the local grayscale situation.
[0065] Preferably, in some achievable manners of the embodiments of the present invention, the method for obtaining the degree of approximation is described in Figure 4 , which shows a flow chart of a method for obtaining a degree of similarity provided by an embodiment of the present invention, the method comprising the following steps:
[0066] S201: Pixels within a preset local range of each edge point are used as local pixels of each edge point; between each edge point and each other edge point, the grayscale deviation of each local pixel is obtained according to the grayscale difference between local pixels at the same distribution position.
[0067] The similarity between each edge point and other edge points in local grayscale performance is analyzed. For normal leather surface texture, the local grayscale difference is low, so the local grayscale deviation between two edge points is analyzed first.
[0068] In some achievable methods of the embodiments of the present invention, first, the local pixel points of each edge point within a preset local range are arranged in a preset arrangement order to obtain a local pixel sequence of each edge point, and by using the same arrangement method to sort within the local range, each local pixel point of the edge point has an index value, reflecting the position distribution within the local range.
[0069] Furthermore, between each edge point and the local pixel sequence of each other edge point, the grayscale difference of the local pixel points with the same index value is used as the grayscale deviation of the local pixel points corresponding to the index value. The local pixel points with the same index value are also the local pixel points with the same distribution position.
[0070] In a specific implementation of an embodiment of the present invention, the preset arrangement order is set to be from top to bottom and from left to right, the preset local range is set to be centered on the edge point, and 7 is the window range of the side length. The specific settings can be adjusted according to the specific implementation scenario and are not limited here.
[0071] When the edge point is a defective part, the grayscale deviation of the local pixel point will be large. However, due to the unevenness of the bicycle saddle, there will be reflections in the acquired surface image, which will also cause a large grayscale deviation of the local pixel point. Therefore, it is necessary to further analyze the grayscale deviation.
[0072] S202: between each edge point and each other edge point, according to the numerical disorder distribution of the grayscale deviations of all local pixels, obtain a numerical distribution index between each edge point and each other edge point.
[0073] First, the differences between edge points are analyzed. The more consistent the overall numerical distribution of grayscale deviation is, the higher the local grayscale similarity between edge points is, and the more consistent the grayscale characteristics between edge points are.
[0074] In the embodiment of the present invention, the variance of the grayscale deviation of all local pixels is used as the numerical distribution index of each edge point and each other edge point, and the variance is used to reflect the chaotic distribution of the numerical values. In other embodiments of the present invention, the chaotic distribution of the numerical values can also be reflected by calculating the standard deviation, coefficient of variation or information entropy, which will not be repeated or limited here.
[0075] The larger the variance, that is, the larger the numerical distribution index, the more inconsistent the grayscale deviation of the overall local pixel points is, and the worse the grayscale representation consistency between the edge point and other edge points in the local range is, and the lower the approximation is.
[0076] S203: between each edge point and each other edge point, according to the value of the grayscale deviation of the local pixel points and the distribution of the distance between the local pixel points, obtaining a distribution discrete index between each edge point and each other edge point.
[0077] Taking into account the situation where the grayscale deviation caused by the reflection problem is also large, we first analyze the position distribution of local pixels that produce large grayscale deviations. When the distribution of local pixels with large deviations is more concentrated, it is likely to be a defect. Conversely, when the position distribution of local pixels with large deviations is more discrete, it is more likely to be caused by interference such as reflection.
[0078] In some achievable methods of the embodiments of the present invention, the upper quartile of the grayscale deviation of all local pixels between each edge point and each other edge point is used as a deviation reference, and the local pixels with grayscale deviation greater than the upper quartile are used as abnormal pixels between each edge point and each other edge point. The upper quartile can be used to screen out local pixels with large grayscale deviations. In other embodiments of the present invention, the deviation reference can also be represented by the mean of all grayscale deviations, which is only used to screen out pixels with large grayscale deviations, and is not limited here.
[0079] Furthermore, within the preset local range of the edge point, the cumulative value of the distance between two different abnormal pixel points is used as the distribution discrete index of each edge point and each other edge point. Since the screening is only based on the grayscale deviation, the abnormal pixel points exist in the local range of each edge point and other edge points, and the distribution in the local range is consistent. Therefore, when analyzing the position, it is only necessary to analyze the density in a single local range. It should be noted that the pixel distance can be obtained by Euclidean distance, which is a technical means well known to those skilled in the art and will not be described in detail here.
[0080] The larger the accumulated value of the distance is, that is, the larger the distribution dispersion index is, the larger the grayscale deviation in the local range is, and the more discrete the distribution is. The possibility that the deviation in the local range is a defect is lower. At this time, the credibility of the difference in the local range is lower, and the approximation of the edge points should be higher.
[0081] S204: Between each edge point and each other edge point, a difference between the total number of edge points in a preset local range is used as an edge distribution index between each edge point and each other edge point.
[0082] Furthermore, since the directions of leather textures are similar and the size of the preset local range remains unchanged during edge point analysis, the degree of similarity can be further determined by the consistency of the distribution of edge points, thereby reducing the impact of interference such as reflection on grayscale judgment.
[0083] In the embodiment of the present invention, the total number of edge points of each edge point in a preset local range is counted to obtain the number of local edge points of each edge point, and the local edge point number is used to reflect the local edge distribution characteristics. The difference between the number of local edge points of each edge point and each other edge point is used as the edge distribution index of each edge point and each other edge point.
[0084] The greater the difference between the total number of edge points, that is, the larger the edge distribution index, the less similar the local texture distribution between the edge points is, and the lower the approximation between the edge points is.
[0085] S205: Combining the numerical distribution index, distribution dispersion index and edge distribution index of each edge point with each other edge point, obtaining the degree of similarity between each edge point and each other edge point; the numerical distribution index and the edge distribution index are both negatively correlated with the degree of similarity, and the distribution dispersion index is positively correlated with the degree of similarity.
[0086] Finally, the local approximation between edge points is characterized by the comprehensive analysis of the three aspects. In the embodiment of the present invention, between each edge point and each other edge point, the product of the numerical distribution index and the edge distribution index is used as the difference distribution index, and the ratio of the distribution dispersion index to the difference distribution index is used as the degree of approximation between each edge point and each other edge point. The ratio reflects that both the numerical distribution index and the edge distribution index are negatively correlated with the degree of approximation, and the distribution dispersion index is positively correlated with the degree of approximation.
[0087] In other embodiments of the present invention, other basic mathematical operations may also be used to reflect that both the numerical distribution index and the marginal distribution index are negatively correlated with the degree of approximation, such as subtraction or negative exponential idempotence, and the distribution discrete index is positively correlated with the degree of approximation, such as addition, etc., without limitation herein.
[0088] In a specific implementation of the embodiment of the present invention, the expression of the approximation degree is:
[0089] ; In the formula, Expressed as The edge point and The approximation between edge points is Expressed as The edge point and The distribution dispersion index between edge points is Expressed as The edge point and The numerical distribution index between edge points, Expressed as The edge point and The edge distribution index between edge points. It is represented as a preset adjustment coefficient, which can be set to 0.01 in the embodiment of the present invention. Its purpose is to prevent the denominator from being zero, making the formula meaningless. No limitation is made here.
[0090] At this point, the local analysis between edge points is completed, and the approximation degree reflects the approximation between edge points.
[0091] S3: between each edge point and each other edge point, according to the grayscale distribution deviation degree and the grayscale distribution range contrast degree within a preset neighborhood range, obtain the illumination difference influence between each edge point and each other edge point.
[0092] Due to the uneven surface of the bicycle saddle, light interference will inevitably occur during image acquisition, which will lead to inconsistent lighting conditions in different parts and may cause shadow deviations, which will cause the approximation degree of the analysis to fail to show a more realistic grayscale approximation. Therefore, the consistency of the lighting distribution is used to analyze the degree to which the edge points are affected by lighting during local analysis.
[0093] Preferably, in some achievable manners of the embodiments of the present invention, the method for obtaining the influence of illumination difference can be found in Figure 5 , which shows a flow chart of a method for obtaining the influence of illumination differences provided by an embodiment of the present invention, the method comprising the following steps:
[0094] S301: between each edge point and each other edge point, according to the similarity of gray level distribution trends within a preset neighborhood range, obtaining the illumination deviation between each edge point and each other edge point.
[0095] The grayscale distribution trend reflects the degree of illumination deviation. When the illumination conditions analyzed between edge points are more consistent, the overall trend of grayscale distribution is close. On the contrary, if the grayscale distribution trend is significantly different, it means that the grayscale distribution in the neighborhood may be affected by different illumination.
[0096] In some achievable methods of the embodiments of the present invention, a grayscale histogram of each edge point within a preset neighborhood range is obtained, and curve fitting is performed on the data in the grayscale histogram to obtain a neighborhood distribution curve for each edge point. The data curve in the grayscale histogram can more intuitively reflect the grayscale distribution trend.
[0097] Furthermore, between each edge point and each other edge point, the DTW value between the neighborhood distribution curves is used as the illumination deviation between each edge point and each other edge point. The degree of trend difference between the neighborhood distribution curves is reflected by the DTW value, and the DTW value is obtained by a dynamic time warping algorithm, which is a technical means well known to those skilled in the art and will not be elaborated here. In other embodiments of the present invention, the Pearson correlation coefficient or the Spearman rank correlation coefficient can also be used to reflect the approximation between the curves, and the degree of difference is reflected by the value of the negative correlation mapping, which will not be elaborated or limited here.
[0098] In a specific implementation of an embodiment of the present invention, a larger range analysis is adopted for the overall analysis of the illumination range than the local range analysis, so the preset neighborhood range is set to be a window range with an edge point as the center and 15 as the side length. The implementer can make specific adjustments according to the implementation scenario.
[0099] The greater the illumination deviation, the more inconsistent the neighborhood illumination between edge points is, the higher the possible illumination influence is, and the lower the credibility of the approximation is.
[0100] S302: between each edge point and each other edge point, according to the difference between the maximum gray level and the minimum gray level within a preset neighborhood range, obtaining a range contrast ratio between each edge point and each other edge point.
[0101] When the grayscale distribution trend is similar, the grayscale distribution range also needs to be considered. Even if the grayscale distribution is similar, there may be illumination deviation or defects in the neighborhood, which may cause the grayscale distribution range to shift or expand or shrink in contrast, making the local analysis of edge points less reliable.
[0102] In some possible implementations of the embodiments of the present invention, the extreme difference of the gray level of each edge point within a preset neighborhood range is used as the gray level range of each edge point. The difference in gray level range between each edge point and each other edge point is used as the range deviation, the difference between the minimum gray levels is used as the lower limit deviation, and the difference between the maximum gray levels is used as the upper limit deviation. The distribution range of gray level changes and the deviation changes of the lower limit and upper side of the gray level distribution are combined to analyze the contrast difference degree of the gray level distribution.
[0103] Furthermore, between each edge point and each other edge point, a range contrast between each edge point and each other edge point is obtained according to the range deviation, the lower limit deviation and the upper limit deviation.
[0104] When the lower limit deviation and the upper limit deviation are larger, it means that the distribution deviation of the gray level in the neighborhood is larger, and the influence of the illumination deviation is more serious. When the range deviation is larger, it means that the range of gray level distribution in the neighborhood varies more. At this time, it is very likely that there are defects and abnormalities in the neighborhood itself, and the abnormal illumination may be analyzed to be low. On the contrary, it means that the distribution of gray level does not change much. If there is a deviation in the distribution in the range, it is very likely caused by the influence of illumination. Therefore, the range deviation is negatively correlated with the range contrast, and the lower limit deviation and the upper limit deviation are both positively correlated with the range contrast.
[0105] In the embodiment of the present invention, the product of the lower limit deviation and the upper limit deviation is used as the deviation degree, and the product of the value after the range deviation is negatively correlated and normalized and the deviation degree is used as the range contrast.
[0106] The greater the range contrast, the more likely it is that edge points are affected by illumination in the neighborhood distribution, and the approximate distribution between edge points is less credible.
[0107] S303: Combining the illumination deviation and range contrast between each edge point and each other edge point, obtain the illumination difference influence between each edge point and each other edge point.
[0108] Combining the grayscale trend distribution and range distribution, the influence of light on edge points is comprehensively reflected. In an embodiment of the present invention, the product of the light deviation and range contrast of each edge point and each other edge point is normalized to obtain the light difference influence of each edge point and each other edge point.
[0109] In a specific implementation of the embodiment of the present invention, the expression of the influence of illumination difference is:
[0110] ; In the formula, Expressed as The edge point and The difference in illumination between edge points affects Expressed as The edge point and The illumination deviation between edge points, Expressed as The edge point and The lower limit deviation between edge points, Expressed as The edge point and The upper limit deviation between edge points, Expressed as The edge point and The range deviation between edge points, is expressed as an exponential function with a natural constant as base, It is represented as a normalization processing function. It should be noted that normalization is a technical means well known to those skilled in the art. The normalization function can be linear normalization or standard normalization, etc. The specific normalization method is not limited here.
[0111] in, Expressed as The edge point and The range contrast between edge points. The larger the illumination deviation and range contrast, the higher the deviation of the overall grayscale distribution between edge points in the neighborhood range, which reflects a larger illumination difference and reduces the authenticity when analyzing the degree of approximation.
[0112] S4: Determine suspected defective edge points from all edge points based on the approximation between each edge point and all other edge points and the influence of illumination differences; perform quality inspection based on the distribution of suspected defective edge points in the grayscale image of the leather surface.
[0113] Finally, the approximation between edge points is further adjusted through the influence of illumination differences, and a more reliable approximate analysis is obtained to screen suspected defective edge points, so as to minimize the various light influence problems when acquiring on the bicycle saddle surface.
[0114] Preferably, in some achievable manners of the embodiments of the present invention, the method for acquiring suspected defect edge points includes:
[0115] First, the credible proximity of each edge point to each other edge point is obtained by combining the degree of similarity between each edge point and each other edge point and the influence of illumination difference. In an embodiment of the present invention, the product of the degree of similarity between each edge point and each other edge point and the inverse proportional value of the illumination difference is used as the credible proximity of each edge point to each other edge point. The greater the influence of illumination difference, the lower the analytical credibility of the degree of similarity is, and therefore adjustment is made through the inverse proportional value.
[0116] Secondly, the credible approximation between each edge point and all other edge points is combined to obtain the normal possibility of each edge point. Considering that the features of normal leather texture edges at all edge points are similar, a comprehensive judgment is made based on the approximation between each edge point and all other edge points. In an embodiment of the present invention, the accumulated value of the credible approximation between each edge point and all other edge points is normalized to obtain the normal possibility of the edge point. The higher the overall credible approximation, the higher the possibility that the edge point is a normal edge point.
[0117] In other embodiments of the present invention, the average value of the credible approximation between each edge point and all other edge points may be normalized to obtain the normal probability of the edge point, which will not be elaborated here.
[0118] Finally, when the normal probability of an edge point is less than the preset normal threshold, it means that the overall similarity between the edge point and other edge points is low, and the corresponding edge point is regarded as a suspected defect edge point. In the embodiment of the present invention, the preset normal threshold is set to 0.3, and the specific value can be adjusted by the implementer according to the specific implementation situation, and is not limited here.
[0119] In other embodiments of the present invention, all possible normal lower quartiles may be used as normal thresholds to screen out edge points with low approximation for further analysis.
[0120] Thus, the points of suspected defect edges in the grayscale image of the leather surface are obtained. When these suspected defect edge points are distributed more and have a higher concentration, it means that these edge points are more likely to constitute defect points, which further indicates that the higher the possibility of defects on the leather surface, the more likely there is a problem with the leather processing quality of the saddle.
[0121] Preferably, in some achievable methods of the embodiments of the present invention, quality detection is performed according to the distribution of suspected defect edge points in the grayscale image of the leather surface, including:
[0122] First, the total number of suspected defect edge points in the leather surface grayscale image is taken as the number of defects in the leather surface grayscale image. The more the number of suspected defect edge points in the image, the higher the possibility of defects.
[0123] Secondly, according to the local distance distribution between the suspected defect edge points in the grayscale image of the leather surface, the defect distribution degree of the leather surface grayscale image is obtained. For the defect edge points, the defect area that may be formed is a clustered area, so there are other defect edge points with close distances near the defect edge points.
[0124] In an embodiment of the present invention, other suspected defect edge points within a preset neighborhood range of each suspected defect edge point are taken as neighborhood defect edge points of the suspected defect edge point, and the total number of neighborhood defect edge points is counted to obtain the local quantity distribution of each suspected defect edge point. When the number of suspected defect points in the local range is more, that is, the local quantity distribution is larger, the distribution is more concentrated. The sum of the distances between each suspected defect edge point and each neighborhood defect edge point is negatively correlated and mapped as the local distance distribution of each suspected defect edge point. When the distance is closer, that is, the local distance distribution is larger, the distribution is more concentrated.
[0125] Furthermore, the product of the local number distribution and the local distance distribution of each suspected defect edge point is used as the defect aggregation degree of each suspected defect edge point. The more other suspected defect edge points are in each suspected defect edge point and the closer the distance is, the more aggregated the local defect distribution is. The average value of the defect aggregation degree of all suspected defect edge points is used as the defect distribution degree of the grayscale image of the leather surface. The higher the overall defect aggregation degree is, the more likely it is that there is a defect area.
[0126] Finally, the defect degree of the leather surface is obtained by combining the defect number and defect distribution degree of the grayscale image of the leather surface. In an embodiment of the present invention, the product of the defect number and the defect distribution degree is normalized to obtain the defect degree of the leather surface. The larger the defect number and the defect distribution degree, the more possible and numerous defects there are in the image, and the higher the defect degree.
[0127] When the defect degree is greater than the preset quality threshold, the leather surface of the corresponding bicycle saddle is recorded as unqualified. In a specific implementation of the embodiment of the present invention, the preset quality threshold is set to 0.4, and the specific value can be adjusted according to the specific implementation scenario, which is not limited here.
[0128] In summary, the present invention considers that the overall similarity between the edge features of the leather texture and the defective part in the image is different, and analyzes the possibility of defects through the approximation between the edge points. First, the numerical similarity and distribution aggregation of the local grayscale deviation between the edge points, as well as the local edge distribution analysis, are analyzed to obtain the approximation degree. Considering that the local reflection in the saddle surface image will bring local grayscale deviation like the defective part, so the single local grayscale deviation cannot reflect the difference in defect characterization, the numerical distribution characteristics of the deviation and the continuous characteristics of the local edge are considered to reduce the influence of the reflection on the approximation degree analysis and improve the accuracy of subsequent defect determination. Further, the overall grayscale distribution between the edge points in the neighborhood is analyzed, considering the problem that the approximation at different edges may be unrealistic due to illumination, and the influence of illumination difference is obtained, so as to adjust the approximation degree in the subsequent defect analysis between the edges. Finally, the approximation degree of each edge point and all edge points and the influence of illumination difference are combined to determine the suspected defect edge points that may have abnormalities, reduce the differences caused by reflection and illumination, improve the accuracy of defect point screening, and perform quality inspection based on the distribution of suspected defect edge points. The present invention reduces the influence of collected light caused by uneven saddle through local grayscale deviation of edge points, local edge distribution and grayscale distribution, so that defect determination is more accurate and the result of quality inspection is more reliable.
[0129] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0130] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A method for visually inspecting the processing quality of bicycle saddle leather, characterized in that: The method comprises: Obtain edge points in the grayscale image of the leather surface of a bicycle saddle; Between each edge point and each other edge point, the degree of similarity between each edge point and each other edge point is obtained according to the numerical similarity and distribution aggregation of the local grayscale deviation and the distribution similarity of the local edge points; Between each edge point and each other edge point, according to the grayscale distribution deviation degree and the grayscale distribution range contrast degree within the preset neighborhood range, the illumination difference influence of each edge point and each other edge point is obtained; Based on the approximation of each edge point to all other edge points and the influence of illumination differences, suspected defective edge points are determined from all edge points; quality inspection is performed based on the distribution of suspected defective edge points in the grayscale image of the leather surface.
2. The method for visually inspecting the processing quality of bicycle saddle leather according to claim 1, characterized in that: The method for obtaining the approximation degree includes: The pixel points of each edge point within the preset local range are used as the local pixel points of each edge point; between each edge point and each other edge point, the grayscale deviation of each local pixel point is obtained according to the grayscale difference between the local pixel points at the same distribution position; Between each edge point and each other edge point, according to the numerical chaotic distribution of the grayscale deviations of all local pixels, the numerical distribution index of each edge point and each other edge point is obtained; Between each edge point and each other edge point, according to the value of the grayscale deviation of the local pixel points and the distribution of the distance between the local pixel points, the distribution discrete index of each edge point and each other edge point is obtained; Between each edge point and each other edge point, the difference between the total number of edge points in a preset local range is used as an edge distribution indicator between each edge point and each other edge point; The degree of similarity between each edge point and each other edge point is obtained by combining the numerical distribution index, distribution dispersion index and marginal distribution index of each edge point with each other edge point; the numerical distribution index and marginal distribution index are negatively correlated with the degree of similarity, and the distribution dispersion index is positively correlated with the degree of similarity.
3. A method for visually inspecting the processing quality of bicycle saddle leather according to claim 2, characterized in that: The grayscale deviation acquisition method includes: Arrange local pixel points of each edge point within a preset local range according to a preset arrangement order to obtain a local pixel sequence of each edge point; Between each edge point and the local pixel sequences of each other edge point, the grayscale difference of the local pixel points having the same index value is used as the grayscale deviation of the local pixel point corresponding to the index value.
4. The method for visually inspecting the processing quality of bicycle saddle leather according to claim 2, characterized in that: The method for obtaining the distribution dispersion index includes: Between each edge point and each other edge point, the upper quartile of the grayscale deviation of all local pixels is used as the deviation benchmark; the local pixels whose grayscale deviation is greater than the upper quartile are regarded as abnormal pixels between each edge point and each other edge point; In the preset local range of edge points, the accumulated value of the distance between two different abnormal pixel points is used as the distribution discrete index of each edge point and each other edge point.
5. The method for visually inspecting the processing quality of bicycle saddle leather according to claim 1, characterized in that: The method for obtaining the influence of illumination difference includes: Between each edge point and each other edge point, according to the similarity of the gray level distribution trend within the preset neighborhood range, the illumination deviation between each edge point and each other edge point is obtained; Between each edge point and each other edge point, according to the difference between the maximum gray level and the minimum gray level within a preset neighborhood range, a range contrast between each edge point and each other edge point is obtained; The illumination difference impact of each edge point on the other edge points is obtained by combining the illumination deviation and range contrast between each edge point and each other edge point.
6. A method for visually inspecting the processing quality of bicycle saddle leather according to claim 5, characterized in that: The method for obtaining the illumination deviation comprises: Obtain a grayscale histogram of each edge point within a preset neighborhood range, perform curve fitting on the data in the grayscale histogram, and obtain a neighborhood distribution curve for each edge point; Between each edge point and each other edge point, the DTW value between the neighborhood distribution curves is used as the illumination deviation between each edge point and each other edge point.
7. A method for visually inspecting the processing quality of bicycle saddle leather according to claim 5, characterized in that: The method for acquiring the range contrast includes: The gray level range of each edge point is taken as the gray level range of each edge point within the preset neighborhood range; The difference in grayscale range between each edge point and each other edge point is taken as the range deviation; the difference between the minimum grayscales is taken as the lower limit deviation; the difference between the maximum grayscales is taken as the upper limit deviation; Between each edge point and every other edge point, the range contrast of each edge point and every other edge point is obtained according to the range deviation, lower limit deviation and upper limit deviation; the range deviation is negatively correlated with the range contrast, and the lower limit deviation and upper limit deviation are both positively correlated with the range contrast.
8. The method for visually inspecting the processing quality of bicycle saddle leather according to claim 1, characterized in that: The method for obtaining the suspected defect edge point includes: Combining the approximation degree of each edge point to each other edge point and the influence of illumination difference, the credible approximation degree of each edge point to each other edge point is obtained; Combine the credible approximation of each edge point with all other edge points to obtain the normal possibility of each edge point; When the normal probability of an edge point is less than a preset normal threshold, the corresponding edge point is regarded as a suspected defect edge point.
9. A method for visually inspecting the processing quality of bicycle saddle leather according to claim 1, characterized in that: The quality inspection is performed according to the distribution of suspected defect edge points in the grayscale image of the leather surface, including: The total number of suspected defect edge points in the leather surface grayscale image is taken as the number of defects in the leather surface grayscale image; According to the local distance distribution between the edge points of suspected defects in the grayscale image of the leather surface, the defect distribution degree of the grayscale image of the leather surface is obtained; Combining the defect quantity and defect distribution of the grayscale image of the leather surface, the defect degree of the leather surface is obtained; When the defect degree is greater than a preset quality threshold, the leather surface of the corresponding bicycle saddle is marked as unqualified.
10. A method for visually inspecting the processing quality of bicycle saddle leather according to claim 9, characterized in that: The method for obtaining the defect distribution degree includes: The other suspected defect edge points within the preset neighborhood range of each suspected defect edge point are used as neighborhood defect edge points of the suspected defect edge point; Count the total number of defect edge points in the neighborhood and obtain the local number distribution of each suspected defect edge point; Negatively correlate the sum of the distances between each suspected defect edge point and each neighboring defect edge point as the local distance distribution of each suspected defect edge point; The product of the local quantity distribution and the local distance distribution of each suspected defect edge point is taken as the defect aggregation degree of each suspected defect edge point; The average value of the defect aggregation degree of all suspected defect edge points is taken as the defect distribution degree of the leather surface grayscale image.
