A defect detection method and system for automotive parts based on visual detection
The method enhances automotive component inspection by using a high-speed camera to adjust sampling frequencies and apply image enhancement techniques, improving defect detection accuracy on moving parts.
Patent Information
- Application Number
- CN202510192507.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-02-21
AI Technical Summary
In the prior art, it is difficult for automotive parts to capture high-quality images on fast production lines, resulting in low accuracy and efficiency of defect detection, and failure to adjust the sampling frequency in real time to adapt to changes in production speed.
Capture the moving image sequence of components through high-speed cameras, extract pixel moving data, perform time series analysis and smoothing processing, adjust the camera sampling frequency, perform image enhancement and cropping, and use convolutional neural network to identify potential defect areas.
It realizes the acquisition of high-quality images at different production speeds, improves the recognition accuracy and efficiency of defect detection, and ensures the stability and accuracy of image processing.
Smart Images

Figure CN119693352B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automotive parts detection, and particularly to a method and system for defect detection of automotive parts based on vision detection. Background Art
[0002] The technical field of automotive parts detection involves the use of various detection methods and tools to evaluate the quality and performance of automotive components. This technical field includes, but is not limited to, vision detection, acoustic detection, laser scanning, and the application of various sensor technologies. Vision detection technology uses high-resolution cameras and image processing software to identify minute defects on the surface of parts, such as cracks, scratches, or corrosion.
[0003] In the prior art, on fast production lines, it is often difficult to capture high-quality images due to the rapid movement of parts. In vision detection, the camera frequently produces blurred and distorted images, affecting the accuracy of defect detection. In addition, it is usually not flexible enough in response to changes in production speed and fails to adjust the sampling frequency in real time, resulting in unstable image acquisition when the speed changes. This instability affects the efficiency and accuracy of defect detection. Therefore, improvements are needed. Summary of the Invention
[0004] The object of the present invention is to solve the drawbacks existing in the prior art, and to propose a method and system for defect detection of automotive parts based on vision detection.
[0005] To achieve the above object, the present invention adopts the following technical solutions. A method for defect detection of automotive parts based on vision detection includes the following steps:
[0006] Capture a moving image sequence of parts on the production line through a high-speed camera, extract the number of pixels that the parts move per second, and generate preliminary speed data; perform time series analysis based on the preliminary speed data, and obtain an adjusted production line speed prediction result through trend judgment and smoothing processing;
[0007] Calculate the sampling frequency according to the adjusted production line speed prediction result, generate a preliminary sampling frequency adjustment instruction; apply the preliminary sampling frequency adjustment instruction to adjust the camera sampling frequency in real time, and obtain an optimized sampling frequency setting result;
[0008] Process the captured image sequence according to the optimized sampling frequency setting result, perform noise elimination, and generate preliminary image enhancement data; perform cropping and contrast adjustment on the preliminary image enhancement data to obtain an optimized image processing result;
[0009] Analyze the quality of the captured images based on the optimized image processing result, and obtain a quality analysis result;
[0010] Input the defective image data into the convolutional neural network model for training, and identify and mark potential defective areas in the optimized image processing results through the convolutional neural network model to obtain the defect detection result.
[0011] Preferably, the step of obtaining the preliminary speed data is as follows:
[0012] Install a high-speed camera on the production line to capture the moving image sequence of the parts in real time and form a complete part image sequence;
[0013] Based on the part image sequence, analyze the pixel displacement between two consecutive frames, extract the pixel movement amount of the part within a fixed time, and combine with the number of frames per second to calculate the pixel movement data per second;
[0014] According to the pixel movement data per second, calculate the preliminary speed of the part to obtain the preliminary speed data.
[0015] Preferably, the step of obtaining the adjusted production line speed prediction result is as follows:
[0016] Based on the preliminary speed data, perform time series analysis to analyze the time dependence and periodic changes in the data to obtain the time series analysis result;
[0017] Judge the trend of the data from the time series analysis result and perform smoothing processing. The formula is:
[0018] ;
[0019] Where, is the adjusted smoothed speed value, is the smoothing coefficient, is the speed value at the current time point, is the current time, is the adjustment intensity, is the reference time point, is the base of the natural logarithm, is the smoothed speed value at the previous time point;
[0020] Based on the smoothed speed value, summarize to obtain the adjusted production line speed prediction result.
[0021] Preferably, the step of obtaining the preliminary sampling frequency adjustment instruction is as follows:
[0022] According to the adjusted production line speed prediction result, determine the speed state of the current production line to obtain the current speed state;
[0023] Based on the current speed state, calculate the sampling frequency. The calculation formula is:
[0024] ;
[0025] in, is the new sampling frequency, is the basic sampling frequency, is the current speed, is the base speed;
[0026] Based on the calculated new sampling frequency, a sampling frequency adjustment instruction is generated to obtain a preliminary sampling frequency adjustment instruction.
[0027] Preferably, the steps for obtaining the optimized sampling frequency setting result are:
[0028] Receiving the preliminary sampling frequency adjustment instruction, determining the sampling frequency adjustment parameters to be implemented, and obtaining the adjustment parameters;
[0029] Based on the adjustment parameters, updating the camera, adjusting the sampling frequency of the camera, and obtaining an updated sampling frequency;
[0030] Based on the updated sampling frequency, the effect is tested and verified to obtain an optimized sampling frequency setting result.
[0031] Preferably, the steps of acquiring the preliminary image enhancement data are:
[0032] Receiving the optimized sampling frequency setting result, capturing an image sequence through a camera, and obtaining an image sequence processed according to the new sampling frequency;
[0033] Based on the image sequence processed by the new sampling frequency, analyzing the noise type in the image, applying median filtering and Gaussian filtering in a targeted manner, removing random variations of non-image content, and obtaining an image sequence with reduced noise;
[0034] Based on the noise-reduced image sequence, the clarity and sharpness of the image are adjusted to obtain preliminary image enhancement data.
[0035] Preferably, the steps for obtaining the optimized image processing result are:
[0036] Receiving the preliminary image enhancement data, performing image cropping, and cropping according to a focus area and a ratio to obtain cropped image data;
[0037] Based on the cropped image data, the adjusted contrast value is calculated using the following formula:
[0038] ;
[0039] in, is the adjusted contrast value, is the contrast value of the original image, is the contrast adjustment coefficient;
[0040] Based on the adjusted contrast value, perform contrast adjustment to obtain an optimized image processing result.
[0041] Preferably, the step of obtaining the quality analysis result is:
[0042] Obtain the optimized image processing result, check the clarity, color accuracy and performance of the image to obtain preliminary image quality evaluation data;
[0043] Based on the preliminary image quality evaluation data, analyze the edge sharpness and noise level, as well as the contrast and brightness checks, to obtain a detailed image quality analysis result;
[0044] Based on the detailed image quality analysis result, judge the overall quality of the image.
[0045] The present invention provides a defect detection system, including:
[0046] An image capture module, based on a high-speed camera, captures a sequence of moving images of components on a production line and generates moving image sequence data;
[0047] A speed analysis module, based on the moving image sequence data, extracts the number of pixels that the component moves per second, performs time series analysis, and generates a production line speed prediction result;
[0048] A sampling adjustment module, based on the production line speed prediction result, calculates the sampling frequency, generates a sampling frequency adjustment instruction, and adjusts the camera sampling frequency in real time to obtain an optimized sampling frequency setting result;
[0049] An image processing module, based on the optimized sampling frequency setting result, processes the captured image sequence, performs noise elimination, generates preliminary image enhancement data, and performs cropping and contrast adjustment on the preliminary image enhancement data to obtain an optimized image processing result;
[0050] A defect recognition module, used to identify and mark potential defect areas in the optimized image processing result through a model to obtain a defect detection result.
[0051] Compared with the prior art, the advantages and positive effects of the present invention are:
[0052] The method of the present invention captures the moving image sequence of components on the production line through a high-speed camera and extracts the pixel movement data per second, improving the image quality monitoring of moving components. And according to the prediction result, the camera sampling frequency is adjusted to ensure high-quality images can be obtained at different production speeds. This adjustment improves the quality of subsequent image processing. Especially after denoising and contrast adjustment, the identification of defects becomes clearer. And the data enhanced by image enhancement is input into the convolutional neural network for training and defect identification, improving the identification accuracy and efficiency, and achieving accurate detection of component defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a schematic diagram of the steps of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0054] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0055] Please refer to Figure 1 , the present invention provides a technical solution, a method for detecting defects of automotive components based on vision detection, including the following steps:
[0056] Capture the moving image sequence of components on the production line through a high-speed camera, extract the number of pixels moved by the components per second, and generate preliminary speed data; perform time series analysis on the preliminary speed data, and obtain the predicted result of the adjusted production line speed through trend judgment and smoothing processing.
[0057] According to the predicted result of the adjusted production line speed, calculate the sampling frequency, generate a preliminary sampling frequency adjustment instruction; apply the preliminary sampling frequency adjustment instruction to adjust the camera sampling frequency in real time to obtain the optimized sampling frequency setting result.
[0058] According to the optimized sampling frequency setting result, process the captured image sequence, perform noise elimination, and generate preliminary image enhancement data; perform cropping and contrast adjustment on the preliminary image enhancement data to obtain the optimized image processing result.
[0059] Based on the optimized image processing result, analyze the quality of the captured image to obtain the quality analysis result;
[0060] Input the defect image data into the convolutional neural network model for training, and identify and mark potential defect areas in the optimized image processing result through the convolutional neural network model to obtain the defect detection result.
[0061] Specifically, organize the original image dataset containing various typical defect types, and label the positions and types of defect areas in the data according to existing quality inspection standards or experience (such as scratches, cracks, pits, etc.). Record the annotation information as corresponding label data to form image-label pairs. Subsequently, perform diversity processing on the images and corresponding labels, divide the dataset into a training set, a validation set, and a test set (for example, in a ratio of 7:2:1), and ensure that the number and distribution of defect samples of each type are relatively balanced in different datasets.
[0062] Normalize the images in the training set, scale each pixel value to an appropriate range (such as between 0 and 1) according to a fixed formula, so that the network has stable gradient changes during training. At the same time, use data augmentation techniques to randomly rotate, flip, translate, scale the training images, or add a small amount of simulated noise to increase the robustness and generalization ability of the model, and avoid reducing the detection ability for new data due to overfitting the features of the training set.
[0063] According to the complexity of the target task and defect characteristics, select a suitable convolutional neural network structure, such as ResNet, VGG, or a custom multi-layer convolutional-pooling combination structure, and connect several fully connected layers or global average pooling layers at the top to output prediction results. Initialize the weight parameters of the network, generally using the Glorot initialization or He initialization method, to lay the foundation for the stable convergence of the subsequent training process.
[0064] According to the task type (such as pixel-level annotation or region-level detection of defect detection), select a suitable loss function. For example, if it is necessary to perform binary classification on whether each pixel is a defect, the cross-entropy loss function can be used; if a target detection framework is adopted, a combined loss that jointly uses the bounding box regression error and the classification error may be required. Select an appropriate optimization algorithm (such as SGD or Adam), and set the initial learning rate and momentum factor. A learning rate scheduler can be used to dynamically adjust the learning rate during the training process.
[0065] Input the image data of the training set into the network in batches (batch). Calculate the error between the predicted output and the true label through forward propagation, use the backpropagation algorithm to calculate the gradient of the loss with respect to each parameter of the network, and update the network weights accordingly. Continuously repeat this process, and each complete process of processing the training set is called an epoch. Monitor indicators such as loss and accuracy on the validation set during the training process to judge the generalization performance and convergence of the model. If the validation set indicators do not improve for a long time, consider adjusting hyperparameters (such as learning rate, batch size) or structural design.
[0066] After multiple training epochs, select the model with the best performance on the validation set metrics as the final model. Use this model for test set evaluation, and measure the defect detection ability of the model on new data through metrics such as accuracy, recall, F1-score, or Mean Average Precision (mAP). If the test results meet the standards, this model can be put into the actual production detection process.
[0067] Use the trained convolutional neural network model to perform forward inference on the optimized image processing results, and perform threshold judgment or non-maximum suppression operations based on the defect probability values and defect area information output by the model. Finally, mark the potential defect areas on the image. The output defect detection results include information such as specific defect types, position coordinates, and confidence scores.
[0068] The steps for obtaining the preliminary speed data are as follows:
[0069] Install a high-speed camera on the production line to capture the moving image sequence of the parts in real time and form a complete image sequence of the parts;
[0070] Based on the image sequence of the parts, analyze the pixel displacement between two consecutive frames, extract the pixel movement amount of the parts within a fixed time, and combine the number of frames per second to calculate the pixel movement data per second;
[0071] According to the pixel movement data per second, calculate the preliminary speed of the parts to obtain the preliminary speed data.
[0072] Specifically, adjust the focal length and position of the high-speed camera to ensure that it covers the entire movement of the parts on the production line; set the high frame rate for the camera to capture multiple frames per second to capture the continuous movement of the parts and ensure the continuity of the images; analyze the captured image sequence, record the precise position of the parts in each frame by comparing the position changes of the parts frame by frame, so as to form a detailed and continuous image data sequence, and the data sequence can clearly show the movement trajectory and speed changes of the parts on the production line.
[0073] From the formed image sequence of the parts, identify and measure the pixel displacement of the parts between two consecutive frames, calculate these displacements to determine the movement speed of the parts; accumulate the total pixel amount of the parts moving within each second to calculate this data to reflect the movement speed of the parts; this method allows monitoring the speed changes of the parts during the production process and adjusting the capture frequency of the camera through the movement data of the parts to ensure the accuracy and real-time nature of the data.
[0074] Using the collected pixel movement data per second, calculate the speed; calculate the movement speed of components by dividing the distance by the time, convert the pixel distance into speed units, and provide accurate production line movement data; comprehensively analyze these speed data to monitor the overall operation efficiency of the production line. By analyzing the change trend of the data, adjust the production parameters in a timely manner to ensure the stable operation of the production line and the quality control of components, and finally output the preliminary speed data.
[0075] The steps to obtain the predicted result of the adjusted production line speed are as follows:
[0076] Based on the preliminary speed data, perform time series analysis, analyze the time dependence and periodic changes in the data, and obtain the time series analysis result;
[0077] Judge the trend of the data from the time series analysis result and perform smoothing processing. The formula is:
[0078] ;
[0079] where, is the adjusted smoothed speed value, is the smoothing coefficient, is the speed value at the current time point, is the current time, is the adjustment intensity, is the reference time point, is the base of the natural logarithm, is the smoothed speed value at the previous time point;
[0080] Based on the smoothed speed value, summarize to obtain the predicted result of the adjusted production line speed.
[0081] Specifically, based on the preliminary speed data, the speed values corresponding to each time point are arranged in chronological order to form time series data. This series is segmented according to a fixed length. In each time period, basic statistical indicators such as the speed mean and speed variance are extracted. A reference cycle length is selected from the known nominal production cycle data of the equipment, and this reference cycle length is used to calculate the Pearson correlation coefficient pair by pair for the segmented speed statistical values. This correlation coefficient is compared with the standard threshold of 0.8 obtained through statistical analysis of a large amount of historical production data. When the correlation coefficient between any two adjacent time periods is higher than 0.8, it is confirmed that there is an obvious periodic change. This periodic information is marked and recorded in contrast to all segmentation results. The recorded periodic markings are paired with the corresponding speed mean and variance values, and by calculating the difference sequence between data points within the cycle and statistically analyzing the difference distribution characteristics, a result set containing cycle markings and corresponding difference characteristics is obtained. Finally, this result set is summarized to obtain a set of data parameters reflecting the characteristics of the time series, and then these data parameters are sorted and inductively processed to form a complete time series analysis result.
[0082] The advantage of the formula is that by introducing a logical function term in the calculation process and the smoothing coefficient , it enables the dynamic adjustment of the weights of the currently measured speed value and the smoothed speed value at the previous moment when synthesizing them, thereby reducing the influence of noise while retaining the key information of speed changes.
[0083] The acquisition steps of are as follows: An error function is constructed based on the deviation between the actual speed and the preliminary smoothed speed at each moment in the time series analysis result obtained previously. The least squares method is used to perform parameter fitting on the error function and solve for the value that minimizes the error, and finally
[0084] is determined; The acquisition steps of
[0085] and are as follows: When recording data, the starting recording moment is used as the reference time point , and then the current moment is obtained according to the timer reading;
[0086] The obtaining steps are as follows: By performing a logistic curve fitting on the previously obtained time series analysis results, performing a non-linear regression on the historical data and the logistic function, and selecting the parameter value that minimizes the fitting mean square error. ;
[0087] The obtaining steps are as follows: At t = 4 seconds, the calculation has been performed through the same formula to obtain the smoothed speed value at the previous moment. .
[0088] Calculation process:
[0089] Calculate the denominator term of the logistic function:
[0090] ;
[0091] Calculate term:
[0092] ;
[0093] Calculate term:
[0094] ;
[0095] Step 4: Substitute the above results into the formula:
[0096] ;
[0097] The result shows that at t = 5 seconds, the adjusted speed obtained by smoothing and logistic function weighting is 1.03216 m / s. When this value is close to 1 m / s and the fluctuation is small, it indicates that the production line speed is relatively stable. When this value is significantly higher, it means that the production line has significantly accelerated. When this value is significantly lower, it means that the production line has significantly decelerated. From this numerical result, it can be further used to predict and correct the overall production line speed in the subsequent steps to finally summarize the predicted result of the adjusted production line speed.
[0098] Based on the smoothed speed value, the smoothed speed values calculated at each moment are arranged in chronological order, and the average value and variance value of each time period are extracted after segmentation. Then, these statistical indicators are matched with the operating time interval information recorded in the previous period. The speed increment is calculated segment by segment based on the difference calculation between data points. Several intermediate points are inserted between adjacent time periods by weighted linear interpolation with the increment sequence as a reference. The sequence obtained by these intermediate points extends the possible speed change data in the future period, and then a point-to-point comparison is made between the extended speed sequence and the actual speed value of the equipment in the current time period. When the speed value at any time point differs from the actual value by more than twice the standard deviation obtained by statistics of a large amount of historical data, it is regarded as an anomaly. The abnormal point is removed from the sequence and the sequence after removal is smoothed again. Finally, the smoothed speed sequence after abnormal removal and interpolation trimming is summarized and sorted to obtain the adjusted production line speed prediction result.
[0099] The steps to obtain the preliminary sampling frequency adjustment instruction are:
[0100] According to the adjusted production line speed prediction result, the speed state of the current production line is determined to obtain the current speed state;
[0101] Based on the current speed state, the sampling frequency is calculated using the following formula:
[0102] ;
[0103] in, is the new sampling frequency, is the basic sampling frequency, is the current speed, is the base speed;
[0104] Based on the calculated new sampling frequency, a sampling frequency adjustment instruction is generated to obtain a preliminary sampling frequency adjustment instruction.
[0105] Specifically, based on the adjusted production line speed prediction results obtained previously, first extract the speed value corresponding to the current moment from them. Compare the extracted speed value with a set of benchmark speed ranges that are statistically monitored and solidified in the internal parameter library for the same type of production line under standard operating conditions. The upper and lower limits of each range are statistically obtained from the stable operation sample data of this production line under different loads and different time periods, and the distribution density of the interval is quantified by calculating the single-point interpolation method for the differences between adjacent intervals. When the current speed value falls within a certain interval, select the speed range of this interval as the current reference. Calculate a fine-tuning coefficient based on the speed dispersion of each sub-interval within the reference interval. This fine-tuning coefficient is obtained by calculating the mean value and standard deviation analysis of the recorded historical speed acquisition points. Multiply this fine-tuning coefficient by the current speed value to obtain the final speed marking value, and then map this speed marking value to the corresponding speed category label. The category number and name corresponding to this label are pre-stored in the internal parameter library. According to the matching rule comparison between the marking value and the category number, finally obtain the speed status category data matching the current speed to get the current speed status.
[0106] The benefit of the formula is that by considering the current speed in the calculation process of the new sampling frequency and the relationship with the benchmark speed to achieve dynamic adjustment of the sampling frequency, so that the sampling frequency can change with the current speed. In this way, increasing the sampling frequency at a higher speed can obtain more refined speed data capture, and reducing the sampling frequency at a lower speed can save resources.
[0107] The acquisition step of the parameter is: obtained by collecting the standard sampling frequency data recorded in the basic parameter manual provided by the equipment manufacturer. The basic sampling frequency setting value of this equipment under the design standard is ;
[0108] The acquisition step of the parameter is: select the average value under stable operating conditions from the adjusted production line speed prediction results obtained previously as the benchmark speed, and determine the average value of the speed values in the stable area after long-term statistics as ;
[0109] The acquisition step of the parameter is: the speed value corresponding to the current moment from the adjusted production line speed prediction results obtained previously, which is recorded by a high-speed camera and a sensor at the current moment and obtained after the smoothing and adjustment process of the previous step ;
[0110] Calculation process:
[0111] Substitute the parameters into the formula:
[0112] ;
[0113] First, calculate the value inside the fraction:
[0114] ;
[0115] Perform the 0.5 - power operation on 1.21:
[0116] ;
[0117] Substitute the result back into the formula:
[0118] ;
[0119] This result indicates that the new sampling frequency is 110Hz. When greater than 100Hz means the current speed is higher than the reference speed, and the sampling frequency should be increased accordingly; when less than 100Hz means the current speed is lower than the reference speed, and the sampling frequency will be decreased. This numerical result has a direct association with the sampling frequency adjustment of the camera or sensor in the current step. When the result exceeds 110Hz, it means the current speed is significantly high, and when it is lower than 90Hz, it means the current speed is significantly low. Through further analysis of the result, subsequent steps can make corresponding adjustments to the sampling strategy.
[0120] Based on the calculated new sampling frequency, retrieve the parameter group corresponding to this frequency from the internal parameter library. These parameter groups include the basic pulse period data for generating control instructions and the corresponding timing allocation data. Substitute the new sampling frequency value into the pulse period calculation formula, make one - by - one correspondence between the pulse period data and the timing allocation data, use the frequency - control instruction mapping table stored internally to compare the current pulse period and the timing allocation result, and find the matching item closest to the instruction required for the current frequency. When there are multiple matching items, compare the differences between them, select the one with the smallest difference as the final control instruction item. When there are data points with too large differences, analyze the historical frequency - instruction matching situation, perform elimination operations on these data points, and then search for matching items again. When the matching item is finally locked, mark this instruction item as the preliminary sampling frequency adjustment instruction.
[0121] The steps to obtain the optimized sampling frequency setting result are as follows:
[0122] Receive the preliminary sampling frequency adjustment instruction, determine the sampling frequency adjustment parameters to be implemented, and obtain the adjustment parameters;
[0123] Based on the adjustment parameters, update the camera and adjust the sampling frequency of the camera to obtain the updated sampling frequency;
[0124] Based on the updated sampling frequency, the effect is tested and verified to obtain the optimized sampling frequency setting result.
[0125] Specifically, decode the received preliminary sampling frequency adjustment instruction, confirm the correctness and safety of the parameters and operation instructions, and then adjust the internal configuration, send instructions, adjust the clock frequency of the electronic controller and the working mode of the processor, ensure that the equipment performs the sampling frequency adjustment, and form the adjustment parameters. The adjustment parameters include the specific value of the sampling frequency, the time range of application, and the exception processing rules under specific operating conditions.
[0126] Input adjustment parameters, modify camera settings, monitor the validity and logical consistency of parameter input, and confirm that all input data meets technical specifications and operational requirements. At the same time, conduct feedback detection to confirm that the adjustment has achieved the expected effect, including analyzing the video stream output by the camera in real time, checking image quality changes, recording all operations and system responses for post-audit and performance evaluation, and obtaining the updated sampling frequency.
[0127] Conduct field tests to verify the effectiveness and reliability of the new settings. The test includes running the camera continuously and recording the output to evaluate the quality of the captured images, especially under changing lighting and dynamic conditions. Compare the data before and after the test to evaluate the impact of the sampling frequency adjustment to ensure that the new settings meet the requirements of the production line and improve image processing efficiency and accuracy, and obtain the optimized sampling frequency setting results.
[0128] The steps to obtain preliminary image enhancement data are:
[0129] Receiving the optimized sampling frequency setting result, capturing an image sequence through a camera, and obtaining an image sequence processed according to the new sampling frequency;
[0130] Based on the image sequence processed with the new sampling frequency, the noise type in the image is analyzed, and the median filter and Gaussian filter are applied in a targeted manner to remove the random variation of non-image content, thereby obtaining an image sequence with reduced noise;
[0131] Based on the noise-reduced image sequence, the clarity and sharpness of the image are adjusted to obtain preliminary image enhancement data.
[0132] Specifically, after obtaining the image sequence processed with the new sampling frequency, the next step is to analyze the type of noise in the image and apply appropriate filtering techniques for noise elimination. The image sequence first undergoes a preliminary visual inspection to identify common problems such as Gaussian noise or salt-and-pepper noise present in the image. Then, a median filter is selected to handle salt-and-pepper noise, which reduces random noise by replacing the pixel value with the median of the surrounding pixel values. For Gaussian noise, a Gaussian filtering technique is used, which smooths the image by applying weighted averaging to the entire image, reducing the visual impact of noise points, and finally obtaining an image sequence with reduced noise.
[0133] After noise elimination processing, the next step in processing the image sequence is image enhancement, including clarity adjustment and sharpening. Clarity adjustment enhances the clarity of image boundaries and lines by adjusting the edge definition of the image. Sharpening improves the visual clarity of the image by increasing the high-frequency details in the image, especially forming a more obvious transition at the edges. Through these steps, the overall visual effect of the image is enhanced, obtaining preliminary image enhancement data.
[0134] The steps to obtain the optimized image processing result are as follows:
[0135] Receive the preliminary image enhancement data, perform image cropping, and crop according to the focus area and ratio to obtain the cropped image data;
[0136] Based on the cropped image data, calculate the adjusted contrast value. The calculation formula is:
[0137] ;
[0138] where, is the adjusted contrast value, is the contrast value of the original image, is the contrast adjustment coefficient;
[0139] Based on the adjusted contrast value, perform contrast adjustment to obtain the optimized image processing result.
[0140] Specifically, according to the preliminary image enhancement data obtained above, the coordinate information corresponding to the horizontal and vertical dimension parameters of the image pixel matrix and the focus area is extracted therefrom, and the coordinate information is matched with a set of scale factors that have been pre-sorted and recorded in the internal parameter library, and the obtained scale factors are compared with the current coordinate range, and the scale factors are used as the basis for the cropping scale, and the upper, lower, left and right boundary positions of the cropping area are calculated according to the scale, and the corresponding pixel row and column index range to be retained is located, and then the gray value and position coordinates of each pixel point are read in turn within the range, and these coordinates and gray value data are recorded, and then it is checked whether these coordinate points are consistent with the originally selected focus area. If they are consistent, it is confirmed that the area does not need to adjust the boundary. If there is a deviation, the cropping boundary position is relocated and the coordinate range is calculated again. The process is repeated until all focus pixel data matches the expected ratio, and finally the pixel data within the selected range is aggregated to form new image array data to obtain the cropped image data.
[0141] The formula is useful because it introduces Term and contrast adjustment factor The synergistic effect of the two makes it possible to achieve nonlinear contrast adjustment, thereby making more flexible and fine adjustments to the image contrast within a subtle range.
[0142] The steps to obtain the parameters are as follows: by statistically analyzing and standardizing the distribution of pixel grayscale values in the original image, the dynamic contrast of the grayscale range is calculated, and the value is quantified to a reasonable range between [0,2]. ;
[0143] The steps to obtain the parameters are as follows: calculate the difference between the original image contrast and the expected contrast (the standard contrast of 1.0 specified in the equipment factory technical data is the target) (1.0-0.85=0.15), and multiply the difference by 2 according to historical image processing experience and experimental statistics to obtain ;
[0144] Calculation process:
[0145] calculate ;
[0146] Query pair Calculation of ;
[0147] calculate ;
[0148] Calculate the molecular part ;
[0149] Calculate the denominator ;
[0150] Substitute into the formula for calculation:
[0151] ;
[0152] The result shows that the currently adjusted contrast ratio is 0.7958, which is lower than the original contrast ratio of 0.85.
[0153] According to the adjusted contrast ratio value obtained previously, read the numerical parameters from this contrast ratio value, multiply this parameter by the grayscale value of each pixel point in the current image pixel matrix one by one, record the change in grayscale value after each operation, perform a difference calculation on the change in these grayscale values and the grayscale value of the previous pixel, use the difference result to judge the degree of grayscale difference between pixels, divide the entire image into several small block areas for uniform processing, perform the same grayscale operation and difference calculation on each pixel in each small block area one by one, summarize the obtained results item by item, use a fixed proportional factor to reduce the deviation degree of the data points that significantly deviate from the original distribution. After all the pixels in all small block areas have completed this process, merge the corrected grayscale data back into the complete image pixel matrix data according to the row and column order to obtain the optimized image processing result.
[0154] The steps to obtain the quality analysis result are as follows:
[0155] Obtain the optimized image processing result, check the clarity, color accuracy, and detail performance of the image to obtain the preliminary image quality assessment data;
[0156] Based on the preliminary image quality assessment data, analyze the edge sharpness and noise level, as well as the contrast ratio and brightness check to obtain the detailed image quality analysis result;
[0157] Based on the detailed image quality analysis result, judge the overall quality of the image.
[0158] Specifically, after receiving the optimized image, first check the clarity of the image. The evaluation method includes measuring whether the transition boundary between the bright and dark parts in the image is clearly visible. The safety threshold for clarity is set such that the boundary can be clearly distinguished without magnification. Then, correct the image color. By comparing the color deviation between the original photographed object and the displayed color of the image, the safe range for color accuracy is that the color difference does not exceed the DeltaE2.0 standard. Finally, evaluate the detail performance of the image to ensure that important details such as textures and shadows can be clearly displayed under different brightness conditions. The evaluation of detail performance uses a standard image test card and is compared with the reference image to obtain the preliminary image quality assessment data.
[0159] Based on the preliminary evaluation data, further analyze the edge sharpness of the image. Using the edge contrast measurement method, by calculating the brightness difference between the pixels representing the edge and the adjacent background pixels in the image, the safety threshold for sharpness is that the edge contrast is higher than 25%. At the same time, check the noise level of the image. By analyzing the random brightness fluctuations in the static area of the image, the safe range of the noise level is set as the signal-to-noise ratio being greater than 30 dB; thus, detailed image quality analysis results are obtained.
[0160] After obtaining the detailed image quality analysis results, conduct an overall quality evaluation of the image. This evaluation combines technical parameters and visual assessment, using preset scoring criteria. These criteria are based on industry-recognized image quality evaluation indicators, such as resolution, color fidelity, and visual clarity, etc. During the scoring process, compare the image with standard images of multiple known quality levels, and score according to the performance of the image in various tests. The total score system is 100 points, and a safety threshold of above 70 points is considered excellent. Finally, determine the overall quality level of the image.
[0161] The present invention provides a defect detection system, including:
[0162] An image capture module, based on a high-speed camera, captures a sequence of moving images of components on the production line and generates moving image sequence data;
[0163] A speed analysis module, based on the moving image sequence data, extracts the number of pixels that the component moves per second, conducts time series analysis, and generates a production line speed prediction result;
[0164] A sampling adjustment module, based on the production line speed prediction result, calculates the sampling frequency, generates a sampling frequency adjustment instruction, and adjusts the camera sampling frequency in real time to obtain an optimized sampling frequency setting result;
[0165] An image processing module, based on the optimized sampling frequency setting result, processes the captured image sequence, performs noise elimination, generates preliminary image enhancement data, and conducts cropping and contrast adjustment on the preliminary image enhancement data to obtain an optimized image processing result;
[0166] A defect recognition module, used to identify and mark potential defect areas in the optimized image processing result through a model to obtain a defect detection result.
[0167] The above are only the preferred embodiments of the present invention, and do not limit the present invention in other forms. Any person skilled in the relevant art may use the disclosed technical content to make changes or modifications into equivalent embodiments with equivalent changes and apply them to other fields. However, as long as it does not depart from the technical content of the technical solution of the present invention, any simple modification, equivalent change, and modification made to the above embodiments based on the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for defect detection of automotive parts based on visual detection, characterized in that, Including the following steps: Capture a sequence of moving images of components on the production line through a high-speed camera, extract the number of pixels that the components move per second, and generate preliminary speed data; according to the preliminary speed data, arrange the speed values corresponding to each time point in chronological order to form a time series, and perform time series analysis. Through trend judgment and smoothing processing, obtain the adjusted production line speed prediction result; According to the adjusted production line speed prediction result, calculate the sampling frequency, and generate a preliminary sampling frequency adjustment instruction; apply the preliminary sampling frequency adjustment instruction to adjust the camera sampling frequency in real time to obtain an optimized sampling frequency setting result; According to the optimized sampling frequency setting result, process the captured image sequence to eliminate noise and generate preliminary image enhancement data; Crop and adjust the contrast of the preliminary image enhancement data to obtain an optimized image processing result; Based on the optimized image processing result, analyze the quality of the captured images to obtain a quality analysis result; Input the defective image data into a convolutional neural network model for training, and use the convolutional neural network model to identify and mark potential defective areas in the optimized image processing result to obtain a defect detection result.
2. The defect detection method for automotive parts based on visual detection according to claim 1, wherein The steps for obtaining the preliminary speed data are as follows: Install a high-speed camera on the production line to capture a sequence of moving images of components in real time to form a complete sequence of component images; Based on the sequence of component images, analyze the pixel displacement between two consecutive frames, extract the pixel movement amount of the components within a fixed time, and combine with the number of frames per second to calculate the pixel movement data per second; According to the pixel movement data per second, calculate the preliminary speed of the components to obtain the preliminary speed data.
3. The defect detection method for automotive parts based on visual detection according to claim 1, wherein The steps for obtaining the adjusted production line speed prediction result are as follows: Based on the preliminary speed data, perform time series analysis, analyze the time dependence and periodic changes in the data to obtain a time series analysis result; Judge the trend of the data from the time series analysis result and perform smoothing processing. The formula is: ; Among them, is the adjusted smoothing speed value, is the smoothing coefficient, is the speed value at the current time point, is the current time, is the adjustment intensity, is the reference time point, is the base of the natural logarithm, is the smoothing speed value at the previous time point; Based on the smoothed speed values, summarize to obtain the adjusted production line speed prediction result.
4. The defect detection method for automotive parts based on visual detection according to claim 1, wherein The steps for obtaining the preliminary sampling frequency adjustment instruction are as follows: According to the adjusted production line speed prediction result, determine the speed state of the current production line to obtain the current speed state; Based on the current speed state, calculate the sampling frequency. The calculation formula is: ; Among them, is the new sampling frequency, is the basic sampling frequency, is the current speed, is the reference speed; Based on the calculated new sampling frequency, generate a sampling frequency adjustment instruction to obtain the preliminary sampling frequency adjustment instruction.
5. The defect detection method of automotive parts based on visual detection according to claim 1, characterized in that, The steps for obtaining the optimized sampling frequency setting result are as follows: Receive the preliminary sampling frequency adjustment instruction, determine the sampling frequency adjustment parameters to be implemented to obtain the adjustment parameters; Based on the adjustment parameters, update the camera and adjust the sampling frequency of the camera to obtain the updated sampling frequency; Based on the updated sampling frequency, test and verify the effect to obtain the optimized sampling frequency setting result.
6. The defect detection method for automotive parts based on visual detection according to claim 1, characterized in that The steps for obtaining the preliminary image enhancement data are as follows: Receive the optimized sampling frequency setting result, capture an image sequence through the camera to obtain an image sequence processed according to the new sampling frequency; Based on the image sequence processed by the new sampling frequency, analyzing the noise type in the image, applying median filtering and Gaussian filtering in a targeted manner, removing random variations of non-image content, and obtaining an image sequence with reduced noise; Based on the noise-reduced image sequence, the clarity and sharpness of the image are adjusted to obtain preliminary image enhancement data.
7. The defect detection method for automotive parts based on visual detection according to claim 1, characterized in that The steps for obtaining the optimized image processing result are: Receiving the preliminary image enhancement data, performing image cropping, and cropping according to a focus area and a ratio to obtain cropped image data; Based on the cropped image data, the adjusted contrast value is calculated using the following formula: ; Among them, is the adjusted contrast value, is the contrast value of the original image, is the contrast adjustment coefficient; Based on the adjusted contrast value, contrast adjustment is performed to obtain an optimized image processing result.
8. The defect detection method of automotive parts based on visual detection according to claim 1, wherein, The steps for obtaining the quality analysis results are: Obtaining the optimized image processing result, checking the clarity, color accuracy and performance of the image, and obtaining preliminary image quality assessment data; Based on the preliminary image quality assessment data, edge sharpness and noise level are analyzed, as well as contrast and brightness are checked to obtain detailed image quality analysis results; Based on the detailed image quality analysis results, the overall quality of the image is judged.
9. A defect detection system for a defect detection method of automotive parts based on visual detection according to any one of claims 1-8, characterized in that, include: The image capture module, based on a high-speed camera, captures the moving image sequence of parts on the production line and generates moving image sequence data; The speed analysis module extracts the number of pixels moved per second by the parts based on the moving image sequence data, performs time series analysis, and generates production line speed prediction results; The sampling adjustment module calculates the sampling frequency based on the production line speed prediction results, generates sampling frequency adjustment instructions, adjusts the camera sampling frequency in real time, and obtains the optimized sampling frequency setting results; An image processing module processes the captured image sequence based on the result of the optimized sampling frequency setting, performs noise elimination, generates preliminary image enhancement data, crops and adjusts the contrast of the preliminary image enhancement data, and obtains an optimized image processing result; The defect recognition module is used to identify and mark potential defect areas of the optimized image processing results through a model to obtain defect detection results.
Citation Information
Patent Citations
Low-power-consumption cloth inspecting machine intelligent control method and system
CN113588671A
Target tracking method and device for fast moving small target
CN119360452A