A method for evaluating the quality of metal parts bending

By determining the distribution inclusion and demarcation degree of the grayscale value, correcting the frequency, and enhancing the image contrast, the problem of defect detection accuracy in the bending and forming process of metal parts is solved, and the accuracy of contrast enhancement and defect recognition is achieved.

CN120219386BActive Publication Date: 2025-09-05SHAANXI ZETAO AUTO PARTS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

Smart Images

  • Figure CN120219386B_ABST
    Figure CN120219386B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for evaluating the quality of metal part bending, comprising: determining the degree of distribution inclusion between a grayscale value and each grayscale value less than the grayscale value based on the distribution relationship between the pixel points corresponding to the grayscale value in the bending region image and the pixel points corresponding to each grayscale value less than the grayscale value; determining the degree of demarcation of the grayscale value based on the degree of distribution inclusion between all grayscale values ​​greater than the grayscale value and all grayscale values ​​less than the grayscale value within a local range of the grayscale value; correcting the frequency of each grayscale value based on the degree of demarcation to obtain a corrected frequency of each grayscale value; enhancing the bending region image based on the corrected frequency of each grayscale value to obtain an enhanced image; and evaluating the bending quality of the metal part based on the enhanced image. The present invention enhances the contrast between different image features in the bending region image, thereby improving the accuracy of the bending quality evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more particularly to a method for evaluating the quality of metal part bending. Background Art

[0002] During the metal bending process, due to the complex and ever-changing processing environment, the collected workpiece surface images often exhibit low contrast. Subtle defects such as creases and cracks are often hidden in low-contrast areas, directly affecting the accuracy of subsequent quality inspections. Therefore, it is necessary to enhance the images of the bending area.

[0003] Histogram equalization, a classic image enhancement method, improves overall contrast by expanding the dynamic range of pixel values ​​and has been widely used in early industrial inspection. However, this method has significant limitations: the histogram equalization algorithm tends to over-enhance high-frequency grayscale regions, while low-frequency grayscale regions may be weakened or even lost. Because subtle defects such as creases and cracks on metal surfaces often correspond to low-frequency grayscale distributions, these key defect features are easily overwhelmed or completely lost by background noise during the histogram equalization process, seriously affecting the accuracy of quality assessment results. Summary of the Invention

[0004] To solve the technical problem that histogram equalization causes low-frequency grayscale areas such as creases and cracks to be drowned out by background noise or completely lost, thus affecting the accuracy of quality evaluation results, the present invention provides a method for evaluating the quality of metal bending forming, comprising:

[0005] For any grayscale value in the bending area image, the distribution inclusion degree between the grayscale value and the grayscale values ​​smaller than the grayscale value is determined based on the distribution relationship between the pixel points corresponding to the grayscale value and the pixel points corresponding to the grayscale values ​​smaller than the grayscale value;

[0006] Determine the demarcation degree of the grayscale value according to the distribution inclusion degree between all grayscale values ​​greater than the grayscale value and all grayscale values ​​less than the grayscale value within the local range of the grayscale value;

[0007] Correcting the frequency of each grayscale value according to the demarcation degree of each grayscale value to obtain the corrected frequency of each grayscale value;

[0008] The image of the bending area is enhanced according to the correction frequency of each gray value to obtain an enhanced image;

[0009] Evaluate the bending quality of metal parts based on enhanced images.

[0010] Preferably, determining the distribution inclusion degree between the grayscale value and each grayscale value smaller than the grayscale value comprises:

[0011] Obtain the minimum bounding rectangle corresponding to all pixels corresponding to each grayscale value as the minimum bounding rectangle of each grayscale value;

[0012] For any two grayscale values, the minimum circumscribed rectangle of the two grayscale values ​​is obtained to obtain the distribution overlap degree between the two pixel points; the product of the distribution overlap degree and the credibility of the distribution overlap degree is used as the distribution inclusion degree between the two pixel points.

[0013] Preferably, the method for obtaining the distribution overlap degree is:

[0014] The intersection and union of the minimum bounding rectangles of the two grayscale values ​​are obtained, and the ratio of the number of pixels contained in the intersection to the number of pixels contained in the union is used as the distribution overlap degree between the two pixels.

[0015] Preferably, the method for obtaining the credibility is:

[0016] Evenly divide the minimum circumscribed rectangle of the grayscale value into several grids, count the number of pixels corresponding to the grayscale value contained in each grid, obtain the average difference in the number of pixels corresponding to the grayscale value contained in any two grids, and perform negative correlation normalization on the average difference to obtain the distribution dispersion of the grayscale value;

[0017] For any two pixels, the minimum value of the distribution dispersion of the two pixels is used as the credibility of the distribution overlap between the two pixels.

[0018] Preferably, determining the demarcation degree of the grayscale value includes:

[0019] The grayscale values ​​after the grayscale value are used as backward reference grayscale values ​​of the grayscale value, and the grayscale values ​​before the grayscale value are used as forward reference grayscale values ​​of the grayscale value;

[0020] Determining the boundary probability of the grayscale value at the backward reference grayscale value based on the distribution inclusion degree between the backward reference grayscale value of the grayscale value and all the forward reference grayscale values ​​of the grayscale value, and the distribution inclusion degree between the backward reference grayscale value of the grayscale value and the grayscale value and all the backward reference grayscale values ​​before the backward reference grayscale value;

[0021] The average of the boundary probabilities of the gray value under all backward reference gray values ​​of the gray value is used as the boundary degree of the gray value.

[0022] Preferably, the method for obtaining the cutoff probability is:

[0023] For any backward reference grayscale value of the grayscale value, obtain the mean of the distribution inclusion degree between the backward reference grayscale value and all the forward reference grayscale values ​​of the grayscale value as the first mean; obtain the mean of the distribution inclusion degree between the backward reference grayscale value and the grayscale value and all the backward reference grayscale values ​​before the backward reference grayscale value as the second mean; take the difference between the second mean and the first mean as the forward and backward inter-class difference; take the mean of the pairwise differences in the distribution inclusion degree between the backward reference grayscale value and all the forward reference grayscale values ​​of the grayscale value as the forward intra-class difference; take the mean of the pairwise differences in the distribution inclusion degree between the backward reference grayscale value and the grayscale value and all the backward reference grayscale values ​​before the backward reference grayscale value as the backward intra-class difference;

[0024] According to the forward and backward inter-class differences, the forward intra-class differences, and the backward intra-class differences, the boundary probability of the grayscale value under the backward reference grayscale value is determined.

[0025] Preferably, the demarcation probability satisfies the expression:

[0026] ;

[0027] in, Indicates the The gray value of The backward reference gray value The boundary probability of gray values; Indicates the The gray value of The forward and backward inter-class differences of the backward reference grayscale values; represents the forward intra-class difference, represents the backward intra-class difference; represents an S-shaped curve; Represents an exponential function with a natural constant as its base.

[0028] Preferably, the correction frequency satisfies the expression:

[0029] ;

[0030] in, Indicates the The correction frequency of the gray value, Indicates the The degree of separation of gray values; Indicates the The frequency of grayscale values; Indicates the number of grayscale values ​​in the bending area image; Indicates the The degree of separation of gray values; Indicates the The frequency of grayscale values.

[0031] Preferably, the step of enhancing the bending area image according to the correction frequency of each grayscale value to obtain an enhanced image includes:

[0032] With the grayscale value as the horizontal axis and the correction frequency of each grayscale value as the vertical axis, a grayscale histogram is constructed, and histogram equalization is performed on the grayscale histogram to obtain an enhanced image of the bending area image.

[0033] Preferably, the metal part bending quality evaluation based on the enhanced image includes:

[0034] The enhanced image is input into the trained neural network to output the bending defects of the metal parts.

[0035] The beneficial effects of the present invention are as follows: the present invention uses the distribution inclusion degree between two grayscale values ​​to quantify the possibility that these two grayscale values ​​belong to the same image feature; the grayscale value boundary degree is determined based on the distribution inclusion degree between all grayscale values ​​greater than the grayscale value and all grayscale values ​​less than the grayscale value within the local range of the grayscale value, and the boundary degree is used to reflect the possibility of the grayscale value as the boundary grayscale value of two image features. The frequency of the grayscale value is corrected based on the boundary degree, so that the boundary grayscale value can be enhanced during enhancement, thereby increasing the contrast between different image features, avoiding excessive enhancement of high-frequency grayscale areas and swallowing up low-frequency grayscale value areas, highlighting abnormal areas such as cracks and wrinkles, and specifically strengthening the weak defect characteristics of the bending area, thereby improving the accuracy of the bending forming quality evaluation of metal parts. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the following detailed description with reference to the accompanying drawings. 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:

[0037] Figure 1 is a flow chart schematically illustrating a method for evaluating the quality of metal part bending forming in the present invention;

[0038] Figure 2 is a schematic diagram schematically showing an image of a bending area;

[0039] Figure 3 is a flow chart schematically illustrating step S2 of a method for evaluating the quality of metal part bending forming in the present invention;

[0040] Figure 4 FIG. 1 is a schematic diagram schematically showing an enhanced image. DETAILED DESCRIPTION

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.

[0042] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0043] The embodiment of the present invention discloses a method for evaluating the quality of metal parts bending forming, referring to Figure 1 , including steps S1 to S3:

[0044] S1. Collect images of the bending area of ​​a metal part.

[0045] After the metal part is bent and formed, a uniform lighting system is used to illuminate the bending area of ​​the metal part, and a camera is used to capture an image of the bending area of ​​the metal part. For ease of processing, the captured image of the bending area is a grayscale image. Figure 2 This is a schematic diagram of the bending area of ​​a metal part.

[0046] S2. Enhance the image of the bending area.

[0047] Specifically, the flowchart of step S2 is as follows: Figure 3 , including steps S201 to S204, specifically:

[0048] S201. For any grayscale value in the bending area image, determine the distribution inclusion degree between the grayscale value and each grayscale value smaller than the grayscale value based on the distribution relationship between the pixel point corresponding to the grayscale value and the pixel points corresponding to each grayscale value smaller than the grayscale value.

[0049] It should be noted that under Gaussian noise interference, different pixels within the same structural feature (such as a flat area, a bent area, or a crack) in a bend region image will exhibit multiple grayscale value distributions. Although these pixels with different grayscale values ​​differ in numerical value, their spatial distribution patterns maintain the topological consistency of the feature region. Therefore, the present invention determines the degree of distribution inclusion between each grayscale value and grayscale values ​​less than that value based on the distribution relationship between the pixels corresponding to that grayscale value and the pixels corresponding to grayscale values ​​less than that value.

[0050] Specifically, all pixel points corresponding to each grayscale value in the bending area image are obtained, and the minimum bounding rectangle corresponding to all pixel points corresponding to each grayscale value is obtained as the minimum bounding rectangle of each grayscale value.

[0051] The degree of distribution inclusion satisfies the expression:

[0052] ;

[0053] in, Indicates the The gray value and The distribution inclusion degree between gray values, ; Indicates the The set of pixels contained in the minimum bounding rectangle of gray values; Indicates the The set of pixels contained in the minimum bounding rectangle of gray values; represents the intersection symbol, Represents the union symbol; represents a quantity function; express With collection The number of pixels contained in the intersection of The minimum bounding rectangle of the gray value The number of pixels contained in the overlapping part of the minimum bounding rectangle of the gray value; express With collection The number of pixels contained in the union of The convex hull area of ​​the gray value is The number of pixels contained in the minimum bounding rectangle of gray values ​​after merging; Indicates the The gray value and The degree of distribution overlap between gray values ​​is The larger the The minimum bounding rectangle of the gray value The more the minimum bounding rectangles of the gray values ​​overlap, the The smaller the time, the more The minimum bounding rectangle of the gray value The smaller the overlap of the minimum circumscribed rectangles of the gray values, the smaller the overlap of the minimum circumscribed rectangles of the gray values. Indicates the The gray value and The credibility of the distribution overlap between gray values ​​is measured. When the credibility is greater, the distribution inclusion degree is closer to the distribution overlap degree. When the credibility is smaller, the distribution inclusion degree is smaller based on the distribution overlap degree.

[0054] Furthermore, the credibility satisfies the expression:

[0055] ;

[0056] in, Indicates the The gray value and The credibility of the degree of distribution overlap between gray values; Indicates the The pixel corresponding to the gray value is The degree of distribution dispersion of the minimum bounding rectangle of the gray value; Indicates the The pixel corresponding to the gray value is The degree of distribution dispersion of the grayscale value in the minimum bounding rectangle. When the distribution dispersion is greater, it means that the pixel points corresponding to the grayscale value present a more dispersed spatial distribution feature within the minimum bounding rectangle. On the contrary, when the distribution dispersion is smaller, it means that the pixel points of the grayscale value present an obvious spatial clustering feature within the minimum bounding rectangle. Grayscale value and The more dispersed the gray values ​​are within their corresponding minimum bounding rectangles, the more Gray value and The degree of distribution overlap obtained by the intersection and union of the minimum bounding rectangles of the grayscale values On the contrary, when the The more concentrated the distribution of the grayscale values ​​is within its minimum bounding rectangle, or the The more concentrated the distribution of gray values ​​is within its minimum circumscribed rectangle, the greater the degree of distribution overlap. The less credible it is.

[0057] Furthermore, the method for obtaining the degree of distribution dispersion is:

[0058] The minimum bounding rectangle of the gray value is evenly divided into F grids, and the number of pixels corresponding to the gray value contained in each grid is counted. Where F is a preset first number, which is set by the implementer according to the actual implementation situation, for example , S represents the number of pixels corresponding to the grayscale value.

[0059] The degree of distribution dispersion satisfies the expression:

[0060] ;

[0061] in, Indicates the The pixel corresponding to the gray value is The degree of distribution dispersion of the minimum bounding rectangle of the gray value; Indicates the The number of grids divided by the minimum bounding rectangle of the gray value; Indicates the The gray value of The grid contains The number of pixels corresponding to the gray value; Indicates the The gray value of The grid contains The number of pixels corresponding to the gray value; Indicates the The number of pixels corresponding to the gray value; Represents an exponential function with a natural constant as the base, used for Perform negative correlation mapping.

[0062] Where, Indicates the The gray value of any two grids contains The average difference in the number of pixels corresponding to the gray value When the pixel points corresponding to the gray values ​​are concentrated in a grid, the average difference will be maximized, which is Therefore, the present invention multiplies the average difference by , to achieve the normalization of the average difference. The larger the average difference, the The gray values ​​are concentrated in a few grids, the smaller the distribution dispersion is. On the contrary, the smaller the average difference is, the smaller the gray value is. The more grids a grayscale value is distributed in, the greater the degree of distribution dispersion.

[0063] S202 : Determine the demarcation degree of the grayscale value according to the distribution inclusion degree between all grayscale values ​​greater than the grayscale value and all grayscale values ​​less than the grayscale value within the local range of the grayscale value.

[0064] Specifically, for any grayscale value in the bend region image, the N grayscale values ​​following that grayscale value serve as its backward reference grayscale value, and the N grayscale values ​​preceding that grayscale value serve as its forward reference grayscale value. These backward and forward reference grayscale values ​​are collectively referred to as reference grayscale values. When there are no N grayscale values ​​preceding that grayscale value, the forward reference grayscale value for that grayscale value is the actual count. When there are no N grayscale values ​​following that grayscale value, the backward reference grayscale value for that grayscale value is the actual count. N is a preset first number. In this embodiment, N=5. In other embodiments, the first number can be set by the implementer based on actual implementation circumstances. The local range of that grayscale value is then the range formed by its reference grayscale value and that grayscale value.

[0065] Furthermore, the degree of separation satisfies the expression:

[0066] ;

[0067] in, Indicates the The degree of separation of gray values; Indicates the The gray value of The backward reference gray value The boundary probability of gray values; Indicates the The number of backward reference gray values ​​for each gray value.

[0068] Among them, The gray value of The backward reference gray value The boundary probability of the gray value satisfies the expression:

[0069] ;

[0070] in, Indicates the The gray value of The backward reference gray value The boundary probability of gray values; Indicates the The gray value of The forward and backward inter-class difference of the backward reference gray value reflects the The gray value of The backward reference gray value is The distribution inclusion degree between all forward reference gray values ​​of the gray value, and the The gray value of The backward reference gray value is All the backward reference grayscale values ​​before the backward reference grayscale value (including Grayscale values) between the distribution of the degree of inclusion between the classes; represents the forward intra-class difference, represents the backward intra-class difference; Represents an S-shaped curve, and the expression is ; Represents an exponential function with a natural constant as its base. Function is used to convert the forward and backward inter-class differences Mapped to the range (0,1), when When it is a negative number, Smaller, and less than 0.5, when When is a positive number, Larger, and larger by 0.5, when When it is 0, The value of is 0.5. For forward intra-class differences and backward intra-class differences Perform negative correlation mapping, currently to intra-class differences or backward intra-class variance When the value is larger, the mapping result is smaller. or backward intra-class variance The smaller the difference, the larger the mapping result. The larger the difference between the current and backward classes, the smaller the difference within the forward class and the smaller the difference within the backward class, the larger the difference between the current and backward classes. The gray value of The backward reference gray value The greater the boundary probability of the gray value.

[0071] Forward and backward inter-class differences Satisfies the expression:

[0072] ;

[0073] Where, Indicates the The gray value and The distribution inclusion degree between gray values, The gray value is The gray value of Backward reference grayscale values, Indicates the The gray value of The backward reference gray value is All the backward reference grayscale values ​​before the backward reference grayscale value (including grayscale values) between the distribution of the degree of inclusion; Indicates the The gray value and The distribution inclusion degree between gray values, The gray value is The gray value of forward reference grayscale values, Indicates the The gray value of The backward reference gray value is The mean of the distribution inclusion degree among all forward reference gray values ​​of a gray value.

[0074] Forward intra-class variance Satisfies the expression:

[0075] ;

[0076] Where, Indicates the The gray value and The degree of distribution inclusion between gray values; Indicates the The gray value and The degree of distribution inclusion between gray values; Indicates the The number of backward reference gray values ​​of gray values. Then the forward intra-class difference For the The gray value of The backward reference gray value is The distribution of all forward reference gray values ​​contains the mean of the pairwise differences between them.

[0077] Backward intra-class differentiation Satisfies the expression:

[0078] ;

[0079] in, Indicates the The gray value and The degree of distribution inclusion between gray values; Indicates the The gray value and The degree of distribution inclusion between gray values; Indicates the The backward reference grayscale value number of the grayscale value. Then the backward intra-class difference For the The gray value of The backward reference gray value is All the backward reference grayscale values ​​before the backward reference grayscale value (including grayscale values) contains the mean of the difference between the two pairs.

[0080] It should be noted that the distribution of grayscale values ​​in the same image feature in the bending area is relatively inclusive, while the distribution of grayscale values ​​in different image features is relatively small. The gray value is the boundary gray value of two image features, then the The local range of gray value is less than The grayscale value of the grayscale value (i.e. The forward reference gray value of the gray value is an image feature, The local range of the gray value is not less than The grayscale value of the grayscale value (i.e. Grayscale value and The backward reference gray value of the gray value) is another image feature, then the The backward reference gray value of the gray value is The distribution of the forward gray values ​​of the gray values ​​is relatively small, The backward reference gray value of the gray value is Grayscale value and The distribution of all the backward gray values ​​before the backward reference gray value is relatively large. , forward intra-class differences and backward intra-class differences To determine the The gray value of The backward reference gray value The probability of gray value separation , the current backward inter-class difference The larger the Under the measurement of the backward reference gray value, the All reference gray values ​​in the local range of gray values ​​are more likely to belong to the two image features. and backward intra-class differences The smaller the time, the higher the Under the measurement of the backward reference gray value, the The gray value is more likely to be the boundary gray value of the two image features. All backward reference gray values ​​of gray values ​​under The greater the probability of dividing the gray value, the The greater the degree of separation of the gray values, the The grayscale value is more likely to be the boundary grayscale value of different image features in the bending area image. The boundary grayscale value means that the grayscale values ​​before the grayscale value are one image feature, and the grayscale value and the grayscale values ​​after the grayscale value are another image feature.

[0081] S203 , correcting the frequency of each grayscale value according to the demarcation degree of each grayscale value to obtain the corrected frequency of each grayscale value.

[0082] It should be noted that the grayscale values ​​of some image features in the bending area image may be close to the grayscale values ​​of other image features, making these image features easily overlooked. For example, subtle cracks in the bending area may not be obvious, resulting in missed detection of subtle cracks during bending quality inspection. The degree of separation of each grayscale value indicates the possibility of each grayscale value serving as the boundary grayscale value between two image features. Therefore, the present invention corrects the frequency of each grayscale value based on the degree of separation of each grayscale value. After the correction frequency is enhanced, the contrast between each image feature in the bending area image is obvious, thereby improving the accuracy of the detection of metal parts during bending.

[0083] Specifically, the correction frequency of each gray value satisfies the expression:

[0084] ;

[0085] in, Indicates the The correction frequency of the gray value, Indicates the The degree of separation of gray values; Indicates the The frequency of grayscale values; Indicates the number of grayscale values ​​in the bending area image; Indicates the The degree of separation of gray values; Indicates the The frequency of grayscale values; Used for Normalization is performed to ensure that the sum of the corrected frequencies of each grayscale value is 1.

[0086] When The greater the degree of separation of the gray values, the The gray value is more likely to be the boundary gray value between different image features, that is, The grayscale value and several grayscale values ​​after it may be an image feature. The grayscale value and several grayscale values ​​before it may be another image feature. So when enhancing the image of the bending area, it is necessary to increase the grayscale value of The frequency of gray values ​​makes the cumulative distribution histogram of the histogram equalization algorithm The cumulative frequency of gray values ​​increases, so that after histogram equalization, the The image features corresponding to the gray value The contrast between the image features corresponding to the grayscale values ​​increases. The greater the degree of separation of the gray values, the The greater the correction frequency of the gray value.

[0087] S204 , enhancing the bending region image according to the correction frequency of each grayscale value to obtain an enhanced image.

[0088] With the grayscale value as the horizontal axis and the correction frequency of each grayscale value as the vertical axis, a grayscale histogram is constructed, and histogram equalization is performed on the grayscale histogram to obtain an enhanced image of the bending area image. Figure 4 It is a schematic diagram of the enhanced image. Figure 4 There are some transverse textures in the material, which are crack defects. Figure 4 The crack defects in Figure 2 The ones in are more obvious and easier to detect.

[0089] S3. Evaluate the bending quality of metal parts based on the enhanced image.

[0090] It should be noted that during the bending process of metal parts, cracks may form in the bend area if the material has insufficient ductility or the bending radius is too small. Wrinkles may also form in the bend area if the material is thin or the bending angle is too large. Therefore, the present invention identifies cracks and wrinkles in the enhanced image.

[0091] Specifically, this embodiment uses a convolutional neural network to identify cracks and wrinkles. The structure of the convolutional neural network is as follows:

[0092] The input of the convolutional neural network is the enhanced image, and the output is the defect recognition result. The data set of the convolutional neural network is the enhanced image corresponding to the image of the bending area of ​​the metal parts containing defects and normal metal parts. The label of the convolutional neural network is the defect recognition result, including no defects, cracks, wrinkles, etc. The loss function of the convolutional neural network is the cross entropy loss.

[0093] The enhanced image is input into the trained convolutional neural network and the defect recognition result is output.

[0094] At this point, the quality evaluation of metal parts bending has been achieved.

Claims

1. A method for evaluating the quality of metal part bending, characterized in that: include: For any grayscale value in the bending area image of the metal part, the distribution inclusion degree between the grayscale value and the grayscale values ​​smaller than the grayscale value is determined based on the distribution relationship between the pixel point corresponding to the grayscale value and the pixel points corresponding to the grayscale values ​​smaller than the grayscale value; Determining the demarcation degree of the grayscale value according to the distribution inclusion degree between all grayscale values ​​greater than the grayscale value and all grayscale values ​​less than the grayscale value within a local range of the grayscale value, including: using several grayscale values ​​after the grayscale value as backward reference grayscale values ​​of the grayscale value, and using several grayscale values ​​before the grayscale value as forward reference grayscale values ​​of the grayscale value; determining the demarcation probability of the grayscale value under the backward reference grayscale value according to the distribution inclusion degree between the backward reference grayscale value of the grayscale value and all forward reference grayscale values ​​of the grayscale value, and the distribution inclusion degree between the backward reference grayscale value of the grayscale value and the grayscale value and all backward reference grayscale values ​​before the backward reference grayscale value; and using the average of the demarcation probabilities of the grayscale value under all backward reference grayscale values ​​of the grayscale value as the demarcation degree of the grayscale value; Correcting the frequency of each grayscale value according to the demarcation degree of each grayscale value to obtain the corrected frequency of each grayscale value; The image of the bending area is enhanced according to the correction frequency of each gray value to obtain an enhanced image; Evaluate the bending quality of metal parts based on enhanced images.

2. A method for evaluating the quality of metal part bending according to claim 1, characterized in that: Determining the distribution inclusion degree between the grayscale value and each grayscale value smaller than the grayscale value includes: Obtain the minimum bounding rectangle corresponding to all pixels corresponding to each grayscale value as the minimum bounding rectangle of each grayscale value; For any two grayscale values, the minimum circumscribed rectangle of the two grayscale values ​​is obtained to obtain the distribution overlap degree between the two pixel points; the product of the distribution overlap degree and the credibility of the distribution overlap degree is used as the distribution inclusion degree between the two pixel points.

3. A method for evaluating the quality of metal bending according to claim 2, characterized in that: The method for obtaining the distribution overlap degree is: The intersection and union of the minimum bounding rectangles of the two grayscale values ​​are obtained, and the ratio of the number of pixels contained in the intersection to the number of pixels contained in the union is used as the distribution overlap degree between the two pixels.

4. A method for evaluating the quality of metal bending according to claim 2, characterized in that: The method for obtaining the credibility is: Evenly divide the minimum circumscribed rectangle of the grayscale value into several grids, count the number of pixels corresponding to the grayscale value contained in each grid, obtain the average difference in the number of pixels corresponding to the grayscale value contained in any two grids, and perform negative correlation normalization on the average difference to obtain the distribution dispersion of the grayscale value; For any two pixels, the minimum value of the distribution dispersion of the two pixels is used as the credibility of the distribution overlap between the two pixels.

5. The method for evaluating the quality of metal bending according to claim 1, wherein: The method for obtaining the demarcation probability is: For any backward reference grayscale value of the grayscale value, obtain the mean of the distribution inclusion degree between the backward reference grayscale value and all the forward reference grayscale values ​​of the grayscale value as the first mean; obtain the mean of the distribution inclusion degree between the backward reference grayscale value and the grayscale value and all the backward reference grayscale values ​​before the backward reference grayscale value as the second mean; take the difference between the second mean and the first mean as the forward and backward inter-class difference; take the mean of the pairwise differences in the distribution inclusion degree between the backward reference grayscale value and all the forward reference grayscale values ​​of the grayscale value as the forward intra-class difference; take the mean of the pairwise differences in the distribution inclusion degree between the backward reference grayscale value and the grayscale value and all the backward reference grayscale values ​​before the backward reference grayscale value as the backward intra-class difference; According to the forward and backward inter-class differences, the forward intra-class differences, and the backward intra-class differences, the boundary probability of the grayscale value under the backward reference grayscale value is determined.

6. A method for evaluating the quality of metal part bending according to claim 5, characterized in that: The demarcation probability satisfies the expression: ; in, Indicates the The gray value of The backward reference gray value The boundary probability of gray values; Indicates the The gray value of The forward and backward inter-class differences of the backward reference grayscale values; represents the forward intra-class difference, represents the backward intra-class difference; represents an S-shaped curve; Represents an exponential function with a natural constant as its base.

7. A method for evaluating the quality of metal bending according to claim 1, characterized in that: The modified frequency satisfies the expression: ; in, Indicates the The correction frequency of the gray value, Indicates the The degree of separation of gray values; Indicates the The frequency of grayscale values; Indicates the number of grayscale values ​​in the bending area image; Indicates the The degree of separation of gray values; Indicates the The frequency of grayscale values.

8. The method for evaluating the quality of metal bending according to claim 1, wherein: The step of enhancing the bending area image according to the correction frequency of each grayscale value to obtain an enhanced image includes: A grayscale histogram is constructed with the grayscale value as the horizontal axis and the correction frequency of each grayscale value as the vertical axis. The grayscale histogram is subjected to histogram equalization to obtain an enhanced image of the bending area image.

9. A method for evaluating the quality of metal part bending according to claim 1, characterized in that: The metal part bending quality evaluation based on the enhanced image includes: The enhanced image is input into the trained neural network to output the bending defects of the metal parts.

Citation Information

Patent Citations

  • Mineral resource identification method based on image segmentation

    CN116228804A

  • Light guide plate quality monitoring method and system based on image processing

    CN118279301A