Defect detection method and system for automobile parts based on visual inspection

Through a high-speed camera, the image sequence of components is captured and the sampling frequency is adjusted in real time, the problem of unstable image acquisition on the fast production line is solved, and high-quality image processing and accurate defect detection are achieved.

CN119693352AActive Publication Date: 2025-03-25CHANGCHUN HUICHENG TECH CO LTD

Patent Information

Application Number
CN202510192507.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-03-25
Estimated Expiration
2045-02-21

AI Technical Summary

Technical Problem

The prior art is difficult to capture high-quality images on fast production lines, resulting in limited accuracy and efficiency of visual detection, especially when image acquisition is unstable when production speeds change.

Method used

Capture the moving image sequence of components through a high-speed camera, extract pixel moving data, perform time series analysis to predict production line speed, and adjust the camera sampling frequency in real time to optimize image processing and defect detection.

Benefits of technology

It achieves high-quality images at different production speeds, improving the quality of image processing and the accuracy and efficiency of defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693352A_ABST
    Figure CN119693352A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automobile part detection, in particular to an automobile part defect detection method and system based on visual inspection, and the method comprises the following steps: capturing a moving image sequence of parts on a production line through a high-speed camera, extracting the number of pixels of the parts moving per second, and generating initial speed data; and performing time sequence analysis according to the initial speed data, and obtaining an adjusted production line speed prediction result through trend judgment and smooth processing. According to the method, the moving image sequence of the parts on the production line is captured by the high-speed camera, and the pixel moving data per second is extracted, so that the image quality monitoring of the moving parts is improved. And the sampling frequency of the camera is adjusted according to a prediction result, so that high-quality images can be obtained at different production speeds. By means of the adjustment, the quality of subsequent image processing is improved, and particularly after denoising and contrast adjustment, defect recognition becomes clearer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automobile parts detection, and in particular to a defect detection method and system for automobile parts based on visual detection. Background Art

[0002] The field of automotive parts inspection technology involves the use of various inspection methods and tools to evaluate the quality and performance of automotive parts. This technical field includes, but is not limited to, visual inspection, acoustic inspection, laser scanning, and the application of various sensor technologies. Visual inspection technology uses high-resolution cameras and image processing software to identify tiny defects on the surface of parts, such as cracks, scratches, or corrosion.

[0003] In the prior art, it is often difficult to capture high-quality images on fast production lines due to the rapid movement of parts. In visual inspection, cameras frequently have blurred and distorted images, which affects the accuracy of defect detection. In addition, they are usually not flexible enough in responding to changes in production speed, and fail 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 purpose of the present invention is to solve the shortcomings of the prior art and to propose a defect detection method and system for automobile parts based on visual inspection.

[0005] In order to achieve the above object, the present invention adopts the following technical solution, a defect detection method of automobile parts based on visual inspection, comprising the following steps: Capturing a moving image sequence of parts on the production line through a high-speed camera, extracting the number of pixels moved per second by the parts, and generating preliminary speed data; performing time series analysis based on the preliminary speed data, and obtaining an adjusted production line speed prediction result through trend judgment and smoothing processing; According to the adjusted production line speed prediction result, the sampling frequency is calculated to generate a preliminary sampling frequency adjustment instruction; the preliminary sampling frequency adjustment instruction is applied 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, the captured image sequence is processed to eliminate noise and generate preliminary image enhancement data; the preliminary image enhancement data is cropped and contrast adjusted to obtain an optimized image processing result; Based on the optimized image processing result, analyzing the quality of the captured image to obtain a quality analysis result; The defect image data is input into the convolutional neural network model for training, and the convolutional neural network model is used to identify and mark potential defect areas on the optimized image processing results to obtain defect detection results.

[0006] Preferably, the steps of obtaining the preliminary speed data are: Install high-speed cameras on the production line to capture the moving image sequence of parts in real time to form a complete image sequence of parts; Based on the component image sequence, the pixel displacement between two consecutive frames is analyzed, the pixel movement amount of the component within a fixed time is extracted, and the pixel movement data per second is calculated in combination with the number of frames per second; According to the pixel movement data per second, the preliminary speed of the component is calculated to obtain preliminary speed data.

[0007] Preferably, the steps for obtaining the adjusted production line speed prediction result are: Based on the preliminary velocity data, a time series analysis is performed to analyze the time dependence and periodic changes in the data to obtain a time series analysis result; The trend of the data is determined from the time series analysis results and smoothed. The formula is: ; in, is the adjusted smoothing speed value, is the smoothing coefficient, is the speed value at the current time point, is the current time, To adjust the intensity, As the reference time point, is the base of natural logarithms, is the smoothed speed value at the previous time point; Based on the smoothed speed value, an adjusted production line speed prediction result is obtained by summarizing.

[0008] Preferably, the steps of obtaining the preliminary sampling frequency adjustment instruction are: Determine the speed state of the current production line according to the adjusted production line speed prediction result to obtain the current speed state; Based on the current speed state, the sampling frequency is calculated using the following formula: ; in, is the new sampling frequency, is the basic sampling frequency, is the current speed, is the base speed; Based on the calculated new sampling frequency, a sampling frequency adjustment instruction is generated to obtain a preliminary sampling frequency adjustment instruction.

[0009] Preferably, the steps for obtaining the optimized sampling frequency setting result are: Receiving the preliminary sampling frequency adjustment instruction, determining the sampling frequency adjustment parameters to be implemented, and obtaining the adjustment parameters; Based on the adjustment parameters, updating the camera, adjusting the sampling frequency of the camera, and obtaining an updated sampling frequency; Based on the updated sampling frequency, the effect is tested and verified to obtain an optimized sampling frequency setting result.

[0010] Preferably, the steps of acquiring the preliminary image enhancement data are: 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; 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.

[0011] Preferably, 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: ; in, is the adjusted contrast value, is the contrast value of the original image, is the contrast adjustment factor; Based on the adjusted contrast value, contrast adjustment is performed to obtain an optimized image processing result.

[0012] Preferably, the steps of 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.

[0013] The present invention provides a defect detection system, comprising: 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.

[0014] Compared with the prior art, the advantages and positive effects of the present invention are: The present invention uses a method to capture the moving image sequence of parts on the production line with a high-speed camera and extract the pixel movement data per second, thereby improving the image quality monitoring of moving parts. The camera sampling frequency is adjusted according to the prediction results to ensure that 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. The image-enhanced data is input into the convolutional neural network for training and defect identification, which improves the recognition accuracy and efficiency and realizes accurate detection of component defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic diagram of the steps of the present invention. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0017] See also Figure 1 The present invention provides a technical solution, a defect detection method for automobile parts based on visual inspection, comprising the following steps: The moving image sequence of parts on the production line is captured by a high-speed camera, and the number of pixels moved by the parts per second is extracted to generate preliminary speed data. Time series analysis is performed based on the preliminary speed data, and the adjusted production line speed prediction results are obtained through trend judgment and smoothing processing.

[0018] According to the adjusted production line speed prediction result, the sampling frequency is calculated and a preliminary sampling frequency adjustment instruction is generated; the preliminary sampling frequency adjustment instruction is applied to adjust the camera sampling frequency in real time to obtain an optimized sampling frequency setting result.

[0019] According to the optimized sampling frequency setting result, the captured image sequence is processed to eliminate noise and generate preliminary image enhancement data; the preliminary image enhancement data is cropped and contrast adjusted to obtain the optimized image processing result.

[0020] Based on the optimized image processing results, the quality of the captured images is analyzed to obtain quality analysis results; The defect image data is input into the convolutional neural network model for training. The convolutional neural network model is used to identify and mark potential defect areas on the optimized image processing results to obtain defect detection results.

[0021] Specifically, the original image dataset containing various typical defect types is sorted, and the defect area location and type (such as scratches, cracks, pits, etc.) in the data are annotated according to the existing quality inspection standards or experience, and the annotation information is recorded as the corresponding label data to form an image-label pair. Subsequently, the images and corresponding labels are processed by sets, and the dataset is divided into a training set, a validation set, and a test set (for example, a ratio of 7:2:1), and the number and distribution of each type of defect samples are ensured to be relatively balanced in different datasets.

[0022] The images in the training set are standardized, and each pixel value is scaled to a suitable range (such as between 0 and 1) according to a fixed formula so that the network has a stable gradient change during training. At the same time, data enhancement methods are used to randomly rotate, flip, translate, scale, or add a small amount of simulated noise to the training images to increase the robustness and generalization ability of the model and avoid reducing the detection ability of new data due to overfitting the training set features.

[0023] According to the complexity of the target task and the characteristics of the defects, select a suitable convolutional neural network structure, such as ResNet, VGG or a custom multi-layer convolution-pooling combination structure, and connect several fully connected layers or global average pooling layers at the top layer to output the 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.

[0024] Choose an appropriate loss function based on the type of task (e.g., pixel-level annotation or region-level detection for defect detection). For example, if you need to classify each pixel as a defect, you can use the cross entropy loss function; if you use an object detection framework, you may need to use a combined loss of bounding box regression error and classification error. Choose an appropriate optimization algorithm (e.g., SGD or Adam) and set the initial learning rate and momentum factor. The learning rate scheduler can be used to dynamically adjust the learning rate during training.

[0025] The image data of the training set is input into the network in batches. The forward propagation calculates the error between the predicted output and the true label. The backward propagation algorithm is used to calculate the gradient of the loss to each network parameter, and the network weight is updated accordingly. This process is repeated continuously, and each complete processing of the training set is called an epoch. During the training process, indicators such as loss and accuracy on the validation set are monitored to determine the generalization performance and convergence of the model. If the validation set indicators do not improve for a long time, you can consider adjusting the hyperparameters (such as learning rate, batch size) or structural design.

[0026] After multiple training epochs, the model with the best performance in the validation set is selected as the final model. The model is used for test set evaluation, and the model's defect detection ability for new data is measured by indicators such as accuracy, recall, F1-score or Mean Average Precision (mAP). If the test results meet the standards, the model can be put into actual production testing.

[0027] The trained convolutional neural network model is used to perform forward inference on the optimized image processing results, and threshold judgment or non-maximum suppression operations are performed based on the defect probability value and defect area information output by the model, and finally potential defect areas are marked on the image. The output defect detection results include specific defect type, location coordinates, confidence score and other information.

[0028] The steps to obtain preliminary speed data are: Install high-speed cameras on the production line to capture the moving image sequence of parts in real time to form a complete image sequence of parts; Based on the image sequence of the parts, the pixel displacement between two consecutive frames is analyzed, the pixel movement of the parts in a fixed time is extracted, and the pixel movement data per second is calculated based on the number of frames per second; According to the pixel movement data per second, the preliminary speed of the parts is calculated to obtain the preliminary speed data.

[0029] Specifically, adjust the focus and position of the high-speed camera to ensure that it covers the entire movement of parts on the production line; set the camera to a high frame rate to capture multiple frames per second to capture the continuous movement of parts and ensure the continuity of the image; analyze the captured image sequence, compare the position changes of parts frame by frame, and record the precise position of parts in each frame, thereby forming a detailed and continuous image data sequence, which can clearly show the movement trajectory and speed changes of parts on the production line.

[0030] From the formed component image sequence, the pixel displacement of the component between two consecutive frames is identified and measured, and these displacements are calculated to determine the movement speed of the component; the total number of pixels moved by the component per second is accumulated and calculated, and this data is used to reflect the movement speed of the component; this method allows monitoring of the speed changes of the components during the production process, and adjusts the capture frequency of the camera through the movement data of the components to ensure the accuracy and real-time nature of the data.

[0031] The collected pixel movement data per second is used to calculate the speed. The moving speed of the parts is calculated by dividing the distance by the time, and the pixel distance is converted into speed units to provide accurate production line motion data. These speed data are combined to monitor the overall operating efficiency of the production line. By analyzing the changing trends of the data, production parameters are adjusted in a timely manner to ensure the stable operation of the production line and the quality control of parts, and finally the preliminary speed data is output.

[0032] The steps to obtain the adjusted production line speed prediction results are: Based on the preliminary velocity data, time series analysis is performed to analyze the time dependence and periodic changes in the data and obtain the time series analysis results; Determine the trend of the data from the time series analysis results and perform smoothing. The formula is: ; in, is the adjusted smoothing speed value, is the smoothing coefficient, is the speed value at the current time point, is the current time, To adjust the intensity, As the reference time point, is the base of natural logarithms, is the smoothed speed value at the previous time point; Based on the smoothed speed values, the adjusted production line speed prediction results are summarized.

[0033] 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, and the sequence is segmented according to a fixed length. Basic statistical indicators such as speed mean and speed variance are extracted in each time period, and a reference cycle length is selected from the known equipment nominal production cycle data. The reference cycle length is used to calculate the Pearson correlation coefficient for the speed statistics after segmentation. The 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 against all segmentation results, and the recorded periodic mark is paired with the corresponding speed mean and variance values ​​for analysis. By calculating the differential sequence between data points in the cycle and statistically analyzing the differential distribution characteristics, a result set containing periodic marks and corresponding differential features 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 summarized to form a complete time series analysis result.

[0034] The formula is useful because it introduces logical functions into the calculation process. and smoothing coefficient , so that when the current measured speed value and the smoothed speed value of the previous moment are integrated, the weights of the two can be dynamically adjusted, thereby reducing the impact of noise while retaining the key information of speed change.

[0035] The acquisition steps are as follows: construct an error function through the deviation between the actual speed and the preliminary smoothing speed at each moment in the time series analysis results obtained previously, use the least squares method to fit the parameters of the error function and solve the problem of minimizing the error. Value, finally determined ; The acquisition steps are as follows: the high-speed camera records the moving pixel amount of the parts passing through the production line at t=5 seconds and converts it into a speed value. After preliminary calibration, the speed value at this moment is quantified as ; and The steps for obtaining are: when recording data, the time when recording starts is used as the reference time point , and then get the current time according to the timer reading ; The steps to obtain the time series analysis result are as follows: by fitting the logistic curve to the time series analysis result obtained previously, performing nonlinear regression between the historical data and the logistic function, and selecting the parameter value that minimizes the mean square error of the fitting. ; The steps to obtain are: at t=4 seconds, the same formula is used to calculate and obtain the smoothed speed value of the previous moment .

[0036] Calculation process: Calculate the denominator of the logic function: ; calculate item: ; calculate item: ; Step 4: Substitute the above results into the formula: ; The results show that at t=5 seconds, the adjusted speed obtained by smoothing and weighting with logical functions is 1.03216 m / s. When the value is close to 1 m / s and has small fluctuations, it means that the production line speed is relatively stable. When the value is significantly higher, it means that the production line speed has increased significantly. When the value is significantly lower, it means that the production line has slowed down significantly. The numerical results can be further used in subsequent steps to predict and correct the overall production line speed, so as to finally summarize the adjusted production line speed prediction results.

[0037] 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.

[0038] The steps to obtain the preliminary sampling frequency adjustment instruction are: 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; Based on the current speed state, the sampling frequency is calculated using the following formula: ; in, is the new sampling frequency, is the basic sampling frequency, is the current speed, is the base speed; Based on the calculated new sampling frequency, a sampling frequency adjustment instruction is generated to obtain a preliminary sampling frequency adjustment instruction.

[0039] Specifically, according to the adjusted production line speed prediction result obtained above, the speed value corresponding to the current moment is first extracted therefrom, and the extracted speed value is compared with a set of reference speed intervals that are solidified in the internal parameter library through long-term monitoring and statistics of the same type of production line under standard operating conditions. The upper and lower limits of each interval are obtained by the statistics of the stable operation sample data of the production line under different loads and different time periods, and the single-point interpolation method is used to calculate the difference between adjacent intervals to quantify the distribution density of the interval interval. When the current speed value falls into a certain interval, the speed range of the interval is selected as the current reference, and a fine-tuning coefficient is calculated according to the speed dispersion of each sub-interval in the reference interval. The fine-tuning coefficient is obtained by performing mean calculation and standard deviation analysis on the recorded historical speed collection points, and the fine-tuning coefficient is multiplied by the current speed value to obtain the final speed mark value, and then the speed mark value is mapped to the corresponding speed category label. The label has the corresponding category number and name stored in the internal parameter library in advance. According to the matching rule of the label value and the category number, the speed state category data matching the current speed is finally obtained to obtain the current speed state.

[0040] The formula is useful because it is The current speed is taken into account in the calculation process With reference speed The relationship between the sampling frequency and the sampling frequency can be dynamically adjusted 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 precise speed data capture, and reducing the sampling frequency at a lower speed can save resources.

[0041] The parameters are 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 the equipment under the design standard is ; The parameter acquisition steps are as follows: select the average value under stable operating conditions from the previously adjusted production line speed prediction results as the reference speed, and determine the average speed value of the stable area after a long period of statistics as ; The parameter acquisition steps are as follows: the speed value corresponding to the current moment in the previously adjusted production line speed prediction result is recorded by the high-speed camera and sensor at the current moment and obtained after smoothing and adjustment in the previous step. ; Calculation process: Substitute the parameters into the formula: ; First calculate the internal value of the score: ; Raise 1.21 to the power of 0.5: ; Substituting the result back into the formula: ; The result shows that the new sampling frequency is 110Hz. If it is greater than 100Hz, it means that the current speed is higher than the reference speed, and the sampling frequency should be increased accordingly. If it is less than 100Hz, it means the current speed is lower than the base speed, and the sampling frequency will be reduced. This numerical result is directly related to the current step for adjusting the sampling frequency of the camera or sensor. When the result exceeds 110Hz, it means the current speed is obviously too high, and when it is less than 90Hz, it means the current speed is obviously too low. Through further analysis of the results, the sampling strategy can be adjusted accordingly in the subsequent steps.

[0042] Based on the calculated new sampling frequency, the parameter groups at the corresponding frequency are retrieved from the internal parameter library. These parameter groups include the basic pulse period data and the corresponding timing allocation data for generating control instructions. The new sampling frequency value is substituted into the pulse period calculation formula, and the pulse period data and the timing allocation data are matched item by item. The internally stored frequency-control instruction mapping table is used to compare the current pulse period and the timing allocation results, and the matching item closest to the instruction required for the current frequency is found. When there are multiple matching items, the gaps between the items are compared, and the one with the smallest gap is selected as the final control instruction item. When there are data points with too large a gap, it is necessary to analyze the historical frequency and instruction matching situation, eliminate the data point, and then look for matching items again. When the matching item is finally locked, the instruction item is identified as a preliminary sampling frequency adjustment instruction.

[0043] The steps to obtain the optimized sampling frequency setting result are: receiving a preliminary sampling frequency adjustment instruction, determining sampling frequency adjustment parameters to be implemented, and obtaining adjustment parameters; Based on the adjustment parameters, the camera is updated, and the sampling frequency of the camera is adjusted to obtain an updated sampling frequency; Based on the updated sampling frequency, the effect is tested and verified to obtain the optimized sampling frequency setting result.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] The steps to obtain preliminary image enhancement data are: 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; 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; Based on the noise-reduced image sequence, the clarity and sharpness of the image are adjusted to obtain preliminary image enhancement data.

[0048] 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 to remove the noise. The image sequence first undergoes a preliminary visual inspection to identify common problems such as Gaussian noise or salt and pepper noise in the image. Next, a median filter is used to process salt and pepper noise, which reduces random noise by replacing the median of the pixel values ​​around the pixel. For Gaussian noise, Gaussian filtering technology is used, which smoothes the image by applying a weighted average method to the entire image, reduces the visual impact of noise, and finally obtains a noise-reduced image sequence.

[0049] After the noise removal process, the next step of image sequence processing is image enhancement, including clarity adjustment and sharpening. Clarity adjustment is to enhance 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 improved, and preliminary image enhancement data is obtained.

[0050] The steps to obtain the optimized image processing results are: receiving 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 formula: ; in, is the adjusted contrast value, is the contrast value of the original image, is the contrast adjustment factor; Based on the adjusted contrast value, contrast adjustment is performed to obtain an optimized image processing result.

[0051] 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.

[0052] 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. 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]. ; 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 ; Calculation process: calculate ; Query pair Calculation of ; calculate ; Calculate the molecular part ; Calculate the denominator ; Substitute into the formula to calculate: ; The result shows that the current adjusted contrast is 0.7958, which is lower than the original contrast of 0.85.

[0053] According to the adjusted contrast value obtained above, a numerical parameter is read from the contrast value, and the parameter is multiplied by the grayscale value of each pixel in the current image pixel matrix one by one. The grayscale value change after each operation is recorded, and the grayscale value change is differentially calculated with the grayscale value of the previous pixel. The difference result is used to judge the grayscale difference between pixels. In order to achieve uniform processing, the entire image is divided into several small areas, and the same grayscale operation and differential calculation are performed on the pixels in each small area one by one. The results are summarized item by item, and a fixed proportional factor is used to reduce the deviation of the data points that obviously deviate from the original distribution. When the pixels in all small areas have completed the process, the grayscale data after correction are merged into the complete image pixel matrix data in row and column order to obtain the optimized image processing result.

[0054] The steps to obtain the quality analysis results are: Obtain optimized image processing results, check image clarity, color accuracy, and detail performance, and obtain 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.

[0055] Specifically, after receiving the optimized image, the clarity of the image is checked first. The evaluation method includes measuring whether the transition boundary between the light and dark parts of the image is clearly visible. The safety threshold of clarity is set so that the boundary can be clearly distinguished without magnification; then, the image color is corrected by comparing the deviation between the color of the original photographed object and the color displayed in the image. The safety range of color accuracy is that the color difference does not exceed the DeltaE2.0 standard; finally, the image detail performance is evaluated to ensure that important details such as texture and shadows can be clearly displayed under different brightness conditions. The detail performance is evaluated using a standard image test card and compared with a reference image to obtain preliminary image quality evaluation data.

[0056] Based on the preliminary evaluation data, the edge sharpness of the image is further analyzed. The edge contrast measurement method is used to calculate the brightness difference between the pixels representing the edge in the image and the adjacent background pixels. The safety threshold of sharpness is an edge contrast higher than 25%. At the same time, the noise level of the image is checked. By analyzing the random brightness fluctuations in the static area of ​​the image, the safety range of the noise level is set to a signal-to-noise ratio greater than 30dB. Detailed image quality analysis results are obtained.

[0057] After obtaining detailed image quality analysis results, the overall quality of the image is judged, which combines technical parameters and visual evaluation, using preset scoring standards based on industry-recognized image quality evaluation indicators such as resolution, color fidelity, and visual clarity. During the scoring process, the image is compared with multiple standard images of known quality levels, and the image is scored based on its performance in various tests. The total score is 100 points, and a safety threshold of 70 points or above is considered excellent. Finally, the overall quality level of the image is determined.

[0058] The present invention provides a defect detection system, comprising: 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.

[0059] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A defect detection method for automobile parts based on visual inspection, characterized in that: The following steps are involved: Capturing a moving image sequence of parts on the production line through a high-speed camera, extracting the number of pixels moved per second by the parts, and generating preliminary speed data; performing time series analysis based on the preliminary speed data, and obtaining an adjusted production line speed prediction result through trend judgment and smoothing processing; According to the adjusted production line speed prediction result, the sampling frequency is calculated to generate a preliminary sampling frequency adjustment instruction; the preliminary sampling frequency adjustment instruction is applied 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, the captured image sequence is processed to remove noise and generate preliminary image enhancement data; Performing cropping and contrast adjustment on the preliminary image enhancement data to obtain an optimized image processing result; Based on the optimized image processing result, analyzing the quality of the captured image to obtain a quality analysis result; The defect image data is input into the convolutional neural network model for training, and the convolutional neural network model is used to identify and mark potential defect areas on the optimized image processing results to obtain defect detection results.

2. The defect detection method for automobile parts based on visual inspection according to claim 1 is characterized in that: The steps for obtaining the preliminary speed data are: Install high-speed cameras on the production line to capture the moving image sequence of parts in real time to form a complete image sequence of parts; Based on the component image sequence, the pixel displacement between two consecutive frames is analyzed, the pixel movement amount of the component within a fixed time is extracted, and the pixel movement data per second is calculated in combination with the number of frames per second; According to the pixel movement data per second, the preliminary speed of the component is calculated to obtain preliminary speed data.

3. The defect detection method for automobile parts based on visual inspection according to claim 1, characterized in that: The steps for obtaining the adjusted production line speed prediction result are: Based on the preliminary velocity data, a time series analysis is performed to analyze the time dependence and periodic changes in the data to obtain a time series analysis result; The trend of the data is determined from the time series analysis results and smoothed. The formula is: ; in, is the adjusted smoothing speed value, is the smoothing coefficient, is the speed value at the current time point, is the current time, To adjust the intensity, As the reference time point, is the base of natural logarithms, is the smoothed speed value at the previous time point; Based on the smoothed speed value, an adjusted production line speed prediction result is obtained by summarizing.

4. The defect detection method for automobile parts based on visual inspection according to claim 1, characterized in that: The steps for obtaining the preliminary sampling frequency adjustment instruction are: Determine the speed state of the current production line according to the adjusted production line speed prediction result to obtain the current speed state; Based on the current speed state, the sampling frequency is calculated using the following formula: ; in, is the new sampling frequency, is the basic sampling frequency, is the current speed, is the base speed; Based on the calculated new sampling frequency, a sampling frequency adjustment instruction is generated to obtain a preliminary sampling frequency adjustment instruction.

5. The defect detection method for automobile parts based on visual inspection according to claim 1, characterized in that: The steps for obtaining the optimized sampling frequency setting result are: Receiving the preliminary sampling frequency adjustment instruction, determining the sampling frequency adjustment parameters to be implemented, and obtaining the adjustment parameters; Based on the adjustment parameters, updating the camera, adjusting the sampling frequency of the camera, and obtaining an updated sampling frequency; Based on the updated sampling frequency, the effect is tested and verified to obtain an optimized sampling frequency setting result.

6. The defect detection method for automobile parts based on visual inspection according to claim 1, characterized in that: The steps for obtaining the preliminary image enhancement data are: 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; 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 automobile parts based on visual inspection 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: ; in, is the adjusted contrast value, is the contrast value of the original image, is the contrast adjustment factor; Based on the adjusted contrast value, contrast adjustment is performed to obtain an optimized image processing result.

8. The defect detection method for automobile parts based on visual inspection according to claim 1, characterized in that: 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 of the defect detection method of automobile parts based on visual inspection according to any one of claims 1 to 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

  • Bolt looseness detection method and device for 360-degree dynamic image monitoring system of train

    CN117593290A

  • Target tracking method and device for fast moving small target

    CN119360452A

  • Process and system for the detection of defects in a tyre

    EP3556576A1

  • Methods and system for object path detection in a workplace

    US20220392081A1

Cited By

  • Acquisition method and system based on camera motion data set

    CN119941796A

  • Intelligent detection method for quality of spherical alumina

    CN120177302A

  • An intelligent detection method for spherical alumina quality

    CN120177302B

  • Automatic test performance benchmark construction method and device and storage medium

    CN120388255A