飞行机器人专栏(十四)-- Kinect DK 人体骨骼点运动提取方法

发布于:2024-04-24 ⋅ 阅读:(28) ⋅ 点赞:(0)

系列文章目录

Ubuntu 18.04/20.04 CV环境配置(下)--手势识别TRTpose+Kinect DK人体骨骼识别_ubuntu kinect骨骼测试-CSDN博客文章浏览阅读1.3k次。trt_pose_ros+ kinect实现手势识别和人体骨骼识别,用于机器人运动控制参考_ubuntu kinect骨骼测试https://haowang.blog.csdn.net/article/details/126761139

文章目录

目录

前言

一、Kinect DK简介

二、关键特性

1.硬件配置

尺寸和重量

2.技术特性

术语

3.功能说明

Azure Kinect 人体跟踪功能

三、 安装K4A & K4ABT SDK及ROS驱动

1. 官方SDK

Building and Dependencies

传感器 SDK

Azure Kinect 人体跟踪 SDK

2. SDK安装

Windows 安装说明

Linux 安装说明

3. 人体追踪SDK

         Azure Kinect 人体跟踪 SDK 的内容

4. 多设备连接

使用多个 Azure Kinect DK 设备的好处

5. 多设备标定

方法1-Green Screen Example

Green Screen Example

 方法2-KinectAzureDKProgramming


前言

Azure Kinect DK 是一款开发人员工具包,配有先进的 AI 传感器,提供复杂的计算机视觉和语音模型。 Kinect 将深度传感器、空间麦克风阵列与视频摄像头和方向传感器整合成一体式的小型设备,提供多种模式、选项和软件开发工具包 (SDK)。 

Azure Kinect DK 开发环境由以下多个 SDK 组成:

  • 用于访问低级别传感器和设备的传感器 SDK。
  • 用于跟踪 3D 人体的人体跟踪 SDK。
  • 用于启用麦克风访问和基于 Azure 云的语音服务的 Azure AI 语音 SDK。

此外,可将认知视觉服务与设备 RGB 相机配合使用。

Azure Kinect 传感器 SDK 提供低级别传感器访问用于完成 Azure Kinect DK 硬件传感器和设备配置。若要详细了解 Azure Kinect 传感器 SDK,请参阅使用传感器 SDK


一、Kinect DK简介

        Azure Kinect DK是面向商业用户的一款专业体感设备:100万像素TOF深度摄像头、1200万像素高清摄像头,7麦克风圆形阵列,和方向传感器,包含了深度,视觉,声音和方向四大传感器类别。

        深度摄像头在控制访问时可以选择宽或窄两种FOV视野,所以在实际空间内获取的数据将会更为精准。可以将捕捉到的人或物的画面以深度摄像画面和三维点云效果来表现。

        同时,连接Azure云服务,进一步推进Azure Kinect DK认知服务,通过将设备上的高级传感器与Azure云端认知服务相结合,开发更准确的视觉和语音模型,并使用Azure机器学习服务来训练模型 。

Azure Kinect DK 文档 | Microsoft LearnAzure Kinect DK 是一款开发人员工具包,配有先进的 AI 传感器,提供复杂的计算机视觉和语音模型。 Kinect 将深度传感器、带有视频摄像头的空间麦克风阵列和方向传感器整合成一体式的小型设备,提供多种模式、选项和 SDK。icon-default.png?t=N7T8https://learn.microsoft.com/zh-cn/azure/kinect-dk/

二、关键特性

1.硬件配置

尺寸和重量

Azure Kinect 设备的尺寸和重量如下。

  • 尺寸:103 x 39 x 126 毫米
  • 重量:440 克

 

2.技术特性

  • 相机视野

术语

整篇文章使用了以下缩写术语。

  • NFOV(窄视场深度模式)
  • WFOV(宽视场深度模式)
  • FOV(视场)
  • FPS(每秒帧数)
  • IMU(惯性测量单元)
  • FoI(专业范围)

 

3.功能说明

Azure Kinect 人体跟踪功能

随附的 SDK 提供以下人体跟踪功能:

  • 提供人体图像分段。
  • 包含 FOV 中每个不完整或完整人体的在解剖学上正确的骨干。
  • 提供每个人体的唯一标识。
  • 可跟踪人体在不同时间的位置。

三、 安装K4A & K4ABT SDK及ROS驱动

GitHub - microsoft/Azure-Kinect-Sensor-SDK: A cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.A cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device. - microsoft/Azure-Kinect-Sensor-SDKicon-default.png?t=N7T8https://github.com/Microsoft/Azure-Kinect-Sensor-SDKAzure Kinect 传感器 SDK 下载 | Microsoft Learn了解如何在 Windows 和 Linux 中下载和安装 Azure Kinect 传感器 SDK。icon-default.png?t=N7T8https://learn.microsoft.com/zh-cn/azure/kinect-dk/sensor-sdk-download

1. 官方SDK

Building and Dependencies

This information is for how to build your own copy of the SDK binaries. Most users of the Azure Kinect DK should not need to re-build the SDK, if you just need to use the SDK see usage for more information. If you need to build from source, you have to clone the repository instead of downloading the Zip file to ensure all the submodule dependencies in place.

Azure-Kinect-Sensor-SDK/docs/building.md at develop · microsoft/Azure-Kinect-Sensor-SDK · GitHubA cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device. - Azure-Kinect-Sensor-SDK/docs/building.md at develop · microsoft/Azure-Kinect-Sensor-SDKicon-default.png?t=N7T8https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/building.md

传感器 SDK 提供以下功能,这些功能一经安装即可在 Azure Kinect DK 上运行:

  • 深度相机访问和模式控制(被动 IR 模式,以及宽视场和窄视场深度模式)
  • RGB 相机访问和控制(例如曝光和白平衡)
  • 运动传感器(陀螺仪和加速度传感器)访问
  • 同步的深度 RGB 相机流,相机之间的延迟可配置
  • 外部设备同步控制,设备之间的延迟偏移量可配置
  • 用于处理图像分辨率、时间戳等的相机帧元数据访问。
  • 设备校准数据访问

关于 Azure Kinect 传感器 SDK | Microsoft Learn概述 Azure Kinect 传感器软件开发工具包 (SDK) 及其功能和工具。icon-default.png?t=N7T8https://learn.microsoft.com/zh-cn/azure/kinect-dk/about-sensor-sdk

传感器 SDK

Azure Kinect 人体跟踪 SDK

人体跟踪 SDK 包含 Windows 库和运行时,在 Azure Kinect DK 硬件上使用时可以跟踪 3D 人体。

2. SDK安装

Windows 安装说明

可在此处找到最新版和旧版 Azure Kinect 传感器 SDK 和固件的安装详细信息。

可在此处找到源代码。

 备注

安装 SDK 时,请记住要安装到的路径。 例如,“C:\Program Files\Azure Kinect SDK 1.2”。 你将在此路径中找到文章中提到的工具。

 

Linux 安装说明

        目前,唯一支持的分发版是 Ubuntu 18.04。 若要请求对其他分发版的支持,请参阅此页

        首先,需要遵照此处的说明,配置 Microsoft 的包存储库

现在,可以安装所需的包。 k4a-tools 包中包含 Azure Kinect 查看器Azure Kinect 录制器和 Azure Kinect 固件工具。 若要安装该包,请运行:

sudo apt install k4a-tools

        此命令安装该工具正常工作所需的依赖项包,包括最新版本的 libk4a<major>.<minor>。 你将需要添加 udev 规则来访问 Azure Kinect DK,而不必成为根用户。 有关说明,请参阅 Linux 设备设置。 也可以根用户身份启动那些使用设备的应用程序。

libk4a<major>.<minor>-dev 包中包含针对 libk4a 生成应用程序/可执行文件的头文件以及 CMake 文件。

libk4a<major>.<minor> 包中包含运行依赖于 libk4a 的应用程序/可执行文件所需的共享对象。

基本教程需要 libk4a<major>.<minor>-dev 包。 若要安装该包,请运行:

sudo apt install libk4a<major>.<minor>-dev

如果该命令成功,则表示 SDK 可供使用。

请确保安装与 libk4a<major>.<minor>-dev 匹配的 libk4a<major>.<minor> 版本。 例如,如果你安装 libk4a1.4.1-dev 包,则请安装包含共享对象文件匹配版本的相应 libk4a1.4.1 包。 有关 libk4a 的最新版本,请参见下一部分的链接。

3. 人体追踪SDK

Azure Kinect Body Tracking SDK: Welcomeicon-default.png?t=N7T8https://microsoft.github.io/Azure-Kinect-Body-Tracking/release/1.1.x/index.html

         https://learn.microsoft.com/zh-cn/azure/kinect-dk/body-sdk-download

Azure Kinect 人体跟踪 SDK 的内容

  • 使用 Azure Kinect DK 生成人体跟踪应用程序所需的标头和库。
  • 使用 Azure Kinect DK 的人体跟踪应用程序所需的可再发行 DLL。
  • 示例人体跟踪应用程序。

4. 多设备连接

同步多个 Azure Kinect DK 设备 | Microsoft Learn本文探讨多设备同步的优势,以及如何设置要同步的设备。icon-default.png?t=N7T8https://learn.microsoft.com/zh-cn/azure/kinect-dk/multi-camera-sync

每个 Azure Kinect DK 设备附带 3.5 毫米同步端口(输入同步输出同步),可将多个设备链接在一起。 连接设备后,软件可以协调设备之间的触发定时。

本文将介绍如何连接和同步设备。

使用多个 Azure Kinect DK 设备的好处

使用多个 Azure Kinect DK 设备的原因有很多,包括:

  • 填补遮挡区域。 尽管 Azure Kinect DK 数据转换生成的是单个图像,但两个相机(深度和 RGB 相机)实际上保持着较小的一段距离。 这种偏移使得遮挡成为可能。 遮挡是指前景对象阻挡了设备上两个相机之一的背景对象的部分视角。 在生成的彩色图像中,前景对象看上去像是在背景对象上投射了一个阴影。
    例如,在下图中,左侧相机可看到灰色像素“P2”。但是,白色前景对象会阻止右侧相机 IR 横梁。 右侧相机无法获取“P2”的数据。附加的同步设备可以提供遮挡的数据。
  • 扫描三维对象。
  • 将有效帧速率提升至 30 帧/秒 (FPS) 以上的值。
  • 捕获同一场景的多个 4K 彩色图像,所有图像都在曝光中心时间点的 100 微秒 (μs) 内对齐。
  • 增大相机的空间覆盖范围。

5. 多设备标定

方法1-Green Screen Example

Green Screen Example

The goal of the green screen example is to demonstrate best practices for using multiple Azure Kinect DK devices, with an emphasis on synchronization and calibration (the 'green screen' code is only a small portion of the logic). In particular, the green screen application showcases a physical limitation of the hardware and how it can be mostly addressed using another device.

Azure-Kinect-Sensor-SDK/examples/green_screen at develop · microsoft/Azure-Kinect-Sensor-SDK · GitHub

 编译:CMakelists.tst

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.5)
project(kinextdk_example LANGUAGES C CXX)


############################
#### AZURE KINECT SDK ######
############################

message("Finding K4A SDK binaries")

# Disable cached locations for K4A SDK binaries.
# Do this to force the search logic to happen correctly.
# If we don't disable these cached directories, we
# won't be able to tell the difference between the ext/sdk location
# and the system installed version on linux. Since we have to treat these
# differently (one needs install, one doesn't) we must disable the cache
# so that find_package(k4a) will fail in all cases if not installed via the .deb.
unset(k4a_DIR CACHE)

# Force running the Findk4a.cmake module
find_package(k4a  REQUIRED)
find_package(OpenCV REQUIRED)
set(K4A_LIBS k4a::k4a;k4a::k4arecord)


# This reads the K4A_LIBS and K4A_INSTALL_REQUIRED variables and decides how to install
# the various shared objects / DLLs

##################################
###### END AZURE KINECT SDK ######
##################################
include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(green_screen main.cpp)
target_link_libraries(green_screen 
			PRIVATE 
			k4a::k4a  
			${OpenCV_LIBS})

 

mkdir build && cd build
cmake .. -DOpenCV_REQUIRED=ON
make 

 方法2-KinectAzureDKProgramming

 [Calibration] Overlay point cloud from two cameras · Issue #803 · microsoft/Azure-Kinect-Sensor-SDK · GitHubHi I have tried to modify the green_screen example to allow the display of point clouds obtained from two sync cameras but couldn't get the point cloud to overlay correctly. Is there be any sample code on overlaying the point cloud from ...icon-default.png?t=N7T8https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/803

GitHub - forestsen/KinectAzureDKProgramming: Samples about Kinect Azure DK programmingSamples about Kinect Azure DK programming. Contribute to forestsen/KinectAzureDKProgramming development by creating an account on GitHub.icon-default.png?t=N7T8https://github.com/forestsen/KinectAzureDKProgramming

  1. Aruco_TwoKinects_Calibration_Extrinsics

    Using ArUco library to calibrate the extrinsic matrix between Two Kinects. We will get two csv files stored two transformation matrix which are "sub => master" and "sub => marker".

  2. OneKinect_Recording_RGB_DEPTH_IR

    Record the rgb+depth+ir stream into the mkv video file.

  3. OneKinect_Playback_RGB_DEPTH_IR

    Playback the mkv video file using opencv.

  4. Open3D_OneKinect

    Using the Open3D to open the azure kinect device and show the rgb + depth image or the point cloud based on the open3d's visualization class.

GitHub - forestsen/K4aGrabber: Kinect Azure DK Grabber of PCL (Point Cloud Library).Kinect Azure DK Grabber of PCL (Point Cloud Library). - forestsen/K4aGrabbericon-default.png?t=N7T8https://github.com/forestsen/K4aGrabber