Metal appearance defect detection method and system
Through automated metal appearance defect detection methods and systems, image processing technology is used to detect defects of metal parts, solving the problems of low efficiency and low accuracy of traditional manual detection, and achieving efficient and accurate defect detection and data collection.
Patent Information
- Application Number
- CN202411520319.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional manual detection of metal appearance defects has problems such as low efficiency, low accuracy and poor stability, and low data collection efficiency and high cost.
A metal appearance defect detection method and system is adopted to collect image data of metal parts, perform image extraction processing and defect detection, and use image defect processing model to automatically detect, output OK or NG signals, and store statistical data.
Automatic detection is realized, avoiding the influence of human factors, improving detection efficiency, accuracy and stability, and reducing data collection costs.
Smart Images

Figure CN119579498A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a metal appearance defect detection method and system. Background Art
[0002] Traditionally, metal parts of cameras (such as camera outer rings or camera brackets, etc.) are mainly inspected for appearance defects manually. Long-term inspection work can easily damage employees' eyesight. At the same time, due to human factors, false detections and missed detections may easily occur, resulting in low detection efficiency and accuracy, poor stability, etc.; and the manual registration of inspection data leads to low data collection efficiency, time-consuming and labor-intensive, and high labor costs. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a metal appearance defect detection method and system, which does not require manual detection, avoids the influence of human factors, improves detection efficiency, accuracy and stability, and has high data collection efficiency and low cost.
[0004] In order to solve the above technical problems, the present invention provides a method for detecting metal appearance defects, including: collecting test image data of test metal parts of different dimensions; performing image extraction processing on the test image data to obtain test image extraction data; inputting the test image extraction data into an image defect processing model to obtain image result data; judging whether the category information in the image result data are all normal categories, if it is judged as yes, it indicates that the test metal part has no defects and outputs an OK signal, if it is judged as no, it indicates that the test metal part has defects and outputs an NG signal; storing and counting the output signal type and its corresponding image result data.
[0005] As an improvement of the above scheme, the steps of image extraction and processing include: binarizing and morphologically processing the input image data to obtain binary image data; using the Blub algorithm to perform pixel connected domain analysis on the binary image data to obtain defect area data; using the OCR character detection algorithm to perform character detection processing on the defect area data to obtain character defect area data; using the defect area data and the character defect area data as image extraction data; classifying and annotating the image extraction data and outputting it to the image defect processing model.
[0006] As an improvement of the above scheme, the image defect processing model includes an input layer, a convolution layer, a pooling layer, a feature fusion layer, a category classification layer and an output layer; the input layer receives the input image extraction data; the convolution layer performs feature extraction on the image extraction data to filter out useless information and obtain defect feature data; the pooling layer performs dimensionality reduction processing on the defect feature data; the feature fusion layer performs layer connection on the same layer with the same dimension; the category classification layer classifies the defect feature data of different layers of different dimensions output by the feature fusion layer to obtain different dimensional category information and multiple defect category information in each dimensional category information; the output layer outputs the image result data [a, b, Q q,c ], where a is the image width, b is the image height, Q q,c is the cth defect category of the qth dimension, q = [1,…, N], c = [1,…, M], N is the total number of dimension types, and M is the total number of defect categories.
[0007] As an improvement of the above scheme, the step of binarizing and morphologically processing the input image data to obtain binary image data includes: using a weighted average method to convert the input image data into grayscale to generate grayscale image data; using a mean filtering algorithm to perform filtering and denoising preprocessing on the grayscale image data; using a linear grayscale stretching algorithm to perform grayscale stretching enhancement on the grayscale image data, using a bimodal histogram threshold segmentation method to binarize the grayscale image data and extract the binary image data; performing corrosion and expansion mathematical morphological algorithm processing on the binary image data to complete the segmentation and extraction of the binary image data.
[0008] As an improvement of the above-mentioned scheme, the step of using the OCR character detection algorithm to perform character detection processing on the defect area data to obtain character defect area data includes: using CRNN-based OCR technology to perform character recognition on the defect area data to extract character features; comparing the character features with a preset threshold to obtain character defect area data.
[0009] The present invention also provides a metal appearance defect detection system, including: an acquisition module, used to acquire test image data of test metal parts of different dimensions; an image extraction module, used to perform image extraction processing on the test image data to obtain test image extraction data; an image defect processing module, used to input the test image extraction data into an image defect processing model to obtain image result data; a judgment processing module, used to judge whether the category information in the image result data is all normal categories, if it is judged as yes, it indicates that the test metal part has no defects and outputs an OK signal, if it is judged as no, it indicates that the test metal part has defects and outputs an NG signal; a statistical processing module, used to store and count the output signal types and their corresponding image result data.
[0010] As an improvement of the above-mentioned scheme, the image extraction module includes: a preprocessing unit, which is used to perform binarization and morphological processing on the input image data to obtain binary image data; a connected domain analysis unit, which is used to perform pixel connected domain analysis on the binary image data using a B lob algorithm to obtain defect area data; a character processing unit, which is used to perform character detection processing on the defect area data using an OCR character detection algorithm to obtain character defect area data; a data synthesis unit, which is used to use the defect area data and the character defect area data as image extraction data; and a classification processing unit, which is used to classify and annotate the image extraction data and output it to the image defect processing model.
[0011] As an improvement of the above scheme, the image defect processing model in the image defect processing module includes an input layer, a convolution layer, a pooling layer, a feature fusion layer, a category classification layer and an output layer; the input layer receives the input image extraction data; the convolution layer performs feature extraction on the image extraction data to filter out useless information and obtain defect feature data; the pooling layer performs dimensionality reduction processing on the defect feature data; the feature fusion layer performs layer connection on the same layer with the same dimension; the category classification layer classifies the defect feature data of different layers of different dimensions output by the feature fusion layer to obtain different dimensional category information and multiple defect category information in each dimensional category information; the output layer outputs the image result data [a, b, Q q,c ], where a is the image width, b is the image height, Q q,c is the cth defect category of the qth dimension, q = [1,…, N], c = [1,…, M], N is the total number of dimension types, and M is the total number of defect categories.
[0012] As an improvement of the above scheme, the preprocessing unit includes: a grayscale processing subunit, which is used to convert the input image data into grayscale using a weighted average method to generate grayscale image data; a filtering processing subunit, which is used to use a mean filtering algorithm to perform filtering and denoising preprocessing on the grayscale image data; a binarization processing subunit, which is used to use a linear grayscale stretching algorithm to perform grayscale stretching enhancement on the grayscale image data, and use a bimodal histogram threshold segmentation method to binarize the grayscale image data to extract the binarized image data; a morphological processing subunit, which is used to perform corrosion and expansion mathematical morphological algorithm processing on the binarized image data to complete the segmentation and extraction of the binarized image data.
[0013] As an improvement of the above scheme, the character processing unit includes: a character recognition subunit, which is used to perform character recognition on the defect area data using CRNN-based OCR technology to extract character features; a character processing subunit, which is used to compare the character features with a preset threshold to obtain character defect area data.
[0014] The implementation of the present invention has the following beneficial effects:
[0015] The metal appearance defect detection method and system of the present invention can automatically perform image defect detection processing on the test metal parts of the camera to obtain the defect data of the test metal parts, and store and count the detection data of the tested metal parts in real time to obtain the number of defective metal parts and their specific defect types and the number of normal metal parts, which is convenient for users to check through the host computer equipment. The present invention does not require human detection, avoids the influence of human factors, improves detection efficiency, accuracy and stability, and has high data collection efficiency and low cost, meeting the user's usage needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of the metal appearance defect detection method of the present invention;
[0017] Figure 2 It is a structural schematic diagram of the metal appearance defect detection system of the present invention;
[0018] Figure 3 It is a structural schematic diagram of the image extraction module of the present invention;
[0019] Figure 4 It is a structural schematic diagram of the pretreatment unit of the present invention;
[0020] Figure 5 It is a structural schematic diagram of the character processing unit of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. It is hereby stated that the directional terms such as up, down, left, right, front, back, inside, outside, etc. that appear or will appear in the text of the present invention are only based on the accompanying drawings of the present invention, and are not specific limitations of the present invention.
[0022] like Figure 1 As shown, the present invention provides a method for detecting metal appearance defects, comprising:
[0023] S1. Collect test image data of test metal parts of different dimensions;
[0024] It should be noted that multiple CCD industrial cameras are used to collect test image data of different dimensions of the test metal parts. Among them, the image collection of different dimensions at least includes the image collection of the top surface dimension, the bottom surface dimension, and multiple side dimensions around the side of the metal part at preset interval angles. By collecting test image data of different dimensions of the metal part, it is ensured that the appearance of the metal part is fully inspected, and the inspection precision and accuracy are improved.
[0025] S2, performing image extraction processing on the test image data to obtain test image extraction data;
[0026] Specifically, the steps of image extraction processing include:
[0027] Step 1: performing binarization and morphological processing on the input image data to obtain binary image data;
[0028] Among them, the step of binarizing and morphologically processing the input image data to obtain binary image data includes: using the weighted average method to convert the input image data into grayscale to generate grayscale image data; using the mean filtering algorithm to perform filtering and denoising preprocessing on the grayscale image data; using the linear grayscale stretching algorithm to perform grayscale stretching enhancement on the grayscale image data, using the bimodal histogram threshold segmentation method to binarize the grayscale image data and extract the binary image data; performing corrosion and expansion mathematical morphological algorithm processing on the binary image data to complete the segmentation and extraction of the binary image data.
[0029] Step 2: Use the Blub algorithm to perform pixel connected domain analysis on the binary image data to obtain defect area data;
[0030] It should be noted that the pixel connected domain analysis of the binary image data is performed through the Blub algorithm, and the area feature quantity of each spot area is calculated to determine whether the spot pixel area exceeds the preset threshold. If it exceeds the preset threshold, it means that there are defects such as chipping, bruises, knife marks, scratches, plating loss or bright lines in the area and the defect area data is output. If it does not exceed the preset threshold, it means that the metal product is qualified. Among them, if there are characters on the appearance, the grayscale mutation will be detected and analyzed when the area surface is detected in the image, and the area will be included in the defect area data set.
[0031] Step 3: Use an OCR character detection algorithm to perform character detection processing on the defect area data to obtain character defect area data;
[0032] It should be noted that, in case of character defects in the character area of the metal part (this step can be omitted if the metal part has no character number on the surface), the present invention uses an OCR character detection algorithm to identify the corresponding character defect area data in the defect area data set, so as to perform high-precision detection and subdivision of the defect categories, so as to facilitate corresponding remedial treatment for different defect categories.
[0033] Specifically, the step of performing character detection processing on the defective area data using an OCR character detection algorithm to obtain character defective area data includes:
[0034] Step (1), using CRNN-based OCR technology to perform character recognition on the defect area data to extract character features;
[0035] It should be noted that the CRNN-based OCR technology is used to perform character recognition on the defective area data where characters exist, so as to extract character features (such as color value, mean value, variance and extreme value of the area).
[0036] Step (ii), comparing the character feature with a preset threshold to obtain character defect area data.
[0037] It should be noted that the extracted character features are compared with the preset threshold to determine whether there are character defects. When it is determined that there are character defects, the image measurement method is used to measure the grayscale, length, width and area of the defect area and output the character defect area data. The types of character defects detected include collapse, reversal, contamination, size and character, etc.
[0038] Among them, most of the surface characters of metal machines are product numbers. The preset threshold is adjusted according to the character number of the actual metal product.
[0039] Step 4: using the defect area data and the character defect area data as image extraction data;
[0040] Step 5: classify and annotate the image extraction data and output it to the image defect processing model.
[0041] It should be noted that the defect area data and the number of character defect areas are summed up and used as image extraction data. The image extraction data is annotated with defect categories using annotation software. In addition to marking the defect information identified by quality inspection, minor and tiny defects that are lower than standard defects should also be marked as defects to ensure the completeness of the search. The annotated data should include the original image and a label file that describes the key defect target information of the image.
[0042] S3, inputting the test image extraction data into the image defect processing model to obtain image result data;
[0043] It should be noted that the test image extraction data of the test metal part is input into the trained image defect processing model, and the test image extraction data is detected by the image defect processing model to obtain image result data. The image structure data includes the original image data and the label file describing the key defect category information of the image.
[0044] Among them, the training method of the image defect processing model is to train all defect category images. The number of training iterations can be set (such as 1500 times) until the loss function loss is not significantly reduced, and the training is stopped and the corresponding model at this moment is output as the image defect processing model.
[0045] Preferably, the image defect processing model includes an input layer, a convolution layer, a pooling layer, a feature fusion layer, a category classification layer and an output layer; the input layer receives the input image extraction data; the convolution layer performs feature extraction on the image extraction data to filter out useless information and obtain defect feature data; the pooling layer performs dimensionality reduction processing on the defect feature data; the feature fusion layer performs layer connection on the same layer with the same dimension; the category classification layer classifies the defect feature data of different layers of different dimensions output by the feature fusion layer to obtain category information of different dimensions and multiple defect category information in each of the dimensional category information; the output layer outputs the image result data [a, b, Q q,c ], where a is the image width, b is the image height, Q q,c is the cth defect category of the qth dimension, q = [1,…, N], c = [1,…, M], N is the total number of dimension types, and M is the total number of defect categories.
[0046] S4, judging whether the category information in the image result data is all normal categories, if it is judged to be yes, it means that the tested metal part has no defects and outputs an OK signal, if it is judged to be no, it means that the tested metal part has defects and outputs an NG signal;
[0047] It should be noted that whether the image data is a defective category is determined by judging the category information in the output image result data. If the test image data of multiple different dimensions of the metal part are all defect-free categories, it means that the appearance of the metal part is defective and an OK signal is output; if any test image data of the metal part is a defective category, it means that the appearance of the metal part is defective and an NG signal is output.
[0048] S5. Store and count the output signal types and their corresponding image result data.
[0049] It should be noted that the inspection data of the tested metal parts are stored and counted to obtain the number of defective metal parts (NG number) and their specific defect types and the number of normal metal parts (OK number). The user can detect and review the stored image structure data of each metal part through the host computer device, and can also manually correct the incorrectly detected data. Among them, each tested metal part is sequentially provided with a product ID number.
[0050] The present invention does not require human detection, avoids the influence of human factors, improves detection efficiency, accuracy and stability, and has high data collection efficiency and low cost, meeting the user's usage needs.
[0051] like Figure 2 As shown, the present invention also provides a metal appearance defect detection system, comprising:
[0052] Acquisition module 1, used to acquire test image data of test metal parts of different dimensions;
[0053] It should be noted that multiple CCD industrial cameras are used to collect test image data of different dimensions of the test metal parts. The image collection of different dimensions at least includes the top surface dimension, the bottom surface dimension, and the image collection of multiple side dimensions around the side of the metal part at preset interval angles. By collecting test image data of different dimensions of the metal part, it is ensured that the appearance of the metal part is fully inspected, and the inspection precision and accuracy are improved.
[0054] An image extraction module 2 is used to perform image extraction processing on the test image data to obtain test image extraction data;
[0055] Specifically, Figure 3 As shown,
[0056] The image extraction module 2 comprises:
[0057] The preprocessing unit 21 is used to perform binarization processing and morphological processing on the input image data to obtain binary image data;
[0058] Among them, Figure 4 As shown, the preprocessing unit 21 includes: a grayscale processing subunit 211, which is used to use a weighted average method to perform grayscale conversion on the input image data to generate grayscale image data; a filtering processing subunit 212, which is used to use a mean filtering algorithm to perform filtering and denoising preprocessing on the grayscale image data; a binarization processing subunit 213, which is used to use a linear grayscale stretching algorithm to perform grayscale stretching enhancement on the grayscale image data, and use a bimodal histogram threshold segmentation method to binarize the grayscale image data to extract the binarized image data; a morphological processing subunit 214, which is used to perform corrosion and expansion mathematical morphological algorithm processing on the binarized image data to complete the segmentation and extraction of the binarized image data.
[0059] A connected domain analysis unit 22, configured to perform pixel connected domain analysis on the binary image data using a Blub algorithm to obtain defect area data;
[0060] It should be noted that the pixel connected domain analysis of the binary image data is performed through the Blub algorithm, and the area feature quantity of each spot area is calculated to determine whether the spot pixel area exceeds the preset threshold. If it exceeds the preset threshold, it means that there are defects such as chipping, bruises, knife marks, scratches, plating loss or bright lines in the area and the defect area data is output. If it does not exceed the preset threshold, it means that the metal product is qualified. Among them, if there are characters on the appearance, the grayscale mutation will be detected and analyzed when the area surface is detected in the image, and the area will be included in the defect area data set.
[0061] A character processing unit 23, configured to perform character detection processing on the defective area data using an OCR character detection algorithm to obtain character defective area data;
[0062] It should be noted that, in case of character defects in the character area of the metal part (this step can be omitted if the metal part has no character number on the surface), the present invention uses an OCR character detection algorithm to identify the corresponding character defect area data in the defect area data set, so as to perform high-precision detection and subdivision of the defect categories, so as to facilitate corresponding remedial treatment for different defect categories.
[0063] Among them, Figure 5 As shown, the character processing unit 23 includes:
[0064] The character recognition subunit 231 is used to perform character recognition on the defect area data using the CRNN-based OCR technology to extract character features;
[0065] It should be noted that the CRNN-based OCR technology is used to perform character recognition on the defective area data where characters exist, so as to extract character features (such as color value, mean value, variance and extreme value of the area).
[0066] The character processing subunit 232 is used to compare the character feature with a preset threshold to obtain character defect area data.
[0067] It should be noted that the extracted character features are compared with the preset threshold to determine whether there are character defects. When it is determined that there are character defects, the image measurement method is used to measure the grayscale, length, width and area of the defect area and output the character defect area data. The types of character defects detected include collapse, reversal, contamination, size and character, etc.
[0068] Among them, most of the surface characters of metal machines are product numbers. The preset threshold is adjusted according to the character number of the actual metal product.
[0069] A data synthesis unit 24, used to use the defect area data and the character defect area data as image extraction data;
[0070] The classification processing unit 25 is used to classify and annotate the image extraction data and output it to the image defect processing model.
[0071] It should be noted that the defect area data and the number of character defect areas are summed up and used as image extraction data. The image extraction data is annotated with defect categories using annotation software. In addition to marking the defect information identified by quality inspection, minor and tiny defects that are lower than standard defects should also be marked as defects to ensure the completeness of the search. The annotated data should include the original image and a label file that describes the key defect target information of the image.
[0072] An image defect processing module 3, used for inputting the test image extraction data into the image defect processing model to obtain image result data;
[0073] It should be noted that the test image extraction data of the test metal part is input into the trained image defect processing model, and the test image extraction data is detected by the image defect processing model to obtain image result data. The image structure data includes the original image data and the label file describing the key defect category information of the image.
[0074] Among them, the training method of the image defect processing model is to train all defect category images. The number of training iterations can be set (such as 1500 times) until the loss function loss is not significantly reduced, and the training is stopped and the corresponding model at this moment is output as the image defect processing model.
[0075] Preferably, the image defect processing model in the image defect processing module 3 includes an input layer, a convolution layer, a pooling layer, a feature fusion layer, a category classification layer and an output layer; the input layer receives the input image extraction data; the convolution layer performs feature extraction on the image extraction data to filter out useless information and obtain defect feature data; the pooling layer performs dimensionality reduction processing on the defect feature data; the feature fusion layer performs layer connection on the same layer with the same dimension; the category classification layer classifies the defect feature data of different layers of different dimensions output by the feature fusion layer to obtain different dimensional category information and multiple defect category information in each dimensional category information; the output layer outputs the image result data [a, b, Q q,c ], where a is the image width, b is the image height, Q q,c is the cth defect category of the qth dimension, q = [1,…, N], c = [1,…, M], N is the total number of dimension types, and M is the total number of defect categories.
[0076] A judgment processing module 4 is used to judge whether the category information in the image result data is all normal categories. If it is judged to be yes, it means that the tested metal part has no defects and outputs an OK signal. If it is judged to be no, it means that the tested metal part has defects and outputs an NG signal.
[0077] It should be noted that whether the image data is a defective category is determined by judging the category information in the output image result data. If the test image data of multiple different dimensions of the metal part are all defect-free categories, it means that the appearance of the metal part is defective and an OK signal is output; if any test image data of the metal part is a defective category, it means that the appearance of the metal part is defective and an NG signal is output.
[0078] The statistical processing module 5 is used to store and count the output signal types and their corresponding image result data.
[0079] It should be noted that the inspection data of the tested metal parts are stored and counted to obtain the number of defective metal parts (NG number) and their specific defect types and the number of normal metal parts (OK number). The user can detect and review the stored image structure data of each metal part through the host computer device, and can also manually correct the incorrectly detected data. Among them, each tested metal part is sequentially provided with a product ID number.
[0080] The metal appearance defect detection method and system of the present invention can automatically perform image defect detection processing on the test metal parts of the camera to obtain the defect data of the test metal parts, and store and count the detection data of the tested metal parts in real time to obtain the number of defective metal parts and their specific defect types and the number of normal metal parts, which is convenient for users to check through the host computer equipment. The present invention does not require human detection, avoids the influence of human factors, improves detection efficiency, accuracy and stability, and has high data collection efficiency and low cost, meeting the user's usage needs.
[0081] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for detecting metal appearance defects, characterized in that: include: Collect test image data of test metal parts of different dimensions; Performing image extraction processing on the test image data to obtain test image extraction data; Inputting the test image extraction data into an image defect processing model to obtain image result data; Determine whether the category information in the image result data is all normal categories, if it is determined to be yes, it means that the test metal part has no defects and an OK signal is output, if it is determined to be no, it means that the test metal part has defects and an NG signal is output; Store and count the output signal types and their corresponding image result data.
2. The metal appearance defect detection method according to claim 1, characterized in that: The steps of image extraction processing include: Performing binarization and morphological processing on the input image data to obtain binary image data; Perform pixel connected domain analysis on the binary image data using a Blob algorithm to obtain defect area data; Performing character detection processing on the defective area data using an OCR character detection algorithm to obtain character defective area data; using the defect area data and the character defect area data as image extraction data; The image extraction data is classified and labeled and output to the image defect processing model.
3. The metal appearance defect detection method according to claim 1, characterized in that: The image defect processing model includes an input layer, a convolution layer, a pooling layer, a feature fusion layer, a category classification layer and an output layer; The input layer receives the input image extraction data; The convolution layer performs feature extraction on the image extraction data to filter out useless information and obtain defect feature data; The pooling layer performs dimensionality reduction processing on the defect feature data; The feature fusion layer is to connect the same layers with the same dimension; The category classification layer classifies the defect feature data of different layers of different dimensions output by the feature fusion layer to obtain category information of different dimensions and multiple defect category information in each of the category information of the dimension; The output layer outputs the image result data [a, b, Q q,c ], where a is the image width, b is the image height, Q q,c is the cth defect category of the qth dimension, q = [1,…, N], c = [1,…, M], N is the total number of dimension types, and M is the total number of defect categories.
4. The metal appearance defect detection method according to claim 2, characterized in that: The step of performing binarization processing and morphological processing on the input image data to obtain binary image data comprises: The input image data is converted into grayscale using the weighted average method to generate grayscale image data; Perform filtering and denoising preprocessing on the grayscale image data using a mean filtering algorithm; Performing grayscale stretching enhancement on the grayscale image data using a linear grayscale stretching algorithm, performing binarization processing on the grayscale image data using a bimodal histogram threshold segmentation method, and extracting the binarized image data; The binary image data is processed by erosion and expansion mathematical morphology algorithms to complete the segmentation and extraction of the binary image data.
5. The metal appearance defect detection method according to claim 2, characterized in that: The step of performing character detection processing on the defective area data using an OCR character detection algorithm to obtain character defective area data comprises: Using CRNN-based OCR technology to perform character recognition on the defect area data to extract character features; The character feature is compared with a preset threshold to obtain character defect area data.
6. A metal appearance defect detection system, characterized in that: include: An acquisition module, used for acquiring test image data of test metal parts of different dimensions; An image extraction module is used to perform image extraction processing on the test image data to obtain test image extraction data; An image defect processing module, used for inputting the test image extraction data into an image defect processing model to obtain image result data; A judgment processing module, used for judging whether the category information in the image result data is all normal categories, if it is judged to be yes, it means that the tested metal part has no defects and outputs an OK signal, if it is judged to be no, it means that the tested metal part has defects and outputs an NG signal; The statistical processing module is used to store and count the output signal types and their corresponding image result data.
7. The metal appearance defect detection system according to claim 6, characterized in that: The image extraction module comprises: A preprocessing unit, used for performing binarization processing and morphological processing on the input image data to obtain binary image data; A connected domain analysis unit, used for performing pixel connected domain analysis on the binary image data using a Blob algorithm to obtain defect area data; A character processing unit, used for performing character detection processing on the defective area data using an OCR character detection algorithm to obtain character defective area data; A data synthesis unit, used for taking the defect area data and the character defect area data as image extraction data; A classification processing unit is used to classify and annotate the image extraction data and output it to the image defect processing model.
8. The metal appearance defect detection system according to claim 6, characterized in that: The image defect processing model in the image defect processing module includes an input layer, a convolution layer, a pooling layer, a feature fusion layer, a category classification layer and an output layer; The input layer receives the input image extraction data; The convolution layer performs feature extraction on the image extraction data to filter out useless information and obtain defect feature data; The pooling layer performs dimensionality reduction processing on the defect feature data; The feature fusion layer is to connect the same layers with the same dimension; The category classification layer classifies the defect feature data of different layers of different dimensions output by the feature fusion layer to obtain category information of different dimensions and multiple defect category information in each of the category information of the dimension; The output layer outputs the image result data [a, b, Q q,c ], where a is the image width, b is the image height, Q q,c is the cth defect category of the qth dimension, q = [1,…, N], c = [1,…, M], N is the total number of dimension types, and M is the total number of defect categories.
9. The metal appearance defect detection system according to claim 7, characterized in that: The pre-processing unit comprises: A grayscale processing subunit, used for grayscale conversion of input image data by using a weighted average method to generate grayscale image data; A filtering processing subunit, used for performing filtering and denoising preprocessing on the grayscale image data using a mean filtering algorithm; A binarization processing subunit is used to perform grayscale stretching enhancement on the grayscale image data using a linear grayscale stretching algorithm, perform binarization processing on the grayscale image data using a bimodal histogram threshold segmentation method, and extract the binarized image data; The morphological processing subunit is used to perform erosion and expansion mathematical morphological algorithm processing on the binary image data to complete the segmentation and extraction of the binary image data.
10. The metal appearance defect detection system according to claim 7, characterized in that: The character processing unit comprises: A character recognition subunit, used for performing character recognition on the defective area data by using the CRNN-based OCR technology to extract character features; The character processing subunit is used to compare the character feature with a preset threshold value to obtain character defect area data.
Citation Information
Patent Citations
Product defect detection method
CN111951238A
Defect detection method and device, electronic equipment and storage medium
CN115294025A
Steel detection method and system based on deep learning
CN116309277A