Disclosure of Invention
The invention aims to provide an indoor positioning method integrating a visual odometer and an IMU. The method aims to solve the problem that the traditional robot positioning is poor in real-time performance and robustness, the stereoscopic matching precision is improved by using a binocular camera in combination with scene structural features and a stereoscopic matching method based on indoor scene structural features, and the method is combined with back-end global optimization based on a factor graph so as to improve the real-time performance and robustness of the robot positioning.
In order to achieve the above object, the present invention provides an indoor positioning method integrating a visual odometer and an Inertial Measurement Unit (IMU), comprising the following steps:
step 1: performing target analysis on an indoor scene by using a camera to obtain a scene image;
step 2: extracting key frames of the scene images to obtain the key frames of the scene images;
and step 3: based on a random sampling consistency algorithm, performing feature point matching on key frames in two continuous scene images of the camera under different poses to obtain pose constraint information of the scene images;
and 4, step 4: based on a factor graph optimization algorithm, according to pose constraint information obtained by matching the characteristics of two continuous scene images, giving an initial value of edges between pose nodes in a factor graph, and performing pose global optimization on the scene images to obtain an optimized pose;
and 5: and optimizing the pose of the camera in real time according to the pose constraint information and the optimized pose to obtain a scene track and a global map of an indoor scene, so as to complete indoor positioning.
Most preferably, the key frame extraction comprises the steps of:
step 2.1: based on the combination of the line segment characteristics and the binary line descriptors, extracting the line structure relationship of the scene image to obtain the scene space structure of the scene image;
step 2.2: based on an ORB feature point extraction algorithm, extracting feature points of the scene image to obtain a feature point matrix of the scene image;
step 2.3: and combining the scene space structure of the scene image with the characteristic point matrix to obtain a key frame of the scene image.
Most preferably, the feature point extraction includes the steps of:
step 2.2.1: constructing a multilayer Gaussian pyramid according to the scene image;
step 2.2.2: calculating the position of the feature point of the Gaussian pyramid of each layer according to the multi-layer Gaussian pyramid based on a FAST algorithm;
step 2.2.3: dividing the Gaussian pyramid of each layer into a plurality of areas according to the positions of the feature points of the Gaussian pyramid of each layer;
step 2.2.4: and extracting the interest points with the maximum response value in the Gaussian pyramid of each layer, and performing descriptor calculation to obtain a characteristic point matrix of the scene image.
Most preferably, the camera is a binocular camera.
Most preferably, the indoor scene is any one of an indoor zenith texture image and a floor texture image.
By applying the method, the problem that the traditional robot positioning is poor in real-time performance and robustness is solved, the stereoscopic matching precision is improved by utilizing a stereoscopic matching method based on the indoor scene structural features by combining a binocular camera with the scene structural features, and the real-time performance and robustness of the robot positioning are improved by combining with the back-end global optimization based on the factor graph.
Compared with the prior art, the invention has the following beneficial effects:
1. according to the indoor positioning method fusing the visual odometer and the IMU, provided by the invention, the stereoscopic matching precision and the drawing effect are improved by utilizing a binocular camera in combination with the scene structural characteristics and a stereoscopic matching method based on the indoor scene structural characteristics, and the visual SLAM system is constructed in combination with the back-end global optimization based on the factor graph so as to improve the real-time property and the robustness of robot positioning.
2. According to the indoor positioning method fusing the visual odometer and the IMU, provided by the invention, the target scene is analyzed, the accurate information constraint condition of pose estimation is obtained based on the inherent characteristics of the indoor scene, and the pose is optimized by adopting a factor graph algorithm.
3. The indoor positioning method fusing the visual odometer and the IMU, provided by the invention, has the advantages that the visual odometer is arranged at the front end, the motion of the camera between adjacent images and a local map are estimated, the camera poses measured by the visual odometer at different moments are received by the back end through a factor graph, and the camera poses are optimized to obtain globally consistent tracks and maps.
Detailed Description
The invention will be further described by the following specific examples in conjunction with the drawings, which are provided for illustration only and are not intended to limit the scope of the invention.
The invention provides an indoor positioning method integrating a visual odometer and an IMU (inertial measurement Unit), which comprises the following steps as shown in figure 1:
step 1: and performing target analysis on the indoor scene of the transformer substation by adopting a binocular camera to obtain a scene image of the indoor scene of the transformer substation.
In the embodiment, the model of the binocular camera is MYNT S1030-IR-120; the indoor scene of the transformer substation is an indoor zenith texture image, a floor texture image and the like.
Step 2: extracting key frames of the scene images of the indoor scene of the transformer substation to obtain the key frames of the scene images of the indoor scene of the transformer substation;
the key frame extraction method comprises the following steps:
step 2.1: and based on the combination of the line segment characteristics and the binary line descriptors, extracting the line structure relationship of the scene image of the indoor scene of the transformer substation, and acquiring the scene space structure of the scene image of the indoor scene of the transformer substation.
Step 2.2: based on an ORB (organized FAST and rotaed BRIEF) feature point extraction algorithm, feature point extraction is carried out on the scene image, and a feature point matrix of the scene image of the indoor scene of the transformer substation is obtained.
The feature point extraction method comprises the following steps:
step 2.2.1: according to the scene image, a multilayer Gaussian pyramid of the scene image is constructed to realize scale invariance transformation of the scene image and to realize rotation invariance transformation by calibrating the direction through a gray scale centroid.
In this embodiment, the C language program corresponding to the multi-layered gaussian pyramid for constructing the scene image is as follows:
inputting: InputAlrray image, vector feature point, OutputAlrray descriptor
Gaussian blur of input image
The scale of change in pyramid is 1.2; pyramid layer number nLevels 8
for (current layer number 0; layer number < nLevels; +++ current layer number)
Downsampling a picture by number of layers
if (layer number! ═ 0)
Edges are added to the image.
Step 2.2.2: based on a FAST algorithm, calculating the feature point position of the Gaussian pyramid of each layer of the scene image according to the Gaussian pyramids of the layers of the scene image.
In this embodiment, the C language program for calculating the feature point position is as follows:
default threshold iniThFAST of FAST feature point is 20
for (current tier number 0; l current tier number < nlevels; ++ current tier number).
Step 2.2.3: dividing the Gaussian pyramid of each layer into a plurality of areas according to the position of the feature point of the Gaussian pyramid of each layer;
step 2.2.4: and extracting the interest points with the maximum response value in the Gaussian pyramid of each layer, and performing descriptor calculation to obtain a characteristic point matrix of the scene image.
In this embodiment, the descriptor calculates the corresponding C language program as follows:
for (current feature point ID ═ 0; ID < n; +++ ID).
Step 2.3: and combining the scene space structure of the scene image of the indoor scene of the transformer substation and the characteristic point matrix of the scene image to obtain the key frame of the scene image.
And step 3: based on Random Sample Consensus (RANSAC), feature point matching is performed on key frames in two continuous scene images of the camera at different poses, so that the two scene images in continuous time are related in information, and pose constraint information of the scene images is obtained.
The matching effect of the feature points directly influences the accuracy and the real-time performance of the feature point tracking process, and further greatly influences the accuracy and the efficiency of the motion estimation result.
And 4, step 4: and constructing a factor graph optimization only with tracks based on a factor graph optimization algorithm, giving an initial value of an edge between pose nodes according to pose constraint information obtained by feature matching between key frames of two continuous scene images, and performing pose global optimization on the scene images to obtain the optimized pose of the scene images.
Wherein, the global pose optimization means: obtaining a Motion edge (Motion Arcs) and a Measurement edge (Measurement Arcs) from camera pose and map features, wherein the Measurement edge connects the pose and feature points measured on the pose, each edge corresponds to a nonlinear pose constraint value, the pose constraint information represents negative log-likelihood of a Measurement and Motion model, and an objective function is a set of the pose constraint information; and (3) linearizing a series of constraints at the factor graph optimization rear end to obtain an information matrix and an information vector, and maximizing the product of factors by adjusting the value of each variable to obtain the map posterior.
And 5: and (3) according to the motion of the camera between the key frames of the continuous scene images estimated by the front-end visual odometer and the pose constraint information of the scene images, and the optimized pose of the scene images measured by the rear-end visual odometer at different moments through a factor graph, optimizing the pose of the camera in real time to obtain a globally consistent scene track and a globally consistent map, and completing indoor positioning.
The working principle of the invention is as follows:
performing target analysis on an indoor scene by using a camera to obtain a scene image; extracting key frames of the scene images to obtain the key frames of the scene images; based on a random sampling consistency algorithm, performing feature point matching on key frames in two continuous scene images of the camera under different poses to obtain pose constraint information of the scene images; based on a factor graph optimization algorithm, according to pose constraint information obtained by matching the characteristics of two continuous scene images, giving an initial value of edges between pose nodes in a factor graph, and performing pose global optimization on the scene images to obtain an optimized pose; and optimizing the pose of the camera in real time according to the pose constraint information and the optimized pose to obtain a scene track and a global map of an indoor scene, so as to complete indoor positioning.
In conclusion, the indoor positioning method fusing the visual odometer and the IMU solves the problem that the traditional robot is poor in positioning instantaneity and robustness, improves the stereo matching precision by combining the binocular camera with the scene structural feature and based on the stereo matching method of the indoor scene structural feature, and improves the instantaneity and robustness of robot positioning by combining with the factor graph-based back-end global optimization.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.