kinect SDK2 比起 Kinect SDK1 多了两个大杀器 Kinect Studio 和 Visual Gesture Builder,这两个软件可以让我们很简单的使用微软自带的机器学习模型,建立自己的姿势库。简单来说就是Kinect Studio 录制和剪辑视频(可以选择自己想要Stream ),然后用Visual Gesture Builder标记视频中的动作,然后生成gba数据库文件。
具体操作过程见 微软发布在 Microsoft Visual Academy 的官方教程视频
这里我用两个动作执行拍照和脱衣的操作
准备过程
添加AdaBoostRech.dll 和 RFRProgressTech.dll 的引用
在解决方案中添加DataBase文件夹,并在文件夹中加入之前软件生产的gba数据库文件
代码部分
- 变量声明
//路径不对
private readonly string gestureDatabase = "WpfApplication1/WpfApplication1/DataBase/clean.gba";
private readonly string photoDatabase = "C:/Users/Wen/Desktop/实验DataBase/take_photo.gba";
private readonly string cleanGestureName = "clean";
private string photoGestureName = "take_photo";
private VisualGestureBuilderFrameSource vgbFrameSource = null;
private VisualGestureBuilderFrameReader vgbFrameReader = null;
- 变量初始化
// create the vgb source. The associated body tracking ID will be set when a valid body frame arrives from the sensor.
this.vgbFrameSource = new VisualGestureBuilderFrameSource(kinectSensor, 0);
this.