CN115205291B - Circuit board detection method, device, equipment and medium - Google Patents

Circuit board detection method, device, equipment and medium Download PDF

Info

Publication number
CN115205291B
CN115205291B CN202211118516.7A CN202211118516A CN115205291B CN 115205291 B CN115205291 B CN 115205291B CN 202211118516 A CN202211118516 A CN 202211118516A CN 115205291 B CN115205291 B CN 115205291B
Authority
CN
China
Prior art keywords
image
detected
circuit board
original
target
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
CN202211118516.7A
Other languages
Chinese (zh)
Other versions
CN115205291A (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.)
Guangzhou Luchen Intelligent Equipment Technology Co ltd
Original Assignee
Guangzhou Luchen Intelligent Equipment 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 Guangzhou Luchen Intelligent Equipment Technology Co ltd filed Critical Guangzhou Luchen Intelligent Equipment Technology Co ltd
Priority to CN202211118516.7A priority Critical patent/CN115205291B/en
Publication of CN115205291A publication Critical patent/CN115205291A/en
Application granted granted Critical
Publication of CN115205291B publication Critical patent/CN115205291B/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
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • 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/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • 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
    • 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)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a circuit board detection method, a circuit board detection device and a circuit board detection medium. The method comprises the following steps: acquiring an original to-be-detected image corresponding to a to-be-detected circuit board and an original template image corresponding to a template circuit board; the template circuit board is a standard circuit board corresponding to the circuit board to be tested; respectively carrying out image preprocessing on an original image to be detected and an original template image to obtain a corresponding target image to be detected and a corresponding target template image; and detecting the foreign matters on the circuit board to be detected according to the difference value between the target image to be detected and the target template image. The embodiment of the invention solves the technical problem of higher false alarm rate caused by foreign matter detection in the prior art, and improves the detection accuracy rate of whether slender abnormal matters such as hair exist in the circuit board.

Description

Circuit board detection method, device, equipment and medium
Technical Field
The invention relates to the technical field of circuit boards, in particular to a circuit board detection method, a circuit board detection device and a circuit board detection medium.
Background
In order to ensure the performance of the circuit board, a layer of three-proofing paint can be coated on the circuit board. In the three-proofing paint spraying process of the circuit board, the phenomenon that slender abnormal objects such as hair and the like fall on the circuit board sometimes occurs, so that the coating failure is caused. In order to avoid this, it is necessary to detect whether there is an elongated anomaly such as hair in coating Automatic Optical Inspection (AOI).
Because the conformal coating contains fluorescent substances, the area coated with the conformal coating shows bright blue under an ultraviolet lamp; while the areas not coated with the tri-proof lacquer show dark black. However, the dark black is also displayed in the area shielded by the hair, and a thin black line is also generated at the edge of the device due to the thin three-proofing paint layer at the edge of the device on the circuit board, so that the false alarm rate of foreign matter detection is high as compared with the long and thin abnormal matters such as hair.
Disclosure of Invention
The invention provides a circuit board detection method, a circuit board detection device and a circuit board detection medium, which are used for solving the technical problem that the false alarm rate of foreign matter detection in the prior art is high and improving the detection accuracy rate of whether long and thin abnormal matters such as hair exist in a circuit board.
According to an aspect of the present invention, there is provided a circuit board inspection method, including:
acquiring an original to-be-detected image corresponding to a circuit board to be detected and an original template image corresponding to a template circuit board; the template circuit board is a standard circuit board corresponding to the circuit board to be tested;
respectively carrying out image preprocessing on the original image to be detected and the original template image to obtain a corresponding target image to be detected and a corresponding target template image;
and detecting the foreign matters on the circuit board to be detected according to the difference value between the target image to be detected and the target template image.
According to another aspect of the present invention, there is provided a circuit board inspection apparatus including:
the acquisition module is used for acquiring an original to-be-detected image corresponding to the to-be-detected circuit board and an original template image corresponding to the template circuit board; the template circuit board is a standard circuit board corresponding to the circuit board to be tested;
the preprocessing module is used for respectively carrying out image preprocessing on the original image to be detected and the original template image to obtain a corresponding target image to be detected and a corresponding target template image;
and the detection module is used for detecting the foreign matters on the circuit board to be detected according to the difference value between the target image to be detected and the target template image.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the circuit board inspection method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the circuit board inspection method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the target image to be detected containing the interference foreign matters and the real foreign matters and the target template image only containing the interference foreign matters are obtained by respectively carrying out image preprocessing on the original image to be detected and the original template image; and then, the target image to be detected and the target template image are subjected to difference comparison to remove the interference foreign matters existing in the target template image, so that the real foreign matters on the circuit board to be detected are detected, the technical problem of high false alarm rate of foreign matter detection in the prior art is solved, and the accuracy rate of detecting whether long and thin abnormal matters such as hair exist in the circuit board is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a circuit board under test according to an embodiment of the present invention
Fig. 2 is a flowchart of a circuit board detection method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method for inspecting a circuit board according to an embodiment of the present invention;
fig. 4 is a flowchart of another circuit board detection method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an image after a low-order clipping operation is performed on a difference template image according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an image after a low cut operation is performed on an image to be measured for difference according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a target difference image according to an embodiment of the present invention;
FIG. 8 is a schematic view of a hair foreign object detection method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a circuit board detection apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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.
It should be noted that the terms "original", "intermediate", "target", "to be measured", "template", and the like in the description and claims of the present invention and the above drawings are used for distinguishing similar objects, and are not necessarily used for describing a specific order or sequence. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic display diagram of a circuit board to be tested according to an embodiment of the present invention. As shown in fig. 1, hair (i.e., real foreign matter) is present on the circuit board to be tested, and a chip is present on the circuit board to be tested, and a similar black line (i.e., interference foreign matter) is formed at the edge of the chip. In the actual detection process, the interfering foreign matter is easy to cause false detection. In view of this, embodiments of the present invention provide a method for detecting a circuit board to accurately detect a long and thin foreign object such as hair on the circuit board to be detected.
In an embodiment, fig. 2 is a flowchart of a circuit board detection method according to an embodiment of the present invention, where the present embodiment is applicable to detecting a long and thin foreign object such as a hair on a circuit board, and the method may be executed by a circuit board detection device, where the circuit board detection device may be implemented in a form of hardware and/or software, and the circuit board detection device may be configured in an electronic device.
It should be noted that, in order to perform image acquisition on the circuit board to be detected, image acquisition may be performed on the circuit board to be detected by the image acquisition device, and the motion control device controls the circuit board to be detected to move to an appropriate position of the image acquisition device. The image acquisition device can comprise: industrial cameras, illumination modules and image acquisition cards. The industrial camera is used for acquiring images of the circuit board to be detected; the illumination module is used for illuminating the circuit board to be tested so as to ensure that light rays are uniformly distributed on the circuit board to be tested; the image acquisition card is used for acquiring data output by the industrial camera in real time.
As shown in fig. 2, the method includes:
s210, acquiring an original to-be-detected image corresponding to the to-be-detected circuit board and an original template image corresponding to the template circuit board.
The circuit board to be tested is a circuit board coated with three-proofing paint; the template circuit board is a standard circuit board corresponding to the circuit board to be tested. It is understood that the stencil sheet is also a three-proof paint-coated circuit sheet, and that no long and thin foreign matter such as hair is present on the stencil sheet.
In the embodiment, the circuit board to be tested is controlled to move to a proper position of the image acquisition equipment through the motion control equipment, and then the image acquisition of the circuit board to be tested is carried out through the image acquisition equipment so as to obtain a corresponding original image to be tested. In the embodiment, the template circuit board is subjected to image acquisition in advance to obtain a corresponding original template image, and the original template image is stored in a test file. And when a detection instruction of the circuit board to be detected is received, automatically loading a test file of the template circuit board corresponding to the circuit board to be detected, and analyzing the test file to obtain a corresponding original template image. It can be understood that the template circuit boards corresponding to different types of circuit boards to be tested are different, and correspondingly, different test files can be generated for the original template images corresponding to different template circuit boards, that is, the mapping relationship between the test files and the original template images is one-to-one correspondence.
S220, respectively carrying out image preprocessing on the original image to be detected and the original template image to obtain a corresponding target image to be detected and a corresponding target template image.
The target image to be detected refers to an image containing interference foreign matters and real foreign matters; the target template image refers to an image containing only the interfering foreign substances. Among other things, image pre-processing may include, but is not limited to, the following: mean filtering, graying processing, low-order truncation and expansion operation.
In the embodiment, after image processing is carried out on an original image to be detected, a target image to be detected containing interference foreign matters and real foreign matters is obtained; and after image processing is carried out on the original template image, a target template image only containing the interference foreign matters is obtained.
And S230, detecting the foreign matters on the circuit board to be detected according to the difference value between the target image to be detected and the target template image.
Wherein, the difference value refers to the pixel difference value between the target image to be detected and the target template image. In the embodiment, the pixel subtraction is carried out on the target image to be detected and the target template image to obtain the pixel value of the real foreign matter in the target image to be detected, so that the foreign matter on the circuit board to be detected can be detected according to the pixel value.
According to the technical scheme of the embodiment, the target image to be detected containing the interference foreign matters and the real foreign matters and the target template image only containing the interference foreign matters are obtained by respectively carrying out image preprocessing on the original image to be detected and the original template image; and then, the target image to be detected and the target template image are subjected to difference comparison to remove the interference foreign matters existing in the target template image, so that the real foreign matters on the circuit board to be detected are detected, the technical problem of high false alarm rate of foreign matter detection in the prior art is solved, and the accuracy rate of detecting whether long and thin abnormal matters such as hair exist in the circuit board is improved.
In an embodiment, fig. 3 is a flowchart of another circuit board detection method according to an embodiment of the present invention, and this embodiment is further complementary to the circuit board detection process based on the foregoing embodiment. As shown in fig. 3, the method includes:
s310, acquiring an original to-be-detected image corresponding to the to-be-detected circuit board and an original template image corresponding to the template circuit board.
The template circuit board is a standard circuit board corresponding to the circuit board to be tested.
And S320, performing alignment operation on the original image to be detected and the original template image.
In an embodiment, before the image preprocessing is performed on the original image to be measured and the original template image, an alignment operation is performed on the original image to be measured and the original template image, so as to ensure the alignment accuracy between the original image to be measured and the original template image.
In one embodiment, S320 includes: S3201-S3203.
S3201, identifying and selecting a target area in the original template image.
Wherein, the target area refers to a partial area in the original template image. In an embodiment, the target area may include, but is not limited to: and the regions with characteristics such as obvious characteristics, rich characteristics or intense image pixel change. The region with obvious characteristics, rich characteristics or violent image pixel change is used as a target region, so that the alignment accuracy between the original image to be detected and the original template image is ensured. In the actual selection process, the area shape of the target area is not limited. Illustratively, the target area may comprise a regular pattern of rectangles, circles, and the like.
In the embodiment, a regular area with obvious characteristics, rich characteristics or violent image pixel change and other characteristics in an original template image is identified, and if a plurality of regular areas with the characteristics are found, one area can be randomly selected from the plurality of regular areas to serve as a target area; if a regular area with the above characteristics is found, the area is directly used as a target area. Of course, if the regular region having the above-described features is not found, the irregular region having the above-described features may be found and the irregular region may be set as the target region.
S3202, searching a characteristic region matched with the target region in the original image to be detected.
The characteristic region refers to a region which is closest to the characteristic of the target region in the original image to be measured. In the embodiment, after a target area in a template image to be detected is selected, key features of the target area are identified and obtained; and then searching a region closest to the key feature in the original image to be detected as a feature region in the original image to be detected.
And S3203, performing alignment operation on the original image to be detected and the original template image according to the coordinate offset value between the target area and the characteristic area.
In the embodiment, coordinate values of one or more key points in a target region are obtained first, then the coordinate values of the key points in a characteristic region are obtained, and then the coordinate difference of the key points between the two regions is determined to be used as a coordinate deviation value; and adjusting the position of the original image to be detected according to the coordinate deviation value so as to align the original image to be detected and the original template image.
S330, respectively and sequentially carrying out mean filtering and graying operation on the original image to be detected and the original template image to obtain a corresponding intermediate image to be detected and an intermediate template image.
Performing mean filtering and graying operation on an original image to be detected in sequence to obtain a corresponding intermediate image to be detected; and sequentially carrying out mean value filtering and graying operation on the original template image to obtain a corresponding intermediate template image. In the actual image preprocessing process, the order of performing the mean filtering and the graying operation is not limited.
And S340, determining a corresponding difference image to be detected according to the original image to be detected and the middle image to be detected.
The image to be measured for difference refers to an image obtained by pixel subtraction between the original image to be measured and the image to be measured in the middle. In the embodiment, the pixel value of each pixel point in the original image to be detected and the pixel value of the corresponding pixel point in each intermediate image to be detected are obtained, then the two pixel values are subtracted to obtain the pixel difference value of the pixel point, and by analogy, the pixel difference value of each pixel point forms the corresponding difference image to be detected.
And S350, determining a corresponding difference template image according to the original template image and the intermediate template image.
The difference template image refers to an image obtained by pixel subtraction between the original template image and the intermediate template image. In the embodiment, the pixel value of each pixel point in the original template image and the pixel value of the corresponding pixel point in each intermediate template image are obtained, then the two pixel values are subtracted to obtain the pixel difference value of the pixel point, and by analogy, the pixel difference value of each pixel point forms the corresponding difference template image.
And S360, respectively executing low-order truncation operation on the difference image to be detected and the difference template image to obtain a corresponding target image to be detected and a corresponding target template image.
The low-order clipping operation refers to an operation of setting 0 to all pixels in the image whose gray scale values are smaller than a preset gray scale threshold value. In the embodiment, a low-order cut operation is performed on the difference image to be detected, so that all pixels of which the gray values are smaller than a preset gray threshold value in the difference image to be detected are set to be 0, and a corresponding target image to be detected is obtained. Similarly, a low-order cut-off operation is performed on the difference template image to set all pixels in the difference template image with gray values smaller than a preset gray threshold value to 0, so as to obtain a corresponding target template image.
In an embodiment, the low cut operation is performed on the difference to-be-detected image to set the pixel with the smaller gray scale value difference in the difference to-be-detected image to 0, and further find out the pixel points corresponding to the interference foreign object and the true foreign object in the difference to-be-detected image. Similarly, the low cut operation is performed on the difference template image in order to set the pixel with smaller gray scale value difference in the difference template image to 0, and further find out the pixel corresponding to the interference foreign object in the difference template image.
In an embodiment, the expansion operation is performed on the difference template image subjected to the low-order truncation operation to obtain a corresponding target template image. In the embodiment, after the low-order truncation operation is performed on the difference template image, the expansion operation is performed to expand the region where the pixel points corresponding to the interference foreign matters are located, so that all the pixel points of the interference foreign matters in the target image to be detected can be covered in the subsequent foreign matter detection process.
And S370, determining a difference value between the target image to be detected and the target template image to obtain a corresponding target difference image.
In the embodiment, the pixel value of each pixel point in the target image to be detected and the pixel value of the corresponding pixel point in each target template image are obtained, then the two pixel values are subtracted to obtain the pixel difference value of the pixel point, and so on, the pixel difference value of each pixel point forms the corresponding target difference image.
And S380, detecting the foreign matters on the circuit board to be detected according to the contour features in the target difference image.
In the embodiment, the contour in the target difference image is detected, the characteristics of all the contours are counted, and the foreign matter on the circuit board to be detected is detected according to the contour characteristics.
According to the technical scheme of the embodiment, on the basis of the embodiment, before the original image to be detected and the original template image are subjected to image preprocessing, the original image to be detected and the original template image are aligned, so that the alignment accuracy between the original image to be detected and the original template image is ensured; then, performing mean filtering, graying, low-order truncation and expansion operation on the original template image to obtain a target template image only containing the interference foreign matters, and performing mean filtering, graying and low-order truncation operation on the original image to be detected to obtain a target image to be detected containing the interference foreign matters and real foreign matters; and finally, according to the difference between the target template image and the target image to be detected, removing the pixel points of the interference foreign matters existing in the target image to be detected, so that the pixel points of the real foreign matters in the target image to be detected are obtained by screening, the foreign matters on the circuit board to be detected can be detected, and the detection accuracy of the circuit board to be detected is improved.
In an embodiment, fig. 4 is a flowchart of another circuit board detection method according to an embodiment of the present invention. The present embodiment is based on the above embodiments, and describes a process of detecting a foreign object on a circuit board to be tested as shown in fig. 1 as a preferred embodiment. As shown in fig. 4, the circuit board detection method in this embodiment includes the following steps:
and S410, acquiring an original template image M and an original image C to be detected.
And S420, aligning the original template image M with the original image C to be measured.
S430, carrying out mean value filtering and graying operation on the original template image M to obtain an intermediate template image M1.
S440, obtaining a difference template image M2 according to the original template image M and the middle template image M1.
S450, carrying out low-order truncation operation on the difference template image M2 to obtain an image M3.
Fig. 5 is a schematic diagram of an image after performing a low bit truncation operation on a difference template image according to an embodiment of the present invention. As shown in fig. 5, a low-order clipping operation is performed on the difference template image M2 to set all pixels with gray values smaller than a preset gray threshold value to 0, so as to obtain a corresponding image M3.
And S460, performing expansion operation on the image M3 to obtain a target template image M4.
S470, carrying out mean filtering and graying operation on the original image C to be measured to obtain an intermediate image C1 to be measured.
And S480, obtaining a difference image C2 to be detected according to the original image C to be detected and the middle image C1 to be detected.
And S490, performing low-order cut-to-reach operation on the difference image to be detected C2 to obtain a target image to be detected C3.
Fig. 6 is a schematic diagram of an image after performing a low cut operation on an image to be detected for difference according to an embodiment of the present invention. As shown in fig. 6, a low-order clipping operation is performed on the difference image to be measured C2 to set all pixels having a gray value smaller than the preset gray threshold value to 0, so as to obtain a corresponding target image to be measured C3.
S4100, obtaining a target difference image C4 according to the target template image M4 and the target image C3 to be detected.
Fig. 7 is an image schematic diagram of a target difference image according to an embodiment of the present invention. As shown in fig. 7, after the target template image M4 and the target image to be detected C3 are obtained, the pixel value of each pixel point of the target template image M4 is subtracted from the pixel value of the corresponding pixel point in the target image to be detected C3 to obtain the pixel difference value of the corresponding pixel point, and the corresponding target difference image C4 is formed according to the pixel difference value.
S4110, detecting the contours in the target difference image C4, counting the characteristics of all the contours, and screening out hair foreign matters according to the contour characteristics.
Fig. 8 is a schematic diagram illustrating detection of a hair line foreign object according to an embodiment of the present invention. In the embodiment, the contour in the target difference image C4 is detected, the features of all the contours are counted, and the corresponding hair line foreign matter is obtained by screening according to the features of the contour. As shown in fig. 8, the long and thin foreign matters selected by the rectangular frame are hair line foreign matters.
It should be noted that the execution sequence between S430-S460 and S470-S490 is not limited, that is, S430-S460 may be executed first, and then S470-S490 may be executed; or the steps S470-S490 can be executed first, and then the steps S430-S460 can be executed; S430-S460 and S470-S490 may also be performed simultaneously.
According to the technical scheme, the algorithm for detecting the slender foreign matters such as the hair strands is configured, so that the accuracy rate of detecting the slender foreign matters such as the hair strands is improved.
In an embodiment, fig. 9 is a schematic structural diagram of a circuit board detection apparatus according to an embodiment of the present invention. As shown in fig. 9, the apparatus includes: an acquisition module 910, a pre-processing module 920, and a detection module 930.
The acquiring module 910 is configured to acquire an original to-be-detected image corresponding to a to-be-detected circuit board and an original template image corresponding to a template circuit board; the template circuit board is a standard circuit board corresponding to the circuit board to be tested;
the preprocessing module 920 is configured to perform image preprocessing on the original image to be detected and the original template image, respectively, to obtain a corresponding target image to be detected and a corresponding target template image;
the detecting module 930 is configured to detect a foreign object on the circuit board to be detected according to a difference between the target image to be detected and the target template image.
In an embodiment, before performing image preprocessing on the original image to be detected and the original template image respectively to obtain a corresponding target image to be detected and a corresponding target template image, the circuit board detection apparatus further includes:
and the actuator is used for executing alignment operation on the original image to be detected and the original template image.
In one embodiment, an actuator, comprising:
the identification selection unit is used for identifying and selecting a target area in the original template image;
the searching unit is used for searching a characteristic area matched with the target area in the original image to be detected;
and the execution unit is used for executing alignment operation on the original image to be detected and the original template image according to the coordinate offset value between the target area and the characteristic area.
In one embodiment, the preprocessing module 920 includes:
the filtering unit is used for respectively and sequentially carrying out mean value filtering and graying operation on the original image to be detected and the original template image to obtain a corresponding middle image to be detected and a corresponding middle template image;
the first determining unit is used for determining a corresponding difference image to be detected according to the original image to be detected and the middle image to be detected;
the second determining unit is used for determining a corresponding difference template image according to the original template image and the intermediate template image;
and the low-order cut-off unit is used for respectively executing low-order cut-off operation on the difference image to be detected and the difference template image to obtain the corresponding target image to be detected and the target template image.
In an embodiment, the preprocessing module 920 further includes:
and the expansion unit is used for performing expansion operation on the difference template image subjected to the low-order truncation operation to obtain a corresponding target template image.
In one embodiment, the detection module 930 includes:
the third determining unit is used for determining a difference value between the target image to be detected and the target template image to obtain a corresponding target difference image;
and the detection unit is used for detecting the foreign matters on the circuit board to be detected according to the contour characteristics in the target difference image.
In one embodiment, the circuit board to be tested is a circuit board coated with conformal coating.
The circuit board detection device provided by the embodiment of the invention can execute the circuit board detection method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
In an embodiment, fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in FIG. 10, a schematic diagram of a structure of an electronic device 10 that may be used to implement embodiments of the present invention is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 10, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The processor 11 performs the various methods and processes described above, such as the circuit board inspection method.
In some embodiments, the circuit board detection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the circuit board detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the circuit board detection method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A circuit board detection method is characterized by being applied to a scene for detecting slender foreign matters, and comprising the following steps:
acquiring an original to-be-detected image corresponding to a to-be-detected circuit board and an original template image corresponding to a template circuit board; the template circuit board is a standard circuit board corresponding to the circuit board to be tested;
respectively carrying out image preprocessing on the original image to be detected and the original template image to obtain a corresponding target image to be detected and a corresponding target template image; the target image to be detected is an image containing interference foreign matters and real foreign matters; the target template image is an image only containing interference foreign matters;
detecting foreign matters on the circuit board to be detected according to a difference value between the target image to be detected and the target template image;
the image preprocessing is respectively carried out on the original image to be detected and the original template image to obtain a corresponding target image to be detected and a corresponding target template image, and the image preprocessing comprises the following steps:
respectively and sequentially carrying out mean filtering and graying operation on the original image to be detected and the original template image to obtain a corresponding intermediate image to be detected and an intermediate template image;
determining a corresponding difference image to be detected according to the original image to be detected and the intermediate image to be detected;
determining a corresponding difference template image according to the original template image and the intermediate template image;
and respectively executing low-order truncation operation on the difference image to be detected and the difference template image to obtain a corresponding target image to be detected and a corresponding target template image.
2. The method according to claim 1, wherein before the image preprocessing is performed on the original image to be measured and the original template image to obtain the corresponding target image to be measured and the target template image, the method further comprises:
and performing alignment operation on the original image to be detected and the original template image.
3. The method of claim 2, wherein the performing an alignment operation on the original image under test and the original template image comprises:
identifying and selecting a target area in the original template image;
searching a characteristic region matched with the target region in the original image to be detected;
and performing alignment operation on the original image to be detected and the original template image according to the coordinate offset value between the target area and the characteristic area.
4. The method according to claim 1, wherein the image preprocessing is performed on the original image to be measured and the original template image, respectively, to obtain a corresponding target image to be measured and a corresponding target template image, and further comprising:
and performing expansion operation on the difference template image subjected to the low-order truncation operation to obtain a corresponding target template image.
5. The method according to claim 1 or 2, wherein the detecting the foreign object on the circuit board to be tested according to the difference value between the target image to be tested and the target template image comprises:
determining a difference value between the target image to be detected and the target template image to obtain a corresponding target difference image;
and detecting the foreign matters on the circuit board to be detected according to the contour features in the target difference image.
6. Method according to claim 1 or 2, characterized in that the circuit board to be tested is a lacquer-coated circuit board.
7. A circuit board detection device is characterized by being applied to a scene for detecting slender foreign matters, and comprising the following components:
the acquisition module is used for acquiring an original to-be-detected image corresponding to the to-be-detected circuit board and an original template image corresponding to the template circuit board; the template circuit board is a standard circuit board corresponding to the circuit board to be tested;
the preprocessing module is used for respectively carrying out image preprocessing on the original image to be detected and the original template image to obtain a corresponding target image to be detected and a corresponding target template image; the target image to be detected is an image containing interference foreign matters and real foreign matters; the target template image is an image only containing interference foreign matters;
the detection module is used for detecting foreign matters on the circuit board to be detected according to the difference value between the target image to be detected and the target template image;
the preprocessing module comprises:
the filtering unit is used for respectively and sequentially carrying out mean filtering and graying operation on the original image to be detected and the original template image to obtain a corresponding intermediate image to be detected and an intermediate template image;
the first determining unit is used for determining a corresponding difference image to be detected according to the original image to be detected and the intermediate image to be detected;
the second determining unit is used for determining a corresponding difference template image according to the original template image and the intermediate template image;
and the low-order cut-off unit is used for respectively executing low-order cut-off operation on the difference image to be detected and the difference template image to obtain a corresponding target image to be detected and a corresponding target template image.
8. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the circuit board inspection method of any one of claims 1-6.
9. A computer-readable storage medium having stored thereon computer instructions for causing a processor to execute the method for inspecting a circuit board according to any one of claims 1-6.
CN202211118516.7A 2022-09-15 2022-09-15 Circuit board detection method, device, equipment and medium Active CN115205291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211118516.7A CN115205291B (en) 2022-09-15 2022-09-15 Circuit board detection method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211118516.7A CN115205291B (en) 2022-09-15 2022-09-15 Circuit board detection method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN115205291A CN115205291A (en) 2022-10-18
CN115205291B true CN115205291B (en) 2023-02-24

Family

ID=83572951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211118516.7A Active CN115205291B (en) 2022-09-15 2022-09-15 Circuit board detection method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115205291B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116245876A (en) * 2022-12-29 2023-06-09 摩尔线程智能科技(北京)有限责任公司 Defect detection method, device, electronic apparatus, storage medium, and program product
CN116486126B (en) * 2023-06-25 2023-10-27 合肥联宝信息技术有限公司 Template determination method, device, equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107093174B (en) * 2017-04-05 2018-03-27 湖北工业大学 A kind of PCB design defect inspection method
CN109389597B (en) * 2018-10-24 2021-04-27 四川长虹电器股份有限公司 Circuit board defect detection system and method on production line
US10964015B2 (en) * 2019-01-15 2021-03-30 International Business Machines Corporation Product defect detection
CN109767445B (en) * 2019-02-01 2020-11-27 佛山市南海区广工大数控装备协同创新研究院 High-precision PCB defect intelligent detection method
CN110473184A (en) * 2019-08-06 2019-11-19 福建工程学院 A kind of pcb board defect inspection method
CN111272768B (en) * 2020-02-28 2022-12-27 苏州杰锐思智能科技股份有限公司 Ceramic tube detection method
CN111583216A (en) * 2020-04-30 2020-08-25 深圳比特微电子科技有限公司 Defect detection method for PCBA
EP3941177A1 (en) * 2020-07-13 2022-01-19 Siemens Aktiengesellschaft Inspection and production of printed circuit board assemblies
CN112258448A (en) * 2020-09-15 2021-01-22 郑州金惠计算机系统工程有限公司 Fine scratch detection method, fine scratch detection device, electronic equipment and computer-readable storage medium
CN112508826B (en) * 2020-11-16 2022-03-01 哈尔滨工业大学(深圳) Printed matter defect detection method
CN114764768A (en) * 2020-12-31 2022-07-19 富泰华工业(深圳)有限公司 Defect detection and classification method and device, electronic equipment and storage medium
CN113673514A (en) * 2021-08-11 2021-11-19 国网山东省电力公司微山县供电公司 Method and system for detecting invasion of foreign matters into power transmission line

Also Published As

Publication number Publication date
CN115205291A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN115205291B (en) Circuit board detection method, device, equipment and medium
EP3499409A1 (en) Identifying apparatus, identifying method, and program
CN112949767B (en) Sample image increment, image detection model training and image detection method
CN108318773B (en) Transmission conductor strand breakage detection method and system
CN115937101A (en) Quality detection method, device, equipment and storage medium
WO2024002187A1 (en) Defect detection method, defect detection device, and storage medium
CN111598913B (en) Image segmentation method and system based on robot vision
CN115294060A (en) Method and device for detecting appearance defects of electrical equipment, electronic equipment and medium
CN116559177A (en) Defect detection method, device, equipment and storage medium
CN113920057A (en) Method, device and system for identifying color of product indicator light
CN115272381B (en) Metal wire segmentation method and device, electronic equipment and storage medium
CN116046790A (en) Defect detection method, device, system, electronic equipment and storage medium
CN115358992A (en) Light spot detection method and device, electronic equipment and storage medium
CN115205163A (en) Method, device and equipment for processing identification image and storage medium
CN115272290A (en) Defect detection method and device, electronic equipment and storage medium
CN117274361A (en) Material surface area measurement method and device, electronic equipment and medium
CN115542100B (en) Insulator fault detection method, device, equipment and medium
CN116433926A (en) Film first frame determining method and device, electronic equipment and storage medium
CN115328607B (en) Semiconductor device rendering method, device, equipment and storage medium
CN117764961A (en) Method and device for processing disconnection scratch connection, electronic equipment and storage medium
CN116309587A (en) Cloth flaw detection method and device, electronic equipment and storage medium
CN117764964A (en) Cross scratch processing method and device, electronic equipment and storage medium
CN116952166A (en) Method, device, equipment and medium for detecting parts of automobile door handle assembly
CN116256313A (en) Distributed PCB defect intelligent detection system based on machine vision
CN115406935A (en) Failure point positioning method, device and system and storage medium

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