CN113935966B - Slag point detection method, device and equipment for metal material and storage medium - Google Patents
Slag point detection method, device and equipment for metal material and storage medium Download PDFInfo
- Publication number
- CN113935966B CN113935966B CN202111193563.3A CN202111193563A CN113935966B CN 113935966 B CN113935966 B CN 113935966B CN 202111193563 A CN202111193563 A CN 202111193563A CN 113935966 B CN113935966 B CN 113935966B
- Authority
- CN
- China
- Prior art keywords
- image
- light source
- annular light
- metal material
- neural network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 239000007769 metal material Substances 0.000 title claims abstract description 98
- 238000001514 detection method Methods 0.000 title claims abstract description 75
- 239000002893 slag Substances 0.000 title claims abstract description 57
- 238000003062 neural network model Methods 0.000 claims abstract description 64
- 238000012545 processing Methods 0.000 claims abstract description 60
- 238000000034 method Methods 0.000 claims abstract description 48
- 238000012360 testing method Methods 0.000 claims description 52
- 238000012549 training Methods 0.000 claims description 43
- 238000007781 pre-processing Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 13
- 238000001914 filtration Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 5
- 229910052782 aluminium Inorganic materials 0.000 description 2
- XAGFODPZIPBFFR-UHFFFAOYSA-N aluminium Chemical compound [Al] XAGFODPZIPBFFR-UHFFFAOYSA-N 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 229910052751 metal Inorganic materials 0.000 description 2
- 239000002184 metal Substances 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 239000002994 raw material Substances 0.000 description 1
- 230000004043 responsiveness Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G06T5/70—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
- G06T2207/20032—Median filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30136—Metal
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The application relates to a slag point detection method, a slag point detection device, slag point detection equipment and a storage medium for metal materials. The slag point detection method of the metal material comprises the following steps: acquiring a cross-sectional image of a metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of metal materials to be detected placed in the backlight source; the annular light source image is obtained by image acquisition of a metal material to be detected which is arranged in the annular light source; performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image; determining the binarized image as a mask image of the annular light source image, and performing image processing on the annular light source image according to the mask image to obtain a pure background image; and processing the pure background image by adopting a preset neural network model, and outputting a slag point detection result.
Description
Technical Field
The application relates to the technical field of metal slag content detection, in particular to a slag point detection method, a slag point detection device, slag point detection equipment and a storage medium of a metal material.
Background
In the quality detection of metal raw materials, the number of slag points in a cross section is replaced by machine vision and image processing. The quality of the aluminum ingot section slag point detection effect through machine vision and image processing is greatly dependent on the rationality of the detection device and the accuracy and responsiveness of the detection method.
In the implementation process, the inventor finds that at least the following problems exist in the conventional technology: the traditional detection technology can not achieve the cost and the detection precision.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a slag point detection method, apparatus, device, and storage medium for a metal material that can achieve both cost and detection accuracy.
In order to achieve the above object, in one aspect, an embodiment of the present invention provides a slag point detection method for a metal material, including the steps of:
acquiring a cross-sectional image of a metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of metal materials to be detected placed in the backlight source; the annular light source image is obtained by image acquisition of a metal material to be detected which is arranged in the annular light source;
performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
determining the binarized image as a mask image of the annular light source image, and performing image processing on the annular light source image according to the mask image to obtain a pure background image;
and processing the pure background image by adopting a preset neural network model, and outputting a slag point detection result.
In one embodiment, the step of performing image processing on the annular light source image according to the mask image to obtain a pure background image includes:
superimposing a mask image on the annular light source image;
and determining the superposition position of pixels with the pixel values of the first set value in the mask image, and adjusting the value of the pixels at the superposition position in the annular light source image to the second set value to obtain the pure background image.
In one embodiment, before the step of performing binarization processing on the backlight source image by using the oxford method, the method further includes:
preprocessing a backlight source image to obtain a preprocessed image;
the step of carrying out binarization processing on the backlight source image by adopting the Ojin method to obtain a binarized image comprises the following steps:
determining a binarization threshold value of the preprocessed image by adopting an Ojin method;
and setting the value of the pixel point with the pixel value larger than the binarization threshold value in the preprocessed image as a second set value, and setting the pixel point with the pixel value smaller than or equal to the binarization threshold value in the preprocessed image as a first set value, so as to obtain the binarization image.
In one embodiment, the step of preprocessing the backlight image to obtain a preprocessed image comprises:
and carrying out median filtering treatment on the backlight source image to obtain a preprocessed image.
In one embodiment, the method further comprises the steps of:
acquiring a plurality of test backlight images and test annular light source images of the test metal materials;
performing image processing on each test backlight source image and each test annular light source image to obtain a plurality of pure background test images;
generating a training set and a testing set according to each pure background testing image;
training the first neural network model by adopting a training set to obtain a second neural network model;
determining a second neural network model with the detection accuracy greater than a preset value as a preset neural network model; the detection accuracy is obtained by detecting the test set by the second neural network model.
In one embodiment, the learning rate of the next training algebra of the first neural network model is obtained according to the learning rate, the learning decay rate, the current training algebra and the total training algebra of the current training algebra of the first neural network model.
In one embodiment, the learning rate of the first neural network model is derived based on the following formula:
wherein lr is the learning rate of the next training algebra of the first neural network model; lr (lr) base Algebraic for the current training of the first neural network model; alpha is learning attenuation rate, and the value of the learning attenuation rate is smaller than 1; epoch is the current training algebra and n_epoch is the total training algebra.
In one aspect, an embodiment of the present invention further provides a slag point detection device for a metal material, including:
the image acquisition module is used for acquiring a cross-section image of the metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of metal materials to be detected placed in the backlight source; the annular light source image is obtained by image acquisition of a metal material to be detected which is arranged in the annular light source;
the binarization processing module is used for performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
the image processing module is used for determining the binarized image as a mask image of the annular light source image, and performing image processing on the annular light source image according to the mask image to obtain a pure background image;
and the result output module is used for processing the pure background image by adopting a preset neural network model and outputting a slag point detection result.
In one aspect, the embodiment of the invention also provides slag point detection equipment for metal materials, which comprises a memory, a processor, an image acquisition device, a backlight source, an annular light source and a switching-on device, wherein the memory stores a computer program; the switching-off device is used for controlling the on or off of the backlight source and also controlling the on or off of the annular light source; the processor is connected with the image acquisition equipment; the backlight source is arranged below the metal material to be tested; the annular light source is arranged around the periphery of the metal material to be measured;
the steps of any of the methods described above are carried out by the processor when executing the computer program.
In another aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods described above.
One of the above technical solutions has the following advantages and beneficial effects:
according to the slag point detection method for the metal material, the backlight source image and the annular light source image of the metal material to be detected are obtained, the backlight source image is subjected to binarization processing by adopting the Ojin method, the binarization image is used as a mask image of the annular light source image, and the obtained mask image can completely divide the cross section area, so that compared with the traditional technology, the certainty is high. And obtaining a pure background image based on the mask image and the annular light source image. And processing the pure background image by adopting a preset neural network model to output a slag point detection result. The binary image is used as a mask of the annular light source image, the obtained pure background image can better protrude slag points of the metal material to be detected, interference of interference factors on detection is reduced, and therefore the slag point detection accuracy of the metal material to be detected is improved. Compared with the traditional method for detecting by adopting microscopic components of metallographic structures, the method has the advantage of low cost, and the detection efficiency and the detection accuracy can be effectively improved by processing the pure background image through the preset neural network model.
Drawings
The foregoing and other objects, features and advantages of the present application will be apparent from the more particular description of the preferred embodiments of the present application as illustrated in the accompanying drawings. Like reference numerals refer to like parts throughout the drawings, and the drawings are not intentionally drawn to scale on actual size or the like, emphasis instead being placed upon illustrating the subject matter of the present application.
FIG. 1 is a first schematic flow diagram of a slag point detection method of a metal material in one embodiment;
FIG. 2 is a flowchart of a step of performing binarization processing on a backlight image by using the Ojin method to obtain a binarized image in one embodiment;
FIG. 3 is a flowchart illustrating steps for acquiring a predetermined neural network model according to an embodiment;
FIG. 4 is a schematic diagram of a confusion matrix of performance indicators of detection results in one embodiment;
FIG. 5 is a block diagram of a slag point detection device for metal materials in one embodiment;
fig. 6 is a block diagram of a slag point detecting apparatus of a metal material in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The current methods for slag point detection mainly comprise two modes: the first is to detect by using microscopic components of metallographic structure, but the requirements on the precision of equipment are very high, and the device cost is high; the second is to use machine learning for feature extraction and then classification, however, because of the rough earlier image processing and poor machine learning model, the model generalizing ability is poor or overfitting is caused.
The slag point detection method for the metal materials can effectively solve the problems.
In one embodiment, as shown in fig. 1, a slag point detection method of a metal material is provided, which includes the steps of:
s110, acquiring a cross-sectional image of a metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of metal materials to be detected placed in the backlight source; the annular light source image is obtained by image acquisition of a metal material to be detected which is arranged in the annular light source;
the metal material to be measured can be metal materials such as aluminum ingots. The cross-section image of the metal material to be measured can be an image of any surface of the metal material, or can be an image of a cross section formed after the metal material to be measured is cut. The cross-sectional image comprises a backlight image and an annular light source, and the cross-sectional image respectively refers to images which are collected in the backlight and the annular light source aiming at the metal materials. The backlight source is a light source for providing backlight for the metal material to be tested, and the annular light source is a light source for providing annular light for the metal material to be tested. In general, a metal material to be measured is disposed between an image capturing device for capturing an image of a backlight source and the backlight source. The annular light source is arranged around the periphery of the metal material to be measured, and can provide light for the metal material to be measured from the periphery of the metal material to be measured.
Specifically, the cross-sectional image of the metal material to be measured may be obtained by any means in the art. In one example, the sectional images of the metal material to be measured can be directly acquired by an industrial camera, and in the example, the backlight source image is obtained by photographing the metal material to be measured placed in the backlight source by the industrial camera; the annular light source image is obtained by photographing the metal material to be detected which is arranged in the annular light source by adopting an industrial camera. In another example, the cross-sectional image of the metallic material to be measured may be extracted directly from the database.
S120, performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
specifically, the oxford method is also called a maximum difference-between-class method, and divides an image into a background and a foreground according to the gray-scale characteristics of the image. Since variance is a measure of the uniformity of the gray level distribution, the larger the inter-class variance between the background and the foreground, the larger the difference between the two parts that make up the image, and the smaller the difference between the two parts when the foreground is divided into the background or the background is divided into the foreground. Therefore, the error division probability of binarizing the backlight image by using the Ojin method is minimum.
S130, determining the binarized image as a mask image of the annular light source image, and performing image processing on the annular light source image according to the mask image to obtain a pure background image;
wherein the mask image is the outside of the box (the inside of the box is the selection area). The mask image protects selected areas from manipulation, while non-masked areas are processed. The solid background image may be a solid white background image.
Specifically, performing image processing on the annular light source image according to the mask image to obtain a pure background image; the image processing method may be any in the art as long as a pure background image can be obtained from a mask image. In a specific example, a mask image may be superimposed on the annular light source image, and then a superimposed position of a pixel in the mask image, where a pixel value is a first set value, is determined, and a value of the pixel in the annular light source image at the superimposed position is adjusted to a second set value. Further, after the pixel values are adjusted, other processes such as image segmentation, image matting, exposure compensation denoising, and image size adjustment may be performed, and the first set value may be 0 or 255.
S140, processing the pure background image by adopting a preset neural network model, and outputting a slag point detection result.
The preset neural network model may be any neural network model, such as a BP neural network model. It should be noted that the neural network model is already trained.
Specifically, the pure background image is input into a preset neural network model, and the preset neural network model can output slag point detection results. The slag point detection result comprises the existence of slag points and the absence of slag points.
According to the slag point detection method for the metal material, the backlight source image and the annular light source image of the metal material to be detected are obtained, the backlight source image is subjected to binarization processing by adopting the Ojin method, the binarization image is used as a mask image of the annular light source image, and the obtained mask image can completely divide the cross section area, so that compared with the traditional technology, the certainty is high. And obtaining a pure background image based on the mask image and the annular light source image. And processing the pure background image by adopting a preset neural network model to output a slag point detection result. The backlight source image is used as a mask of the annular light source image, the obtained pure background image can better protrude slag points of the metal material to be detected, interference of interference factors on detection is reduced, and therefore the slag point detection accuracy of the metal material to be detected is improved. Compared with the traditional method for detecting by adopting microscopic components of metallographic structures, the method has the advantage of low cost, and the detection efficiency and the detection accuracy can be effectively improved by processing the pure background image through the preset neural network model.
In one embodiment, the step of performing image processing on the annular light source image according to the mask image to obtain a pure background image comprises the following steps:
superimposing a mask image on the annular light source image;
and determining the superposition position of pixels with the pixel values of the first set value in the mask image, and adjusting the value of the pixels in the superposition position in the annular light source image to a second set value to obtain a pure background image.
Specifically, the mask image is actually a binarized image. The binarized image includes pixel points having pixel values of 0 and 255. In one specific example, the first set point is 255 and the second set point is 0. And determining the superposition position of the pixels with the pixel value of 255 in the mask image, and adjusting the value of the pixels at the superposition position in the annular light source image to 0 while the values of the pixels at other positions remain unchanged, so as to obtain the image with the pure white background.
In one embodiment, before the step of performing binarization processing on the backlight source image by using the oxford method, the method further includes:
preprocessing a backlight source image to obtain a preprocessed image;
the preprocessing can be any preprocessing means in the field, such as exposure compensation, denoising, image size adjustment, and the like. The preprocessed image is an image obtained after preprocessing the backlight.
In one specific example, the pre-processed image is obtained by median filtering the backlight image.
As shown in fig. 2, the step of performing binarization processing on a backlight image by using the oxford method to obtain a binarized image includes:
s210, determining a binarization threshold value of the preprocessed image by adopting an Ojin method;
s220, setting the value of the pixel point with the pixel value larger than the binarization threshold value in the preprocessed image as a second set value, and setting the pixel point with the pixel value smaller than or equal to the binarization threshold value in the preprocessed image as a first set value, so as to obtain the binarized image.
Wherein the first set value and the second set value are different pixel values. In one specific example, the second set point may be 0 and the first set point may be 255.
Specifically, the pixel value of the pixel point with the pixel value larger than the binarization threshold in the preprocessed image is set to 0, and the pixel value of the pixel point with the pixel value smaller than the binarization threshold in the preprocessed image is set to 255, so that the binarized image can be obtained.
In one embodiment, as shown in fig. 3, there is provided a step of acquiring a preset neural network model, including the steps of:
s310, acquiring a plurality of test backlight images and test annular light source images of the test metal materials;
s320, performing image processing on each test backlight source image and each test annular light source image to obtain a plurality of pure background test images;
specifically, the pure background test images corresponding to the plurality of test metal materials can be obtained by obtaining the pure background image in any one of the modes described above.
S330, generating a training set and a testing set according to each pure background testing image;
specifically, the plain background test image may be divided into a training set and a test set at a ratio of 7:3.
S340, training the first neural network model by adopting a training set to obtain a second neural network model;
specifically, the training set is input into a first neural network model for training, and a trained second neural network model is obtained.
S350, determining a second neural network model with the detection accuracy greater than a preset value as a preset neural network model; the detection accuracy is obtained by detecting the test set by the second neural network model.
The detection accuracy is the accuracy of evaluating the performance index.
Specifically, the test set is used to test the second neural network model for generalization capability and correctness of the test model, and step S340 is repeated until the detection accuracy is greater than a preset value. In one specific example, the preset value is 90%. A schematic diagram of the performance index confusion matrix of the detection result is shown in FIG. 4.
In one specific example, the learning rate of the next training algebra of the first neural network model is derived from the learning rate, the learning decay rate, the current training algebra, and the total training algebra of the current training algebra of the first neural network model. Specifically, the learning rate of the first neural network model is obtained based on the following formula:
wherein lr is the learning rate of the next training algebra of the first neural network model; lr (lr) base A current learning rate that is a current training algebra of the first neural network model; alpha is learning attenuation rate, and the value of the learning attenuation rate is smaller than 1; epoch is the current training algebra and n_epoch is the total training algebra.
Through the steps, the learning rate is adjusted according to exponential decay to replace the original fixed learning rate, so that the weight parameters are updated more slowly along with the increase of algebra, training is finer, overfitting is avoided, and the generalization capability of the model is improved.
It should be understood that, although the steps in the flowcharts of fig. 1-3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1-3 may include multiple sub-steps or phases that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or phases are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or phases of other steps or other steps.
In one embodiment, as shown in fig. 5, there is provided a slag point detection device for a metal material, including:
the image acquisition module is used for acquiring a cross-section image of the metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of metal materials to be detected placed in the backlight source; the annular light source image is obtained by image acquisition of a metal material to be detected which is arranged in the annular light source;
the binarization processing module is used for performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
the image processing module is used for determining the binarized image as a mask image of the annular light source image, and performing image processing on the annular light source image according to the mask image to obtain a pure background image;
and the result output module is used for processing the pure background image by adopting a preset neural network model and outputting a slag point detection result.
In one embodiment, the image processing module is further configured to superimpose a mask image on the annular light source image; and determining the superposition position of pixels with the pixel values of the first set value in the mask image, and adjusting the value of the pixels at the superposition position in the annular light source image to the second set value to obtain the pure background image.
In one embodiment, the slag point detection device of the metal material further comprises:
the preprocessing module is used for preprocessing the backlight source image to obtain a preprocessed image;
the binarization processing module is also used for determining a binarization threshold value of the preprocessed image by adopting an Ojin method; and setting the value of the pixel point with the pixel value larger than the binarization threshold value in the preprocessed image as a second set value, and setting the pixel point with the pixel value smaller than or equal to the binarization threshold value in the preprocessed image as a first set value, so as to obtain the binarization image.
In one embodiment, the preprocessing module is further configured to perform median filtering processing on the backlight source image to obtain a preprocessed image.
The specific limitation of the slag point detection device for the metal material can be referred to the limitation of the slag point detection method for the metal material hereinabove, and the description thereof will not be repeated here. All or part of each module in the slag point detection device for the metal materials can be realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, as shown in fig. 6, there is provided a slag point detection device for metal materials, including a memory and a processor, the memory storing a computer program, and further including an image acquisition device, a backlight source, a ring-shaped light source, and an on-off device; the switching-off device is used for controlling the on or off of the backlight source and also controlling the on or off of the annular light source; the processor is connected with the image acquisition equipment; the backlight source is arranged below the metal material to be tested; the annular light source is arranged around the periphery of the metal material to be measured;
the image capturing device may be any device capable of capturing images in the art, such as a video camera and a video recorder. The backlight source is a light source for providing backlight for the metal material to be tested, and the annular light source is a light source for providing annular light for the metal material to be tested. The breaking device may be any device having breaking capabilities in the art.
Specifically, the backlight source is arranged below the metal material to be tested and is used for providing backlight for the metal material to be tested. The annular light source is arranged around the periphery of the metal material to be measured and is used for providing annular light for the metal material to be measured. The switching-off device can be connected with a processor, and the processor controls the opening of the backlight source and the annular light source according to actual conditions. The switching-off device can also be manually pressed to switch on or off the backlight source and the annular light source.
Further, the processor when executing the computer program performs the steps of:
acquiring a cross-sectional image of a metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of metal materials to be detected placed in the backlight source; the annular light source image is obtained by image acquisition of a metal material to be detected which is arranged in the annular light source;
performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
determining the binarized image as a mask image of the annular light source image, and performing image processing on the annular light source image according to the mask image to obtain a pure background image;
and processing the pure background image by adopting a preset neural network model, and outputting a slag point detection result.
In one embodiment, the processor performs the step of performing image processing on the annular light source image according to the mask image to obtain a pure background image, and further performs the following steps:
superimposing a mask image on the annular light source image;
and determining the superposition position of pixels with the pixel values of the first set value in the mask image, and adjusting the value of the pixels at the superposition position in the annular light source image to the second set value to obtain the pure background image.
In one embodiment, the following steps are further implemented before the step of binarizing the backlight image by using the oxford method is performed by the processor:
preprocessing a backlight source image to obtain a preprocessed image;
in one embodiment, the step of obtaining the binarized image further comprises the steps of:
determining a binarization threshold value of the preprocessed image by adopting an Ojin method;
and setting the value of the pixel point with the pixel value larger than the binarization threshold value in the preprocessed image as a second set value, and setting the pixel point with the pixel value smaller than or equal to the binarization threshold value in the preprocessed image as a first set value, so as to obtain the binarization image.
In one embodiment, the step of preprocessing the backlight image by the processor further comprises the steps of:
and carrying out median filtering treatment on the backlight source image to obtain a preprocessed image.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a plurality of test backlight images and test annular light source images of the test metal materials;
performing image processing on each test backlight source image and each test annular light source image to obtain a plurality of pure background test images;
generating a training set and a testing set according to each pure background testing image;
training the first neural network model by adopting a training set to obtain a second neural network model;
determining a second neural network model with the detection accuracy greater than a preset value as a preset neural network model; the detection accuracy is obtained by detecting the test set by the second neural network model.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a cross-sectional image of a metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of metal materials to be detected placed in the backlight source; the annular light source image is obtained by image acquisition of a metal material to be detected which is arranged in the annular light source;
performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
determining the binarized image as a mask image of the annular light source image, and performing image processing on the annular light source image according to the mask image to obtain a pure background image;
and processing the pure background image by adopting a preset neural network model, and outputting a slag point detection result.
In one embodiment, the step of performing image processing on the annular light source image according to the mask image to obtain a pure background image is further performed by the processor to:
superimposing a mask image on the annular light source image;
and determining the superposition position of pixels with the pixel values of the first set value in the mask image, and adjusting the value of the pixels in the superposition position in the annular light source image to a second set value to obtain a pure background image.
In one embodiment, the following steps are further implemented when the step of binarizing the backlight image using the oxford method is performed by the processor:
preprocessing a backlight source image to obtain a preprocessed image;
in one embodiment, the step of performing binarization processing on the backlight source image by using the oxford method to obtain a binarized image is performed by the processor, and further comprises the following steps:
determining a binarization threshold value of the preprocessed image by adopting an Ojin method;
and setting the value of the pixel point with the pixel value larger than the binarization threshold value in the preprocessed image as a second set value, and setting the pixel point with the pixel value smaller than or equal to the binarization threshold value in the preprocessed image as a first set value, so as to obtain the binarization image.
In one embodiment, the step of preprocessing the backlight image, resulting in a preprocessed image, when executed by the processor, further performs the steps of:
and carrying out median filtering treatment on the backlight source image to obtain a preprocessed image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a plurality of test backlight images and test annular light source images of the test metal materials;
performing image processing on each test backlight source image and each test annular light source image to obtain a plurality of pure background test images;
generating a training set and a testing set according to each pure background testing image;
training the first neural network model by adopting a training set to obtain a second neural network model;
determining a second neural network model with the detection accuracy greater than a preset value as a preset neural network model; the detection accuracy is obtained by detecting the test set by the second neural network model.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus dynamic random access memory (RDRAM), and interface dynamic random access memory (DRDRAM).
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
Claims (9)
1. The slag point detection method of the metal material is characterized by comprising the following steps:
acquiring a cross-sectional image of a metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of the metal material to be detected, which is arranged in the backlight source; the annular light source image is obtained by image acquisition of the metal material to be detected, which is arranged in the annular light source;
performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
determining the binarized image as a mask image of the annular light source image, and superposing the mask image on the annular light source image; determining the superposition position of pixels with pixel values of a first set value in the mask image, and adjusting the value of the pixels in the superposition position in the annular light source image to a second set value to obtain a pure background image;
and processing the pure background image by adopting a preset neural network model, and outputting a slag point detection result.
2. The method for detecting slag points of metal materials according to claim 1, wherein before the step of binarizing the backlight image by using the oxford method, further comprising:
preprocessing the backlight source image to obtain a preprocessed image;
the step of carrying out binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image comprises the following steps:
determining a binarization threshold value of the preprocessed image by adopting an Ojin method;
and setting the value of the pixel point with the pixel value larger than the binarization threshold value in the preprocessed image as the second set value, and setting the pixel point with the pixel value smaller than or equal to the binarization threshold value in the preprocessed image as the first set value, so as to obtain the binarization image.
3. The slag spot detection method of a metal material according to claim 2, wherein the step of preprocessing the backlight image to obtain a preprocessed image comprises:
and carrying out median filtering treatment on the backlight source image to obtain the preprocessing image.
4. The slag spot detection method of a metal material as set forth in claim 1, further comprising the step of:
acquiring a plurality of test backlight images and test annular light source images of the test metal materials;
performing image processing on each test backlight source image and each test annular light source image to obtain a plurality of pure background test images;
generating a training set and a testing set according to each pure background testing image;
training the first neural network model by adopting the training set to obtain a second neural network model;
determining a second neural network model with the detection accuracy greater than a preset value as the preset neural network model; and the detection accuracy is obtained by detecting the test set by the second neural network model.
5. The method for detecting slag points of metal materials according to claim 4, wherein the learning rate of the next training algebra of the first neural network model is obtained according to the learning rate, the learning attenuation rate, the current training algebra and the total training algebra of the current training algebra of the first neural network model.
6. The slag point detection method of a metal material according to claim 5, wherein the learning rate of the first neural network model is obtained based on the following formula:
wherein lr is the learning rate of the next training algebra of the first neural network model; lr (lr) base A learning rate for a current training algebra of the first neural network model; alpha is the learning attenuation rate, and the value of the learning attenuation rate is smaller than 1; epoch is the current training algebra and n_epoch is the total training algebra.
7. Slag point detection device of metal material, characterized by comprising:
the image acquisition module is used for acquiring a cross-section image of the metal material to be detected; the section image comprises a backlight source image and an annular light source image; the backlight source image is obtained by image acquisition of the metal material to be detected, which is arranged in the backlight source; the annular light source image is obtained by image acquisition of the metal material to be detected, which is arranged in the annular light source;
the binarization processing module is used for performing binarization processing on the backlight source image by adopting an Ojin method to obtain a binarized image;
an image processing module, configured to determine the binarized image as a mask image of the annular light source image, and superimpose the mask image on the annular light source image; determining the superposition position of pixels with pixel values of a first set value in the mask image, and adjusting the value of the pixels in the superposition position in the annular light source image to a second set value to obtain a pure background image;
and the result output module is used for processing the pure background image by adopting a preset neural network model and outputting a slag point detection result.
8. The slag point detection device for the metal material comprises a memory and a processor, wherein the memory stores a computer program, and is characterized by further comprising an image acquisition device, a backlight source, an annular light source and an opening device; the switching-off device is used for controlling the on or off of the backlight source and also used for controlling the on or off of the annular light source; the processor is connected with the image acquisition equipment; the backlight source is arranged below the metal material to be tested; the annular light source is arranged around the periphery of the metal material to be tested;
the processor, when executing the computer program, implements the steps of the method of any one of claims 1 to 6.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111193563.3A CN113935966B (en) | 2021-10-13 | 2021-10-13 | Slag point detection method, device and equipment for metal material and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111193563.3A CN113935966B (en) | 2021-10-13 | 2021-10-13 | Slag point detection method, device and equipment for metal material and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113935966A CN113935966A (en) | 2022-01-14 |
CN113935966B true CN113935966B (en) | 2023-05-26 |
Family
ID=79278780
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111193563.3A Active CN113935966B (en) | 2021-10-13 | 2021-10-13 | Slag point detection method, device and equipment for metal material and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113935966B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114782400B (en) * | 2022-05-17 | 2023-06-20 | 东风本田发动机有限公司 | Method, device, equipment, medium and program product for detecting slag point of metal material |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106839986B (en) * | 2017-03-24 | 2023-07-21 | 中国计量大学 | Double-station carrier band detection system based on machine vision and machine learning |
CN107884413A (en) * | 2017-10-24 | 2018-04-06 | 华东交通大学 | A kind of device and detection method of automatic detection bearing roller missing |
CN108918093B (en) * | 2018-05-23 | 2020-08-04 | 精锐视觉智能科技(深圳)有限公司 | Optical filter mirror surface defect detection method and device and terminal equipment |
CN110097540A (en) * | 2019-04-20 | 2019-08-06 | 东莞中科蓝海智能视觉科技有限公司 | The visible detection method and device of polygon workpeace |
CN111460947B (en) * | 2020-03-15 | 2022-05-31 | 吉林大学 | BP neural network-based method and system for identifying metal minerals under microscope |
-
2021
- 2021-10-13 CN CN202111193563.3A patent/CN113935966B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113935966A (en) | 2022-01-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111680746B (en) | Vehicle damage detection model training, vehicle damage detection method, device, equipment and medium | |
CN111199523B (en) | Power equipment identification method, device, computer equipment and storage medium | |
CN111507298B (en) | Face detection method, device, computer equipment and storage medium | |
CN108710837A (en) | Cigarette smoking recognition methods, device, computer equipment and storage medium | |
CN113469971B (en) | Image matching method, detection device and storage medium | |
CN109035167B (en) | Method, device, equipment and medium for processing multiple faces in image | |
CN114764775A (en) | Infrared image quality evaluation method, device and storage medium | |
CN113935966B (en) | Slag point detection method, device and equipment for metal material and storage medium | |
CN113066088A (en) | Detection method, detection device and storage medium in industrial detection | |
KR101716111B1 (en) | System and method for detecting foreign substance | |
CN112949453A (en) | Training method of smoke and fire detection model, smoke and fire detection method and smoke and fire detection equipment | |
CN115631198B (en) | Crack detection method and device for glass display screen and computer equipment | |
US7646892B2 (en) | Image inspecting apparatus, image inspecting method, control program and computer-readable storage medium | |
CN112669300A (en) | Defect detection method and device, computer equipment and storage medium | |
WO2022130814A1 (en) | Index selection device, information processing device, information processing system, inspection device, inspection system, index selection method, and index selection program | |
CN112446833A (en) | Image processing method, intelligent terminal and storage medium | |
CN114359414A (en) | Lens smudge identification method and device, computer equipment and storage medium | |
CN113284113A (en) | Glue overflow flaw detection method and device, computer equipment and readable storage medium | |
CN116309563B (en) | Method, device, medium, equipment and program product for detecting defect of panel edge | |
CN117351011B (en) | Screen defect detection method, apparatus, and readable storage medium | |
CN117197129B (en) | Blackening degree detection method and device and computer equipment | |
US11631183B2 (en) | Method and system for motion segmentation | |
CN111681229B (en) | Deep learning model training method, wearable clothes flaw identification method and wearable clothes flaw identification device | |
JP6743633B2 (en) | Computer program, moving body detection method, and moving body detection device | |
CN114092413A (en) | Dark field image restoration method and system, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |