CN116109640A - Workpiece surface small defect detection method in industrial detection - Google Patents

Workpiece surface small defect detection method in industrial detection Download PDF

Info

Publication number
CN116109640A
CN116109640A CN202310391809.0A CN202310391809A CN116109640A CN 116109640 A CN116109640 A CN 116109640A CN 202310391809 A CN202310391809 A CN 202310391809A CN 116109640 A CN116109640 A CN 116109640A
Authority
CN
China
Prior art keywords
image
workpiece
pixel value
images
value
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.)
Granted
Application number
CN202310391809.0A
Other languages
Chinese (zh)
Other versions
CN116109640B (en
Inventor
徐超
潘正颐
侯大为
童竹勍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changzhou Weiyizhi Technology Co Ltd
Original Assignee
Changzhou Weiyizhi Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Changzhou Weiyizhi Technology Co Ltd filed Critical Changzhou Weiyizhi Technology Co Ltd
Priority to CN202310391809.0A priority Critical patent/CN116109640B/en
Publication of CN116109640A publication Critical patent/CN116109640A/en
Application granted granted Critical
Publication of CN116109640B publication Critical patent/CN116109640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of industrial detection, and provides a workpiece surface small defect detection method in industrial detection.

Description

Workpiece surface small defect detection method in industrial detection
Technical Field
The invention relates to the technical field of industrial detection, in particular to a workpiece surface small defect detection method in industrial detection and a non-transitory computer readable storage medium.
Background
In industrial quality inspection, small defects (defects with a total number of pixels less than 400) are defects that are small in area but are relatively serious. At present, the industrial quality inspection model performs a plurality of downsampling operations on pictures in the process of extracting image features, small defects are easily filtered in the process of downsampling operations, and the small defects cannot be detected finally.
In the related art, in order to increase the detection rate of small defects, the following problems exist in this way, by adopting a high-resolution camera to perform image acquisition to increase the amount of pixels occupied by the small defects: 1. high resolution cameras are several times higher than general cameras in cost, resulting in increased cost for industrial detection; 2. the large amount of data of pictures shot by the high-resolution camera leads to the fact that a large amount of data need to be processed when the model is calculated, a large amount of time is spent, and detection efficiency is affected.
Disclosure of Invention
In order to solve the above technical problems, a first object of the present invention is to provide a method for detecting small defects on a workpiece surface in industrial inspection.
A second object of the invention is to propose a non-transitory computer readable storage medium.
The technical scheme adopted by the invention is as follows:
an embodiment of a first aspect of the present invention provides a method for detecting a small defect on a workpiece surface in industrial detection, including the following steps: step S1, collecting a workpiece image and marking defects; s2, convolving the workpiece image with a Gaussian filter kernel; step S3, performing maximum pooling operation on the convolved image by adopting a 2 x 2 kernel; step S4, repeating the steps S2-S3 twice to extract the characteristic images; step S5, carrying out convolution operation on the characteristic image and local extremum operators in four directions, and obtaining a convolution result, wherein the four directions comprise: +x-direction, +y-direction, -x-direction, and-y-direction; step S6, judging the convolution result, wherein if the convolution result is larger than a threshold thr, the pixel value of the current position is set to be 1, and if the convolution result is smaller than or equal to the threshold thr, the pixel value of the current position is set to be 0, so that 4 binarization graphs are generated; step S7, adding the pixel values of the same positions of the 4 binarization graphs to obtain a pixel value T of each position, and determining the pixel value T of each position, where if t=4, the pixel value of the current position is set to 1, and if t+.4, the pixel value of the current position is set to 0, so as to generate a first Mask image M1 corresponding to the workpiece image; step S8, solving the maximum inscribed rectangular outline of the first Mask image M1, setting the pixels in the inscribed rectangular outline as 1, setting the pixels outside the inscribed rectangular outline as 0, and obtaining a second Mask image M2; step S9, generating a first amplified image I2 by amplifying the set times of the workpiece images, and generating a second amplified image M3 by amplifying the set times of the second Mask image M2; step S10, solving IOU (Intersection over Union, cross ratio) values of the maximum inscribed rectangular outline of the second enlarged image M3 and each GT frame of the first enlarged image I2, and solving an average IOU_MEAN of the IOU values of all GT (group Truth) frames of the first enlarged image I2; step S11, traversing the threshold thr from 255 to 0 once, repeatedly executing the steps S2-S10, and taking the maximum value of the threshold thr meeting IOU_MEAN >0.5 as the optimal threshold of the current workpiece image; step S12, respectively executing steps S2-S11 on all the workpiece images acquired in the step S1, counting the optimal threshold values of all the workpiece images, and taking the minimum value in the optimal threshold values of all the workpiece images as a model optimal threshold value thr_best; step S13, acquiring a dataset of a workpiece surface defect detection model, and executing steps S2-S9 on images of the dataset, wherein the threshold value in step S5 is set as the optimal model threshold value thr_best when the steps S2-S9 are executed; step S14, obtaining an image block Y of which the pixel value of a second amplified image M3 in the image of the data set is 1 and corresponds to the position of a first amplified image I2, and carrying out image enhancement on the image block Y by adopting a low-rank matrix enhancement algorithm; and S15, training the workpiece surface defect detection model by adopting the enhanced data set.
The method for detecting the small defects on the surface of the workpiece in the industrial detection provided by the invention can also have the following additional technical characteristics:
according to one embodiment of the present invention, the workpiece image is magnified by a set magnification and the second Mask image M2 is magnified by a set magnification using a proximity interpolation method.
According to one embodiment of the invention, the set multiple is 16.
An embodiment of the second aspect of the present invention proposes a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for detecting small defects on a surface of a workpiece in an industrial inspection according to an embodiment of the first aspect of the present invention.
The invention has the beneficial effects that:
according to the invention, firstly, the optimal threshold thr_best of the model is obtained by utilizing a defect searching algorithm, then, the potential defect position of the data set of the workpiece surface defect detection model is searched according to the optimal threshold thr_best of the model, and then, only the image of the potential defect position is subjected to low-rank matrix enhancement according to a low-rank matrix enhancement algorithm, and the enhanced image is adopted to carry out detection model training, so that the algorithm processing time can be reduced, the detection rate of the model on small defects can be effectively improved, the actual industrial production requirement can be met, a high-resolution camera is not needed, and the cost can be effectively controlled.
Drawings
FIG. 1 is a flow chart of a method of workpiece surface small defect detection in industrial inspection according to one embodiment of the invention;
FIG. 2 is a schematic diagram of the structure of a Gaussian filter kernel according to an embodiment of the invention;
FIG. 3 is a schematic diagram of the structure of a four-way local extremum operator according to one embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
FIG. 1 is a flow chart of a method of workpiece surface small defect detection in industrial inspection according to one embodiment of the invention. As shown in fig. 1, the method comprises the steps of:
and S1, collecting a workpiece image and marking defects.
Specifically, the workpiece image is a collection of workpiece surface images, for example, 300 workpiece images, and the employed workpiece images are subjected to defect labeling, including the kind and position of defects (GT frame).
And S2, convolving the workpiece image with a Gaussian filter kernel.
Specifically, the structure of the gaussian filter kernel can be shown with reference to fig. 2.
And S3, performing maximum pooling operation on the convolved image by adopting a 2 x 2 kernel.
And S4, repeating the steps S2-S3 twice to extract the characteristic image.
S5, the characteristic image and the local extremum operators in four directions are processed
Figure SMS_1
) Performing convolution operation and obtaining a convolution result, wherein the four directions comprise: +x direction, +y direction, -x direction, and-y direction.
Specifically, the local extremum operator of four directions
Figure SMS_2
) The structure of (2) can be seen in figure 3.
And S6, judging the convolution result, wherein if the convolution result is larger than a threshold thr, the pixel value of the current position is set to be 1, and if the convolution result is smaller than or equal to the threshold thr, the pixel value of the current position is set to be 0, so that 4 binarization graphs are generated.
Specifically, the initial value of the threshold thr is 255, as described below.
Step S7, adding the pixel values of the same positions of the 4 binarization graphs to obtain a pixel value T of each position, and judging the pixel value T of each position, wherein if t=4, the pixel value of the current position is set to 1, and if t+.4, the pixel value of the current position is set to 0, so as to generate a first Mask image M1 corresponding to the workpiece image.
Step S8, the maximum inscribed rectangular outline is obtained for the first Mask image M1, the pixels in the inscribed rectangular outline are set to be 1, and the pixels outside the inscribed rectangular outline are set to be 0, so that the second Mask image M2 is obtained.
Step S9, generating a first amplified image I2 by amplifying the set times of the workpiece images, and generating a second amplified image M3 by amplifying the set times of the second Mask image M2.
Further, according to an embodiment of the present invention, the workpiece image is magnified by a set magnification and the second Mask image M2 is magnified by a set magnification using a proximity interpolation method. The set multiple may be 16 times.
Specifically, the original workpiece image I1 corresponding to the second Mask image M2 is enlarged 16 times by adopting a neighboring interpolation method to generate a first enlarged image I2, and the GT frame corresponding to the image I1 is correspondingly enlarged 16 times. Meanwhile, the second Mask image M2 is enlarged 16 times by using the adjacent interpolation method to generate a second enlarged image M3.
Step S10, the IOU value is calculated for each GT frame of the first enlarged image I2 and the maximum inscribed rectangular outline of the second enlarged image M3, and the MEAN value iou_mean is calculated for the IOU values of all GT frames of the first enlarged image I2.
Specifically, the IOU value is obtained for the biggest inscribed rectangular outline of the graph M3 and the GT frame of the first amplified image I2 obtained after amplifying the biggest inscribed rectangular outline by 16 times in the step S10, and the IOU_MEAN is obtained by averaging the IOUs corresponding to all the GT frames on a single graph.
And S11, traversing the threshold thr from 255 to 0, repeatedly executing the steps S2-S10, and taking the maximum value of the threshold thr meeting IOU_MEAN >0.5 as the optimal threshold of the current workpiece image.
Specifically, for each workpiece image acquired in step S1, traversing the threshold thr from 255 to 0, repeatedly executing steps S2 to S10, thereby obtaining 256 iou_mean corresponding to each workpiece image, screening out more than 0.5 of all obtained 256 iou_mean, and taking the maximum of the threshold thr corresponding to the screened iou_mean as the optimal threshold of the workpiece image.
And step S12, respectively executing steps S2-S11 on all the workpiece images acquired in the step S1, counting the optimal threshold values of all the workpiece images, and taking the minimum value in the optimal threshold values of all the workpiece images as a model optimal threshold value thr_best.
Step S13, acquiring a dataset of the workpiece surface defect detection model, and executing steps S2-S9 on images of the dataset, wherein the threshold value in the step S5 is set as a model optimal threshold value thr_best when executing the steps S2-S9. Wherein the data set comprises a training set and a testing set.
Specifically, a dataset of a workpiece surface defect detection model is acquired, a threshold is set as a model optimal threshold thr_best acquired in step S12 for each image in the dataset, and steps S2 to S9 are performed.
Step S14, obtaining an image block Y with a pixel value of 1 of a second amplified image M3 in the image of the data set corresponding to the position of the first amplified image I2, and carrying out image enhancement on the image block Y by adopting a low-rank matrix enhancement algorithm.
Specifically, after step S13 is performed, a second enlarged image M3 and a first enlarged image I2 are obtained for each image in the dataset, a position of the second enlarged image M3 corresponding to the first enlarged image I2 with a pixel value of 1 is found, and the found image block Y at the corresponding position is subjected to image enhancement by adopting a low-rank matrix enhancement algorithm. The low rank matrix enhancement algorithm is repeatedly performed such that all potential defective blocks in the first enlarged image I2 in step S13 are enhanced.
And S15, training a workpiece surface defect detection model by adopting the enhanced data set.
Specifically, the potential defect positions of the data set are searched according to the optimal model threshold thr_best, and only the potential defect position images are subjected to low-rank matrix enhancement, so that the algorithm processing time can be reduced, and the detection rate of small defects of the workpiece can be effectively improved.
Image enhancement is carried out on the image block Y by adopting a low-rank matrix enhancement algorithm, specifically;
if the set Ω constituted by the original pixel positions of the image block Y, the complement Ω of Ω c For the first enlarged image I2 pixel position formation of step S9Is a set of (3).
Initializing parameters: x=0, n=0, z=0, p=0, q=0 and μ=β=1e-8, k=0, where X represents the output result image (image with image block Y enhanced), K represents the kth iteration update, k=100, n, Z, P, Q are intermediate parameter variables, μ, β are positive penalty weight parameters.
The specific steps of carrying out image enhancement on the image block Y by adopting a low-rank matrix enhancement algorithm are as follows:
step S101, update by equation 1
Figure SMS_3
. Equation 1 is:
Figure SMS_4
Figure SMS_5
represents the updated value of X after the (k+1) th iteration, Y k Y value, P representing the kth iteration k P value, Z representing the kth iteration k Z value, Q, representing the kth iteration k Represents the Q value, N of the kth iteration k An N value representing the kth iteration;
step S102, updating Z through formula 2 k+1 . Equation 2 is:
Figure SMS_7
wherein Z is k+1 Represents the updated value of Z after the (k+1) th iteration,/and>
Figure SMS_10
,/>
Figure SMS_12
for the ith singular value of X in the kth iteration, ε is a minimum number greater than 0, +.>
Figure SMS_8
Is->
Figure SMS_11
Left singular matrix of singular decomposition,>
Figure SMS_13
is->
Figure SMS_14
Singular matrix of singular decomposition,>
Figure SMS_6
is->
Figure SMS_9
A right singular matrix of singular decomposition,
step S103, updating Y by equation 3 (k+1) . Wherein, formula 3 is:
Figure SMS_15
,Y (k+1) represents the updated value of Y after the (k+1) th iteration, N k N value, Y representing the kth iteration Ω And an output result image representing Ω.
Step S104, updating N through formula 4 k+1 . Wherein, formula 4 is
Figure SMS_16
Lambda is the regularization parameter, N k+1 Representing the updated value of N after the (k+1) th iteration.
Step S105, update P by equation 5 k+1 . Wherein, formula 5 is
Figure SMS_17
,P k+1 Representing the updated value of P after the (k+1) th iteration.
Step S106, update Q through equation 6 k+1 . Wherein, formula 6 is:
Figure SMS_18
,Q k+1 representing the updated value of Q after the (k+1) th iteration.
Step S107, updating the multipliers μ and β by μ=tμ, β=tβ, wherein
Figure SMS_19
Step S108, repeating steps S101-S107 until meeting the convergence condition:
Figure SMS_20
,F=2。
in summary, according to the method for detecting the small defects on the surface of the workpiece in the industrial detection according to the embodiment of the invention, firstly, the optimal threshold thr_best of the model is obtained by using the defect searching algorithm, then the potential defect positions of the data set of the detection model of the surface of the workpiece are searched according to the optimal threshold thr_best of the model, and then, only the images of the potential defect positions are subjected to low-rank matrix enhancement according to the low-rank matrix enhancement algorithm, and the enhanced images are adopted for carrying out detection model training, so that the algorithm processing time can be reduced, the detection rate of the small defects by the model can be effectively improved, the actual industrial production requirements can be met, and the cost can be effectively controlled without a high-resolution camera.
Furthermore, the invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for detecting small defects on a workpiece surface in industrial detection.
According to the non-transitory computer readable storage medium, when the computer program stored on the storage medium is executed by a processor, firstly, a model optimal threshold thr_best is obtained by using a defect searching algorithm, then, the potential defect position of a data set of a workpiece surface defect detection model is searched according to the model optimal threshold thr_best, then, only the potential defect position image is subjected to low-rank matrix enhancement according to a low-rank matrix enhancement algorithm, and the enhanced image is adopted to carry out detection model training, so that the algorithm processing time can be reduced, the detection rate of the model to small defects can be effectively improved, the actual industrial production requirements can be met, a high-resolution camera is not needed, and the cost can be effectively controlled.
In the description of the present invention, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. The meaning of "a plurality of" is two or more, unless specifically defined otherwise.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily for the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order from that shown or discussed, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present invention.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (4)

1. The method for detecting the small defects on the surface of the workpiece in industrial detection is characterized by comprising the following steps of:
step S1, collecting a workpiece image and marking defects;
s2, convolving the workpiece image with a Gaussian filter kernel;
step S3, performing maximum pooling operation on the convolved image by adopting a 2 x 2 kernel;
step S4, repeating the steps S2-S3 twice to extract the characteristic images;
step S5, carrying out convolution operation on the characteristic image and local extremum operators in four directions, and obtaining a convolution result, wherein the four directions comprise: +x-direction, +y-direction, -x-direction, and-y-direction;
step S6, judging the convolution result, wherein if the convolution result is larger than a threshold thr, the pixel value of the current position is set to be 1, and if the convolution result is smaller than or equal to the threshold thr, the pixel value of the current position is set to be 0, so that 4 binarization graphs are generated;
step S7, adding the pixel values of the same positions of the 4 binarization graphs to obtain a pixel value T of each position, and judging the pixel value T of each position, wherein if t=4, the pixel value of the current position is set to 1, and if t+.4, the pixel value of the current position is set to 0, so as to generate a first Mask image M1 corresponding to the workpiece image;
step S8, solving the maximum inscribed rectangular outline of the first Mask image M1, setting the pixels in the inscribed rectangular outline as 1, setting the pixels outside the inscribed rectangular outline as 0, and obtaining a second Mask image M2;
step S9, generating a first amplified image I2 by amplifying the set times of the workpiece images, and generating a second amplified image M3 by amplifying the set times of the second Mask image M2;
step S10, solving IOU values of the maximum inscribed rectangular outline of the second amplified image M3 and each GT frame of the first amplified image I2, and solving an average IOU_MEAN of the IOU values of all GT frames of the first amplified image I2;
step S11, traversing the threshold thr from 255 to 0 once, repeatedly executing the steps S2-S10, and taking the maximum value of the threshold thr meeting IOU_MEAN >0.5 as the optimal threshold of the current workpiece image;
step S12, respectively executing steps S2-S11 on all the workpiece images acquired in the step S1, counting the optimal threshold values of all the workpiece images, and taking the minimum value in the optimal threshold values of all the workpiece images as a model optimal threshold value thr_best;
step S13, acquiring a dataset of a workpiece surface defect detection model, and executing steps S2-S9 on images of the dataset, wherein the threshold value in step S5 is set as the optimal model threshold value thr_best when the steps S2-S9 are executed;
step S14, obtaining an image block Y of which the pixel value of a second amplified image M3 in the image of the data set is 1 and corresponds to the position of a first amplified image I2, and carrying out image enhancement on the image block Y by adopting a low-rank matrix enhancement algorithm;
and S15, training the workpiece surface defect detection model by adopting the enhanced data set.
2. The method for detecting small defects on a surface of a workpiece in industrial inspection according to claim 1, wherein the workpiece image is magnified by a set magnification and the second Mask image M2 is magnified by a set magnification by a proximity interpolation method.
3. The method for detecting small defects on a surface of a workpiece in industrial inspection according to claim 2, wherein the set multiple is 16 times.
4. A non-transitory computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the method for detecting small defects on the surface of a workpiece in industrial inspection according to any one of claims 1-3.
CN202310391809.0A 2023-04-13 2023-04-13 Workpiece surface small defect detection method in industrial detection Active CN116109640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310391809.0A CN116109640B (en) 2023-04-13 2023-04-13 Workpiece surface small defect detection method in industrial detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310391809.0A CN116109640B (en) 2023-04-13 2023-04-13 Workpiece surface small defect detection method in industrial detection

Publications (2)

Publication Number Publication Date
CN116109640A true CN116109640A (en) 2023-05-12
CN116109640B CN116109640B (en) 2023-08-18

Family

ID=86264178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310391809.0A Active CN116109640B (en) 2023-04-13 2023-04-13 Workpiece surface small defect detection method in industrial detection

Country Status (1)

Country Link
CN (1) CN116109640B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130114879A1 (en) * 2011-11-09 2013-05-09 Pratt & Whitney Method and System for Automated Defect Detection
CN105260998A (en) * 2015-11-16 2016-01-20 华东交通大学 MCMC sampling and threshold low-rank approximation-based image de-noising method
WO2018165753A1 (en) * 2017-03-14 2018-09-20 University Of Manitoba Structure defect detection using machine learning algorithms
CN111862027A (en) * 2020-07-15 2020-10-30 常州大学 Textile flaw detection method based on low-rank sparse matrix decomposition
CN113256608A (en) * 2021-06-17 2021-08-13 常州微亿智造科技有限公司 Workpiece defect detection method and device
CN115205288A (en) * 2022-09-14 2022-10-18 江苏智云天工科技有限公司 Industrial defect detection method and device
CN115861220A (en) * 2022-11-28 2023-03-28 江苏理工学院 Cold-rolled strip steel surface defect detection method and system based on improved SSD algorithm

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130114879A1 (en) * 2011-11-09 2013-05-09 Pratt & Whitney Method and System for Automated Defect Detection
CN105260998A (en) * 2015-11-16 2016-01-20 华东交通大学 MCMC sampling and threshold low-rank approximation-based image de-noising method
WO2018165753A1 (en) * 2017-03-14 2018-09-20 University Of Manitoba Structure defect detection using machine learning algorithms
CN111862027A (en) * 2020-07-15 2020-10-30 常州大学 Textile flaw detection method based on low-rank sparse matrix decomposition
CN113256608A (en) * 2021-06-17 2021-08-13 常州微亿智造科技有限公司 Workpiece defect detection method and device
CN115205288A (en) * 2022-09-14 2022-10-18 江苏智云天工科技有限公司 Industrial defect detection method and device
CN115861220A (en) * 2022-11-28 2023-03-28 江苏理工学院 Cold-rolled strip steel surface defect detection method and system based on improved SSD algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李振兴;张义平;丁震龙;: "基于图像像素级分割与标记映射的工件表面微小缺陷检测算法", 组合机床与自动化加工技术, no. 01 *

Also Published As

Publication number Publication date
CN116109640B (en) 2023-08-18

Similar Documents

Publication Publication Date Title
CN110189255B (en) Face detection method based on two-stage detection
CN108961180B (en) Infrared image enhancement method and system
CN109632808B (en) Edge defect detection method and device, electronic equipment and storage medium
CN108827181B (en) Vision-based plate surface detection method
KR102606931B1 (en) Static soiling detection and correction
CN110706224B (en) Optical element weak scratch detection method, system and device based on dark field image
CN116309510A (en) Numerical control machining surface defect positioning method and device
CN116777907A (en) Sheet metal part quality detection method
CN113706464B (en) Printed matter appearance quality detection method and system
CN113109368A (en) Glass crack detection method, device, equipment and medium
CN113012157A (en) Visual detection method and system for equipment defects
CN113066088A (en) Detection method, detection device and storage medium in industrial detection
CN109300127A (en) Defect inspection method, device, computer equipment and storage medium
CN113780110A (en) Method and device for detecting weak and small targets in image sequence in real time
CN114550021A (en) Surface defect detection method and device based on feature fusion
CN114842430B (en) Vehicle information identification method and system for road monitoring
CN107895371B (en) Textile flaw detection method based on peak coverage value and Gabor characteristics
CN114648611B (en) Three-dimensional reconstruction method and device for local orbit function
CN112163996A (en) Flat-angle video fusion method based on image processing
CN113744142B (en) Image restoration method, electronic device and storage medium
CN113436218B (en) SAR image edge detection method based on Gaussian filtering and mean filtering
CN116109640B (en) Workpiece surface small defect detection method in industrial detection
JP4405407B2 (en) Defect inspection equipment
Wang et al. A bilateral filtering based ringing elimination approach for motion-blurred restoration image
CN111899297B (en) Method for extracting center of light stripe of line structure

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