A method for fast computation of image correlation

By employing sliding window and dimensional transformation methods, image correlation can be quickly calculated, solving the problem of long computation time for large images and enabling real-time target localization. This method is suitable for scenarios such as matching guidance and emergency search and rescue.

CN120780858BActive Publication Date: 2025-11-21SICHUAN DESHENG XINDA BRAIN INTELLIGENCE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies take too long to calculate image correlations, especially when searching for large heterogeneous feature maps, making real-time localization impossible. They also involve a large number of traversal calculations, resulting in low efficiency.

Method used

By using a sliding window to extract feature vectors and combining dimensionality transformation and normalization calculation, a cross-correlation graph can be obtained in one calculation, reducing the number of calculation steps and time.

Benefits of technology

It enables rapid calculation of image correlation, allowing for quick and accurate target location in scenarios requiring target localization, and is suitable for applications such as matching guidance and emergency search and rescue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780858B_ABST
    Figure CN120780858B_ABST
Patent Text Reader

Abstract

The application discloses a method for quickly calculating image correlation, and relates to the technical field of image matching, which comprises the following steps: S1, acquiring a template feature map from a template image and a search feature map from a search image based on a feature extraction network; 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 the calculation result obtained in the step S3 to obtain a matching cross-correlation map; and S5, obtaining the position with the maximum correlation of the sliding window based on the position index of the maximum value in the matching cross-correlation map. According to the application, the normalized correlation of each position of a template to be matched on a search image is calculated, the cross-correlation map can be obtained only once, the time for obtaining the cross-correlation map is reduced, and the position of a target can be quickly located in a scene requiring target positioning.
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, and particularly relates 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, a method and system for heterogeneous image matching positioning based on a twin network and supervised training are disclosed in patent CN114022729A. In order to calculate the positioning of a template in a search image, the obtained template feature map is traversed on a 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. Therefore, the position of the template in the search image cannot be positioned in real time. Moreover, the number of traversals required by this traversal calculation is large, further increasing the time required. 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.

[0005] The present application discloses a method for quickly calculating image correlation, comprising the following steps:

[0006] 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, H represents the height, W represents the width, H represents the height. H

[0007] S2. A sliding window is set, and the search feature map is traversed and extracted through the sliding window. A first feature vector is extracted.

[0008] S3. The template feature map ​​​and search feature map Perform cross-correlation calculations to obtain the results;

[0009] S4. Based on the calculation results obtained in step S3, perform dimensional transformation to obtain the matching cross-correlation graph. ;

[0010] S5, Based on Matching Cross-Correlation Graph The position index of the maximum value in the middle is used to obtain the position with the highest correlation in the sliding window.

[0011] Furthermore, step S2 specifically includes the following steps:

[0012] S21, Based on template feature map width and height Set a sliding window, the size of which is... The sliding step size is 1, and the sliding window searches 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.

[0013] S22. The sliding window has traversed the search feature map. Then, extract the first feature vector. The first feature vector The dimension is .

[0014] Preferably, step S3 specifically includes the following steps:

[0015] S31. Template feature map Perform a dimensional transformation to obtain the second feature vector. The second feature vector The dimension is ;

[0016] S32, regarding the first eigenvector Perform dimensional transformation to obtain the third feature vector. The third feature vector The dimension is ;

[0017] S33, through formula Along the 0th dimension Calculate the second eigenvector mean Its dimension is [1];

[0018] S34, through formula Along the first dimension Calculate the third eigenvector mean Its dimensions are ;

[0019] S35, through formula For the second eigenvector Perform mean normalization calculation to obtain the first mean normalization result. Its dimensions are ; through formula For the third eigenvector Perform mean normalization calculation to obtain the second mean normalization result. Its dimensions are ;

[0020] S36, through formula Template feature map and search feature map Perform normalized cross-correlation calculation, where This represents the result of cross-correlation calculation after dimensional transformation and normalization. The dimension is .

[0021] Preferably, the normalized cross-correlation calculation results Perform dimensional transformation to obtain the matching cross-correlation graph. The matching cross-correlation graph The dimension is .

[0022] The beneficial effects of this invention are:

[0023] 1) This invention extracts features from the search feature map, then transforms the dimensions of the results, and performs normalized cross-correlation calculations based on the transformed dimensions and the template feature map, reducing the number of calculation steps and thus reducing the time to obtain the cross-correlation map. In scenarios requiring target localization, such as matching guidance or emergency search and rescue, the location of the target can be quickly located. Attached Figure Description

[0024] Figure 1 This is a schematic diagram illustrating the steps of a method for rapidly calculating image correlation according to an embodiment of the present invention. Detailed Implementation

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

[0026] This application discloses a method for quickly calculating image correlation. It changes the method of calculating the normalized correlation of a template to be matched at each position in a search image using a traversal approach. Instead, it only requires one calculation to obtain the cross-correlation map, reducing the time spent obtaining the cross-correlation map. In scenarios requiring target localization, this method enables rapid location of the target. The method includes: calculating the feature map of the template to be matched. Searching feature maps Cross-correlation graph on Instead of performing normalized correlation calculations at each position using a traversal method, this approach first traverses the search graph using a sliding window, transforms the dimensions of the traversed features, and then calculates the cross-correlation graph in a single step based on a normalization method. The steps of this invention are illustrated in the diagram below. Figure 1 As shown, the specific steps include:

[0027] S1. Based on a 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 search image I. The search feature map The dimension is Where C represents depth, Represents template feature map width, Represents template feature map The height of the search feature map is W. width, H Represents the search feature map Height;

[0028] S2. Set a sliding window and extract the search feature map by traversing through the sliding window. Extract the first feature vector ;

[0029] S3, Template Feature Map and search feature map Perform cross-correlation calculations to obtain the results;

[0030] S4. Based on the calculation results obtained in step S3, perform dimensional transformation to obtain the matching cross-correlation graph. ;

[0031] S5, Based on Matching Cross-Correlation Graph The position index of the maximum value in the middle is used to obtain the position with the highest correlation in the sliding window.

[0032] Specifically, step S2 includes the following steps:

[0033] S21, based on the template feature map width and height Set the sliding window, the size of the sliding window is , the sliding step is 1, the sliding direction of the sliding window traversing in the search feature map is from left to right and from top to bottom, and after extracting the features at each position, the extracted features are stacked;

[0034] S22, after the sliding window traverses the search feature map , a first feature vector is extracted, the dimension of the first feature vector is .

[0035] Specifically, the step S3 specifically comprises the following steps:

[0036] S31, performing dimension transformation on the template feature map to obtain a second feature vector , the dimension of the second feature vector is ;

[0037] S32, performing dimension transformation on the first feature vector to obtain a third feature vector , the dimension of the third feature vector is ;

[0038] S33, calculating the mean of the second feature vector along the 0th dimension by the formula , the dimension of which is [1];

[0039] S34, calculating the mean of the third feature vector along the 1st dimension by the formula , the dimension of which is ;

[0040] S35, performing mean normalization calculation on the second feature vector by the formula to obtain a first mean normalization result , the dimension of which is ; performing mean normalization calculation on the third feature vector by the formula to obtain a second mean normalization result , the dimension of which is ;

[0041] S36、by formula to the template feature map and the search feature map , wherein the numerator is calculated first, the result dimension of the matrix multiplication , and then based on the transformation dimension , the result dimension of the numerator is . In the denominator , is the norm of the second mean normalized result , and the result dimension is , is the norm of the first mean normalized result , and the result dimension is , and then is multiplied by to obtain the result dimension of the denominator ; the dimension of the normalized cross-correlation calculation result is . .

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

[0043] Exemplarily, the present application can also be implemented by the following steps:

[0044] Step 1, based on a feature extraction network, obtaining a template feature map from a template image T, wherein the dimension of the template feature map is , and obtaining a search feature map from a search image I, wherein the dimension of the search feature map is , wherein C represents the 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 and represents the height of the search feature map ;

[0045] Step 2: Set up a sliding window and extract the search feature map by traversing through the sliding window. Extract the first feature vector Based on template feature map width and height Set a sliding window, the size of which is... The sliding step size is 1, and the sliding window searches the feature map. The sliding window iterates through the feature map from left to right and from top to bottom. After extracting features at each position, the extracted features are stacked. The sliding window iterates through the entire feature map search. Then, extract the first feature vector. The first feature vector The dimension is ;

[0046] Step 3: Process the template feature map and search feature map Perform cross-correlation calculations to obtain the results; analyze the template feature map. Perform a dimensional transformation to obtain the second feature vector. The second feature vector The dimension is For the first eigenvector Perform dimensional transformation to obtain the third feature vector. The third feature vector The dimension is ; the second feature vector mean and the third eigenvector mean The default value is 0, which is the result of the first mean normalization. , Its dimensions are Second mean normalization result , Its dimensions are ; through formula Template feature map and search feature map Perform normalized cross-correlation calculations, where the molecule First, calculate matrix multiplication. Result Dimension Then based on the transformation dimension ,molecular The result dimension is Denominator middle, The result of the second mean normalization of norm, the result dimension of which is , is the first mean normalized result the norm, the result dimension of which is , then the is multiplied by the to obtain the result dimension of the denominator: ; the dimension of the normalized cross-correlation calculation result is ;

[0047] Step 4, based on the calculation result obtained in step 3, dimension transformation is performed to obtain a matching cross-correlation graph ; dimension transformation is performed on the normalized cross-correlation calculation result to obtain a matching cross-correlation graph , and the dimension of the matching cross-correlation graph is ;

[0048] Step 5, based on the position index of the maximum value in the matching cross-correlation graph , the position with the maximum sliding window correlation is obtained.

[0049] Exemplarily, the above-mentioned normalized cross-correlation calculation method 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.

[0050] In summary, the present application discloses a method for quickly calculating image correlation, which changes the used traversal method, calculates the normalized correlation of each position of the to-be-matched template on the search image, and obtains the cross-correlation graph only by calculating once, thereby reducing the time consumed in the calculation process, and reducing the time for obtaining the cross-correlation graph. In the scene requiring target positioning, such as matching guidance or emergency search and rescue, the target position can be positioned more quickly.

[0051] The above-mentioned is only the preferred embodiment of the present application, and it should be understood that the present application is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but 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 present application shall be within the protection scope of the appended claims of the present application.

Claims

1. A method of fast computation of image correlation, characterized in that, The method comprises the following steps: S1. Based on a 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 search image I. The search feature map The dimension is Where C represents depth, Represents template feature map width, Represents template feature map The height of the search feature map is W. width, H Represents the search feature map Height; S2, set a sliding window, traverse and extract a search feature map through the sliding window , extract a first feature vector ; S3, Template Feature Map and search feature map Perform cross-correlation calculations to obtain the results; S4, performing dimension transformation based on the calculation result obtained in step S3 to obtain a matching cross-correlation graph ; S5、based on matching cross-correlation diagram The position index of the maximum value in the middle, the position of the maximum correlation of the sliding window is obtained. The step S3 specifically comprises the following steps: S31, obtaining a template feature map performing dimension transformation to obtain a second feature vector , wherein a dimension of the second feature vector is ; S32, performing dimension transformation on the first feature vector to obtain a third feature vector S33, performing dimension transformation on the second feature vector to obtain a fourth feature vector , wherein a dimension of the third feature vector is ​ S33, through formula Along the 0th dimension Calculate the second eigenvector mean Its dimension is [1]; S34, by formula along the first dimension computing a third eigenvector whose mean is ; S35, by formula to the second feature vector mean normalization calculation is performed to obtain a first mean normalization result , the dimension of which is ; by formula to the third feature vector mean normalization calculation is performed to obtain a second mean normalization result , the dimension of which is ; S36, by formula to the template feature map and the search feature map a normalized cross-correlation computation is performed, where denotes the transform dimension, the normalized cross-correlation computation result has a dimension of ; The step S4 specifically comprises: performing normalization on the cross-correlation calculation result to obtain a matching cross-correlation graph , wherein a dimension of the matching cross-correlation graph is .

2. The method of claim 1, wherein: The step S2 specifically comprises the following steps: The step S2 specifically comprises the following steps: S21, based on the template feature map width of the template feature map and height of the template feature map A sliding window is set, the size of the sliding window is , the sliding step 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 extracting features at each position. S22, the sliding window traverses the search feature map After that, a first feature vector is extracted , the first feature vector has a dimension of .

Citation Information

Patent Citations

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

    CN114022729A

  • Lane line semantic segmentation method based on self-attention

    CN119888231A

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

    US11417041B2