Method, device and electronic device for positioning movable device
By extracting and processing point features and line features in monocular images, combined with inertial measurement data, and optimizing the positioning state function, the problem of low positioning accuracy of monocular cameras in low-light and low-texture environments is solved, and a higher level of accuracy is achieved. Positioning accuracy and robustness.
Patent Information
- Application Number
- CN202211146449.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-09-20
AI Technical Summary
In urban areas with insufficient lighting, low texture, and dense texture, when monocular cameras are used for vehicle positioning, the accuracy of the positioning results is low.
By acquiring the target monocular image and inertial measurement unit data collected by the mobile device, extract point features and line features, eliminate abnormal points, merge and filter line features, perform positioning operations based on the inertial measurement unit data, and optimize the state function to determine the initial position. Attitude information and correct position information.
The accuracy and robustness of positioning results are improved, especially in environments with insufficient lighting and low texture, which significantly improves positioning accuracy.
Smart Images

Figure CN115752489B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a positioning method, device and electronic equipment for a movable device. Background Art
[0002] In some scenarios involving positioning, taking the Simultaneous Localization And Mapping (SLAM) scenario as an example, the SLAM scenario mainly helps vehicles perceive the surrounding environment in real time and better complete tasks such as navigation, obstacle avoidance, and path planning, all of which rely on the accuracy of positioning.
[0003] At present, when positioning a vehicle, a monocular image of the surrounding environment is usually collected by a monocular camera installed on the vehicle, and the vehicle is positioned based on the collected monocular image. However, using this method, especially for some urban areas with insufficient lighting, low texture, and dense texture, will result in low accuracy of positioning results. Summary of the invention
[0004] The present invention provides a positioning method, a device and an electronic device for a movable device, which improve the accuracy of the positioning result.
[0005] The present invention provides a method for positioning a movable device, and the method for positioning a movable device may include:
[0006] The target monocular image and inertial measurement unit data collected by the movable device are obtained respectively.
[0007] Extract multiple point features and multiple line features corresponding to the target monocular image.
[0008] Outliers are removed from the multiple point features to obtain multiple target point features corresponding to the target monocular image.
[0009] Merging the multiple line features according to the distance between the endpoints of each of the multiple line features to obtain multiple first line features; and filtering the multiple first line features to obtain multiple target line features corresponding to the target monocular image;
[0010] A positioning operation of the movable device is performed based on the plurality of target point features, the plurality of target line features, and the inertial measurement unit data.
[0011] According to a positioning method for a movable device provided by the present invention, a plurality of line features corresponding to the target monocular image are extracted, including:
[0012] The target monocular image is processed into blocks to obtain a plurality of image blocks corresponding to the target monocular image.
[0013] The line features in each image block are extracted respectively to obtain a plurality of line features corresponding to the target monocular image.
[0014] According to a positioning method for a movable device provided by the present invention, the screening and processing of the plurality of first line features to obtain a plurality of target line features corresponding to the target monocular image includes:
[0015] The plurality of first line features are screened according to the width and height of the target monocular image, the number of the plurality of first line features, and the length factor, and a plurality of second line features are determined from the plurality of first features.
[0016] According to the distance between the target monocular image and the immediately previous monocular image being less than a preset threshold, the multiple second line features are screened and processed, and multiple third line features are determined from the multiple second features.
[0017] The plurality of third line features are screened according to the vanishing points corresponding to the plurality of third line features to obtain the plurality of target line features.
[0018] According to a positioning method for a movable device provided by the present invention, the plurality of third line features are screened according to the vanishing points corresponding to the plurality of third line features to obtain the plurality of target line features, including:
[0019] The plurality of third line features are screened according to the vanishing points corresponding to the plurality of third line features to obtain a plurality of fourth line features.
[0020] According to the Hamming distance and angle between each fourth line feature in the multiple fourth line features and the line feature corresponding to the previous frame of monocular image, abnormal line features are eliminated from the multiple fourth line features to obtain the multiple target line features.
[0021] According to a positioning method for a movable device provided by the present invention, performing a positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data includes:
[0022] Constructing a state function corresponding to the movable device; wherein the state function includes the position, speed and direction of the inertial measurement unit data in the world coordinate system, the inverse depth of each of the multiple target point features, and the orthogonal representation of each of the multiple target line features.
[0023] The state function is optimized according to the inertial measurement unit residual, the point feature residual, the line feature residual, the vanishing point residual and the priori residual to obtain an optimized target state function.
[0024] Based on the target state function, an initial position, an initial speed and an initial direction corresponding to the movable device are determined; and according to the initial position, the initial speed and the initial direction, initial posture information of the movable device is determined.
[0025] When it is determined that there is a loop detection between the target monocular image and the previous monocular image immediately adjacent to it, the initial position information is corrected by using the point features and posture information corresponding to the previous monocular image to obtain the target posture information of the movable device; wherein the target posture information is the positioning result of the movable device.
[0026] According to a positioning method for a movable device provided by the present invention, the initial position information is corrected by using point features and posture information corresponding to the previous frame of monocular image, including:
[0027] The point features and posture information corresponding to the previous frame of the monocular image are used as constraints of the target state function to determine the target position, target speed and target direction corresponding to the movable device; and the target posture information of the movable device is determined based on the target position, the target speed and the target direction.
[0028] The initial position information is corrected according to the target posture information.
[0029] According to a positioning method of a movable device provided by the present invention, the method further includes:
[0030] Initially detect whether there is a loop between the target monocular image and its immediately previous monocular image frame. If a loop is initially detected, determine a plurality of candidate monocular images.
[0031] Among the multiple candidate monocular images, feature matching is performed on two candidate monocular images. If the number of inliers between two candidate monocular images is greater than a quantity threshold, it is determined that loop detection exists between the target monocular image and the previous monocular image.
[0032] The present invention also provides a positioning device for a movable device, and the positioning device for a movable device may include:
[0033] The acquisition unit is used to respectively acquire the target monocular image and inertial measurement unit data collected by the movable device.
[0034] The extraction unit is used to extract multiple point features and multiple line features corresponding to the target monocular image.
[0035] The elimination unit is used to eliminate abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image.
[0036] A processing unit is used to merge the multiple line features according to the distance between the endpoints of each of the multiple line features to obtain multiple first line features; and to filter the multiple first line features to obtain multiple target line features corresponding to the target monocular image.
[0037] An execution unit is used to perform a positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data.
[0038] According to a positioning device for a movable device provided by the present invention, the extraction unit is specifically used to perform block processing on the target monocular image to obtain multiple image blocks corresponding to the target monocular image; and respectively extract line features in each image block to obtain multiple line features corresponding to the target monocular image.
[0039] According to a positioning device for a movable device provided by the present invention, the extraction unit is specifically used to screen the multiple first line features according to the width, height, number and length factor of the target monocular image, and determine multiple second line features from the multiple first features; based on the distance between the target monocular image and the previous frame monocular image immediately adjacent to it being less than a preset threshold, screen the multiple second line features, and determine multiple third line features from the multiple second features; based on the vanishing points corresponding to the multiple third line features, screen the multiple third line features to obtain the multiple target line features.
[0040] According to a positioning device for a movable device provided by the present invention, the extraction unit is specifically used to screen the multiple third line features according to the vanishing points corresponding to the multiple third line features to obtain multiple fourth line features; according to the Hamming distance and angle between each fourth line feature in the multiple fourth line features and the line features corresponding to the previous frame of monocular image, abnormal line features are eliminated from the multiple fourth line features to obtain the multiple target line features.
[0041] According to a positioning device for a movable device provided by the present invention, the execution unit is specifically used to construct a state function corresponding to the movable device; wherein the state function includes the position, speed and direction of the inertial measurement unit data in the world coordinate system, the inverse depth of each of the multiple target point features, and the orthogonal representation of each of the multiple target line features; the state function is optimized according to the inertial measurement unit residual, the point feature residual, the line feature residual, the vanishing point residual and the prior residual to obtain an optimized target state function; based on the target state function, the initial position, initial speed and initial direction corresponding to the movable device are determined; and the initial posture information of the movable device is determined according to the initial position, the initial speed and the initial direction; when it is determined that there is a loop detection between the target monocular image and the previous frame monocular image adjacent to it, the initial position information is corrected by the point features and posture information corresponding to the previous frame monocular image to obtain the target posture information of the movable device; wherein the target posture information is the positioning result of the movable device.
[0042] According to a positioning device for a movable device provided by the present invention, the execution unit is specifically used to use the point features and posture information corresponding to the previous frame of monocular image as constraints of the target state function, determine the target position, target speed and target direction corresponding to the movable device; and determine the target posture information of the movable device according to the target position, the target speed and the target direction; and correct the initial position information according to the target posture information.
[0043] According to a positioning device for a movable device provided by the present invention, the device further includes a detection unit;
[0044] The detection unit is used to initially detect whether there is a loop between the target monocular image and its immediately previous monocular image. If a loop is initially detected, multiple candidate monocular images are determined; among the multiple candidate monocular images, feature matching is performed on each of the candidate monocular images. If the number of inner points of the two candidate monocular images is greater than a quantity threshold, it is determined that a loop detection exists between the target monocular image and the previous monocular image.
[0045] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for positioning a movable device as described above is implemented.
[0046] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the positioning method of a movable device as described in any one of the above is implemented.
[0047] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the positioning method of a movable device as described in any one of the above is implemented.
[0048] The positioning method, device and electronic device of the movable device provided by the present invention obtain the target monocular image and inertial measurement unit data collected by the movable device; and extract multiple point features and multiple line features corresponding to the target monocular image; remove abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image; merge the multiple line features according to the distance between the endpoints of the two line features in the multiple line features to obtain multiple first line features; and screen the multiple first line features to obtain multiple target line features corresponding to the target monocular image; and then perform the positioning operation of the movable device according to the multiple target point features, multiple target line features and inertial measurement unit data. In this way, by processing the point features and line features separately, and performing the positioning operation of the movable device according to the multiple target point features and multiple target line features obtained by processing and the inertial measurement unit data, the accuracy of the positioning result can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a flow chart of a method for positioning a movable device provided by an embodiment of the present invention;
[0051] Figure 2 A tracking schematic diagram provided by an embodiment of the present invention;
[0052] Figure 3 Another tracking schematic diagram provided by an embodiment of the present invention;
[0053] Figure 4 A trajectory heat map for positioning in low-light scenes provided by the prior art;
[0054] Figure 5 A trajectory heat map for positioning in a low-light scene provided by an embodiment of the present invention;
[0055] Figure 6 A trajectory heatmap for localization in low-texture scenes provided by the prior art;
[0056] Figure 7 A trajectory heat map for positioning in a low-texture scene provided by an embodiment of the present invention;
[0057] Figure 8 A schematic structural diagram of a positioning device for a movable device provided by an embodiment of the present invention;
[0058] Fig. 9 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] In the embodiments of the present invention, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In the text description of the present invention, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0061] The technical solution provided by the embodiment of the present invention can be applied to positioning scenarios. In many cases, positioning operations need to be performed. For example, controlling a team of mobile robots to move in a warehouse and organize shelves, or controlling an autonomous driving car to park in an empty parking space, etc., all require positioning operations. Taking the Simultaneous Localization And Mapping (SLAM) scenario as an example, the SLAM scenario mainly helps vehicles to perceive the surrounding environment in real time with the help of sensors such as cameras, inertial measurement units, global positioning systems (GPS), and global navigation satellite systems (GNSS), so as to better complete navigation, obstacle avoidance, path planning and other tasks, all of which rely on the accuracy of positioning.
[0062] At present, when positioning a vehicle, a monocular image of the surrounding environment is usually collected by a monocular camera installed on the vehicle, and the vehicle is positioned based on the collected monocular image. However, using this method, especially for some urban areas with insufficient lighting, low texture, and dense texture, will result in low accuracy of positioning results.
[0063] In order to improve the accuracy of the positioning result, an embodiment of the present invention provides a positioning method for a movable device, which obtains a target monocular image and inertial measurement unit data collected by the movable device respectively; extracts multiple point features and multiple line features corresponding to the target monocular image; removes abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image; merges the multiple line features according to the distance between the endpoints of the multiple line features, and obtains multiple first line features; and screens the multiple first line features to obtain multiple target line features corresponding to the target monocular image; and then performs the positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data. In this way, by processing the point features and the line features respectively, and performing the positioning operation of the movable device according to the multiple target point features and the multiple target line features obtained by the processing and the inertial measurement unit data, the accuracy of the positioning result can be effectively improved.
[0064] For example, the movable device may be a robot, an autonomous driving vehicle, etc., and may be configured according to actual needs.
[0065] It can be understood that the positioning method of the movable device provided in the embodiment of the present invention can be implemented by the Robot Operating System (ROS) and C++ language, and the OpenCv library is used to fuse point features and line features. In addition, in order to verify the positioning method of the movable device provided in the embodiment of the present invention, a comparative experiment with the VINS-MONO and OKVIS algorithms was subsequently carried out on the EuRoC dataset. The experiment showed that the positioning method of the movable device provided in the embodiment of the present invention can effectively improve the accuracy of the positioning results. Even in some environments with insufficient lighting, low texture, and dense texture, the positioning results have high accuracy and strong robustness.
[0066] The positioning method of a mobile device provided by the present invention will be described in detail below through the following specific embodiments. It is understandable that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0067] Figure 1The present invention provides a flow chart of a method for positioning a mobile device according to an embodiment of the present invention. The method for positioning a mobile device can be executed by software and / or hardware devices. For example, see Figure 1 As shown, the positioning method of the movable device may include:
[0068] S101, respectively obtaining a target monocular image and inertial measurement unit data collected by a movable device.
[0069] Among them, the target monocular image can be understood as a frame of monocular image newly collected in a sliding window. In order to distinguish it from other monocular images in the sliding window, in an embodiment of the present invention, a frame of monocular image newly collected in the sliding window can be recorded as the target monocular image.
[0070] For example, when the movable device collects a target monocular image, the target monocular image can be collected by a monocular camera set in the movable device; when collecting inertial measurement unit data, the inertial measurement unit data can be collected by an inertial measurement unit (IMU) set in the movable device, thereby obtaining the target monocular image and inertial measurement unit data.
[0071] S102: extracting a plurality of point features and a plurality of line features corresponding to the target monocular image.
[0072] For example, when extracting multiple point features corresponding to the target monocular image, the ORB (oriented fast and rotated BRIEF) technology can be used to extract the point features, so as to extract multiple point features. For example, after extracting multiple point features, the KLT (Kanade-Lucas-Tomasi) method can be further used to perform optical flow tracking of the point features. For example, see Figure 2 and Figure 3 As shown, Figure 2 A tracking schematic diagram provided by an embodiment of the present invention, Figure 3 Another tracking schematic diagram provided by an embodiment of the present invention, wherein: Figure 2 A schematic diagram of tracking in low-light conditions. Figure 3 Schematic diagram of tracking in a low-texture scene, with better tracking effect.
[0073] By way of example, when extracting multiple line features corresponding to a target monocular image, in order to make the extracted line features have good rotation and scale invariance, the extraction time is short and the distribution is uniform, in an embodiment of the present invention, the target monocular image can be firstly divided into blocks to obtain multiple image blocks corresponding to the target monocular image; by way of example, the target monocular image can be divided into 12×12 image blocks, and the line features in each image block are extracted respectively to obtain multiple line features corresponding to the target monocular image, which can effectively ensure that the extracted line features have good rotation and scale invariance, the extraction time is short and the distribution is uniform.
[0074] After extracting the multiple point features and the multiple line features corresponding to the target monocular image, the multiple point features and the multiple line features can be processed respectively, that is, the following S103 and S104 are executed:
[0075] S103, eliminating abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image.
[0076] For example, when removing outliers from multiple point features, the RANSAC geometric constraint algorithm can be used to remove outliers, i.e., outliers, from the multiple point features, thereby obtaining multiple point features after removing the outliers. For ease of distinction, the multiple point features after removing the outliers can be referred to as multiple target point features.
[0077] S104, merging the multiple line features according to the distance between the endpoints of each of the multiple line features to obtain multiple first line features; and screening the multiple first line features to obtain multiple target line features corresponding to the target monocular image.
[0078] For example, in an embodiment of the present invention, multiple line features corresponding to the target monocular image may be added to the set gather It means that there are n line features in the i-th frame image. Represents the nth line feature in the i-th frame image. For the pairwise line features in the multiple line features corresponding to the target monocular image, assume that the two line features are (l i ,l j ), then the line feature can be i And the line feature is l j The distance between the endpoints of the line feature l i and line features j Merge processing is performed. If the line feature l i Only one endpoint is close to the line feature l j The endpoints of the line feature l i and line features j Merge into longer segments; if feature l iBoth endpoints are close to the line feature l j And the distance threshold between the two is less than the distance threshold, for example, 10px, then the line feature l i and line features j Merge into new line segments to obtain multiple new line features, which can be recorded as multiple first line features. In this way, through the merging process, redundant short line segments and line segments with close distances can be eliminated, which can not only effectively improve the matching accuracy and matching speed of line features, but also reduce the mismatching phenomenon caused by short line segments, thereby leading to problems such as difficulty in the initialization process.
[0079] After obtaining multiple first line features through merging processing, the multiple first line features can be further screened. For example, when screening multiple first line features, the multiple first line features can be screened according to the width, height, number of multiple first line features and length factor of the target monocular image, and multiple second line features can be determined from the multiple first features; and the multiple second line features can be screened according to the distance between the target monocular image and the previous monocular image immediately adjacent to it being less than a preset threshold, and multiple third line features can be determined from the multiple second features; and then the multiple third line features can be screened according to the vanishing points corresponding to the multiple third line features to obtain multiple target line features.
[0080] For example, in an embodiment of the present invention, when screening the multiple first-line features according to the width, height, number of the multiple first-line features, and length factor of the target monocular image, the following formula 1 may be referred to:
[0081]
[0082] Wherein, W represents the width of the target monocular image, H represents the height of the target monocular image, α represents the length factor, and n represents the number of multiple first-line features.
[0083] After the plurality of first line features are screened according to the above formula 1 to obtain the plurality of second line features satisfying the above formula 1, the plurality of second line features can be screened and processed according to the distance between the target monocular image and the immediately previous monocular image being less than the preset threshold, and a plurality of third line features can be determined from the plurality of second features. The value of the preset threshold can be set according to actual needs, and the embodiment of the present invention does not specifically limit the value of the preset threshold.
[0084] For example, when screening multiple third line features according to the vanishing points corresponding to multiple third line features, the vanishing points corresponding to the multiple third line features can be calculated first, for example, the J-linkage algorithm can be used to detect the vanishing points and calculate the vanishing points corresponding to the multiple third line features; and the multiple third line features are screened according to the calculated vanishing points corresponding to the multiple third line features to obtain multiple fourth line features; and then, according to the Hamming distance and angle between each fourth line feature and the line feature corresponding to the previous frame of the monocular image, the abnormal line features are eliminated from the multiple fourth line features to obtain multiple target line features. For example, the fourth line feature corresponding to the Hamming distance greater than 30px and / or the angle less than 0.1rad can be determined as an abnormal line feature, and the abnormal line feature is eliminated.
[0085] After obtaining the multiple target point features and multiple target line features corresponding to the target monocular image respectively through the above S103 and S104, the following S105 can be executed:
[0086] S105: Execute a positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data.
[0087] For example, when performing a positioning operation of a movable device based on multiple target point features, multiple target line features and inertial measurement unit data, a state function corresponding to the movable device can be first constructed; wherein the state function includes the position, speed and direction of the inertial measurement unit data in the world coordinate system, the inverse depth of each of the multiple target point features, and the orthogonal representation of each of the multiple target line features; and based on the inertial measurement unit residual, the point feature residual, the line feature residual, the vanishing point residual and the prior residual, the state function is optimized to obtain an optimized target state function.
[0088] For example, in the embodiment of the present invention, the state function corresponding to the constructed movable device can be shown in the following formula 2:
[0089]
[0090] Among them, χ represents the state corresponding to the removable device, X i Indicates the IMU state corresponding to the capture of the i-th frame of monocular image, including the position, velocity and direction of the i-th frame of inertial measurement unit data in the sliding window in the world coordinate system, accelerometer bias, gyroscope bias, λ represents the inverse depth of each of the multiple target point features included in each frame of monocular image in the sliding window, including the inverse depth of each of the multiple target point features included in the target monocular image, O represents the orthogonal representation of each of the multiple target line features included in each frame of monocular image in the sliding window, including the orthogonal representation of each of the multiple target line features included in the target monocular image. np , n m , n l They represent the sum of the keyframes in the sliding window, the total number of point features and line features observed in all keyframes, respectively.
[0091] It is understandable that when constructing the state function corresponding to the movable device, initialization can be performed first. For example, if the rotation extrinsic parameter is unknown, the rotation extrinsic parameter is estimated first; multiple target point features included in each frame of the monocular image, and the position and posture of each target point feature in the camera coordinate system are determined, and the IMU angular velocity bias is calibrated using the camera rotation constraint, and the IMU angular velocity bias is calibrated using the camera rotation constraint, and the initialization parameters are solved using the IMU translation: gravity, velocity, and scale factor. These initial values are used to guide the subsequent VIO-based nonlinear optimization. Secondly, the initialization process requires the alignment of the vision and IMU with inconsistent frequencies.
[0092] For example, when the state function is optimized according to the inertial measurement unit residual, the point feature residual, the line feature residual, the vanishing point residual and the prior residual, the optimized target state function can be shown in the following formula 3:
[0093]
[0094] Among them, r0 represents the prior residual, represents the inertial measurement unit residual, represents the point feature residual, represents the line feature residual, represents the vanishing point residual, J p represents the prior Jacobian matrix, which comes from the Hessian matrix obtained after the previous optimization, where ρ p , ρ l and ρ v Satisfying the Huber rule, P, L, and V represent the set of point features, line features, and vanishing points in the camera coordinate system, respectively. and Represent the IMU, point, line and vanishing point measurement covariance matrices respectively.
[0095] The calculation of line feature residual can be referred to the following formula 4:
[0096]
[0097] Where l, K' and K represent the reprojected line feature, the projection matrix of the line feature and the intrinsic parameters of the camera respectively. K' and K are both unit matrices. (f x ,f y ) and (c x ,c y) represent the focal length and principal point of the image respectively. In the embodiment of the present invention, the reprojected line segment is equal to the normal vector.
[0098] Therefore, the line feature residual can be found in the following formula 5:
[0099]
[0100] Among them, r l represents the line feature residual, d represents the distance between the two endpoints of the observed line segment and the reprojected line segment, and p s and p e are the endpoints of the line segments observed in the monocular image.
[0101] The calculation of the vanishing point residual can be shown in the following formula 6. The vanishing point is equivalent to the projection of a point at infinity on a three-dimensional line.
[0102]
[0103] Wherein, V0 represents a point in a three-dimensional line segment, P=K[I|0] represents the projection matrix of the camera, and in the embodiment of the present invention, the vanishing point from the line segment is equivalent to the direction vector of the line segment, v i The intersection with the image plane is an estimate of the vanishing point, so the vanishing point residual is expressed as follows:
[0104]
[0105] Among them, r v represents the vanishing point residual, p v Represents the observation of the vanishing point.
[0106] Combined with the above description, after the target state function is obtained through optimization, the target state function can be solved to determine the initial position, initial speed and initial direction corresponding to the movable device; and further determine the initial posture information of the movable device based on the initial position, initial speed and initial direction. After determining the initial posture information of the movable device, it is also possible to further detect whether the target monocular image and its immediately previous monocular image have loop detection, and when it is determined that the target monocular image and its immediately previous monocular image have loop detection, the initial position information is corrected through the point features and posture information corresponding to the previous monocular image to obtain the target posture information of the movable device; wherein the target posture information is the positioning result of the movable device.
[0107] For example, in an embodiment of the present invention, when determining whether there is a loop detection between a target monocular image and its immediately previous monocular image, an initial detection can be performed to determine whether there is a loop between the target monocular image and its immediately previous monocular image. If a loop is detected in the initial detection, multiple candidate monocular images are determined; then, feature matching is performed between two candidate monocular images in multiple candidate monocular images. If the number of inliers between two candidate monocular images is greater than a quantity threshold, it is determined that there is a loop detection between the target monocular image and the previous monocular image. In this way, loop detection can be accurately performed through dual detection of initial detection and inlier number detection, thereby improving the accuracy of the loop detection result. Among them, the quantity threshold can be set according to actual needs. Here, the embodiment of the present invention does not further limit the specific value of the quantity threshold.
[0108] For example, when initially detecting whether there is a loop between a target monocular image and its immediately previous monocular image, the target point features corresponding to the target monocular image can be used. Considering that in order to make the point features corresponding to the target monocular image sufficient, a preset number of point features can be added on the basis of the corresponding target point features, and used together for initial loop detection, so that better loop detection can be achieved. In addition, in an embodiment of the present invention, only the descriptors of all point features used for feature retrieval can be retained, and the monocular image can be discarded to reduce memory usage.
[0109] For example, when feature matching is performed on pairs of multiple candidate monocular frame images, when both candidate monocular frame images are 2D images, that is, 2D-2D, the RANSAC geometric constraint algorithm can be used to perform an F matrix test to achieve feature matching; when one of the two candidate monocular frame images is a 3D image and the other is a 2D image, that is, 3D-2D: the RANSAC geometric constraint algorithm can be used to perform a PnP test to achieve feature matching, which can be specifically set according to actual needs.
[0110] When it is determined that there is a loop detection between the target monocular image and its immediately previous monocular image, when the initial position information is corrected by using the point features and pose information corresponding to the previous monocular image, for example, the point features and pose information corresponding to the previous monocular image can be used as constraints of the target state function, as shown in the following formula 8:
[0111]
[0112] in, is the pose in loop closure detection, and (p,m) represents the p-th point feature observed in the m-th frame monocular image under loop closure detection.
[0113] In combination with the above description, after taking the point features and posture information corresponding to the previous frame of the monocular image as the constraints of the target state function, the new position, new speed and new direction corresponding to the movable device can be calculated based on the above formula 8. In an embodiment of the present invention, the new position can be recorded as the target position, the new speed can be recorded as the target speed, and the new direction can be recorded as the target direction; and the target posture information of the movable device is determined according to the target position, target speed and target direction, and then the initial position information is corrected according to the target posture information to obtain the target posture information of the movable device; wherein the target posture information is the positioning result of the movable device.
[0114] It can be seen that in the embodiment of the present invention, by acquiring the target monocular image and inertial measurement unit data collected by the movable device; and extracting multiple point features and multiple line features corresponding to the target monocular image; removing abnormal points from the multiple point features, and obtaining multiple target point features corresponding to the target monocular image; merging multiple line features according to the distance between the endpoints of two line features in the multiple line features, and obtaining multiple first line features; and screening the multiple first line features to obtain multiple target line features corresponding to the target monocular image; and then performing the positioning operation of the movable device according to the multiple target point features, multiple target line features and inertial measurement unit data. In this way, by processing the point features and line features separately, and performing the positioning operation of the movable device according to the multiple target point features and multiple target line features obtained by processing and the inertial measurement unit data, the accuracy of the positioning result can be effectively improved.
[0115] The above embodiment describes in detail the positioning method of the movable device provided by the embodiment of the present invention. In addition, the positioning method of the movable device provided by the embodiment of the present invention can also be verified by the robot operating system, and the accuracy and real-time performance of the positioning result can be analyzed and verified.
[0116] In order to demonstrate the performance in low-texture scenes and scenes with large changes in light intensity, the mobile robot is moved to scenes with low light intensity and low texture intensity, and the positioning results provided by the embodiments of the present invention are demonstrated in combination with these two scenes. When demonstrating the positioning results, it is mainly demonstrated from two aspects, one is the positioning accuracy, and the other is the positioning real-time performance. When demonstrating the positioning accuracy, take the case where the mobile robot moves to a scene with low light intensity, i.e., insufficient light intensity, as an example, it can be combined with Figure 4 and Figure 5 As shown, Figure 4 A trajectory heat map for positioning in low-light scenes provided by the prior art. Figure 5 A trajectory heat map for positioning in a scene with insufficient lighting is provided in an embodiment of the present invention, wherein: Figure 4 The trajectory heat map shown is obtained based on OKVIS. Figure 5 The trajectory heat map shown is obtained based on the technical solution provided by the embodiment of the present invention. It can be seen that in the scene with dim light intensity, the maximum trajectory error obtained by OKVIS reaches 1.709m, while the maximum error rate obtained by using the technical solution provided by the embodiment of the present invention is only 0.152m, and the positioning accuracy is improved by 1024.342% compared with OKVIS.
[0117] Taking the case of a mobile robot moving into a low-texture scene as an example, Figure 6 and Figure 7 As shown, Figure 6 A trajectory heat map for localization in low-texture scenes provided by the prior art. Figure 7 A trajectory heat map for positioning in a low-texture scene provided by an embodiment of the present invention, wherein: Figure 6 The trajectory heat map shown is obtained based on OKVIS. Figure 7 The trajectory heat map shown is obtained based on the technical solution provided by the embodiment of the present invention. It can be seen that in the scene with low light intensity, the maximum trajectory error obtained by OKVIS reaches 0.704m, while the maximum error rate obtained by the technical solution provided by the embodiment of the present invention is only 0.092m, and the positioning accuracy is improved by 665.217% compared with OKVIS. In addition, it is not difficult to see that the rapid rotation and movement of the camera have a significant impact on estimating its direction, and light changes are particularly challenging for tracking point and line features. The positioning method provided by the embodiment of the present invention can meet the needs of complex environments and has good positioning accuracy, and can provide good pose estimation for mobile robots.
[0118] When demonstrating the real-time positioning, taking the average running time of each module on the MH_05 sequence as an example, see the following Table 1, where VPL-VINS represents the positioning method provided by an embodiment of the present invention, and VINS-Mono represents the positioning method provided by the prior art.
[0119] Table 1
[0120]
[0121] It can be seen from Table 1 that the operation time of front-end point line feature extraction and matching is short and the detection efficiency is high. Compared with VINS-Mono, not only the line feature extraction and tracking time is short, but also the point feature extraction and matching based on ORB have achieved higher efficiency. Compared with the lightweight front-end, the back-end of VPL-VINS is more time-consuming. Therefore, the positioning method proposed in the present invention can meet the real-time requirements of SLAM in complex environments.
[0122] The positioning device of the movable device provided by the present invention is described below. The positioning device of the movable device described below and the positioning method of the movable device described above can be referred to each other.
[0123] Figure 8 A schematic diagram of a positioning device for a movable device provided in an embodiment of the present invention, for example, see Figure 8 As shown, the positioning device 80 of the movable device may include:
[0124] The acquisition unit 801 is used to respectively acquire the target monocular image and the inertial measurement unit data collected by the movable device.
[0125] The extraction unit 802 is used to extract multiple point features and multiple line features corresponding to the target monocular image.
[0126] The elimination unit 803 is used to eliminate abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image.
[0127] The processing unit 804 is used to merge the multiple line features according to the distance between the endpoints of each of the multiple line features to obtain multiple first line features; and to filter the multiple first line features to obtain multiple target line features corresponding to the target monocular image.
[0128] The execution unit 805 is used to perform a positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data.
[0129] Optionally, the extraction unit 802 is specifically used to perform block processing on the target monocular image to obtain multiple image blocks corresponding to the target monocular image; and respectively extract line features in each image block to obtain multiple line features corresponding to the target monocular image.
[0130] Optionally, the extraction unit 802 is specifically used to screen the multiple first line features according to the width, height, number and length factor of the target monocular image, and determine the multiple second line features from the multiple first features; based on the distance between the target monocular image and the previous frame monocular image adjacent to it being less than a preset threshold, screen the multiple second line features and determine the multiple third line features from the multiple second features; based on the vanishing points corresponding to the multiple third line features, screen the multiple third line features to obtain the multiple target line features.
[0131] Optionally, the extraction unit 802 is specifically used to screen the multiple third line features according to the vanishing points corresponding to the multiple third line features to obtain multiple fourth line features; according to the Hamming distance and angle between each fourth line feature in the multiple fourth line features and the line features corresponding to the previous frame of the monocular image, eliminate abnormal line features from the multiple fourth line features to obtain multiple target line features.
[0132] Optionally, the execution unit 805 is specifically used to construct a state function corresponding to the movable device; wherein the state function includes the position, speed and direction of the inertial measurement unit data in the world coordinate system, the inverse depth of each of a plurality of target point features, and the orthogonal representation of each of a plurality of target line features; the state function is optimized according to the inertial measurement unit residual, the point feature residual, the line feature residual, the vanishing point residual and the prior residual to obtain an optimized target state function; based on the target state function, the initial position, initial speed and initial direction corresponding to the movable device are determined; and the initial posture information of the movable device is determined according to the initial position, initial speed and initial direction; when it is determined that there is a loop detection between the target monocular image and the previous frame monocular image adjacent to it, the initial position information is corrected by the point features and posture information corresponding to the previous frame monocular image to obtain the target posture information of the movable device; wherein the target posture information is the positioning result of the movable device.
[0133] Optionally, the execution unit 805 is specifically used to use the point features and posture information corresponding to the previous frame of the monocular image as constraints of the target state function to determine the target position, target speed and target direction corresponding to the movable device; and determine the target posture information of the movable device based on the target position, target speed and target direction; and correct the initial position information based on the target posture information.
[0134] Optionally, the positioning device 80 of the movable device further includes a detection unit.
[0135] The detection unit is used to initially detect whether there is a loop between a target monocular image and its immediately previous monocular image. If a loop is found in the initial detection, multiple candidate monocular images are determined; and feature matching is performed on two candidate monocular images among the multiple candidate monocular images. If the number of inner points of two candidate monocular images is greater than a number threshold, it is determined that a loop is detected between the target monocular image and the previous monocular image.
[0136] The positioning device 80 for a movable device provided in an embodiment of the present invention can execute the technical solution of the positioning method for a movable device in any of the above-mentioned embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the positioning method for a movable device. Please refer to the implementation principle and beneficial effects of the positioning method for a movable device, and no further details will be given here.
[0137] Fig. 9 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the positioning method of the movable device, which includes: respectively acquiring the target monocular image and the inertial measurement unit data collected by the movable device; extracting multiple point features and multiple line features corresponding to the target monocular image; removing abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image; merging the multiple line features according to the distance between the endpoints of the multiple line features, to obtain multiple first line features; and filtering the multiple first line features to obtain multiple target line features corresponding to the target monocular image; performing positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data.
[0138] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0139] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the positioning method of a movable device provided by the above-mentioned methods, which includes: respectively acquiring a target monocular image and an inertial measurement unit data collected by the movable device; extracting multiple point features and multiple line features corresponding to the target monocular image; removing abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image; merging the multiple line features according to the distance between the endpoints of each of the multiple line features to obtain multiple first line features; and screening the multiple first line features to obtain multiple target line features corresponding to the target monocular image; performing a positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data.
[0140] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the positioning method of a movable device provided by the above-mentioned methods, the method comprising: respectively acquiring a target monocular image and an inertial measurement unit data collected by the movable device; extracting multiple point features and multiple line features corresponding to the target monocular image; removing abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image; merging the multiple line features according to the distance between the endpoints of each of the multiple line features to obtain multiple first line features; and screening the multiple first line features to obtain multiple target line features corresponding to the target monocular image; performing a positioning operation of the movable device according to the multiple target point features, the multiple target line features and the inertial measurement unit data.
[0141] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0142] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for positioning a movable device, characterized in that: include: Obtaining target monocular images and inertial measurement unit data collected by the movable device respectively; Extracting a plurality of point features and a plurality of line features corresponding to the target monocular image; Eliminate abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image; Merging the multiple line features according to the distance between the endpoints of each of the multiple line features to obtain multiple first line features; and filtering the multiple first line features to obtain multiple target line features corresponding to the target monocular image; performing a positioning operation of the movable device based on the plurality of target point features, the plurality of target line features, and the inertial measurement unit data; The filtering and processing of the plurality of first line features to obtain a plurality of target line features corresponding to the target monocular image includes: According to the width and height of the target monocular image, the number of the plurality of first line features and the length factor, the plurality of first line features are screened and processed, and a plurality of second line features are determined from the plurality of first line features; According to the distance between the target monocular image and the immediately previous monocular image being less than a preset threshold, screening the plurality of second line features, and determining a plurality of third line features from the plurality of second line features; The plurality of third line features are screened according to the vanishing points corresponding to the plurality of third line features to obtain the plurality of target line features.
2. The method for positioning a movable device according to claim 1, characterized in that: Extracting a plurality of line features corresponding to the target monocular image, including: Performing block processing on the target monocular image to obtain a plurality of image blocks corresponding to the target monocular image; The line features in each image block are extracted respectively to obtain a plurality of line features corresponding to the target monocular image.
3. The method for positioning a movable device according to claim 1, characterized in that: The screening process of the plurality of third line features according to the vanishing points corresponding to the plurality of third line features to obtain the plurality of target line features includes: screening the plurality of third line features according to the vanishing points corresponding to the plurality of third line features to obtain a plurality of fourth line features; According to the Hamming distance and angle between each fourth line feature in the multiple fourth line features and the line feature corresponding to the previous frame of monocular image, abnormal line features are eliminated from the multiple fourth line features to obtain the multiple target line features.
4. The method for positioning a movable device according to claim 1 or 2, characterized in that: The performing a positioning operation of the movable device according to the plurality of target point features, the plurality of target line features and the inertial measurement unit data comprises: Constructing a state function corresponding to the movable device; wherein the state function includes the position, velocity and direction of the inertial measurement unit data in the world coordinate system, the inverse depth of each of the multiple target point features, and the orthogonal representation of each of the multiple target line features; Optimizing the state function according to the inertial measurement unit residual, the point feature residual, the line feature residual, the vanishing point residual and the priori residual to obtain an optimized target state function; Based on the target state function, determine the initial position, initial speed and initial direction corresponding to the movable device; and determine the initial posture information of the movable device according to the initial position, the initial speed and the initial direction; When it is determined that there is a loop detection between the target monocular image and the previous monocular image immediately adjacent to it, the initial position information is corrected by using the point features and posture information corresponding to the previous monocular image to obtain the target posture information of the movable device; wherein the target posture information is the positioning result of the movable device.
5. The method for positioning a movable device according to claim 4, characterized in that: The correcting the initial position information by using the point features and the posture information corresponding to the previous frame of the monocular image includes: Using the point features and posture information corresponding to the previous frame of the monocular image as constraints of the target state function, determining the target position, target speed and target direction corresponding to the movable device; and determining the target posture information of the movable device according to the target position, the target speed and the target direction; The initial position information is corrected according to the target posture information.
6. The method for positioning a movable device according to claim 4, characterized in that: The method further comprises: Initially detecting whether there is a loop between the target monocular image and its immediately previous monocular image frame, and if a loop is detected, determining a plurality of candidate monocular images; Among the multiple candidate monocular images, feature matching is performed on two candidate monocular images. If the number of inliers between two candidate monocular images is greater than a quantity threshold, it is determined that loop detection exists between the target monocular image and the previous monocular image.
7. A positioning device for a movable device, characterized in that: include: An acquisition unit, used to respectively acquire a target monocular image and inertial measurement unit data collected by a movable device; An extraction unit, used to extract a plurality of point features and a plurality of line features corresponding to the target monocular image; A removal unit, used to remove abnormal points from the multiple point features to obtain multiple target point features corresponding to the target monocular image; a processing unit, configured to merge the plurality of line features according to the distance between the endpoints of each of the plurality of line features to obtain a plurality of first line features; and to filter the plurality of first line features to obtain a plurality of target line features corresponding to the target monocular image; an execution unit, configured to execute a positioning operation of the movable device according to the plurality of target point features, the plurality of target line features and the inertial measurement unit data; The filtering and processing of the plurality of first line features to obtain a plurality of target line features corresponding to the target monocular image includes: According to the width and height of the target monocular image, the number of the plurality of first line features and the length factor, the plurality of first line features are screened and processed, and a plurality of second line features are determined from the plurality of first line features; According to the distance between the target monocular image and the immediately previous monocular image being less than a preset threshold, screening the plurality of second line features, and determining a plurality of third line features from the plurality of second line features; The plurality of third line features are screened according to the vanishing points corresponding to the plurality of third line features to obtain the plurality of target line features.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the positioning method for a movable device as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the positioning method of a movable device as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the positioning method of a movable device as claimed in any one of claims 1 to 6 is implemented.
