Real-time defect detection and data processing system in sheet metal part processing
Through a sheet metal defect detection system that simplifies the algorithm process, the problem of slow processing speed caused by large calculations in the prior art is solved, and the rapid detection and data processing of sheet metal defects is realized, ensuring the reliability of the detection results and the real-time performance of the production line.
Patent Information
- Application Number
- CN202510334667.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing sheet metal defect detection methods have a large amount of calculation, resulting in slow processing speed and affecting real-time performance.
High-precision image acquisition equipment is used to acquire images in real time, combining preprocessing, feature extraction, edge detection and defect identification modules to simplify the algorithm process, filter key areas and feature bands through intelligent algorithms, quickly identify defects, and store detection results in real time.
It realizes rapid detection and data processing of sheet metal defects, meets the real-time inspection requirements of production lines, and ensures the reliability and processing quality of the inspection results.
Smart Images

Figure CN120278958A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sheet metal part processing, and particularly relates to a real-time defect detection and data processing system in sheet metal part processing. Background Technique
[0002] In the stamping process of sheet metal parts, various defects may occur, such as wrinkles, burrs, deformation, surface scratches, dimensional inaccuracies, flanging and bending, etc. In order to ensure the quality of sheet metal parts after stamping, it is necessary to detect and process the defects of sheet metal parts after stamping. Currently, the method of sheet metal part defect detection is usually based on computer vision. By performing edge detection on the surface image of the sheet metal part, defects can be identified;
[0003] For example, the patent document with the application number 202210971035.4 discloses a method for detecting abnormalities in sheet metal stamping. This method obtains the gradient information and sharpness degree of each pixel point in the surface image of the sheet metal part after stamping, obtains the edge description value of each pixel point, constructs a histogram of edge description values according to the edge description values, determines the subordination relationship of each band on the histogram curve, obtains the first main band and the second main band, completes the classification of pixel points, obtains edge pixel points, and uses shape features to screen the edge lines formed by the edge pixel points to obtain the accurate edge of the wrinkle defect. This invention adaptively classifies pixel points through edge description values, avoids misclassification caused by fixed threshold classification, and obtains the abnormality degree of sheet metal stamping according to the accurate edge of the wrinkle defect.
[0004] However, the above detection method involves complex image processing algorithms, including gradient calculation, sharpness degree analysis, edge description value construction, Gaussian distribution fitting, and KL divergence calculation, etc. The computational complexity of these algorithms is relatively high, which may lead to a slow processing speed, thus affecting the real-time performance of defect detection and data processing. Therefore, we need to propose a real-time defect detection and data processing system in sheet metal part processing to solve the above existing problems, so that it can reduce unnecessary calculation steps, improve the algorithm efficiency, and ensure the real-time processing and analysis of data. Summary of the Invention
[0005] The purpose of the present invention is to provide a real-time defect detection and data processing system in sheet metal part processing, which can reduce unnecessary calculation steps, improve the algorithm efficiency, and ensure the real-time processing and analysis of data, so as to solve the problems raised in the above background technique.
[0006] To achieve the above purpose, the present invention adopts the following technical solutions:
[0007] A real-time defect detection and data processing system in sheet metal part processing, comprising: an image acquisition module, which uses a high-precision and high-resolution image acquisition device to collect a complete image of the surface of the sheet metal part after stamping in real time;
[0008] A preprocessing module, the input end of which is connected to the output end of the image acquisition module. The preprocessing module performs preprocessing of denoising and grayscale conversion on the collected image, and simplifies the preprocessing steps to improve the processing speed;
[0009] A feature extraction module, the input end of which is connected to the output end of the preprocessing module. The feature extraction module screens out key areas where defects may exist through intelligent algorithms;
[0010] An edge detection module, the input end of which is connected to the output end of the feature extraction module. The edge detection module quickly identifies the feature bands related to defects according to the key areas extracted by the feature extraction module;
[0011] A defect recognition module, the input end of which is connected to the output end of the edge detection module. The defect recognition module accurately recognizes defects through a recognition model, and then fuses all defect information to generate a detailed defect recognition result;
[0012] A data processing and storage module, the input end of which is connected to the output end of the defect recognition module. The data processing and storage module stores the detected defect data in the database in real time and quickly, and generates a visual report to display the defect detection results and statistical information.
[0013] Preferably, the image acquisition device includes an imaging unit, a control unit and a power supply unit. The control unit is electrically connected to the imaging unit and the power supply unit respectively. The imaging unit is mainly composed of a lens assembly and an image sensor.
[0014] Preferably, the process of image acquisition by the image acquisition module includes a parameter setting stage and a trigger acquisition stage. The acquisition frame rate, resolution and exposure time of the image acquisition device are set through the parameter setting stage, and the trigger stage cooperates with a photoelectric sensor linked to the stamping device to detect the position of the movement of the sheet metal part in real time and trigger the imaging unit to perform image acquisition.
[0015] Preferably, the process of the parameter setting stage is as follows:
[0016] A1. Set the frame rate of the image acquisition device according to the speed of the sheet metal part processing production line;
[0017] A2. Set the resolution according to the size of the sheet metal part and the required defect detection accuracy;
[0018] A3. Set the exposure time according to the sheet metal surface material and lighting conditions.
[0019] Preferably, the process of the triggering acquisition stage is as follows:
[0020] A4. When the sheet metal part reaches the detection area after stamping, the optoelectronic sensor linked to the stamping equipment will detect the position change of the sheet metal part and generate a trigger signal to be transmitted to the image acquisition device;
[0021] A5. After receiving the trigger signal, the image acquisition device immediately starts the imaging unit, and the imaging unit quickly focuses on the surface of the sheet metal part and captures an image of the surface of the sheet metal part;
[0022] A6. The image data is transmitted to the preprocessing module through the data interface.
[0023] Preferably, the process of the preprocessing module preprocessing the acquired image is as follows:
[0024] B1. Divide the acquired image into multiple non-overlapping small block images, and set the size of each small block image to m*n;
[0025] B2. Calculate the mean value u of each small block image data ij , and the calculation formula is:
[0026] where B ij (x,y) is the pixel value at the coordinate (x,y) in the small block image B ij , i and j are the number of rows and columns of the small block image B ij respectively, and m and n are the height and width of the small block image B ij respectively;
[0027] B3. Calculate the variance σ of the small block image according to the mean value u ij , and the calculation formula is: ij
[0028]
[0029] B4. Adjust the variance σ of the small block image according to the actual image noise situation to obtain the adjusted variance σ ij , and the adjusted variance σ a , and the adjusted variance σ a The adjustment formula is: σ a = k * σ ij , where k is the adjustment coefficient and its value is between 0.5 and 2;
[0030] B5. Construct a Gaussian kernel G with an odd value and a size of s*s, and calculate the pixel element G(x,y) of the Gaussian kernel G. The calculation formula is:
[0031] Among them, (x, y) are the coordinates of the Gaussian kernel G, s - 1 is the maximum value of the coordinates x and y, and σ α is the adjusted variance;
[0032] B6. Filter each small block image respectively, and the filtering formula is:
[0033]
[0034] Among them, is the pixel value participating in the current filtering calculation in the original small block image B ij , and are respectively the pixel position coordinates corresponding to the current element of the Gaussian kernel in the original small block image B ij . When or or or , boundary processing is required. B ij (u, v) is the pixel value at the coordinate (u, v) position in the new small block image after filtering the original small block image B ij , and G(x, y) is the element value at the coordinate (x, y) position in the Gaussian kernel G;
[0035] B7. Re - splice all the filtered small block images in the original order, and after splicing, obtain the denoised image I(x, y);
[0036] B8. Represent the denoised image I(x, y) using the three components in the RGB space, and calculate the gray value of the denoised image. Among them,
[0037] The representation using the three components in the RGB space is: I(x, y) = [r(x, y), g(x, y), b(x, y)];
[0038] The gray value calculation formula is: (x, y) are the pixel coordinates, r(x, y) is the red component value of the pixel (x, y), g(x, y) is the green component value of the pixel (x, y), b(x, y) is the blue component value of the pixel (x, y), and G ray (x, y) is the gray value of the denoised image.
[0039] Preferably, the process of the feature extraction module for screening key region features is as follows:
[0040] C1. Analyze the pre - processed image using an intelligent algorithm based on image entropy or edge density, and divide the key regions where defects may exist;
[0041] C2. Calculate the gradient magnitude M(x, y) and direction θ(x, y) for each pixel point within the key area. The calculation formula is as follows:
[0042]
[0043] where G x is the gray-scale change rate of the image in the horizontal direction, G y is the gray-scale change rate of the image in the vertical direction, I(x, y) is the pixel value at the coordinate (x, y) in the preprocessed image, is the convolution operation, M(x, y) is the gradient magnitude of the pixel point at the coordinate (x, y) in the image, and θ(x, y) is the gradient direction of the pixel point at the coordinate (x, y) in the image;
[0044] C3. Combine the changes in neighboring pixels and calculate the second-order difference of the pixels to extract the sharpness information. The calculation formula is as follows:
[0045] L(x, y) = I(x - 1, y) + I(x, y - 1) - 4I(x, y) + I(x, y + 1) + I(x + 1, y), where I(x, y) is the pixel value at the coordinate (x, y) in the preprocessed image, I(x - 1, y) is the pixel value of the adjacent pixel on the left of the current pixel point (x, y), I(x, y - 1) is the pixel value of the adjacent pixel below the current pixel point (x, y), I(x, y + 1) is the pixel value of the adjacent pixel above the current pixel point (x, y), and I(x + 1, y) is the pixel value of the adjacent pixel on the right of the current pixel point (x, y);
[0046] C4. Substitute the gradient magnitude, gradient direction, and sharpness information into the simplified edge calculation model to obtain the edge description value. The formula of the edge calculation model is as follows:
[0047] E(x, y) = a * M(x, y) + c * θ(x, y) + d * L(x, y), where a is the weight coefficient of the gradient magnitude M(x, y), c is the weight coefficient of the gradient direction θ(x, y), d is the weight coefficient of the sharpness information L(x, y), and E(x, y) is the edge description value.
[0048] Preferably, the process of the edge detection module for feature band identification is as follows:
[0049] D1. Use a hash table to quickly count the occurrence frequencies of different edge description values based on the edge description values obtained by the key feature extraction module, and construct a histogram of the edge description values;
[0050] D2. Smooth each element in the histogram. The formula for smoothing is as follows:
[0051] Among them, Q is the number of elements in the histogram, H(i) is the value of the histogram of the i-th element, and H(f) is the value of the histogram after smoothing;
[0052] D3. According to the entire histogram data, determine whether each element in the histogram is a local peak or valley, and divide the bands based on the adjacent valleys and peaks;
[0053] D4. Compare the divided bands with the known defect feature bands in the defect feature library, and find the band with a high similarity to the known defect feature bands as the feature band.
[0054] Preferably, the process of defect recognition by the defect recognition module is as follows:
[0055] E1. Screen out the set of edge pixel points that may belong to defects from the edge pixel points output by the edge detection module;
[0056] E2. Determine the region R corresponding to the set of edge pixel points, and calculate the central moments U of each order in the region R pq , and the calculation formula is as follows:
[0057]
[0058] Among them, and are the central coordinates of the region R, x1 and y1 are the image coordinates respectively, p and q are the orders used to define the contour moments, and are all non-negative integers;
[0059] E3. Compare the calculated central moment U pq with the central moment of the standard shape model without defects, and calculate the similarity D between the two;
[0060] E4. Set the similarity threshold D' for judging anomalies. When the confidence D is greater than or equal to the similarity threshold D', it is judged that there are no defects. When the similarity D is less than the similarity threshold D', it is determined that there are defects, and the position of the defects is output;
[0061] E5. Integrate the recognition results of the defects to generate a detailed defect recognition report.
[0062] Preferably, when the data processing and storage module stores the defect data, it first converts the defect data output by the defect recognition module into the required format of the database, then establishes a hash database index according to the key features of the defect data, and then inserts the defect data after format conversion and index establishment into the database specifically designed for sheet metal part data in real time. Finally, it reads the defect data from the database and uses the visualization library to generate an intuitive and clear report according to the set report template to display the defect detection results and statistical information.
[0063] A real - time defect detection and data processing system in sheet metal part processing proposed by the present invention has the following advantages compared with the prior art:
[0064] 1. Through the cooperation of the image acquisition module, pre - processing module, feature extraction module, edge detection module, defect recognition module and data processing and storage module, the whole process from image acquisition to defect recognition and data storage of the present invention is optimized, reducing a large number of unnecessary calculation steps, greatly improving the processing speed, and being able to meet the stringent requirements of the sheet metal part processing production line for real - time defect detection, realizing the rapid detection and data processing of defects on the sheet metal parts after stamping.
[0065] 2. Although the algorithm process of the present invention is simplified, through targeted key area extraction, efficient feature recognition and a special multi - defect recognition model, it can still accurately identify various common defects on the sheet metal parts, ensuring the reliability of the detection results and effectively guaranteeing the processing quality of the sheet metal parts. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 shows a system block diagram according to an embodiment of the present invention;
[0067] Figure 2 shows a flowchart of pre - processing the acquired image by the pre - processing module according to an embodiment of the present invention;
[0068] Figure 3 shows a flowchart of screening key area features by the feature extraction module according to an embodiment of the present invention;
[0069] Figure 4 shows a flowchart of identifying feature bands by the edge detection module according to an embodiment of the present invention;
[0070] Figure 5 shows a flowchart of defect recognition by the defect recognition module according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0071] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. The specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0072] The present invention provides as Figures 1-5A real-time defect detection and data processing system in sheet metal part processing, including an image acquisition module, a preprocessing module, a feature extraction module, an edge detection module, a defect recognition module, and a data processing and storage module;
[0073] The image acquisition module uses a high-precision and high-resolution image acquisition device to real-time acquire the complete image of the surface of the sheet metal part after stamping;
[0074] The image acquisition device includes an imaging unit, a control unit, and a power supply unit. The control unit is electrically connected to the imaging unit and the power supply unit respectively. The imaging unit is mainly composed of a lens assembly and an image sensor. The lens assembly is used to focus light and accurately project the light on the sheet metal surface onto the image sensor. For the sheet metal part detection scenario, the lens assembly needs to have high resolution and low distortion characteristics to ensure clear presentation of sheet metal details and reduce image deformation; the image sensor uses a CMOS sensor with a high pixel density to enable it to capture more subtle defects.
[0075] The control unit is responsible for managing the various functions of the device, such as parameters of frame rate, resolution, and exposure time, coordinating the work of the imaging unit, and setting the frame rate of the image acquisition device at an appropriate value according to the speed of the sheet metal part processing production line to ensure that each frame of image can be captured in time when the sheet metal part quickly passes through the detection area; the power supply unit converts the externally input alternating current into the direct current required by the device and stabilizes the voltage to ensure that the imaging unit and the control unit work in a stable power environment and avoid affecting the image acquisition quality due to power fluctuations.
[0076] The process of image acquisition by the image acquisition module includes a parameter setting stage and a trigger acquisition stage. The acquisition frame rate, resolution, and exposure time of the image acquisition device are set through the parameter setting stage, and the trigger stage cooperates with the photoelectric sensor linked to the stamping device to real-time detect the position of the movement of the sheet metal part and trigger the imaging unit to perform image acquisition. Among them, the process of the parameter setting stage is as follows:
[0077] A1. According to the speed of the sheet metal part processing production line, set the frame rate of the image acquisition device. For example, if the sheet metal parts pass through the detection area at a speed of 10 per second, to ensure that each sheet metal part can be clearly captured, the frame rate needs to be set above 10 frames per second, such as 15 frames per second, to ensure that at least one complete image can be acquired when each sheet metal part passes by;
[0078] A2. Set the resolution according to the size of the sheet metal part and the required defect detection accuracy. For small sheet metal parts that require detection of tiny defects (such as surface scratches less than 1 mm), a higher resolution should be set, such as 2048×1536 pixels, to ensure clear presentation of details; while for large sheet metal parts that mainly focus on larger defects (such as deformations greater than 5 mm), the resolution can be appropriately reduced, such as 1024×768 pixels, which can reduce data transmission and processing volume while meeting the detection requirements.
[0079] A3. Set the exposure time according to the surface material of the sheet metal and the lighting conditions. For reflective sheet metal parts made of stainless steel, set the exposure time to 1 / 1000 second and appropriately shorten the exposure time to avoid overexposure of the image; for sheet metal parts with a sandblasted surface, the exposure time can be extended to 1 / 200 second to increase the image brightness and contrast.
[0080] The process of the trigger acquisition stage is as follows:
[0081] A4. When the sheet metal part reaches the detection area after stamping, the photoelectric sensor linked to the stamping equipment will detect the position change of the sheet metal part and generate a trigger signal, which is transmitted to the image acquisition device;
[0082] A5. After receiving the trigger signal, the image acquisition device immediately activates the imaging unit, and the imaging unit quickly focuses on the surface of the sheet metal part and captures an image of the surface of the sheet metal part;
[0083] A6. The image data is transmitted to the preprocessing module through the data interface to ensure the integrity and accuracy of the data.
[0084] By setting a high frame rate, it is ensured that images can be captured in time when the sheet metal part quickly passes through the detection area, and the high resolution ensures clear presentation of subtle defects. The linkage trigger mechanism between the image acquisition device and the stamping equipment ensures that the captured image is the state of the sheet metal part after stamping, providing high-quality raw data for the preprocessing module.
[0085] The input end of the preprocessing module is connected to the output end of the image acquisition module. The preprocessing module performs denoising and grayscale preprocessing on the captured image and simplifies the preprocessing steps to improve the processing speed;
[0086] As Figure 2 shown, the process of the preprocessing module performing preprocessing on the captured image is as follows:
[0087] B1. Divide the captured image into multiple non-overlapping small block images, and the size of each small block image is set to m*n;
[0088] B2. Calculate the mean value u ij of the data of each small block image respectively, and the calculation formula is:
[0089] Among them, B ij (x, y) is the pixel value of the pixel with coordinates (x, y) in the small block image B ij where i and j are the number of rows and columns of the small block image B ij respectively, and m and n are the height and width of the small block image B ij respectively;
[0090] B3. Calculate the variance σ of the small block image according to the mean value u ij , and the calculation formula is: ij
[0091]
[0092] B4. Adjust the variance σ of the small block image according to the actual image noise situation to obtain the adjusted variance σ ij , and the adjusted variance σ a The adjustment formula is: σ a a = k * σ ij , where k is the adjustment coefficient and its value ranges from 0.5 to 2;
[0093] B5. Construct a Gaussian kernel G with an odd value and a size of s * s, and calculate the pixel element G(x, y) of the Gaussian kernel G. The calculation formula is:
[0094]
[0095] where (x, y) are the coordinates of the Gaussian kernel G, s - 1 is the maximum value of the coordinates x and y, and σ α is the adjusted variance;
[0095] B6. Perform filtering processing on each small block image respectively. The filtering formula is:
[0096]
[0097] where is the pixel value of the original small block image B ij participating in the current filtering calculation, and are the pixel position coordinates corresponding to the current element of the Gaussian kernel in the original small block image B ij respectively. When or or or , boundary processing is required. B ij (u, v) is the pixel value at the position of the coordinate (u, v) in the new small block image after filtering the original small block image B ij , and G(x, y) is the element value at the position of the coordinate (x, y) in the Gaussian kernel G;
[0098] B7. Re - splice all the filtered small - block images in the original order. After splicing is completed, the denoised image I(x, y) is obtained;
[0099] B8. Represent the denoised image I(x, y) using the three components in the RGB space, and calculate the grayscale value of the denoised image. Among them,
[0100] The representation of the three components in the RGB space is: I(x, y)=[r(x, y), g(x, y), b(x, y)];
[0101] The formula for calculating the grayscale value is: (x, y) is the pixel coordinate, r(x, y) is the red - component value of the pixel (x, y), g(x, y) is the green - component value of the pixel (x, y), b(x, y) is the blue - component value of the pixel (x, y), G ray (x, y) is the grayscale value of the denoised image;
[0102] By adjusting the filtering parameters according to the local image features, noise can be effectively removed while details are retained, avoiding image - edge blurring. Calculating the image grayscale can quickly convert a color image into a grayscale image, reduce the data volume, and improve the processing speed of the subsequent feature - extraction module;
[0103] The input end of the feature - extraction module is connected to the output end of the pre - processing module. The feature - extraction module screens out the key areas that may have defects through intelligent algorithms;
[0104] As Figure 3 shown, the process of the feature - extraction module for screening key - area features is as follows:
[0105] C1. Use an intelligent algorithm based on image entropy or edge density to analyze the pre - processed image and divide the key areas that may have defects;
[0106] C2. Calculate the gradient magnitude M(x, y) and direction θ(x, y) of each pixel point in the key area. The calculation formulas are:
[0107]
[0108] where, G x is the grayscale change rate of the image in the horizontal direction, G y is the grayscale change rate of the image in the vertical direction, I(x, y) is the pixel value at the coordinate (x, y) in the pre - processed image, is the convolution operation, M(x, y) is the gradient magnitude of the pixel point at the coordinate (x, y) in the image, and θ(x, y) is the gradient direction of the pixel point at the coordinate (x, y) in the image;
[0109] C3. Combine the changes in neighboring pixels to calculate the second-order difference of pixels to extract the sharpness information. The calculation formula is as follows:
[0110] L(x,y) = I(x - 1,y) + I(x,y - 1) - 4I(x,y) + I(x,y + 1) + I(x + 1,y), where I(x,y) is the pixel value at the coordinate (x,y) in the preprocessed image, I(x - 1,y) is the pixel value adjacent to the left of the current pixel point (x,y), I(x,y - 1) is the pixel value adjacent to the bottom of the current pixel point (x,y), I(x,y + 1) is the pixel value adjacent to the top of the current pixel point (x,y), and I(x + 1,y) is the pixel value adjacent to the right of the current pixel point (x,y);
[0111] C4. Substitute the gradient magnitude, gradient direction, and sharpness information into the simplified edge calculation model to obtain the edge description value. The formula of the edge calculation model is as follows:
[0112] E(x,y) = a * M(x,y) + c * θ(x,y) + d * L(x,y), where a is the weight coefficient of the gradient magnitude M(x,y), c is the weight coefficient of the gradient direction θ(x,y), d is the weight coefficient of the sharpness information L(x,y), and E(x,y) is the edge description value;
[0113] The input end of the edge detection module is connected to the output end of the feature extraction module. The edge detection module quickly identifies the feature bands related to defects based on the key regions extracted by the feature extraction module;
[0114] As Figure 4 shown, the process of the edge detection module for feature band identification is as follows:
[0115] D1. Use a hash table to quickly count the occurrence frequencies of different edge description values according to the edge description values obtained by the key feature extraction module, and construct a histogram of the edge description values;
[0116] D2. Smooth each element in the histogram to facilitate more accurate identification of the feature bands. The formula for smoothing is:
[0117] where Q is the number of elements in the histogram, H(i) is the value of the histogram of the i-th element, and H(f) is the value of the histogram after smoothing;
[0118] D3. According to the entire histogram data, judge whether each element in the histogram is a local peak or valley, and divide the bands based on the adjacent valleys and peaks;
[0119] D4. Compare the divided wavebands with the known defect feature wavebands in the defect feature library, and find the wavebands with high similarity to the known defect feature wavebands as the feature wavebands. The defect feature library is established in advance and stores information on known defect feature wavebands for comparison during edge detection.
[0120] The input end of the defect recognition module is connected to the output end of the edge detection module. The defect recognition module accurately identifies defects through the recognition model, and then fuses all defect information to generate a detailed defect recognition result.
[0121] As Figure 5 shown, the process of defect recognition by the defect recognition module is as follows:
[0122] E1. Screen out the set of edge pixels that may belong to defects from the edge pixels output by the edge detection module.
[0123] E2. Determine the region R corresponding to the set of edge pixels, and calculate the central moments U pq of each order in the region R. The calculation formula is as follows:
[0124]
[0125] Among them, and are the central coordinates of the region R, x1 and y1 are the image coordinates respectively, p and q are the orders used to define the contour moments, and both are non - negative integers.
[0126] E3. Compare the calculated central moments U pq with the central moments of the standard shape model without defects, and calculate the similarity D between the two.
[0127] E4. Set the similarity threshold D' for judging abnormalities. When the confidence D is greater than or equal to the similarity threshold D', it is judged that there are no defects. When the similarity D is less than the similarity threshold D', it is determined that there are defects, and the position of the defects is output.
[0128] E5. Integrate the recognition results of the defects to generate a detailed defect recognition report. The defect recognition report includes information on the position, type, size, and severity of the defects.
[0129] The input end of the data processing and storage module is connected to the output end of the defect recognition module. The data processing and storage module stores the detected defect data in the database in real - time and quickly, and generates a visual report to display the defect detection results and statistical information.
[0130] When storing the defect data, the data processing and storage module first converts the defect data output by the defect recognition module into the required format of the database, then establishes a hash database index based on the key features of the defect data for quick query and retrieval, and then inserts the defect data after format conversion and index establishment into the database designed specifically for sheet metal part data in real time. Finally, the defect data is read from the database, and an intuitive and clear report is generated using a visualization library according to the set report template to display the defect detection results and statistical information.
[0131] By storing the defect data in real time and quickly generating a visualization report, it is convenient for production management personnel to view and analyze the quality problems in the production process at any time, adjust the production parameters in a timely manner or take corresponding measures, thereby improving production efficiency and product quality.
[0132] Through the cooperation of the image acquisition module, preprocessing module, feature extraction module, edge detection module, defect recognition module and data processing and storage module, the entire process from image acquisition to defect recognition and data storage is optimized, reducing a large number of unnecessary calculation steps, greatly improving the processing speed, and being able to meet the stringent requirements of the sheet metal part processing production line for real-time defect detection, realizing the rapid detection and data processing of defects on the sheet metal parts after stamping. Although the algorithm process of this system is simplified, through targeted key area extraction, efficient feature recognition and a dedicated multi-defect recognition model, it can still accurately identify various common defects on the sheet metal parts, ensuring the reliability of the detection results and effectively guaranteeing the processing quality of the sheet metal parts.
[0133] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A real-time defect detection and data processing system in sheet metal part processing, characterized in that: Including: An image acquisition module, which uses a high-precision and high-resolution image acquisition device to collect a complete image of the surface of the sheet metal part after stamping in real time; A preprocessing module, the input end of which is connected to the output end of the image acquisition module. The preprocessing module performs preprocessing of denoising and grayscaling on the collected image, and simplifies the preprocessing steps to improve the processing speed; A feature extraction module, the input end of which is connected to the output end of the preprocessing module. The feature extraction module screens out key areas that may have defects through intelligent algorithms; An edge detection module, the input end of which is connected to the output end of the feature extraction module. The edge detection module quickly identifies the feature bands related to defects based on the key areas extracted by the feature extraction module; A defect recognition module, the input end of which is connected to the output end of the edge detection module. The defect recognition module accurately recognizes defects through a recognition model, and then fuses all defect information to generate a detailed defect recognition result; A data processing and storage module, the input end of which is connected to the output end of the defect recognition module. The data processing and storage module stores the detected defect data in the database in real time and quickly, and generates a visual report to display the defect detection results and statistical information.
2. The real-time defect detection and data processing system in sheet metal part processing according to claim 1, characterized in that: The image acquisition device includes an imaging unit, a control unit, and a power supply unit. The control unit is electrically connected to the imaging unit and the power supply unit respectively. The imaging unit is mainly composed of a lens assembly and an image sensor.
3. A real-time defect detection and data processing system in sheet metal part processing according to claim 2, characterized in that: The process of image acquisition by the image acquisition module includes a parameter setting stage and a trigger acquisition stage. The acquisition frame rate, resolution, and exposure time of the image acquisition device are set through the parameter setting stage. In the trigger stage, it cooperates with a photoelectric sensor linked to the stamping device to detect the position of the sheet metal part in real time and trigger the imaging unit to perform image acquisition.
4. A real-time defect detection and data processing system in sheet metal part processing according to claim 3, characterized in that: The process of the parameter setting stage is as follows: A1. Set the frame rate of the image acquisition device according to the speed of the sheet metal part processing production line; A2. Set the resolution according to the size of the sheet metal part and the required defect detection accuracy; A3. Set the exposure time according to the surface material of the sheet metal and the lighting conditions.
5. A real-time defect detection and data processing system in sheet metal part processing according to claim 4, characterized in that: The process of the trigger acquisition stage is as follows: A4. When the sheet metal part reaches the detection area after stamping, the photoelectric sensor linked to the stamping device will detect the position change of the sheet metal part and generate a trigger signal to be transmitted to the image acquisition device; A5. After receiving the trigger signal, the image acquisition device immediately starts the imaging unit, and the imaging unit quickly focuses on the surface of the sheet metal part and captures the image of the surface of the sheet metal part; A6. The image data is transmitted to the preprocessing module through the data interface.
6. The real-time defect detection and data processing system in sheet metal part processing according to claim 5, characterized in that: The process of the preprocessing module preprocessing the collected image is as follows: B1. Divide the collected image into multiple non-overlapping small block images, and the size of each small block image is set to m*n; B2. Calculate the mean value μ of each small block of image data respectively ij , and the calculation formula is as follows: Among them, B ij (where x and y are the pixel values of the small image B ij at the coordinates (x, y), i and j are the number of rows and columns of the small image B respectively ij respectively, and m and n are the height and width of the small image B ij ; B3. According to the mean value μ ij Calculate the variance σ of the small piece of image ij , and the calculation formula is as follows: B4. Adjust the variance σ of the small piece of image according to the actual image noise situation ij to obtain the adjusted variance σ a . The adjusted variance σ a . The adjustment formula is: σ a = k * σ ij , where k is the adjustment coefficient and its value ranges from 0.5 to 2; B5. Construct a Gaussian kernel G with an odd value and a size of s*s, and calculate the pixel element G(x,y of the Gaussian kernel G. The calculation formula is: where (x, y are the coordinates of the Gaussian kernel G, s - 1 is the maximum value of the coordinates x and y, and σ α is the adjusted variance; B6. Perform filtering processing on each small block image respectively. The filtering formula is: Among them, is the pixel value of the original small block image B ij participating in the current filtering calculation, and are respectively the pixel position coordinates corresponding to the current element of the Gaussian kernel in the original small block image B ij When or or or or ij (u, v are the pixel values at the coordinates (u, v in the new small block image after filtering the original small block image B ij G(x, y is the element value at the coordinates (x, y in the Gaussian kernel G; B7. Re - splice all the filtered small - block images in the original order. After splicing is completed, the denoised image I(x, y; is obtained. B8. Represent the denoised image I(x, y using the three components in the RGB color space, and calculate the gray - scale value of the denoised image. Among them, The representation using the three components in the RGB color space is: I(x, y = r(x, y, g(x, y, b(x, y; The grayscale value calculation formula is as follows: (where x and y are pixel coordinates, r(x,y is the red component value of pixel (x,y, g(x,y is the green component value of pixel (x,y, b(x,y is the blue component value of pixel (x,y, and G ray (x,y is the grayscale value of the denoised image.
7. A real-time defect detection and data processing system in sheet metal part processing according to claim 1, characterized in that: The process of the feature extraction module for screening key - area features is as follows: C1. Analyze the pre - processed image using an intelligent algorithm based on image entropy or edge density to divide the key areas where defects may exist. C2. Calculate the gradient magnitude M(x, y and direction θ(x, y of each pixel point in the key area. The calculation formula is: Among them, G x is the gray-scale change rate of the image in the horizontal direction, and G y is the gray-scale change rate of the image in the vertical direction. I(x, y) is the pixel value at the coordinate (x, y) in the preprocessed image. is the convolution operation. M(x, y) is the gradient magnitude of the pixel point at the coordinate (x, y) in the image, and θ(x, y) is the gradient direction of the pixel point at the coordinate (x, y) in the image. C3. Combine the changes of neighboring pixels to calculate the second - order difference of pixels to extract the sharpness information. The calculation formula is: L(x, y = I(x - 1, y+I(x, y - 1 - 4I(x, y+I(x, y + 1+I(x + 1, y, where I(x, y is the pixel value at the coordinate (x, y in the pre - processed image, I(x - 1, y is the pixel value adjacent to the left of the current pixel point (x, y, I(x, y - 1 is the pixel value adjacent to the below of the current pixel point (x, y, I(x, y + 1 is the pixel value adjacent to the above of the current pixel point (x, y, and I(x + 1, y is the pixel value adjacent to the right of the current pixel point (x, y; C4. Substitute the gradient magnitude, gradient direction, and sharpness information into a simplified edge - calculation model to obtain the edge - description value. The formula of the edge - calculation model is: E(x, y = a*M(x, y + c*θ(x, y + d*L(x, y, where a is the weight coefficient of the gradient magnitude M(x, y, c is the weight coefficient of the gradient direction θ(x, y, d is the weight coefficient of the sharpness information L(x, y, and E(x, y is the edge - description value.
8. A real-time defect detection and data processing system in sheet metal part processing according to claim 1, characterized in that: The process of the edge - detection module for identifying feature bands is as follows: D1. Use a hash table to quickly count the occurrence frequencies of different edge - description values according to the edge - description values obtained from the key - feature extraction module, and construct a histogram of the edge - description values. D2. Smooth each element in the histogram. The smoothing formula is: Where Q is the number of elements in the histogram, H(i) is the value of the histogram of the i-th element, and H(f) is the value of the histogram after smoothing; D3. According to the entire histogram data, judge whether each element in the histogram is a local peak or valley, and divide the bands based on the adjacent valleys and peaks. D4. Compare the divided bands with the known defect - feature bands in the defect - feature library, and find the bands with high similarity to the known defect - feature bands as the feature bands.
9. A real-time defect detection and data processing system in sheet metal part processing according to claim 1, characterized in that: The process of the defect - identification module for defect identification is as follows: E1. Screen out the set of edge - pixel points that may belong to defects from the edge - pixel points output by the edge - detection module. E2. Determine the region R corresponding to the set of edge pixel points, and calculate the central moments U of each order in the region R pq , and the calculation formula is as follows: Among them, and are the central coordinates of region R, x1 and y1 are the image coordinates respectively, p and q are the orders used to define the contour moments, and both are non-negative integers; E3. Compare the calculated central moment U pq with the central moment of the standard shape model without defects to calculate the similarity D between the two; E4. Set the similarity threshold D’ for judging abnormalities. When the confidence D is greater than or equal to the similarity threshold D’, it is judged that there is no defect. When the similarity D is less than the similarity threshold D’, it is determined that there is a defect, and the position of the defect is output. E5. Integrate the recognition results of the defects to generate a detailed defect - recognition report.
10. A real-time defect detection and data processing system in sheet metal part processing according to claim 9, characterized in that: When storing the defect data, the data processing and storage module first converts the defect data output by the defect recognition module into the required format of the database, then establishes a hash database index based on the key features of the defect data, and then inserts the defect data after format conversion and index establishment into the database specially designed for sheet metal part data in real time. Finally, the defect data is read from the database, and an intuitive and clear report is generated using the visualization library according to the set report template to display the defect detection results and statistical information.
Citation Information
Patent Citations
Sheet metal stamping anomaly detection method
CN115049651A