Stamping part defect detection system based on machine vision
Through the stamping defect detection system based on machine vision, using technologies such as image acquisition, preprocessing and convolutional neural networks, the problems of slow speed and unstable quality of traditional manual detection methods are solved, and the stamping defect detection is achieved fast and high accuracy.
Patent Information
- Application Number
- CN202510004605.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Due to subjective judgment errors and backward technology, traditional manual detection methods lead to slow detection speed, unstable quality, difficult defect identification and low detection efficiency of stamping parts.
A stamping part defect detection system based on machine vision is adopted, including a stamping part image acquisition module, a preprocessing module, a defect detection module and a defect type identification module. Through image acquisition, threshold segmentation, morphological processing, scale deviation calculation and convolutional neural network feature extraction, rapid and accurate detection of stamped part defects is achieved.
It realizes the fast speed and high accuracy of stamping parts defect detection, can accurately detect unqualified products and identify their types, and has the advantages of high detection power and high accuracy.
Smart Images

Figure CN120031799A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of stamping part defect detection, and in particular to a stamping part defect detection system based on machine vision. Background Art
[0002] As manufacturers have increasingly higher requirements for improving the productivity of stamping parts, quality inspection of stamping parts, as an important part of the production process, needs to meet the requirements of fast speed and high precision.
[0003] Traditional industrial manufacturing still mainly uses manual inspection methods to detect surface defects of products. This method is slow to detect products due to subjective judgment errors and backward technology. It also has problems such as unstable inspection quality, difficulty in identifying defects and low inspection efficiency. Therefore, we propose a stamping defect inspection system based on machine vision to solve the above-mentioned problems. Summary of the invention
[0004] The purpose of the present invention is to provide a stamping part defect detection system based on machine vision to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A stamping part defect detection system based on machine vision comprises a stamping part image acquisition module, a preprocessing module, a defect detection module and a defect type recognition module; the stamping part image acquisition module is used to acquire the photographed stamping part image; the preprocessing module is used to perform threshold segmentation and morphological processing on the image acquired by the stamping part image acquisition module; after the defect detection module preprocesses the stamping part image, it extracts non-background pixel points in each stamping part edge image as possible edge points, and calculates the scale of each possible edge point in the stamping part edge image at the corresponding scale by combining the pixel values of the possible edge points and the pixel points in their eight neighborhoods. degree deviation; the actual coordinate position of each edge pixel point on the edge of the stamping part is obtained according to the coordinate position and scale deviation of each possible edge point in the stamping part edge image, and the defects of the stamping part are detected by matching the actual coordinate position of the edge pixel point of the stamping part with the standard position of each standard edge pixel point in the template image; the defect type recognition module uses a feature extraction method based on a convolutional neural network to identify the defect type on the surface of the stamping part; the stamping part image acquisition module is connected to a preprocessing module, the preprocessing module is connected to a defect detection module, and the defect detection module is connected to a defect type recognition module.
[0007] As a further solution of the present invention: the specific preprocessing process of the preprocessing module is as follows: first, the collected grayscale image of the stamping part is converted into a binary image through fixed threshold segmentation, and the region of interest is extracted; the binary image is subjected to morphological processing of opening and closing operations to remove noise.
[0008] As a further solution of the present invention: the preprocessing module includes a threshold segmentation unit and a morphological processing unit. The threshold segmentation unit gives a certain threshold, compares the grayscale value of each pixel with the threshold, and divides the image data into two parts, a pixel group greater than the threshold and a pixel group less than the threshold.
[0009] As a further solution of the present invention: the specific process of the morphological processing is as follows: performing an opening operation on the stamping part image to eliminate the noise in the image background; performing a closing operation on the stamping part image to eliminate the noise in the stamping part surface image.
[0010] As a further solution of the present invention: In the defect detection module, a method for obtaining the actual coordinate position of each edge pixel point corresponding to the edge of the stamping part according to the coordinate position and scale deviation in the stamping part edge image where each possible edge point is located, comprises: extracting the coordinate position of each possible edge point on different stamping part edge images, placing the scale deviations of the corresponding possible edge points at the same coordinate position in a set, and for each set, constructing a scale deviation change curve of the possible edge points at the corresponding coordinate position of each set with the scale of the LOG operator as the horizontal axis and the scale deviation as the vertical axis; obtaining the reference edge pixel point of each edge of the stamping part according to the scale deviation change curve; and obtaining the actual coordinate position of other edge pixel points on the corresponding edge based on the reference edge pixel point.
[0011] As a further solution of the present invention: the defect types in the defect type identification module include point feature defects and line feature defects. A multi-scale sparse basis is constructed for the isotropy of point feature defects, and a multi-scale geometric analysis basis is constructed for the anisotropy of line feature defects, so as to achieve the purpose of enhancing defect characteristics and improve the accuracy of defect detection.
[0012] As a further solution of the present invention: the specific steps of the defect type recognition module are: collecting a large number of labeled stamping part images and corresponding defect location and type data as training samples for feature learning; preprocessing the training images and extracting image blocks for learning; for point defect image blocks, using MRBM neural network for unsupervised learning to extract multi-layer sparse representations; for linear defect image blocks, using convolutional autoencoder network for unsupervised learning to extract geometric distribution features of various scales; saving the learned feature library corresponding to the defect type label; extracting all features of the new image using a pre-trained feature extraction network; and using feature matching classifier to determine what type of defect the new image features belong to.
[0013] As a further solution of the present invention: the method for obtaining the actual coordinate positions of other edge pixel points on the corresponding edge based on the reference edge pixel point includes: taking the reference edge pixel point as the first adaptive edge point of each edge, and searching for the next adjacent adaptive edge point with the adaptive edge point as the starting point until all adaptive edge points corresponding to each edge are found.
[0014] As a further solution of the present invention: the method for obtaining the adjacent next adaptive edge point includes: obtaining the gradient direction of the current adaptive edge point, and dividing eight pixel points in the eight neighborhoods of the current adaptive edge point into two parts based on the gradient direction; each part represents the position direction of the adjacent next adaptive edge point connected to the current adaptive edge point in a single direction; and confirming the adjacent next adaptive edge point connected to the current adaptive edge point according to the number of possible edge points in each part.
[0015] As a further solution of the present invention: the stamping part image acquisition module is used to acquire the photographed stamping part image, and the image acquisition device includes a high-resolution camera and a light source device.
[0016] Compared with the prior art, the present invention has the following beneficial effects:
[0017] The stamping parts defect detection system based on machine vision collects small-scale stamping parts images, performs fixed threshold segmentation on the grayscale images, and converts them into binary images. The image is preprocessed to remove noise using the opening and closing operations of morphological processing. At the same time, the edges of the stamping parts are detected using LOG operators of different scales. The actual coordinate positions of all edge pixels of the stamping parts can be obtained through the different responses of the edges of the stamping parts at different positions to the LOG operators of the same scale. Matching the actual coordinate positions with the standard positions in the template image can ensure the accuracy of the matching, thereby making the defect detection results of the stamping parts more accurate. Unqualified products can be accurately detected and the types of unqualified products can be identified, with the advantages of high detection power and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a structural schematic diagram of the stamping part defect detection system based on machine vision of the present invention.
[0019] Figure 2 It is a structural schematic diagram of the preprocessing module in the present invention. DETAILED DESCRIPTION
[0020] In one embodiment, Figure 1-Figure 2As shown in the figure, a stamping part defect detection system based on machine vision includes a stamping part image acquisition module, a preprocessing module, a defect detection module, and a defect type recognition module. The stamping part image acquisition module is used to collect the captured stamping part images. The preprocessing module is used to perform threshold segmentation and morphological processing on the images collected by the stamping part image acquisition module. After the stamping part images are preprocessed by the defect detection module, non-background pixel points in each stamping part edge image are extracted as possible edge points, and the scale deviation of each possible edge point in the corresponding stamping part edge image at the corresponding scale is calculated by combining the pixel values of the possible edge points and the pixel points in their eight-neighborhoods. According to the coordinate position and scale deviation of each possible edge point in the stamping part edge image, the actual coordinate position of each edge pixel point corresponding to the stamping part edge is obtained, and the defects of the stamping part are detected by matching the actual coordinate positions of the edge pixel points of the stamping part with the standard positions of the standard edge pixel points in the template image. The defect type recognition module uses a feature extraction method based on a convolutional neural network to identify the defect types on the surface of the stamping part. The stamping part image acquisition module is connected to the preprocessing module, the preprocessing module is connected to the defect detection module, and the defect detection module is connected to the defect type recognition module;
[0021] The specific process of preprocessing by the preprocessing module is as follows: First, the collected grayscale image of the stamping part is converted into a binary image through fixed threshold segmentation, and the region of interest is extracted. Morphological processing of opening and closing operations is performed on the binary image to remove noise;
[0022] The preprocessing module includes a threshold segmentation unit and a morphological processing unit. The threshold segmentation unit gives a determined threshold, compares the grayscale value of each pixel with the threshold, and divides the data of the image into two parts, the pixel group greater than the threshold and the pixel group less than the threshold;
[0023] The specific process of morphological processing is as follows: An opening operation (erosion first and then dilation) is performed on the stamping part image to eliminate the noise in the image background. A closing operation (erosion first and then dilation) is performed on the stamping part image to eliminate the noise in the stamping part surface image;
[0024] In the defect detection module, a method for obtaining the actual coordinate position of each edge pixel point corresponding to the edge of the stamping part according to the coordinate position and scale deviation in the stamping part edge image where each possible edge point is located, comprising: extracting the coordinate position of each possible edge point on different stamping part edge images, placing the scale deviations of the corresponding possible edge points at the same coordinate position in a set, and for each set, constructing a scale deviation change curve of the possible edge points at the corresponding coordinate position of each set with the scale of the LOG operator as the horizontal axis and the scale deviation as the vertical axis; obtaining the reference edge pixel point of each edge of the stamping part according to the scale deviation change curve; and obtaining the actual coordinate position of other edge pixel points on the corresponding edge based on the reference edge pixel point;
[0025] The defect types in the defect type recognition module include point feature defects and line feature defects. A multi-scale sparse basis is constructed for the isotropy of point feature defects, and a multi-scale geometric analysis basis is constructed for the anisotropy of line feature defects, so as to enhance the defect features and improve the accuracy of defect detection.
[0026] The specific steps of the defect type recognition module are as follows: collect a large number of annotated stamping parts images and corresponding defect location and type data as training samples for feature learning; preprocess the training images, such as standardization and cropping, and extract image blocks for learning; for point defect image blocks, use the MRBM neural network for unsupervised learning to extract multi-layer sparse representations; for linear defect image blocks, use the convolutional autoencoder network for unsupervised learning to extract geometric distribution features of each scale; save the learned feature library corresponding to the defect type label; use the pre-trained feature extraction network to extract all features of the new image; feature matching classifiers, such as SVM, determine what type of defect the new image features belong to;
[0027] The method for obtaining the actual coordinate positions of other edge pixel points on the corresponding edge based on the reference edge pixel point includes: taking the reference edge pixel point as the first adaptive edge point of each edge, and searching for the next adjacent adaptive edge point with the adaptive edge point as the starting point, until all adaptive edge points corresponding to each edge are found;
[0028] The method for obtaining the next adjacent adaptive edge point comprises: obtaining the gradient direction of the current adaptive edge point, dividing eight pixel points in the eight neighborhoods of the current adaptive edge point into two parts based on the gradient direction; each part represents the position direction of the next adjacent adaptive edge point connected to the current adaptive edge point in one direction; and confirming the next adjacent adaptive edge point connected to the current adaptive edge point according to the number of possible edge points in each part;
[0029] The stamping part image acquisition module is used to acquire the photographed stamping part images, and the image acquisition equipment includes a high-resolution camera and a light source device.
[0030] The present invention collects small-scale stamping part images, performs fixed threshold segmentation on the grayscale images, and converts them into binary images. The image is preprocessed to remove noise using the opening and closing operations of morphological processing. At the same time, the edges of the stamping parts are detected using LOG operators of different scales. The actual coordinate positions of all edge pixels of the stamping parts can be obtained through the different responses of the edges of the stamping parts at different positions to the LOG operators of the same scale. The actual coordinate positions are matched with the standard positions in the template image to ensure the accuracy of the matching, thereby making the defect detection results of the stamping parts more accurate. Unqualified products can be accurately detected, and the types of unqualified products can be identified, with the advantages of high detection power and high accuracy.
[0031] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A stamping parts defect detection system based on machine vision, characterized in that: It includes a stamping part image acquisition module, a preprocessing module, a defect detection module, and a defect type recognition module; the stamping part image acquisition module is used to acquire the stamping part image; the preprocessing module is used to perform threshold segmentation and morphological processing on the image acquired by the stamping part image acquisition module; After preprocessing the stamping part image, the defect detection module extracts non-background pixels in each stamping part edge image as possible edge points, and calculates the scale deviation of each possible edge point in the stamping part edge image to which it belongs at the corresponding scale by combining the pixel values of the possible edge points and the pixels in their eight neighborhoods; the actual coordinate position of each edge pixel corresponding to the stamping part edge is obtained according to the coordinate position and scale deviation in the stamping part edge image where each possible edge point is located, and the defects of the stamping part are detected by matching the actual coordinate position of the edge pixel of the stamping part with the standard position of each standard edge pixel in the template image; the defect type recognition module uses a feature extraction method based on a convolutional neural network to identify the defect type on the surface of the stamping part; the stamping part image acquisition module is connected to the preprocessing module, the preprocessing module is connected to the defect detection module, and the defect detection module is connected to the defect type recognition module.
2. According to claim 1, a stamping part defect detection system based on machine vision is characterized in that: The specific process of preprocessing in the preprocessing module is as follows: first, the collected grayscale image of the stamping part is converted into a binary image through fixed threshold segmentation to extract the region of interest; and the binary image is subjected to morphological processing of opening and closing operations to remove noise.
3. A stamping part defect detection system based on machine vision according to claim 2, characterized in that: The preprocessing module includes a threshold segmentation unit and a morphological processing unit. The threshold segmentation unit gives a certain threshold, compares the grayscale value of each pixel with the threshold, and divides the image data into two parts, a pixel group greater than the threshold and a pixel group less than the threshold.
4. A stamping part defect detection system based on machine vision according to claim 3, characterized in that: The specific process of the morphological processing is as follows: an opening operation is performed on the stamping part image to eliminate the noise in the image background; and a closing operation is performed on the stamping part image to eliminate the noise in the stamping part surface image.
5. The machine vision-based stamping part defect detection system according to claim 1, characterized in that: In the defect detection module, a method for obtaining the actual coordinate position of each edge pixel point corresponding to the edge of the stamping part according to the coordinate position and scale deviation in the stamping part edge image where each possible edge point is located includes: extracting the coordinate position of each possible edge point on different stamping part edge images, placing the scale deviations of the corresponding possible edge points at the same coordinate position in a set, and for each set, constructing a scale deviation change curve of the possible edge points at the corresponding coordinate position of each set with the scale of the LOG operator as the horizontal axis and the scale deviation as the vertical axis; obtaining the reference edge pixel point of each edge of the stamping part according to the scale deviation change curve; and obtaining the actual coordinate position of other edge pixel points on the corresponding edge based on the reference edge pixel point.
6. The machine vision-based stamping part defect detection system according to claim 1, characterized in that: The defect types in the defect type identification module include point feature defects and line feature defects. A multi-scale sparse basis is constructed for the isotropy of point feature defects, and a multi-scale geometric analysis basis is constructed for the anisotropy of line feature defects, so as to enhance the defect features and improve the accuracy of defect detection.
7. A stamping part defect detection system based on machine vision according to claim 6, characterized in that: The specific steps of the defect type recognition module are: collecting a large number of annotated stamping part images and corresponding defect location and type data as training samples for feature learning; preprocessing the training images and extracting image blocks for learning; For point defect image blocks, the MRBM neural network is used for unsupervised learning to extract multi-layer sparse representations; for linear defect image blocks, the convolutional autoencoder network is used for unsupervised learning to extract geometric distribution features at various scales; The learned feature library is saved corresponding to the defect type label; the pre-trained feature extraction network is used to extract all features of the new image; Feature matching classifier determines what defect type the new image feature belongs to.
8. The machine vision-based stamping part defect detection system according to claim 5, characterized in that: The method for obtaining the actual coordinate positions of other edge pixel points on the corresponding edge based on the reference edge pixel point includes: taking the reference edge pixel point as the first adaptive edge point of each edge, and searching for the next adjacent adaptive edge point with the adaptive edge point as the starting point, until all adaptive edge points corresponding to each edge are found.
9. The machine vision-based stamping parts defect detection system according to claim 8, characterized in that: The method for acquiring the adjacent next adaptive edge point comprises: acquiring the gradient direction of the current adaptive edge point, dividing eight pixel points in the eight neighborhoods of the current adaptive edge point into two parts based on the gradient direction; each part represents the position direction of the adjacent next adaptive edge point connected to the current adaptive edge point in one direction; and confirming the adjacent next adaptive edge point connected to the current adaptive edge point according to the number of possible edge points in each part.
10. The machine vision-based stamping part defect detection system according to claim 1, characterized in that: The stamping part image acquisition module is used to acquire the photographed stamping part image, and the image acquisition equipment includes a high-resolution camera and a light source equipment.
Citation Information
Cited By
Method and device for quantifying morphology deviation degree of closed curve type defects
CN121033050A
A method and device for quantifying the morphology deviation of a closed curve type defect
CN121033050B
Automatic detection method and system for forming size of hardware stamping part of automobile seat
CN121163376A
An automated method and system for detecting the forming dimensions of automotive seat hardware stamping parts
CN121163376B