目标检测模块 - 功能概览

本文中,如果不作特别说明的均可以插上摄像头直接运行。另外,大部分程序都需要Nvidia Cuda环境,默认您有Nvidia显卡,并且按照环境配置完成相关配置,其他无需CUDA环境的程序会做特别说明。

编译目标检测功能包:终端运行./compile_control.sh或者./compile_all.sh

相机标定

创建一个标定板,运行后会在当前目录创建一个名为board_charuco_d6.png的图片,使用A4进行打印。

./Prometheus/Modules/object_detection/shell/create_board_charuco.sh

运行标定程序,程序会读取相机id为0的画面,根据画面提示,按c键添加标定图像(建议添加20张以上),然后按esc键程序开始根据获取到图像进行相机内参计算(画面会卡主,此时正在计算),等待计算完成。

./Prometheus/Modules/object_detection/shell/calibrate_camera_charuco_cam0.sh

将生成的文件重命名为calib_webcam_640x480.yaml替换掉Modules/object_detection/shell/calib_webcam_640x480.yaml中的文件。

更加详细内容请看相机标定

二维码检测(CPU)

Prometheus/Modules/object_detection/aruco_images/6X6_250中的二维码打印粘贴。运行以下程序,既可以获取二维码的ID、位姿等信息。

# 默认使用0号摄像头
roslaunch prometheus_detection web_cam0.launch
# 启动二维码检测
roslaunch prometheus_detection aruco_det.launch

YOLOv3通用目标检测

仅提供测试使用,暂无法自定义数据集训练模型,如果想训练自己的目标检测模型请参照使用YOLOv5 注意配置安装Nvidia驱动、CUDA,否则帧率只有1帧率

# 默认使用0号摄像头
roslaunch prometheus_detection web_cam0.launch
roslaunch prometheus_detection ms_coco_det.launch

KCF框选跟踪(CPU)

# 默认使用0号摄像头
roslaunch prometheus_detection web_cam0.launch
roslaunch prometheus_detection tracker_kcf.launch

SiamRPN框选跟踪

# 默认使用0号摄像头
roslaunch prometheus_detection web_cam0.launch
roslaunch prometheus_detection tracker_siamrpn.launch

其他

启动minip相机

roslaunch prometheus_detection mipi_cam_720p.launch

将视频文件转为ROS图像话题,修改input_video_dir路径为视频文件地址

roslaunch prometheus_detection video_replay.launch

YOLOv5(tensorrt加速版本)+目标跟踪。需要另外其他内容参考YOLOv5的使用部分

roslaunch prometheus_detection yolov5_nvidia_tensorrt.launch

相关msg说明

  • ArucoInfo.msg:Aruco二维码的信息
  • MultiArucoInfo.msg:MultiArucoInfo.msgz的数组表示
  • BoundingBox.msg:单个视觉检测框的信息
  • BoundingBoxs.msg:BoundingBox.msg的数组表示
  • DetectionInfo.msg:视觉检测反馈消息
  • MultiDetectionInfo.msg:DetectionInfo.msg的数组表示
  • GlobalAruco.msg:室内多二维码定位