[go: up one dir, main page]

CN117213515A - Visual SLAM path planning method and device, electronic equipment and storage medium - Google Patents

Visual SLAM path planning method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117213515A
CN117213515A CN202311170257.7A CN202311170257A CN117213515A CN 117213515 A CN117213515 A CN 117213515A CN 202311170257 A CN202311170257 A CN 202311170257A CN 117213515 A CN117213515 A CN 117213515A
Authority
CN
China
Prior art keywords
path planning
map
algorithm
point
camera
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311170257.7A
Other languages
Chinese (zh)
Inventor
王美恒
宋呈群
程俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Institute of Advanced Technology of CAS
Original Assignee
Shenzhen Institute of Advanced Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Institute of Advanced Technology of CAS filed Critical Shenzhen Institute of Advanced Technology of CAS
Priority to CN202311170257.7A priority Critical patent/CN117213515A/en
Publication of CN117213515A publication Critical patent/CN117213515A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Image Analysis (AREA)

Abstract

本申请涉及一种视觉SLAM路径规划方法、装置、电子设备以及存储介质。所述方法包括:获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;通过相机获取当前图像帧,对当前图像帧进行ORB特征点提取,并将ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息;通过深度学习模型对所述当前图像帧进行目标点检测,并利用位姿变换计算得到目标点的位置坐标;以所述相机的位姿信息作为路径规划的起始点,以所述目标点的位置坐标作为路径规划的终点,使用路径规划算法在所述离线地图上进行路径规划。本申请实施例充分利用了离线地图的信息,能够较为准确地匹配特征点与地图点,得到较为准确的位姿信息。

This application relates to a visual SLAM path planning method, device, electronic equipment and storage medium. The method includes: obtaining an offline map of the current scene, which is pre-constructed by a SLAM algorithm; obtaining the current image frame through a camera, extracting ORB feature points on the current image frame, and comparing the ORB feature points with the current scene Match the offline map to obtain the pose information of the camera; perform target point detection on the current image frame through a deep learning model, and use pose transformation to calculate the position coordinates of the target point; use the pose of the camera The information is used as the starting point of path planning, the location coordinates of the target point are used as the end point of path planning, and a path planning algorithm is used to perform path planning on the offline map. The embodiments of this application make full use of offline map information, can more accurately match feature points and map points, and obtain more accurate pose information.

Description

视觉SLAM路径规划方法、装置、电子设备及存储介质Visual SLAM path planning method, device, electronic equipment and storage medium

技术领域Technical field

本申请属于同步定位与建图技术领域,特别涉及一种视觉SLAM路径规划方法、装置、电子设备以及存储介质。This application belongs to the technical field of simultaneous positioning and mapping, and particularly relates to a visual SLAM path planning method, device, electronic equipment and storage medium.

背景技术Background technique

对于视障人士来说,一旦出门,可能要面临比身体残障更无力的状况,如奇形怪状的盲道,没有提示的红绿灯,缺失的导盲犬或是拒入导盲犬的交通工具和餐厅……。因此,有高达30%的视障人士选择不踏出家门一步。如何帮助盲人建立日常生活中对外界的感知及导盲问题,是现亟需解决的问题。For the visually impaired, once they go out, they may face situations that are more powerless than physical disabilities, such as weird blind roads, traffic lights without prompts, missing guide dogs, or transportation and restaurants that refuse to admit guide dogs... . Therefore, up to 30% of visually impaired people choose not to step out of their homes. How to help blind people establish their perception of the outside world and guide them in their daily lives is an urgent problem that needs to be solved.

在现有的导盲技术领域,通常采用视觉SLAM(Simultaneous Localization andMapping,同步定位与建图)技术引导视力受损人士移动,视觉SLAM可以帮助视力受损人士定位自身的位置以及建立对周围环境的感知,所采用的视觉SLAM方法决定了导盲的效果。SLAM是指在没有先验信息的情况下,利用搭载在机器人上的传感器感知周围环境,在运动过程中建立环境模型,同时估计自身定位的技术。然而,现有技术中的视觉SLAM技术并没有利用场景中的离线地图信息,导致特征点与地图点匹配不够准确,得到的位姿信息精确度不高,最终影响导盲效果。In the field of existing guide technology for the blind, visual SLAM (Simultaneous Localization and Mapping) technology is usually used to guide visually impaired people to move. Visual SLAM can help visually impaired people locate their own position and establish an understanding of the surrounding environment. Perception, the visual SLAM method used determines the effect of guiding the blind. SLAM refers to a technology that uses sensors mounted on a robot to sense the surrounding environment without prior information, build an environment model during movement, and estimate its own positioning at the same time. However, the existing visual SLAM technology does not make use of the offline map information in the scene, resulting in inaccurate matching of feature points and map points, and the resulting pose information is not highly accurate, ultimately affecting the blind guidance effect.

发明内容Contents of the invention

本申请提供了一种视觉SLAM路径规划方法、装置、电子设备以及存储介质,旨在至少在一定程度上解决现有技术中的上述技术问题之一。This application provides a visual SLAM path planning method, device, electronic device, and storage medium, aiming to solve one of the above technical problems in the prior art at least to a certain extent.

为了解决上述问题,本申请提供了如下技术方案:In order to solve the above problems, this application provides the following technical solutions:

一种视觉SLAM路径规划方法,包括:A visual SLAM path planning method, including:

获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;Obtain the offline map of the current scene, which is pre-constructed by the SLAM algorithm;

通过相机获取当前图像帧,采用ORB算法对所述当前图像帧进行ORB特征点提取,并通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息;Obtain the current image frame through the camera, use the ORB algorithm to extract ORB feature points from the current image frame, and use the relocation algorithm to match the ORB feature points with the offline map of the current scene to obtain the pose information of the camera ;

通过深度学习模型对所述当前图像帧进行目标点检测,并利用位姿变换计算得到目标点的位置坐标;Perform target point detection on the current image frame through a deep learning model, and use pose transformation to calculate the position coordinates of the target point;

以所述相机的位姿信息作为路径规划的起始点,以所述目标点的位置坐标作为路径规划的终点,使用路径规划算法在所述离线地图上进行路径规划。The pose information of the camera is used as the starting point of path planning, the position coordinates of the target point are used as the end point of path planning, and a path planning algorithm is used to perform path planning on the offline map.

本申请实施例采取的技术方案还包括:所述离线地图包括当前场景的点云地图与八叉树地图,所述获取当前场景的离线地图具体为:The technical solution adopted by the embodiment of this application also includes: the offline map includes a point cloud map and an octree map of the current scene. The specific steps of obtaining the offline map of the current scene are:

使用SLAM算法对所述当前场景进行建图,得到点云地图;Use the SLAM algorithm to map the current scene and obtain a point cloud map;

使用层次聚类算法将所述点云地图中的地图点描述符形成K叉树格式,将所述点云地图转换为八叉树地图;Use a hierarchical clustering algorithm to form the map point descriptors in the point cloud map into a K-tree format, and convert the point cloud map into an octree map;

将所述点云地图与八叉树地图保存成文件格式。Save the point cloud map and octree map into a file format.

本申请实施例采取的技术方案还包括:所述ORB特征点包括关键点和描述符,所述通过相机获取当前图像帧,采用ORB算法对所述当前图像帧进行ORB特征点提取包括:The technical solution adopted by the embodiment of the present application also includes: the ORB feature points include key points and descriptors, and obtaining the current image frame through a camera and using the ORB algorithm to extract ORB feature points from the current image frame includes:

利用FAST算法在所述当前图像帧中寻找高强度变化的像素点作为关键点;Use the FAST algorithm to find pixels with high intensity changes in the current image frame as key points;

计算所述关键点周围的灰度梯度方向,根据所述灰度梯度方向确定关键点的方向,并将其作为ORB特征点的方向;Calculate the gray gradient direction around the key point, determine the direction of the key point based on the gray gradient direction, and use it as the direction of the ORB feature point;

对于每个关键点,使用BRIEF算法生成一个固定长度的二进制描述符,通过比较特定位置的像素对生成二进制编码,所述二进制编码对应于关键点周围的图像区域。For each keypoint, a fixed-length binary descriptor is generated using the BRIEF algorithm, which compares pairs of pixels at specific locations to generate a binary code that corresponds to the image area around the keypoint.

本申请实施例采取的技术方案还包括:所述通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息具体为:The technical solution adopted by the embodiment of the present application also includes: matching the ORB feature points with the offline map of the current scene through a relocation algorithm to obtain the pose information of the camera as follows:

将所述ORB特征点的描述符与所述离线地图的地图点描述符进行匹配,得到若干对匹配点;Match the descriptors of the ORB feature points with the map point descriptors of the offline map to obtain several pairs of matching points;

使用N点透视位姿求解算法对所述匹配点进行位姿求解。An N-point perspective pose solving algorithm is used to solve the pose of the matching points.

本申请实施例采取的技术方案还包括:所述通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息之后,还包括:The technical solution adopted by the embodiment of the present application also includes: matching the ORB feature points with the offline map of the current scene through a relocation algorithm, and after obtaining the pose information of the camera, it also includes:

使用光束平差法对所述当前相机的位姿信息与IMU数据进行优化,得到优化后的位姿信息。The beam adjustment method is used to optimize the pose information of the current camera and the IMU data to obtain optimized pose information.

本申请实施例采取的技术方案还包括:所述通过深度学习模型对所述当前图像帧进行目标点检测,并利用位姿变换计算得到目标点的位置坐标具体为:The technical solution adopted by the embodiment of the present application also includes: performing target point detection on the current image frame through a deep learning model, and using pose transformation to calculate the position coordinates of the target point, specifically:

使用深度学习模型对所述当前图像帧进行目标点检测,得到所述目标点的图像检测框及图像检测框的图像坐标;Use a deep learning model to perform target point detection on the current image frame, and obtain the image detection frame of the target point and the image coordinates of the image detection frame;

基于所述图像坐标通过位姿变换计算得到目标点的世界坐标。The world coordinates of the target point are calculated through pose transformation based on the image coordinates.

本申请实施例采取的技术方案还包括:所述使用路径规划算法在所述离线地图上进行路径规划之后,还包括:The technical solution adopted by the embodiment of the present application also includes: after using the path planning algorithm to perform path planning on the offline map, it also includes:

基于路径规划结果,将路线信息转为语音播放。Based on the path planning results, the route information is converted into voice playback.

本申请实施例采取的另一技术方案为:一种视觉SLAM路径规划装置,包括:Another technical solution adopted by the embodiment of the present application is: a visual SLAM path planning device, including:

离线构建模块:用于获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;Offline building module: used to obtain the offline map of the current scene, which is pre-constructed by the SLAM algorithm;

在线匹配模块:用于通过相机获取当前图像帧,采用ORB算法对所述当前图像帧进行ORB特征点提取,并通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息;Online matching module: used to obtain the current image frame through the camera, use the ORB algorithm to extract ORB feature points from the current image frame, and match the ORB feature points with the offline map of the current scene through the relocation algorithm to obtain the Describes the camera’s pose information;

目标检测模块:用于通过深度学习模型对所述当前图像帧进行目标点检测,并利用位姿变换计算得到目标点的位置坐标;Target detection module: used to perform target point detection on the current image frame through a deep learning model, and use pose transformation to calculate the position coordinates of the target point;

路径规划模块:用于以所述相机的位姿信息作为路径规划的起始点,以所述目标点的位置坐标作为路径规划的终点,使用路径规划算法在所述离线地图上进行路径规划。Path planning module: used to use the pose information of the camera as the starting point of path planning, use the position coordinates of the target point as the end point of path planning, and use a path planning algorithm to perform path planning on the offline map.

本申请实施例采取的又一技术方案为:一种电子设备,所述电子设备包括处理器、存储器、存储在所述存储器中并可在所述处理器上运行的计算机程序、通信接口以及外部设备;所述处理器执行所述计算机程序时实现上述的视觉SLAM路径规划方法。Another technical solution adopted by the embodiment of the present application is: an electronic device. The electronic device includes a processor, a memory, a computer program stored in the memory and executable on the processor, a communication interface, and an external Equipment; the processor implements the above visual SLAM path planning method when executing the computer program.

本申请实施例采取的又一技术方案为:一种存储介质,所述存储介质存储有处理器可运行的计算机程序,所述计算机程序用于执行上述的视觉SLAM路径规划方法。Another technical solution adopted by the embodiments of the present application is: a storage medium that stores a computer program executable by a processor, and the computer program is used to execute the above visual SLAM path planning method.

相对于现有技术,本申请实施例产生的有益效果在于:本申请实施例的视觉SLAM路径规划方法、装置、电子设备以及存储介质通过预先构建当前场景的离线地图,通过重定位算法与离线地图匹配计算当前位姿信息,使用深度学习模型对当前图像帧进行目标点检测,得到当前图像帧中的目标点检测框坐标并变换到世界坐标,基于当前位姿信息和目标点的世界坐标进行路径规划。本申请实施例充分利用了离线地图的信息,能够较为准确地匹配特征点与地图点,得到较为准确的位姿信息,对于视觉SLAM中的重定位任务具有更好的适应性,可以更好地帮助视力受损人士建立日常生活中对外界的感知及导盲。Compared with the existing technology, the beneficial effects produced by the embodiments of the present application are: the visual SLAM path planning method, device, electronic device and storage medium of the embodiments of the present application pre-construct an offline map of the current scene, and use the relocation algorithm and the offline map Match and calculate the current pose information, use the deep learning model to detect the target point in the current image frame, obtain the coordinates of the target point detection frame in the current image frame and transform them into world coordinates, and perform path based on the current pose information and the world coordinates of the target point planning. The embodiments of this application make full use of offline map information, can more accurately match feature points and map points, obtain more accurate pose information, have better adaptability to the relocation task in visual SLAM, and can better Help visually impaired people to establish their perception and guidance of the outside world in daily life.

附图说明Description of drawings

图1是本申请第一实施例的视觉SLAM路径规划方法的流程图;Figure 1 is a flow chart of the visual SLAM path planning method according to the first embodiment of the present application;

图2是本申请第二实施例的视觉SLAM路径规划方法的流程图;Figure 2 is a flow chart of the visual SLAM path planning method according to the second embodiment of the present application;

图3为本申请实施例的视觉SLAM路径规划装置结构示意图;Figure 3 is a schematic structural diagram of the visual SLAM path planning device according to the embodiment of the present application;

图4为本申请实施例的电子设备结构示意图。Figure 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

本申请中的术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括至少一个该特征。本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。本申请实施例中所有方向性指示(诸如上、下、左、右、前、后……)仅用于解释在某一特定姿态(如附图所示)下各部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或电子设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或电子设备固有的其它步骤或单元。The terms “first”, “second” and “third” in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Thus, features defined as "first", "second", and "third" may explicitly or implicitly include at least one of these features. In the description of this application, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically limited. All directional indications (such as up, down, left, right, front, back...) in the embodiments of this application are only used to explain the relative positional relationship between components in a specific posture (as shown in the drawings). , sports conditions, etc., if the specific posture changes, the directional indication will also change accordingly. Furthermore, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or electronic device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also Includes other steps or units inherent to such processes, methods, products, or electronic devices.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art understand, both explicitly and implicitly, that the embodiments described herein may be combined with other embodiments.

请参阅图1,是本申请第一实施例的视觉SLAM路径规划方法的流程图,该视觉SLAM路径规划方法可应用于智能手机、增强现实(augmented reality,AR)/虚拟现实(virtualreality,VR)设备、平板电脑等电子设备,本申请实施例对电子设备的具体类型不作任何限制。Please refer to Figure 1, which is a flow chart of the visual SLAM path planning method according to the first embodiment of the present application. The visual SLAM path planning method can be applied to smartphones, augmented reality (AR)/virtual reality (VR) devices, tablet computers and other electronic devices. The embodiments of this application do not place any restrictions on the specific types of electronic devices.

具体的,本申请第一实施例的视觉SLAM路径规划方法包括以下步骤:Specifically, the visual SLAM path planning method in the first embodiment of this application includes the following steps:

S100:获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;S100: Obtain the offline map of the current scene, which is pre-constructed by the SLAM algorithm;

本步骤中,离线地图包括当前场景的点云地图与八叉树地图,所述离线地图的构建方式具体包括:In this step, the offline map includes the point cloud map and the octree map of the current scene. The construction method of the offline map specifically includes:

S101:使用SLAM算法对当前场景进行建图,得到点云地图;S101: Use the SLAM algorithm to map the current scene and obtain a point cloud map;

其中,点云地图是一种三维地图表示方法,由大量的离散点组成,每个点都具有空间坐标以及颜色和法线等其他属性。点云地图通过激光雷达或其他传感器获取点云数据,用于描述环境的三维结构和特征。点云地图能够提供更精确和详细的环境模型,以支持自动驾驶、机器人导航等应用。Among them, point cloud map is a three-dimensional map representation method, which consists of a large number of discrete points. Each point has spatial coordinates and other attributes such as color and normal. Point cloud maps obtain point cloud data through lidar or other sensors to describe the three-dimensional structure and characteristics of the environment. Point cloud maps can provide more accurate and detailed environmental models to support applications such as autonomous driving and robot navigation.

S102:使用层次聚类算法将点云地图中的地图点描述符形成K叉树格式,将点云地图转换为八叉树地图;S102: Use hierarchical clustering algorithm to form the map point descriptors in the point cloud map into K-ary tree format, and convert the point cloud map into an octree map;

其中,八叉树地图是点云地图的一种常用数据结构,通过将空间划分为八个相等大小的子区域,并在每个子区域中递归地进行划分,从而将点云数据组织成树状结构,每个节点代表一个子区域,包含该区域内的点云数据或其他属性。这种分层的结构使得八叉树地图能够高效地存储和访问点云数据,能够更好的适用于动态环境、局部地图更新和快速搜索等应用场景。Among them, octree map is a common data structure for point cloud maps. It organizes point cloud data into a tree by dividing the space into eight equal-sized sub-regions and recursively dividing in each sub-region. Structure, each node represents a sub-region, containing point cloud data or other attributes within the region. This layered structure enables octree maps to efficiently store and access point cloud data, and is better suited to application scenarios such as dynamic environments, local map updates, and fast searches.

S103:将点云地图与八叉树地图保存成文件格式;S103: Save the point cloud map and octree map into file format;

S110:基于当前场景的离线地图,使用相机获取当前图像帧,并采用ORB(OrientedFAST and Rotated BRIEF)算法对当前图像帧进行ORB特征点提取;S110: Based on the offline map of the current scene, use the camera to obtain the current image frame, and use the ORB (OrientedFAST and Rotated BRIEF) algorithm to extract ORB feature points of the current image frame;

本步骤中,所使用的相机包括但不限于双目相机或RGB-D相机等。ORB算法是一种在计算机视觉中人工设计的特征点描述符算法,它结合了FAST(Features fromAccelerated Segment Test)关键点检测算法和BRIEF(Binary Robust IndependentElementary Features)描述符算法的优点,能够在不同尺度、旋转和光照条件下鲁棒地检测和描述图像的特征点。In this step, the cameras used include but are not limited to binocular cameras or RGB-D cameras. The ORB algorithm is a manually designed feature point descriptor algorithm in computer vision. It combines the advantages of the FAST (Features from Accelerated Segment Test) key point detection algorithm and the BRIEF (Binary Robust Independent Elementary Features) descriptor algorithm, and can Robustly detect and describe image feature points under , rotation and lighting conditions.

本申请实施例中,ORB特征点包括关键点(Key-point)和描述符(Descriptor)两部分,采用ORB算法进行的ORB特征点提取过程具体为:首先利用FAST算法在当前图像帧中寻找高强度变化的像素点作为关键点;然后,计算关键点周围的灰度梯度方向,将灰度梯度方向作为ORB特征点的方向,使得ORB特征点能够在不同旋转角度下具有不变性,从而提高鲁棒性和匹配性能。对于每个关键点,使用BRIEF算法生成一个固定长度的二进制描述符,通过比较特定位置的像素对生成二进制编码,二进制编码对应于关键点周围的图像区域。由于使用二进制描述符,ORB特征点具有快速匹配和高效存储的特性。In the embodiment of this application, ORB feature points include two parts: key-point and descriptor. The ORB feature point extraction process using the ORB algorithm is specifically: first, use the FAST algorithm to find high-resolution features in the current image frame. The pixel points with changing intensity are used as key points; then, the gray gradient direction around the key points is calculated, and the gray gradient direction is used as the direction of the ORB feature point, so that the ORB feature point can be invariant under different rotation angles, thus improving the accuracy of the algorithm. Stickiness and matching performance. For each keypoint, a fixed-length binary descriptor is generated using the BRIEF algorithm, which compares pairs of pixels at specific locations to generate a binary code that corresponds to the image area around the keypoint. Due to the use of binary descriptors, ORB feature points have the characteristics of fast matching and efficient storage.

S120:通过重定位算法将ORB特征点与当前场景的离线地图进行匹配,得到当前相机的位姿信息,将当前相机的位姿信息作为路径规划的起始点;S120: Match the ORB feature points with the offline map of the current scene through the relocation algorithm to obtain the pose information of the current camera, and use the pose information of the current camera as the starting point of path planning;

本申请实施例中,ORB特征点与离线地图的匹配过程具体为:将当前图像帧的ORB特征点的描述符与离线地图的地图点描述符进行匹配,得到若干对匹配点,并使用PnP(Perspective-n-Point,N点透视位姿求解)算法对匹配点进行位姿求解。其中,PnP算法是一种计算机视觉中用于求解相机位姿的算法,它通过已知的三维点和对应图像中的二维点进行相机位姿估计。PnP算法的基本原理是利用至少3个非共线的三维点和它们在图像中对应的二维点,通过求解透视变换矩阵来计算相机的位姿。PnP算法的输入包括三维点的坐标和对应图像的二维点坐标,输出为相机的旋转矩阵和平移向量。In the embodiment of this application, the matching process of ORB feature points and offline maps is specifically: matching the descriptors of ORB feature points of the current image frame with the map point descriptors of the offline map to obtain several pairs of matching points, and use PnP ( Perspective-n-Point, N-point perspective pose solution) algorithm solves the pose of matching points. Among them, the PnP algorithm is an algorithm used in computer vision to solve the camera pose. It estimates the camera pose through known three-dimensional points and two-dimensional points in the corresponding image. The basic principle of the PnP algorithm is to use at least three non-collinear three-dimensional points and their corresponding two-dimensional points in the image to calculate the camera pose by solving the perspective transformation matrix. The input of the PnP algorithm includes the coordinates of the three-dimensional point and the coordinates of the two-dimensional point of the corresponding image, and the output is the rotation matrix and translation vector of the camera.

进一步地,PnP算法包括EPnP(Efficient PnP)、UPnP(Uncalibrated PnP)以及Direct Linear Transform(DLT)等多种求解算法,其中:EPnP算法通过最小化重投影误差来求解相机位姿,采用线性最小二乘方法,并利用SVD分解来计算相机的位姿,具有较高的计算效率和精度。UPnP算法是在相机未进行内部标定的情况下,通过最小化射线投影误差估计相机的位姿。UPnP算法需要已知的相机视角、相机平面和三维点的深度信息等约束条件。DLT算法是一种经典的求解PnP问题试验费,通过对透视变换矩阵进行线性求解来估计相机的位姿。DLT算法在计算精度方面可能受到噪声和误差的影响,因此通常需要采用非线性优化算法进行进一步的精确估计。Furthermore, PnP algorithms include EPnP (Efficient PnP), UPnP (Uncalibrated PnP) and Direct Linear Transform (DLT) and other solving algorithms. Among them: EPnP algorithm solves the camera pose by minimizing the reprojection error, using linear least square Multiplication method, and using SVD decomposition to calculate the camera pose, has high computational efficiency and accuracy. The UPnP algorithm estimates the camera's pose by minimizing the ray projection error when the camera is not internally calibrated. The UPnP algorithm requires known constraints such as camera angle of view, camera plane and depth information of three-dimensional points. The DLT algorithm is a classic method for solving the PnP problem. It estimates the camera's pose by linearly solving the perspective transformation matrix. DLT algorithms may be affected by noise and errors in terms of calculation accuracy, so nonlinear optimization algorithms are usually required for further accurate estimation.

S130:基于当前图像帧,通过深度学习模型对当前图像帧进行目标点检测,将目标点检测结果作为路径规划终点,并利用位姿变换计算路径规划终点的位置坐标;S130: Based on the current image frame, perform target point detection on the current image frame through the deep learning model, use the target point detection result as the end point of path planning, and use pose transformation to calculate the position coordinates of the end point of path planning;

本步骤中,所用深度学习模型包括但不限于YOLO或SSD(Single Shot MultiBoxDetector,单步多框目标检测)等。在本申请实施例中,以使用yolov5模型对当前图像帧进行目标点检测为例,其具体检测过程包括:In this step, the deep learning models used include but are not limited to YOLO or SSD (Single Shot MultiBox Detector, single-step multi-frame target detection). In the embodiment of this application, taking the use of the yolov5 model to detect target points in the current image frame as an example, the specific detection process includes:

S131:使用yolov5模型对当前图像帧进行目标点检测,得到目标点的图像检测框及图像检测框的图像坐标;S131: Use the yolov5 model to detect the target point in the current image frame, and obtain the image detection frame of the target point and the image coordinates of the image detection frame;

S132:基于图像坐标通过位姿变换计算得到目标点的世界坐标;S132: Calculate the world coordinates of the target point through pose transformation based on the image coordinates;

其中,世界坐标的计算过程具体包括:Among them, the calculation process of world coordinates specifically includes:

第一步:获取每个图像点的深度ziThe first step: obtain the depth z i of each image point;

其中,深度zi的获取方式包括:使用RGB-D深度相机从深度图中获取每个图像点的深度zi,或使用双目相机从视差图中恢复深度zi:已知双目相机的焦距f及基线b,使用OpenCV可以得到每个图像点的视差d,进一步求得每个图像点的深度ziAmong them, the depth z i is obtained by: using an RGB-D depth camera to obtain the depth z i of each image point from the depth map, or using a binocular camera to recover the depth z i from the disparity map: the binocular camera is known Focal length f and baseline b, use OpenCV to obtain the disparity d of each image point, and further obtain the depth z i of each image point:

第二步:计算所有图像点的深度平均值将深度平均值/>作为当前相机与目标点的距离:Step 2: Calculate the average depth of all image points average the depth/> As the distance between the current camera and the target point:

可选地,也可以使用外接超声波测距仪获取当前相机与目标点的距离。Optionally, you can also use an external ultrasonic rangefinder to obtain the distance between the current camera and the target point.

第三步:根据距离已被标定的相机内参矩阵K以及相机位姿Rcw与tcw计算得到目标点的世界坐标Pw为:Step 3: According to distance Calibrated camera internal parameter matrix K and camera pose R cw and t cw calculate the world coordinate P w of the target point as:

式(3)中,下标cw表示从世界坐标系变换到相机坐标系,下标w表示世界坐标系下的坐标。In formula (3), the subscript cw represents the transformation from the world coordinate system to the camera coordinate system, and the subscript w represents the coordinates in the world coordinate system.

S140:以当前相机的位姿信息作为路径规划起始点,以目标点的位置坐标作为路径规划终点,使用路径规划算法在八叉树地图上进行路径规划;S140: Use the pose information of the current camera as the starting point of path planning, use the position coordinates of the target point as the end point of path planning, and use the path planning algorithm to perform path planning on the octree map;

本步骤中,路径规划算法可以选择双向快速扩展随机树(RRT-Connect)算法或快速探索随机树(Rapid-exploring random tree,RRT)算法。本申请对路径规划的具体实现方式不做限制。以双向快速扩展随机树(RRT-Connect)算法为例,路径规划过程具体为:从起始点和目标点分别生长两棵扩展树,在每一次迭代过程中,对其中一棵树进行扩展,并尝试连接另一棵树的最近节点以扩展新节点。In this step, the path planning algorithm can select the bidirectional rapidly expanding random tree (RRT-Connect) algorithm or the rapid exploring random tree (Rapid-exploring random tree, RRT) algorithm. This application does not limit the specific implementation method of path planning. Taking the bidirectional rapidly expanding random tree (RRT-Connect) algorithm as an example, the path planning process is as follows: growing two expansion trees from the starting point and the target point respectively, and in each iteration process, one of the trees is expanded, and Try to connect the nearest node of another tree to extend the new node.

S150:基于路径规划结果,将路线信息转为语音播放;S150: Based on the path planning results, convert the route information into voice playback;

本申请实施例中,可使用TextToSpeech引擎进行语音播报。语音播报内容包括但不限于:与目标点的距离信息以及基于路径规划所得的行进路线信息等。In the embodiment of this application, the TextToSpeech engine can be used for voice broadcast. Voice broadcast content includes but is not limited to: distance information to the target point As well as travel route information based on path planning, etc.

基于上述,本申请第一实施例的视觉SLAM路径规划方法通过预先构建当前场景的离线地图,通过重定位算法与离线地图匹配计算当前位姿信息,使用深度学习模型对当前图像帧进行目标点检测,得到当前图像帧中的目标点检测框坐标并变换到世界坐标,基于当前位姿信息和目标点的世界坐标进行路径规划以及语音播报。本申请实施例充分利用了离线地图的信息,能够较为准确地匹配特征点与地图点,得到较为准确的位姿信息,对于视觉SLAM中的重定位任务具有更好的适应性,可以更好地帮助视力受损人士建立日常生活中对外界的感知及导盲。Based on the above, the visual SLAM path planning method of the first embodiment of the present application pre-constructs an offline map of the current scene, calculates the current pose information by matching the relocation algorithm with the offline map, and uses a deep learning model to perform target point detection on the current image frame. , obtain the coordinates of the target point detection frame in the current image frame and transform them into world coordinates, and perform path planning and voice broadcasting based on the current pose information and the world coordinates of the target point. The embodiments of this application make full use of offline map information, can more accurately match feature points and map points, obtain more accurate pose information, have better adaptability to the relocation task in visual SLAM, and can better Help visually impaired people to establish their perception and guidance of the outside world in daily life.

请参阅图2,是本申请第二实施例的视觉SLAM路径规划方法的流程图。本申请第二实施例的视觉SLAM路径规划方法包括以下步骤:Please refer to Figure 2, which is a flow chart of the visual SLAM path planning method according to the second embodiment of the present application. The visual SLAM path planning method in the second embodiment of this application includes the following steps:

S200:获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;S200: Obtain the offline map of the current scene, which is pre-constructed by the SLAM algorithm;

该步骤与第一实施例中的S100相同,具体可参见S100的相关描述,在此不再赘述。This step is the same as S100 in the first embodiment. For details, please refer to the relevant description of S100 and will not be described again here.

S210:基于当前场景的离线地图,使用相机获取当前图像帧,并采用ORB(OrientedFAST and Rotated BRIEF)算法对当前图像帧进行特征点提取;S210: Based on the offline map of the current scene, use the camera to obtain the current image frame, and use the ORB (OrientedFAST and Rotated BRIEF) algorithm to extract feature points of the current image frame;

该步骤与第一实施例中S110相同,具体可参见S110的相关描述,在此不再赘述。This step is the same as S110 in the first embodiment. For details, please refer to the relevant description of S110 and will not be described again here.

S220:通过重定位算法将ORB特征点与当前场景的离线地图进行匹配,得到当前相机的位姿信息,将当前相机的位姿信息作为路径规划的起始点;S220: Match the ORB feature points with the offline map of the current scene through the relocation algorithm to obtain the pose information of the current camera, and use the pose information of the current camera as the starting point of path planning;

该步骤与第一实施例中S120相同,具体可参见S120的相关描述,在此不再赘述。This step is the same as S120 in the first embodiment. For details, please refer to the relevant description of S120 and will not be described again here.

S230:使用光束平差法对当前相机的位姿信息与IMU数据进行优化,得到优化后的位姿信息;S230: Use the beam adjustment method to optimize the current camera's pose information and IMU data to obtain the optimized pose information;

本步骤中,IMU(Inertial Measurement Unit,惯性传感器)是一种集成了多个惯性传感器的装置,用于测量物体的加速度和角速度。IMU通常由两个主要的传感器组成:加速度计和陀螺仪。加速度计:加速度计用于测量物体在三个轴向上的加速度,可以检测物体的线性运动和重力加速度。加速度计的输出单位是m/s2,可以通过积分加速度数据来计算速度和位置。陀螺仪:陀螺仪用于测量物体围绕三个轴向的角速度,可以检测物体的旋转和角度变化。陀螺仪的输出单位是度/秒或弧度/秒,可以通过积分角速度数据来计算姿态和方向。IMU通常被应用于惯性导航、姿态估计和运动跟踪等领域。通过结合加速度计和陀螺仪的数据,可以估计物体的姿态和运动状态。在视觉惯性SLAM中,需要测量第i帧位姿Ti和速度vi,以及陀螺仪和加速度计的偏置和/>具体地:In this step, IMU (Inertial Measurement Unit, inertial sensor) is a device that integrates multiple inertial sensors and is used to measure the acceleration and angular velocity of the object. IMU usually consists of two main sensors: accelerometer and gyroscope. Accelerometer: The accelerometer is used to measure the acceleration of an object in three axes and can detect the linear motion of the object and the acceleration of gravity. The output unit of the accelerometer is m/s 2 , and velocity and position can be calculated by integrating the acceleration data. Gyroscope: Gyroscope is used to measure the angular velocity of an object around three axes and can detect the rotation and angle changes of the object. The gyroscope's output units are degrees/second or radians/second, and attitude and orientation can be calculated by integrating angular velocity data. IMU is usually used in fields such as inertial navigation, attitude estimation and motion tracking. By combining data from accelerometers and gyroscopes, the attitude and motion of an object can be estimated. In visual inertial SLAM, it is necessary to measure the pose T i and velocity v i of the i-th frame, as well as the offsets of the gyroscope and accelerometer. and/> specifically:

Ti=[Ri,pi]∈SE(3) (4)T i =[R i , p i ]∈SE(3) (4)

需要在连续视觉帧i和i+1之间获得IMU预积分测量值,为ΔRi,i+1,Δvi,i+1,Δpi,i+1以及整个测量向量的协方差矩陌和惯性残差/> It is necessary to obtain IMU pre-integrated measurements between consecutive visual frames i and i+1 for ΔR i,i+1 , Δv i,i+1 , Δp i,i+1 and the covariance moment of the entire measurement vector and inertia residual/>

其中Log:SO(3)→R3表示从李群映射到李代数。连同惯性残差,使用帧i和位置xj处的3D点j之间的重投影误差rijWhere Log: SO(3)→R 3 represents the mapping from Lie group to Lie algebra. Together with the inertial residual, the reprojection error r ij between frame i and 3D point j at position x j is used:

式中,Π:R3→Rn是对应相机模型的投影函数,uij是在图像帧i上对点j的观测,具有协方差矩阵∑ij,TCB∈SE(3)代表从本体IMU到相机(左或右)的刚性变换,从校准中已知,是SE(3)群在R3元素上的变换运算。In the formula, Π: R 3 → R n is the projection function of the corresponding camera model, u ij is the observation of point j on image frame i, with a covariance matrix ∑ ij , T CB ∈SE (3) represents the IMU from the ontology Rigid transformation to camera (left or right), known from calibration, is the transformation operation of the SE(3) group on R 3 elements.

在本申请实施例中,相机可以近似为IMU的位置,TCB可以近似为单位矩阵I;定义状态向量:In the embodiment of this application, the camera can be approximated as the position of the IMU, and T CB can be approximated as the unit matrix I; define the state vector:

给定一组k+1个关键帧及其状态和一组l个三维点及其状态视觉惯性优化问题可以表述如下:Given a set of k+1 keyframes and their states and a set of l three-dimensional points and their states The visual inertia optimization problem can be formulated as follows:

其中κj是观察三维点j的关键帧集。对于重投影误差,使用鲁棒的Huber核ρHub来减少误匹配的影响。where κ j is the set of key frames for observing three-dimensional point j. For reprojection errors, the robust Huber kernel ρ Hub is used to reduce the impact of mismatching.

S240:基于当前图像帧,通过深度学习模型对当前图像帧进行目标点检测,将目标点检测结果作为路径规划终点,并利用位姿变换计算得到路径规划终点的位置坐标;S240: Based on the current image frame, perform target point detection on the current image frame through the deep learning model, use the target point detection result as the end point of path planning, and use pose transformation to calculate the position coordinates of the end point of path planning;

该步骤与第一实施例中S130相同,具体可参见S130的相关描述,在此不再赘述。This step is the same as S130 in the first embodiment. For details, please refer to the relevant description of S130, which will not be described again here.

S250:以当前相机的位姿信息作为路径规划的起始点,以目标点的位置坐标作为路径规划的终点,使用路径规划算法在八叉树地图上进行路径规划;S250: Use the pose information of the current camera as the starting point of path planning, use the position coordinates of the target point as the end point of path planning, and use the path planning algorithm to perform path planning on the octree map;

该步骤与第一实施例中S140相同,具体可参见S140的相关描述,在此不再赘述。This step is the same as S140 in the first embodiment. For details, please refer to the relevant description of S140 and will not be described again here.

S260:基于路径规划结果,将路线信息转为语音播放;S260: Based on the path planning results, convert the route information into voice playback;

该步骤与第一实施例中S150相同,具体可参见S150的相关描述,在此不再赘述。This step is the same as S150 in the first embodiment. For details, please refer to the relevant description of S150 and will not be described again here.

基于上述,本申请第二实施例的视觉SLAM路径规划方法在第一实施例的基础上,通过光束平差法同时优化IMU数据与相机位姿信息,可以进一步提高精度和鲁棒性,从而得到更为准确的位姿信息。Based on the above, the visual SLAM path planning method in the second embodiment of the present application, based on the first embodiment, simultaneously optimizes the IMU data and camera pose information through the beam adjustment method, which can further improve the accuracy and robustness, thereby obtaining More accurate pose information.

请参阅图3,为本申请实施例的视觉SLAM路径规划装置结构示意图。本申请实施例的视觉SLAM路径规划装置包括:Please refer to Figure 3, which is a schematic structural diagram of a visual SLAM path planning device according to an embodiment of the present application. The visual SLAM path planning device in this embodiment of the present application includes:

离线构建模块31:用于获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;Offline construction module 31: used to obtain the offline map of the current scene, which is pre-constructed by the SLAM algorithm;

上述离线构建模块31包括:The above-mentioned offline building module 31 includes:

场景重建单元,用于使用SLAM算法对当前场景进行建图,得到点云地图;The scene reconstruction unit is used to map the current scene using the SLAM algorithm to obtain a point cloud map;

地图转化单元,用于将点云地图转换为八叉树地图;Map conversion unit, used to convert point cloud maps into octree maps;

地图保存单元,用于使用层次聚类算法将点云地图中的地图点对应的特征点描述符形成K叉树格式,并将点云地图与八叉树地图保存成文件格式。The map saving unit is used to use the hierarchical clustering algorithm to form the feature point descriptors corresponding to the map points in the point cloud map into a K-tree format, and save the point cloud map and the octree map into a file format.

在线匹配模块32,用于基于当前场景的离线地图,使用相机获取当前图像帧,并采用ORB算法对当前图像帧进行特征点提取,通过重定位算法将ORB特征点与当前场景的离线地图进行匹配,得到当前相机的位姿信息,将当前相机的位姿信息作为路径规划的起始点;The online matching module 32 is used for the offline map based on the current scene, using the camera to obtain the current image frame, and using the ORB algorithm to extract feature points of the current image frame, and matching the ORB feature points with the offline map of the current scene through the relocation algorithm. , obtain the pose information of the current camera, and use the pose information of the current camera as the starting point of path planning;

上述在线匹配模块32包括:The above-mentioned online matching module 32 includes:

特征点提取单元,用于提取当前图像帧的特征点;Feature point extraction unit, used to extract feature points of the current image frame;

重定位单元,用于将特征点与离线地图的地图点匹配,并计算当前相机的位姿信息;The relocation unit is used to match feature points with map points of the offline map and calculate the pose information of the current camera;

位姿优化单元,使用光束平差法对位姿信息与IMU数据进行优化,得到更为准确的位姿信息。The pose optimization unit uses the beam adjustment method to optimize pose information and IMU data to obtain more accurate pose information.

目标检测模块33,用于基于当前图像帧,通过深度学习模型对当前图像帧进行目标点检测,将目标点检测结果作为路径规划终点,并利用位姿变换计算得到路径规划终点的位置坐标;The target detection module 33 is used to perform target point detection on the current image frame based on the current image frame through a deep learning model, use the target point detection result as the end point of the path planning, and use pose transformation to calculate the position coordinates of the end point of the path planning;

上述目标检测模块33包括:The above-mentioned target detection module 33 includes:

目标检测单元,用于使用深度学习模型对当前图像帧进行目标点检测,得到目标点的图像检测框及图像检测框的图像坐标;The target detection unit is used to detect the target point of the current image frame using a deep learning model to obtain the image detection frame of the target point and the image coordinates of the image detection frame;

距离估计单元,用于计算当前相机与目标点的距离;Distance estimation unit, used to calculate the distance between the current camera and the target point;

坐标计算单元,用于根据距离、已被标定的相机内参矩阵以及相机位姿计算得到目标点的世界坐标。The coordinate calculation unit is used to calculate the world coordinates of the target point based on the distance, the calibrated camera internal parameter matrix, and the camera pose.

路径规划模块34:用于以当前相机的位姿信息作为路径规划的起始点,以目标点的位置坐标作为路径规划的终点,使用路径规划算法在八叉树地图上进行路径规划;Path planning module 34: used to use the pose information of the current camera as the starting point of path planning, use the position coordinates of the target point as the end point of path planning, and use the path planning algorithm to perform path planning on the octree map;

语音播报模块35:用于基于路径规划结果,将路线信息转为语音播放。Voice broadcast module 35: used to convert route information into voice broadcast based on the path planning results.

需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above-mentioned devices/units are based on the same concept as the method embodiments of the present application. For details of their specific functions and technical effects, please refer to the method embodiments section. No further details will be given.

本申请实施例提供的装置可以应用在前述方法实施例中,详情参见上述方法实施例的描述,在此不再赘述。The devices provided by the embodiments of the present application can be applied in the foregoing method embodiments. For details, please refer to the description of the foregoing method embodiments, which will not be described again here.

请参阅图4,是本申请实施例提供的电子设备的结构示意图。所述电子设备4包括:一个或多个处理器41(图中仅示出一个)、存储器42、存储在所述存储器42中并可在所述处理器41上运行的计算机程序43、通信接口44以及外部设备45。所述处理器41执行所述计算机程序43时实现上述各个视觉SLAM路径规划方法实施例中的步骤。Please refer to FIG. 4 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 4 includes: one or more processors 41 (only one is shown in the figure), a memory 42, a computer program 43 stored in the memory 42 and executable on the processor 41, and a communication interface. 44 and external devices 45. When the processor 41 executes the computer program 43, the steps in each of the above visual SLAM path planning method embodiments are implemented.

本领域技术人员可以理解,图4仅仅是电子设备4的示例,并不构成对电子设备4的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备还可以包括输入输出设备、网络接入设备、总线等。Those skilled in the art can understand that FIG. 4 is only an example of the electronic device 4 and does not constitute a limitation of the electronic device 4. It may include more or fewer components than shown in the figure, or some components may be combined, or different components may be used. , for example, the electronic device may also include input and output devices, network access devices, buses, etc.

所称处理器41可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(FieldProgrammable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器。The so-called processor 41 may be a central processing unit (CPU), or other general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor.

所述存储器42可以是所述电子设备4的内部存储单元,例如电子设备4的硬盘或内存。所述存储器42也可以是所述电子设备4的外部存储设备,例如所述电子设备4上配备的插接式硬盘,智能存储卡(smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash card)等进一步地,所述存储器42还可以既包括所述电子设备4的内部存储单元也包括外部存储设备。所述存储器42用于存储所述计算机程序以及所述电子设备所需的其他程序和数据。所述存储器42还可以用于暂时地存储己经输出或者将要输出的数据。The memory 42 may be an internal storage unit of the electronic device 4 , such as a hard disk or memory of the electronic device 4 . The memory 42 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), or a secure digital (SD) equipped on the electronic device 4. card, flash card, etc. Further, the memory 42 may also include both an internal storage unit of the electronic device 4 and an external storage device. The memory 42 is used to store the computer program and other programs and data required by the electronic device. The memory 42 can also be used to temporarily store data that has been output or is to be output.

所述外部设备可以是双目相机以及IMU。The external device may be a binocular camera and an IMU.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述装置中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units and modules is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs. Module completion means dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be hardware-based. It can also be implemented in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present application. For the specific working processes of the units and modules in the above device, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be described again here.

本申请实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。Embodiments of the present application also provide a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.

本申请实施例还提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现可实现上述各个方法实施例中的步骤。Embodiments of the present application also provide a computer program product. When the computer program product is run on an electronic device, the steps in each of the above method embodiments can be implemented when the electronic device is executed.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not detailed or documented in a certain embodiment, please refer to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能宄竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.

在本申请所提供的实施例中,应该理解到,所揭露的装置/电子设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/电子设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,买际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices/electronic devices and methods can be implemented in other ways. For example, the apparatus/electronic equipment embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple divisions. Units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the methods of the above embodiments, which can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer can When the program is executed by the processor, the steps of each of the above method embodiments can be implemented. Wherein, the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM) , random access memory (Random Access Memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately added or deleted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium Excludes electrical carrier signals and telecommunications signals.

以上所述实施例仅用以说明本申请的技术方案,而非对其限制:尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the above-mentioned implementations. The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions in the embodiments of this application, and should be included in within the protection scope of this application.

Claims (10)

1.一种视觉SLAM路径规划方法,其特征在于,包括:1. A visual SLAM path planning method, characterized by including: 获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;Obtain the offline map of the current scene, which is pre-constructed by the SLAM algorithm; 通过相机获取当前图像帧,采用ORB算法对所述当前图像帧进行ORB特征点提取,并通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息;Obtain the current image frame through the camera, use the ORB algorithm to extract ORB feature points from the current image frame, and use the relocation algorithm to match the ORB feature points with the offline map of the current scene to obtain the pose information of the camera ; 通过深度学习模型对所述当前图像帧进行目标点检测,并利用位姿变换计算得到目标点的位置坐标;Perform target point detection on the current image frame through a deep learning model, and use pose transformation to calculate the position coordinates of the target point; 以所述相机的位姿信息作为路径规划的起始点,以所述目标点的位置坐标作为路径规划的终点,使用路径规划算法在所述离线地图上进行路径规划。The pose information of the camera is used as the starting point of path planning, the position coordinates of the target point are used as the end point of path planning, and a path planning algorithm is used to perform path planning on the offline map. 2.根据权利要求1所述的视觉SLAM路径规划方法,其特征在于,所述离线地图包括当前场景的点云地图与八叉树地图,所述获取当前场景的离线地图具体为:2. The visual SLAM path planning method according to claim 1, characterized in that the offline map includes a point cloud map and an octree map of the current scene, and the obtaining the offline map of the current scene is specifically: 使用SLAM算法对所述当前场景进行建图,得到点云地图;Use the SLAM algorithm to map the current scene and obtain a point cloud map; 使用层次聚类算法将所述点云地图中的地图点描述符形成K叉树格式,将所述点云地图转换为八叉树地图;Use a hierarchical clustering algorithm to form the map point descriptors in the point cloud map into a K-tree format, and convert the point cloud map into an octree map; 将所述点云地图与八叉树地图保存成文件格式。Save the point cloud map and octree map into a file format. 3.根据权利要求2所述的视觉SLAM路径规划方法,其特征在于,所述ORB特征点包括关键点和描述符,所述通过相机获取当前图像帧,采用ORB算法对所述当前图像帧进行ORB特征点提取包括:3. The visual SLAM path planning method according to claim 2, characterized in that the ORB feature points include key points and descriptors, the current image frame is obtained through a camera, and the ORB algorithm is used to perform processing on the current image frame. ORB feature point extraction includes: 利用FAST算法在所述当前图像帧中寻找高强度变化的像素点作为关键点;Use the FAST algorithm to find pixels with high intensity changes in the current image frame as key points; 计算所述关键点周围的灰度梯度方向,根据所述灰度梯度方向确定关键点的方向,并将其作为ORB特征点的方向;Calculate the gray gradient direction around the key point, determine the direction of the key point based on the gray gradient direction, and use it as the direction of the ORB feature point; 对于每个关键点,使用BRIEF算法生成一个固定长度的二进制描述符,通过比较特定位置的像素对生成二进制编码,所述二进制编码对应于关键点周围的图像区域。For each keypoint, a fixed-length binary descriptor is generated using the BRIEF algorithm, which compares pairs of pixels at specific locations to generate a binary code that corresponds to the image area around the keypoint. 4.根据权利要求3所述的视觉SLAM路径规划方法,其特征在于,所述通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息具体为:4. The visual SLAM path planning method according to claim 3, characterized in that, by matching the ORB feature points with the offline map of the current scene through a relocation algorithm, the pose information of the camera is obtained. : 将所述ORB特征点的描述符与所述离线地图的地图点描述符进行匹配,得到若干对匹配点;Match the descriptors of the ORB feature points with the map point descriptors of the offline map to obtain several pairs of matching points; 使用N点透视位姿求解算法对所述匹配点进行位姿求解。An N-point perspective pose solving algorithm is used to solve the pose of the matching points. 5.根据权利要求4所述的视觉SLAM路径规划方法,其特征在于,所述通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息之后,还包括:5. The visual SLAM path planning method according to claim 4, characterized in that, after matching the ORB feature points with the offline map of the current scene through a relocation algorithm to obtain the pose information of the camera, Also includes: 使用光束平差法对所述当前相机的位姿信息与IMU数据进行优化,得到优化后的位姿信息。The beam adjustment method is used to optimize the pose information of the current camera and the IMU data to obtain optimized pose information. 6.根据权利要求1所述的视觉SLAM路径规划方法,其特征在于,所述通过深度学习模型对所述当前图像帧进行目标点检测,并利用位姿变换计算得到目标点的位置坐标具体为:6. The visual SLAM path planning method according to claim 1, characterized in that the target point is detected on the current image frame through a deep learning model, and the position coordinates of the target point are calculated using pose transformation, specifically: : 使用深度学习模型对所述当前图像帧进行目标点检测,得到所述目标点的图像检测框及图像检测框的图像坐标;Use a deep learning model to perform target point detection on the current image frame, and obtain the image detection frame of the target point and the image coordinates of the image detection frame; 基于所述图像坐标通过位姿变换计算得到目标点的世界坐标。The world coordinates of the target point are calculated through pose transformation based on the image coordinates. 7.根据权利要求1至6任一项所述的视觉SLAM路径规划方法,其特征在于,所述使用路径规划算法在所述离线地图上进行路径规划之后,还包括:7. The visual SLAM path planning method according to any one of claims 1 to 6, characterized in that after using the path planning algorithm to perform path planning on the offline map, it also includes: 基于路径规划结果,将路线信息转为语音播放。Based on the path planning results, the route information is converted into voice playback. 8.一种视觉SLAM路径规划装置,其特征在于,包括:8. A visual SLAM path planning device, characterized by including: 离线构建模块:用于获取当前场景的离线地图,所述当前场景的离线地图由SLAM算法预先构建;Offline building module: used to obtain the offline map of the current scene, which is pre-constructed by the SLAM algorithm; 在线匹配模块:用于通过相机获取当前图像帧,采用ORB算法对所述当前图像帧进行ORB特征点提取,并通过重定位算法将所述ORB特征点与当前场景的离线地图进行匹配,得到所述相机的位姿信息;Online matching module: used to obtain the current image frame through the camera, use the ORB algorithm to extract ORB feature points from the current image frame, and match the ORB feature points with the offline map of the current scene through the relocation algorithm to obtain the Describes the camera’s pose information; 目标检测模块:用于通过深度学习模型对所述当前图像帧进行目标点检测,并利用位姿变换计算得到目标点的位置坐标;Target detection module: used to perform target point detection on the current image frame through a deep learning model, and use pose transformation to calculate the position coordinates of the target point; 路径规划模块:用于以所述相机的位姿信息作为路径规划的起始点,以所述目标点的位置坐标作为路径规划的终点,使用路径规划算法在所述离线地图上进行路径规划。Path planning module: used to use the pose information of the camera as the starting point of path planning, use the position coordinates of the target point as the end point of path planning, and use a path planning algorithm to perform path planning on the offline map. 9.一种电子设备,其特征在于,所述电子设备包括处理器、存储器、存储在所述存储器中并可在所述处理器上运行的计算机程序、通信接口以及外部设备;所述处理器执行所述计算机程序时实现权利要求1至7任一项所述的视觉SLAM路径规划方法。9. An electronic device, characterized in that the electronic device includes a processor, a memory, a computer program stored in the memory and executable on the processor, a communication interface, and an external device; the processor When the computer program is executed, the visual SLAM path planning method described in any one of claims 1 to 7 is implemented. 10.一种存储介质,其特征在于,所述存储介质存储有处理器可运行的计算机程序,所述计算机程序用于执行权利要求1至7任一项所述的视觉SLAM路径规划方法。10. A storage medium, characterized in that the storage medium stores a computer program executable by a processor, and the computer program is used to execute the visual SLAM path planning method according to any one of claims 1 to 7.
CN202311170257.7A 2023-09-11 2023-09-11 Visual SLAM path planning method and device, electronic equipment and storage medium Pending CN117213515A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311170257.7A CN117213515A (en) 2023-09-11 2023-09-11 Visual SLAM path planning method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311170257.7A CN117213515A (en) 2023-09-11 2023-09-11 Visual SLAM path planning method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117213515A true CN117213515A (en) 2023-12-12

Family

ID=89038185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311170257.7A Pending CN117213515A (en) 2023-09-11 2023-09-11 Visual SLAM path planning method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117213515A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119027638A (en) * 2024-10-24 2024-11-26 自然资源部第二海洋研究所 Marine visual SLAM ranging method, device, computer equipment and storage medium
CN119339050A (en) * 2024-12-18 2025-01-21 坤浪科技(上海)有限公司 A method, device, storage medium and equipment for vehicle positioning based on vision

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119027638A (en) * 2024-10-24 2024-11-26 自然资源部第二海洋研究所 Marine visual SLAM ranging method, device, computer equipment and storage medium
CN119027638B (en) * 2024-10-24 2025-03-25 自然资源部第二海洋研究所 Marine visual SLAM ranging method, device, computer equipment and storage medium
CN119339050A (en) * 2024-12-18 2025-01-21 坤浪科技(上海)有限公司 A method, device, storage medium and equipment for vehicle positioning based on vision

Similar Documents

Publication Publication Date Title
CN110070615B (en) Multi-camera cooperation-based panoramic vision SLAM method
JP6745328B2 (en) Method and apparatus for recovering point cloud data
KR102314228B1 (en) Map construction method, apparatus, device and readable storage medium
CN107990899B (en) Positioning method and system based on SLAM
CN110095752B (en) Positioning method, apparatus, device and medium
KR20220053513A (en) Image data automatic labeling method and device
CN109146938B (en) Method, device and equipment for calibrating position of dynamic obstacle and storage medium
Wendel et al. Natural landmark-based monocular localization for MAVs
US11227395B2 (en) Method and apparatus for determining motion vector field, device, storage medium and vehicle
WO2020063878A1 (en) Data processing method and apparatus
CN117213515A (en) Visual SLAM path planning method and device, electronic equipment and storage medium
CN110033489A (en) A kind of appraisal procedure, device and the equipment of vehicle location accuracy
US12046001B2 (en) Visual localization method, terminal, and server
CN114140527B (en) Dynamic environment binocular vision SLAM method based on semantic segmentation
WO2023283929A1 (en) Method and apparatus for calibrating external parameters of binocular camera
CN111801678A (en) City environment label
WO2022199195A1 (en) Map updating method and system, vehicle-mounted terminal, server, and storage medium
KR20200028210A (en) System for structuring observation data and platform for mobile mapping or autonomous vehicle
KR20200032776A (en) System for information fusion among multiple sensor platforms
WO2024021340A1 (en) Robot following method and apparatus, and robot and computer-readable storage medium
KR102249381B1 (en) System for generating spatial information of mobile device using 3D image information and method therefor
CN117830397A (en) Repositioning method, repositioning device, electronic equipment, medium and vehicle
CN110853098A (en) Robot positioning method, device, equipment and storage medium
CN113689499B (en) A visual rapid positioning method, device and system based on point-surface feature fusion
WO2025054774A1 (en) Visual slam-based path planning method and apparatus, electronic device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination