Template attitude feature construction method and system and computer readable storage medium
By constructing a multi-resolution pyramid and an adaptive rotation compensation mechanism in image matching, the rotation-scaling coupling bias problem is solved, improving matching accuracy and efficiency, and enabling real-time pose estimation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies suffer from rotation-scaling coupling bias in image matching and pose estimation, resulting in low matching accuracy and difficulty in balancing efficiency and accuracy. The computational cost of constructing multi-pose templates is high, and existing methods cannot meet the needs of real-time applications.
A multi-resolution pyramid construction method based on template images is adopted. By downsampling layer by layer and calculating the initial orientation encoding value of feature points, combined with parameter combinations within the preset attitude parameter range, the orientation deviation correction is calculated, and geometric transformation is performed to generate a multi-attitude feature model. Adaptive rotation compensation and neighborhood voting optimization mechanism are used to eliminate interpolation errors and improve matching accuracy.
It significantly reduces azimuth deviation, shortens feature construction time from seconds to milliseconds, improves matching stability and accuracy, and meets the needs of real-time applications.
Smart Images

Figure CN121767413A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision and image matching technology, and in particular to a method, system and computer-readable storage medium for constructing template pose features. Background Technology
[0002] In image matching and pose estimation tasks, the template and the target object may undergo pose changes such as rotation, scaling, and translation. Existing matching techniques mainly include template matching based on normalized cross-correlation (NCC), histogram of oriented gradients (HOG), or scale-invariant feature transform (SIFT).
[0003] However, existing technologies face the following technical challenges: First, the rotation-scaling coupling bias problem severely affects matching accuracy. Traditional methods, such as linear interpolation pyramids, suffer from significant systematic deviations in feature azimuth angles when recalculating the azimuth code after rotation due to the nonlinear relationship between interpolation operations and spatial transformation, which severely reduces matching accuracy.
[0004] Secondly, there is an irreconcilable contradiction between efficiency and accuracy. The method of directly generating multi-pose images and then extracting features consumes a lot of time, for example, it takes about 8.28 seconds to extract one pose, which cannot meet the requirements of real-time applications; while the approximate calculation method can improve speed, it will further aggravate the orientation deviation.
[0005] Furthermore, existing multi-angle template matching methods require the pre-generation of templates with multiple rotation angles for matching one by one, resulting in huge computational load and poor real-time performance. Methods based on feature orientation alignment perform rotation correction by detecting the main orientation of key points, but are prone to orientation estimation errors for targets with weak or repetitive textures. Frequency domain-based methods, such as Fourier-Merlin transform, can achieve rotation-invariant matching, but have limited ability to preserve local features.
[0006] Therefore, there is an urgent need for a method that can automatically compensate for rotation and construct stable attitude features without significantly increasing the computational load, so as to improve matching accuracy and robustness. Summary of the Invention
[0007] The purpose of this invention is to provide a template pose feature construction method, system, and computer-readable storage medium to solve the problems of azimuth systematic error caused by linear interpolation, low efficiency of multi-pose template construction, and insufficient matching accuracy in the prior art.
[0008] To achieve this objective, the present invention adopts the following technical solution: In a first aspect, the present invention provides a template pose feature construction method, which includes the following steps: S1. Construct an image pyramid with multiple resolution levels based on a template image, wherein the resolution of the first layer image is equal to the original resolution of the template image, and the resolutions of the second to Lth layers decrease sequentially. The i-th layer image is downsampled layer by layer to obtain the (i+1)-th layer image, where L is the total number of layers in the image pyramid, and i... <L; S2. Extract the feature points of the first layer image and calculate the initial orientation code value for each feature point; S3. For each parameter combination within the preset attitude parameter range, calculate the azimuth deviation correction amount used to eliminate interpolation error, combine the initial azimuth code value, rotation angle and the azimuth deviation correction amount into a compensated azimuth code value, and perform geometric transformation on the feature point coordinates according to the parameter combination, wherein the parameter combination includes rotation angle and scale factor. S4. Generate a multi-pose feature model based on the transformed coordinates and the compensated orientation code value.
[0009] Preferably, step S1, which involves downsampling the i-th layer image layer by layer to obtain the (i+1)-th layer image, specifically includes: The image of layer i is downsampled layer by layer using a linear interpolation method to obtain the image of layer i+1. The resolution of the image of layer i+1 is half that of the image of layer i.
[0010] Preferably, the azimuth deviation correction Δθ is calculated using the compensation function f(m,s). , where m∈[1,L], m is the pyramid level index, s is the scaling factor, and f is the predefined compensation function.
[0011] Specifically, the expression for the compensation function f(m,s) is as follows: , where k(m) is the hierarchical correlation coefficient and k(m) = k0 + k1·m, a is the scaling parameter, and b is the baseline bias.
[0012] Preferably, a hierarchical adaptive enhancement is applied to the azimuth deviation correction, and the enhanced correction Δθ applied for Where Δθ is the basic correction, m is the pyramid level index, and γ is the enhancement coefficient.
[0013] Preferably, in step S3, calculating the azimuth deviation correction amount used to eliminate interpolation errors specifically includes: The orientation deviation correction amount is obtained by querying a pre-built three-dimensional data table, which includes a hierarchical index, a quantized scale value, and a quantized rotation angle. The hierarchical index, the quantized scale value, and the quantized rotation angle together constitute the index dimension.
[0014] Specifically, the three-dimensional data table is constructed through offline learning via the following steps: Perform feature extraction on the standard test set under different levels, scales, and rotation parameter combinations; The deviation between the statistical theoretical orientation value and the actual measured value; Store the deviation value in the corresponding table entry.
[0015] Preferably, in step S3, performing a geometric transformation on the feature point coordinates based on the parameter combination specifically includes: Based on the parameter combination, the feature point coordinates are subjected to the following rotation and scaling transformation: , , Where (x,y) are the original coordinates of the feature point in the first layer image, (x',y') are the transformed coordinates, s is the scale factor in the parameter combination, and α is the rotation angle in the parameter combination.
[0016] Preferably, step S2 includes: S21. Extract the feature points of the first layer image; S22. By calculating the main direction of the gradient histogram in the neighborhood of each feature point, the initial orientation code value corresponding to each feature point is obtained, wherein the value range of the local gradient direction corresponding to any feature point is [0°, 360°).
[0017] Preferably, after generating the compensated azimuth code value, the process further includes: Within an N×N pixel window of a feature point, the directional distribution of adjacent points is statistically analyzed, where N is an odd number. The azimuth interval with the highest frequency was selected as the optimized azimuth code.
[0018] Specifically, the step of statistically analyzing the directional distribution of adjacent points within an N×N pixel window of the feature point includes: Divide the [0°, 360°) region into M uniform intervals, each interval spanning 360° / M.
[0019] Preferably, step S21 specifically includes: S211. Calculate the gradient magnitude map of the first layer image; S212. Detect the local maxima of the gradient in the gradient magnitude map; S213. Select the K local maxima of gradient with the largest magnitude as feature points, where K is a preset value.
[0020] Specifically, the detection of local maxima of the gradient is restricted to a predefined effective region, which is obtained through the following steps: Extract the outline of the foreground object from the template image; The foreground object outline is morphologically processed to obtain a binary mask; The region marked as 1 by the binary mask is taken as the effective detection region.
[0021] Preferably, the multi-pose feature model adopts a unified coordinate representation, and the multi-pose feature model includes the normalized position of the feature point in the circumscribed rectangular coordinate system, the compensated 8-bit quantized orientation code, the binarized flag of the gradient magnitude, and the relative offset vector from the model center to the feature point.
[0022] In a second aspect, the present invention provides a template pose feature construction system, comprising: The pyramid construction module is used to construct an image pyramid with multiple resolution levels based on a template image. The resolution of the first layer image is equal to the original resolution of the template image. The resolutions of the second to Lth layers decrease sequentially. The i-th layer image is downsampled layer by layer to obtain the (i+1)-th layer image. Here, L is the total number of layers in the image pyramid, and i... <L; The feature extraction module is used to extract feature points from the first layer image and calculate the initial orientation code value for each feature point; The compensation processing module is used to calculate the azimuth deviation correction amount for eliminating interpolation error for each parameter combination within a preset attitude parameter range, combine the initial azimuth code value, rotation angle and the azimuth deviation correction amount into a compensated azimuth code value, and perform geometric transformation on the feature point coordinates according to the parameter combination, wherein the parameter combination includes rotation angle and scale factor. The model generation module is used to generate a multi-pose feature model based on the transformed coordinates and the compensated orientation encoding values.
[0023] Preferably, the compensation processing module includes: The function calculation unit is used to calculate the azimuth deviation correction in real time using the compensation function f(m,s); The lookup unit is used to retrieve the azimuth deviation correction from a pre-stored 3D data table; Enhancement unit, used to apply a hierarchical enhancement factor to the base correction amount; The table lookup unit is executed first, and the function calculation unit is executed when the table lookup fails.
[0024] Preferably, the template pose feature construction system further includes an optimization processing module for performing spatial consistency optimization of orientation coding through a neighborhood voting mechanism.
[0025] Thirdly, the present invention provides a computer-readable storage medium storing program code and compensation data, wherein the program code, when executed by a processor, implements the template pose feature construction method as described above, and the compensation data is an index structure that supports constant-time access.
[0026] Compared with the prior art, the present invention has the following beneficial effects: This invention, on the one hand, effectively eliminates the systematic bias introduced by linear interpolation by introducing an adaptive rotation compensation mechanism, significantly reducing azimuth angle deviation; on the other hand, by pre-constructing an error compensation data table and adopting a query mechanism with constant time complexity, it shortens the feature construction time of a single pose from the second level to the millisecond level; furthermore, through a neighborhood azimuth voting optimization mechanism, it effectively reduces the position offset error of feature points and improves the stability of matching.
[0027] The present invention has other features and advantages, which will be apparent from or will be set forth in detail in the accompanying drawings and the following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description
[0028] 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, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a flowchart of the template pose feature construction method provided in Embodiment 1 of the present invention.
[0030] Figure 2 This is a schematic diagram of neighborhood voting in Embodiment 1 of the present invention.
[0031] Figure 3 This is an example of a matching result from one embodiment of the present invention.
[0032] Figure 4 This is yet another example of a matching result in Embodiment 1 of the present invention.
[0033] Figure 5 This is a structural block diagram of the template pose feature construction system provided in Embodiment 1 of the present invention. Detailed Implementation
[0034] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.
[0035] Example 1 Reference Figures 1-4 The template pose feature construction method in this embodiment is based on adaptive rotation compensation and is suitable for applications such as target detection, pose estimation, and industrial vision inspection. The template pose feature construction method includes the following steps: S1. Construct an image pyramid containing multiple resolution levels based on template images.
[0036] Construct an L-layer image pyramid. The resolution of the first layer image is equal to the original resolution of the template image, and the resolution of the second to Lth layers decreases sequentially. The i-th layer image is downsampled layer by layer to obtain the (i+1)-th layer image, where L is the total number of layers in the image pyramid. The images in this L-layer image pyramid, from bottom to top, are numbered 1, 2, ..., i, ..., L, where i and L are natural numbers, and i... <L,。
[0037] Specifically, a linear interpolation method is used for downsampling. The pixel value of each layer (i+1) is calculated by weighted averaging of the neighboring pixels of the layer (i). The resolution of the layer (i+1) is half that of the layer (i). For example, for a 1024×1024 original image, layer 1 is 1024×1024, layer 2 is 512×512, layer 3 is 256×256, and so on.
[0038] It should be noted that while linear interpolation downsampling is computationally efficient, it introduces a systematic azimuth angle deviation. According to experimental measurements, this deviation can reach 4.7° under different parameter combinations. Relying solely on linear interpolation downsampling will severely affect the matching accuracy. The subsequent steps in this embodiment will address this newly introduced systematic azimuth angle deviation.
[0039] S2. Extract the feature points of the first layer image and calculate the initial orientation code value for each feature point.
[0040] Specifically, this step includes: S21. Extract feature points from the first layer image. The specific process is as follows: S211. Calculate the gradient magnitude map of the first layer image. Use the gradient operator to calculate the gradient components in the horizontal and vertical directions, and then obtain the gradient magnitude.
[0041] S212. Detect local maxima of the gradient magnitude map. Perform non-maximum suppression in the local neighborhood of each pixel, and mark points with gradient magnitudes greater than other pixels in the neighborhood as local maxima.
[0042] S213. Select the K local maxima points of the gradient with the largest amplitude as feature points, where K is a preset value. In practice, the value of K needs to be adjusted according to the image complexity; the typical range of K is 100-1000. The larger the value of K, the more feature points there are, and the greater the computational load. It can be understood that here k represents the number of selected local maxima points, for example, 8. Each point has a direction, and the optimal direction is determined through voting.
[0043] Preferably, the detection of local maxima of the gradient is restricted to a predefined effective region to avoid extracting invalid features in the background region and greatly reduce the computational load. Specifically, the foreground object contour is extracted from the template image, and morphological processing is performed on the foreground object contour to obtain a binary mask. The region marked as 1 in the binary mask is taken as the effective detection region.
[0044] S22. By calculating the main direction of the gradient histogram in the neighborhood of each feature point, the initial azimuth encoding value corresponding to each feature point is obtained. The gradient direction distribution is statistically analyzed in the neighborhood window around the feature point to construct an orientation histogram. The direction with the highest frequency is selected as the initial azimuth encoding value of the point, with a value range of [0°, 360°).
[0045] S3. Perform compensation processing and geometric transformation for each parameter combination within the preset attitude parameter range.
[0046] Specifically, the preset pose parameter range generally includes multiple parameter combinations, and different parameter combinations are suitable for template images of different types and parameters. Each parameter combination should include a rotation angle and a scale factor. The following processing is performed on each parameter combination: First, the azimuth deviation correction Δθ used to eliminate interpolation errors is calculated. This embodiment provides two methods for calculating the azimuth deviation correction Δθ used to eliminate interpolation errors, as follows: Method 1: Calculated using the compensation function f(m,s). Where m∈[1,L] is the pyramid level index, and s is the scale factor. The expression for the compensation function f(m,s) is: , Wherein, k(m) is the hierarchical correlation coefficient and k(m) = k0 + k1·m, with typical parameter values of k0 = 0.1 and k1 = 0.1, a is the scaling parameter, with a typical value of 0.35, and b is the baseline bias, with a typical value of 0.2.
[0047] Method 2: Obtain the azimuth deviation correction Δθ used to eliminate interpolation errors by querying a pre-built 3D data table. Specifically, this 3D data table includes hierarchical indexes, quantized scale values, and quantized rotation angles as index dimensions. The query can be performed using either direct or indirect index queries.
[0048] Furthermore, this three-dimensional data table can be obtained through pre-built offline learning. The specific offline learning construction steps are as follows: Perform feature extraction on the standard test set under different levels, scales, and rotation parameter combinations; The deviation between the statistical theoretical orientation value and the actual measured value; Store the deviation value in the corresponding table entry.
[0049] Secondly, to further improve processing accuracy, this embodiment further applies hierarchical adaptive enhancement to the orientation deviation correction amount to obtain the enhanced correction amount Δθ. applied The expression is: Where γ is the enhancement coefficient, typically taking a value of 0.1. This hierarchical adaptive enhancement method enables higher-level images to receive stronger compensation, effectively addressing the problem of error accumulation and thus improving processing accuracy.
[0050] Then, calculate the compensated azimuth code value θ. final The calculation method is as follows: θ final =(θ initial +α+Δθ applied mod360°, Where, θ initial Here is the initial azimuth code value, α is the rotation angle, and Δθ is the initial azimuth code value. applied This is the amount of correction after applying the hierarchical enhancement.
[0051] Finally, a geometric transformation is performed on the feature point coordinates based on the parameter combination: , , Where (x,y) are the original coordinates of the feature point in the first layer image, (x',y') are the transformed coordinates, s is the scale factor in the parameter combination, and α is the rotation angle in the parameter combination.
[0052] Preferably, after generating the compensated azimuth code value, a neighborhood consistency optimization process is further performed, specifically as follows: Within an N×N pixel window of a feature point, the directional distribution of adjacent points is statistically analyzed, where N is an odd number, typically 3. Divide the area [0°, 360°) into M uniform intervals, each interval spanning 360° / M, where M is a power of 2, such as M equals 8; The azimuth interval with the highest frequency was selected as the optimized azimuth code.
[0053] It is understandable that neighborhood consistency optimization is essentially neighborhood orientation voting, which uses the orientation with the highest frequency as the final orientation, thereby suppressing the offset caused by noise.
[0054] S4. Generate a multi-pose feature model based on the transformed coordinates and the compensated orientation code values.
[0055] Specifically, the multi-pose feature model adopts a unified coordinate representation, which includes: the normalized position of the feature point in the circumscribed rectangular coordinate system; the compensated 8-bit (or power of 2 bits as needed) quantized orientation code, quantizing 360° into 256 levels (adaptive adjustment is required if the quantized orientation code is of other powers); the binarized flag of the gradient magnitude; and the relative offset vector from the model center to the feature point.
[0056] The method described in this embodiment can achieve a single attitude feature model generation time in the millisecond range, a significant reduction in azimuth deviation, a substantial reduction in position offset error, and a high matching accuracy across the entire attitude range.
[0057] This invention effectively eliminates the systematic bias introduced by linear interpolation through an adaptive rotation compensation mechanism, ensures the efficiency and integrity of the system through a dual-mode design of pre-built data tables and real-time compensation functions, and further improves the stability of features through neighborhood voting optimization. It has important application value in fields such as industrial visual inspection.
[0058] Example 2 Please see Figure 5 The template pose feature construction system in this embodiment includes: The pyramid construction module 10 is used to construct an image pyramid containing multiple resolution levels based on a template image. The resolution of the first layer image is equal to the original resolution of the template image, and the resolutions of the second to Lth layers decrease sequentially. The i-th layer image is downsampled layer by layer to obtain the i+1-th layer image.
[0059] The feature extraction module 20 is used to extract feature points from the first layer image and calculate the initial orientation code value for each feature point.
[0060] The compensation processing module 30 is used to calculate the azimuth deviation correction amount for eliminating interpolation errors for each parameter combination within the preset attitude parameter range, combine the initial azimuth code value, rotation angle and azimuth deviation correction amount into the compensated azimuth code value, and perform geometric transformation on the feature point coordinates according to the parameter combination.
[0061] The model generation module 40 is used to generate a multi-pose feature model based on the transformed coordinates and the compensated orientation code values.
[0062] Specifically, the compensation processing module 30 includes: The function calculation unit is used to calculate the azimuth deviation correction in real time using the compensation function f(m,s); The lookup unit is used to retrieve the azimuth deviation correction from a pre-stored 3D data table; The enhancement unit is used to apply a hierarchical enhancement factor of (1+γ×m) to the basic correction amount. The table lookup unit is executed first, and the function calculation unit is executed when the parameter combination being queried is not within the pre-stored range.
[0063] Preferably, the template pose feature construction system further includes an optimization processing module, which is used to optimize the consistency of the orientation encoding space through a neighborhood voting method.
[0064] Example 3 The computer-readable storage medium of this embodiment stores program code and compensation data. When the program code is executed by a processor, it implements the template pose feature construction method described above. The compensation data is organized into an index structure that supports constant-time access and uses a direct address mapping method to achieve fast lookup.
[0065] Combination Figures 1-5 The present invention has the following beneficial effects: This invention, on the one hand, effectively eliminates the systematic bias introduced by linear interpolation by introducing an adaptive rotation compensation mechanism, significantly reducing azimuth angle deviation; on the other hand, by pre-constructing an error compensation data table and adopting a query mechanism with constant time complexity, it shortens the feature construction time of a single pose from the second level to the millisecond level; furthermore, through a neighborhood azimuth voting optimization mechanism, it effectively reduces the position offset error of feature points and improves the stability of matching.
[0066] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing template pose features, characterized in that, Includes the following steps: An image pyramid with multiple resolution levels is constructed based on a template image. The resolution of the first layer image is equal to the original resolution of the template image. The resolutions of the second to Lth layers decrease sequentially. The i-th layer image is downsampled layer by layer to obtain the (i+1)-th layer image. Here, L is the total number of layers in the image pyramid, and i... <L; Extract feature points from the first layer image and calculate the initial orientation code value for each feature point; For each parameter combination within the preset attitude parameter range, calculate the azimuth deviation correction amount to eliminate interpolation error, combine the initial azimuth code value, rotation angle and the azimuth deviation correction amount into a compensated azimuth code value, and perform a geometric transformation on the feature point coordinates according to the parameter combination, which includes rotation angle and scale factor; A multi-pose feature model is generated based on the transformed coordinates and the compensated orientation code value.
2. The template pose feature construction method as described in claim 1, characterized in that, The step of downsampling the i-th layer image to obtain the (i+1)-th layer image specifically includes: The image of layer i is downsampled layer by layer using a linear interpolation method to obtain the image of layer i+1. The resolution of the image of layer i+1 is half that of the image of layer i.
3. The template pose feature construction method as described in claim 1, characterized in that, The azimuth deviation correction Δθ is calculated using the compensation function f(m,s). , where m∈[1,L], m is the pyramid level index, s is the scaling factor, and f is the predefined compensation function.
4. The method as described in claim 3, characterized in that, The expression for the compensation function f(m,s) is as follows: , where k(m) is the hierarchical correlation coefficient and k(m) = k0 + k1·m, a is the scaling parameter, and b is the baseline bias.
5. The template pose feature construction method as described in claim 3, characterized in that, A hierarchical adaptive enhancement is applied to the azimuth deviation correction, and the enhanced correction amount Δθ applied for Where Δθ is the basic correction, m is the pyramid level index, and γ is the enhancement coefficient.
6. The template pose feature construction method as described in claim 1, characterized in that, The calculation of the azimuth deviation correction amount used to eliminate interpolation errors specifically includes: The orientation deviation correction amount is obtained by querying a pre-built three-dimensional data table, which includes a hierarchical index, a quantized scale value, and a quantized rotation angle. The hierarchical index, the quantized scale value, and the quantized rotation angle together constitute the index dimension.
7. The template pose feature construction method as described in claim 6, characterized in that, The three-dimensional data table is constructed through offline learning using the following steps: Perform feature extraction on the standard test set under different levels, scales, and rotation parameter combinations; The deviation between the statistical theoretical orientation value and the actual measured value; Store the deviation value in the corresponding table entry.
8. The template pose feature construction method as described in claim 1, characterized in that, The geometric transformation of the feature point coordinates based on the parameter combination specifically includes: Based on the parameter combination, the feature point coordinates are subjected to the following rotation and scaling transformation: , , Where (x,y) are the original coordinates of the feature point in the first layer image, and (x',y') are the transformed coordinates. s is the scale factor in the parameter combination, and α is the rotation angle in the parameter combination.
9. The template pose feature construction method as described in claim 1, characterized in that, The step of extracting feature points from the first layer image and calculating the initial orientation code value for each feature point specifically includes: Extract feature points from the first layer image; The initial orientation code value corresponding to each feature point is obtained by calculating the main direction of the gradient histogram in the neighborhood of each feature point, wherein the value range of the local gradient direction corresponding to any feature point is [0°, 360°).
10. The template pose feature construction method as described in claim 1, characterized in that, After generating the compensated azimuth code value, the process further includes: Within an N×N pixel window of a feature point, the directional distribution of adjacent points is statistically analyzed, where N is an odd number. The azimuth interval with the highest frequency was selected as the optimized azimuth code.
11. The template pose feature construction method as described in claim 10, characterized in that, The step of statistically analyzing the azimuth distribution of adjacent points within an N×N pixel window of the feature points specifically includes: Divide the [0°, 360°) region into M uniform intervals, each interval spanning 360° / M.
12. The template pose feature construction method as described in claim 1, characterized in that, The extraction of feature points from the first layer image specifically includes: Calculate the gradient magnitude map of the first layer image; Detect the local maxima of the gradient in the gradient magnitude map; Select the K local maxima of the gradient with the largest magnitude as feature points, where K is a preset value.
13. The template pose feature construction method as described in claim 12, characterized in that, The detection of local maxima of the gradient is restricted to a predefined effective region, which is obtained through the following steps: Extract the outline of the foreground object from the template image; The foreground object outline is morphologically processed to obtain a binary mask; The region marked as 1 by the binary mask is taken as the effective detection region.
14. The template pose feature construction method as described in claim 1, characterized in that, The multi-pose feature model adopts a unified coordinate representation. The multi-pose feature model includes the normalized position of the feature point in the circumscribed rectangular coordinate system, the compensated 8-bit quantized orientation code, the binarized flag of the gradient magnitude, and the relative offset vector from the model center to the feature point.
15. A template pose feature construction system, characterized in that, include: The pyramid construction module is used to construct an image pyramid with multiple resolution levels based on a template image. The resolution of the first layer image is equal to the original resolution of the template image. The resolutions of the second to Lth layers decrease sequentially. The i-th layer image is downsampled layer by layer to obtain the (i+1)-th layer image. Here, L is the total number of layers in the image pyramid, and i... <L; The feature extraction module is used to extract feature points from the first layer image and calculate the initial orientation code value for each feature point; The compensation processing module is used to calculate the azimuth deviation correction amount for eliminating interpolation error for each parameter combination within a preset attitude parameter range, combine the initial azimuth code value, rotation angle and the azimuth deviation correction amount into a compensated azimuth code value, and perform geometric transformation on the feature point coordinates according to the parameter combination, wherein the parameter combination includes rotation angle and scale factor. The model generation module is used to generate a multi-pose feature model based on the transformed coordinates and the compensated orientation encoding values.
16. The template pose feature construction system as described in claim 15, characterized in that, The compensation processing module includes: The function calculation unit is used to calculate the azimuth deviation correction in real time using the compensation function f(m,s); The lookup unit is used to retrieve the azimuth deviation correction from a pre-stored 3D data table; Enhancement unit, used to apply the basic correction amount Hierarchical enhancement factor; The table lookup unit is executed first, and the function calculation unit is executed when the table lookup fails.
17. The template pose feature construction system as described in claim 15, characterized in that, It also includes an optimization processing module, which performs spatial consistency optimization of orientation coding through a neighborhood voting mechanism.
18. A computer-readable storage medium, characterized in that, The system stores program code and compensation data. When the program code is executed by a processor, it implements the template pose feature construction method according to any one of claims 1 to 14. The compensation data is an index structure that supports constant-time access.