A method for detecting the quality of automobile workpiece edge covering based on weighted contour matching
By constructing a standard contour for the edge binding of automotive workpieces and using a bimodal weighted evaluation function, the problems of subjectivity and low efficiency in existing detection methods are solved, and high-precision, high-efficiency intelligent detection of the edge binding quality of automotive workpieces is achieved.
Patent Information
- Application Number
- CN202511165171.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-08-20
AI Technical Summary
Existing methods for inspecting the edge of automotive body-in-white are subject to strong subjectivity, low efficiency, and difficulty in achieving full-size quantitative evaluation. Furthermore, they are susceptible to noise interference when dealing with highly edge-sensitive areas, making it difficult to distinguish between reasonable tolerances and actual defects, leading to misjudgments or missed detections.
A weighted contour matching-based detection method is adopted. By constructing a standard contour of the edging of automotive workpieces, the difference between the contour to be detected and the standard contour is calculated using a bimodal weighted evaluation function. Combined with the mutation sensitivity factor, differential analysis is performed to achieve intelligent quantitative evaluation of the edging quality.
It achieves high-precision and high-efficiency intelligent detection of the edge binding quality of automotive parts, and can accurately distinguish between reasonable tolerances and real defects, reducing misjudgments and missed detections.
Smart Images

Figure CN120672751B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine vision and intelligent inspection technology, and in particular, it is a method for inspecting the edge quality of automotive workpieces based on weighted contour matching. Background Technology
[0002] In the automotive manufacturing industry, body-in-white hemming is a key process for forming the edges of body panels (such as doors, hoods, and trunk lids). Its quality directly affects the structural strength, appearance matching accuracy, and long-term corrosion resistance of the entire vehicle. The main challenges in inspecting body-in-white hemming lie in edge sensitivity, computational efficiency, and quantitative evaluation. Traditional hemming quality inspection methods mainly rely on manual visual inspection or contact measurement, which suffers from high subjectivity, low efficiency, and difficulty in achieving full-dimensional quantitative evaluation. Existing inspection methods are optical inspections, which use 3D laser profilometers to acquire three-dimensional contour data of the body-in-white hemming. However, these methods are susceptible to noise interference when dealing with highly edge-sensitive areas and lack the ability to differentiate between abrupt defects (such as hemming cracks) and gradual defects (such as surface distortion). Furthermore, due to unavoidable tolerance fluctuations in the production process, existing fixed threshold judgment models cannot accurately distinguish between reasonable tolerances and actual defects, easily leading to misjudgments or missed detections. Summary of the Invention
[0003] The present invention aims to solve the aforementioned technical problems existing in the prior art by providing a method for inspecting the edge quality of automotive workpieces based on weighted contour matching.
[0004] The technical solution of this invention is: a method for inspecting the edge binding quality of automotive workpieces based on weighted contour matching, which is carried out in the following steps:
[0005] Step 1. Construct the standard outline for the edge binding of the automotive workpiece.
[0006] Obtain an initial set of automotive workpiece contour samples, and perform the following steps sequentially for each contour sample:
[0007] Step 1.1 Contour data preprocessing;
[0008] Step 1.2 Contour data correction;
[0009] Step 1.3 Selection of contour point set data;
[0010] Step 1.4 Contour data visualization;
[0011] Step 1.5 Calculate the mean and variance to obtain the mean image and variance image;
[0012] Step 1.6 Contour extraction and reverse analysis to obtain the standard contour of the automotive workpiece edge;
[0013] Step 2. Inspect the edge binding quality of the automotive workpiece based on its standard contour.
[0014] Step 2.1 Obtain the edge contour data of the automotive workpiece to be inspected and perform preprocessing;
[0015] Step 2.2 Calculate the difference between the edge contour of the automobile workpiece to be inspected and the standard edge contour of the automobile workpiece based on the dual-modal weighted evaluation function;
[0016] Step 2.3 Determine whether the edge binding quality of the automotive workpiece is up to standard.
[0017] Step 1 is described in detail as follows:
[0018] Obtain the initial set of automotive workpiece contour samples , where k∈{1,2,…,n} is an integer index, for each contour Perform the following steps in sequence:
[0019] Step 1.1 Contour data preprocessing:
[0020] Step 1.1.1 Calculate the geometric centroid ,in: Represents outline The number of discrete points included. i Point set index variable , X-axis coordinates Y-axis coordinate;
[0021] Step 1.1.2 Extract the contour The vertex with the smallest X-axis coordinate ;
[0022] Step 1.1.3 Calculate vertices With geometric centroid European distance Store in distance set middle;
[0023] Step 1.1.4 Vertex With geometric centroid connection The angle with the horizontal axis is , outline The included discrete points are rotated to make =0, obtain the rotated contour data. ;
[0024] Step 1.1.5: Rotate the contour data. Perform feature quantization:
[0025] Step 1.1.5.1 Divide the X-axis into m vertical partitions at fixed intervals. j=1,...,m;
[0026] Step 1.1.5.2 For each partition Take partition All contour points The average value is used as the dividing line. The points inside are divided into 2 subsets , ;
[0027] Step 1.1.5.3 Calculate according to the following formula Feature indicators ,in , Denotes points in a subset. express Pointed value;
[0028] Step 1.1.5.4 Generate contour feature vector ;
[0029] Step 1.1.6 Remove abnormal contours:
[0030] Step 1.1.6.1 Construct the feature matrix of the contour feature vectors for all contours. Each row corresponds to a feature vector of a contour;
[0031] Step 1.1.6.2 Normalize all data in the feature matrix M within the range of 0-255 and convert it into an image. Take the derivative of the generated image along the Y-axis to obtain the gradient image.
[0032] Step 1.1.6.3 Perform gradient image grayscale thresholding to ensure that the number of retained contours and the total number of contours satisfy a normal distribution, thus obtaining the thresholded segmentation region;
[0033] Step 1.1.6.4 calculates all row coordinates within the threshold segmentation region, removes abnormal contours, and leaves a set C of remaining contours. ,Right now ;
[0034] Step 1.2 Contour data correction:
[0035] Step 1.2.1 Contour Rotation:
[0036] With each contour geometric centroid A local coordinate system is constructed for the reference point, and the target region is defined using the following parameters:
[0037]
[0038] The unit is mm;
[0039] The iterative weighted least squares (IRLS) method is used to fit a straight line to the point set of the target region, thus obtaining the equation of the line; the angle between the line and the X-axis is then obtained. Set the rotation center and outline. Perform a rigid body transformation around the center of rotation to make the included angle =0, thus obtaining the contour after angle transformation. ;
[0040] Step 1.2.2 Benchmark Acquisition:
[0041] Outline With k=1, the point where the minimum value is taken in both the X-axis and Y-axis directions is used as the reference point. and benchmark ;
[0042] Step 1.2.3 Batch translation:
[0043] Other contours , Translate to the reference point , To obtain the outline , ;
[0044] Step 1.3 Selection of contour point set data:
[0045] For each contour , ,by and Based on this, tolerance ranges are given in the X-axis and Y-axis directions. For any data point If the following conditions are met simultaneously:
[0046]
[0047] Then point The contour point set is obtained. ;
[0048] Step 1.4 Contour Data Visualization:
[0049] Step 1.4.1 Calculate the parameters for converting the contour to an image:
[0050] Calculate the width of the image converted from the outline. and height And the data that the contour needs to be translated , The details are as follows:
[0051] Will Split into a set of X-axis coordinate values With Y-axis coordinate value set Given a magnification factor K, first... and The geometric data is magnified by a factor of K, and then the extreme values of the magnified sets are calculated separately. The contour data is represented by the coordinate ranges on the X and Y axes respectively. , express:
[0052] ;
[0053] Step 1.4.2 Contour data visualization conversion:
[0054] contour point set , Split into a set of X-axis coordinate values With Y-axis coordinate value set Perform the operation according to the following formula to obtain the results respectively. and :
[0055]
[0056] Build size is The all-zero matrix is used as the basis image. and The data is converted into image coordinates, and... and The polygon contour boundary and its internal pixel values are set to 255 according to the coordinate set definition to obtain the contour image, resulting in an image set. , ;
[0057] Step 1.5 Calculate the mean and variance to obtain the mean image and variance image:
[0058] Input image set , record the image The pixel value ,
[0059] Calculate the mean and variance using the following formulas respectively;
[0060]
[0061] Obtain the mean image With variance image ;
[0062] Step 1.6 Contour extraction and reverse analysis yields the standard contour of the automotive workpiece's edge:
[0063] Step 1.6.1 Variance image Normalization is performed to map the image grayscale values to the range of 0-255. An adaptive threshold segmentation method is then used to extract the highlighted regions representing the standard contour of the workpiece in the variance image as the region of interest. ;
[0064] The threshold T in the adaptive threshold segmentation method is determined using the following formula:
[0065]
[0066] Where mean represents the average gray level of the target region. The gray-level variance of the target region is expressed by the following formula:
[0067] ;
[0068] in The total number of effective pixels in the image. Medium grayscale values belong to the range The set of pixels is ;
[0069] Step 1.6.2 Isotropic circular structural elements Perform the closing operation, where the structuring element radius The calculation formula is as follows:
[0070]
[0071] Step 1.6.3 Perform connected component analysis, retain the main contour region with the largest area, and obtain a closed loop. ;
[0072] Step 1.6.4 uses an iterative refinement algorithm to extract... The skeleton is obtained by peeling away the boundary pixels layer by layer until the centerline structure of a single pixel width is obtained. ;
[0073] Step 1.6.5 uses an interpolation method to extract the skeleton. Switch to sub-pixel precision and remove points with y-coordinate values less than 150 to obtain the contour. ;
[0074] Step 1.6.6 reverse analysis yields the standard contour of the automotive workpiece's edge binding:
[0075] Step 1.6.6.1 Extract the contour The coordinates of the points are split into a set of X coordinates. With Y coordinate set ;
[0076] Step 1.6.6.2: Following the formula below, perform reverse data parsing to restore the data to its original coordinate system before visualization, thus obtaining the standard contour of the automotive workpiece's edge. ;
[0077]
[0078] Step 2 is described in detail below:
[0079] Step 2.1 Contour to be detected Data preprocessing:
[0080] Input the outline of the automotive workpiece to be inspected. coordinate set and Perform data preprocessing according to the following steps:
[0081] Step 2.1.1 Rotate the contour to be detected:
[0082] Step 2.1.1.1 Calculate the geometric centroid ,in: Represents the contour to be detected The number of discrete points included. i Point set index variable , X-axis coordinates Y-axis coordinate;
[0083] Step 2.1.1.2 Using the geometric centroid A local coordinate system is constructed for the reference point, and the target region is defined using the following parameters:
[0084]
[0085] The ,unit mm ;
[0086] Based on the point set satisfying the target region, the IRLS method (irregular weighted least squares) is used to fit a straight line and obtain the angle between the line and the X-axis. Rotate the profile clockwise around the given rotation center Ad. Angle, to obtain the contour after angle transformation ;
[0087] Step 2.1.2 Outline Alignment:
[0088] Find the contour Find the minimum values of the X-axis and Y-axis, and then translate them relative to the reference point. , Alignment;
[0089] Step 2.1.3 Selection of detection area:
[0090] For each contour ,by and Based on this, tolerance ranges are given in the X-axis and Y-axis directions. For any data point, if the following conditions are met simultaneously:
[0091]
[0092] Then point The set of contour points to be detected is obtained. ;
[0093] Step 2.2 Calculate the difference between the edge contour of the automobile workpiece to be inspected and the standard edge contour of the automobile workpiece based on the bimodal weighted evaluation function:
[0094] Step 2.2.1 Construct discrete points on the contour to be detected To the standard contour of the workpiece minimum distance function ;
[0095] Step 2.2.2 Set the absolute distance threshold ,if Proceed to step 2.2.3; otherwise, minimize the distance. Place it into set F and proceed to step 2.2.4;
[0096] Step 2.2.3 Setting Value ;calculate Compared to the previous point Distance value ,calculate and Distance value According to the following formula It should be classified into set S or F;
[0097]
[0098] Step 2.2.4 Set the weight function :
[0099]
[0100] in, ;
[0101] The discrete point set corresponding to the contour to be detected With standard profile minimum distance and the introduction of weight functions The cumulative sum expression is as follows:
[0102] ;
[0103] in Indicates the number of discrete points of the contour to be detected;
[0104] Step 2.2.5 Calculate the normalized confidence score:
[0105] Step 2.2.5.1 Calculate the similarity ratio Rate according to the following formula:
[0106]
[0107] Where 0.5 is the morphological tolerance coefficient, Standard contour of the workpiece center of mass To standard profile The sum of the distances is given by the following formula:
[0108]
[0109] Step 2.2.5.2 Calculate the normalized confidence score:
[0110] ;
[0111] Step 2.3 Determine whether the edge binding quality of the automotive workpiece is up to standard:
[0112] like This indicates the difference between the profile to be inspected and the standard profile of the workpiece. Approaching the mark, the quality of the edging of the automotive workpiece is determined to be acceptable; if... This indicates that the profile to be inspected is similar to the standard profile of the workpiece. The difference is significant, and the edge-wrapping quality of the automotive workpiece is determined to be substandard.
[0113] This invention first acquires multi-sample data using a 3D laser profilometer. An adaptive contour modeling algorithm is then used to train and reverse-analyze the extracted and corrected contour data to construct a dynamic standard contour model with process tolerance compatibility. Second, a dual-modal weighted evaluation function is designed to calculate the optimal distance between each point of the measured contour and the standard contour. A mutation sensitivity factor is combined to perform differential analysis on the weighted deviation in the contour abrupt change region and the cumulative deviation in the gradual change region. Through nonlinear mapping, the distance is converted into a confidence score, achieving intelligent quantitative evaluation of edge binding quality. This invention can be applied to online inspection of the edge binding quality of automotive workpieces such as car doors and hoods, providing a high-precision, high-efficiency intelligent quality control solution for automobile manufacturing. Attached Figure Description
[0114] Figure 1 This is a flowchart of an embodiment of the present invention.
[0115] Figure 2 This is a schematic diagram of dividing vertical partitions according to an embodiment of the present invention.
[0116] Figure 3 This is an image from which abnormal contours have been removed according to an embodiment of the present invention.
[0117] Figure 4 This is a schematic diagram of the contour after rotation according to an embodiment of the present invention.
[0118] Figure 5 This is a schematic diagram of obtaining the reference point according to an embodiment of the present invention.
[0119] Figure 6 It is a contour image generated from contour data in an embodiment of the present invention.
[0120] Figure 7 This is the mean image of an embodiment of the present invention.
[0121] Figure 8 This is a variance image according to an embodiment of the present invention.
[0122] Figure 9 This is a schematic diagram of the skeleton of an embodiment of the present invention.
[0123] Figure 10 This is the contour image after skeleton processing in an embodiment of the present invention. Detailed Implementation
[0124] This invention provides a method for inspecting the edge quality of automotive workpieces based on weighted contour matching, such as... Figure 1 The steps shown are as follows:
[0125] Step 1. Construct the standard outline for the edge binding of the automotive workpiece.
[0126] Obtain an initial set of automotive workpiece contour samples, and perform the following steps sequentially for each contour sample:
[0127] Step 1.1 Contour data preprocessing;
[0128] Step 1.2 Contour data correction;
[0129] Step 1.3 Selection of contour point set data;
[0130] Step 1.4 Contour data visualization;
[0131] Step 1.5 Calculate the mean and variance to obtain the mean image and variance image;
[0132] Step 1.6 Contour extraction and reverse analysis to obtain the standard contour of the automotive workpiece edge;
[0133] Step 2. Inspect the edge-sealing quality of the automotive workpiece based on its standard contour;
[0134] Step 2.1 Obtain the edge contour data of the automotive workpiece to be inspected and perform preprocessing;
[0135] Step 2.2 Calculate the difference between the edge contour of the automobile workpiece to be inspected and the standard edge contour of the automobile workpiece based on the dual-modal weighted evaluation function;
[0136] Step 2.3 Determine whether the edge binding quality of the automotive workpiece is up to standard.
[0137] Step 1 is described in detail as follows:
[0138] Sample data was acquired using a 3D laser profilometer to obtain an initial set of automotive workpiece contour samples. , where k∈{1,2,…,n} is an integer index, for each contour Perform the following steps in sequence:
[0139] Step 1.1 Contour data preprocessing:
[0140] The sample contour data collected during the training process theoretically have high morphological consistency, but in actual collection, the local point cloud position may be shifted due to interference from surface reflection. Therefore, in the contour data preprocessing stage, abnormal data needs to be screened out from the original sample contour data.
[0141] Step 1.1.1 Calculate the geometric centroid ,in: Represents outline The number of discrete points included. i Point set index variable , X-axis coordinates Y-axis coordinate;
[0142] Step 1.1.2 Extract the contour The vertex with the smallest X-axis coordinate ;
[0143] Step 1.1.3 Calculate vertices With geometric centroid European distance Store in distance set middle;
[0144] Step 1.1.4 Vertex With geometric centroid connection The angle with the horizontal axis is , outline The included discrete points are rotated to make =0, obtain the rotated contour data. ;
[0145] Step 1.1.5: Rotate the contour data. Perform feature quantization:
[0146] Step 1.1.5.1 as follows Figure 2 The diagram shows m vertical sections divided along the X-axis at fixed intervals (e.g., 0.2 mm). j=1,...,m;
[0147] Step 1.1.5.2 For each partition Take partition All contour points The average value is used as the dividing line. The points inside are divided into 2 subsets , ;
[0148] Step 1.1.5.3 Calculate according to the following formula Feature indicators ,in , Denotes points in a subset. express Pointed value;
[0149] Step 1.1.5.4 Generate contour feature vector ;
[0150] Step 1.1.6 Remove abnormal contours:
[0151] Step 1.1.6.1 Construct the feature matrix of the contour feature vectors for all contours. Each row corresponds to a feature vector of a contour;
[0152] Step 1.1.6.2 Normalize all data in the feature matrix M within the range of 0-255 and convert it into an image. Take the derivative of the generated image along the Y-axis to obtain the gradient image.
[0153] Step 1.1.6.3 Perform gradient image grayscale thresholding to ensure that the number of retained contours and the total number of contours satisfy a normal distribution, thus obtaining the thresholded segmentation region;
[0154] The grayscale threshold setting in this embodiment of the invention adopts a cascaded detection architecture, with each threshold value set separately. Segmentation was performed, yielding three results; experimental verification was conducted using a grayscale threshold. The number of retained contours is normally distributed relative to the total number of contours.
[0155] Step 1.1.6.4 as follows Figure 3 The calculated threshold segmentation region contains all row coordinates. After removing abnormal contours, the remaining contour set C contains the following number of elements: ,Right now ;
[0156] Step 1.2 Contour data correction:
[0157] Step 1.2.1 Contour Rotation:
[0158] With each contour geometric centroid A local coordinate system is constructed for the reference point, and the target region is defined using the following parameters:
[0159]
[0160] The unit is mm;
[0161] The iterative weighted least squares (IRLS) method is used to fit a straight line to the point set of the target region, thus obtaining the equation of the line; the angle between the line and the X-axis is then obtained. Set the rotation center and outline. Perform a rigid body transformation around the center of rotation to make the included angle =0, resulting in the following: Figure 4 The contour after angle transformation shown ;
[0162] Step 1.2.2 Benchmark Acquisition:
[0163] like Figure 5 As shown, in outline With k=1, the point where the minimum value is taken in both the X-axis and Y-axis directions is used as the reference point. and benchmark ;
[0164] Step 1.2.3 Batch translation:
[0165] Other contours , Translate to the reference point , To obtain the outline , ;
[0166] Step 1.3 Selection of contour point set data:
[0167] For each contour , ,by and Based on this, tolerance ranges are given in the X-axis and Y-axis directions. For any data point If the following conditions are met simultaneously:
[0168]
[0169] Then point The contour point set is obtained. ;
[0170] Step 1.4 Contour Data Visualization:
[0171] Step 1.4.1 Calculate the parameters for converting the contour to an image:
[0172] Calculate the width of the image converted from the outline. and height And the data that the contour needs to be translated , The details are as follows:
[0173] Will Split into a set of X-axis coordinate values With Y-axis coordinate value set Given a magnification factor K, first... and The geometric data is magnified by a factor of K, and then the extreme values of the magnified sets are calculated separately. The contour data is represented by the coordinate ranges on the X and Y axes respectively. , express:
[0174] ,
[0175] ;
[0176] Step 1.4.2 Contour data visualization conversion:
[0177] contour point set , Split into a set of X-axis coordinate values With Y-axis coordinate value set Perform the operation according to the following formula to obtain the results respectively. and :
[0178]
[0179] The construction size is ( The all-zero matrix of ) is used as the basis image, and and The data is converted into image coordinates, and... and The pixel values of the polygon outline boundary and interior defined by the coordinate set are set to 255, resulting in the following: Figure 6 The outline image shown yields an image set. , ;
[0180] Step 1.5 Calculate the mean and variance to obtain the mean image and variance image:
[0181] Input image set , record the image The pixel value ,
[0182] Calculate the mean and variance using the following formulas respectively;
[0183]
[0184] Get as Figure 7 The mean image shown He Ru Figure 8 The variance image shown ;
[0185] Step 1.6 Contour extraction and reverse analysis yields the standard contour of the automotive workpiece's edge:
[0186] Step 1.6.1 In the variance image In the variance image, the pixel grayscale represents the probability density of the existence of the contour. Normalization is performed to map the image grayscale values to the range of 0-255. An adaptive threshold segmentation method is then used to extract the highlighted regions representing the standard contour of the workpiece in the variance image as the region of interest. ;
[0187] The threshold T in the adaptive threshold segmentation method is determined using the following formula:
[0188]
[0189] Where mean represents the average gray level of the target region. The gray-level variance of the target region is expressed by the following formula:
[0190]
[0191] ;
[0192] in The total number of effective pixels in the image. The medium grayscale value belongs to the range [{1, 255}]. The set of pixels is ;
[0193] Step 1.6.2 Isotropic circular structural elements Perform the closing operation, where the structuring element radius The calculation formula is as follows:
[0194]
[0195] Step 1.6.3 Perform connected component analysis, retain the main contour region with the largest area, and obtain a closed loop. ;
[0196] Step 1.6.4 uses an iterative refinement algorithm to extract... The skeleton is obtained by peeling away the boundary pixels layer by layer until a centerline structure of single-pixel width is obtained, resulting in... Figure 9 The skeleton shown ;
[0197] Step 1.6.5 uses an interpolation method to extract the skeleton. Switch to sub-pixel precision and remove points with y-coordinate values less than 150, resulting in: Figure 10 The illustrated outline ;
[0198] Step 1.6.6 reverse analysis yields the standard contour of the automotive workpiece's edge binding:
[0199] Step 1.6.6.1 Extract the contour The coordinates of the points are split into a set of X coordinates. With Y coordinate set ;
[0200] Step 1.6.6.2: Following the formula below, perform reverse data parsing to restore the data to its original coordinate system before visualization, thus obtaining the standard contour of the automotive workpiece's edge. ;
[0201]
[0202] Step 2 is described in detail below:
[0203] Step 2.1 Contour to be detected Data preprocessing:
[0204] Input the outline of the automotive workpiece to be inspected. coordinate set and Perform data preprocessing according to the following steps:
[0205] Step 2.1.1 Rotate the contour to be detected:
[0206] Step 2.1.1.1 Calculate the geometric centroid ,in: Represents the contour to be detected The number of discrete points included. i Point set index variable , X-axis coordinates Y-axis coordinate;
[0207] Step 2.1.1.2 Using the geometric centroid A local coordinate system is constructed for the reference point, and the target region is defined using the following parameters:
[0208]
[0209] The ,unit mm ;
[0210] Based on the point set satisfying the target region, the IRLS method (irregular weighted least squares) is used to fit a straight line and obtain the angle between the line and the X-axis. Rotate the profile clockwise around the given rotation center Ad. Angle, to obtain the contour after angle transformation ;
[0211] Step 2.1.2 Outline Alignment:
[0212] Find the contour Find the minimum values of the X-axis and Y-axis, and then translate them relative to the reference point. , Alignment, the aforementioned reference point , That is, the reference points set for constructing the standard profile;
[0213] Step 2.1.3 Selection of detection area:
[0214] For each contour ,by and Based on this, tolerance ranges are given in the X-axis and Y-axis directions. For any data point, if the following conditions are met simultaneously:
[0215]
[0216] Then point The set of contour points to be detected is obtained. ;
[0217] Step 2.2 Calculate the difference between the edge contour of the automobile workpiece to be inspected and the standard edge contour of the automobile workpiece based on the bimodal weighted evaluation function:
[0218] Step 2.2.1 Construct discrete points on the contour to be detected To the standard contour of the workpiece minimum distance function ;
[0219] Step 2.2.2 Set the absolute distance threshold ,if If this point is a potential mutation point, proceed to step 2.2.3; otherwise, use the minimum distance. Place it into set F and proceed to step 2.2.4;
[0220] Step 2.2.3 Setting Value ;calculate Compared to the previous point Distance value ,calculate and Distance value According to the following formula It should be classified into set S or F;
[0221]
[0222] Step 2.2.4 Determine the dynamic weight allocation strategy and set the weight function. :
[0223]
[0224] in, ;
[0225] The discrete point set corresponding to the contour to be detected With standard profile minimum distance and the introduction of weight functions The cumulative sum expression is as follows:
[0226] ;
[0227] in Indicates the number of discrete points of the contour to be detected;
[0228] Step 2.2.5 Calculate the normalized confidence score:
[0229] Step 2.2.5.1 Calculate the similarity ratio Rate according to the following formula:
[0230]
[0231] Where 0.5 is the morphological tolerance coefficient, Standard contour of the workpiece center of mass To standard profile The sum of the distances is given by the following formula:
[0232]
[0233] Step 2.2.5.2 Calculate the normalized confidence score:
[0234] ;
[0235] Using a double threshold truncation method can ensure the validity of the output. This process can avoid negative value interference while retaining the expressive power of 100% matching degree.
[0236] Step 2.3 Determine whether the edge binding quality of the automotive workpiece is up to standard:
[0237] like This indicates the difference between the profile to be inspected and the standard profile of the workpiece. Approaching the mark, the quality of the edging of the automotive workpiece is determined to be acceptable; if... This indicates that the profile to be inspected is similar to the standard profile of the workpiece. Significant differences indicate that the edging of the automotive workpiece has deformed or has defects such as warping, thus the workpiece is deemed unqualified in terms of edging quality.
Claims
1. A method for inspecting the edge binding quality of automotive workpieces based on weighted contour matching, characterized in that... Follow these steps in sequence: Step 1. Construct the standard outline for the edge binding of the automotive workpiece. Obtain an initial set of automotive workpiece edge contour samples, and perform the following steps for each contour sample in sequence: Step 1.1 Contour data preprocessing; Step 1.2 Contour data correction; Step 1.3 Selection of contour point set data; Step 1.4 Contour data visualization, the specific steps are as follows: Step 1.4.1 Calculate the parameters for converting the contour to an image: Calculate the width of the image converted from the outline. and height And the data that the contour needs to be translated , The details are as follows: contour point set Split into a set of X-axis coordinate values With Y-axis coordinate value set Given a magnification factor K, first... and The geometric data is magnified by a factor of K, and then the extreme values of the magnified sets are calculated separately. , , , ; The contour data is represented by the coordinate ranges on the X and Y axes respectively. , express: ; Step 1.4.2 Contour data visualization conversion: contour point set The set of x-axis coordinates is split into k=1,...,n'. With Y-axis coordinate value set Perform the operation according to the following formula to obtain the results respectively. and : ; Build size is The all-zero matrix is used as the basis image. and The data is converted into image coordinates, and... and The polygon contour boundary and its internal pixel values are set to 255 according to the coordinate set definition to obtain the contour image, resulting in an image set. , ; Step 1.5 Calculate the mean and variance to obtain the mean image and variance image; Step 1.6 Contour extraction and reverse analysis yields the standard contour of the automotive workpiece's edge. The specific steps are as follows: Step 1.6.1 Variance image Normalization is performed to map the image grayscale values to the range of 0-255. An adaptive threshold segmentation method is then used to extract the highlighted regions representing the standard contour of the workpiece in the variance image as the region of interest. ; The threshold T in the adaptive threshold segmentation method is determined using the following formula: ; Where mean represents the average gray level of the target region. The gray-level variance of the target region is expressed by the following formula: ; in The total number of effective pixels in the image The set of pixels with gray values in the range [1, 255] is: ; Step 1.6.2 Isotropic circular structural elements Perform the closing operation, where the structuring element radius The calculation formula is as follows: ; Step 1.6.3 Perform connected component analysis, retain the main contour region with the largest area, and obtain a closed loop. ; Step 1.6.4 uses an iterative refinement algorithm to extract... The skeleton is obtained by peeling away the boundary pixels layer by layer until the centerline structure of a single pixel width is obtained. ; Step 1.6.5 uses an interpolation method to extract the skeleton. Switch to sub-pixel precision and remove points with y-coordinate values less than 150 to obtain the contour. ; Step 1.6.6 reverse analysis yields the standard contour of the automotive workpiece's edge binding: Step 1.6.6.1 Extract the contour The coordinates of the points are split into a set of X coordinates. With Y coordinate set ; Step 1.6.6.2: Following the formula below, perform reverse data parsing to restore the data to its original coordinate system before visualization, thus obtaining the standard contour of the automotive workpiece's edge. ; ; ; Step 2. Inspect the edge binding quality of the automotive workpiece based on its standard contour. Step 2.1 Obtain the edge contour data of the automotive workpiece to be inspected and perform preprocessing; Step 2.2 Calculate the difference between the edge contour of the automobile workpiece to be inspected and the standard edge contour of the automobile workpiece based on the bimodal weighted evaluation function. The specific steps are as follows: Step 2.2.1 Construct discrete points on the contour to be detected To the standard contour of the workpiece minimum distance function ; Step 2.2.2 Set the absolute distance threshold ,if Proceed to step 2.2.3; otherwise, minimize the distance. Place it into set F and proceed to step 2.2.4; Step 2.2.3 Setting Values ;calculate Compared to the previous point Distance value ,calculate and Distance value According to the following formula It should be classified into set S or F; ; Step 2.2.4 Set the weight function : ; in, , ; The discrete point set corresponding to the contour to be detected With standard profile minimum distance and the introduction of weighting functions The cumulative sum expression is as follows: ; in Indicates the number of discrete points of the contour to be detected; Step 2.2.5 Calculate the normalized confidence score: Step 2.2.5.1 Calculate the similarity ratio Rate according to the following formula: ; Where 0.5 is the morphological tolerance coefficient, Standard contour of the workpiece center of mass To standard profile The sum of the distances is given by the following formula: ; Step 2.2.5.2 Calculate the normalized confidence score: ; Step 2.3 Determine whether the edge binding quality of the automotive workpiece is up to standard.
2. The method for inspecting the edge binding quality of automotive workpieces based on weighted contour matching according to claim 1, characterized in that... Step 1 is described in detail as follows: Obtain the initial set of automotive workpiece contour samples , where k∈{1,2,…,n} is an integer index, for each contour Perform the following steps in sequence: Step 1.1 Contour data preprocessing: Step 1.1.1 Calculate the geometric centroid ,in: Represents outline The number of discrete points included. Point set index variable , X-axis coordinates Y-axis coordinate; Step 1.1.2 Extract the contour The vertex with the smallest X-axis coordinate ; Step 1.1.3 Calculate vertices With geometric centroid European distance Store in distance set middle; Step 1.1.4 Vertex With geometric centroid connection The angle with the horizontal axis is , will wheel Kuo The included discrete points are rotated to make Obtain the rotated contour data ; Step 1.1.5: Rotate the contour data. Perform feature quantization: Step 1.1.5.1 Divide the X-axis into m vertical partitions at fixed intervals. j=1,...,m; Step 1.1.5.2 For each partition Take partition All contour points The average value is used as the dividing line. The points inside are divided into 2 subsets , ; Step 1.1.5.3 Calculate according to the following formula Feature indicators ,in , , Denotes points in a subset. express Pointed value; Step 1.1.5.4 Generate contour feature vector ; Step 1.1.6 Remove abnormal contours: Step 1.1.6.1 Construct the feature matrix of the contour feature vectors for all contours. Each row corresponds to a feature vector of a contour; Step 1.1.6.2 [The text appears to be incomplete and contains several grammatical errors. A more accurate All data are normalized within the range of 0-255 and converted into an image. The gradient image is obtained by taking the derivative of the generated image along the Y-axis. Step 1.1.6.3 Perform gradient image grayscale thresholding to ensure that the number of retained contours and the total number of contours satisfy a normal distribution, thus obtaining the thresholded segmentation region; Step 1.1.6.4 calculates the row coordinates of all elements within the threshold segmentation region, removes abnormal contours, and obtains the set of remaining contours. The number is n' ,Right now ; Step 1.2 Contour data correction: Step 1.2.1 Contour Rotation: With each contour geometric centroid A local coordinate system is constructed for the reference point, and the target region is defined using the following parameters: ; The unit is mm; The iterative weighted least squares (IRLS) method is used to fit a straight line to the point set of the target region, thus obtaining the equation of the line; the angle between the line and the X-axis is then obtained. Set the rotation center and outline. Perform a rigid body transformation around the center of rotation to make the included angle The contour after angle transformation is obtained. ; Step 1.2.2 Benchmark Acquisition: Outline With k=1, the point where the minimum value is taken in both the X-axis and Y-axis directions is used as the reference point. and benchmark ; Step 1.2.3 Batch translation: Other contours k=2,..., n' Translate to the reference point , To obtain the outline k=1,..., n' ; Step 1.3 Selection of contour point set data: For each contour k=1,..., n' ,by and Based on this, tolerance ranges are given in the X-axis and Y-axis directions. , For any data point If the following conditions are met simultaneously: ; Then point The contour point set is obtained. ; Step 1.4 Contour data visualization; Step 1.5 Calculate the mean and variance to obtain the mean image and variance image: Input image set , record the image The pixel value , Calculate the mean and variance using the following formulas respectively; ; ; Obtain the mean image With variance image ; Step 1.6 Contour extraction and reverse analysis yields the standard contour of the automotive workpiece edge.
3. The method for inspecting the edge quality of automotive workpieces based on weighted contour matching according to claim 2, characterized in that... Step 2 is described in detail below: Step 2.1 Contour to be detected Data preprocessing: Input the outline of the automotive workpiece to be inspected. coordinate set and Perform data preprocessing according to the following steps: Step 2.1.1 Rotate the contour to be detected: Step 2.1.1.1 Calculate the geometric centroid ,in: Represents the contour to be detected The number of discrete points included. Point set index variable , X-axis coordinates Y-axis coordinate; Step 2.1.1.2 Using the geometric centroid A local coordinate system is constructed for the reference point, and the target region is defined using the following parameters: ; The ,unit mm ; Based on the point set satisfying the target region, the IRLS method (irregular weighted least squares) is used to fit a straight line and obtain the angle between the line and the X-axis. Rotate the profile clockwise around the given rotation center Ad. Angle, to obtain the contour after angle transformation ; Step 2.1.2 Outline Alignment: Find the contour Find the minimum values of the X-axis and Y-axis, and then translate them relative to the reference point. , Alignment; Step 2.1.3 Selection of detection area: For each contour ,by and Based on this, tolerance ranges are given in the X-axis and Y-axis directions. , For any data point, if the following conditions are met simultaneously: ; Then point The set of contour points to be detected is obtained. ; Step 2.2 Calculate the difference between the edge contour of the automobile workpiece to be inspected and the standard edge contour of the automobile workpiece based on the dual-modal weighted evaluation function; Step 2.3 Determine whether the edge binding quality of the automotive workpiece is up to standard: like This indicates the difference between the profile to be inspected and the standard profile of the workpiece. Approaching the mark, the quality of the edging of the automotive workpiece is determined to be acceptable; if... This indicates that the profile to be inspected is similar to the standard profile of the workpiece. The difference is significant, and the edge-wrapping quality of the automotive workpiece is determined to be substandard.
Citation Information
Patent Citations
Free-form surface profile tolerance detection method based on machine vision
CN113847881A
Rapid intelligent detection method and system for automobile parts
CN116818778A