Visual camera positioning method based on space homogenization feature point extraction and matching

By introducing image grid and weighted feature point homogenization extraction and descriptor similarity and geometric constraint matching verification into the visual localization method, the pose estimation bias caused by uneven feature point distribution is solved, and high-precision and high-robustness visual camera localization is achieved.

CN121767445APending Publication Date: 2026-03-31GUANGDONG OCEAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing visual localization methods suffer from biased pose estimation and poor system robustness due to uneven spatial distribution of feature points.

Method used

A feature point spatial homogenization extraction strategy based on image grid and weight score is adopted, combined with a joint matching verification mechanism of descriptor similarity and geometric constraints, to ensure that feature points are uniformly distributed in image space and eliminate false matches.

Benefits of technology

It improves the efficiency of visual positioning algorithms in utilizing global environmental information, reduces pose estimation bias and tracking loss risk, and enhances the accuracy and robustness of feature matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767445A_ABST
    Figure CN121767445A_ABST
Patent Text Reader

Abstract

The invention discloses a visual camera positioning method based on space homogenization feature point extraction and matching. In order to overcome the technical problems that pose estimation is biased and system robustness is poor due to uneven spatial distribution of feature points in an existing visual positioning method, stable and accurate self-positioning of a visual camera can be realized based on global environment information. According to the method, firstly, a feature point space homogenization extraction strategy based on image grids and weight scores is designed, region division is carried out on an image plane, and high-quality feature points are independently screened in each grid, so that it is ensured that the feature points are uniformly distributed in the whole image space, and excessive aggregation in a rich-texture region is avoided. On the other hand, a joint matching verification mechanism based on descriptor similarity and geometric constraints is introduced, mismatching which still possibly exists after uniform extraction is further filtered out, and then high-precision and high-robustness feature matching and pose calculation of the visual camera are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual camera localization technology in three-dimensional environment space, and in particular to a visual camera localization method based on spatial homogenization feature point extraction and matching. Technical Background

[0002] Feature point extraction and matching are the core foundation for achieving high accuracy and robustness in visual camera localization methods. This method stably extracts key feature points with strong representational capabilities of environmental texture and geometry from image sequences captured by the camera, and establishes accurate correspondences across frames and viewpoints. Based on these highly discriminative feature points and their matching pairs, the system can robustly calculate the camera's six-degree-of-freedom pose changes in three-dimensional space, thus building a stable and reliable environmental perception foundation for path planning, environmental interaction, and autonomous decision-making in unmanned systems such as robots. To address the challenges to feature stability posed by drastic changes in illumination and significant viewpoint shifts in the environment, existing research has focused on enhancing the invariance and robustness of feature descriptors. By improving the representation methods and matching criteria of feature descriptors, they are made insensitive to changes in illumination intensity and viewing angle, thereby ensuring the reliability of the system's localization in complex environments. A typical example is the visual localization part of ORB-SLAM2, which uses the RBRIEF-based ORB descriptor. This descriptor itself possesses good illumination invariance and rotation invariance, providing a foundation for the stable operation of the system in various real-world scenarios.

[0003] However, during feature point extraction and matching, if feature points are excessively concentrated in local areas of the image, it will lead to incomplete representation of global information, thus affecting the robustness of subsequent visual camera localization. Specifically, this over-clustering of feature points can cause bias in visual camera pose estimation. When the matched feature points only come from a corner of the scene, the camera pose calculated based on this local information cannot accurately reflect its relationship with the global environment, especially under pure rotational motion, which can easily lead to calculation failure. In addition, when these densely populated areas of feature points temporarily disappear due to occlusion, changes in lighting, or motion blur, the entire tracking thread will face the risk of being lost due to a lack of sufficient alternative feature points. Summary of the Invention

[0004] In view of this, the purpose of this invention is to overcome the technical difficulties of existing visual localization methods, which are caused by uneven spatial distribution of feature points, resulting in biased pose estimation and poor system robustness, thereby ensuring that the visual camera can achieve stable and accurate self-localization based on global environmental information.

[0005] The method of this invention first designs a feature point spatial homogenization extraction strategy based on image grids and weight scores. This strategy divides the image plane into regions and independently selects high-quality feature points within each grid, ensuring a uniform distribution of feature points throughout the image space and avoiding excessive clustering in texture-rich areas. Secondly, a joint matching verification mechanism based on descriptor similarity and geometric constraints is introduced to further filter out potential mismatches after homogenization extraction. This achieves high-precision, robust feature matching and visual camera pose calculation, enabling high-precision visual camera localization and effectively reducing the risk of visual camera pose estimation errors and tracking loss due to feature point clustering.

[0006] This invention provides a visual camera localization method based on spatially homogenized feature point extraction and matching, comprising the following steps:

[0007] Step 1: Input the RGB image dataset of the 3D environment space acquired by the vision camera. Perform grayscale preprocessing on the input H×W size RGB image dataset to ensure that feature point extraction and matching focus on the texture structure information of the image.

[0008] Step 2: Use an ORB-based feature extraction algorithm to process the current frame image acquired by the visual camera, initially detect key points, and calculate a high-dimensional feature descriptor for each key point.

[0009] Step 3: Calculate the gradient information and initial weight scores of key points;

[0010] Step 4: Divide the image into N×N uniform regions using a spatial grid partitioning method, with each region having a size of [missing information]. Within each region, the optimal feature points are selected based on their weight scores, thereby ensuring that the feature points are evenly distributed in the spatial distribution of the image and avoiding excessive aggregation in texture-rich areas.

[0011] Step 5: Perform steps 1 to 4 above on the multiple collected image datasets to construct a feature map database containing spatially homogenized feature points and their three-dimensional spatial coordinates; when the visual camera uses feature points for localization, directly call this pre-constructed database;

[0012] Step 6: Match the feature points of the current frame after spatial homogenization with the feature points in the feature map database; establish a preliminary correspondence between the two-dimensional feature points of the current frame and the three-dimensional map points in the database by calculating the similarity between feature descriptors;

[0013] Step 7: Identify and remove incorrect matches from the initial matching pairs. Then, using the filtered correct matching pairs, compare the two-dimensional coordinates of the current frame with the corresponding three-dimensional coordinates in the database. Solve the Perspective-n-Point problem to calculate the position and orientation of the current camera relative to the reference coordinate system.

[0014] Step 8: Using a nonlinear optimization method, the camera pose and 3D map point coordinates are used as optimization variables to minimize the reprojection error, thereby obtaining the optimal and accurate visual camera six-DOF pose.

[0015] Step 9: Output the final optimized precise pose of the visual camera in 3D space to complete the visual camera localization task.

[0016] Specifically, in step one, the grayscale preprocessing operation involves linearly calculating the three-channel color values ​​of each pixel using a standard luminance conversion formula to generate a grayscale image that retains only luminance information.

[0017] In step two, a scale pyramid is first built on the input image to support scale invariance detection. Then, an improved FAST corner detector is used to quickly locate a large number of key points in each pyramid level, and the most prominent key points are selected by Harris corner response values.

[0018] For each keypoint, its principal direction is calculated using the centroid method, and a 256-bit binary feature descriptor is constructed in the pixel neighborhood around the keypoint based on this direction using the BRIEF descriptor generator. This descriptor is formed by comparing the intensity of pixel pairs after direction correction, and finally outputs a set of high-dimensional binary description vectors with direction information.

[0019] In step three, calculating the gradient information of key points refers to the gradient magnitude and direction angle of each key point in the current frame image;

[0020] Specifically, the gradient information of each keypoint is calculated in its local neighborhood by calculating the gradient components of each pixel in the horizontal and vertical directions within that neighborhood. and Then, the gradient magnitude of each pixel is calculated based on these two components. and gradient direction .

[0021] In step four, the weights are composed of the Harris corner response intensity, scale stability, and local density penalty factor of the feature points.

[0022] Each grid region retains only the top f (usually f=1) feature points with the highest weight scores, and the rest are removed, thereby achieving a spatially uniform distribution of feature points in the global scope.

[0023] In step six, a fast approximate nearest neighbor search algorithm (such as brute-force Hamming distance matching) is first used to calculate the difference between the current frame descriptor and all feature point descriptors in the database. Reliable initial matching pairs are selected through bidirectional matching, thereby establishing a preliminary correspondence between the two-dimensional pixel coordinates of the current frame and the corresponding three-dimensional map points stored in the database, providing core two-dimensional-three-dimensional point correspondence data for subsequent visual camera pose estimation and localization.

[0024] In step seven, the random sample consensus algorithm and a minimum-scale PnP solver are first used as the inner model for iterative calculation: In each iteration, a candidate camera pose is calculated by randomly selecting the minimum number of matching pairs; then, based on this candidate pose, all 3D map points in the database are projected onto the current frame image plane, and the reprojection error between the candidate pose and the corresponding 2D feature points is calculated. Matching pairs with errors less than a preset threshold are marked as "inliers"; after multiple random samplings, the candidate pose with the most inliers is selected as the output of this random sample consensus algorithm, and all inliers are judged as correct matches, while the rest are discarded as incorrect matches; finally, using the filtered correct matching pairs, a more accurate preliminary camera pose estimate is calculated by solving PnP again, providing a better initial value for subsequent optimization.

[0025] In step eight, using the camera pose obtained in step seven and the coordinates of the 3D map points involved in the calculation as initial values, a nonlinear optimization problem is constructed with minimizing the reprojection error as the objective function.

[0026] Specifically, the camera pose and the coordinates of all associated 3D map points are used as optimization variables. The objective function is the sum of squared pixel differences between the observations of all correctly matched pairs and the predicted positions of their corresponding 3D points projected onto the image plane based on the currently estimated camera pose. This problem is solved iteratively using nonlinear optimization algorithms such as Gauss-Newton. By adjusting the camera pose and 3D point coordinates, the total reprojection error is minimized, and finally, an accurate visual camera position and pose is output.

[0027] In step nine, the output visual camera localization result includes the precise six-degree-of-freedom pose of the visual camera in the current frame in the predefined world coordinate system, which is the rigid body transformation composed of the three-dimensional translation vector t and the rotation matrix R.

[0028] This invention also provides the application of the visual camera localization method based on spatial homogenization feature point extraction and matching in robot navigation, augmented reality, and autonomous driving.

[0029] For example, in robot navigation, the results obtained by the method serve as key inputs for robot localization; in augmented reality, the pose results obtained by the method are the technological cornerstone for achieving stable superposition of virtual objects onto the real world. After obtaining the precise pose of the camera relative to preset markers or natural feature scenes, the AR engine can calculate the correct projection transformation matrix of the virtual model from the camera's perspective. By updating this matrix in real time for each frame, it is possible to ensure that the virtual object and the real scene maintain geometric consistency in terms of perspective, occlusion, and lighting, thereby achieving an immersive interactive experience of "virtual-real fusion" on devices such as mobile phones and AR glasses.

[0030] In autonomous driving, the visual pose obtained by the method is closely integrated with the vehicle's own global navigation system and high-precision map to provide redundant and high-frequency local positioning. When the vehicle is driving in areas where GNSS signals are lost, such as tunnels and urban canyons, the visual pose can continuously output the vehicle's position and heading angle on the map by matching the road features captured by the onboard camera with the pre-annotated high-precision map. The pose results obtained by the method can be fused with the perception data of lidar and millimeter-wave radar to jointly support the vehicle's lane-level positioning, trajectory prediction and decision planning.

[0031] The present invention also provides an apparatus for implementing the above method, comprising a camera device and a data processor, wherein the camera device provides image data;

[0032] The data processor includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program, which is encoded to implement the method described. The data processor is physically connected to the camera device via a wired or wireless connection.

[0033] The beneficial effects of this invention are:

[0034] (1) The present invention can effectively improve the uniform distribution of feature points in the image space by improving the spatial homogenization feature point extraction strategy, thereby improving the efficiency of the visual positioning algorithm in utilizing global environmental information, while avoiding the bias in pose estimation and the decrease in system robustness caused by the local aggregation of feature points.

[0035] (2) This invention enhances the model’s ability to identify and eliminate mismatched points by introducing a matching verification mechanism based on descriptor quality and geometric consistency, thereby improving the accuracy and reliability of feature matching and effectively suppressing matching interference caused by dynamic objects and lighting changes.

[0036] (3) In addition, the present invention can also be applied to autonomous navigation of UAVs in open or weak texture environments, as well as long-term robust positioning and map building of intelligent mobile robots. Attached Figure Description

[0037] To make the technical solutions in the embodiments of the present invention clearer, the accompanying drawings required in the description of the embodiments will be introduced briefly and in detail below. Wherein:

[0038] Figure 1 This is a general block diagram of a visual camera localization method based on spatial homogenization feature point extraction and matching.

[0039] Figure 2 This refers to gradient information of key points in a local region of an image.

[0040] Figure 3 This is a schematic diagram of spatial grid division for an image.

[0041] Figure 4 This is a diagram showing the spatially homogenized distribution of feature points.

[0042] Figure 5 This refers to the process by which a visual camera uses feature point information for localization.

[0043] Figure 6 These are feature extraction results based on the ORB method for the same dataset.

[0044] Figure 7 The results of feature point extraction based on spatial homogenization in the same dataset (this invention). Detailed Implementation

[0045] To enable a better understanding of the method of the present invention, the technical solutions of the present invention will be described in simple and detailed form below with reference to the accompanying drawings in the embodiments of the present invention.

[0046] Please see Figure 1 As shown, this invention provides a visual camera localization method based on spatially homogenized feature point extraction and matching, comprising the following steps:

[0047] Step 1: Input a series of RGB image datasets of the 3D environment space acquired by a visual camera. For the input H×W RGB image dataset, linearly calculate the three-channel color values ​​of each pixel using the standard luminance conversion formula to generate a grayscale image that retains only luminance information. The purpose of this grayscale preprocessing is to eliminate the interference of lighting color differences and irrelevant color noise, ensuring that feature point extraction and matching focus on the image's texture structure information.

[0048] Step 2: The current frame image acquired by the visual camera is processed using an ORB-based feature extraction algorithm to initially detect a large number of keypoints, and a high-dimensional feature descriptor is calculated for each keypoint. Specifically, a scale pyramid is first constructed for the input image to support scale-invariant detection. Then, an improved FAST corner detector is used to quickly locate a large number of keypoints at each pyramid level, and the most prominent keypoints are selected using Harris corner response values. For each keypoint, its principal orientation is calculated using the centroid method, and a 256-bit binary feature descriptor is constructed in the pixel neighborhood around the keypoint using a BRIEF descriptor generator based on this orientation. This descriptor is formed by comparing the intensity of orientation-corrected pixel pairs, ultimately outputting a set of high-dimensional binary descriptor vectors with orientation information, providing a foundation for subsequent feature matching and localization tasks.

[0049] Please see Figure 2 As shown, step three involves calculating the gradient information and initial weight scores of keypoints. After extracting keypoints, the gradient information is calculated around the local neighborhood of each keypoint. This is done by calculating the gradient components of each pixel in the horizontal and vertical directions within that neighborhood. and Then, the gradient magnitude of each pixel is calculated based on these two components. and gradient direction The gradient magnitude reflects the drasticness of the brightness change at a pixel, while the orientation angle reflects the direction of that brightness change. The gradient magnitude is used as the initial weight score for the feature point, which will be used for keypoint selection in subsequent spatial homogenization processing.

[0050] Please see Figure 3 and Figure 4 As shown, step four involves using a spatial grid partitioning method to divide the image into N×N uniform regions, each region having a size of [missing information]. For each grid region, all feature points within it are sorted and filtered according to a comprehensive weight score. This weight is composed of the feature point's Harris corner response intensity, scale stability, and local density penalty factor. The response intensity reflects the saliency of the feature point, scale stability ensures multi-scale consistency, and the local density penalty factor decreases in weight as the number of feature points in the grid increases, thereby suppressing aggregation. Finally, only the top f (usually f=1) feature points with the highest weight scores are retained in each grid region, and the rest are discarded, thus achieving a spatially uniform distribution of feature points globally.

[0051] Step 5: Perform steps 1 through 4 above on the multiple acquired image datasets to construct a feature map database containing spatially homogenized feature points and their 3D spatial coordinates. When the visual camera uses feature points for localization, this pre-constructed database is directly invoked.

[0052] Step Six: Match the spatially homogenized feature points of the current frame with feature points in the pre-built database. By calculating the similarity between feature descriptors, a preliminary correspondence is established between the 2D feature points of the current frame and the 3D map points in the database. Specifically, after spatial homogenization, each feature point in the current frame carries its high-dimensional binary descriptor. The matching process first employs a fast approximate nearest neighbor search algorithm (such as brute-force Hamming distance matching) to calculate the difference between the current frame descriptor and all feature point descriptors in the database. Reliable initial matching pairs are then selected through bidirectional matching, thereby establishing a preliminary correspondence between the 2D pixel coordinates of the current frame and the corresponding 3D map points stored in the database. This process provides core 2D-3D point correspondence data for subsequent visual camera pose estimation and localization.

[0053] Step 7: Identify and remove incorrect matches from the initial matching pairs. Then, using the filtered correct matching pairs, calculate the position and pose of the current camera relative to the reference coordinate system by solving the Perspective-n-Point (PnP) problem, comparing the 2D coordinates of the current frame with the corresponding 3D coordinates in the database. Specifically, first, iterative calculations are performed using a random sample consensus algorithm and a minimum-scale PnP solver as the inner model: In each iteration, a candidate camera pose is calculated by randomly selecting the minimum number of matching pairs; then, based on this candidate pose, all 3D map points in the database are projected onto the current frame image plane, and the reprojection error between the candidate pose and the corresponding 2D feature points is calculated. Matching pairs with errors less than a preset threshold are marked as "inliers". After multiple random samplings, the candidate pose with the most inliers is selected as the output of this random sample consensus algorithm, and all inliers are judged as correct matches, while the rest are removed as incorrect matches. Finally, using this set of filtered correct matching pairs, a more accurate preliminary camera pose estimate is calculated by solving the PnP problem again, providing better initial values ​​for subsequent optimization.

[0054] Step 8: To further improve the positioning accuracy of the visual camera, a nonlinear optimization method is adopted, using the camera pose and 3D map point coordinates as optimization variables to minimize the reprojection error, thereby obtaining the optimal and accurate six-DOF pose of the visual camera. Specifically, to obtain the optimal camera position and pose, this step performs global consistency optimization. Using the camera pose obtained in Step 7 and the 3D map point coordinates involved in the calculation as initial values, a nonlinear optimization problem is constructed with minimizing the reprojection error as the objective function. Therefore, the camera pose and all associated 3D map point coordinates are used together as optimization variables, and the objective function is the sum of squared pixel differences between the observations of all correctly matched pairs and the predicted positions of their corresponding 3D points projected onto the image plane according to the currently estimated camera pose. This problem is solved iteratively using nonlinear optimization algorithms such as Gauss-Newton, minimizing the total reprojection error by adjusting the camera pose and 3D point coordinates. This process can effectively adjust the error between the pose estimation and the geometric position of the map points, ultimately outputting an accurate visual camera position and pose.

[0055] Please see Figure 5 As shown, step nine outputs the final optimized precise pose of the visual camera in 3D space, completing the visual camera localization task. Specifically, the output visual camera localization result includes the precise six-degree-of-freedom pose of the visual camera in the current frame in a predefined world coordinate system, which is the rigid body transformation composed of the 3D translation vector t and the rotation matrix R.

[0056] This result can be applied to scenarios such as robot navigation, augmented reality, and autonomous driving. Specifically, in robot navigation, the result can serve as a key input for robot localization. By matching the real-time calculated camera pose with a pre-built environmental map, the robot can not only determine its precise position in the environment but also calculate its speed and direction by combining the historical sequence of poses. In augmented reality, this pose result is the technological cornerstone for achieving stable overlay of virtual objects onto the real world. After obtaining the precise pose of the camera relative to preset markers or natural features of the scene, the AR engine can calculate the correct projection transformation matrix of the virtual model from the camera's perspective. By updating this matrix in real time with each frame, it is possible to ensure that the virtual object and the real scene maintain geometric consistency in terms of perspective, occlusion, and lighting, thereby achieving an immersive interactive experience of "virtual-real fusion" on devices such as mobile phones and AR glasses. In the field of autonomous driving, visual pose is closely integrated with the vehicle's own global navigation system and high-precision maps, providing redundant and high-frequency local localization. When a vehicle is traveling in areas where GNSS signals are lost, such as tunnels or urban canyons, visual pose can be continuously output by matching road features captured by the onboard camera with pre-annotated high-precision maps. This pose result can be fused with perception data from LiDAR and millimeter-wave radar to jointly support lane-level localization, trajectory prediction, and decision planning for the vehicle, making it one of the key modules for achieving safe autonomous driving.

[0057] Specific application case results

[0058] This invention proposes a visual camera localization method based on spatially homogenized feature point extraction and matching. Comparison results on the same dataset demonstrate that traditional feature extraction tends to cluster in local areas, while the spatially homogenized feature point extraction method of this invention can effectively cover the entire image region.

[0059] The method was validated in a real-world testing environment, such as... Figure 6The results show the feature extraction results based on the ORB method. As can be seen from the results, under the same dataset conditions, the feature points extracted by the traditional ORB method (reference: E. Rublee, V. Rabaud, K. Konolige and G. Bradski, "ORB: An efficient alternative to SIFT or SURF," 2011 International Conference on Computer Vision, Barcelona, ​​Spain, 2011, pp.2564-2571, doi: 10.1109 / ICCV.2011.6126544.) are mainly concentrated in several key local regions of the image, exhibiting a relatively clustered distribution. This can easily lead to local information overload while other regions exhibit sparse features.

[0060] In comparison, such as Figure 7 The image shows the feature point extraction results based on spatial homogenization (this invention) on the same dataset. It can be seen that the spatial homogenization method proposed in this invention enables feature points to achieve a uniform distribution across the entire image, effectively covering all regions of the image. This enhances the robustness of feature matching and significantly improves the accuracy of subsequent visual camera localization. This result is achieved by dividing the image into a grid and adaptively weighting each region (considering feature point response intensity, scale stability, and local density) to obtain representative key points within the grid. This process effectively changes the spatial distribution pattern of feature points, transforming it from a natural, texture-clustered distribution into a controlled, globally uniform distribution. The mechanism by which this invention improves matching robustness and positioning accuracy is as follows: First, uniform distribution ensures that scene structure information can be effectively sampled in different image regions, reducing the risk of matching failure due to feature loss or over-concentration; second, in the subsequent PnP pose calculation, uniformly distributed spatial observation points can provide observation equations with better geometric constraints and lower ill-conditionedness for the optimization problem, effectively suppressing the problem of calculation noise amplification caused by collinear or coplanar feature points, thereby systematically improving the stability of the visual positioning algorithm and the accuracy of the final pose estimation.

Claims

1. A visual camera localization method based on spatial homogenization feature point extraction and matching, characterized in that, The method comprises the following steps: Step one, input the RGB image dataset of the three-dimensional environment space acquired by the visual camera, and perform a grayscale preprocessing operation on the input HxW size RGB image dataset to ensure that the feature point extraction and matching focus on the texture structure information of the image; Step two, use an ORB-based feature extraction algorithm to process the current frame image acquired by the visual camera, preliminarily detect key points, and calculate a high-dimensional feature descriptor for each key point; Step three, calculate the gradient information and initial weight score of the key points; Step four, the image is divided into N×N uniform regions by using space grid division method, the size of each region is In each region, according to the weight score of the feature points, the optimal feature points in each region are screened out, so as to ensure the uniformity of the feature points in the spatial distribution of the image and avoid excessive aggregation in the rich texture region. Step five, perform the first to fourth steps on the collected multiple image datasets to construct a feature map database containing spatially uniformized feature points and their three-dimensional space coordinates; When the visual camera is positioned using the feature points, the pre-constructed database is directly called; Step six, match the feature points of the current frame after spatial uniformization processing with the feature points in the feature map database; by calculating the similarity between the feature descriptors, a preliminary correspondence between the two-dimensional feature points of the current frame and the three-dimensional map points in the database is established; Step seven, identify and eliminate incorrect matches from the preliminary matching pairs, and then use the correct matching pairs after screening to calculate the position and pose of the current camera relative to the reference coordinate system by solving the Perspective-n-Point problem; Step eight, use a nonlinear optimization method to minimize the re-projection error by taking the camera pose and three-dimensional map point coordinates as optimization variables, thereby obtaining the optimal and accurate six-degree-of-freedom pose of the visual camera; Step nine, output the final optimized accurate pose of the visual camera in the three-dimensional space, and complete the positioning task of the visual camera.

2. The visual camera localization method based on spatial homogenization feature point extraction and matching of claim 1, wherein, In step one, the grayscale preprocessing operation is performed by linearly calculating the three-channel color values of each pixel using a standard brightness conversion formula to generate a grayscale image that only retains brightness information.

3. The method of claim 1, wherein, In step two, a scale pyramid is first established for the input image to support scale-invariant detection; then, a modified FAST corner detector is used to quickly locate a large number of key point positions at each pyramid level, and the most prominent key points are selected through Harris corner response values; For each key point, the centroid method is used to calculate its main direction, and based on this direction, a 256-bit binary feature descriptor is constructed within the pixel neighborhood around the key point through a BRIEF descriptor generator; the descriptor is formed by comparing the intensity of the direction-corrected pixel pairs, and finally outputs a high-dimensional binary description vector with direction information.

4. The vision camera localization method based on spatial homogenization feature point extraction and matching of claim 1, wherein, In step three, the gradient information of the key points refers to the gradient size and direction angle of each key point in the current frame image; In particular, the gradient information of a local neighborhood around each keypoint is computed by calculating the gradient components in horizontal and vertical directions for each pixel in the neighborhood and Then, the gradient magnitude and the gradient direction of each pixel are computed based on these two components.

5. The visual camera positioning method based on spatially uniformized feature point extraction and matching according to claim 1, wherein In step four, the weight is composed of the Harris corner response intensity, scale stability, and local density penalty factor of the feature points; Only the top f (usually f = 1) feature points with the highest weight scores are kept in each grid region, and the rest are discarded, so as to achieve the spatial uniform distribution of feature points in the global range.

6. The visual camera localization method based on spatially uniform feature points extraction and matching according to claim 1, characterized in that, In step six, firstly, the fast approximate nearest neighbor search algorithm (such as brute-force Hamming distance matching) is used to calculate the difference between the current frame descriptor and all feature point descriptors in the database; reliable initial matching pairs are screened through bidirectional matching, thereby establishing a preliminary correspondence between the two-dimensional pixel coordinates of the current frame and the corresponding three-dimensional map points stored in the database, and providing core two-dimensional-three-dimensional point correspondence data for subsequent visual camera pose estimation and localization.

7. The visual camera localization method based on spatially uniform feature points extraction and matching according to claim 1, characterized in that, In step seven, firstly, the iterative calculation is performed by using the random sample consensus algorithm and a PnP solver with a minimum scale as an inner model: in each iteration, a candidate camera pose is calculated by randomly selecting the minimum number of matching pairs; then, all three-dimensional map points in the database are projected onto the current frame image plane according to the candidate pose, the re-projection error between the three-dimensional map points and the corresponding two-dimensional feature points is calculated, and the matching pairs with an error less than a preset threshold are marked as "inliers"; after multiple random sampling, the candidate pose with the most inliers is selected as the output result of the random sample consensus algorithm, and all inliers are determined as correct matching, and the rest are discarded as false matching; finally, by solving PnP again, a more accurate preliminary camera pose estimation is calculated by using the screened correct matching pairs, and a better initial value is provided for subsequent optimization.

8. The visual camera localization method based on spatially uniform feature points extraction and matching according to claim 1, characterized in that, In step eight, the camera pose obtained in step seven and the three-dimensional map point coordinates involved in the calculation are used as initial values to construct a nonlinear optimization problem with the minimization of re-projection error as the objective function; Specifically, the camera pose and all associated three-dimensional map point coordinates are used as optimization variables, and the objective function is the sum of squares of pixel differences between the observed values of all correct matching pairs and the predicted positions of the corresponding three-dimensional points projected onto the image plane according to the current estimated camera pose; the problem is solved iteratively by using Gauss-Newton and other nonlinear optimization algorithms, the total re-projection error is minimized by adjusting the camera pose and three-dimensional point coordinates, and finally an accurate visual camera position and attitude are output.

9. The visual camera localization method based on spatially uniform feature points extraction and matching according to claim 1, characterized in that, In step nine, the output result of visual camera localization includes the accurate six-degree-of-freedom pose of the current frame visual camera in the predefined world coordinate system, i.e., the rigid body transformation composed of the three-dimensional translation vector t and the rotation matrix R.

10. The use of a visual camera localization method based on spatial homogenization feature point extraction and matching according to any one of claims 1 to 9 in robot navigation, augmented reality, and autonomous driving. For example, in robot navigation, the results obtained by the method are used as key inputs for robot localization; in augmented reality, the pose results obtained by the method are the technical cornerstone for realizing the stable superposition of virtual objects on the real world. After obtaining the accurate pose of the camera relative to the preset markers or natural feature scenes, the AR engine can calculate the correct projection transformation matrix of the virtual model in the camera view. By updating the matrix in real time for each frame, the virtual object and the real scene can be ensured to be geometrically consistent in perspective, occlusion, and lighting, thereby realizing the immersive interactive experience of "virtual-real fusion" on devices such as mobile phones and AR glasses. In autonomous driving, the visual pose obtained by the method is combined with the vehicle's own global navigation system and high-precision map to provide redundant and high-frequency local positioning. When the vehicle is driving in areas where GNSS signals are invalid, such as tunnels and urban canyons, the visual pose can continuously output the vehicle's position and heading angle in the map by matching the road features captured by the vehicle-mounted camera with the pre-labeled high-precision map. The pose results obtained by the method can be fused with the perception data of lidar and millimeter wave radar to jointly support the vehicle's lane-level positioning, trajectory prediction, and decision planning.