CN115147427A - Visual detection method and system for resistance defects on PCB and computing device - Google Patents

Visual detection method and system for resistance defects on PCB and computing device Download PDF

Info

Publication number
CN115147427A
CN115147427A CN202211081834.0A CN202211081834A CN115147427A CN 115147427 A CN115147427 A CN 115147427A CN 202211081834 A CN202211081834 A CN 202211081834A CN 115147427 A CN115147427 A CN 115147427A
Authority
CN
China
Prior art keywords
image
detection
resistor
data
defects
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.)
Pending
Application number
CN202211081834.0A
Other languages
Chinese (zh)
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.)
Suzhou Dinnar Automation Technology Co Ltd
Original Assignee
Suzhou Dinnar Automation 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 Suzhou Dinnar Automation Technology Co Ltd filed Critical Suzhou Dinnar Automation Technology Co Ltd
Priority to CN202211081834.0A priority Critical patent/CN115147427A/en
Publication of CN115147427A publication Critical patent/CN115147427A/en
Pending legal-status Critical Current

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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/02Affine transformations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/10Image enhancement or restoration using non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • 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/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • 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/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20056Discrete and fast Fourier transform, [DFT, FFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation
    • 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/30141Printed circuit board [PCB]

Landscapes

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

Abstract

The invention discloses a visual detection method, a system and a computing device for resistance defects on a PCB (printed Circuit Board), comprising the following steps of: the method comprises the steps of collecting early-stage data, processing data, obtaining information, training a model, detecting defects and outputting detection results. According to the invention, the ROI picture is obtained from the training set original image and the resistance original image to be detected, the important characteristic information in the ROI picture is extracted and is transmitted into the SVM for training as data, so that the detection speed and the detection precision are improved, and the false alarm rate is reduced; the ROI picture is subjected to data processing such as calibration, angle rotation and the like, so that the detection picture is compared with a pose closer to a template picture in a detection model, the influence of the size, position and angle difference of a resistor on a detection result when the image is shot is eliminated, and the false alarm rate of detection is reduced; the whole working process is smooth, the automation degree is high, and the working efficiency is high.

Description

Visual detection method and system for resistance defects on PCB and computing device
Technical Field
The invention relates to the technical field of machine vision, in particular to a visual detection method, a system and computing equipment for resistance defects on a PCB (printed circuit board).
Background
In the 3C digital field, the quality problem of resistor attachment on a PCB board directly affects the performance of a product, so that the quality of the resistor attachment is critical after the resistor attachment. The traditional manual detection has the defects of low detection efficiency, high omission factor, high cost and the like. And the switching between different products is difficult to realize a universal detection method. In the machine vision field in recent years, the detection of resistor attachment needs to be specially processed according to different conditions due to the difference of size, position and angle in the attachment process, and a specific algorithm of a specified type needs to be written.
Therefore, a visual detection method, a system and a computing device for resistance defects on a PCB are developed, a feature extraction algorithm and an SVM (Support Vector Machine) are combined, a universal detection method for different products can be realized, the detection rate is improved, the false alarm rate is reduced, the production efficiency is improved, and the method, the system and the computing device have practical significance obviously.
Disclosure of Invention
The invention aims to provide a visual detection method, a system and a computing device for resistance defects on a PCB (printed Circuit Board), which reduce the training speed and the detection speed of a model by extracting characteristic information and combining an SVM (support vector machine) training method.
In order to achieve the purpose, the invention adopts the technical scheme that: a visual detection method for resistance defects on a PCB comprises the following steps:
s1, collecting early-stage data: acquiring defect data and data without defects by using photographic equipment by an acquirer, and making an original image of a training set;
s2, data processing: positioning the original image Of the training set obtained in the step S1, obtaining a Region Of Interest (ROI) picture and preprocessing the ROI picture to manufacture a training set preprocessed image;
s3, information acquisition: extracting characteristic information of the resistors in the preprocessed images of the training set through an image segmentation algorithm, and sorting the characteristic information into a one-dimensional array;
s4, model training: training by using a Support Vector Machine (SVM) through a maximum class spacing method to obtain a detection model;
s5, defect detection: acquiring a detection image, acquiring an original image of a resistor to be detected, preprocessing the original image, extracting characteristic information of the resistor to be detected in the image through an image segmentation algorithm, and sorting the characteristic information into a one-dimensional array; inputting the feature information of the image conversion into the detection model trained in the step S4 for detection, and outputting detection data;
s6, outputting a detection result: the detection data outputted in S5 is compared with a threshold value, and it is judged as OK or NG and recorded.
In the step S1, in the defect data acquisition process, a technician needs to determine a type of a defect that may occur according to a production condition of a product, and an acquirer uses a photographing device to acquire various previous-stage data according to the type of the defect; the number of data acquisitions without defects is greater than the number of data acquisitions with defects; when data without defects and defect data are acquired, environmental variables are completely consistent, and the influence of the acquisition environment on the acquired image is avoided.
Preferably, the method for positioning the acquired original images of the training set in step S2 includes performing product positioning on the original images of the training set by using a positioning algorithm, acquiring ROI position information, and performing affine transformation.
Preferably, the positioning method comprises one or a combination of a center positioning method or a product edge extraction algorithm.
Preferably, the method for acquiring and preprocessing the ROI picture in step S2 includes extracting the ROI according to the acquired ROI position information and forming the ROI picture, and performing calibration, positioning, and angle rotation operations on the ROI picture; and then transforming the image to a frequency spectrum by using fast Fourier transform to perform high-pass filtering processing, and then transforming the image to an image space by using inverse Fourier transform.
In the above, the template picture needs to be acquired before the ROI picture is calibrated, positioned, and rotated, and all the shapes of the ROI picture need to be adjusted to be close to the template picture.
Preferably, the fast fourier transform formula is:
Figure 577552DEST_PATH_IMAGE001
wherein, the first and the second end of the pipe are connected with each other,xyis a space domain variable;uvis a frequency domain variable.
In the above, the edge contrast is obviously enhanced by adopting fast Fourier transform, so that the outline information of the sample is enhanced, and the detection result is more accurate.
Preferably, in step S3, the characteristic information of the resistor includes a center position, an area, length and width information, center-of-gravity position information, a geometric moment of the current product, a convexity of the product, and a squareness of the product.
Preferably, the geometrical moments of the current product comprise zero order moments, first order moments and second order moments; the zero moment represents the quality of the image, namely the sum of the image gray levels; the first moment is used for solving the central position of the image; the second moment is the moment of inertia.
Preferably, the formula of the zero order moment is:
Figure 570915DEST_PATH_IMAGE002
the formula of the first moment is as follows:
Figure 138294DEST_PATH_IMAGE003
the formula of the second moment is as follows:
Figure 875306DEST_PATH_IMAGE004
wherein, the first and the second end of the pipe are connected with each other,Gis the gray value of the current point;ithe abscissa of the current point is;jis the ordinate of the current point.
Preferably, in step S4, the input data of the SVM includes the feature information acquired in step S3 and a label corresponding to the training set preprocessed image, where the label corresponding to the training set preprocessed image is NG or OK of the product corresponding to the picture.
Specifically, the feature information and the corresponding labels are input into the SVM, so that the time for model training is shortened, the detection precision is improved, specifically, the time for training is short, only 3s are needed for 1000 pictures, and the time for training is far shorter than that for deep learning of the model. In addition, the SVM has excellent generalization capability, but is more suitable for small sample training, the number of the sample images acquired by the SVM model is 30-100 and is far smaller than that of the samples required by a deep learning model, and the SVM model can obtain a result output which is much better than that of other algorithms on a small sample. The SVM model is trained by adopting a maximum inter-class variance method so as to reduce the misclassification probability. Compared with the method combining PCA (Principal Components Analysis) and SVM (support vector machine) in the prior art, the method has the advantages of high speed, high detection rate and low false alarm because the method extracts important characteristic information of the picture instead of reducing the dimension of a set of all information.
Preferably, in step S5, the method for acquiring the detection image includes acquiring an original image of the resistor to be detected by using a photographic device;
the method for preprocessing the original image of the resistor to be detected comprises the steps of calibrating, positioning, rotating an angle, matching the image, carrying out affine transformation, intercepting a resistor detection area and carrying out Fourier transformation on the image;
the characteristic information of the resistor to be tested comprises the center position, the area, the length and the width information, the gravity center position information, the geometric moment of the product to be tested, the convexity and the rectangularity of the product.
In the above, the method for preprocessing the original image of the resistor to be measured includes using a positioning algorithm to perform product positioning on the original image of the resistor to be measured, acquiring ROI position information, and performing affine transformation; the positioning method comprises one or a combination of a center positioning method and a product edge extraction algorithm; extracting the ROI according to the acquired ROI position information and forming an ROI picture, and performing calibration, positioning and angle rotation operations on the ROI picture to enable the shape of the ROI picture to be close to a template picture adopted during detection model training, so that the picture to be detected is compared with a sample in a model in a closer pose, and the false alarm rate of detection can be reduced; and then, transforming the image to a frequency spectrum by using fast Fourier transform to perform high-pass filtering processing, and then transforming the image to an image space by using inverse Fourier transform.
In the above, the method for extracting the feature information of the resistor to be tested is consistent with the method for extracting the feature information of the resistor in the training set preprocessed image, and the type of the feature information of the resistor to be tested is consistent with the type of the feature information of the resistor in the training set preprocessed image, that is, the geometric moment of the product to be tested includes zero order moment, first order moment, and second order moment.
In the above, the threshold in step S6 includes a threshold set by human or a threshold simulated by the detection model.
The application also claims a system for visually inspecting a resistance defect on a PCB board, carrying out the method described above, comprising:
the image acquisition module is used for acquiring an original image of the training set and an original image of the resistor to be detected;
the image processing model is used for carrying out image processing on the original images of the training set and the original images of the resistors to be detected to obtain an ROI picture and corresponding characteristic information;
the model training module is used for inputting data obtained by processing original images of a training set into the SVM and training the data to obtain a detection model;
and the defect detection module is used for inputting the characteristic information of the resistor to be detected into the detection model, outputting the detection result and judging the detection result to be NG or OK.
The application also claims a computing device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor, when executing the computer program, implements a method as described above; the processor setting is open setting for external parameters.
The method is provided with open setting of external parameters, and specifically, in the steps, the operations of calibrating, positioning, angle rotation, image matching, affine transformation, resistance detection area interception and the like of the picture can be set through the open parameters. Therefore, after the position/posture of a detection sample is changed, only the parameters are manually set for adjustment, and secondary development of source codes is not needed, so that the debugging time is greatly reduced, and the universality of the detection method and the detection system is improved. In other words, the sample data set can be manufactured only by changing the position of the resistor by using the source data processing method for replacing the product. After the algorithm is well done, the algorithm can be switched among different products by leading the algorithm into the specified path and switching the data path under the open parameters, so that the algorithm is convenient, fast and stable.
Due to the application of the technical scheme, compared with the prior art, the invention has the following advantages:
1. compared with a method adopting a PCA and SVM combined mode in the prior art, the method obtains an ROI picture from a training set original image and a resistance original image to be detected, extracts important characteristic information in the ROI picture, transmits the important characteristic information into the SVM to be trained as data, and does not reduce the dimension of a set of all information, so that the detection speed and the detection precision are improved, and the false alarm rate is reduced;
2. according to the method, the original images of the training set and the original images of the resistor to be detected are positioned and subjected to radial transformation, and the ROI images are subjected to data processing such as calibration, angle rotation and the like, so that the detection images are compared at a pose closer to the template images in the detection model, the influence of the size, position and angle difference of the resistor on the detection result when the images are shot is eliminated, and the false alarm rate of detection is reduced;
3. according to the method, the edge contrast of the detected image is obviously enhanced by performing fast Fourier transform, high-pass filtering processing and inverse Fourier transform on the detected image, so that the outline information of the image is enhanced, and the detection result is more accurate;
4. according to the invention, the open setting of external parameters is set in the source data of the processor, the parameters are only manually set for adjustment after the position/posture of a detection sample is changed, and secondary development of a source code is not needed, so that the debugging time is greatly reduced, and the universality of the detection method and the detection system is improved;
5. the method is simple, the whole working process is smooth, the automation degree is high, and the working efficiency is high.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that some of the drawings in the following description are embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a detection method according to an embodiment of the present invention.
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.
Example one
As shown in fig. 1, the present embodiment relates to a method for visually inspecting a resistance defect on a PCB, comprising the following steps:
s1, collecting early-stage data: acquiring defect data and data without defects by using photographic equipment by an acquirer, and making an original image of a training set;
s2, data processing: positioning the original image Of the training set obtained in the step S1, obtaining a Region Of Interest (ROI) picture and preprocessing the ROI picture to manufacture a training set preprocessed image;
s3, information acquisition: extracting characteristic information of the resistors in the preprocessed images of the training set through an image segmentation algorithm, and sorting the characteristic information into a one-dimensional array;
s4, model training: training by using a Support Vector Machine (SVM) through a maximum class spacing method to obtain a detection model;
s5, defect detection: acquiring a detection image, acquiring an original image of a resistor to be detected, preprocessing the original image, extracting characteristic information of the resistor to be detected in the image through an image segmentation algorithm, and sorting the characteristic information into a one-dimensional array; inputting the feature information of the image conversion into the detection model trained in the step S4 for detection, and outputting detection data;
s6, outputting a detection result: the detection data outputted in S5 is compared with a threshold value, and it is judged to be OK or NG and recorded.
In the step S1, in the defect data acquisition process, a technician needs to determine the types of defects that may occur according to the production conditions of the product, and an acquisition worker uses a camera to acquire diverse early-stage data according to the types of defects; the number of data acquisitions without defects is greater than the number of data acquisitions with defects; when data without defects and data with defects are acquired, environment variables are completely consistent, and the influence of the acquisition environment on the acquired images is avoided.
Further, the method for positioning the acquired original images of the training set in the step S2 includes performing product positioning on the original images of the training set by using a positioning algorithm, acquiring ROI position information, and performing affine transformation.
Further, the positioning method includes one or a combination of a center positioning method and a product edge extraction algorithm.
Furthermore, the method for acquiring and preprocessing the ROI picture in the step S2 comprises the steps of extracting the ROI according to the acquired ROI position information, forming the ROI picture, and performing calibration, positioning and angle rotation on the ROI picture; and then, transforming the image to a frequency spectrum by using fast Fourier transform to perform high-pass filtering processing, and then transforming the image to an image space by using inverse Fourier transform.
In the above, the template picture needs to be acquired before the ROI picture is calibrated, positioned, and rotated, and all the shapes of the ROI picture need to be adjusted to be close to the template picture.
Further, the fast fourier transform formula is:
Figure 398691DEST_PATH_IMAGE001
wherein the content of the first and second substances,xyis a space domain variable;uvis a frequency domain variable.
In the above, the edge contrast is obviously enhanced by adopting the fast Fourier transform, and the outline information of the sample is enhanced, so that the detection result is more accurate.
Further, in step S3, the characteristic information of the resistor includes the center position, the area, the length and the width information of the resistor, the position information of the center of gravity, the geometric moment of the current product, the convexity of the product, and the rectangularity of the product.
Further, the geometric moments of the current product include a zero order moment, a first order moment and a second order moment; the zero moment represents the quality of the image, namely the sum of the image gray levels; the first moment is used for solving the central position of the image; the second moment is a moment of inertia.
Further, the formula of the zero order moment is as follows:
Figure 828535DEST_PATH_IMAGE002
the formula of the first moment is as follows:
Figure 132478DEST_PATH_IMAGE003
the formula of the second moment is as follows:
Figure 407601DEST_PATH_IMAGE005
wherein the content of the first and second substances,Gis the gray value of the current point;ithe abscissa of the current point is;jis the ordinate of the current point.
Further, in step S4, the input data of the SVM includes the feature information acquired in step S3 and a label corresponding to the training set preprocessed image, where the label corresponding to the training set preprocessed image is NG or OK of the product corresponding to the picture.
Specifically, the feature information and the corresponding labels are input into the SVM, so that the time for model training is shortened, and the detection precision is improved. In addition, the SVM has excellent generalization capability, but is more suitable for small sample training, the number of the sample images acquired by the SVM model is 30-100 and is far smaller than that of the samples required by a deep learning model, and the SVM model can obtain a result output which is much better than that of other algorithms on a small sample. The SVM model is trained by adopting a maximum inter-class variance method so as to reduce the misclassification probability. Compared with the method combining PCA and SVM in the prior art, the method has the advantages of high speed, high detectable rate and low false alarm because the method extracts important characteristic information of the picture instead of reducing the dimension of a set of all information.
Further, in step S5, the method for collecting the detection image includes collecting an original image of the resistor to be detected by using a camera;
the method for preprocessing the original image of the resistor to be detected comprises the steps of calibrating, positioning, rotating an angle, matching the image, carrying out affine transformation, intercepting a resistor detection area and carrying out Fourier transformation on the image;
the characteristic information of the resistor to be tested comprises the center position, the area, the length and the width information, the gravity center position information, the geometric moment of the product to be tested, the convexity and the rectangularity of the product.
In the above, the method for preprocessing the original image of the resistor to be measured includes positioning the product of the original image of the resistor to be measured by using a positioning algorithm, acquiring the position information of the ROI, and performing affine transformation; the positioning method comprises one or a combination of a center positioning method and a product edge extraction algorithm; extracting the ROI according to the acquired ROI position information and forming an ROI picture, and performing calibration, positioning and angle rotation operations on the ROI picture to enable the shape of the ROI picture to be close to a template picture adopted during detection model training, so that the picture to be detected is compared with a sample in a model in a closer pose, and the false alarm rate of detection can be reduced; and then transforming the image to a frequency spectrum by using fast Fourier transform to perform high-pass filtering processing, and then transforming the image to an image space by using inverse Fourier transform.
In the above, the method for extracting the characteristic information of the resistor to be measured is consistent with the method for extracting the characteristic information of the resistor in the training set preprocessed image, and the type of the characteristic information of the resistor to be measured is consistent with the type of the characteristic information of the resistor in the training set preprocessed image, that is, the geometric moment of the product to be measured includes the zero-order moment, the first-order moment and the second-order moment.
In the above, the threshold in step S6 includes a threshold set by human or a threshold simulated by the detection model.
Example two
The present embodiment is performed on the basis of the first embodiment, and the same parts as the first embodiment are not repeated.
The embodiment relates to a visual detection system for resistance defects on a PCB (printed circuit board), which carries the method of the first embodiment and comprises the following steps:
the image acquisition module is used for acquiring an original image of the training set and an original image of the resistor to be detected;
the image processing model is used for carrying out image processing on the original images of the training set and the original images of the resistors to be detected to obtain an ROI picture and corresponding characteristic information;
the model training module is used for inputting data obtained by processing original images of a training set into the SVM and training the data to obtain a detection model;
and the defect detection module is used for inputting the characteristic information of the resistor to be detected into the detection model, outputting the detection result and judging the detection result to be NG or OK.
EXAMPLE III
The application also claims a computing device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor, when executing the computer program, implements a method as described above; the processor setting is open setting for external parameters.
The method is provided with open setting of external parameters, and specifically, in the steps, the operations of calibrating, positioning, angle rotation, image matching, affine transformation, resistance detection area interception and the like of the picture can be set through the open parameters. Therefore, after the position/posture of a detection sample is changed, only parameters are manually set for adjustment, and secondary development of source codes is not needed, so that the debugging time is greatly reduced, and the universality of the detection method and the detection system is improved. In other words, the sample data set can be manufactured only by changing the position of the resistor by using the source data processing method for replacing the product. After the algorithm is well done, the algorithm can be switched among different products by leading the algorithm into the specified path and switching the data path under the open parameters, so that the algorithm is convenient, fast and stable.
Further, the computer device may include one or more processors, such as one or more Central Processing Units (CPUs) or Graphics Processors (GPUs), each of which may implement one or more hardware threads. The computer device may also comprise any memory for storing any kind of information, such as code, settings, data etc., having thereon a computer program being executable on a processor, which computer program, when being executed by said processor, is able to carry out the instructions of the method as described above. The computer device may also include input/output interfaces (I/O) for receiving various inputs (via input devices) and for providing various outputs (via output devices). The computer device may also include one or more network interfaces for exchanging data with other devices via one or more communication links. One or more communication buses couple the above-described components together.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A visual detection method for resistance defects on a PCB is characterized by comprising the following steps:
s1, collecting early-stage data: acquiring defect data and data without defects by using photographic equipment by an acquirer, and making an original image of a training set;
s2, data processing: positioning the original image of the training set obtained in the step S1, obtaining an ROI picture and preprocessing the ROI picture to manufacture a training set preprocessed image;
s3, information acquisition: extracting characteristic information of the resistors in the preprocessed images of the training set through an image segmentation algorithm, and sorting the characteristic information into a one-dimensional array;
s4, model training: training by using an SVM through a maximum class interval method to obtain a detection model;
s5, defect detection: acquiring a detection image, acquiring an original image of a resistor to be detected, preprocessing the original image, extracting characteristic information of the resistor to be detected in the image through an image segmentation algorithm, and sorting the characteristic information into a one-dimensional array; inputting the feature information of the image conversion into the detection model trained in the step S4 for detection, and outputting detection data;
s6, outputting a detection result: the detection data outputted in S5 is compared with a threshold value, and it is judged as OK or NG and recorded.
2. The visual inspection method of the resistor defects on the PCB as recited in claim 1, wherein the step S2 of positioning the obtained original images of the training set comprises using a positioning algorithm to perform product positioning on the original images of the training set, obtaining ROI position information, and performing affine transformation.
3. The visual inspection method of the resistor defects on the PCB as recited in claim 2, wherein the method of obtaining and preprocessing the ROI picture in step S2 comprises extracting the ROI according to the obtained ROI position information and forming the ROI picture, and performing calibration, positioning and angle rotation operations on the ROI picture; and then transforming the image to a frequency spectrum by using fast Fourier transform to perform high-pass filtering processing, and then transforming the image to an image space by using inverse Fourier transform.
4. The visual inspection method of the resistance defects on the PCB as recited in claim 3, wherein the fast Fourier transform formula is:
Figure DEST_PATH_IMAGE001
wherein the content of the first and second substances,xyis a space domain variable;uvis a frequency domain variation.
5. The visual inspection method for defects of resistors on PCB as claimed in claim 1, wherein in step S3, the characteristic information of resistors includes center position, area, length and width information, center of gravity position information, geometric moment of current product, convexity of product and rectangularity of product.
6. The visual inspection method of the resistor defects on the PCB as recited in claim 5, wherein the geometrical moments of the current product comprise zero order moment, first order moment, second order moment; the zero moment represents the quality of the image, namely the sum of the image gray levels; the first moment is used for solving the central position of the image; the second moment is a moment of inertia.
7. The visual inspection method of the resistor defects on the PCB as recited in claim 1, wherein in step S4, the input data of the SVM includes the feature information obtained in step S3 and a label corresponding to the pre-processed image of the training set, and the label corresponding to the pre-processed image of the training set is NG or OK of the product corresponding to the picture.
8. The visual inspection method for the defects of the resistors on the PCB as claimed in claim 1, wherein in the step S5, the method for collecting the inspection image comprises collecting an original image of the resistor to be inspected by using a photographic device;
the method for preprocessing the original image of the resistor to be detected comprises the steps of calibrating, positioning, rotating an angle, matching the image, carrying out affine transformation, intercepting a resistor detection area and carrying out Fourier transformation on the image;
the characteristic information of the resistor to be tested comprises the center position, the area, the length and the width information, the gravity center position information, the geometric moment of the product to be tested, the convexity and the rectangularity of the product.
9. A visual inspection system for resistance defects on a PCB board carrying the method of any one of claims 1-8, comprising:
the image acquisition module is used for acquiring an original image of the training set and an original image of the resistor to be detected;
the image processing model is used for carrying out image processing on the original images of the training set and the original images of the resistors to be detected to obtain an ROI picture and corresponding characteristic information;
the model training module is used for inputting data obtained by processing original images of a training set into the SVM and training the data to obtain a detection model;
and the defect detection module is used for inputting the characteristic information of the resistor to be detected into the detection model, outputting the detection result and judging the detection result to be NG or OK.
10. A computing device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor, when executing the computer program, implements the method of any one of claims 1-8; the processor setting is open setting for external parameters.
CN202211081834.0A 2022-09-06 2022-09-06 Visual detection method and system for resistance defects on PCB and computing device Pending CN115147427A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211081834.0A CN115147427A (en) 2022-09-06 2022-09-06 Visual detection method and system for resistance defects on PCB and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211081834.0A CN115147427A (en) 2022-09-06 2022-09-06 Visual detection method and system for resistance defects on PCB and computing device

Publications (1)

Publication Number Publication Date
CN115147427A true CN115147427A (en) 2022-10-04

Family

ID=83415922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211081834.0A Pending CN115147427A (en) 2022-09-06 2022-09-06 Visual detection method and system for resistance defects on PCB and computing device

Country Status (1)

Country Link
CN (1) CN115147427A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109685774A (en) * 2018-12-10 2019-04-26 桂林理工大学 Varistor open defect detection method based on depth convolutional neural networks
CN113298798A (en) * 2021-06-10 2021-08-24 上海电机学院 Main journal defect detection method based on feature fusion

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109685774A (en) * 2018-12-10 2019-04-26 桂林理工大学 Varistor open defect detection method based on depth convolutional neural networks
CN113298798A (en) * 2021-06-10 2021-08-24 上海电机学院 Main journal defect detection method based on feature fusion

Similar Documents

Publication Publication Date Title
Xu et al. Canny edge detection based on Open CV
US11240441B2 (en) Method, device, system and computer-program product for setting lighting condition and storage medium
CN110706293B (en) SURF feature matching-based electronic component positioning and detecting method
CN111260731A (en) Checkerboard sub-pixel level corner point self-adaptive detection method
CN107085728B (en) Method and system for effectively scoring probe in image by using vision system
CN105975979B (en) A kind of instrument detecting method based on machine vision
US6718074B1 (en) Method and apparatus for inspection for under-resolved features in digital images
CN115619787B (en) UV glue defect detection method, system, equipment and medium
CN115775236A (en) Surface tiny defect visual detection method and system based on multi-scale feature fusion
CN108335310B (en) Portable grain shape and granularity detection method and system
CN116071315A (en) Product visual defect detection method and system based on machine vision
CN112381751A (en) Online intelligent detection system and method based on image processing algorithm
CN111882547A (en) PCB missing part detection method based on neural network
KR20220026439A (en) Apparatus and method for checking whether a part is inserted in PCB
CN112381177A (en) Dial digital character recognition method and system based on deep learning
CN115147427A (en) Visual detection method and system for resistance defects on PCB and computing device
CN117079286A (en) Identification method and identification system for pointer instrument
CN115131355B (en) Intelligent method for detecting waterproof cloth abnormity by using electronic equipment data
CN113008470B (en) Gas leakage detection device and gas leakage detection method
CN112967258B (en) Display defect detection method and device for watch and computer readable storage medium
CN107230230B (en) Instrument image positioning method based on synthesis filter
CN111553910A (en) Infrared image-based thermal fault detection method for electrical equipment of large experimental device
CN111833325A (en) Colloidal gold reagent strip detection method and system based on deep learning
CN111986153B (en) Digital image correlation algorithm stability test method
TWI803393B (en) Defect detection system based on unsupervised learning and method thereof

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20221004

RJ01 Rejection of invention patent application after publication