Image template matching method, monitoring system, device, and storage medium

By using feature matching model and random sampling consistency algorithm in PCB detection, efficient pairing and difference calculation of feature points are achieved, the problem of excessive calculation load is solved, and the detection efficiency and speed are improved.

CN119888279BActive Publication Date: 2025-08-29HANGZHOU XINJUNZHE MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411919523.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-08-29
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

The existing image template matching method is too heavy to calculate the load in PCB detection and cannot meet the real-time requirements of large-scale production. Especially in complex situations, the calculation volume is large and the speed is slow, so it is impossible to quickly detect a large number of images.

Method used

The first and second feature matching models are used to extract feature points respectively, and the stochastic sampling consistency algorithm is used to obtain the homogeneous matrix H, which matches feature points that meet the geometric constraints of the opposing pole, calculate the degree of difference in combination with the Euclidean distance value, and determine the defect location.

Benefits of technology

It reduces the calculation load, improves the analysis efficiency, shortens the processing time, and meets the real-time needs of large-scale production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888279B_ABST
    Figure CN119888279B_ABST
Patent Text Reader

Abstract

The present invention discloses an image template matching method and a monitoring system, device, and storage medium, including: acquiring a captured image and a template image; extracting each feature point of the captured image respectively through at least a first feature matching model and a second feature matching model; normalizing the feature point data and merging them into a captured feature data collection; pairing each feature point in the captured feature data collection with each feature point in the template feature data collection according to a homography matrix H to obtain a plurality of matching point groups, wherein the matching point groups include feature points in the captured feature data collection and feature points in the template feature data collection that meet epipolar geometry constraints; calculating the degree of difference between the feature points in the captured feature data collection and the feature points in the template feature data collection in each matching point group; and deriving the defect position based on the degree of difference information. The present design reduces the computing load, improves the analysis efficiency, and shortens the processing time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer image analysis, and in particular to an image template matching method and a monitoring system, device, and storage medium. Background Art

[0002] With the development of the electronics industry, the complexity and density of electronic circuits carried by PCBs continue to increase. Before PCBs leave the factory, the quality of the electronic circuits on them needs to be tested. However, traditional manual inspection methods can no longer meet the needs of modern production lines.

[0003] Automated optical inspection (AOI), as an efficient and accurate inspection method, can be introduced into the PCB quality inspection process and has been widely used in the PCB manufacturing industry. AOI captures images of the PCB and analyzes them against template images to identify defective areas on the sampled image surface, thereby alerting quality inspectors to inspect the PCB. Existing methods for analyzing captured and template images use feature extraction models to extract feature points from the captured image, then correlate these with feature points in the template image and perform a comparison.

[0004] However, with the increasing complexity of PCB design and the continuous increase in production speed, the PCB surface has numerous details, resulting in flaws in the extraction of feature points. In addition, due to the need for operations such as PCB rotation and translation, the matching processing load of feature points is heavy, which cannot meet the needs of large-scale PCB production, which requires rapid detection of a large number of images. Especially when dealing with complex situations, problems such as large amount of calculation and slow speed are prominent, which cannot meet the real-time requirements of large-scale production. Summary of the Invention

[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides an image template matching method and monitoring system, device, and storage medium to reduce computing load, improve analysis efficiency, and shorten processing time.

[0006] According to an embodiment of the first aspect of the present invention, an image template matching method includes: acquiring a captured image and a template image; extracting each feature point of the captured image respectively by at least a first feature matching model and a second feature matching model to obtain a first captured feature data set and a second captured feature data set; normalizing the feature point data in the first captured feature data set and the feature point data in the second captured feature data set and merging them into a captured feature data set; obtaining a homography matrix H by using a random sampling consistency algorithm, and pairing each feature point in the captured feature data set with each feature point in the template feature data set according to the homography matrix H to obtain a plurality of matching point groups, wherein the matching point groups include points that satisfy epipolar geometry constraints. The feature points in the collection feature data collection and the feature points in the template feature data collection, wherein the feature points in the template feature data collection include the feature point data in the first template feature data set and the feature point data in the second template feature data set that are merged after normalization processing, the first template feature data set is obtained by extracting each feature point of the template image by the first feature matching model, and the second template feature data set is obtained by extracting each feature point of the template image by the second feature matching model; the difference degree of the feature points in the collection feature data collection and the feature points in the template feature data collection in each matching point group are calculated to obtain the difference degree information; the defect position is obtained according to the difference degree information, and the defect position is output.

[0007] An image template matching method according to an embodiment of the present invention has at least the following beneficial effects:

[0008] The image template matching method of the present invention, when acquiring a captured image, extracts each feature point of the captured image respectively through at least a first feature matching model and a second feature matching model, and then normalizes the extracted feature point data and merges them into a captured feature data set, and uniformly pairs the feature points in the captured feature data set with the feature points in the template feature data set through a homography matrix H to form a matching point group. At this time, the degree of difference between the feature points from the captured feature data set and the feature points from the template feature data set in the matching point group is calculated. If the difference is large, there is a defect, and the defect location is known. This design first narrows the matching range of the feature points through a random sampling consistency algorithm, so that the feature points that are paired with each other in the matching point group need to meet the epipolar geometry constraint conditions, and then the degree of difference is calculated, which reduces the computing load, improves the analysis efficiency, and shortens the processing time.

[0009] According to some embodiments of the present invention, the step of calculating the degree of difference between the feature points in the collected feature data collection and the feature points in the template feature data collection in each matching point group to obtain the degree of difference information includes: calculating the Euclidean distance values ​​of the feature points in each group of mutually matching collected feature data collection and the feature points in the template feature data collection; forming the degree of difference information based on the Euclidean distance values; and when the Euclidean distance value is greater than a distance threshold, obtaining the defect position based on the matching point group.

[0010] According to some embodiments of the present invention, the feature point data of the first acquisition feature data set and the second acquisition feature data set include each feature point and a descriptor corresponding to the feature point, wherein the descriptor includes a coordinate vector value of the feature point; normalizing the feature point data in the first acquisition feature data set and the feature point data in the second acquisition feature data set and merging them into an acquisition feature data collection includes: normalizing the coordinate vector values ​​of the descriptors in the first acquisition feature data set and the second acquisition feature data set to the same numerical specifications; merging each feature point of the first acquisition feature data set and the second acquisition feature data set to form a feature point list; and merging each coordinate vector value of the normalized first acquisition feature data set and the second acquisition feature data set to form a descriptor matrix.

[0011] According to some embodiments of the present invention, the step of pairing each feature point in the collection feature data set and each feature point in the template feature data set according to the homography matrix H to obtain a plurality of matching point groups includes a pairing step for each feature point in the collection feature data set, wherein the pairing step includes: searching for a feature point P2 in the template feature data set for a feature point P1 in the collection feature data set according to the homography matrix H, the homogeneous coordinates of the feature point P1 are [x1, y1, 1], the homogeneous coordinates of the feature point P2 are [x2, y2, 1], and the paired feature points P1 in the collection feature data set and P2 in the template feature data set meet in, is the transposed matrix of the homogeneous coordinates of the feature point P2, and K is the epipolar geometry constraint threshold.

[0012] The feature point P2 in the template feature data collection is searched for the feature point P1 in the collected feature data collection according to the homography matrix H, including:

[0013] Filter each feature point P2 in the template feature data collection;

[0014] when Then the feature point P2 is screened out;

[0015] when The feature point P2 and the feature point P1 form a matching point group.

[0016] According to some embodiments of the present invention, obtaining the acquisition image and the template image includes: constructing a world coordinate system based on the relationship between the line scan camera and the mobile platform for placing the object to be scanned; and converting the coordinates of the acquisition image and the coordinates of the template image into the world coordinate system.

[0017] According to some embodiments of the present invention, the initial transformation matrix of the world coordinate system is:

[0018]

[0019] Where W is the initial transformation matrix of the world coordinate system; R0 is the initial rotation matrix of the line scan camera relative to the object to be scanned; D0 is the initial displacement matrix of the line scan camera relative to the object to be scanned;

[0020] When the mobile platform translates Δt at a speed v, the transformation matrix of the world coordinate system is:

[0021]

[0022] According to the second aspect of the present invention, the monitoring system includes: a mobile platform for carrying an object to be scanned; a line scan camera for scanning the object to be scanned and capturing an image; a storage module for storing a template image; a control module connected to the line scan camera and the storage module, respectively, the control module executing the image template matching method disclosed in any of the above embodiments to obtain the defect position of the captured image; and an output module, the control module being connected to the output module to output the defect position of the captured image.

[0023] The monitoring system according to the embodiment of the present invention has at least the following beneficial effects:

[0024] The monitoring system of the present invention applies the image template matching method disclosed in any of the above embodiments to obtain the defect position of the collected image, thereby reducing the computing load, improving the analysis efficiency, and shortening the processing time.

[0025] According to the control device of the embodiment of the third aspect of the present invention, the control device includes a memory and a processor, the memory stores a computer program, and the processor implements the image template matching method disclosed in any of the above embodiments when executing the computer program.

[0026] According to the computer-readable storage medium of the fourth embodiment of the present invention, the computer-readable storage medium stores a computer program, and is characterized in that when the computer program is executed by a processor, it implements the image template matching method disclosed in any of the above embodiments.

[0027] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:

[0029] Figure 1 This is a first flow chart of one embodiment of the image template matching method of the present invention;

[0030] Figure 2 A second flow chart of one embodiment of the image template matching method of the present invention;

[0031] Figure 3 This is a principle structural block diagram of one embodiment of the monitoring system of the present invention;

[0032] Figure 4 This is a schematic diagram of the structure of a line scan camera and a mobile platform of one embodiment of the monitoring system of the present invention;

[0033] Figure 5 This is a principle structural block diagram of one embodiment of the control device of the present invention.

[0034] Reference numerals:

[0035] Mobile platform 310 ; line scan camera 320 ; storage module 330 ; control module 400 ; output module 500 ; processor 610 ; memory 620 ; input / output interface 630 ; communication interface 640 ; bus 650 . DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0037] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0039] like Figure 1 As shown, an image template matching method according to an embodiment of the first aspect of the present invention includes:

[0040] S110, acquiring a captured image and a template image;

[0041] S120, extracting each feature point of the acquired image using at least a first feature matching model and a second feature matching model to obtain a first acquired feature data set and a second acquired feature data set;

[0042] S130, normalizing the feature point data in the first collected feature data set and the feature point data in the second collected feature data set and merging them into a collected feature data set;

[0043] S140. Determine a homography matrix H using a random sampling consistency algorithm. Pair each feature point in the collected feature data collection with each feature point in the template feature data collection according to the homography matrix H to obtain a plurality of matching point groups, wherein the matching point groups include feature points in the collected feature data collection and feature points in the template feature data collection that satisfy epipolar geometry constraints, wherein the feature points in the template feature data collection include feature point data in a first template feature data set and feature point data in a second template feature data set that are normalized and merged, the first template feature data set being obtained by extracting each feature point of the template image using a first feature matching model, and the second template feature data set being obtained by extracting each feature point of the template image using a second feature matching model;

[0044] S150, respectively calculating the degree of difference between the feature points in the collected feature data set and the feature points in the template feature data set in each matching point group to obtain degree of difference information;

[0045] S160: Determine the defect location based on the difference degree information and output the defect location.

[0046] Among them, this design can be applied to PCB inspection. The surface image of the PCB is collected by a line scan camera. It can be understood that the template image is a standard PCB sample image, which is stored in the storage module. The control module analyzes the defect location of the PCB cost by comparing the collected image with the template image.

[0047] The image template matching method of the present invention, when acquiring a captured image, extracts each feature point of the captured image respectively through at least a first feature matching model and a second feature matching model, and then normalizes the extracted feature point data and merges them into a captured feature data set, and uniformly pairs the feature points in the captured feature data set with the feature points in the template feature data set through a homography matrix H to form a matching point group. At this time, the degree of difference between the feature points from the captured feature data set and the feature points from the template feature data set in the matching point group is calculated. If the difference is large, there is a defect, and the defect location is known. This design first narrows the matching range of the feature points through a random sampling consistency algorithm, so that the feature points that are paired with each other in the matching point group need to meet the epipolar geometry constraint conditions, and then the degree of difference is calculated, which reduces the computing load, improves the analysis efficiency, and shortens the processing time.

[0048] Since it is necessary to compare the feature points of the acquired image and the template image, and the object to be scanned may move or rotate during the sampling image shooting process, it is necessary to unify the acquired image and the template image to the same coordinates before processing. In some embodiments of the present invention, obtaining the acquired image and the template image includes:

[0049] Constructing a world coordinate system based on the relationship between the line scan camera and the mobile platform used to place the object to be scanned;

[0050] The coordinates of the captured image and the template image are transformed into the world coordinate system.

[0051] Specifically, if Figure 3 、 4 As shown, a line scan camera is used to scan a mobile platform on which an object to be scanned is placed. The coordinates of the camera A can be set to (x c ,y c , z c ); the line scan sensor coordinates are (r, c); the imaging plane coordinates are (u, v); the world coordinates are (x w ,y w , z w ).

[0052] Therefore, according to Figure 4 The relationship in [1] is combined with the coordinates of camera A, the scanning sensor coordinates, and the imaging plane coordinates to establish the initial rotation matrix R0 of the line scan camera relative to the scanned object and the initial displacement matrix D0 of the line scan camera relative to the scanned object.

[0053] In some embodiments of the present invention, the initial transformation matrix of the world coordinate system is:

[0054]

[0055] Where W is the initial transformation matrix of the world coordinate system; R0 is the initial rotation matrix of the line scan camera relative to the object to be scanned; D0 is the initial displacement matrix of the line scan camera relative to the object to be scanned;

[0056] When the mobile platform translates Δt at a speed v, the transformation matrix of the world coordinate system is:

[0057]

[0058] The rotation of the mobile platform increases the rotation amount in R0, which is not described in detail here. The subsequent coordinate calculations of the captured image and the template image are all based on the world coordinate system.

[0059] In some embodiments of the present invention, Figure 2 As shown, the step of calculating the difference between the feature points in the collected feature data set and the feature points in the template feature data set in each matching point group to obtain the difference information includes:

[0060] S210, calculating the Euclidean distance between the feature points in each set of mutually matched collected feature data and the feature points in the template feature data;

[0061] S220, forming difference degree information according to the Euclidean distance value;

[0062] S230: When the Euclidean distance value is greater than the distance threshold, the defect position is obtained based on the matching point group.

[0063] The Euclidean distance value is calculated for the coordinates of the feature points in the collection of feature data collected within the matching point group and the coordinates of the feature points in the collection of template feature data. The distance threshold here can be set by the staff. The smaller the Euclidean distance value, the more similar the feature points of the collected image and the feature points of the template image are. When the Euclidean distance value is large, or even exceeds the distance threshold, it proves that the feature points of the collected image may have defects and are not similar to the feature points of the template image.

[0064] In some embodiments of the present invention, the first feature matching model may be a SURF feature matching model. The SURF feature matching model is a feature detection based on the determinant of the Hessian matrix. It uses a square filter response that approximates the second order and derivative of the Hessian matrix to find feature points. The SURF feature matching model tends to find points and spot features with strong responses under the Hessian matrix framework. The second feature matching model may be an ORB feature matching model. The ORB feature matching model is based on the FA8T corner detector. The FA8T is run on a multi-scale pyramid to find feature points with corner characteristics, such as corner structures with strong brightness contrast. There may be more feature matching models for feature extraction of captured images. For example, a third feature matching model may be set, such as a SIFT feature matching model.

[0065] In some embodiments of the present invention, the feature point data of the first collected feature data set and the second collected feature data set include each feature point and a descriptor corresponding to the feature point, wherein the descriptor includes a coordinate vector value of the feature point;

[0066] It should be noted that the first feature matching model and the second feature matching model need to perform feature extraction processing on the collected image and the template image. The first feature matching model processes the collected image to detect the feature point K in the image. SURF and descriptor H SURF , the first feature matching model processes the template image and detects the key point M in the image SURF and calculate the descriptor L SURF Similarly, the second feature matching model processes the captured image to detect the feature point K in the image ORB and descriptor H ORB , the first feature matching model processes the template image and detects the key point M in the image ORB and calculate the descriptor L ORB .

[0067] Since different feature matching models form different numerical scales of coordinate vectors, for example, the descriptor H corresponding to the feature points formed by the SURF feature matching model is SURF is a 64-dimensional floating point vector, and the descriptor H corresponding to the feature point formed by the ORB feature matching model ORB It is a 256-bit binary string.

[0068] Therefore, the step of normalizing the feature point data in the first collected feature data set and the feature point data in the second collected feature data set and merging them into a collection of collected feature data includes:

[0069] The coordinate vector values ​​of the descriptors in the first acquisition feature data set and the second acquisition feature data set are normalized to the same numerical specifications; the 256-bit binary string can be normalized and converted into a floating-point vector, for example, if the binary string is 1, it is converted into (1, 0), and if the binary string is 0, it is converted into (0, 0).

[0070] Merging each feature point of the first collected feature data set and the second collected feature data set to form a feature point list. It can be understood that the feature points are marking points and can be placed one by one in the feature point list;

[0071] The coordinate vector values ​​of the normalized first acquired feature data set and the second acquired feature data set are merged to form a descriptor matrix. Specifically, merging can be understood as composing the coordinate vector values ​​one by one into elements of the descriptor matrix.

[0072] In some embodiments of the present invention, pairing each feature point in the collected feature data set with each feature point in the template feature data set according to the homography matrix H to obtain a plurality of matching point groups includes pairing each feature point in the collected feature data set, wherein the pairing step includes:

[0073] According to the homography matrix H, the feature point P1 of the collected feature data set is searched for the feature point P2 in the template feature data set. The homogeneous coordinates of the feature point P1 are [x1, y1, 1], and the homogeneous coordinates of the feature point P2 are [x2, y2, 1]. The paired feature points P1 of the collected feature data set and P2 of the template feature data set meet in, is the transposed matrix of the homogeneous coordinates of the feature point P2, and K is the epipolar geometry constraint threshold.

[0074] Among them, the homography matrix H is obtained using the random sampling consistency algorithm. Based on the epipolar geometry properties, we have when The closer it is to 0, the more the feature points in the matching point group can satisfy the epipolar geometry constraint. Therefore, according to actual needs, the staff can set the epipolar geometry constraint threshold of K, and use the homogeneous coordinates of the feature point P1 and the calculation of the homography matrix H to search for the feature point P2 that satisfies the epipolar geometry constraint threshold.

[0075] Specifically, searching for the feature point P2 in the template feature data set for the feature point P1 in the collected feature data set according to the homography matrix H includes:

[0076] Filter each feature point P2 in the template feature data collection;

[0077] when Then the feature point P2 is screened out;

[0078] when The feature point P2 and the feature point P1 form a matching point group.

[0079] According to an embodiment of the second aspect of the present invention, the monitoring system includes: a mobile platform 310 for carrying an object to be scanned; a line scan camera 320 for scanning the object to be scanned and capturing an acquired image; a storage module 330 for storing a template image; a control module 400, connected to the line scan camera 320 and the storage module 330, respectively, the control module 400 executing the image template matching method disclosed in any of the above embodiments to obtain the defect position of the acquired image; and an output module 500, the control module 400 being connected to the output module 500 to output the defect position of the acquired image.

[0080] The monitoring system of the present invention applies the image template matching method disclosed in any of the above embodiments to obtain the defect position of the collected image, thereby reducing the computing load, improving the analysis efficiency, and shortening the processing time.

[0081] According to the control device of the third embodiment of the present invention, the control device includes a memory 620 and a processor 610. The memory 620 stores a computer program, and the processor 610 implements the image template matching method disclosed in any of the above embodiments when executing the computer program.

[0082] The control device can be any intelligent terminal including a central computer, a remote device terminal computer, etc.

[0083] like Figure 5 As shown, Figure 5 The hardware structure of the control device of another embodiment is also illustrated. The control device includes:

[0084] The processor 610 may be implemented as a general-purpose central processing unit (CPU), a microprocessor (MCU), an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0085] The memory 620 can be implemented in the form of a read-only memory 620 (ROM), a static storage device, a dynamic storage device, or a random access memory 620 (RAM). The memory 620 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 620 and is called by the processor 610 to execute the image template matching method of the embodiments of this application.

[0086] Input / output interface 630, used to implement information input and output;

[0087] Communication interface 640, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0088] bus 650 , which transmits information between various components of the device (e.g., processor 610 , memory 620 , input / output interface 630 , and communication interface 640 );

[0089] The processor 610 , the memory 620 , the input / output interface 630 and the communication interface 640 are connected to each other in communication within the device via a bus 650 .

[0090] According to the computer-readable storage medium of the fourth embodiment of the present invention, the computer-readable storage medium stores a computer program, which is characterized in that when the computer program is executed by the processor 610, it implements the image template matching method disclosed in any of the above embodiments.

[0091] The memory 620 is a non-transient computer-readable storage medium that can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0092] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0093] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0094] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0095] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0096] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0097] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. An image template matching method, characterized in that: include: Obtaining a captured image and a template image; Extracting feature points of the captured image at least by using a first feature matching model and a second feature matching model to obtain a first captured feature data set and a second captured feature data set; Normalizing the feature point data in the first collected feature data set and the feature point data in the second collected feature data set and merging them into a collected feature data set; deriving a homography matrix H using a random sampling consistency algorithm, and pairing each feature point in the collected feature data set with each feature point in the template feature data set according to the homography matrix H to obtain a plurality of matching point groups, wherein the matching point groups include feature points in the collected feature data set and feature points in the template feature data set that satisfy epipolar geometry constraints, wherein the feature points in the template feature data set include the feature point data in the first template feature data set and the feature point data in the second template feature data set that are normalized and merged, the first template feature data set is obtained by extracting each feature point of the template image by a first feature matching model, and the second template feature data set is obtained by extracting each feature point of the template image by a second feature matching model; Calculating the degree of difference between the feature points in the collected feature data set and the feature points in the template feature data set in each matching point group to obtain difference degree information; The defect location is obtained based on the difference degree information and output.

2. The image template matching method according to claim 1, wherein: The step of calculating the difference between the feature points in the collected feature data set and the feature points in the template feature data set in each matching point group to obtain the difference information includes: Calculate the Euclidean distance between the feature points in each set of mutually matched collected feature data and the feature points in the template feature data; Forming difference degree information based on Euclidean distance values; When the Euclidean distance value is greater than the distance threshold, the defect location is obtained based on the matching point group.

3. The image template matching method according to claim 1, wherein: The feature point data of the first collected feature data set and the second collected feature data set include each feature point and a descriptor corresponding to the feature point, wherein the descriptor includes a coordinate vector value of the feature point; The step of normalizing the feature point data in the first collected feature data set and the feature point data in the second collected feature data set and merging them into a collection of collected feature data includes: Normalizing the coordinate vector values ​​of the descriptors in the first acquired feature data set and the second acquired feature data set to the same numerical specifications; Merging each feature point of the first collected feature data set and the second collected feature data set to form a feature point list; The coordinate vector values ​​of the normalized first acquired feature data set and the second acquired feature data set are combined to form a descriptor matrix.

4. The image template matching method according to claim 1, wherein: The step of pairing each feature point in the collected feature data set with each feature point in the template feature data set according to the homography matrix H to obtain a plurality of matching point groups includes pairing each feature point in the collected feature data set, wherein the pairing step includes: According to the homography matrix H, the feature point P1 of the collected feature data set is searched for the feature point P2 in the template feature data set. The homogeneous coordinates of the feature point P1 are [x1, y1, 1], and the homogeneous coordinates of the feature point P2 are [x2, y2, 1]. The paired feature points P1 of the collected feature data set and P2 of the template feature data set meet in, is the transposed matrix of the homogeneous coordinates of the feature point P2, and K is the epipolar geometry constraint threshold.

5. The image template matching method according to claim 4, characterized in that: The feature point P2 in the template feature data collection is searched for the feature point P1 in the collected feature data collection according to the homography matrix H, including: Filter each feature point P2 in the template feature data collection; when Then the feature point P2 is screened out; when The feature point P2 and the feature point P1 form a matching point group.

6. The image template matching method according to claim 1, characterized in that: The acquiring of the acquisition image and the template image includes: Constructing a world coordinate system based on the relationship between the line scan camera and the mobile platform used to place the object to be scanned; The coordinates of the captured image and the template image are transformed into the world coordinate system.

7. The image template matching method according to claim 6, characterized in that: The initial transformation matrix of the world coordinate system is: Where W is the initial transformation matrix of the world coordinate system; R0 is the initial rotation matrix of the line scan camera relative to the object to be scanned; D0 is the initial displacement matrix of the line scan camera relative to the object to be scanned; When the mobile platform translates Δt at a speed v, the transformation matrix of the world coordinate system is:

8. A monitoring system, characterized in that: include: A mobile platform for carrying objects to be scanned; A line scan camera is used to scan an object to be scanned and capture an image; A storage module, used for storing template images; a control module, connected to the line scan camera and the storage module, respectively, and configured to execute the image template matching method according to any one of claims 1 to 7 to obtain a defect position in the captured image; The output module is connected to the control module to output the defect position of the captured image.

9. A control device, characterized in that: include: one or more memories; One or more processors, configured to execute one or more computer programs stored in the one or more memories, and further configured to execute the image template matching method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The method comprises instructions which, when executed on a computer, enable the computer to execute the image template matching method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Applique ceramic disc surface defect detection method based on image difference

    CN110503633A

  • Feature matching method based on optical flow, intelligent terminal and computer storage medium

    CN113554035A