CN111598771B - PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera - Google Patents

PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera Download PDF

Info

Publication number
CN111598771B
CN111598771B CN202010039810.3A CN202010039810A CN111598771B CN 111598771 B CN111598771 B CN 111598771B CN 202010039810 A CN202010039810 A CN 202010039810A CN 111598771 B CN111598771 B CN 111598771B
Authority
CN
China
Prior art keywords
image
matrix
splicing
module
real
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010039810.3A
Other languages
Chinese (zh)
Other versions
CN111598771A (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202010039810.3A priority Critical patent/CN111598771B/en
Publication of CN111598771A publication Critical patent/CN111598771A/en
Application granted granted Critical
Publication of CN111598771B publication Critical patent/CN111598771B/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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/32Indexing scheme for image data processing or generation, in general involving image mosaicing
    • 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]
    • 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/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention provides a PCB defect detection system based on a CCD camera, which comprises a CCD image acquisition module, and an image recombination splicing module, a defect detection module and a self-correction module which are respectively arranged on the same host computer with the CCD image acquisition module. The invention utilizes the characteristic that the linear CCD acquires images according to line scanning, and realizes the detection and the information adjustment of partial image information by controlling the number of imaging lines of the images. The invention utilizes the self-correcting module to adjust the splicing line number to obtain the image line number information and avoid the false detection. The invention effectively utilizes the linear CCD camera to effectively improve the efficiency of PCB defect detection, saves the production cost and improves the real-time property.

Description

PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera
Technical Field
The invention belongs to the technical field of PCB (printed circuit board) defect detection, and particularly relates to a PCB defect detection system and method based on a CCD (charge coupled device) camera.
Background
The PCB circuit board manufacturing process has multiple processes, defects can be generated in each process, if the fine defects can not be accurately and rapidly found in the production process, the product qualification rate can be reduced, the reliability of the product can be influenced, even the whole printed circuit board can be scrapped, and the production cost is increased. If the manufactured PCB is found to be faulty, the cost is huge, and the cost for putting the faulty PCB on the market is fatal, so that the defect detection has a very important position in the production process of the PCB. Meanwhile, in the existing PCB on-line detection method, the detection speed has a bottleneck, so the invention greatly improves the detection efficiency and saves the cost by utilizing the characteristic of scanning and imaging of the linear CCD camera.
Disclosure of Invention
Aiming at the defects in the prior art, the PCB defect detection system and method based on the CCD camera provided by the invention can improve the real-time acquisition and detection efficiency, have higher accuracy and real-time performance, and further develop the online detection of the PCB.
In order to achieve the above purpose, the invention adopts the technical scheme that:
the scheme provides a PCB defect detection system based on a CCD camera, which comprises a CCD image acquisition module, and an image recombination splicing module, a defect detection module and a self-correction module which are respectively arranged on the same upper computer with the CCD image acquisition module;
the CCD image acquisition module is used for scanning and acquiring images in real time and transmitting the images acquired by real-time scanning and the acquired standard sampling images into the image recombination and splicing module; the CCD image acquisition module comprises a CCD camera and a CCD image acquisition interface;
the image recombination and splicing module is used for receiving the image line number information transmitted by the self-correcting module, respectively performing image splicing and recombination on the input real-time acquired image and the standard sampling image according to lines according to the image line number information, and transmitting the spliced image to the defect detection module;
the defect detection module is used for calculating the brightness, the contrast and the structure of the corresponding image according to the spliced acquired image and the standard sampling image by using a structural similarity algorithm, obtaining the difference between the acquired image and the standard sampling image according to the calculation result, obtaining the defect position according to the difference and transmitting the defect position to the self-correction module;
and the self-correction module is used for adjusting the scanning line number according to the obtained defect position and inputting the adjusted line number to the image splicing module.
Based on the method, the invention also discloses a PCB defect detection method based on the CCD camera, which comprises the following steps:
s1, acquiring a standard sampling image, setting the acquisition line number of a CCD camera and the basic setting of the CCD camera, and scanning and acquiring the image in real time by using the CCD camera;
s2, inputting image line number information, and respectively carrying out image splicing recombination processing on the standard sampling image and the real-time acquisition image according to the image line number information;
s3, respectively calculating the brightness, the contrast and the structure of the spliced acquired image and the standard sampled image by using a structural similarity algorithm, judging whether defects exist according to the calculation result, if so, entering the step S4, otherwise, ending the detection, and thus completing the defect detection of the PCB;
and S4, adjusting the scanning line number according to the judgment result, taking the adjusted scanning line number information as the input image line number information in the step S2, and returning to the step S2.
Further, the matrix expression of the real-time image acquisition in step S1 is:
Figure GDA0002512320950000031
the matrix expression of the standard sampling image is as follows:
Figure GDA0002512320950000032
the method comprises the following steps of A, B, epsilon, y and eta, wherein A is a matrix of a real-time acquired image, B is a matrix of a standard sampling image, epsilon is an initial scanning position, x is the number of lines of each scanning, y is the number of columns of each scanning, and eta is an initial value of standard sampling image interception.
Still further, the step S2 includes the steps of:
s201, inputting a real-time acquisition image;
s202, inputting image line number information: setting a default value of the number of splicing lines, and calculating to obtain a next splicing line numerical value according to the default value of the number of lines;
s203, image splicing and recombining: and according to the default value of the splicing line number, carrying out image splicing recombination processing on the standard sampling image and the real-time acquisition image according to lines.
Still further, the expression of the next splice line value in step S202 is as follows:
ω′=ω+R pre +R after
where ω' is the next splice line value, R pre For the desired forward movement, R after Omega is the default value of the number of splicing lines for the required next line.
Still further, the matrix expression of the real-time acquired image after being recombined in step S203 is as follows:
Figure GDA0002512320950000041
the matrix expression of the recombined standard sampling image is as follows:
Figure GDA0002512320950000042
wherein, A 'is a recombined real-time collected image matrix, B' is a recombined standard sampling image matrix, and R pre For the desired forward movement, R after And omega is a default value of the number of splicing lines, x is the number of lines in each scanning, y is the number of columns in each scanning, and eta is an initial value of standard sampling image interception.
Still further, the step S3 includes the steps of:
s301, respectively calculating the brightness, the contrast and the structure of the spliced real-time collected image and the standard sampled image by using a structural similarity algorithm;
s302, fusing the brightness, the contrast and the structure of the real-time collected image and the standard sampled image in proportion to obtain an evaluation function;
s303, judging whether the evaluation function is larger than a preset detection threshold value T or not d If so, finishing the detection so as to finish the defect detection of the PCB, otherwise, marking the defect position in the current acquired image, outputting the current defect detection image, and entering the step S4.
Still further, the expression of the evaluation function is as follows:
F(A',B')=[L(A',B')] α [C(A',B')] β [S(A',B')] γ
Figure GDA0002512320950000043
Figure GDA0002512320950000044
Figure GDA0002512320950000051
Figure GDA0002512320950000052
Figure GDA0002512320950000053
Figure GDA0002512320950000054
Figure GDA0002512320950000055
Figure GDA0002512320950000056
wherein F (A ', B') is an evaluation function,. Mu. A' Is the pixel mean gray value, μ, of the matrix A B' Is the average gray value of pixels in the matrix B', N is the total number of pixels, x i Is the value, y, of the pixel corresponding to the matrix A i Is the value of the pixel point corresponding to the matrix B ', i is the subscript of the corresponding point in the matrix A', sigma A' Is the standard deviation, σ, of the matrix A B' Is the standard deviation of matrix B ', L (A ', B ') is the luminance contrast function of matrix A ' and matrix B ',
Figure GDA0002512320950000057
of the mean grey value of the pixels of the matrix AThe square of the square,
Figure GDA0002512320950000058
is the square of the mean gray value of the pixels of the matrix B', C 1 ,C 2 ,C 3 All are stability parameters for increasing the calculation result, C (A ', B') is a contrast ratio function of the matrix A 'and the matrix B',
Figure GDA0002512320950000059
is the variance of the matrix a' and,
Figure GDA00025123209500000510
is the variance of matrix B ', S (A ', B ') is the structural contrast function of matrix A ' and matrix B ', σ A'B' The covariance matrix A 'and the covariance matrix B' are all parameters for adjusting the three modules, A 'is a recombined real-time collected image matrix, and B' is a recombined standard sampling image matrix.
Still further, the step S4 includes the steps of:
s401, judging whether a defect detection image is input or not according to a judgment result, if so, entering a step S402, otherwise, ending the process;
s402, judging whether the previous scanning line information is needed or not, if so, setting the current line number information as the needed previous line number R pre And step S403 is carried out, otherwise, the imaging range of the current image is the initial range of the PCB, and step S403 is carried out;
s403, judging whether the subsequent scanning line information is needed or not, if so, setting the current line number information as the subsequent line number R needed after And using the number of required succeeding rows R after Completing the current image information, and entering step S404, otherwise, ending the process;
s404, the required previous row number R is set pre And the required number of post rows R after As the input image line count information in step S2, and returns to step S2.
Still further, the expression of the line number information of the input image in the step S404 is as follows:
ω′=ω+R pre +R after
where ω' is the number of lines of the output image, i.e. the next stitching line value, R pre For the desired forward movement, R after Omega is the default value of the number of splicing lines for the required next line.
The invention has the beneficial effects that:
(1) In order to overcome the defects of the existing PCB online detection technology in real time and efficiency, the invention uses the CCD as acquisition equipment, uses the PCB as a detection object, and uses technologies such as image acquisition, image processing and the like as supports to perform online defect detection on the PCB, thereby improving the real-time acquisition and detection efficiency, having higher accuracy and real time and realizing the further development of the PCB online detection. The method is carried out on the basis of using a linear CCD camera at a standard acquisition speed, utilizes the characteristics of the linear CCD camera to acquire images according to line scanning, and carries out PCB circuit board defect detection under the condition of using a structural similarity algorithm as the defect detection basis;
(2) The invention uses the linear CCD to collect images, realizes the functions of image splicing, defect detection and self-correction by utilizing the line scanning imaging characteristic of the linear CCD, simultaneously, the CCD collection module and other modules do not interfere with each other, run in parallel and realize the effect of on-line detection. The invention respectively transmits the collected image and the standard sampling image into the image restoration and restoration module and the defect detection module, the self-correction module finishes the defect detection of the PCB, and the self-correction module is used for adjusting the splicing line number, thereby completing the image information and avoiding the false detection. The invention effectively utilizes the linear CCD camera to effectively improve the efficiency of PCB defect detection, saves the production cost and improves the real-time property.
Drawings
FIG. 1 is a block diagram of the system of the present invention.
FIG. 2 is a parallel schematic diagram of an embodiment of the present invention.
FIG. 3 is a flow chart of the method of the present invention.
FIG. 4 is a flow chart of the image reorganizing and stitching module of the present invention.
FIG. 5 is a flow chart of a defect detection module according to the present invention.
FIG. 6 is a flow chart of a self-calibration module of the present invention.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate the understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and it will be apparent to those skilled in the art that various changes may be made without departing from the spirit and scope of the invention as defined and defined in the appended claims, and all matters produced by the invention using the inventive concept are protected.
Examples
As shown in fig. 1, the present invention provides a PCB defect detection system based on a CCD camera, which comprises a CCD image acquisition module, and an image recombination and splicing module, a defect detection module and a self-correction module, which are respectively arranged on the same host computer as the CCD image acquisition module;
the CCD image acquisition module is used for scanning and acquiring images in real time and transmitting the images acquired by real-time scanning and the acquired standard sampling images into the image recombination and splicing module; the CCD image acquisition module comprises a CCD camera and a CCD image acquisition interface;
the image recombination and splicing module is used for receiving the image line number information transmitted by the self-correcting module, respectively performing image splicing and recombination on the input real-time acquired image and the standard sampling image according to lines according to the image line number information, and transmitting the spliced image to the defect detection module;
the defect detection module is used for calculating the brightness, the contrast and the structure of the corresponding image by using a structure similarity algorithm according to the spliced acquired image and the standard sampling image, obtaining the difference between the acquired image and the standard sampling image according to the calculation result, obtaining the defect position according to the difference and transmitting the defect position to the self-correction module;
and the self-correction module is used for adjusting the scanning line number according to the obtained defect position and inputting the adjusted line number to the image splicing module.
In the embodiment, the parallel module is adopted, and the CCD image acquisition module works in parallel with the image recombination and splicing module, the defect detection module and the self-correction module, so that the real-time performance of detection is improved, and online detection is completed.
In this embodiment, as shown in fig. 2, the whole system operation mainly includes two major parts, namely, an acquisition program and a detection program, and both the acquisition program and the detection program are designed to operate in a parallel manner on the same upper computer. The acquisition program mainly runs an image acquisition module, the detection program mainly runs an image splicing recombination module, a defect detection module and a self-correction module. The acquisition program and the running program run in parallel from the time axis, and the linear CCD acquires images through line scanning, so that the detection program mainly splices and detects some lines in the line scanning process to form an independent program block. Each detection program block operates independently without interference and operates in a parallel mode, and each detection program detects different lines from the axis of the image acquisition line number to realize parallel operation.
The invention is carried out on the basis of using a linear CCD camera under the standard acquisition speed, utilizes the characteristic that the linear CCD acquires images according to line scanning, and carries out PCB circuit board defect detection under the condition that a structural similarity algorithm is used as the defect detection basis, because the structural similarity algorithm is used for carrying out the defect detection, a large amount of image information is needed, and the common use is mainly based on an integral image, the invention utilizes the characteristic that the linear CCD acquires images according to line scanning, realizes the detection of partial image information and the adjustable information by controlling the number of imaging lines, as shown in figure 3, and the realization method is as follows:
s1, acquiring a standard sampling image, setting the acquisition line number of a CCD camera and the basic setting of the CCD camera, and scanning and acquiring the image in real time by using the CCD camera.
In this embodiment, according to the characteristics of linear CCD imaging, the number of rows and columns of each scanning is set to be x, the number of columns is set to be y, the number of columns is set to be a fixed value, and the initial scanning position is set to be e, so that the size of the image scanned and imaged each time is x × y, and the formed matrix is:
Figure GDA0002512320950000091
meanwhile, the size of the required standard sampling image is also x y, the size of the standard sampling image is a cut-off part of the pixel line number in the image, and an original standard sampling image cutting initial value is reserved as eta, so that an imaging range matrix of the image is cut off:
Figure GDA0002512320950000092
and transmitting the real-time collected image matrix A to an image recombination and splicing module.
S2, inputting image line number information, and respectively performing image splicing recombination processing on the standard sampling image and the real-time acquisition image according to the image line number information, wherein as shown in FIG. 4, the implementation method comprises the following steps:
s201, inputting a real-time acquisition image;
s202, inputting image line number information: setting a default value of the splicing line number, and calculating to obtain a next splicing line numerical value according to the default value of the splicing line number;
the expression for the next splice line value is as follows:
ω′=ω+R pre +R after
wherein, omega' is the next splicing line value, R pre For the desired forward movement, R after Omega is a default value of the splicing line number for the needed next line;
s203, image splicing and recombination: and splicing and recombining the standard sampling image and the acquired image according to the rows according to the default value of the splicing row number, wherein the matrix expression of the real-time acquired image after recombination is as follows:
Figure GDA0002512320950000101
the matrix expression of the recombined standard sampling image is as follows:
Figure GDA0002512320950000102
wherein, A 'is a recombined real-time collected image matrix, B' is a recombined standard sampling image matrix, and R pre For the desired forward movement, R after And omega is a default value of the number of splicing lines, x is the number of lines in each scanning, y is the number of columns in each scanning, and eta is an initial value of standard sampling image interception.
In this embodiment, the image reorganization and stitching module is configured to perform image stitching on the input real-time captured image according to lines and transmit the image stitching to the defect detection module, and the image reorganization and stitching module also receives the stitching line number information transmitted by the self-correction module, so as to facilitate the processing of the next defect detection.
S3, respectively calculating the brightness, the contrast and the structure of the spliced real-time collected image and the standard sampled image by using a structure similarity algorithm, judging whether defects exist according to the calculation result, if so, entering the step S4, otherwise, finishing the detection, and thus completing the defect detection of the PCB, wherein the implementation method is shown in FIG. 5:
s301, respectively calculating the brightness, the contrast and the structure of the spliced real-time collected image and the standard sampled image by using a structural similarity algorithm;
s302, fusing the brightness, the contrast and the structure of the real-time collected image and the standard sampled image in proportion to obtain an evaluation function;
s303, judging whether the evaluation function is larger than a preset detection threshold value T or not d If so, finishing the detection so as to finish the defect detection of the PCB, otherwise, marking the defect position in the current acquired image and outputting the current defect detectionImage, and proceeds to step S4.
In this embodiment, the defect detection module is designed to perform corresponding calculation of brightness, contrast, and structure on the transmitted collected image and the standard sampling image through a structure similarity algorithm, obtain a difference between the two images through specific calculation, thereby obtaining a defect position, and if a defect exists, mark the defect and transmit the defect to the self-correction module.
In this embodiment, from the image recomposing and stitching module, the collected image matrix a 'and the standard sampling image matrix B' are transmitted. Since the image quality is restricted by the luminance information and the contrast information, when the image quality is calculated, it is necessary to consider both the structural information and the influence of the two.
In this embodiment, the average gray-scale value of the image is used as the estimation of the brightness measurement, and the average gray-scale value of the pixels of the matrix a' is:
Figure GDA0002512320950000111
the average gray-scale values of the pixels of matrix B' are:
Figure GDA0002512320950000121
taking the standard deviation of the image as a contrast estimation value, the standard deviation of the matrix A' is:
Figure GDA0002512320950000122
the standard deviation of matrix B' is:
Figure GDA0002512320950000123
the luminance contrast function of matrices a 'and B' is:
Figure GDA0002512320950000124
the contrast function for matrices A 'and B' is:
Figure GDA0002512320950000125
the structural contrast function of matrices A 'and B' is:
Figure GDA0002512320950000126
wherein,
Figure GDA0002512320950000127
combining three correlation functions of brightness, contrast and structure to obtain an evaluation function:
F(A',B')=[L(A',B')] α [C(A',B')] β [S(A',B')] γ
in the above formula, F (A ', B') is an evaluation function, μ A' Is the pixel mean gray value, μ, of the matrix A B' Is the average gray value of pixels of the matrix B', N is the total number of pixels, x i Is the value, y, of the pixel corresponding to the matrix A i Is the value of the pixel point corresponding to the matrix B ', i is the subscript of the corresponding point in the matrix A', sigma A' Is the standard deviation, σ, of the matrix A B' Is the standard deviation of matrix B ', L (A ', B ') is the luminance contrast function of matrix A ' and matrix B ',
Figure GDA0002512320950000128
which is the square of the average gray value of the pixels of the matrix a',
Figure GDA0002512320950000129
is the square of the mean gray value of the pixels of the matrix B', C 1 ,C 2 ,C 3 All are stability parameters for increasing the calculation result, C (A ', B') is a contrast ratio function of the matrix A 'and the matrix B',
Figure GDA0002512320950000131
is the variance of the matrix a' and,
Figure GDA0002512320950000132
is the variance of matrix B ', S (A ', B ') is the structural contrast function of matrix A ' and matrix B ', σ A'B' The covariance matrix A 'and the covariance matrix B' are all parameters for adjusting the three modules, A 'is a recombined real-time collected image matrix, and B' is a recombined standard sampling image matrix.
In this embodiment, the specific pixel difference in the image can be calculated through the evaluation function, so that the defect is found, and obviously, the formula judges from the pixel level, so that the formula has strong sensitivity, so that a false detection situation can occur, and the false detection situation does not exist, and the false detection situation exists, which is caused by the current image information being incomplete, and is a defect of using a structural similarity algorithm, and the defect is corrected to a certain extent in the self-correction module.
S4, adjusting the number of scanning lines according to the determination result, and taking the adjusted number of scanning lines as the number of lines of the input image in step S2, and returning to step S2, as shown in fig. 6, the implementation method is as follows:
s401, judging whether a defect detection image is input or not, if so, entering a step S402, otherwise, ending the process;
s402, judging whether the previous scanning line information is needed or not, if so, setting the current line number information as the needed previous line number R pre And step S403 is carried out, otherwise, the imaging range of the current image is the initial range of the PCB, and step S403 is carried out;
s403, judging whether the subsequent scanning line information is needed or not, if so, setting the current line number information as the subsequent line number R needed after And using the number of required succeeding rows R after Completing the current image information, and entering step S404, otherwise, ending the process;
s404, the required previous row number R is set pre And the required number of post rows R after As input image line number information in step S2, and backReturning to the step S2, the operation is carried out,
the expression of the line number information of the input image is as follows:
ω′=ω+R pre +R after
where ω' is the number of lines of the output image, i.e. the next stitching line value, R pre For the desired forward movement, R after ω is the default number of stitching rows for the desired next row.
In this embodiment, the self-correcting module aims to avoid a false detection phenomenon caused by insufficient image information by adjusting the line number information in the current image, and outputs the adjusted line number information to the image reorganizing and splicing module to complete the self-correcting process.
Through the design, the invention can improve the real-time acquisition and detection efficiency, has higher accuracy and real-time performance, and realizes the further development of the online detection of the PCB.

Claims (9)

1. A PCB circuit board defect detection system based on a CCD camera is characterized by comprising a CCD image acquisition module, an image recombination splicing module, a defect detection module and a self-correction module, wherein the image recombination splicing module, the defect detection module and the self-correction module are respectively arranged on the same upper computer with the CCD image acquisition module;
the CCD image acquisition module is used for scanning and acquiring images in real time and transmitting the images acquired by real-time scanning and the acquired standard sampling images into the image recombination and splicing module; the CCD image acquisition module comprises a CCD camera and a CCD image acquisition interface;
the image recombination and splicing module is used for receiving image line number information transmitted by the self-correction module, respectively performing image splicing and recombination on an input real-time acquisition image and a standard sampling image according to lines according to the image line number information, and transmitting the spliced image to the defect detection module, and specifically comprises the following steps:
inputting a real-time acquisition image;
inputting image line number information: setting a default value of the number of splicing lines, and calculating to obtain a next splicing line numerical value according to the default value of the number of lines;
image splicing and recombining: according to the default value of the splicing line number, carrying out image splicing recombination processing on the standard sampling image and the real-time collected image according to lines;
the defect detection module is used for calculating the brightness, the contrast and the structure of the corresponding image according to the spliced acquired image and the standard sampling image by using a structure similarity algorithm, obtaining the difference between the acquired image and the standard sampling image according to the calculation result, obtaining the defect position according to the difference and transmitting the defect position to the self-correction module;
and the self-correction module is used for adjusting the scanning line number according to the obtained defect position and inputting the adjusted line number to the image splicing module.
2. A PCB defect detection method based on a CCD camera is characterized by comprising the following steps:
s1, acquiring a standard sampling image, setting the acquisition line number of a CCD camera and the basic setting of the CCD camera, and scanning and acquiring the image in real time by using the CCD camera;
s2, inputting image line number information, and respectively carrying out image splicing recombination processing on the standard sampling image and the real-time acquisition image according to the image line number information, wherein the image splicing recombination processing specifically comprises the following steps:
the step S2 includes the steps of:
s201, inputting a real-time acquisition image;
s202, inputting image line number information: setting a default value of the number of splicing lines, and calculating to obtain a next splicing line numerical value according to the default value of the number of lines;
s203, image splicing and recombining: according to the default value of the splicing line number, carrying out image splicing recombination processing on the standard sampling image and the real-time acquisition image according to the lines;
s3, respectively calculating the brightness, the contrast and the structure of the spliced acquired image and the standard sampled image by using a structural similarity algorithm, judging whether defects exist according to the calculation result, if so, entering the step S4, otherwise, finishing the detection, and thus finishing the defect detection of the PCB;
and S4, adjusting the scanning line number according to the judgment result, taking the adjusted scanning line number information as the input image line number information in the step S2, and returning to the step S2.
3. The PCB defect detection method based on the CCD camera of claim 2, wherein the matrix expression of the real-time collected image in the step S1 is as follows:
Figure FDA0004048401310000021
the matrix expression of the standard sampling image is as follows:
Figure FDA0004048401310000022
the method comprises the following steps of A, B, epsilon, y and eta, wherein A is a matrix of a real-time acquired image, B is a matrix of a standard sampling image, epsilon is an initial scanning position, x is the number of lines of each scanning, y is the number of columns of each scanning, and eta is an initial value of standard sampling image interception.
4. The CCD camera-based PCB defect detection method of claim 2, wherein the expression of the next stitch line value in step S202 is as follows:
ω′=ω+R pre +R after
where ω' is the next splice line value, R pre For the desired forward movement, R after ω is the default number of stitching rows for the desired next row.
5. The PCB defect detection method based on CCD camera of claim 2, wherein the matrix expression of the real-time collected image after the recombination in the step S203 is as follows:
Figure FDA0004048401310000031
the matrix expression of the recombined standard sampling image is as follows:
Figure FDA0004048401310000032
wherein, A 'is a recombined real-time collected image matrix, B' is a recombined standard sampling image matrix, and R pre For the desired forward movement, R after And omega is a default value of the number of splicing lines, x is the number of lines in each scanning, y is the number of columns in each scanning, and eta is an initial value of standard sampling image interception.
6. The CCD camera based PCB circuit board defect detecting method of claim 2, wherein the step S3 comprises the steps of:
s301, respectively calculating the brightness, the contrast and the structure of the spliced real-time collected image and the standard sampled image by using a structural similarity algorithm;
s302, fusing the brightness, the contrast and the structure of the real-time collected image and the standard sampled image in proportion to obtain an evaluation function;
s303, judging whether the evaluation function is larger than a preset detection threshold value T or not d If so, finishing the detection so as to finish the defect detection of the PCB, otherwise, marking the defect position in the current acquired image, outputting the current defect detection image, and entering the step S4.
7. The CCD camera-based PCB circuit board defect detection method of claim 6, wherein the expression of the evaluation function is as follows:
F(A',B')=[L(A',B')] α [C(A',B')] β [S(A',B')] γ
Figure FDA0004048401310000041
Figure FDA0004048401310000042
Figure FDA0004048401310000043
Figure FDA0004048401310000044
Figure FDA0004048401310000045
Figure FDA0004048401310000046
Figure FDA0004048401310000047
Figure FDA0004048401310000048
wherein F (A ', B') is an evaluation function,. Mu. A' Is the pixel mean gray value, μ, of the matrix A B' Is the average gray value of pixels in the matrix B', N is the total number of pixels, x i Is the value, y, of the pixel corresponding to the matrix A i Is the value of the pixel point corresponding to the matrix B ', i is the subscript of the corresponding point in the matrix A', sigma A' Is the standard deviation, σ, of the matrix A B' Is the standard deviation of the matrix B',l (A ', B') is a luminance contrast function of the matrix A 'and the matrix B',
Figure FDA0004048401310000051
which is the square of the average gray value of the pixels of the matrix a',
Figure FDA0004048401310000052
is the square of the mean gray value of the pixels of the matrix B', C 1 ,C 2 ,C 3 All are stability parameters for increasing the calculation result, C (A ', B') is a contrast ratio function of the matrix A 'and the matrix B',
Figure FDA0004048401310000053
is the variance of the matrix a' and,
Figure FDA0004048401310000054
is the variance of matrix B ', S (A ', B ') is the structural contrast function of matrix A ' and matrix B ', σ A'B' The covariance matrix A 'and the covariance matrix B' are all parameters for adjusting the three modules, A 'is a recombined real-time collected image matrix, and B' is a recombined standard sampling image matrix.
8. The CCD camera-based PCB defect detection method of claim 2, wherein the step S4 comprises the following steps:
s401, judging whether a defect detection image is input or not according to a judgment result, if so, entering a step S402, otherwise, ending the process;
s402, judging whether the previous scanning line information is needed or not, if so, setting the current line number information as the needed previous line number R pre And step S403 is carried out, otherwise, the imaging range of the current image is the initial range of the PCB, and step S403 is carried out;
s403, judging whether the subsequent scanning line information is needed or not, if so, setting the current line number information as the subsequent line number R needed after And using the desired number of columns R after Completing a current imageInformation, and step S404 is entered, otherwise, the flow is ended;
s404, the required previous row number R pre And the required number of post rows R after As input image line number information in step S2, and returns to step S2.
9. The CCD camera-based PCB circuit board defect detecting method of claim 8, wherein the expression of the row number information of the input image in the step S404 is as follows:
ω′=ω+R pre +R after
where ω' is the number of lines information of the output image, i.e. the next stitching line value, R pre For the desired forward movement, R after ω is the default number of stitching rows for the desired next row.
CN202010039810.3A 2020-01-15 2020-01-15 PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera Active CN111598771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010039810.3A CN111598771B (en) 2020-01-15 2020-01-15 PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010039810.3A CN111598771B (en) 2020-01-15 2020-01-15 PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera

Publications (2)

Publication Number Publication Date
CN111598771A CN111598771A (en) 2020-08-28
CN111598771B true CN111598771B (en) 2023-03-14

Family

ID=72191966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010039810.3A Active CN111598771B (en) 2020-01-15 2020-01-15 PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera

Country Status (1)

Country Link
CN (1) CN111598771B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112215784B (en) * 2020-12-03 2021-04-06 江西博微新技术有限公司 Image decontamination method, image decontamination device, readable storage medium and computer equipment
CN112652360B (en) * 2020-12-15 2024-10-18 苏州缔因安生物科技有限公司 Digital PCR fluorescent signal acquisition method, device, equipment and storage medium
CN113533375A (en) * 2021-08-26 2021-10-22 惠州市特创电子科技股份有限公司 Forward and reverse scanning modeling detection method for printed circuit board
CN116805298B (en) * 2022-11-30 2024-09-13 慧之安信息技术股份有限公司 Circuit board defect detection method based on edge calculation
CN117372434B (en) * 2023-12-08 2024-04-30 深圳市强达电路股份有限公司 Positioning system and method for PCB production

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001069643A1 (en) * 2000-03-13 2001-09-20 Hitachi, Ltd. Charged particle beam scanning device
US8867796B2 (en) * 2010-01-21 2014-10-21 Hewlett-Packard Development Company, L.P. Automated inspection of a printed image
CN103308524A (en) * 2012-03-16 2013-09-18 西安中科麦特电子技术设备有限公司 PCB automatic optical inspection system
CN104867144B (en) * 2015-05-15 2018-05-01 广东工业大学 IC element welding point defect detection methods based on mixed Gauss model
CN108318804A (en) * 2018-02-01 2018-07-24 江西景旺精密电路有限公司 A kind of PCB automatic testing methods and system
CN208206822U (en) * 2018-04-10 2018-12-07 深圳市嘉立创科技发展有限公司 Pcb board defect automatic checkout system based on machine vision
CN109738450B (en) * 2019-01-09 2021-06-29 合肥联宝信息技术有限公司 Method and device for detecting notebook keyboard

Also Published As

Publication number Publication date
CN111598771A (en) 2020-08-28

Similar Documents

Publication Publication Date Title
CN111598771B (en) PCB (printed Circuit Board) defect detection system and method based on CCD (Charge coupled device) camera
CN108765416B (en) PCB surface defect detection method and device based on rapid geometric alignment
WO2022052480A1 (en) Method and system for detecting and processing defect in lithium battery electrode plate in real time
CN102393397B (en) System and method for detecting surface defects of magnetic shoe
CN114994061B (en) Machine vision-based steel rail intelligent detection method and system
CN102879404B (en) System for automatically detecting medical capsule defects in industrial structure scene
CN108871185B (en) Method, device and equipment for detecting parts and computer readable storage medium
CN110966956A (en) Binocular vision-based three-dimensional detection device and method
CN112819844B (en) Image edge detection method and device
CN110992313A (en) Camera image center detection and center adjustment method based on machine vision
CN107480678A (en) A kind of chessboard recognition methods and identifying system
CN106290379A (en) Rail surface defects based on Surface scan camera detection device and method
CN104749801B (en) High Precision Automatic optical detecting method and system
CN116030021A (en) Automatic detection system for hidden crack characteristics of photovoltaic module
CN110728269B (en) High-speed rail contact net support pole number plate identification method based on C2 detection data
CN114280073A (en) Tile defect detection device adopting laser and camera composite detection mode and classification method
CN105023018A (en) Jet code detection method and system
CN114820439A (en) PCB bare board defect detection system and method based on AOI
CN115791830A (en) Steel plate detection system, steel plate detection method and electronic equipment
CN114359253A (en) Image pollution detection method and system based on convolutional neural network
CN115015286A (en) Chip detection method and system based on machine vision
CN113723841A (en) Online detection method for tool missing in assembly type prefabricated part
CN110443803A (en) A kind of printed matter picture quality detection method and device
CN107403429B (en) Method for quickly and automatically acquiring parameters of periodic sequence image model
CN116499362B (en) Steel plate size online measurement system

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