Normalized cross-correlation NCC rapid calculation method and system based on two-dimensional convolution

By transforming the normalized cross-correlation formula into multiple convolution terms and leveraging the parallel computing characteristics of two-dimensional convolution, the problem of time-consuming normalized cross-correlation calculation is solved, enabling fast template matching and making it suitable for application scenarios with high real-time requirements.

CN121542547APending Publication Date: 2026-02-17TIANJIN JINHANG COMP TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511862644.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

In existing technologies, the normalized cross-correlation calculation process is time-consuming and cannot meet the needs of rapid template matching.

Method used

By constructing a normalized cross-correlation formula based on two-dimensional convolution and transforming it into a combination of multiple convolution terms, the parallel computing characteristics of two-dimensional convolution are utilized for computation, avoiding repeated calculation of the mean and variance, thus achieving fast computation.

Benefits of technology

It significantly reduces the overall computational load and greatly improves the computing speed, enabling it to meet the rapid similarity assessment needs of scenarios with high real-time requirements, such as drone target tracking, industrial online inspection, and autonomous driving environmental perception.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542547A_ABST
    Figure CN121542547A_ABST
Patent Text Reader

Abstract

The invention relates to a normalized cross-correlation NCC rapid calculation method and system based on two-dimensional convolution. The method comprises the following steps: constructing a normalized cross-correlation formula for calculating the similarity between a target image and a source image; performing convolution form transformation on the normalized cross-correlation formula to obtain a normalized convolution item formula comprising a plurality of convolution items; performing convolution operation on the convolution item to obtain a convolution calculation result; and substituting the convolution calculation result into the normalized convolution item formula to obtain a position similarity value of a position on the source image, and converting the normalized cross-correlation formula into a combination form of a plurality of convolution items, so that the problems that the time consumption of the current normalized cross-correlation calculation process is relatively long and the calculation efficiency is low can be solved. And the requirement of fast template matching is difficult to meet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer image processing technology, and in particular to a fast method and system for calculating normalized cross-correlation (NCC) based on two-dimensional convolution. Background Technology

[0002] Template matching achieves precise location of the target image within the source image by quantifying the grayscale similarity of different regions between the "template image" (i.e., the target image to be located) and the "source image" (i.e., the original scene image to be searched). Currently, Normalized Cross Correlation (NCC) is commonly used to calculate the similarity between the target image and the source image. However, the NCC calculation process is time-consuming and cannot meet the needs of rapid template matching. Summary of the Invention

[0003] This application provides a fast method and system for normalized cross-correlation (NCC) calculation based on two-dimensional convolution, which can solve the problem that the current normalized cross-correlation calculation process is time-consuming and cannot meet the needs of rapid template matching.

[0004] Firstly, this application provides a fast method for calculating normalized cross-correlation (NCC) based on two-dimensional convolution, including: Construct a normalized cross-correlation formula for calculating the similarity between the target image and the source image; The normalized cross-correlation formula is transformed into a convolutional form to obtain a normalized convolutional formula that includes multiple convolutional terms. Perform a convolution operation on the convolution terms to obtain the convolution calculation result; Substituting the convolution calculation result into the normalized convolution term formula, the region similarity value of the previous region in the source image is obtained.

[0005] In some embodiments, the normalized cross-correlation formula is: .

[0006] In some embodiments, the formula for the normalized convolution term is: ; Where mn represents the number of pixels in the target image. For window convolution terms, This refers to the pixel mean of the source image in the window. The mean pixel value of the target image. For the sum of squared pixels of the source image in the window, For the sum of squares of the target image pixels, For the squared difference term of the target image, This is the squared difference term for the window image.

[0007] In some embodiments, performing a convolution operation on the convolution terms to obtain a convolution calculation result includes: For the window convolution term Perform convolution operations to obtain the window convolution calculation results; For the pixel mean of the window source image Perform convolution operations to obtain the mean value of the source image in the window; For the target image pixel mean term Perform convolution operations to obtain the mean value of the target image; For the sum of squared pixels of the window source image Perform convolution operations to obtain the sum of squares of the source image in the window; For the target image pixel sum of squares Perform convolution operations to obtain the sum of squares of the target image.

[0008] In some embodiments, the mean pixel value of the window source image Perform convolution operation to obtain the mean of the source image in the window, specifically: Using the pixel mean convolution formula of the window source image Calculate the pixel mean of the source image in the window. The mean value of the source image of the window is calculated. The pixel mean of the target image Perform convolution operations to obtain the mean value of the target image, specifically: Using the pixel mean convolution formula of the target image Calculate the pixel mean of the target image The mean value of the target image is calculated.

[0009] In some embodiments, performing a convolution operation on the convolution terms to obtain a convolution calculation result further includes: Substitute the results of the sum of squares of the window source image and the mean of the window source image into the window image squared difference term. The result of the window squared difference calculation is obtained; Substitute the sum of squares and the mean of the target image into the difference of squares term of the target image. The target squared difference is calculated.

[0010] In some embodiments, substituting the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the previous region in the source image specifically involves: Substituting the target image pixels, the mean of the source image, the mean of the target image, the squared difference of the window, and the squared difference of the target image into the normalized convolution term formula, the region similarity value of the previous region of the source image is obtained. Before performing a convolution operation on the convolution terms to obtain the convolution calculation result, the method further includes: Obtain the number of pixels mn of the target image, where m is the number of pixels in width and n is the number of pixels in height.

[0011] In some embodiments, substituting the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the previous region of the source image further includes: Based on the normalized convolution term formula, the similarity between the target image and other regions in the source image is calculated to obtain the region similarity value of other regions; The position of the target image in the source image is determined based on the magnitude of the region similarity value.

[0012] Secondly, embodiments of this application provide a fast NCC calculation system based on two-dimensional convolution, comprising: The module is used to construct a normalized cross-correlation formula for calculating the similarity between the target image and the source image; The transformation module is used to perform a convolution transformation on the normalized cross-correlation formula to obtain a normalized convolution formula that includes multiple convolution terms. The calculation module is used to perform convolution operations on the convolution terms to obtain the convolution calculation result; and to substitute the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the region above the source image.

[0013] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the fast calculation method for normalized cross-correlation (NCC) based on two-dimensional convolution as described in any one of the first aspects.

[0014] The technical solutions provided in this application have the following advantages compared with the prior art: The present application provides a fast method and system for normalized cross-correlation (NCC) calculation based on two-dimensional convolution. This method constructs a normalized cross-correlation formula for calculating the similarity between a target image and a source image; transforms the normalized cross-correlation formula into a convolutional form, resulting in a normalized convolutional term formula comprising multiple convolutional terms; performs convolution operations on these terms to obtain the convolutional calculation result; and substitutes the convolutional calculation result into the normalized convolutional term formula to obtain the positional similarity value of the previous position in the source image. By transforming the normalized cross-correlation formula into a combination of multiple convolutional terms, the parallel computing characteristics of two-dimensional convolution (e.g., adaptable to hardware acceleration) can be utilized, avoiding redundant operations of repeatedly calculating the mean and variance position by position, significantly reducing the overall computational load. This solves the problem that the current normalized cross-correlation calculation process is time-consuming and cannot meet the requirements for rapid template matching. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0018] Figure 1 A flowchart illustrating a fast method for calculating normalized cross-correlation (NCC) based on two-dimensional convolution, provided in an embodiment of this application; Figure 2 A schematic diagram of a target image and a source image provided in an embodiment of this application; Figure 3 This is a schematic diagram showing a target image sliding on a source image, according to an embodiment of this application. Figure 4 This is a schematic diagram showing the target image at any position on the source image, as provided in an embodiment of this application. Figure 5 This is a schematic diagram of window convolution operation provided in an embodiment of this application; Figure 6 A schematic diagram of the convolution operation of the source image pixel mean and the target image pixel mean provided in an embodiment of this application; Figure 7 A schematic diagram of the convolution operation of the source image pixel sum of squares and the target image pixel sum of squares provided in an embodiment of this application; Figure 8 A schematic diagram of a fast NCC calculation method based on two-dimensional convolution provided in an embodiment of this application; Figure 9 This is a schematic diagram of a fast NCC calculation system based on two-dimensional convolution provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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 some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0021] Template matching is a key technology supporting target relocalization. Its core logic lies in quantifying the similarity between different regions of the target image and the source image. By locating the region in the source image with the highest similarity to the target image, the target's position can be accurately locked. This vision-based technology, with its intuitiveness and practicality, has been widely applied in various fields of production and daily life, such as industrial inspection, intelligent monitoring, and robot navigation. Among many similarity evaluation metrics, Normalized Cross Correlation (NCC) has become a classic choice that combines reliability and robustness because it can effectively suppress interference such as changes in illumination.

[0022] Traditional template matching employs a "sliding window" strategy: using the target image size as a fixed window, it traverses all possible positions in the source image from left to right and from top to bottom, calculating the similarity between the window region and the target image point by point, and finally using the position corresponding to the maximum similarity as the target localization result. However, the calculation of the NCC index requires simultaneous calculation of multiple operations such as image mean, variance, and pixel convolution, resulting in a large amount of redundant computation during the traversal process, significantly increasing the overall time consumption and making it difficult to meet the application requirements of real-time scenarios.

[0023] like Figure 2 , 3 As shown in Figure 4, template matching is the process of finding the location of a target image within a source image. The typical template matching method involves sliding the target image across the source image in a left-to-right, top-to-bottom order, with the sliding window size matching the target image, to calculate the similarity between different locations (or regions). The target image traverses all locations (or regions) in the source image, and the location with the highest similarity value is the target image's position in the source image. A schematic diagram of the target image sliding across the source image is shown below. Figure 3 As shown in the diagram; the target image needs to traverse all positions in the source image. For any position (x, y), the normalized cross-correlation NCC(x, y) value at that position is calculated. The higher the NCC(x, y) value, the higher the similarity. The position corresponding to the highest similarity value is the target position. A schematic diagram of any position is shown below. Figure 4 As shown.

[0024] Firstly, such as Figure 1-8 As shown, to address the aforementioned technical problems, this application provides a fast method for calculating normalized cross-correlation (NCC) based on two-dimensional convolution, including: S101: Construct a normalized cross-correlation formula for calculating the similarity between the target image and the source image; S102: Perform a convolution transformation on the normalized cross-correlation formula to obtain a normalized convolution formula that includes multiple convolution terms; S103: Perform a convolution operation on the convolution terms to obtain the convolution calculation result; S1014: Substitute the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the previous region of the source image.

[0025] It should be noted that traditional NCC calculation requires repeatedly calculating the image mean, variance, and pixel product at each position during the sliding window traversal process. This redundant calculation leads to high computational complexity and significant time consumption, making it difficult to adapt to real-time scenarios. The method provided in this application transforms the normalized cross-correlation formula into a combination of multiple convolution terms, making full use of the parallel computing characteristics of two-dimensional convolution (such as GPU / NPU hardware acceleration). This avoids the invalid operation of repeatedly calculating the mean and variance region by region, transforming the original "point-by-point traversal - repeated calculation" mode into a "convolution parallel operation - result reuse" mode, which greatly reduces the overall computational load. Compared with traditional methods, this method significantly improves the calculation speed and can meet the needs of scenarios with stringent real-time requirements (such as UAV target tracking, industrial online detection, video surveillance target localization, autonomous driving environmental perception, etc.) for rapid similarity assessment.

[0026] It should be noted that the method provided in this application is an equivalent convolutional transformation of the NCC formula. No simplification or approximation is made to the core logic of normalized cross-correlation (such as illumination change suppression, contrast adaptation, and resistance to local noise interference). By decomposing the original formula into multiple fast-computable convolutional terms, the resulting region similarity value is completely consistent with the traditional NCC calculation result, ensuring the accuracy and reliability of similarity assessment. Furthermore, two-dimensional convolution is a mature technology in the field of computer vision, possessing a complete hardware adaptation ecosystem (such as GPUs, NPUs, FPGAs, and dedicated AI chips, all of which can provide efficient convolutional computation support). This method, through convolutional transformation, can directly reuse existing hardware computing resources without the need for additional dedicated computing modules, reducing engineering implementation costs and technical implementation difficulties.

[0027] In some embodiments, the normalized cross-correlation formula is: .

[0028] It should be noted that the normalized cross-correlation formula is obtained by normalizing the mean of the target image (w) and the source image window (f) respectively (subtracting their own mean). , Then, correlation calculation is performed to offset the impact of overall changes in light intensity (such as uniform enhancement / decrease in brightness) or contrast scaling on similarity. Among them, the calculation result of the NCC formula (i.e., the normalized cross-correlation formula) is fixed in the range of [-1, 1]: 1 represents a perfect match, -1 represents a completely negative correlation, and 0 represents no correlation. Based on this standardized result range, the similarity in different locations and different scenes can be directly comparable, which facilitates the rapid determination of the "location corresponding to the maximum similarity" and improves the efficiency and reliability of target positioning.

[0029] In some embodiments, the formula for the normalized convolution term is: ; Where mn represents the number of pixels in the target image. For window convolution terms, This refers to the pixel mean of the source image in the window. The mean pixel value of the target image. For the sum of squared pixels of the source image in the window, For the sum of squares of the target image pixels, For the squared difference term of the target image, This is the squared difference term for the window image.

[0030] It should be noted that the original NCC formula requires repeated calculation of statistics such as the mean and sum of squares window by window, while this convolution term formula decomposes the numerator and denominator of NCC into multiple independent convolution terms (such as window convolution terms). Window source image pixel square sum item These convolutional terms can be performed using two-dimensional convolution, thereby improving computation speed; and each decomposed convolutional term (such as window convolution term, sum of squares term) is an independent basic computation module, which can directly reuse mature convolution acceleration hardware in the field of computer vision (such as GPU, NPU, dedicated convolution chip), without the need to develop additional dedicated computing units, thus reducing the cost of engineering implementation; It should be noted that by using parallel convolutional computation, the convolutional terms of all windows in the entire source image can be calculated at once. Subsequently, the NCC values ​​(i.e., the region similarity values) of all locations can be obtained simply by substituting them into the formula. There is no need to repeatedly calculate the mean and sum of squares for each window, which can significantly reduce the computation time and make NCC suitable for scenarios with high real-time requirements (such as video target tracking and industrial online detection).

[0031] In some embodiments, performing a convolution operation on the convolution terms to obtain a convolution calculation result includes: For the window convolution term Perform convolution operations to obtain the window convolution calculation results; For the pixel mean of the window source image Perform convolution operations to obtain the mean value of the source image in the window; For the target image pixel mean term Perform convolution operations to obtain the mean value of the target image; For the sum of squared pixels of the window source image Perform convolution operations to obtain the sum of squares of the source image in the window; For the target image pixel sum of squares Perform convolution operations to obtain the sum of squares of the target image.

[0032] It should be noted that each convolutional term (e.g.) Figure 5 As shown, window convolution terms The mean term, sum of squares, etc. are all independent two-dimensional convolution operations. With the help of the parallel computing capabilities of hardware such as GPU / NPU, multiple convolution terms can be operated on simultaneously (or in batches according to hardware resources).

[0033] It should be noted that NCC calculations at different locations can share some convolution terms (such as the mean value of the target image pixels). Target image pixel sum of squares It is a fixed value that only needs to be calculated once: that is, the average pixel value of the target image. Target image pixel sum of squares Only one convolution operation needs to be performed on the target image itself, and the result can be directly reused for all subsequent NCC calculations; the mean pixel value of the window source image. The sum of squared pixels of the window source image The results for all windows can be obtained at once through full-image convolution, eliminating the need for repeated statistics at each position (or region), thus significantly reducing redundant calculations.

[0034] It should be noted that, as Figure 7 As shown, the sum of squared pixels of the window source image This represents the sum of the squares of the source image pixels within the (x,y) window, which is equal to the convolution of the squares of the source image pixels within the (x,y) window with a matrix of all 1s. The target image pixel sum of squares term This represents the sum of the squares of the target image pixels, which is equal to the convolution of the squares of the target image pixels with a matrix of all 1s. .

[0035] In some embodiments, the mean pixel value of the window source image Perform convolution operation to obtain the mean of the source image in the window, specifically: Using the pixel mean convolution formula of the window source image Calculate the pixel mean of the source image in the window. The mean value of the source image of the window is calculated. The pixel mean of the target image Perform convolution operations to obtain the mean value of the target image, specifically: Using the pixel mean convolution formula of the target image Calculate the pixel mean of the target image The mean value of the target image is calculated.

[0036] It should be noted that, as Figure 6As shown, the mean pixel value of the source image in the (x,y) window. The formula for the pixel mean convolution of the (x,y) window source image with a matrix of all 1s, divided by the number of pixels, is the same as the convolution formula for the pixel mean of the window source image. Target image pixel mean The formula for the pixel mean convolution of the target image is equal to the convolution of the target image with a matrix of all ones, divided by the number of pixels. .

[0037] In some embodiments, performing a convolution operation on the convolution terms to obtain a convolution calculation result further includes: Substitute the results of the sum of squares of the window source image and the mean of the window source image into the window image squared difference term. The result of the window squared difference calculation is obtained; Substitute the sum of squares and the mean of the target image into the difference of squares term of the target image. The target squared difference is calculated.

[0038] It should be noted that the formula for the window image squared difference term is "window source image squared sum term - The target image squared difference term is the target image squared sum term. ": Among them, "source image sum of squares" and "target image sum of squares" are the results of previously completed convolution terms. " "This is the result of the pre-calculated mean term (calculated)" , You can get the corresponding result. , By simply substituting the existing convolution calculation results into the formula, the squared difference term can be obtained. There is no need to perform a new convolution operation on the squared difference term separately, which completely avoids redundant calculations and further reduces the overall computational load.

[0039] In some embodiments, substituting the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the previous region in the source image specifically involves: Substituting the target image pixels, the mean of the source image, the mean of the target image, the squared difference of the window, and the squared difference of the target image into the normalized convolution term formula, the region similarity value of the previous region of the source image is obtained. Before performing a convolution operation on the convolution terms to obtain the convolution calculation result, the method further includes: Obtain the number of pixels mn of the target image, where m is the number of pixels in width and n is the number of pixels in height.

[0040] It should be noted that before the convolution operation, the width (m) and height (n) of the target image are determined first, and the number of pixels in the target image (mn) is obtained. This avoids redundancy, as mn is the result of subsequent operations in multiple modules (division of the mean term, division of the squared difference term, etc.). The shared parameters of mn (etc.) can be obtained in advance and can be calculated once and reused throughout the process, without the need to repeatedly count the target image size in each module; on the other hand, it can reduce errors: the precise value of mn is determined in advance (instead of being temporarily counted during calculation), which can avoid the deviation in the calculation of mean and square difference caused by size statistics errors, and ensure the consistency of parameters in all subsequent modules.

[0041] In some embodiments, substituting the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the previous region of the source image further includes: Based on the normalized convolution term formula, the similarity between the target image and other regions in the source image is calculated to obtain the region similarity value of other regions; The position of the target image in the source image is determined based on the magnitude of the region similarity value.

[0042] It should be noted that by "traversing and calculating the similarity of all regions (or windows) of the source image", it can cover all regions in the source image that may contain the target image. Combined with the logic of "locating according to the size of the similarity value", it can accurately find the region with the highest matching degree with the target image, making the previous fast calculation process a usable location result.

[0043] It should be noted that in the formula for the normalized convolution term... , m, n and It is a constant value, which is fixed in any window and can be calculated in advance before feature matching. All other variables can be calculated by sliding convolution to obtain the feature map. The NCC matrix result can be obtained by combining the feature map with the constant value. It represents the NCC value of any (x,y) window. The position of the maximum NCC value is used as the position of the target image on the source image.

[0044] It should be noted that when processing images with large pixel counts, the NCC similarity calculation process is very time-consuming. In this embodiment, the calculation is split into convolution operations, which can be accelerated using NPU and GPU chips, greatly improving the efficiency of NCC feature matching.

[0045] Secondly, such as Figure 9 As shown, this application provides a fast NCC calculation system based on two-dimensional convolution, comprising: Module 10 is used to construct a normalized cross-correlation formula for calculating the similarity between the target image and the source image; Transformation module 20 is used to perform a convolution transformation on the normalized cross-correlation formula to obtain a normalized convolution formula that includes multiple convolution terms. The calculation module 30 is used to perform convolution operation on the convolution term to obtain the convolution calculation result; and to substitute the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the region above the source image.

[0046] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the fast calculation method for normalized cross-correlation (NCC) based on two-dimensional convolution as described in any one of the first aspects.

[0047] The device / system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0048] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0049] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also mean including the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a specific order described or illustrated unless the order of execution is explicitly indicated. It should also be understood that additional or alternative steps may be used. The above description is merely a specific embodiment of the invention to enable those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A normalized cross correlation (NCC) fast calculation method based on two-dimensional convolution, characterized in that, include: Construct a normalized cross-correlation formula for calculating the similarity between the target image and the source image; The normalized cross-correlation formula is transformed into a convolutional form to obtain a normalized convolutional formula that includes multiple convolutional terms. Perform a convolution operation on the convolution terms to obtain the convolution calculation result; Substituting the convolution calculation result into the normalized convolution term formula, the region similarity value of the previous region in the source image is obtained.

2. The two-dimensional convolution-based normalized cross correlation (NCC) fast computation method according to claim 1, wherein, The normalized cross-correlation formula is: 。 3. The two-dimensional convolution-based normalized cross correlation (NCC) fast computation method of claim 1, wherein, The formula for the normalized convolution term is: ; wherein mn is the target image pixel, is the windowed convolution term, is the windowed source image pixel mean term, is the target image pixel mean term, is the windowed source image pixel sum of squares term, is the target image pixel sum of squares term, is the target image squared difference term, is the windowed image squared difference term.

4. The fast calculation method for normalized cross-correlation NCC based on two-dimensional convolution according to claim 3, characterized in that, The step of performing a convolution operation on the convolution terms to obtain the convolution calculation result includes: For the window convolution term Perform convolution operations to obtain the window convolution calculation results; For the pixel mean of the window source image Perform convolution operations to obtain the mean value of the source image in the window; For the target image pixel mean term Perform convolution operations to obtain the mean value of the target image; For the sum of squared pixels of the window source image Perform convolution operations to obtain the sum of squares of the source image in the window; For the target image pixel sum of squares Perform convolution operations to obtain the sum of squares of the target image.

5. The fast calculation method for normalized cross-correlation NCC based on two-dimensional convolution according to claim 4, characterized in that, The pixel mean of the window source image Perform convolution operation to obtain the mean of the source image in the window, specifically: Using the pixel mean convolution formula of the window source image Calculate the pixel mean of the source image in the window. The mean value of the source image of the window is calculated. The pixel mean of the target image Perform convolution operation to obtain the mean value of the target image, specifically: Using the pixel mean convolution formula of the target image Calculate the pixel mean of the target image The mean value of the target image is calculated.

6. The fast calculation method for normalized cross-correlation NCC based on two-dimensional convolution according to claim 4, characterized in that, The step of performing a convolution operation on the convolution terms to obtain the convolution calculation result further includes: Substitute the sum of squares and the mean of the window source image into the window image squared difference term. The result of the window squared difference calculation is obtained; Substitute the sum of squares and the mean of the target image into the difference of squares term of the target image. The target squared difference is calculated.

7. The fast calculation method for normalized cross-correlation NCC based on two-dimensional convolution according to claim 6, characterized in that, The step of substituting the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the previous region in the source image is specifically as follows: Substituting the target image pixels, the mean of the source image, the mean of the target image, the squared difference of the window, and the squared difference of the target image into the normalized convolution term formula, the region similarity value of the previous region of the source image is obtained. Before performing a convolution operation on the convolution terms to obtain the convolution calculation result, the method further includes: Obtain the number of pixels mn of the target image, where m is the number of pixels in width and n is the number of pixels in height.

8. The fast calculation method for normalized cross-correlation NCC based on two-dimensional convolution according to any one of claims 1-7, characterized in that, The step of substituting the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the previous region in the source image further includes: Based on the normalized convolution term formula, the similarity between the target image and other regions in the source image is calculated to obtain the region similarity value of other regions; The position of the target image in the source image is determined based on the magnitude of the region similarity value.

9. A fast NCC calculation system based on normalized cross-correlation using two-dimensional convolution, characterized in that, The method for fast calculation of normalized cross-correlation NCC based on two-dimensional convolution, as described in any one of claims 1-8, includes: The module is used to construct a normalized cross-correlation formula for calculating the similarity between the target image and the source image; The transformation module is used to perform a convolution transformation on the normalized cross-correlation formula to obtain a normalized convolution formula that includes multiple convolution terms. The calculation module is used to perform convolution operations on the convolution terms to obtain the convolution calculation result; and to substitute the convolution calculation result into the normalized convolution term formula to obtain the region similarity value of the region above the source image.

10. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the fast calculation method for normalized cross-correlation NCC based on two-dimensional convolution as described in any one of claims 1-8.