Image matching method, computer device and storage medium

By determining the preset search range and anchor points in image matching, the problem of insufficient stability in image matching is solved, achieving higher stability and accuracy.

CN120635502BActive Publication Date: 2026-07-31ZHEJIANG HUARAY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG HUARAY TECH CO LTD
Filing Date
2025-04-18
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The stability of image matching in existing technologies is insufficient, which affects the accuracy of matching.

Method used

By acquiring the original image and the template image, a preset search range is determined, including the alignment area and the search range anchor point. Matching is performed and the matching degree is combined to determine the final result.

Benefits of technology

It improves the stability and accuracy of image matching, reduces data fluctuations, and enhances feature consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635502B_ABST
    Figure CN120635502B_ABST
Patent Text Reader

Abstract

This application discloses an image matching method, computer device, and storage medium. The method includes: acquiring an original image and a template image; determining a preset search range; wherein the preset search range includes at least one of: an alignment region and search range anchor points, the alignment region being obtained by aligning a preset region; and the search range anchor points being obtained by sampling anchor points within a preset parameter range; matching the original image and the template image within the preset search range to obtain several matching degrees; and combining the matching degrees to determine the matching result. This approach can improve the stability of image matching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image matching method, computer device and storage medium. Background Technology

[0002] With the development of computer vision technology, image matching is being used more and more in various fields, such as target localization, target recognition, and image registration.

[0003] Image matching typically involves using specific algorithms to find regions in a target image that are most similar to the features of a template image. However, different search results based on the template image in the matching image can lead to instability in image matching, and this instability affects the accuracy of the matching. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide an image matching method, computer device, and storage medium that can improve the stability of image matching.

[0005] The first aspect of this application provides an image matching method, which includes: acquiring an original image and a template image; determining a preset search range; wherein the preset search range includes at least one of an alignment region and search range anchor points, the alignment region being obtained by aligning a preset region range; the search range anchor points being obtained by anchor point sampling a preset parameter range; matching the original image and the template image within the preset search range to obtain several matching degrees; and combining the matching degrees to determine a matching result.

[0006] A second aspect of this application provides a computer device including a memory and a processor coupled to each other, the memory storing program data and the processor executing the program data to implement any step of the above-described image matching method.

[0007] A third aspect of this application provides a computer-readable storage medium storing program data executable by a processor, the program data being used to implement any step of the image matching method described above.

[0008] The above scheme obtains the original image and template image, determines the preset search range, matches the original image and template image within the preset search range to obtain several matching degrees, and combines the matching degrees to determine the matching result. Since the preset search range includes at least one of the alignment region and the search range anchor point, and the alignment region is obtained by aligning the preset region range, and the search range anchor point is obtained by anchor point sampling of the preset parameter range, it can maximize the consistency of features, reduce data fluctuations, and improve the stability of image matching.

[0009] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in this application, the accompanying drawings required in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Among them:

[0011] Figure 1 This is a flowchart illustrating the first embodiment of the image matching method of this application;

[0012] Figure 2 This is an example schematic diagram of an embodiment of the template image and edge features of this application;

[0013] Figure 3 This is an example schematic diagram of an embodiment of the pyramid image matching process of this application;

[0014] Figure 4 This is a flowchart illustrating the second embodiment of the image matching method of this application;

[0015] Figures 5a-5c This is an example schematic diagram of an embodiment of the pyramid image of this application;

[0016] Figures 6a-6c This is an example schematic diagram of another embodiment of the pyramid image in this application;

[0017] Figures 7a-7c This is an example schematic diagram of another embodiment of the pyramid image of this application;

[0018] Figure 8 This is a flowchart illustrating the third embodiment of the image matching method of this application;

[0019] Figure 9 This is a flowchart illustrating the fourth embodiment of the image matching method of this application;

[0020] Figure 10 This is a schematic diagram of the structure of an embodiment of the image matching device of this application;

[0021] Figure 11 This is a schematic diagram of the structure of an embodiment of the computer device of this application;

[0022] Figure 12 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0024] The terms "first" and "second" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0025] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0026] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0027] This application provides the following embodiments, and each embodiment is described in detail below.

[0028] Please see Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the image matching method of this application. The method may include the following steps:

[0029] S11: Obtain the original image and template image.

[0030] Image matching in this application can refer to template matching or matching of any two images. Image matching can be divided into two stages. The first stage is template training, which involves selecting a template image to be matched and performing feature extraction and storage of the template image. The second stage is template matching, which involves searching and locating the pose information of the template image trained in the first stage in the original image. The pose information includes position coordinates, rotation angle, scaling, etc., in order to find a target image or target region that matches the template image in the original image.

[0031] It is possible to obtain an original image and a template image, wherein the template image represents the image to be searched or matched, and optionally, the template image may contain the target object, such as an object or entity. The original image represents the image to be searched or matched, and regions matching the template image can be searched in the original image. This application does not impose any restrictions on the original image and the template image.

[0032] Optionally, the size of the original image is larger than the size of the template image. Optionally, the number of original images is one or more, and / or the number of template images is one or more; this application does not impose any limitation on this.

[0033] S12: Determine the preset search range; wherein, the preset search range includes at least one of: an alignment region and a search range anchor point, the alignment region is obtained by aligning the preset region range; the search range anchor point is obtained by anchor point sampling of the preset parameter range.

[0034] A preset search range for matching the original image and the template image can be determined. This preset search range may include at least one dimension. Optionally, the preset search range includes at least one of: an alignment region and search range anchor points. The alignment region is obtained by aligning the preset region range (e.g., position dimension), and can be used to describe the matching position in the original image; that is, the alignment region can represent the region in the original image used for matching. The search range anchor points are obtained by anchor sampling from a preset parameter range (e.g., angle dimension, scale dimension); that is, the search range anchor points can be used to describe the scale and / or angle of the original image used for matching.

[0035] In some implementations, at least one of a preset region range or a preset parameter range can be obtained. Then, the preset region range is aligned with the original image to obtain an aligned region. Anchor point sampling is performed on the preset parameter range to obtain the search range anchor points.

[0036] In some implementations, the search range anchor points include search scale anchor points and / or search angle anchor points. The search scale anchor points are obtained by sampling anchor points within a preset scale range, and the search angle anchor points are obtained by sampling anchor points within a preset angle range. The preset scale range represents the scale range of the original image during matching and can be used to describe the scale or blur level of the original image. The preset angle range represents the angular range of the original image during matching and can be used to describe the rotation angle of the original image.

[0037] S13: Match the original image and the template image within a preset search range to obtain several matching degrees.

[0038] The original image and template image can be matched within a preset search range to obtain a certain matching degree. Optionally, matching can be based on edge features, correlation, or feature points; this application does not limit the matching method. For example, taking edge feature-based matching as an example, since edge features can be extracted with high sub-pixel accuracy, the final matching and positioning accuracy can reach 1 / 40 of a pixel, which can improve the accuracy of image matching.

[0039] Optionally, the original image contains several layers of a first image, and the template image contains several layers of a second image, with different layers corresponding to different image scales. Multi-scale processing can be performed on the original image and the template image to obtain multi-scale, multi-layered first and second images.

[0040] Optionally, the layers can be a multi-layered pyramid structure. The template matching process can follow the pyramid order, matching the first and second images from top to bottom and from coarse to fine, continuously searching for more precise pose information at the bottom layer of the pyramid based on the candidate target. A traversal matching search is performed within a preset search range on each pyramid layer to obtain the similarity between the first and second images at each layer, resulting in several matching scores.

[0041] Optionally, if there are several layers of first and second images, the preset search range can be the image corresponding to the first layer (such as a pyramid image), and the other layers can be determined based on the corresponding first layer image. This application uses this as an example for illustration. Alternatively, the preset search range can be the image corresponding to each layer, and this application does not limit this.

[0042] Optionally, the matching degree between the original image and the template image can be determined by using the gradient direction of each first feature point in the original image (such as the first image) and the gradient direction of each second feature point in the template image (such as the second image). Here, feature points can be pixels, contour points, or edge points, etc. For example, the matching degree can be calculated using a cosine angle, and its matching degree can be expressed as follows:

[0043]

[0044] Where similarity represents the degree of matching. A i Let B be the gradient direction of the i-th first feature point in the original image. i Let be the gradient direction of the second feature point in the template image corresponding to the position of the i-th first feature point, and n be the number of first or second feature points. The angle between the two gradient directions can be measured using a cosine function. The size of the angle reflects the similarity or matching degree between the gradient directions of the template image and the original image. The smaller the angle, the higher the matching degree. For example, when the angle is 0, the matching degree is 1.

[0045] S14: Based on the combined matching scores, determine the matching result.

[0046] Based on the matching scores obtained above, the matching result between the original image and the template image is determined.

[0047] In some implementations, in response to the matching degree meeting a preset matching condition, the matching result is determined to be the target region corresponding to the matching degree. The preset matching condition includes conditions such as the matching degree being the maximum value or the matching degree being greater than a matching degree threshold; this application does not impose any limitations on these conditions.

[0048] In some embodiments, before step S13 above, feature points (such as edge points or contour points) of the original image and template image can be extracted, gradient information of each feature point can be obtained, and the gradient information of each feature point can be normalized to obtain the gradient direction of each feature point.

[0049] Please see Figure 2 For example, taking a template image as an example, the edge features of the template image can be extracted to obtain the gradient information (m) of each second feature point (such as an edge point or contour point). x ,m y ), gradient information (m) for each second feature point x ,m y After normalization, the gradient direction of the second feature point is obtained. Its gradient direction B is represented as follows:

[0050]

[0051] Please see Figure 3For steps S13 to S14 above, template matching is performed based on the pyramid features corresponding to several layers of pyramid images, following a coarse-to-fine strategy. Specifically, firstly, in the smallest-scale pyramid image, matching is performed on that layer's pyramid image. The matching degree is determined by comparing the gradient direction of the second feature point of the template image with the gradient direction of the first feature point of the original image. The image region with the highest matching degree is selected as the candidate target region. Then, the candidate target region is mapped to the original image in the next larger-scale pyramid image to obtain the matching region. Then, within the matching region in that layer's pyramid image, the matching degree is obtained again to determine the candidate target region, and this mapping continues to the next larger-scale pyramid image to obtain new matching regions, until the final candidate target region is determined in the largest-scale pyramid image, which is then used as the final target region. This template matching based on pyramid images reduces computational load and improves template matching efficiency.

[0052] The above scheme obtains the original image and template image, determines the preset search range, matches the original image and template image within the preset search range to obtain several matching degrees, and combines the matching degrees to determine the matching result. Since the preset search range includes at least one of the alignment region and the search range anchor point, and the alignment region is obtained by aligning the preset region range, and the search range anchor point is obtained by anchor point sampling of the preset parameter range, it can maximize the consistency of features, reduce data fluctuations, and improve the stability of image matching.

[0053] In some embodiments, step S12 of the above embodiment can be further extended. For step S12, the preset search range may include at least one of an alignment region and a search range anchor point. The alignment region can improve the stability of constructing a pyramid image of several layers, and the search range anchor point can improve the stability of discrete angle and scale selection, thereby improving the stability of image matching. The preset search range will be described below.

[0054] Please see Figure 4 , Figure 4 This is a flowchart illustrating a second embodiment of the image matching method of this application. When the preset search range includes an alignment region, determining the preset search range may include the following steps:

[0055] S21: Obtain the preset area range of the original image.

[0056] During the construction of the pyramid image structure, when the preset region changes, the image features will also undergo slight changes, and this change will affect all layers of the pyramid image. For example, if the preset region is changed while including the template image, the final matching result (such as position, angle, scale, and matching degree) will fluctuate slightly. This fluctuation may lead users to believe that the algorithm is not stable enough.

[0057] The original image contains several layers of first images, and the template image contains several layers of second images. Different layers correspond to different image scales. Each layer's first image corresponds to a preset region containing a number of pixels. Each pixel in the current layer is obtained by performing a preset statistical analysis on a preset number of pixels from the corresponding neighborhood of the previous layer. The preset number can represent the scaling factor for each layer, and the preset statistics can be the average, median, etc. This application uses the average value as an example for explanation.

[0058] Please see Figures 5a-5c For example, consider a three-layer pyramid image. Figures 5a-5c These are the first, second, and third pyramid images, respectively. The original image size is 12*12 pixels. The first image, consisting of several layers, contains three pyramid images. When matching the entire image region, pyramid images can be constructed for each layer. The first pyramid image is 12*12 pixels and contains pixels 0 to 143. The second pyramid image is 6*6 pixels, and the third pyramid image is 3*3 pixels.

[0059] The scaling factor for each layer of the pyramid image is calculated by averaging the values ​​of two adjacent pixels (2*2). In other words, each pixel in the current layer is based on the average of the four pixels in its corresponding neighborhood in the previous layer. For example, pixel (0,0) in the third layer of the pyramid image is calculated by averaging the values ​​of four pixels (0,0), (0,1), (1,0), and (1,1) in the second layer. Similarly, pixel (0,0) in the second layer is calculated by averaging the values ​​of four pixels (0,0), (0,1), (1,0), and (1,1) in the first layer. When the average value is not an integer, it can be rounded up. Based on the mapping relationship between the layers, the pixel value of pixel (0,0) in the third layer of the pyramid image is obtained by averaging the values ​​of 16 pixels in the first layer.

[0060] Obtain a preset region range from the original image. This preset region range can encompass an area defined by preset coordinates, preset height, and preset width. The preset region range can be represented as (x, y, w, h), where x and y represent the preset coordinates of the rectangular region (e.g., the coordinates of the top-left corner), and w and h represent the preset width and height of the rectangular region, respectively. Please refer to [link / reference]. Figures 6a-6c Exemplary Figures 6a-6c These are the first, second, and third pyramid images, respectively. Taking a preset region range (1,1,8,8) as an example, pyramid images of each layer can be constructed from the original image. For the first pyramid image, pixels can be selected within the preset region range (1,1,8,8) to obtain the first pyramid image. Then, the second pyramid image is obtained based on the average value of the four pixels in the corresponding neighborhood of the first pyramid image, and so on, to obtain the third pyramid image.

[0061] S22: Align the preset region with the original image using coordinates to obtain an aligned region; wherein the aligned region includes the preset region.

[0062] The coordinates of a preset region can be aligned with those of the original image to obtain an aligned region. The aligned region can contain the preset region, and the coordinates of the aligned region can be aligned with those of the original region.

[0063] In some implementations, the alignment region includes an area formed by alignment coordinates, alignment height, and alignment width. Optionally, the alignment region has a preset multiple relationship with the preset coordinates of the preset region range of the underlying layer. Optionally, the preset multiple is related to the preset number (or scaling factor) corresponding to each layer. Optionally, the preset multiple is related to the number of layers in the pyramid image. This application does not limit the preset multiple. The alignment region can be represented as (alignx, alignmenty, alignmentw, alignmenth), where alignx and alignmenty represent alignment coordinates, alignw represents alignment width, and alignh represents alignment height.

[0064] Alignment coordinates can be obtained by pre-processing using preset multiples and preset coordinates (x, y). Specifically, a value greater than or equal to the preset coordinates and a multiple of the preset multiple can be obtained. The difference between this multiple and the preset multiple is then taken as the maximum value between this difference and 0, resulting in the alignment coordinates. Next, the coordinate difference between the alignment coordinates and the preset coordinates can be obtained; this difference includes a first coordinate difference (e.g., the x-axis difference) and a second coordinate difference (e.g., the y-axis difference). The difference between the preset width and the first coordinate difference is determined to obtain the alignment width. Finally, the difference between the preset height and the second coordinate difference is determined to obtain the alignment height.

[0065] The preset region range can be represented as (x, y, w, h). Aligning the preset region range with the original image using coordinates yields the aligned region (alignx, aligny, alignw, alignh). Taking a preset multiplier of 4 as an example, its aligned region can be represented as follows:

[0066] alignx=MAX(0,ALIGN(x,4)-4);

[0067] aligny=MAX(0,ALIGN(y,4)-4);

[0068] alignw = w - (alignx - x);

[0069] alignh = h - (aligny - y).

[0070] Here, MAX represents the maximum of the two values, and ALIGN(x,4) represents a value greater than or equal to x and a multiple of 4. After performing coordinate alignment on the preset region range (1,1,8,8), the aligned region (0,0,9,9) is obtained. The aligned rectangular region must completely contain the original rectangular region without any loss of image area.

[0071] For example, taking a three-layer pyramid image as an example, the alignment coordinates (alignx, alignmenty) of the preset region range of the bottom search should be a multiple of 4. Taking a four-layer pyramid image as an example, the alignment coordinates (alignx, alignmenty) of the preset region range of the bottom search should be a multiple of 8. Other cases follow the same principle.

[0072] Please see Figures 7a-7c Exemplary Figures 7a-7c These are the first, second, and third pyramid images, respectively. Taking the alignment region (0,0,9,9) as an example, pyramid images of each layer can be constructed from the original image. For the first pyramid image, pixels can be selected within the alignment region (0,0,9,9) to obtain the first pyramid image. Then, the second pyramid image is obtained based on the average value of the four pixels in the corresponding neighborhood of the first pyramid image, and so on, to obtain the third pyramid image. By aligning the preset region range, the pyramid images constructed at each layer can be consistent with the pyramid image constructed across the entire image region. Post-processing such as edge extraction can improve the consistency of each feature value, thereby improving the consistency of the calculation results at each stage, reducing data fluctuations, and improving the overall stability of image matching.

[0073] Please see Figure 8 , Figure 8 This is a flowchart illustrating a third embodiment of the image matching method of this application. When the preset search range further includes search range anchor points, the method for determining the preset search range may include the following steps:

[0074] S31: Determine the original range anchor point.

[0075] Optionally, a preset search range can be determined using a reference anchor point and a preset parameter range.

[0076] Alternatively, the original range anchor point can be obtained using the reference anchor point.

[0077] A baseline anchor point can be obtained. This baseline anchor point can be parameters of a template image, parameters of a target object contained within the template image, or parameters of the original image, representing parameters that can match the target object or template image. Based on the baseline anchor point, sampling is performed within the selectable parameter range with a preset step size to obtain the original range anchor point. The selectable parameter range represents the currently supported parameter range. For selectable parameter ranges smaller than the baseline anchor point, sampling can be performed by subtracting the preset step size; for selectable parameter ranges larger than the baseline anchor point, sampling can be performed by adding the preset step size to obtain the original range anchor point.

[0078] In some implementations, the search range anchor points include search scale anchor points and / or search angle anchor points. The search scale anchor points are obtained by anchor point sampling within a preset scale range, and the search angle anchor points are obtained by anchor point sampling within a preset angle range. The preset scale range represents the scale range of the original image during matching, and the preset angle range represents the angle range of the original image during matching.

[0079] In some implementations, the reference anchor point corresponding to the search scale anchor point is 1 scale, and / or the reference anchor point corresponding to the search angle anchor point is 0 degrees.

[0080] Taking the search scale anchor point as an example, determine its original range anchor point, with 1 scale as the base anchor point. If the selectable parameter range (such as the scale range supported by the algorithm) is a minimum scale of 0.5 and a maximum scale of 2, the preset step size of the scale is 0.05. The range of optional parameters smaller than the reference anchor point 1 can be sampled by subtracting a preset step size of 0.05, and the range of optional parameters larger than the reference anchor point 1 can be sampled by adding a preset step size of 0.05, to obtain the original range anchor points as follows: 0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1,1.05,1.1,1.15,1.2,1.25,1.3,1.35,1.4,1.45,1.5,1.55,1.6,1.65,1.7,1.75,1.8,1.85,1.9,1.95,2.

[0081] For search angle anchor points, the same method as search scale anchor points can be used to obtain the corresponding original range anchor points with 0 degrees as the reference anchor point. This application will not elaborate on this further.

[0082] S32: Select anchor points that belong to the preset parameter range from the original range anchor points to obtain several search range anchor points.

[0083] Obtain the preset parameter range, and then select anchor points belonging to the preset parameter range from the original range anchor points to obtain several search range anchor points.

[0084] Taking the search scale anchor point as an example, the preset scale range is [0.9, 1.1]. The preset scale range represents the scale range of the original image during matching. Anchor points belonging to this preset scale range can be selected from the original range anchor points corresponding to the search scale anchor point, resulting in several search scale anchor points, as follows: 0.9, 0.95, 1, 1.05, 1.1. Similarly, for the search angle anchor point, anchor points belonging to the preset angle range can be selected from the corresponding original range anchor points, resulting in several search angle anchor points. Here, the preset angle range represents the angle range of the original image during matching.

[0085] The above scheme, by setting search angle anchor points and / or search scale anchor points, ensures that the matching degree of the original image and the template image is calculated entirely using these anchor points. As long as the search range includes the true angle and / or true scale of the target object or template image, the pose information for the highest matching degree is fixed, thus improving matching stability. Furthermore, by using search angle anchor points to fix discrete angles, stable results are ensured across different angle search ranges; similarly, by using search scale anchor points to fix discrete scales, stable results are ensured across different scale search ranges, thereby improving overall image matching stability.

[0086] In some embodiments, step S13 can be extended to match the original image and the template image within different preset search ranges to obtain several matching degrees.

[0087] Please see Figure 9 , Figure 9 This is a flowchart illustrating the fourth embodiment of the image matching method of this application. The method may include the following steps:

[0088] S41: Match each aligned region of the original image with the template image to obtain several matching degrees.

[0089] If the preset search range includes the alignment area, each alignment area of ​​the original image is matched with the template image to obtain a certain degree of matching. Thus, the target area can be determined based on the degree of matching.

[0090] S42: Match the original image and the template image sequentially at each anchor point in the search range to obtain several matching degrees.

[0091] If the preset search range includes the search range anchor points, the original image and the template image can be matched sequentially at each search range anchor point to obtain the matching degree of each search range anchor point.

[0092] S43: Using the anchor points and alignment regions of each search range, match the original image and the template image to obtain several matching degrees.

[0093] When the preset search range includes alignment areas and search range anchor points, the original image and the template image can be matched at each search range anchor point and alignment area to obtain several matching degrees.

[0094] Optionally, the original image can be processed using each search range anchor point to obtain several anchor point images. Then, the alignment area of ​​each anchor point image can be matched with the template image to obtain several matching degrees.

[0095] The above scheme can optimize the stability of image features by obtaining the alignment region from the construction of the pyramid image itself (image scaling). By obtaining the setting of the search range anchor point, stable matching can be obtained under different angle and scale settings, thereby improving the overall stability of image matching.

[0096] It is understood that in the above method of specific implementation, the order in which each step is written does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0097] In some embodiments, this application also provides an image matching apparatus for implementing the image matching method of any of the above embodiments.

[0098] Please see Figure 10 , Figure 10 This is a schematic diagram of an embodiment of the image matching device of this application. The image matching device 50 includes an acquisition module 51, a range module 52, a matching module 53, and a result module 54. The modules are interconnected.

[0099] The acquisition module 51 is used to acquire the original image and the template image.

[0100] The range module 52 is used to determine a preset search range; the preset search range includes at least one of an alignment region and a search range anchor point, wherein the alignment region is obtained by aligning the preset region range; and the search range anchor point is obtained by anchor point sampling of the preset parameter range.

[0101] The matching module 53 is used to match the original image and the template image within a preset search range to obtain several matching degrees.

[0102] Result module 54 is used to integrate the various matching degrees to determine the matching result.

[0103] It should be noted that the image matching device and the image matching method provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs its operations have been described in detail in the method embodiments, and will not be repeated here. In practical applications, the image matching device provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This application does not impose any limitations on this.

[0104] It is understood that the image matching method in this application can be executed by a computer device, which can be any device with processing capabilities, such as a mobile device, computer, server, etc., and this application does not impose any restrictions on it. In some possible implementations, the image matching method can be implemented by the processor calling program data stored in memory.

[0105] Regarding the above embodiments, this application provides a computer device; please refer to [link / reference]. Figure 11 , Figure 11 This is a schematic diagram of the structure of a computer device according to an embodiment of the present application. The computer device 60 includes a memory 61 and a processor 62, wherein the memory 61 and the processor 62 are coupled to each other. The memory 61 stores program data, and the processor 62 is used to execute the program data to implement the steps of any embodiment of the image matching method described above.

[0106] In this embodiment, processor 62 can also be referred to as a CPU (Central Processing Unit). Processor 62 may be an integrated circuit chip with signal processing capabilities. Processor 62 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 62 can be any conventional processor.

[0107] The methods described in the above embodiments can be implemented as computer programs; therefore, this application proposes a computer-readable storage medium. Please refer to [link to relevant documentation]. Figure 12 , Figure 12This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 70 stores program data 71 that can be executed by a processor to implement the steps of any embodiment of the image matching method described above.

[0108] In this embodiment, the computer-readable storage medium 70 can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or a medium that can store program data 71. Alternatively, it can be a server that stores the program data 71. The server can send the stored program data 71 to other devices for execution, or it can run the stored program data 71 itself.

[0109] In some embodiments, the functions or modules of the apparatus provided in the above embodiments of this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments. For the sake of brevity, this application will not repeat the details here.

[0110] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to each other. For the sake of brevity, the present application will not repeat them here.

[0111] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. An image matching method characterized by, include: Obtain the original image and the template image; the original image and the template image are pyramid images. A preset search range is determined; wherein, the preset search range includes: an alignment region and search range anchor points, the alignment region is obtained by aligning the preset region range; the search range anchor points are obtained by anchor point sampling of a preset parameter range; The original image and the template image are matched within the preset search range to obtain several matching degrees; The matching result is determined by combining all matching scores. The preset search range includes an alignment region; determining the preset search range includes: Obtain a preset region range of the original image; wherein, the preset region range includes: a region formed by preset coordinates, preset height, and preset width; the alignment region includes: a region formed by alignment coordinates, alignment height, and alignment width; The preset region is aligned with the original image using coordinates to obtain the aligned region; wherein the aligned region includes the preset region, comprising: Alignment coordinates are obtained by performing preset processing using preset multiples and preset coordinates; wherein, the preset multiples are related to the number of layers in the pyramid image; Obtain the coordinate difference between the alignment coordinates and the preset coordinates; wherein, the coordinate difference includes a first coordinate difference and a second coordinate difference; The difference between the preset width and the first coordinate difference is determined to obtain the alignment width; The difference between the preset height and the second coordinate difference is determined to obtain the alignment height.

2. The method according to claim 1, characterized in that, The original image contains several layers of first images, and the template image contains several layers of second images. The image scales corresponding to different layers are different. The preset region range corresponding to the first image of each layer contains several pixels. Each pixel of the current layer is obtained by performing preset statistics on a preset number of pixels in the corresponding neighborhood of the previous layer.

3. The method according to claim 1, characterized in that, The preset search range includes search range anchor points; Determining the preset search range includes: Determine the original range anchor point; From the original range anchor points, select anchor points that belong to the preset parameter range to obtain several search range anchor points.

4. The method according to claim 3, characterized in that, The search range anchor points include search scale anchor points and / or search angle anchor points. The search scale anchor points are obtained by sampling anchor points within a preset scale range, and the search angle anchor points are obtained by sampling anchor points within a preset angle range. The preset scale range represents the scale range of the original image during matching, and the preset angle range represents the angle range of the original image during matching.

5. The method according to claim 3 or 4, characterized in that, The determination of the original range anchor point includes: Obtain the reference anchor point; Based on the reference anchor point, sampling is performed within the selectable parameter range with a preset step size to obtain the original range anchor point; Wherein, the range of optional parameters smaller than the reference anchor point is sampled by subtracting the preset step size, and the range of optional parameters larger than the reference anchor point is sampled by adding the preset step size; and / or, the reference anchor point corresponding to the search scale anchor point is 1 scale, and the reference anchor point corresponding to the search angle anchor point is 0 degrees.

6. The method according to claim 1, characterized in that, The process of matching the original image and the template image within the preset search range yields several matching degrees, including: Using the anchor points of each search range and the alignment region, the original image and the template image are matched to obtain several matching degrees; And / or, the determination of the matching result by combining the various matching degrees includes: In response to the matching degree satisfying the preset matching conditions, the matching result is determined to be the target region corresponding to the matching degree.

7. A computer device, characterized in that, The method includes a memory and a processor coupled to each other, the memory storing program data and the processor executing the program data to implement the steps of the method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The system stores program data that can be executed by a processor, the program data being used to implement the steps of the method according to any one of claims 1 to 6.