Disclosure of Invention
Therefore, the technical problem to be solved by the present invention is to overcome the above-mentioned defects in the prior art, and to provide a glass surface defect collecting device and a detection method.
For this purpose, the glass surface defect collecting device comprises a box body, an industrial camera, an annular light source and a conveyor belt; the industrial camera is installed at the top end in the box body, the conveyor belt is installed at the bottom end in the box body, and the annular light source is installed between the industrial camera and the conveyor belt; the glass is placed on a conveyor belt.
Preferably, the light source device also comprises a light source bracket which is arranged on the box body and can move up and down in the box body; the annular light source is arranged on the light source bracket.
Preferably, the camera fixture is arranged at the top end inside the box body, and the industrial camera is arranged in the camera fixture.
Preferably, the device further comprises a base, and the box body is mounted on the base.
Preferably, the conveying device further comprises a driving motor, and the conveying belt is controlled to rotate by the driving motor.
The invention also provides a glass surface defect detection method by using the glass surface defect acquisition device, which comprises the following steps:
s1: adjusting the height of the annular light source to the height of the maximum width of the glass plane which can be collected by the industrial camera, and collecting pictures;
s2: extracting a circular area polished by the annular light source by adopting an image processing technology, removing redundant interference information, and extracting an ROI (region of interest);
s3: after the ROI interest area is extracted, feature extraction is carried out on the ROI interest area, and feature information is enhanced;
s4: using label software to frame and sort objects such as scratches, dirt, broken edges and the like on the glass surface, and making a data set;
s5: and selecting YOLOv4 as a basic algorithm framework, constructing a YOLOv4 deep learning defect detection network, optimizing a training strategy, learning the defect information through a neural network according to the defect information labeled by a training set by the model to obtain a training weight model, and using the training weight model in a server defect detection module.
Preferably, step S2 includes:
s21: carrying out image enhancement on the image, and enhancing the characteristic information of the defect;
s22: denoising the image by adopting median filtering;
s23: dividing regions by adopting a gray histogram, selecting a circular region needing defect information identification, and eliminating other interference regions.
Preferably, step S3 includes:
s31: performing edge extraction on the defect information by using a sobel operator to highlight the defect information;
s32: fitting according to the shape of the defect information to complete partial defect information;
s33: and the number of data samples is amplified by performing rotation change, scale transformation and translation transformation on the image.
Preferably, step S4 includes:
s41: dividing the defects into three categories, namely scratches (flaws, points and foreign matters), dirt and edge breakage, and manufacturing an equivalent positive sample set, namely a plane glass sample without the defects;
s42: selecting defect characteristics of a target to be detected by using a label software frame, and generating a corresponding xml file, wherein the xml file comprises the position and the category information of the selected defect characteristics;
s43: the data set was divided into three parts, 80% training set, 10% test set and 10% validation set.
Preferably, the method further comprises: further optimizing the model by adopting a DropBlock regularization method, Mosaic data enhancement and cosine annealing learning rate; and the accuracy of the test result is improved by adopting a K-fold cross verification method.
According to the glass surface defect acquisition device and the detection method, the low-angle annular light source is used for acquiring the defect information of the plane glass, so that the irradiation conditions with good uniformity, good stability and high brightness can be provided, the acquisition of the defect information can be improved to the maximum extent, and particularly, the misjudgment and the missed judgment can be reduced aiming at the defects which are small, have shallow scratch depth and are difficult to identify, and the accuracy of a detection system is greatly improved; the defect information is identified and classified by using the deep learning model, the characteristics of the region of interest do not need to be extracted manually, the time consumption is short, the difficulty is low, a large amount of waste of human resources can be avoided, the defect information on the curved surface can be effectively acquired, and the defect type can be detected quickly and efficiently.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
As shown in fig. 1, the present embodiment provides a glass surface defect collecting device, which comprises a box body 1, an industrial camera 2, an annular light source 3 and a conveyor belt 4; the industrial camera 2 is arranged at the top end in the box body 1, the conveyor belt 4 is arranged at the bottom end in the box body 1, and the annular light source 3 is arranged between the industrial camera 2 and the conveyor belt 4; the glass is placed on a conveyor belt 4.
In this embodiment, since the dust in the air interferes with the quality of the acquired image under the irradiation of strong light, the dust is easily recognized as a defect, which causes a determination error, and thus the case 1 is provided to operate the acquisition device in a closed space, thereby reducing the probability of erroneous determination.
In the embodiment, the annular light source 3 can provide irradiation conditions with good uniformity, good stability and high brightness, and can improve the acquisition of defect information to the greatest extent, and particularly reduce erroneous judgment and missing judgment aiming at defects which are small, have shallow scratch depths and are difficult to identify, thereby greatly improving the accuracy of the detection system.
The glass surface defect collecting device also comprises a light source bracket 5, wherein the light source bracket 5 is arranged on the box body 1 and can move up and down in the box body 1; the annular light source 3 is mounted on a light source support 5.
In the present embodiment, since the effect produced by the ring-shaped light source 3 is circular, not the information of the entire glass surface but the information of the glass surface within the light source range is exhibited. By installing the ring light source 3 on the light source support 5, the height of the light source support 5 can be adjusted so as to adjust the height of the ring light source 3, so that the ring light source 3 can cover the whole glass, and the industrial camera 2 can acquire the whole glass plane.
The glass surface defect collecting device further comprises a camera clamp 6, the camera clamp 6 is installed at the top end inside the box body 1, and the industrial camera 2 is installed in the camera clamp 6.
In the present embodiment, the camera holder 6 is used to mount the industrial camera 2, and by mounting the industrial camera 2 in the camera holder 6, it is ensured that the industrial camera 2 can be stably mounted on the top end inside the case 1.
The glass surface defect collecting device also comprises a base 7, and the box body 1 is arranged on the base 7; the glass surface defect collecting device further comprises a driving motor 8, and the conveying belt 4 is controlled by the driving motor 8 to rotate.
In this embodiment, the base 7 is used for fixing the box 1, and the driving motor 8 is used for driving the conveyor belt 4 to rotate.
In this embodiment, the process of collecting the glass surface defect image is as follows: control driving motor 8 motion, conveyer belt 4 begins to turn left motion from the right side for planar glass turns left from the right side and moves, and at the in-process that removes, industrial camera 2 from left to right carries out the collection of image to the glass surface, and light source support 5 fixes at 1 certain height of box, and the height of straight line module control light source support 5 of accessible z axle, annular light source 3 is fixed on light source support 5, and annular light source 3 passes through electrical controller and adjusts luminance.
The embodiment also provides a glass surface defect detection method using the glass surface defect acquisition device, which comprises the following steps:
s1: adjusting the height of the annular light source 3 to the height at which the industrial camera 2 can acquire the maximum width of the glass plane, and acquiring pictures;
s2: extracting a circular area polished by the annular light source 3 by adopting an image processing technology, removing redundant interference information, and extracting an ROI (region of interest);
s3: after the ROI interest area is extracted, feature extraction is carried out on the ROI interest area, and feature information is enhanced;
s4: using label software to frame and sort objects such as scratches, dirt, broken edges and the like on the glass surface, and making a data set;
s5: and selecting YOLOv4 as a basic algorithm framework, constructing a YOLOv4 deep learning defect detection network, optimizing a training strategy, learning the defect information through a neural network according to the defect information labeled by a training set by the model to obtain a training weight model, and using the training weight model in a server defect detection module.
In this embodiment, since the industrial camera 2 needs to be adjusted to a certain height, which results in an excessively large area range for recognition compared with the detection effective area, after the picture is acquired, the circular area polished by the annular light source 3 is extracted by adopting an image processing technology, redundant interference information is eliminated, and after the recognition area is extracted, the feature extraction is performed on the recognition area, so that the feature information is enhanced.
Step S2 includes:
s21: carrying out image enhancement on the image, and enhancing the characteristic information of the defect;
s22: denoising the image by adopting median filtering;
s23: dividing regions by adopting a gray histogram, selecting a circular region needing defect information identification, and eliminating other interference regions.
In this embodiment, because the industrial camera 2 inevitably generates noise during the digital-to-electrical conversion process, the median filter is used to denoise the image, and sharp edge information of the image can be protected.
Step S3 includes:
s31: performing edge extraction on the defect information by using a sobel operator to highlight the defect information;
s32: fitting according to the shape of the defect information to complete partial defect information;
s33: and the number of data samples is amplified by performing rotation change, scale transformation and translation transformation on the image.
In the present embodiment, steps S2 and S3 are image preprocessing. Because partial defect has partial information loss in the image preprocessing process, the defect information is discontinuous, and the partial defect information needs to be fitted according to the shape of the defect information. Because the number of the defect samples is small, the number of the data samples needs to be amplified by performing operations such as rotation change, scale transformation, translation transformation and the like on the image.
Step S4 includes:
s41: dividing the defects into three categories, namely scratches (flaws, points and foreign matters), dirt and edge breakage, and manufacturing an equivalent positive sample set, namely a plane glass sample without the defects;
s42: selecting defect characteristics of a target to be detected by using a label software frame, and generating a corresponding xml file, wherein the xml file comprises the position and the category information of the selected defect characteristics;
s43: the data set was divided into three parts, 80% training set, 10% test set and 10% validation set.
The glass surface defect detection method further comprises the following steps: further optimizing the model by adopting a DropBlock regularization method, Mosaic data enhancement and cosine annealing learning rate; and the accuracy of the test result is improved by adopting a K-fold cross verification method.
In this embodiment, the model structure used is a YOLOv4 network, the size of the network input is a multiple of 32, and the appropriate size may be selected according to the performance of the computer GPU. In the model selection of the industrial camera 2, a camera of 500 ten thousand pixels is used, which is sufficient in resolution, and the input picture size is finally selected to be 608 × 608. In order to further optimize the model, a DropBlock regularization method, Mosaic data enhancement, cosine annealing learning rate and the like are adopted, and in order to improve the accuracy of the test result, a K-fold cross-validation method is adopted for verification. And obtaining a training weight after the model is trained, and loading the training weight into a prediction program to detect whether the glass plane has defects.
According to the glass surface defect acquisition device and the detection method, the low-angle annular light source is used for acquiring the defect information of the plane glass, so that the irradiation conditions with good uniformity, good stability and high brightness can be provided, the acquisition of the defect information can be improved to the maximum extent, and particularly, the misjudgment and the missed judgment can be reduced aiming at the defects which are small, have shallow scratch depth and are difficult to identify, and the accuracy of a detection system is greatly improved; the defect information is identified and classified by using the deep learning model, the characteristics of the region of interest do not need to be extracted manually, the time consumption is short, the difficulty is low, a large amount of waste of human resources can be avoided, the defect information on the curved surface can be effectively acquired, and the defect type can be detected quickly and efficiently.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.