Method for quickly calculating image correlation

By using the sliding window and dimensionality transformation methods, image correlation is quickly calculated, which solves the problem of long calculation time in the existing technology and realizes rapid target positioning in target positioning scenarios.

CN120780858AActive Publication Date: 2025-10-14SICHUAN DESHENG XINDA BRAIN INTELLIGENCE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511203828.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-10-14
Estimated Expiration
2045-08-27

AI Technical Summary

Technical Problem

Existing technologies take too long to calculate image correlation and are unable to locate the target position in real time. In particular, the computational complexity is high in heterogeneous image matching, resulting in the inability to locate the position of the template in the search image in real time.

Method used

A sliding window is used to traverse the feature map, extract the feature vector, and obtain the cross-correlation map at one time through dimensionality transformation and normalization calculation, which reduces the number of calculation steps and uses the dimensionality transformation and normalization method of the feature map for fast calculation.

Benefits of technology

It achieves fast calculation of image correlation and reduces calculation time, so that the target position can be quickly located in scenarios where target positioning is required, such as improving real-time performance in matching guidance or emergency search and rescue scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780858A_ABST
    Figure CN120780858A_ABST
Patent Text Reader

Abstract

The invention discloses a method for quickly calculating image correlation, and relates to the technical field of image matching, and the method comprises the steps: S1, based on a feature extraction network, obtaining a template feature map from a template image, and obtaining a search feature map from a search image; s2, setting a sliding window, traversing and extracting the search feature map through the sliding window, and extracting a first feature vector; s3, performing cross-correlation operation on the template feature map and the search feature map to obtain a calculation result; s4, performing dimension transformation based on a calculation result obtained in the step S3 to obtain a matched cross-correlation graph; and S5, based on the position index of the maximum value in the matched cross-correlation graph, obtaining the position with the maximum correlation of the sliding window. According to the method, the normalized correlation of each position of the to-be-matched template on the search image is calculated, and the cross-correlation graph can be obtained only through one-time calculation, so that the time for obtaining the cross-correlation graph is shortened, and the position of the target can be quickly positioned in a scene in which the target needs to be positioned.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image matching, in particular to a method for quickly calculating image correlation. BACKGROUND

[0002] In the prior art, there is no method for realizing target positioning by quickly calculating image correlation. For example, the patent with publication number CN114022729A discloses a method and system for heterogeneous image matching positioning based on a twin network and supervised training. In order to calculate the positioning of a template in a search image, the obtained template feature map is traversed on the heterogeneous search feature map, and a normalized correlation operation is performed at each traversal position to obtain a matching cross-correlation map. However, this method has the following disadvantages: when traversing and calculating, if the size of the heterogeneous search feature map is larger, the time required for traversal and calculation is longer, and the matching cross-correlation map cannot be obtained in real time, so the position of the template in the search image cannot be positioned in real time. Moreover, the number of traversals required for this traversal calculation is also large, further increasing the time consumption. SUMMARY

[0003] The present application aims to overcome the shortcomings of the prior art and provide a method for quickly calculating image correlation.

[0004] The purpose of the present application is achieved by the following technical solutions: The present application discloses a method for quickly calculating image correlation, comprising the following steps: S1. Based on a feature extraction network, a template feature map is obtained from a template image T. The dimension of the template feature map is A search feature map is obtained from a search image I. The dimension of the search feature map is wherein C represents the depth, W represents the width of the template feature map H represents the height of the template feature map W represents the width of the search feature map H represents the height of the search feature map ; H S2. A sliding window is set, and the search feature map is traversed and extracted through the sliding window to obtain a first feature vector ; S3. Cross-correlation operation is performed on the template feature map and the search feature map to obtain a calculation result. ​​​S4, performing dimension transformation based on the calculation result obtained in step S3 to obtain a matching cross-correlation graph ; S5, obtaining the position with the maximum correlation in the sliding window based on the position index of the maximum value in the matching cross-correlation graph .

[0005] Further, the step S2 specifically comprises the following steps: S21, setting a sliding window based on the width and height of the template feature graph ; and the height of the search feature graph , the size of the sliding window is , the sliding step is 1, and the sliding direction of the sliding window in the search feature graph is from left to right and from top to bottom, and the extracted features are stacked after the features are extracted at each position; S22, after the sliding window traverses the search feature graph , a first feature vector is extracted, and the dimension of the first feature vector is

[0006] Preferably, the step S3 specifically comprises the following steps: S31, performing dimension transformation on the template feature graph to obtain a second feature vector , and the dimension of the second feature vector is ; S32, performing dimension transformation on the first feature vector to obtain a third feature vector , and the dimension of the third feature vector is ; S33, calculating the mean value of the second feature vector along the 0th dimension by the formula , and the dimension of the mean value is [1]; S34, calculating the mean value of the third feature vector along the 1st dimension by the formula , and the dimension of the mean value is ; S35, performing mean value normalization calculation on the mean value of the second feature vector , the dimension of which is ; the mean value of the third feature vector is normalized by formula , and a second mean normalization result is obtained, the dimension of which is ; ; S36, normalized cross-correlation calculation is performed on the template feature map and the search feature map by formula , wherein represents the transformation dimension, and the dimension of the normalized cross-correlation calculation result is .

[0007] Preferably, the normalized cross-correlation calculation result is subjected to dimension transformation to obtain a matching cross-correlation map , the dimension of the matching cross-correlation map is .

[0008] The present application has the following advantages: 1) The present application extracts the features of the search feature map, then subjects the result to dimension transformation, and performs normalized cross-correlation calculation on the template feature map based on the transformed dimension, thereby reducing the steps of calculation and the time for obtaining the cross-correlation map, and in the scene requiring target positioning, such as matching guidance or emergency search and rescue, the position of the target can be quickly positioned. BRIEF DESCRIPTION OF DRAWINGS

[0009] Figure 1 is a step schematic diagram of a method for quickly calculating image correlation according to an embodiment of the present application. DETAILED DESCRIPTION

[0010] The technical solutions of the present application will be described clearly and completely below with reference to the embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0011] The present application discloses a method for quickly calculating image correlation, which modifies the method for calculating the normalized correlation of each position of the template to be matched on the search image by using the traversal method, and only needs to be calculated once to obtain the cross-correlation map, thereby reducing the time for obtaining the cross-correlation map, and in the scene requiring target positioning, the position of the target can be quickly positioned. The method comprises: calculating the template feature map of the template to be matched Cross-correlation plot on Instead of using the traversal method to perform normalized correlation calculations at each position, we first traverse the search graph in a sliding window manner, transform the traversed features into dimensions, and then calculate the cross-correlation graph once based on the normalization method. , the steps of the present invention are shown in the following diagram: Figure 1 As shown, the specific steps include: S1. Based on the feature extraction network, obtain the template feature map from the template image T , the template feature map The dimension is , obtain the search feature map from the search image I , the search feature map The dimension is , where C represents the depth, Representation template feature map The width, Representation template feature map The height of W represents the search feature map The width, H Represents the search feature graph height; S2. Set a sliding window and extract the search feature map through the sliding window traversal , extract the first eigenvector ; S3. Template feature map and search feature graph Perform cross-correlation calculation to obtain calculation results; S4: Perform dimension transformation based on the calculation result obtained in step S3 to obtain a matching cross-correlation graph ; S5. Based on matching cross-correlation graph The position index of the maximum value in the sliding window is obtained to obtain the position with the largest correlation in the sliding window.

[0012] Specifically, step S2 includes the following steps: S21, template-based feature map Width and height Set a sliding window, the size of the sliding window is , the sliding step is 1, and the sliding window is searching for the feature map The sliding direction of the traversal is from left to right and from top to bottom. After extracting features at each position, the extracted features are stacked; S22, the sliding window traverses the search feature map Then, extract the first eigenvector , the first feature vector has a dimension of .

[0013] Specifically, the step S3 specifically comprises the following steps: S31, performing dimension transformation on the template feature map to obtain a second feature vector , the second feature vector has a dimension of ; S32, performing dimension transformation on the first feature vector to obtain a third feature vector , the third feature vector has a dimension of ; S33, calculating the mean value of the second feature vector along the 0th dimension by the formula , which has a dimension of [1]; S34, calculating the mean value of the third feature vector along the 1st dimension by the formula , which has a dimension of ; S35, performing mean value normalization calculation on the mean value of the second feature vector by the formula to obtain a first mean value normalized result , which has a dimension of ; performing mean value normalization calculation on the mean value of the third feature vector by the formula to obtain a second mean value normalized result , which has a dimension of ; S36, performing normalized cross-correlation calculation on the template feature map and the search feature map by the formula , wherein the numerator , the result dimension of the matrix multiplication is calculated first, and then based on the transformed dimension , the result dimension of the numerator is . In the denominator , is the second mean value normalized result . norm, the result dimension of which is , is the first mean normalized result the norm of , the result dimension of which is , and then is multiplied by to obtain the result dimension of the denominator: ; the dimension of the normalized cross-correlation calculation result is .

[0014] Specifically, the step S4 specifically comprises: performing dimension transformation on the normalized cross-correlation calculation result to obtain a matching cross-correlation map , the dimension of the matching cross-correlation map is .

[0015] Exemplarily, the application can also be realized through the following steps: Step 1, acquiring a template feature map from a template image T based on a feature extraction network, the dimension of the template feature map is , and acquiring a search feature map from a search image I, the dimension of the search feature map is , wherein C represents depth, represents the width of the template feature map , represents the height of the template feature map , W represents the width of the search feature map , H represents the height of the search feature map ; Step 2, setting a sliding window, traversing the search feature map by the sliding window to extract a first feature vector ; setting the sliding window based on the width and the height of the template feature map , the size of the sliding window is , the step length of the sliding is 1, the sliding direction of the sliding window in the search feature map is from left to right and from top to bottom, and the extracted features are stacked after the features are extracted at each position; after the search feature map is traversed by the sliding window, the first feature vector is extracted, the dimension of the first feature vector is ; Step 3: Template feature map and search feature graph Perform cross-correlation calculation to obtain the calculation result; Perform dimension transformation to obtain the second eigenvector , the second eigenvector The dimension is ; For the first eigenvector Perform dimension transformation to obtain the third eigenvector , the third eigenvector The dimension is ; The second eigenvector The mean and the third eigenvector The mean The default value is 0, which means the first mean normalization result , , whose dimensions are ; Second mean normalization result , , whose dimensions are ; Through the formula Template feature map and search feature graph Perform normalized cross-correlation calculations, where the numerator In the example above, we first calculate the matrix multiplication. The result dimension , then based on the transformation dimension ,molecular The resulting dimension is . Denominator middle, is the second mean normalization result of norm, the resulting dimension is , is the first mean normalization result of norm, the resulting dimension is , then and Perform matrix multiplication to obtain the resulting dimension of the denominator: ; Normalized cross-correlation calculation results The dimension is ; Step 4: Perform dimension transformation based on the calculation results obtained in step 3 to obtain the matching cross-correlation graph ; Calculation results of normalized cross-correlation Perform dimension transformation to obtain matching cross-correlation graph , the matching cross-correlation graph The dimension of the normalized cross-correlation is ; Step 5, obtaining the position of the maximum sliding window correlation based on the position index of the maximum value in the matching cross-correlation graph.

[0016] Exemplarily, the above-mentioned normalized cross-correlation calculation mode can also use other correlation calculation formulas, such as Euclidean distance, Mahalanobis distance, Pearson correlation coefficient, Manhattan distance, Hamming distance, mutual information calculation formula, etc.

[0017] To sum up, the application discloses a method for quickly calculating image correlation, changes the used traversal method, calculates the normalized correlation of each position of a to-be-matched template on a search image, and only needs to be calculated once to obtain a cross-correlation graph, reduces the time consumed in the calculation process, thereby reducing the time for obtaining the cross-correlation graph, and in a scene requiring target positioning, such as a matching guidance or emergency search and rescue scene, the position of the target can be positioned more quickly.

[0018] The above-mentioned is only the preferred embodiment of the application, and it should be understood that the application is not limited to the form disclosed herein, should not be regarded as excluding other embodiments, and can be used in various other combinations, modifications and environments, and can be modified by the above-mentioned teaching or related technical or knowledge within the scope of the concept described herein. The modification and change made by the person skilled in the art without departing from the spirit and scope of the application should be within the protection scope of the claims attached to the application.​

Claims

1. A method for quickly calculating image correlation, characterized in that: The following steps are involved: S1. Based on the feature extraction network, obtain the template feature map from the template image T , the template feature map The dimension is , obtain the search feature map from the search image I , the search feature map The dimension is , where C represents the depth, Representation template feature map The width, Representation template feature map The height of W represents the search feature map The width, H Represents the search feature graph height; S2. Set a sliding window and extract the search feature map through the sliding window traversal , extract the first eigenvector ; S3, template feature map and search feature graph Perform cross-correlation calculation to obtain calculation results; S4: Perform dimension transformation based on the calculation result obtained in step S3 to obtain a matching cross-correlation graph ; S5. Based on matching cross-correlation graph The position index of the maximum value in the sliding window is obtained to obtain the position with the largest correlation in the sliding window.

2. The method for rapidly calculating image correlation according to claim 1, wherein: The step S2 specifically includes the following steps: S21, template-based feature map Width and height Set a sliding window, the size of the sliding window is , the sliding step is 1, and the sliding window is searching for the feature map The sliding direction of the traversal is from left to right and from top to bottom. After extracting features at each position, the extracted features are stacked; S22, the sliding window traverses the search feature map Then, extract the first eigenvector , the first eigenvector The dimension is .

3. The method for rapidly calculating image correlation according to claim 2, wherein: The step S3 specifically includes the following steps: S31, template feature map Perform dimension transformation to obtain the second eigenvector , the second eigenvector The dimension is ; S32, for the first eigenvector Perform dimension transformation to obtain the third eigenvector , the third eigenvector The dimension is ; S33, through the formula Along the 0th dimension Calculate the second eigenvector The mean , whose dimension is [1]; S34, through the formula Along the first dimension Calculate the third eigenvector The mean , whose dimensions are ; S35, through the formula For the second eigenvector The mean Perform mean normalization calculation to obtain the first mean normalization result , whose dimensions are ; Through the formula For the third eigenvector The mean Perform mean normalization calculation to obtain the second mean normalization result , whose dimensions are ; S36, through the formula Template feature map and search feature graph Perform normalized cross-correlation calculations, where Indicates the transformation dimension and normalized cross-correlation calculation results The dimension is .

4. The method for rapidly calculating image correlation according to claim 3, wherein: The step S4 specifically includes: calculating the normalized cross-correlation result Perform dimension transformation to obtain matching cross-correlation graph , the matching cross-correlation graph The dimension is .

Citation Information

Patent Citations

  • Heterogenous image matching and positioning method and system based on twin network and supervised training

    CN114022729A

  • AI multi-dimensional teaching behavior analysis method and system based on classroom video

    CN118658128B

  • Lane line semantic segmentation method based on self-attention

    CN119888231A

  • Target tracking hardware implementation system and method

    US10810746B2

  • Style-aware audio-driven talking head animation from a single image

    US11417041B2