WO2017193596A1 - 印制电路板图像匹配方法和系统 - Google Patents

印制电路板图像匹配方法和系统 Download PDF

Info

Publication number
WO2017193596A1
WO2017193596A1 PCT/CN2016/113120 CN2016113120W WO2017193596A1 WO 2017193596 A1 WO2017193596 A1 WO 2017193596A1 CN 2016113120 W CN2016113120 W CN 2016113120W WO 2017193596 A1 WO2017193596 A1 WO 2017193596A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature point
printed circuit
circuit board
image
template
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.)
Ceased
Application number
PCT/CN2016/113120
Other languages
English (en)
French (fr)
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 Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology 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 Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Publication of WO2017193596A1 publication Critical patent/WO2017193596A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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]

Definitions

  • the present invention relates to the field of optical detection technology, and in particular, to a printed circuit board image matching method and system.
  • the method based on template matching is to match the corresponding image block and template image by sliding the image window on the input image.
  • the common measurement method is NCC (Normalized Cross Correlation method).
  • NCC Normalized Cross Correlation method
  • this method can only match non-rotating boards, and image matching is not possible for boards that may have varying degrees of rotational variation in an online automated optical inspection environment.
  • the matching method based on SIFT/SURF operator is to eliminate noise by multi-scale decomposition based on linear Gaussian pyramid, and extract significant feature points, and then match the input image with the feature points of the template to complete the image matching.
  • this kind of method requires a lot of computation time and computational resources in the matching process, which not only slows the calculation, but also limits the usage scenario of the AOI, and also increases the computational hardware cost;
  • the feature detection algorithm such as SIFT/SURF is based on linearity.
  • the Gaussian pyramid performs multi-scale decomposition. This decomposition method sacrifices local precision, which is easy to cause boundary blur and detail loss, which leads to matching errors and other results.
  • the conventional printed circuit board image matching method has a slow calculation speed, a high hardware cost, and a low accuracy.
  • a printed circuit board image matching method includes the following steps:
  • the above-mentioned printed circuit board image matching method performs feature point extraction on the template image and the test pattern of the obtained target printed circuit board, respectively, to obtain a first feature point set of the template image and a second feature point set of the test pattern. Recalculating a similarity value between the first feature point of the first feature point set and the second feature point of the second feature point set, and performing the first feature point and the second feature point according to the similarity value Pairing, obtaining a pair of feature points; calculating a conversion matrix of the template pattern of the target printed circuit board to the test pattern according to the feature point pair, and using the conversion matrix to find a printed circuit matching the template image in the test pattern Board image.
  • the printed circuit board image matching method of the invention realizes the fast matching of the printed circuit board image, and effectively improves the accuracy of the printed circuit board image matching method.
  • a printed circuit board image matching system comprising:
  • An acquisition module configured to obtain a template image and a test chart of the target printed circuit board; wherein the template image is an angle corrected image of the target printed circuit board, and the test chart is the target printed circuit An unangled image of the board;
  • An extraction module configured to perform feature point extraction on the template image and the test image respectively, and acquire a first feature point set of the template image and a second feature point set of the test image;
  • a pairing module configured to calculate a similarity value between the first feature point of the first feature point set and the second feature point of the second feature point set, and the first feature point and the second feature point according to the similarity value Feature points are paired to obtain feature point pairs;
  • a matching module configured to calculate a conversion matrix of the template map of the target printed circuit board to the test pattern according to the feature point pair, and use the conversion matrix to search for a printed circuit board image in the test chart that matches the template image .
  • the printed circuit board image matching system feature extraction is performed on the template image and the test pattern of the target printed circuit board acquired by the acquisition module by the extraction module, and the first feature point set and the test chart of the template image are obtained. a second feature point set; and calculating, by the pairing module, the first feature point of the first feature point set and the second feature point of the second feature point set a similarity value between the first feature point and the second feature point according to the similarity value to obtain a feature point pair; finally, the matching module is used to calculate the target printed circuit according to the feature point pair
  • the template map of the board to the conversion matrix of the test pattern, and the conversion matrix is used to find the printed circuit board image in the test chart that matches the template image.
  • FIG. 1 is a flow chart of a method for matching printed circuit board images according to an embodiment of the present invention
  • FIG. 2 is a flow chart of a method for matching printed circuit board images according to another embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a printed circuit board image matching system according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural view of a printed circuit board image matching system according to another embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for matching a printed circuit board image according to an embodiment of the present invention, including the following steps:
  • Step S101 Acquire a template image and a test chart of the target printed circuit board; wherein the template image is an angle-corrected image of the target printed circuit board, and the test chart is the target printed circuit board An image without angle correction;
  • the template points and test patterns of the target printed circuit board are obtained to prepare for feature point extraction in the subsequent steps.
  • the template image described in this step may only include an angle corrected target printed circuit board image
  • the test image may include one or more target printed circuit board images, and each The image of the board is not angle corrected and may be scattered anywhere in the image; in addition, the target printed circuit board may not be included in the test chart.
  • the step 101 of acquiring a template image and a test pattern of the target printed circuit board may include:
  • the printed circuit board image matching method of the present invention does not output any image; if the test image includes N target printed circuit boards, the present invention The printed circuit board image matching method outputs the successfully printed printed circuit board image in N times.
  • Step S102 performing feature point extraction on the template image and the test image respectively, and acquiring a first feature point set of the template image and a second feature point set of the test image;
  • the feature point detection and extraction are performed on the obtained target printed circuit board template map and the test image respectively, and the first feature point set of the template image and the second feature point set of the test image are obtained, which is convenient for subsequent The step of pairing the above feature points.
  • the number of feature points of the first feature point set is not necessarily equal to the number of feature points of the second feature point set.
  • the first feature point set is obtained.
  • the number of feature points is 1000.
  • the number of feature points of the second feature point set may be 1500.
  • the main purpose is The 1000 feature points of the first feature point set and the 1500 feature points of the second feature point set are searched and paired.
  • Step S103 calculating a similarity value between the first feature point of the first feature point set and the second feature point of the second feature point set, and the first feature point and the second feature point according to the similarity value Pairing to obtain feature point pairs;
  • the first feature point set and the second feature point set are extracted and matched by the first feature point set extracted in step S102, that is, by calculating the first feature point and the second feature of the first feature point set. And a similarity value between the second feature points of the point set, according to the similarity value, finding feature points corresponding to the one-to-one correspondence between the template image and the test image, and composing the first feature point set and the second feature point set Feature point pairs.
  • Step S104 Calculate a conversion matrix of the template of the target printed circuit board to the test pattern according to the feature point pair, and use the conversion matrix to search for a printed circuit board image in the test chart that matches the template image.
  • step S103 After retrieving the pairing to obtain a plurality of sets of feature point pairs in step S103, calculating a conversion matrix of the template map of the target printed circuit board to the test pattern according to the first feature point and the second feature point of the feature point pair, and The conversion matrix is used to find an image of the target printed circuit board in the test chart that matches the template image.
  • the above-mentioned printed circuit board image matching method performs feature point extraction on the template image and the test pattern of the obtained target printed circuit board, respectively, to obtain a first feature point set of the template image and a second feature point set of the test pattern. ; calculate the first a similarity value between the first feature point of the feature point set and the second feature point of the second feature point set, and the first feature point and the second feature point are paired according to the similarity value to obtain a feature point And calculating a conversion matrix of the template of the target printed circuit board to the test pattern according to the feature point pair, and using the conversion matrix to search for a printed circuit board image in the test chart that matches the template image.
  • the printed circuit board image matching method of the invention realizes the fast matching of the printed circuit board image, and effectively improves the accuracy of the printed circuit board image matching method.
  • the calculation of the template of the target printed circuit board to the conversion matrix of the test image according to the feature point pair, and using the conversion includes:
  • the method further includes:
  • Step S105 Shielding the feature point pairs to match other printed circuit board images in the plurality of target printed circuit board images.
  • the test chart contains images of a plurality of printed circuit boards. After the image matching of one printed circuit board is completed, in order to avoid matching the images of other printed circuit boards, it is necessary to clear the previous pairs. Feature points involved in matching the target printed circuit board image.
  • the conversion matrix calculated by the previous round of matching can find the printed circuit board image area corresponding to the printed circuit board image in the template image in the test chart, that is, by the template image
  • the printed circuit board image, the printed circuit board image area in the test chart obtained through the conversion matrix mapping, masks the feature points in the area, and only considers the remaining feature points when performing other printed circuit board image matching. It can not only avoid the influence of the previous round, but also improve the efficiency of matching other printed circuit board images.
  • the technical solution of the embodiment achieves fast matching of multiple printed circuit board images and improves the working efficiency of the printed circuit board image matching method.
  • the step of performing feature point extraction on the template image and the test image respectively includes:
  • the nonlinear scale space of a single linguistic layer is constructed by using a KAZE operator, and the feature points are extracted from the template map and the test map by using the nonlinear scale space.
  • the printed circuit board image matching method of this embodiment uses a KAZE operator to pass nonlinear expansion.
  • the spatial filtering is used to construct a stable nonlinear scale space of a single linguistice layer, and the feature points are extracted from the template graph and the test graph by using the nonlinear scale space, and the calculation is greatly improved under the premise that the precision is relatively unchanged.
  • Efficiency moreover, the KAZE operator is used to construct the nonlinear scale space of a single Octave layer, and the feature points of the rotated circuit board image can be extracted, which facilitates image matching in subsequent steps and reduces the printed circuit board.
  • the hardware cost of the image matching method is used to construct a stable nonlinear scale space of a single Octave layer, and the feature points are extracted from the template graph and the test graph by using the nonlinear scale space, and the calculation is greatly improved under the premise that the precision is relatively unchanged.
  • Efficiency moreover, the KAZE operator is used to construct the nonlinear scale space of a single Octave layer, and
  • L represents the image brightness of the template or test pattern of the target printed circuit board
  • t represents the scale parameter
  • c(x, y, t) represents the conduction function
  • the extracted feature points are represented by feature vectors, and are prepared for pairing the feature points in the subsequent steps.
  • the printed circuit board image matching method of the present invention calculates the similarity value between the first feature point of the first feature point set and the second feature point of the second feature point set.
  • the steps can include:
  • the feature points in the first feature point set and the second feature point set may be obtained by using, for example, a KAZE operator.
  • the high-dimensional vector of the 64-dimensional feature is represented; and the first feature point of the first feature point set and the second feature point of the second feature point set are indexed and retrieved by using the multi-probe LSH index function, and finally the feature point pair is obtained.
  • FIG. 2 is a flowchart of a method for matching a printed circuit board image according to another embodiment of the present invention, and the step of obtaining feature point pairs of the first feature point set and the second feature point set is performed. After that, you can also include:
  • Step S106 Calculate a best matching distance and a second best matching distance between the first feature point and the second feature point in the feature point pair;
  • Step S107 Determine the reliability of the feature point pair by comparing the difference between the best matching distance and the sub-optimal matching distance and the preset threshold value, and filter the feature point pair according to the reliability.
  • the feature points of the first feature point set and the second feature point set are searched and paired by using the multi-probe LSH index to obtain features. After the point is paired, certain measures can be taken to re-evaluate the reliability of the obtained feature point pairs. In the implementation, determining the feature point pair by comparing the difference between the best matching distance of the first feature point and the second feature point in the feature point pair and the sub-optimal matching distance and the preset threshold value Reliability, filtering the feature point pairs according to reliability, effectively improving the accuracy of the printed circuit board image matching method, and further improving the efficiency of the printed circuit board image matching method of the present invention.
  • the printed circuit board image matching method of the present invention determines the feature point pair by comparing the difference between the best matching distance and the sub-optimal matching distance and the preset threshold value.
  • the step S107 of filtering the feature point pairs according to the reliability may include:
  • the difference between the best matching distance and the sub-optimal matching distance is greater than a preset threshold, determining that the feature point pair is reliable; otherwise, determining that the feature point pair is unreliable, and filtering the feature point pair.
  • the feature point pair whose difference between the best matching distance and the second best matching distance is greater than the preset threshold is retained, and the difference between the best matching distance and the second best matching distance is not greater than the preset threshold.
  • the culling is performed to improve the accuracy of the printed circuit board image matching method of the present invention, and further improves the working efficiency of the printed circuit board image matching method of the present invention.
  • the printed circuit board image matching method of the present invention may further include: after the step of using the conversion matrix to search for an image of the printed circuit board that matches the template image in the test image, the method further includes:
  • Step S108 Correcting the printed circuit board image in the test chart according to the target printed circuit board image in the template image.
  • the printed circuit board image in the test chart can be printed according to the target printed circuit board image in the template image.
  • Image correction methods such as geometric correction, angle correction, etc., including but not limited to.
  • the calculating the conversion matrix of the first feature point to the second feature point of the plurality of sets of feature point pairs comprises:
  • the method may further include:
  • a random sample set algorithm may be used to calculate a conversion matrix of a first feature point to a second feature point of a plurality of sets of feature point pairs, in order to accurately describe a template map of the target printed circuit board to a test map. Relationship, the set of feature points with the smallest selection error is the calculated conversion matrix as the template of the target printed circuit board to the conversion matrix of the test chart.
  • first feature point and the second feature point may be represented in the form of coordinates or vectors, which is also advantageous for calculating the first feature point to the second feature point according to the first feature point and the second feature point. Conversion matrix.
  • the shape of the target printed circuit board in the test chart can be filtered a priori.
  • the printed circuit board image matching method of the present invention may further include: after the step of using the conversion matrix to search for a target printed circuit board image that matches the template image in the test pattern,
  • Step S109 filtering the target printed circuit board image in the test chart that is inconsistent with the morphological feature of the target printed circuit board image in the template image by comparing the morphological features of the target printed circuit board image in the test chart and the template image.
  • the printed circuit board image matching method of the present invention can determine whether the image area of the mapped target printed circuit board in the test chart is still a convex polygon and its area and the template image aims The image area of the printed circuit board is roughly equivalent to determine whether the match is successful. If the matching is successful, the geometrically corrected printed circuit board image that is matched this time is output, otherwise the matching process is ended.
  • FIG. 3 is a schematic structural diagram of a printed circuit board image matching system according to an embodiment of the present invention, including:
  • An obtaining module 101 configured to acquire a template image and a test chart of the target printed circuit board; wherein the template image is an angle-corrected image of the target printed circuit board, and the test chart is the target printing An unangled image of the board;
  • the template image described in the obtaining module 101 may include only one angle corrected target printed circuit board image, and the test image may include one or more target printed circuit board images, and Each board image is not angularly corrected and may be scattered anywhere in the image; in addition, the target printed circuit board may not be included in the test chart.
  • the acquisition module 101 can also be used to:
  • the printed circuit board image matching system of the present invention does not output any image; if the test chart includes N target printed circuit boards, the present invention The printed circuit board image matching system outputs the successfully matched board image in N outputs.
  • the extracting module 102 is configured to perform feature point extraction on the template graph and the test graph, respectively, and obtain a first feature point set of the template graph and a second feature point set of the test graph;
  • the feature point detection and extraction are performed on the acquired target printed circuit board template image and the test image respectively, and the first feature point set of the template image and the second feature point set of the test image are obtained.
  • the above feature points are paired for the subsequent steps.
  • the number of feature points of the first feature point set is not necessarily equal to the number of feature points of the second feature point set.
  • the first feature point set is obtained.
  • the number of feature points is 1000.
  • the number of feature points of the second feature point set may be 1500.
  • the main purpose is The 1000 feature points of the first feature point set and the 1500 feature points of the second feature point set are searched and paired.
  • the pairing module 103 is configured to calculate a similarity value between the first feature point of the first feature point set and the second feature point of the second feature point set, and the first feature point and the first feature point according to the similarity value Two feature points are paired to obtain feature point pairs;
  • the first feature point set extracted by the extraction module 102 and the feature points in the second feature point set are search-matched, that is, by calculating the first feature point of the first feature point set and And a similarity value between the second feature points of the second feature point set, according to the similarity value, finding a feature point corresponding to the template map and the test image, and forming the first feature point set and the second feature A feature point pair of a point set.
  • the matching module 104 is configured to calculate a conversion matrix of the template map of the target printed circuit board to the test pattern according to the feature point pair, and use the conversion matrix to search for a printed circuit board that matches the template image in the test pattern. image.
  • step S103 After retrieving the pairing to obtain a plurality of sets of feature point pairs in step S103, calculating a conversion matrix of the template map of the target printed circuit board to the test pattern according to the first feature point and the second feature point of the feature point pair, and The conversion matrix is used to find an image of the target printed circuit board in the test chart that matches the template image.
  • feature extraction is performed on the template image and the test pattern of the target printed circuit board acquired by the acquisition module 101 by the extraction module 102, and the first feature point set and test of the template image are obtained.
  • a second set of feature points of the graph a second set of feature points of the graph; and calculating, by the pairing module 103, a similarity value between the first feature point of the first feature point set and the second feature point of the second feature point set, according to the similarity value pair
  • the first feature point and the second feature point are paired to obtain a feature point pair.
  • the matching module 104 calculates a conversion matrix of the target printed circuit board template to the test pattern according to the feature point pair, and utilizes The conversion matrix looks for a printed circuit board image in the test pattern that matches the template map.
  • the matching module 104 can also be used to:
  • the method may further include:
  • the shielding module 105 is configured to shield the feature point pairs to match other printed circuit board images in the plurality of target printed circuit board images.
  • the test chart contains images of a plurality of printed circuit boards, and a printed circuit board is completed. After the image is matched, in order to avoid matching the other printed circuit board images, it is necessary to clear the feature points involved in the previous matching of the target printed circuit board image.
  • the conversion matrix calculated by the previous round of matching can find the printed circuit board image area corresponding to the printed circuit board image in the template image in the test chart, that is, by the template image
  • the printed circuit board image, the printed circuit board image area in the test chart obtained through the conversion matrix mapping, masks the feature points in the area, and only considers the remaining feature points when performing other printed circuit board image matching. It can not only avoid the influence of the previous round, but also improve the efficiency of matching other printed circuit board images.
  • the technical solution of the embodiment achieves fast matching of multiple printed circuit board images and improves the working efficiency of the printed circuit board image matching method.
  • the extraction module 102 can also be used to:
  • the nonlinear scale space of a single linguistic layer is constructed by using a KAZE operator, and the feature points are extracted from the template map and the test map by using the nonlinear scale space.
  • the extraction module 102 of the printed circuit board image matching system of the present embodiment constructs a stable nonlinear scale space of a single Octave layer by nonlinear diffusion filtering using a KAZE operator, and utilizes the nonlinear scale space.
  • Feature point extraction is performed on the template graph and the test graph, and the computational efficiency is greatly improved under the premise that the precision is relatively unchanged; moreover, the nonlinear scale space of a single linguistice layer is constructed by using the KAZE operator, and the rotation can also be performed.
  • the feature points of the changed printed circuit board image are extracted, which facilitates image matching in subsequent steps, and reduces the hardware cost of the printed circuit board image matching system.
  • L represents the image brightness of the template or test pattern of the target printed circuit board
  • t represents the scale parameter
  • c(x, y, t) represents the conduction function
  • the extracted feature points are represented by feature vectors, and are prepared for pairing the feature points in the subsequent steps.
  • the retrieval module 103 can also be used to:
  • the feature points in the first feature point set and the second feature point set may be obtained by using, for example, a KAZE operator.
  • the high-dimensional vector of the 64-dimensional feature is represented; and the first feature point of the first feature point set and the second feature point of the second feature point set are indexed and retrieved by using the multi-probe LSH index function, and finally the feature point pair is obtained.
  • the efficiency and the matching precision of the retrieval pairing are effectively improved, and the working efficiency of the printed circuit board image matching system is further improved.
  • FIG. 4 is a schematic structural diagram of a printed circuit board image matching system according to another embodiment of the present invention. After the calculating module 103, the method further includes:
  • the calculating module 106 is configured to calculate a best matching distance and a second best matching distance between the first feature point and the second feature point in the feature point pair;
  • the determining module 107 is configured to determine the reliability of the feature point pair by comparing the difference between the best matching distance and the sub-optimal matching distance and the preset threshold value, and filter the feature point pair according to the reliability.
  • the feature points of the first feature point set and the second feature point set are searched and paired by using the multi-probe LSH index to obtain features. After the point is paired, certain measures can be taken to identify the reliability of the obtained feature point pairs. In the implementation, determining the feature point pair by comparing the difference between the best matching distance of the first feature point and the second feature point in the feature point pair and the sub-optimal matching distance and the preset threshold value Reliability, filtering the feature point pairs according to reliability, effectively improving the accuracy of the printed circuit board image matching method, and further improving the efficiency of the printed circuit board image matching method of the present invention.
  • the printed circuit board image matching system of the present invention may also For:
  • the difference between the best matching distance and the sub-optimal matching distance is greater than a preset threshold, determining that the feature point pair is reliable; otherwise, determining that the feature point pair is unreliable, and filtering the feature point pair.
  • the feature point pair whose difference between the best matching distance and the second best matching distance is greater than the preset threshold is retained, and the difference between the best matching distance and the second best matching distance is not greater than the preset threshold. Elimination of the printed circuit board image matching system of the present invention improves the accuracy of the printed circuit board image matching system of the present invention.
  • the printed circuit board image matching system of the present invention after the matching module 104, further includes:
  • the correction module 108 is configured to correct the printed circuit board image in the test chart according to the target printed circuit board image in the template image.
  • the image correction method of the printed circuit board image in the test chart including but not limited to geometric correction, angle correction, etc., may be performed according to the target printed circuit board image in the template image.
  • the matching module 104 can also be used to:
  • a random sample set algorithm may be used to calculate a conversion matrix of a first feature point to a second feature point of a plurality of sets of feature point pairs, in order to accurately describe a template map of the target printed circuit board to a test map. Relationship, the set of feature points with the smallest selection error is the calculated conversion matrix as the template of the target printed circuit board to the conversion matrix of the test chart.
  • first feature point and the second feature point may be represented in the form of coordinates or vectors, which is also advantageous for calculating the first feature point to the second feature point according to the first feature point and the second feature point. Conversion matrix.
  • the target in the test chart can be printed.
  • the shape of the board is filtered a priori.
  • the printed circuit board image matching system of the present invention after the matching module 104, may further include:
  • the shape prior module 109 is configured to compare the morphological features of the target printed circuit board image in the test chart and the template image to print the target image in the test chart that is inconsistent with the morphological feature of the target printed circuit board image in the template image.
  • the board image is filtered.
  • the printed circuit board image matching system of the present invention can utilize the shape prior module 109 to determine whether the image area of the mapped target printed circuit board in the test chart is still a convex polygon and The area is roughly equivalent to the image area of the target printed circuit board in the template map to determine whether the match was successful. If the matching is successful, the geometrically corrected printed circuit board image that is matched this time is output, otherwise the matching process is ended.
  • the above-mentioned printed circuit board image matching method and system by performing feature point extraction on the template image and the test pattern of the obtained target printed circuit board respectively, obtaining the first feature point set of the template image and the second feature of the test chart a point set; recalculating a similarity value between the first feature point of the first feature point set and the second feature point of the second feature point set, and the first feature point and the second feature according to the similarity value Pointing is performed to obtain a pair of feature points; calculating a conversion matrix of the template of the target printed circuit board to the test pattern according to the feature point pair, and using the conversion matrix to find a print matching the template image in the test chart Board image.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

一种印制电路板图像匹配方法和系统,其中,所述方法包括如下步骤:获取目标印制电路板的模板图和测试图(S101);分别对所述模板图和测试图进行特征点提取,获取所述模板图的第一特征点集和测试图的第二特征点集(S102);计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对(S103);根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像(S104)。通过上述方法,实现了对印制电路板图像的快速匹配,提高了印制电路板图像匹配方法和系统的准确性。

Description

印制电路板图像匹配方法和系统 技术领域
本发明涉及光学检测技术领域,特别是涉及一种印制电路板图像匹配方法和系统。
背景技术
在自动光学检测系统(Automatic Optic Inspection,AOI)中,常常需要先对印刷电路板进行图像匹配,以便后续步骤的对印刷电路板的检测能够正常运行。
对于印制电路板图像匹配,现有的技术方案主要有两种:一、基于模板匹配的方法;二、基于SIFT(Scale-invariant feature transform,尺度不变特征变换)/SURF(Speeded Up Robust Features,加速鲁棒特性)算子的匹配方法。
基于模板匹配的方法是通过在输入图像上滑动图像窗口对相应的图像块和模板图像进行匹配,常见的度量方法是NCC(Normalized Cross Correlation method,归一化积相关算法)。但是,该方法仅能匹配无旋转的电路板,对于在在线自动光学检测环境中拍摄的可能有不同程度的旋转变化的电路板无法进行图像匹配。
基于SIFT/SURF算子的匹配方法是通过基于线性的高斯金字塔进行多尺度分解来消除噪声,并提取显著特征点,然后通过匹配输入图像与模板的特征点完成图像的匹配。但是,该类方法在匹配过程需要耗费大量的计算时间与计算资源,不仅计算速度慢,而且限制AOI的使用场景,还提高了计算硬件成本;另外,SIFT/SURF等特征检测算法是基于线性的高斯金字塔进行多尺度分解的,这种分解方法牺牲了局部精度,容易造成边界模糊和细节丢失,进而导致匹配错误等结果。
综上所述,传统的印制电路板图像匹配方法计算速度慢、硬件成本过高以及准确率较低。
发明内容
基于此,有必要针对传统的印制电路板图像匹配方法计算速度慢、硬件成本过高以及准确率较低的技术问题,提供一种印制电路板图像匹配方法和系统。
一种印制电路板图像匹配方法,包括如下步骤:
获取目标印制电路板的模板图和测试图;其中,所述模板图为所述目标印制电路板的经过角度矫正的图像,所述测试图为所述目标印制电路板的未经角度矫正的图像;
分别对所述模板图和测试图进行特征点提取,获取所述模板图的第一特征点集和测试图的第二特征点集;
计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;
根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。
上述印制电路板图像匹配方法,通过分别对获取的目标印制电路板的模板图和测试图进行特征点提取,得到所述模板图的第一特征点集和测试图的第二特征点集;再计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。通过上述技术方案,本发明的印制电路板图像匹配方法,实现了对印制电路板图像的快速匹配,有效地提高了印制电路板图像匹配方法的准确性。
一种印制电路板图像匹配系统,包括:
获取模块,用于获取目标印制电路板的模板图和测试图;其中,所述模板图为所述目标印制电路板的经过角度矫正的图像,所述测试图为所述目标印制电路板的未经角度矫正的图像;
提取模块,用于分别对所述模板图和测试图进行特征点提取,获取所述模板图的第一特征点集和测试图的第二特征点集;
配对模块,用于计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;
匹配模块,用于根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。
上述印制电路板图像匹配系统,通过提取模块分别对获取模块获取到的目标印制电路板的模板图和测试图进行特征点提取,得到所述模板图的第一特征点集和测试图的第二特征点集;再通过配对模块计算第一特征点集的第一特征点和第二特征点集的第二特征点之 间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;最后,利用匹配模块根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。通过上述技术方案,本发明的印制电路板图像匹配系统,实现了对目标印制电路板图像的快速匹配,有效地提高了印制电路板图像匹配系统的准确性。
附图说明
图1为本发明的一个实施例的印制电路板图像匹配方法流程图;
图2为本发明的另一个实施例的印制电路板图像匹配方法流程图;
图3为本发明的一个实施例的印制电路板图像匹配系统的结构示意图;
图4为本发明的另一个实施例的印制电路板图像匹配系统的结构示意图。
具体实施方式
为了更进一步阐述本发明所采取的技术手段及取得的效果,下面结合附图及较佳实施例,对本发明的技术方案,进行清楚和完整的描述。
如图1所示,图1为本发明的一个实施例的印制电路板图像匹配方法流程图,包括如下步骤:
步骤S101:获取目标印制电路板的模板图和测试图;其中,所述模板图为所述目标印制电路板的经过角度矫正的图像,所述测试图为所述目标印制电路板的未经角度矫正的图像;
在本步骤中,通过获取目标印制电路板的模板图和测试图,为后续步骤的特征点提取做准备。
在具体实施时,本步骤中所述的模板图里可以仅包含一张经过角度矫正的目标印制电路板图像,而测试图中可能包含一张或者多张目标印制电路板图像,且每张电路板图像均未经过角度矫正,并可能散落在图像中的任意位置;此外,测试图中还有可能不包含目标印制电路板。
在其中一个实施例中,本发明的印制电路板图像匹配方法,所述获取目标印制电路板的模板图和测试图的步骤101可以包括:
获取多个目标印制电路板的模板图和测试图;其中,所述模板图为所述多个目标印制电路板的经过角度矫正的图像,所述测试图为所述多个目标印制电路板的未经角度矫正的图像。
在具体实施时,若测试图中不包含目标印制电路板时,本发明的印制电路板图像匹配方法,则不输出任何图像;若测试图中包括N张目标印制电路板,本发明的印制电路板图像匹配方法,则分N次输出匹配成功的印制电路板图像。
步骤S102:分别对所述模板图和测试图进行特征点提取,获取所述模板图的第一特征点集和测试图的第二特征点集;
在本步骤中,通过对获取的目标印制电路板模板图和测试图分别进行特征点检测与提取,得到所述模板图的第一特征点集和测试图的第二特征点集,便于后续步骤的对上述特征点进行配对。在具体实施时,第一特征点集的特征点个数与第二特征点集的特征点个数不一定相等,例如,经过对模板图进行特征点检测与提取,得到第一特征点集的特征点的个数为1000,经过对测试图进行特征点检测与提取,得到第二特征点集的特征点的个数可能为1500,在后续步骤的对上述特征点进行配对时,主要就是针对第一特征点集的1000个特征点和第二特征点集的1500个特征点进行检索配对。
步骤S103:计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;
在本步骤中,通过对步骤S102提取到的第一特征点集和第二特征点集中的特征点进行检索匹配,也就是说,通过计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值,查找到模板图和测试图中一一对应的特征点,并组成第一特征点集和第二特征点集的特征点对。
步骤S104:根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。
在步骤S103检索配对得到多组特征点对之后,根据所述特征点对中的第一特征点和第二特征点,计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的目标印制电路板的图像。
上述印制电路板图像匹配方法,通过分别对获取的目标印制电路板的模板图和测试图进行特征点提取,得到所述模板图的第一特征点集和测试图的第二特征点集;再计算第一 特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。通过上述技术方案,本发明的印制电路板图像匹配方法,实现了对印制电路板图像的快速匹配,有效地提高了印制电路板图像匹配方法的准确性。
在具体实施时,若测试图中包含多个目标印制电路板图像,所述根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像的步骤S104包括:
根据所述特征点对计算其中一个目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的所述其中一个目标印制电路板图像。
在所述利用所述转换矩阵查找测试图中与模板图相匹配的所述其中一个目标印制电路板图像的步骤之后,还包括:
步骤S105:将所述特征点对进行屏蔽,对多个目标印制电路板图像中的其他印制电路板图像进行匹配。
在上述实施例中,测试图中包含了多张印制电路板的图像,在完成了一张印制电路板的图像匹配之后,为了避免对其他印制电路板图像的匹配,需要清除之前对目标印制电路板图像进行匹配时涉及到的特征点。举例来说,由上一轮匹配所计算得到的转换矩阵,可在测试图中查找到与模板图中的印制电路板图像相对应的印制电路板图像区域,即,由模板图中的印制电路板图像,经过转换矩阵映射得到的测试图中的印制电路板图像区域,屏蔽掉该区域中的特征点,在进行其他印制电路板图像匹配时,只用考虑剩余的特征点即可,不仅避免了受上一轮的影响,也提高了对其他印制电路板图像进行匹配的效率。本实施例的技术方案,实现了对多张印制电路板图像的快速匹配,提高了印制电路板图像匹配方法的工作效率。
在其中一个实施例中,本发明的印制电路板图像匹配方法,所述分别对所述模板图和测试图进行特征点提取的步骤包括:
利用KAZE算子构造单个Octave层的非线性尺度空间,并利用所述非线性尺度空间对所述模板图和测试图进行特征点提取。
在实际应用时,本实施例的印制电路板图像匹配方法,利用KAZE算子通过非线性扩 散滤波来构造稳定的单个Octave层的非线性尺度空间,并利用所述非线性尺度空间对所述模板图和测试图进行特征点提取,在保持精度相对不变的前提下,大大提升了计算效率;而且,利用KAZE算子构造单个Octave层的非线性尺度空间,还可以对经过旋转变化的印制电路板图像的特征点进行提取,便于进行后续步骤的图像匹配,降低了印制电路板图像匹配方法的硬件成本。
本实施例所述的非线性扩散滤波方法,是将目标印制电路板的模板图和测试图的图像亮度L在不同尺度上的变化视为某种形式的流动函数的散度:
Figure PCTCN2016113120-appb-000001
式中,L表示所述目标印制电路板的模板图或者测试图的图像亮度,t表示尺度参数,c(x,y,t)表示传导函数。
在具体实施时,为了有限保留宽度较大的区域,可以选择如下式所示的传导函数c(x,y,t):
Figure PCTCN2016113120-appb-000002
式中,c(x,y,t)表示传导函数,t表示尺度参数,
Figure PCTCN2016113120-appb-000003
表示高斯平滑后的图像Lσ的梯度,k表示控制扩散程度的常数。
在具体实施时,提取的特征点以特征向量进行表示,为后续步骤的对特征点进行配对做准备。
在其中一个实施例中,本发明所述的印制电路板图像匹配方法,所述计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值的步骤可以包括:
利用多探头索引函数对第一特征点集的第一特征点和第二特征点集的第二特征点进行索引检索,并计算所述第一特征点和第二特征点之间的度量距离;
根据所述度量距离确定所述第一特征点和第二特征点之间的相似度值。
在本实施例中,由于得到的第一特征点集和第二特征点集中的特征点数量较多,可以将第一特征点集和第二特征点集中的特征点采用诸如KAZE算子得到的64维特征的高维向量来进行表示;再利用多探头LSH索引函数对第一特征点集的第一特征点和第二特征点集的第二特征点进行索引检索,并最终得到特征点对。通过上述技术方案,有效地提高了 检索配对的效率和配对精度,进一步提高了印制电路板图像匹配方法的效率。
如图2所示,图2为本发明的另一个实施例的印制电路板图像匹配方法流程图,在所述得到所述第一特征点集和第二特征点集的特征点对的步骤之后,还可以包括:
步骤S106:计算所述特征点对中的第一特征点和第二特征点之间的最佳匹配距离和次佳匹配距离;
步骤S107:通过比较所述最佳匹配距离与次佳匹配距离的差距与预设阈值的大小关系,判断所述特征点对的可靠性,根据可靠性对特征点对进行过滤。
在上述实施例中,为了进一步提高本发明的印制电路板图像匹配方法的准确率,在利用多探头LSH索引对第一特征点集和第二特征点集中的特征点进行检索配对,得到特征点对之后,可以采取一定的措施来对得到的特征点对的可靠性进行再次判断。在本实施中,通过比较所述特征点对中的第一特征点和第二特征点的最佳匹配距离与次佳匹配距离的差距与预设阈值的大小关系,判断所述特征点对的可靠性,根据可靠性对特征点对进行过滤,有效地提高了印制电路板图像匹配方法的准确性,进一步提高了本发明的印制电路板图像匹配方法的效率。
在其中一个实施例中,本发明的印制电路板图像匹配方法,所述通过比较所述最佳匹配距离与次佳匹配距离的差距与预设阈值的大小关系,判断所述特征点对的可靠性,根据可靠性对特征点对进行过滤的步骤S107可以包括:
若所述最佳匹配距离与次佳匹配距离的差距大于预设阈值,则判定所述特征点对可靠;否则,判定所述特征点对不可靠,并对所述特征点对进行过滤。
在上述实施例中,通过将最佳匹配距离与次佳匹配距离的差距大于预设阈值的特征点对进行保留,将最佳匹配距离与次佳匹配距离的差距不大于预设阈值的特征点对进行剔除,提高了本发明的印制电路板图像匹配方法的准确性,进一步也提高了本发明的印制电路板图像匹配方法的工作效率。
在其中一个实施例中,本发明的印制电路板图像匹配方法,在所述利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板的图像的步骤之后,还可以包括:
步骤S108:根据所述模板图中的目标印制电路板图像对测试图中的印制电路板图像进行矫正。
在实际应用中,可以根据模板图中的目标印制电路板图像对测试图中的印制电路板图 像进行包括但不限于的几何矫正、角度矫正等图像矫正方法。
在其中一个实施例中,本发明的印制电路板图像匹配方法,所述计算所述多组特征点对中的第一特征点到第二特征点的转换矩阵的步骤包括:
利用随机样本集算法计算多组特征点对中的第一特征点到第二特征点的转换矩阵;
在所述利用随机样本集算法计算多组特征点对中的第一特征点到第二特征点的转换矩阵的步骤之后,还可以包括:
选择误差最小的一组特征点对所计算得到的转换矩阵作为所述模板图到测试图的转换矩阵;其中,所述转换矩阵表示模板图中的目标印制电路板图像到与模板图中的目标印制电路板图像对应的测试图中的印制电路板图像的映射关系。
在本实施例中,可以利用随机样本集算法计算多组特征点对中的第一特征点到第二特征点的转换矩阵,为了准确地描述目标印制电路板的模板图到测试图的映射关系,选择误差最小的一组特征点对计算得到的转换矩阵作为目标印制电路板的模板图到测试图的转换矩阵。
在实际应用时,第一特征点和第二特征点可以以坐标或者向量的形式进行表示,这也有利于根据第一特征点和第二特征点,计算得到第一特征点到第二特征点的转换矩阵。
在具体实施时,如果测试图中没有目标印制电路板的图像,而模板图中只有一张该目标印制电路板的图像时,也有可能计算得到这样的转换矩阵,从而形成错误的配对。因此,为了进一步提高本发明的印制电路板图像匹配方法的准确率,可以对测试图中的目标印制电路板的形态先验进行过滤。
在其中一个实施例中,本发明的印制电路板图像匹配方法,在所述利用所述转换矩阵查找测试图中与模板图相匹配的目标印制电路板图像的步骤之后,还可以包括:
步骤S109:通过比较测试图和模板图中的目标印制电路板图像的形态特征,对测试图中与模板图中的目标印制电路板图像的形态特征不一致的目标印制电路板图像进行过滤。
由于印制电路板的图像区域一般为凸多边形,因此可假设模板图中的目标印制电路板的图像区域经过映射后,也应该是一个凸多边形;而且,经过测试图中的经过映射后的目标印制电路板的图像区域的面积,也应与模板图中的目标印制电路板的图像区域大致相当。因此,在实际应用中,本发明的印制电路板图像匹配方法,可以通过判断测试图中的经过映射后的目标印制电路板的图像区域是否仍为凸多边形且其面积与模板图中的目标 印制电路板的图像区域大致相当,来断定本次匹配是否成功。如果匹配成功,则输出本次匹配出来的经过几何矫正的印制电路板图像,否则结束本次匹配过程。
如图3所示,图3为本发明的一个实施例的印制电路板图像匹配系统的结构示意图,包括:
获取模块101,用于获取目标印制电路板的模板图和测试图;其中,所述模板图为所述目标印制电路板的经过角度矫正的图像,所述测试图为所述目标印制电路板的未经角度矫正的图像;
在具体实施时,获取模块101中所述的模板图里可以仅包含一张经过角度矫正的目标印制电路板图像,而测试图中可能包含一张或者多张目标印制电路板图像,且每张电路板图像均未经过角度矫正,并可能散落在图像中的任意位置;此外,测试图中还有可能不包含目标印制电路板。
在其中一个实施例中,本发明的印制电路板图像匹配系统,所述获取模块101还可以用于:
获取多个目标印制电路板的模板图和测试图;其中,所述模板图为所述多个目标印制电路板的经过角度矫正的图像,所述测试图为所述多个目标印制电路板的未经角度矫正的图像。
在具体实施时,若测试图中不包含目标印制电路板时,本发明的印制电路板图像匹配系统,则不输出任何图像;若测试图中包括N张目标印制电路板,本发明的印制电路板图像匹配系统,则分N次输出匹配成功的电路板图像。
提取模块102,用于分别对所述模板图和测试图进行特征点提取,获取所述模板图的第一特征点集和测试图的第二特征点集;
在上述提取模块102中,通过对获取的目标印制电路板模板图和测试图分别进行特征点检测与提取,得到所述模板图的第一特征点集和测试图的第二特征点集,便于后续步骤的对上述特征点进行配对。在具体实施时,第一特征点集的特征点个数与第二特征点集的特征点个数不一定相等,例如,经过对模板图进行特征点检测与提取,得到第一特征点集的特征点的个数为1000,经过对测试图进行特征点检测与提取,得到第二特征点集的特征点的个数可能为1500,在后续步骤的对上述特征点进行配对时,主要就是针对第一特征点集的1000个特征点和第二特征点集的1500个特征点进行检索配对。
配对模块103,用于计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;
在上述配对模块103中,通过对提取模块102提取到的第一特征点集和第二特征点集中的特征点进行检索匹配,也就是说,通过计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值,查找到模板图和测试图中一一对应的特征点,并组成第一特征点集和第二特征点集的特征点对。
匹配模块104,用于根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。
在步骤S103检索配对得到多组特征点对之后,根据所述特征点对中的第一特征点和第二特征点,计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的目标印制电路板的图像。
上述印制电路板图像匹配系统,通过提取模块102分别对获取模块101获取到的目标印制电路板的模板图和测试图进行特征点提取,得到所述模板图的第一特征点集和测试图的第二特征点集;再通过配对模块103计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;最后,利用匹配模块104根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。通过上述技术方案,本发明的印制电路板图像匹配系统,实现了对目标印制电路板图像的快速匹配,有效地提高了印制电路板图像匹配系统的准确性。
在具体实施时,若测试图中包含多个目标印制电路板图像,所述匹配模块104还可以用于:
根据所述特征点对计算其中一个目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的所述其中一个目标印制电路板图像。
在所述匹配模块104之后,还可以包括:
屏蔽模块105,用于将所述特征点对进行屏蔽,对多个目标印制电路板图像中的其他印制电路板图像进行匹配。
在上述实施例中,测试图中包含了多张印制电路板的图像,在完成了一张印制电路板 的图像匹配之后,为了避免对其他印制电路板图像的匹配,需要清除之前对目标印制电路板图像进行匹配时涉及到的特征点。举例来说,由上一轮匹配所计算得到的转换矩阵,可在测试图中查找到与模板图中的印制电路板图像相对应的印制电路板图像区域,即,由模板图中的印制电路板图像,经过转换矩阵映射得到的测试图中的印制电路板图像区域,屏蔽掉该区域中的特征点,在进行其他印制电路板图像匹配时,只用考虑剩余的特征点即可,不仅避免了受上一轮的影响,也提高了对其他印制电路板图像进行匹配的效率。本实施例的技术方案,实现了对多张印制电路板图像的快速匹配,提高了印制电路板图像匹配方法的工作效率。
在其中一个实施例中,本发明的印制电路板图像匹配系统,所述提取模块102,还可以用于:
利用KAZE算子构造单个Octave层的非线性尺度空间,并利用所述非线性尺度空间对所述模板图和测试图进行特征点提取。
在实际应用时,本实施例的印制电路板图像匹配系统的提取模块102利用KAZE算子通过非线性扩散滤波来构造稳定的单个Octave层的非线性尺度空间,并利用所述非线性尺度空间对所述模板图和测试图进行特征点提取,在保持精度相对不变的前提下,大大提升了计算效率;而且,利用KAZE算子构造单个Octave层的非线性尺度空间,还可以对经过旋转变化的印制电路板图像的特征点进行提取,便于进行后续步骤的图像匹配,降低了印制电路板图像匹配系统的硬件成本。
本实施例所述的非线性扩散滤波方法,是将目标印制电路板的模板图和测试图的图像亮度L在不同尺度上的变化视为某种形式的流动函数的散度:
Figure PCTCN2016113120-appb-000004
式中,L表示所述目标印制电路板的模板图或者测试图的图像亮度,t表示尺度参数,c(x,y,t)表示传导函数。
在具体实施时,为了有限保留宽度较大的区域,可以选择如下式所示的传导函数c(x,y,t):
Figure PCTCN2016113120-appb-000005
式中,c(x,y,t)表示传导函数,t表示尺度参数,
Figure PCTCN2016113120-appb-000006
表示高斯平滑后的图像Lσ的梯度,k表示控制扩散程度的常数。
在具体实施时,提取的特征点以特征向量进行表示,为后续步骤的对特征点进行配对做准备。
在其中一个实施例中,本发明所述的印制电路板图像匹配系统,所述检索模块103,还可以用于:
利用多探头索引函数对第一特征点集的第一特征点和第二特征点集的第二特征点进行索引检索,并计算所述第一特征点和第二特征点之间的度量距离;
根据所述度量距离确定所述第一特征点和第二特征点之间的相似度值。
在本实施例中,由于得到的第一特征点集和第二特征点集中的特征点数量较多,可以将第一特征点集和第二特征点集中的特征点采用诸如KAZE算子得到的64维特征的高维向量来进行表示;再利用多探头LSH索引函数对第一特征点集的第一特征点和第二特征点集的第二特征点进行索引检索,并最终得到特征点对。通过上述技术方案,有效地提高了检索配对的效率和配对精度,进一步提高了印制电路板图像匹配系统的工作效率。
如图4所示,图4为本发明的另一个实施例的印制电路板图像匹配系统的结构示意图,在所述计算模块103之后,还可以包括:
计算模块106,用于计算所述特征点对中的第一特征点和第二特征点之间的最佳匹配距离和次佳匹配距离;
判断模块107,用于通过比较所述最佳匹配距离与次佳匹配距离的差距与预设阈值的大小关系,判断所述特征点对的可靠性,根据可靠性对特征点对进行过滤。
在上述实施例中,为了进一步提高本发明的印制电路板图像匹配系统的准确率,在利用多探头LSH索引对第一特征点集和第二特征点集中的特征点进行检索配对,得到特征点对之后,可以采取一定的措施来对得到的特征点对的可靠性进行甄别。在本实施中,通过比较所述特征点对中的第一特征点和第二特征点的最佳匹配距离与次佳匹配距离的差距与预设阈值的大小关系,判断所述特征点对的可靠性,根据可靠性对特征点对进行过滤,有效地提高了印制电路板图像匹配方法的准确性,进一步提高了本发明的印制电路板图像匹配方法的效率。
在其中一个实施例中,本发明的印制电路板图像匹配系统,所述判断模块107,还可 以用于:
若所述最佳匹配距离与次佳匹配距离的差距大于预设阈值,则判定所述特征点对可靠;否则,判定所述特征点对不可靠,并对所述特征点对进行过滤。
在上述实施例中,通过将最佳匹配距离与次佳匹配距离的差距大于预设阈值的特征点对进行保留,将最佳匹配距离与次佳匹配距离的差距不大于预设阈值的特征点对进行剔除,提高了本发明的印制电路板图像匹配系统的准确性,进一步也提高了本发明的印制电路板图像匹配系统的工作效率。
在其中一个实施例中,本发明的印制电路板图像匹配系统,在所述匹配模块104之后,还包括可以:
矫正模块108,用于根据所述模板图中的目标印制电路板图像对测试图中的印制电路板图像进行矫正。
在实际应用中,可以根据模板图中的目标印制电路板图像对测试图中的印制电路板图像进行包括但不限于的几何矫正、角度矫正等图像矫正方法。
在其中一个实施例中,本发明的印制电路板图像匹配系统,所述匹配模块104还可以用于:
利用随机样本集算法计算多组特征点对中的第一特征点到第二特征点的转换矩阵;
选择误差最小的一组特征点对所计算得到的转换矩阵作为所述模板图到测试图的转换矩阵;其中,所述转换矩阵表示模板图中的目标印制电路板图像到与模板图中的目标印制电路板图像对应的测试图中的印制电路板图像的映射关系。
在本实施例中,可以利用随机样本集算法计算多组特征点对中的第一特征点到第二特征点的转换矩阵,为了准确地描述目标印制电路板的模板图到测试图的映射关系,选择误差最小的一组特征点对计算得到的转换矩阵作为目标印制电路板的模板图到测试图的转换矩阵。
在实际应用时,第一特征点和第二特征点可以以坐标或者向量的形式进行表示,这也有利于根据第一特征点和第二特征点,计算得到第一特征点到第二特征点的转换矩阵。
在具体实施时,如果测试图中没有目标印制电路板的图像,而模板图中只有一张该目标印制电路板的图像时,也有可能计算得到这样的转换矩阵,从而形成错误的配对。因此,为了进一步提高本发明的印制电路板图像匹配方法的准确率,可以对测试图中的目标印制 电路板的形态先验进行过滤。
在其中一个实施例中,本发明的印制电路板图像匹配系统,在所述匹配模块104之后,还可以包括:
形态先验模块109,用于通过比较测试图和模板图中的目标印制电路板图像的形态特征,对测试图中与模板图中的目标印制电路板图像的形态特征不一致的目标印制电路板图像进行过滤。
由于印制电路板的图像区域一般为凸多边形,因此可假设模板图中的目标印制电路板的图像区域经过映射后,也应该是一个凸多边形;而且,经过测试图中的经过映射后的目标印制电路板的图像区域的面积,也应与模板图中的目标印制电路板的图像区域大致相当。因此,在实际应用中,本发明的印制电路板图像匹配系统,可以利用形态先验模块109通过判断测试图中的经过映射后的目标印制电路板的图像区域是否仍为凸多边形且其面积与模板图中的目标印制电路板的图像区域大致相当,来断定本次匹配是否成功。如果匹配成功,则输出本次匹配出来的经过几何矫正的印制电路板图像,否则结束本次匹配过程。
上述印制电路板图像匹配方法和系统,通过分别对获取的目标印制电路板的模板图和测试图进行特征点提取,得到所述模板图的第一特征点集和测试图的第二特征点集;再计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。通过上述技术方案,本发明的印制电路板图像匹配方法,实现了对印制电路板图像的快速匹配,有效地提高了印制电路板图像匹配方法的准确性。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (10)

  1. 一种印制电路板图像匹配方法,其特征在于,包括如下步骤:
    获取目标印制电路板的模板图和测试图;其中,所述模板图为所述目标印制电路板的经过角度矫正的图像,所述测试图为所述目标印制电路板的未经角度矫正的图像;
    分别对所述模板图和测试图进行特征点提取,获取所述模板图的第一特征点集和测试图的第二特征点集;
    计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;
    根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。
  2. 根据权利要求1所述的印制电路板图像匹配方法,其特征在于,所述分别对所述模板图和测试图进行特征点提取的步骤包括:
    利用KAZE算子构造单个Octave层的非线性尺度空间,并利用所述非线性尺度空间对所述模板图和测试图进行特征点提取。
  3. 根据权利要求1所述的印制电路板图像匹配方法,其特征在于,所述计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值的步骤包括:
    利用多探头索引函数对第一特征点集的第一特征点和第二特征点集的第二特征点进行索引检索,并计算所述第一特征点和第二特征点之间的度量距离;
    根据所述度量距离确定所述第一特征点和第二特征点之间的相似度值。
  4. 根据权利要求1所述的印制电路板图像匹配方法,其特征在于,在所述得到所述第一特征点集和第二特征点集的特征点对的步骤之后,还包括:
    计算所述特征点对中的第一特征点和第二特征点之间的最佳匹配距离和次佳匹配距离;
    通过比较所述最佳匹配距离与次佳匹配距离的差距与预设阈值的大小关系,判断所述特征点对的可靠性,根据可靠性对特征点对进行过滤。
  5. 根据权利要求4所述的印制电路板图像匹配方法,其特征在于,所述通过比较所述最佳匹配距离与次佳匹配距离的差距与预设阈值的大小关系,判断所述特征点对的可靠性,根据可靠性对特征点对进行过滤的步骤包括:
    若所述最佳匹配距离与次佳匹配距离的差距大于预设阈值,则判定所述特征点对可靠;否则,判定所述特征点对不可靠,并对所述特征点对进行过滤。
  6. 根据权利要求1所述的印制电路板图像匹配方法,其特征在于,所述计算所述多组特征点对中的第一特征点到第二特征点的转换矩阵的步骤包括:
    利用随机样本集算法计算多组特征点对中的第一特征点到第二特征点的转换矩阵;
    在所述利用随机样本集算法计算多组特征点对中的第一特征点到第二特征点的转换矩阵的步骤之后,还包括:
    选择误差最小的一组特征点对所计算得到的转换矩阵作为所述模板图到测试图的转换矩阵;其中,所述转换矩阵表示模板图中的目标印制电路板图像到与模板图中的目标印制电路板图像对应的测试图中的印制电路板图像的映射关系。
  7. 根据权利要求1所述的印制电路板图像匹配方法,其特征在于,在所述利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板的图像的步骤之后,还包括:
    根据所述模板图中的印制电路板图像对测试图中的印制电路板图像进行矫正。
  8. 根据权利要求1所述的印制电路板图像匹配方法,其特征在于,所述获取目标印制电路板的模板图和测试图的步骤包括:
    获取多个目标印制电路板的模板图和测试图;其中,所述模板图为所述多个目标印制电路板的经过角度矫正的图像,所述测试图为所述多个目标印制电路板的未经角度矫正的图像;
    所述根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像的步骤包括:
    根据所述特征点对计算其中一个目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的所述其中一个目标印制电路板图像;
    在所述利用所述转换矩阵查找测试图中与模板图相匹配的所述其中一个目标印制电路板图像的步骤之后,还包括:
    将所述特征点对进行屏蔽,对多个目标印制电路板图像中的其他印制电路板图像进行匹配。
  9. 根据权利要求1所述的印制电路板图像匹配方法,其特征在于,在所述利用所述转换矩阵查找测试图中与模板图相匹配的目标印制电路板图像的步骤之后,还包括:
    通过比较测试图和模板图中的目标印制电路板图像的形态特征,对测试图中与模板图中的目标印制电路板图像的形态特征不一致的目标印制电路板图像进行过滤。
  10. 一种印制电路板图像匹配系统,其特征在于,包括:
    获取模块,用于获取目标印制电路板的模板图和测试图;其中,所述模板图为所述目标印制电路板的经过角度矫正的图像,所述测试图为所述目标印制电路板的未经角度矫正的图像;
    提取模块,用于分别对所述模板图和测试图进行特征点提取,获取所述模板图的第一特征点集和测试图的第二特征点集;
    配对模块,用于计算第一特征点集的第一特征点和第二特征点集的第二特征点之间的相似度值,根据所述相似度值对所述第一特征点和第二特征点进行配对,得到特征点对;
    匹配模块,用于根据所述特征点对计算所述目标印制电路板的模板图到测试图的转换矩阵,并利用所述转换矩阵查找测试图中与模板图相匹配的印制电路板图像。
PCT/CN2016/113120 2016-05-13 2016-12-29 印制电路板图像匹配方法和系统 Ceased WO2017193596A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610322428.7A CN106023182A (zh) 2016-05-13 2016-05-13 印制电路板图像匹配方法和系统
CN201610322428.7 2016-05-13

Publications (1)

Publication Number Publication Date
WO2017193596A1 true WO2017193596A1 (zh) 2017-11-16

Family

ID=57098090

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113120 Ceased WO2017193596A1 (zh) 2016-05-13 2016-12-29 印制电路板图像匹配方法和系统

Country Status (2)

Country Link
CN (1) CN106023182A (zh)
WO (1) WO2017193596A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188815A (zh) * 2019-05-24 2019-08-30 广州市百果园信息技术有限公司 一种特征点采样方法、装置、设备及存储介质
CN111340701A (zh) * 2020-02-24 2020-06-26 南京航空航天大学 一种基于聚类法筛选匹配点的电路板图像拼接方法
CN111951211A (zh) * 2019-05-17 2020-11-17 株式会社理光 一种目标检测方法、装置及计算机可读存储介质
CN112559342A (zh) * 2020-12-09 2021-03-26 上海米哈游天命科技有限公司 一种画面测试图像的获取方法、装置、设备及存储介质
CN114018935A (zh) * 2021-11-05 2022-02-08 苏州中锐图智能科技有限公司 一种多点快速标定方法
CN114926659A (zh) * 2022-05-16 2022-08-19 上海贝特威自动化科技有限公司 一种基于sift和cm的变形目标定位算法
CN116523852A (zh) * 2023-04-13 2023-08-01 成都飞机工业(集团)有限责任公司 一种基于特征匹配的碳纤维复合材料的异物检测方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106023182A (zh) * 2016-05-13 2016-10-12 广州视源电子科技股份有限公司 印制电路板图像匹配方法和系统
EP3582599B1 (en) * 2017-02-13 2022-03-30 Koh Young Technology Inc. Apparatus for inspecting components mounted on printed circuit board, operating method thereof, and computer-readable recording medium
CN108364024B (zh) * 2018-02-11 2021-05-07 金蝶软件(中国)有限公司 图像匹配方法、装置、计算机设备和存储介质
CN110070491A (zh) * 2019-03-16 2019-07-30 平安城市建设科技(深圳)有限公司 银行卡图片矫正方法、装置、设备及存储介质
CN116030504A (zh) * 2023-02-15 2023-04-28 石家庄淼海信息技术有限公司 一种指纹识别系统及其识别方法
CN117131221A (zh) * 2023-07-25 2023-11-28 声瞳科技(广州)有限公司 基于cnn的pcb板图像相似度的快速检索方法
CN117893502B (zh) * 2024-01-15 2025-02-25 广州市科帕电子科技有限公司 图像检测方法、装置、设备及存储介质
CN118351059A (zh) * 2024-03-21 2024-07-16 中科可控信息产业有限公司 电路板检测方法、装置、计算机设备和存储介质
CN119537633B (zh) * 2024-11-15 2026-01-20 华中师范大学 一种电路板的客户信息识别方法和系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120141010A1 (en) * 2010-12-01 2012-06-07 Hon Hai Precision Industry Co., Ltd. Image analysis device and method
CN102567724A (zh) * 2010-12-11 2012-07-11 鸿富锦精密工业(深圳)有限公司 图像校正系统及方法
CN102663756A (zh) * 2012-04-20 2012-09-12 华南理工大学 印刷电路板中异型元件和高密度封装元器件的配准方法
CN105243663A (zh) * 2015-09-29 2016-01-13 深圳大学 一种pcb扫描图像的自动匹配方法及系统
CN106023182A (zh) * 2016-05-13 2016-10-12 广州视源电子科技股份有限公司 印制电路板图像匹配方法和系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4196302B2 (ja) * 2006-06-19 2008-12-17 ソニー株式会社 情報処理装置および方法、並びにプログラム
JP5202037B2 (ja) * 2008-02-29 2013-06-05 キヤノン株式会社 特徴点位置決定方法及び装置
CN102938077A (zh) * 2012-10-25 2013-02-20 渭南师范学院 基于双阈值二值化的在线式aoi图像检索方法
CN103854278A (zh) * 2012-12-06 2014-06-11 五邑大学 基于连通区域质心形状上下文的印刷电路板图像配准方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120141010A1 (en) * 2010-12-01 2012-06-07 Hon Hai Precision Industry Co., Ltd. Image analysis device and method
CN102567724A (zh) * 2010-12-11 2012-07-11 鸿富锦精密工业(深圳)有限公司 图像校正系统及方法
CN102663756A (zh) * 2012-04-20 2012-09-12 华南理工大学 印刷电路板中异型元件和高密度封装元器件的配准方法
CN105243663A (zh) * 2015-09-29 2016-01-13 深圳大学 一种pcb扫描图像的自动匹配方法及系统
CN106023182A (zh) * 2016-05-13 2016-10-12 广州视源电子科技股份有限公司 印制电路板图像匹配方法和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, PENG ET AL.: "Multi-source remote sensing images matching based on nonlinear scale space", SCIENCE OF SURVEYING AND MAPPING, vol. 40, no. 7, 31 July 2015 (2015-07-31), pages 41 - 42, ISSN: 1009-2307 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111951211A (zh) * 2019-05-17 2020-11-17 株式会社理光 一种目标检测方法、装置及计算机可读存储介质
CN111951211B (zh) * 2019-05-17 2024-05-14 株式会社理光 一种目标检测方法、装置及计算机可读存储介质
CN110188815A (zh) * 2019-05-24 2019-08-30 广州市百果园信息技术有限公司 一种特征点采样方法、装置、设备及存储介质
CN111340701A (zh) * 2020-02-24 2020-06-26 南京航空航天大学 一种基于聚类法筛选匹配点的电路板图像拼接方法
CN111340701B (zh) * 2020-02-24 2022-06-28 南京航空航天大学 一种基于聚类法筛选匹配点的电路板图像拼接方法
CN112559342A (zh) * 2020-12-09 2021-03-26 上海米哈游天命科技有限公司 一种画面测试图像的获取方法、装置、设备及存储介质
CN114018935A (zh) * 2021-11-05 2022-02-08 苏州中锐图智能科技有限公司 一种多点快速标定方法
CN114926659A (zh) * 2022-05-16 2022-08-19 上海贝特威自动化科技有限公司 一种基于sift和cm的变形目标定位算法
CN114926659B (zh) * 2022-05-16 2023-08-08 上海贝特威自动化科技有限公司 一种基于sift和cm的变形目标定位算法
CN116523852A (zh) * 2023-04-13 2023-08-01 成都飞机工业(集团)有限责任公司 一种基于特征匹配的碳纤维复合材料的异物检测方法

Also Published As

Publication number Publication date
CN106023182A (zh) 2016-10-12

Similar Documents

Publication Publication Date Title
WO2017193596A1 (zh) 印制电路板图像匹配方法和系统
US11854173B2 (en) System and method for finding lines in an image with a vision system
CN112115893B (zh) 仪表盘指针读数识别方法、装置、计算机设备及存储介质
KR102649038B1 (ko) 비전 시스템으로 이미지에서 라인을 찾기 위한 시스템 및 방법
CN117173437B (zh) 多模态遥感影像混合匹配方法和系统
WO2022151658A1 (zh) 一种缺陷检测方法、装置、计算机设备及计算机可读存储介质
CN109784250B (zh) 自动引导小车的定位方法和装置
CN115131413B (zh) 基于多尺度三维频域卷积特征的多模遥感图像配准方法
CN111797744A (zh) 一种基于共现滤波算法的多模态遥感图像匹配方法
JP2018142189A (ja) プログラム、測距方法、及び測距装置
CN111340134B (zh) 一种基于局部动态规整的快速模板匹配方法
CN107862319B (zh) 一种基于邻域投票的异源高分光学影像匹配误差剔除方法
Shi et al. Robust image registration using structure features
WO2022110492A1 (zh) 指静脉身份识别方法、装置、计算机设备和存储介质
CN118674760B (zh) 基于iss特征点的点云配准方法及系统
CN119360051B (zh) 基于零样本深度学习的要素提取以及地图生成方法、装置
Li et al. Unmanned aerial vehicle image matching based on improved RANSAC algorithm and SURF algorithm
Sidor et al. The impact of the implementation of edge detection methods on the accuracy of automatic voltage reading
CN119228643B (zh) 无人机遥感影像的自动拼图方法及装置
CN115861428B (zh) 一种位姿测量方法、装置、终端设备及存储介质
CN113066130A (zh) 航空摄影影像中心位置解算方法、装置、电子设备和可读存储介质
CN112907662A (zh) 特征提取方法、装置、电子设备及存储介质
Wu et al. Research on SAR image matching based on SAR-Harris detector and adaptive locally-affine matching
CN114677285B (zh) 一种光轴偏差测量方法、智能终端及计算机可读存储介质
CN117115275B (zh) 畸变参数的确定方法、装置和计算机设备

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16901551

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16901551

Country of ref document: EP

Kind code of ref document: A1