Kinect SDK 1.6和Joint.ScaleTo方法 [英] Kinect SDK 1.6 and Joint.ScaleTo method
问题描述
我正在使用Kinect SDK 1.6,并且正在遵循 Windows Kinect Quickstart Series 的 Skeleton Tracking Funamentals 教程,该教程在
I'm using Kinect SDK 1.6, and I'm following the Skeleton Tracking Funamentals tutorial of Windows Kinect Quickstart Series, available here.
即使这些教程是针对SDK 1.0制作的,在我按照说明将手的位置映射到自定义大小的窗口(例如1280x720)上,一切都进行得很顺利.
Even if these tutorials have been made for SDK 1.0, all was going pretty well until I followed the instructions to map the position of my hands on a custom-sized window (say 1280x720).
Dan Fernandez使用以下代码行实现了这一目标
Dan Fernandez is using the following line of code to achieve this
private void ScalePosition(FrameworkElement element, Joint joint)
{
// Convert the value to X/Y;
Joint scaledJoint = joint.ScaleTo(1280, 720);
....
}
嗯,方法ScaleTo
不是自定义函数,应该在Kinect SDK中提供,但是根据我的编辑器,没有这样的方法.我找不到它,而且我认为自SDK 1.0以来,它可能已被移动/重命名/任何内容.
Well, the method ScaleTo
is not a custom function, it should be provided in the Kinect SDK, but according to my editor, there's no such method. I can't locate it, and I think it might have been moved/renamed/whatever since SDK 1.0.
只是确保一切都井井有条,这是我的using
列表,其他所有内容(骨骼跟踪等)都可以正常工作,所以我真的无法弄清楚
Just to make sure everything is in order, here is my using
list, everyithing else (Skeleton tracking etc.) is working, so I really can't figure it out
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Kinect;
using Microsoft.Kinect.Toolkit;
using Microsoft.Samples.Kinect.WpfViewers;
我可以根据要求提供有关我的代码的更多详细信息.
I can give further details about my code on request.
推荐答案
如果您对Coding4Fun有正确的引用,您实际上只是缺少了这一点:
If you have the correct reference to Coding4Fun, you are actually just missing this:
using Coding4Fun.Kinect.Wpf;
在代码的开头.
这篇关于Kinect SDK 1.6和Joint.ScaleTo方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!