High-robustness visual positioning method based on fuzzy template set and fuzzy invariant features

By constructing a fuzzy template set and using gradient direction quantization histogram features, a visual localization method was developed, which solved the problems of localization accuracy and robustness in defocused and blurred images. This method achieves high-precision and real-time localization results and is suitable for complex industrial environments.

CN122199660APending Publication Date: 2026-06-12HANGZHOU HUICUI INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU HUICUI INTELLIGENT TECH CO LTD
Filing Date
2026-01-20
Publication Date
2026-06-12

Smart Images

  • Figure CN122199660A_ABST
    Figure CN122199660A_ABST
Patent Text Reader

Abstract

The application discloses a high-robustness visual positioning method based on fuzzy template set and fuzzy invariant features, comprising the following steps: S10, offline template preparation; S20, online positioning; wherein, S10, offline template preparation, comprising the following steps: S11, clear template acquisition and ROI definition; S12, fuzzy kernel estimation and fuzzy template set generation; S13, fuzzy invariant feature extraction; S20, online positioning, comprising the following steps S21, multi-resolution pyramid search; S22, parallel correlation matching based on hybrid similarity measure; S23, optimal template and coarse positioning point determination; S24, pyramid refinement and sub-pixel positioning. The application significantly improves the positioning success rate and precision under the out-of-focus blur condition; maintains the robustness to illumination change, partial occlusion and background interference; realizes the sub-pixel level positioning precision; guarantees the calculation efficiency of the algorithm, and meets the real-time requirement of industrial online detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of machine vision positioning technology, and relates to a highly robust visual positioning method based on fuzzy template sets and fuzzy invariant features. Background Technology

[0002] In the field of industrial automation, machine vision positioning is a core technology for guiding robots to perform operations such as grasping, assembly, and welding. Its basic principle is to acquire images of the target object using a camera, and then calculate the target's precise position in the camera coordinate system using image processing algorithms. However, in actual industrial settings, due to factors such as mechanical vibration, fluctuations in the workpiece's position, depth-of-field limitations, or thermal deformation, the camera is not always in optimal focus. This defocus blur leads to degradation of image edges and texture details, posing a significant challenge to traditional positioning algorithms based on sharp edges or feature points, directly reducing positioning accuracy and stability. Especially in industries with extremely high precision requirements, such as semiconductors and precision electronic assembly, even micron-level defocus can lead to positioning failure.

[0003] Existing visual localization solutions primarily rely on feature matching or template matching techniques when dealing with out-of-focus and blurred images. The most similar implementations include methods based on feature descriptors, methods based on normalized cross-correlation (NCC), and active focusing methods based on the image sharpness evaluation function (Focus Measure).

[0004] Existing technical solution 1: Feature descriptor-based matching methods (such as SIFT, SURF, ORB). These methods detect key points (such as corners and patches) in an image, calculate their local feature descriptors, then match these descriptors between a template image and the blurred image to be detected. Finally, they calculate affine or projective transformation matrices using the matched point pairs to determine the target location. For example, the SIFT (Scale Invariant Feature Transform) algorithm constructs a Gaussian difference pyramid to detect key points that are invariant to scale and rotation, generating a 128-dimensional feature vector for matching. The advantage of this method is its robustness to rotation, scale changes, and certain degrees of illumination variation. However, its fatal weakness lies in its high sensitivity to image blur. Defocus blur severely attenuates high-frequency information (i.e., edges and textures), leading to a sharp decrease in the number of detected feature points and significant distortion of the calculated feature descriptors, resulting in a substantial drop in matching accuracy. In cases of severe blur, it may be impossible to extract a sufficient number of stable feature points, causing complete failure of localization.

[0005] Existing technical solution two: Gray-scale template matching based on normalized cross-correlation (NCC). This is the most classic and widely used template matching method in industrial vision. It directly utilizes the gray-scale information of the image for matching. Let the template image be... Its size is The image to be searched is At each candidate location in the search graph Calculate the template and the corresponding image sub-image Normalized cross-correlation score : ; in, It's a template. The mean, Subgraph The mean. The range of values ​​is The closer the value is to 1, the higher the matching degree. NCC has inherent invariance to linear illumination changes. However, traditional NCC is very sensitive to nonlinear gray-level changes and image degradation (such as blurring). Defocus blur is essentially a convolution process of the image with a point spread function (usually modeled as a Gaussian kernel). It changes the distribution of image gray levels, so that the gray-level relationship between the sub-image of the image to be detected and the clear template no longer satisfies a simple linear relationship. This leads to the attenuation, broadening, or even shift of the correlation peak, and in severe cases, it can produce incorrect matching positions.

[0006] Existing technical solution three: Active focusing method based on sharpness evaluation. This solution does not directly process blurry images, but rather attempts to avoid blurring altogether. The system controls a motor to drive the lens or camera to move along the optical axis, acquiring images at multiple locations and calculating a sharpness evaluation function (Focus Measure, FM) for each image, such as the squared gradient sum, Laplacian energy, or Tenengrad function. The location that maximizes the FM value is the optimal focusing position. This method can obtain the sharpest image under ideal conditions. However, its fundamental drawback is its slow speed and unsuitability for dynamic scenes. The entire "movement-acquisition-calculation-judgment" process is time-consuming, failing to meet the cycle time requirements of high-speed production lines. Furthermore, this method struggles with real-time tracking and focusing when the incoming material location fluctuates significantly or when multiple targets at different heights need to be monitored simultaneously.

[0007] Based on the above in-depth analysis of existing technical solutions, their key shortcomings in dealing with out-of-focus blur positioning tasks can be clearly summarized: 1. Poor robustness to image blur: Feature point methods fail under blur; traditional NCC methods suffer from decreased correlation peak quality under blur, resulting in a sharp drop in accuracy and reliability. This is the core challenge faced by existing technologies.

[0008] 2. Real-time limitations and application scenarios: Active focusing methods cannot meet the requirements of high-speed online detection and are powerless against multi-planar targets or rapidly changing scenes.

[0009] 3. Insufficient ability to handle complex scenarios: In practical applications, in addition to blurriness, the target may also be partially occluded, subject to background interference, or experience scale changes (due to variations in the distance between the camera and the target). Existing methods often struggle to maintain stability when these complex factors coexist with blurriness.

[0010] 4. The challenge of balancing algorithm complexity and accuracy: Some advanced image restoration algorithms (such as blind deconvolution) may improve image quality, but their computational complexity is extremely high, and the restoration process may introduce artifacts, which may interfere with subsequent localization. Summary of the Invention

[0011] The purpose of this invention is to provide a fast and robust visual localization method based on fuzzy invariant grayscale features and multi-resolution correlation technology. This invention aims to extract stable and reliable positional information directly from defocused and blurred images without image restoration. The core idea is to design an image representation method insensitive to blur and construct a matching strategy compatible with scale changes and local occlusion, enabling correlation matching on blurred images to achieve localization accuracy and reliability similar to that of clear images. Specific objectives include: significantly improving the success rate and accuracy of localization under defocus and blurred conditions; maintaining robustness to illumination changes, partial occlusion, and background interference; achieving sub-pixel-level localization accuracy; and ensuring the computational efficiency of the algorithm to meet the real-time requirements of industrial online inspection.

[0012] To address the above problems, the technical solution of this invention is a highly robust visual localization method based on fuzzy template sets and fuzzy invariant features, comprising the following steps: S10, offline template preparation; S20, online positioning; S10, offline template preparation, includes the following steps: S11, clear template collection and ROI definition; S12, Fuzzy kernel estimation and fuzzy template set generation; S13, fuzzy invariant feature extraction; S20, online positioning, includes the following steps: S21, Multi-resolution Pyramid Search; S22, Parallel relevance matching based on hybrid similarity metrics; S23, Determination of optimal template and coarse positioning points; S24, pyramid refinement and sub-pixel positioning.

[0013] Preferably, step S11 specifically includes: acquiring a target image under ideal focusing conditions. And manually or automatically define a region containing the target features and with a simple background as the template region. .

[0014] Preferably, S12 specifically includes: modeling defocus blur as a convolution of a sharp image and a point spread function, using a two-dimensional Gaussian function. To approximate the point spread function: ; in, The standard deviation of the Gaussian kernel determines the degree of fuzziness. The larger the image, the blurrier it becomes; use a predefined set of parameters. value, K is the total number of predefined fuzzy templates, i.e. the size of the fuzzy template set; For clear template areas Perform convolution to generate a fuzzy template set. ; ; in, For a set of predefined The i-th standard deviation value in the values ​​is used to generate a template with a specific degree of fuzziness; The standard deviation is The two-dimensional Gaussian function is used; simultaneously, the gradient magnitude map of each blurred template is calculated. As an auxiliary feature.

[0015] Preferably, step S13 uses a gradient direction quantization histogram as a fuzzy invariant feature, specifically including the following steps: S131, Calculate the template image gradient direction and amplitude ; S132, will arrive directional range uniform quantization A range; S133, for each pixel, according to its gradient direction Its gradient magnitude The amplitude is accumulated into the corresponding direction interval; at the same time, bilinear interpolation is used to distribute the amplitude to the two nearest direction intervals simultaneously. S134, obtained a dimensional histogram vector .

[0016] Preferably, step S21 specifically includes: preparing the image to be inspected. and fuzzy template sets Construct Gaussian pyramids separately, and perform a coarse search starting from the top layer, which is the lowest resolution layer, and gradually refine it downwards.

[0017] Preferably, the coarse search in S21 includes: Let the number of pyramid layers be . The current layer is ( ); The image to be inspected is in the first The image of the layer is denoted as .

[0018] Preferably, step S22 specifically includes the following steps: S221, at the current pyramid level Traverse the fuzzy template set Each template in Image in this layer ; S222, for each candidate position Calculate the mixed similarity score The score is a weighted fusion of two related scores: Gray-scale correlation score Calculate the sub-image and fuzzy template of the image to be inspected. Normalized cross-correlation score ; Feature Relevance Score Calculate the gradient direction quantization histogram feature vector corresponding to the sub-image of the image to be inspected. Gradient direction quantization histogram feature vector of template The similarity between them is calculated using cosine similarity: ; S223, the final mixed similarity score is: ;in, It is an adjustable weighting coefficient used to balance the importance of grayscale information and feature information.

[0019] Preferably, step S23 specifically includes the following steps: S231, for each template Find one within its search range that makes Largest position and its score ; S232, obtained by comparing all templates Choose the template with the highest score. and its corresponding position This is the optimal matching result for the current pyramid level.

[0020] Preferably, step S24 specifically includes the following steps: S241, obtain the optimal position from the current layer Map to the next layer as the center of the search, and repeat S22 and S23 in a smaller neighborhood; S242, when processing down to the bottom layer of the pyramid, i.e., the original resolution layer, sub-pixel interpolation is performed near the optimal position using a quadratic surface fitting method: at integer pixel positions... The mixed similarity scores of the point and its eight neighboring points (9 points in total) are used to fit a two-dimensional quadratic surface function; by finding the maximum point of this function, the sub-pixel accuracy positioning coordinates can be obtained. , ;in, It is the sub-pixel offset obtained by solving for the extreme points of the fitted surface.

[0021] Preferably, after step S24, anti-occlusion and interference processing is performed. Specifically, when calculating the hybrid similarity score, the template is divided into... For each non-overlapping or partially overlapping sub-block, calculate the mixed similarity score for each sub-block, and then take the median of these scores as the final score for the entire template.

[0022] The present invention has at least the following beneficial effects: 1. Excellent robustness to defocus blur: By using a pre-generated "blur template set" and matching it with the image to be inspected, this invention cleverly adapts the template to the blurred state of the image, rather than attempting to blur the image itself. Combined with HQGO features that are insensitive to blur, it enables the acquisition of sharp and stable correlation peaks even on severely defocused images, thereby achieving high-precision localization and solving the core pain point of traditional methods where performance drops sharply under blur.

[0023] 2. Higher positioning accuracy and reliability: The hybrid similarity metric combines the advantages of grayscale and orientation features, providing richer matching information. Multi-resolution pyramid search and sub-pixel surface fitting techniques work together to ensure that the final positioning result achieves sub-pixel level accuracy.

[0024] 3. Strong ability to handle complex scenes: The region-specific correlation and median strategies effectively improve the algorithm's resistance to partial occlusion and local interference. The multi-template mechanism also indirectly enhances the adaptability to scale changes (because blurring itself will cause the target edge to spread, which is similar to scale reduction in appearance).

[0025] 4. Balances accuracy and efficiency: Although multiple templates and feature calculations are introduced, the pyramid coarse-to-fine search strategy places a large portion of the computational burden on the low-resolution layer, keeping overall computational efficiency under control and meeting the needs of most industrial online applications. Compared to active focusing, the speed is improved by orders of magnitude.

[0026] 5. Highly adaptive: The algorithm can automatically select the best matching blur template without needing to know the exact degree of defocus in advance or make complex parameter adjustments, making it easy to integrate and deploy. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating the steps of the highly robust visual localization method based on fuzzy template sets and fuzzy invariant features according to an embodiment of the present invention. Figure 2 This is a schematic diagram illustrating the generation of a fuzzy template set in a highly robust visual localization method based on fuzzy template sets and fuzzy invariant features, according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the gradient orientation quantization histogram (HQGO) feature extraction process of a highly robust visual localization method based on fuzzy template sets and fuzzy invariant features according to an embodiment of the present invention. Figure 4 This is a schematic diagram illustrating the multi-resolution pyramid search and hybrid similarity calculation of a highly robust visual localization method based on fuzzy template sets and fuzzy invariant features according to an embodiment of the present invention. Figure 5 This is a schematic diagram illustrating the regional correlation and median decision of the highly robust visual localization method based on fuzzy template sets and fuzzy invariant features according to an embodiment of the present invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0029] Conversely, this invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of the invention as defined in the claims. Furthermore, to provide a better understanding of the invention, certain specific details are described in detail below. However, those skilled in the art will fully understand the invention even without these detailed descriptions.

[0030] See Figure 1 The flowchart of an embodiment of the method of the present invention includes the following steps: S10, offline template preparation; S20, online positioning; S10, offline template preparation, includes the following steps: S11, clear template collection and ROI definition; S12, Fuzzy kernel estimation and fuzzy template set generation; S13, fuzzy invariant feature extraction; S20, online positioning, includes the following steps: S21, Multi-resolution Pyramid Search; S22, Parallel relevance matching based on hybrid similarity metrics; S23, Determination of optimal template and coarse positioning points; S24, pyramid refinement and sub-pixel positioning.

[0031] S11 specifically includes: acquiring a target image under ideal focusing conditions. And manually or automatically define a region containing the target features and with a simple background as the template region. .

[0032] S12 specifically includes: modeling defocus blur as a convolution of the sharp image and a point spread function, using a two-dimensional Gaussian function. To approximate the point spread function: ; in, The standard deviation of the Gaussian kernel determines the degree of fuzziness. The larger the image size, the blurrier it becomes; see also Figure 2 Using a set of predefined... value, K is the total number of predefined fuzzy templates, i.e. the size of the fuzzy template set; For clear template areas Perform convolution to generate a fuzzy template set. ; ; in, For a set of predefined The i-th standard deviation value in the values ​​is used to generate a template with a specific degree of fuzziness; The standard deviation is The two-dimensional Gaussian function is used; simultaneously, the gradient magnitude map of each blurred template is calculated. As an auxiliary feature, gradient magnitude is sensitive to edge information and may exhibit a more stable distribution than that of a clear image under certain degrees of blur.

[0033] S13 uses the Histogram of Quantized Gradient Orientations (HQGO) as a fuzzy invariant feature. See [link / reference]. Figure 3 Specifically, it includes the following steps: S131, Calculate the template image gradient direction and amplitude ; S132, will arrive directional range uniform quantization A range; S133, for each pixel, according to its gradient direction Its gradient magnitude The amplitude is accumulated into the corresponding direction interval; at the same time, bilinear interpolation is used to distribute the amplitude to the two nearest direction intervals simultaneously. S134, obtained a dimensional histogram vector This histogram represents the statistical distribution of image edge directions. Theoretical analysis and experiments show that, within a certain range of ambiguity, the statistical distribution of gradient directions has better stability than the original gray-level distribution or gradient magnitude distribution.

[0034] At this point, we have defined each fuzzy template. Two sets of data were prepared: the original blurred grayscale image. and its corresponding HQGO feature vector .

[0035] See Figure 4 S21 specifically includes: for the image to be inspected and fuzzy template sets Construct Gaussian pyramids separately, and perform a coarse search starting from the top layer, which is the lowest resolution layer, and gradually refine it downwards.

[0036] The coarse search in S21 includes: Let the number of pyramid layers be . The current layer is ( ); The image to be inspected is in the first The image of the layer is denoted as .

[0037] S22 specifically includes the following steps: S221, at the current pyramid level Traverse the fuzzy template set Each template in Image in this layer ; S222, for each candidate position Calculate the mixed similarity score The score is a weighted fusion of two related scores: Gray-scale correlation score Calculate the sub-image and fuzzy template of the image to be inspected. Normalized cross-correlation score ; Feature Relevance Score Calculate the gradient direction quantization histogram feature vector corresponding to the sub-image of the image to be inspected. Gradient direction quantization histogram feature vector of template The similarity between them is calculated using cosine similarity: ; S223, the final mixed similarity score is: in, It is an adjustable weighting coefficient used to balance the importance of grayscale information and feature information. Typically, it can be appropriately reduced when there is severe blurring. The value of relies more heavily on the correlation with fuzzier and more stable features.

[0038] S23 specifically includes the following steps: S231, for each template Find one within its search range that makes Largest position and its score ; S232, obtained by comparing all templates Choose the template with the highest score. and their corresponding positions This serves as the optimal matching result for the current pyramid layer. This is equivalent to automatically selecting the template that best matches the current blur level of the image to be inspected.

[0039] S24 specifically includes the following steps: S241, obtain the optimal position from the current layer Map to the next layer as the center of the search, and repeat S22 and S23 in a smaller neighborhood; S242, when processing down to the bottom layer of the pyramid, i.e., the original resolution layer, sub-pixel interpolation is performed near the optimal position using a quadratic surface fitting method: at integer pixel positions... The mixed similarity scores of the point and its eight neighboring points (9 points in total) are used to fit a two-dimensional quadratic surface function; by finding the maximum point of this function, the sub-pixel accuracy positioning coordinates can be obtained. , ;in, It is the sub-pixel offset obtained by solving for the extreme points of the fitted surface.

[0040] See Figure 5 To address partial occlusion and localized interference, this invention introduces a region-specific strategy when calculating the hybrid similarity score. After S24, anti-occlusion and interference processing is performed; specifically, when calculating the hybrid similarity score, the template is divided into... For each non-overlapping or partially overlapping sub-block, calculate the mixed similarity score for each sub-block, and then take the median of these scores as the final score for the entire template.

[0041] The scope of protection of this invention is defined by the appended claims, and its core innovation and key protection points are as follows: The method for constructing an offline blurred template set involves using a set of Gaussian kernels with different standard deviations σ to convolve the sharp templates, simulating different degrees of defocus, thereby generating a set of blurred templates. The technical solution.

[0042] Gradient Orientation Quantization Histogram (HQGO) feature for blurred image matching: This method preserves the calculation of gradient direction and magnitude from the image and forms a direction statistics histogram through quantization and accumulation, thus serving as a method for blur-robust feature descriptors.

[0043] Parallel correlation matching process based on hybrid similarity metric: During the matching process, the gray-level correlation score (e.g., NCC) and feature correlation score (e.g., cosine similarity based on HQGO) between the image to be detected and the template are calculated simultaneously, and the two are weighted and fused through a weight α to form the final hybrid similarity score. The algorithm.

[0044] The search strategy combines multi-resolution pyramid and multi-template selection: at each layer of the pyramid, all fuzzy templates are traversed, and the template with the highest mixed similarity score and its position are selected as the optimal result of the current layer, which guides the complete iterative process of refining the search in the next layer.

[0045] The region-based correlation and median decision mechanism for anti-occlusion protection is as follows: The template is divided into multiple sub-blocks, the similarity score of each sub-block is calculated, and the median of the scores of all sub-blocks is taken as the overall matching score of the template.

[0046] The complete visual positioning system workflow integrates all the above innovations: from offline template preparation to online real-time positioning, including the entire process of image acquisition, feature extraction, matching search, sub-pixel positioning, and result output.

[0047] In specific embodiments, the following alternative solutions can be implemented without departing from the core concept of the present invention: Alternatives to the blur kernel model: In addition to the Gaussian kernel, a disk kernel or other custom point spread function model can be used to generate a blur template set, depending on the characteristics of the actual optical system.

[0048] Alternatives to fuzz-invariant features: In addition to HQGO, variants of Local Binary Patterns (LBP) (such as rotation-invariant LBP) or energy features based on Gabor filters can be considered, which also have some robustness to fuzziness under certain conditions.

[0049] Alternatives to feature similarity metrics: In addition to cosine similarity, chi-square distance, Bhattacharyya distance, and other similarities can be used to measure the similarity of features between two histograms.

[0050] An alternative to the hybrid weighting setting: the weight α can be an adaptive parameter that is dynamically adjusted based on the current pyramid level, the confidence of the matching score, or the estimated degree of image blur.

[0051] Alternatives to anti-occlusion strategies: In addition to the block median method, the idea of ​​robust principal component analysis (RobustPCA) can also be used to decompose the template and the image to be inspected, attempting to separate the background and sparse occlusion noise, and then match it on the cleaner's data.

[0052] Application expansion: The core concept of this method—by constructing a degradation model library and fusing multiple features for relevant matching—can be widely applied to other localization scenarios with image degradation, such as motion blur and target localization and tracking under atmospheric turbulence.

[0053] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A highly robust visual localization method based on fuzzy template sets and fuzzy invariant features, characterized in that, Includes the following steps: S10, offline template preparation; S20, online positioning; S10, offline template preparation, includes the following steps: S11, clear template collection and ROI definition; S12, Fuzzy kernel estimation and fuzzy template set generation; S13, fuzzy invariant feature extraction; S20, online positioning, includes the following steps: S21, Multi-resolution Pyramid Search; S22, Parallel relevance matching based on hybrid similarity metrics; S23, Determination of optimal template and coarse positioning points; S24, pyramid refinement and sub-pixel positioning.

2. The method according to claim 1, characterized in that, S11 specifically includes: acquiring a target image under ideal focusing conditions. And manually or automatically define a region containing the target features and with a simple background as the template region. .

3. The method according to claim 2, characterized in that, S12 specifically includes: modeling defocus blur as a convolution of the sharp image and a point spread function, using a two-dimensional Gaussian function. To approximate the point spread function: ; in, The standard deviation of the Gaussian kernel determines the degree of fuzziness. The larger the image, the blurrier it becomes; use a predefined set of parameters. value, K is the total number of predefined fuzzy templates, i.e. the size of the fuzzy template set; For clear template areas Perform convolution to generate a fuzzy template set. ; ; in, For a set of predefined The i-th standard deviation value in the values ​​is used to generate a template with a specific degree of fuzziness; The standard deviation is The two-dimensional Gaussian function is used; simultaneously, the gradient magnitude map of each blurred template is calculated. As an auxiliary feature.

4. The method according to claim 3, characterized in that, S13 uses gradient direction quantization histogram as fuzzy invariant feature, specifically including the following steps: S131, Calculate the template image gradient direction and amplitude ; S132, will arrive directional range uniform quantization A range; S133, for each pixel, according to its gradient direction Its gradient magnitude The amplitude is accumulated into the corresponding direction interval; at the same time, bilinear interpolation is used to distribute the amplitude to the two nearest direction intervals simultaneously. S134, obtained a dimensional histogram vector .

5. The method according to claim 4, characterized in that, S21 specifically includes: the image to be inspected. and fuzzy template sets Construct Gaussian pyramids separately, and perform a coarse search starting from the top layer, which is the lowest resolution layer, and gradually refine it downwards.

6. The method according to claim 5, characterized in that, The coarse search in S21 includes: Let the number of pyramid layers be . The current layer is ( ); The image to be inspected is in the first The image of the layer is denoted as .

7. The method according to claim 6, characterized in that, S22 specifically includes the following steps: S221, at the current pyramid level Traverse the fuzzy template set Each template in Image in this layer ; S222, for each candidate position Calculate the mixed similarity score The score is a weighted fusion of two related scores: Gray-scale correlation score Calculate the sub-image and fuzzy template of the image to be inspected. Normalized cross-correlation score ; Feature Relevance Score Calculate the gradient direction quantization histogram feature vector corresponding to the sub-image of the image to be inspected. Gradient direction quantization histogram feature vector of template The similarity between them is calculated using cosine similarity: ; S223, the final mixed similarity score is: in, It is an adjustable weighting coefficient used to balance the importance of grayscale information and feature information.

8. The method according to claim 7, characterized in that, S23 specifically includes the following steps: S231, for each template Find one within its search range that makes Largest position and its score ; S232, obtained by comparing all templates Choose the template with the highest score. and their corresponding positions This is the optimal matching result for the current pyramid level.

9. The method according to claim 8, characterized in that, S24 specifically includes the following steps: S241, obtain the optimal position from the current layer Map to the next layer as the center of the search, and repeat S22 and S23 in a smaller neighborhood; S242, when processing down to the bottom layer of the pyramid, i.e., the original resolution layer, sub-pixel interpolation is performed near the optimal position using a quadratic surface fitting method: at integer pixel positions... The mixed similarity scores of the point and its eight neighboring points (9 points in total) are used to fit a two-dimensional quadratic surface function; by finding the maximum point of this function, the sub-pixel accuracy positioning coordinates can be obtained. , ;in, It is the sub-pixel offset obtained by solving for the extreme points of the fitted surface.

10. The method according to claim 1, characterized in that, After step S24, anti-occlusion and interference processing is performed. Specifically, when calculating the hybrid similarity score, the template is divided into... For each non-overlapping or partially overlapping sub-block, calculate the mixed similarity score for each sub-block, and then take the median of these scores as the final score for the entire template.