基于Bounding Box的激光点云聚类

本文介绍如何利用从2D图像检测到的ROI进行激光点云聚类,通过摄像头图像的YOLO物体识别提取bounding box,并讨论了处理重叠ROI和非精确矩形框匹配的问题,以创建3D物体。
摘要由CSDN通过智能技术生成

Camera系列文章

传感器融合是将多个传感器采集的数据进行融合处理,以更好感知周围环境;这里首先介绍Camera的相关内容,包括摄像头及图像知识基本介绍,OpenCV图像识别(特征提取,目标分类等),融合激光点云和图像进行TTC估计。

系列文章目录
1. 摄像头基础及校准
2. Lidar TTC估计
3. Camera TTC估计
4. OpenCV图像特征提取
5. 常见特征检测算法介绍
6. 常见特征描述符介绍
7. YOLOv3物体检测
8. 三维激光点云到二维图像的投影
9. 基于Bounding Box的激光点云聚类



前言

本节我们将通过从2D图像检测获取到的ROI(Region of interests)来对激光点云进行聚类,避免错误聚类。基于此初步的3D点云聚类,我们可以提取最近点的一些信息,比如距离,激光点云数量,目标物宽度等信息,这样我们就可以获取每个时间帧的信息,

基于ROI实现激光点云聚类

本节的主要目标是聚类场景中属于同一物体的激光点云,这里我们需要利用上一节的基于摄像头图像的YOLO物体识别方法,提取bounding box作为ROI(region of interest),以及描述物体类型的标签。
下面我们将利用ROI使空间中的3D激光点云和图像中的2D 物体关联。如下图所示,主要通过使用内外参等校准信息将所有激光点云投射到图像平面上。通过迭代所有激光灯和ROI,检查激光点云是否属于某一特定的bounding box。
在这里插入图片描述
如果某一点云在某一ROI内,则将其增加到boundingbox数据结构中,其中包含以下元素。

struct BoundingBox {
    // bounding box around a classified object (contains both 2D and 3D data)

    int boxID; // unique identifier for this bounding box
    int trackID; // unique identifier for the track to which this bounding box belongs

    cv::Rect roi; // 2D region-of-interest in image coordinates
    int classID; // ID based on class file provided to YOLO framework
    double confidence; // classification trust

    std::vector<LidarPoint> lidarPoints; // Lidar 3D points which project into 2D image roi
    std::vector<cv::KeyPoint> keypoints; // keypoints enclosed by 2D roi
    std::vector<cv::DMatch> kptMatches; // keypoint matches enclosed by 2D roi
};

“boxID”,“roi”,“classID”,“confidence”在目标检测中获取;激光点云聚类过程中,“lidarPoints”中加入相应的ROI矩形框内的所有激光点云。即上图中的,所有投影到摄像头图像中的激光点云与包围这些点云的ROI框关联。不在矩形框内的激光点云被忽略。
某些情况下,目标检测后返回的ROI过大从而导致矩形框重叠,这种情况下需要调整ROI大小,降低不在物体上的激光点云数量,具体实现如下所示,通过使用缩放因子shrinkFactor,相对原矩形框缩小的比例[%]。通常,使用的是5%~10%的比例,避免丢失太多的信息。某些情况下,bounding box严重偏大时,调整ROI区域大小是提高激光点云聚类质量的好办法。

        double shrinkFactor = 0.10;
        vector<vector<BoundingBox>::iterator> enclosingBoxes; // pointers to all bounding boxes which enclose the current Lidar point
        for (vector<BoundingBox>::iterator it2 = boundingBoxes.begin(); it2 != boundingBoxes.end(); ++it2)
        {
   
            // shrink current bounding box slightly to avoid having too many outlier points around the edges
            cv::Rect smallerBox;
            smallerBox.x = (*it2).roi.x + shrinkFactor * (*it2).roi.width / 2.0;
            smallerBox.y = (*it2).roi.y + shrinkFactor * (*it2).roi.height / 2.0;
            smallerBox.width = (*it2).roi.width * (1 - shrinkFactor);
            smallerBox.height = (*it2).roi.height * (1 - shrinkFactor);

            // check wether point is within current bounding box
            
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值