kinectkinect入门


备注

本节概述了kinect是什么,以及开发人员可能想要使用它的原因。

它还应该提到kinect中的任何大型主题,并链接到相关主题。由于kinect的文档是新的,您可能需要创建这些相关主题的初始版本。

安装或设置

有关设置或安装kinect的详细说明。设置Kinect传感器

适用于Windows 1.5,1.6,1.7,1.8的Kinect

以下是使Kinect传感器启动并运行的一些简单步骤。

步骤1:将传感器安装在稳定的表面上

将传感器放置在稳定的表面上,使其在使用过程中不会掉落或撞击。以下是一些其他提示。

Do not place the Kinect on or in front of a speaker or on a surface that vibrates or makes noise.
Keep the Kinect out of direct sunlight.
Use the Kinect within its specified operating temperature range of 41 to 95 degrees Fahrenheit (5 to 35 degrees Celsius). If the sensor is exposed to an environment outside of its prescribed temperature range, turn it off and allow the temperature to stabilize within the specified range before you use the sensor again.
Do not tilt a Kinect on its base. Manually tilting the Kinect can damage the sensor. The Kinect tilt angle is controlled by software; see Kinect Explorer - WPF C# Sample for an example.
 

第2步:安装Kinect for Windows SDK

If you haven't done so already, download and install the free SDK from the Kinect for Windows download page.
If you haven't done so already, download and install the free Developer Toolkit from the Kinect for Windows download page.
 

第3步:插入Kinect传感器

Connect the power supply for your Kinect to an external power source.
Connect the Kinect to a USB port on your PC and wait for Windows to recognize it.
All the drivers, including audio, will load seamlessly.
 

安装Kinect for Windows SDK时,安装包中包含Kinect驱动程序。当Kinect驱动程序安装在基于Windows的PC上时,插入PC的USB端口的Kinect显示为多组件USB设备。

关于USB主机控制器兼容性存在已知问题。

加载驱动程序后,您需要设置开发环境。如果您使用的是Visual Studio,请继续配置开发环境以帮助您创建第一个C#或C ++应用程序。

故障排除提示

以下提示将帮助您开始使用Kinect:

If a non-Microsoft driver for the Kinect is installed on your computer, the Kinect for Windows drivers might not install or function correctly. To fix this, uninstall the non-Microsoft drivers before installing the Kinect for Windows SDK.
Connect the power supply for the Kinect to an external power source; if the Kinect has only power from the USB connection, it will be minimally functional and light the LED, but it must be connected to an external power source to be fully functional.
No tools are required for calibration of audio and video.
Your Kinect should be the only device plugged into a USB hub on your computer. If you have more than one Kinect, connect them to different USB controllers. If 2 hubs are connected to the same controller, only 1 Kinect can work at a time.
The Kinect is protected from overheating by a fan. It is controlled by the sensor's firmware, which turns off the camera at 90 degrees Celsius. There is no software interface for applications to control the fan.
Reasonable lighting, neither extremely dark nor extremely bright, is important for capturing images with the RGB camera. Incandescent, fluorescent, and natural lighting provide no special obstacles, but do not point an intense or constant light source at the camera because this can blind the RGB sensor.
The depth sensor functions adequately in typical and reduced lighting, although in near darkness there is increased noise in the signal.
The depth sensor reads depth information from reflected light. Objects that are highly reflective (mirrors and shiny metal) or highly absorptive (fluffy and/or dark materials) may not be registered by the depth sensor as successfully as other objects.
 

资源

Linux的

Ubuntu / Debian官方软件包

从Ubuntu 11.10(Oneiric)和Debian 7(Wheezy)开始,Ubuntu和Debian提供了libfreenect的官方软件包。您可以在控制台中轻松安装它们:

$ sudo apt-get install freenect
 

Ubuntu 12.04中gspca内核驱动程序阻止libfreenect在用户模式下声明Kinect设备。删除并将模块列入黑名单

$ sudo modprobe -r gspca_kinect 
$ sudo modprobe -r gspca_main
$ echo "blacklist gspca_kinect" |sudo tee -a /etc/modprobe.d/blacklist.conf
 

或安装最新版本的libfreenect ,它可以通过为Ubuntu 12.04添加更新的libfreenect软件包Florian Echtler libtisch PPA(见下文)来自动分离内核驱动程序。

属于“plugdev”组的任何用户都可以访问freenect设备。默认情况下,桌面用户属于plugdev组,但如果需要将其添加到组:

$ sudo adduser $USER plugdev
 

然后注销并再次登录NeuroDebian存储库

如果你想要最新版本的libfreenect,无论你使用哪个版本的Debian或Ubuntu,最后发布的libfreenect都支持所有支持的Debian和Ubuntu版本(即Ubuntu Lucid(10.04),Maverick(10.10),Natty(11.04)在NeuroDebian存储库中可以获得Oneiric(11.10)和Debian Squeeze和Wheezy(撰写本文时)。这里提供的软件包是由官方Debian软件包的维护者创建的,遵循Debian / Ubuntu的标准。

要启用NeuroDebian存储库:

$ wget -O- http://neuro.debian.net/lists/$(lsb_release -cs).us-nh | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
$ sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
$ sudo apt-get update
 

安装libfreenect与以前一样:

$ sudo apt-get install freenect
 

确保您的用户属于plugdev组(桌面用户的默认设置),以便在没有root权限的情况下访问设备。如果不是这样,请按以下方式添加:

$ sudo adduser $USER plugdev
 

并注销并再次登录libtisch PPA

可以通过此链接获得Lucid(10.04),Maverick(10.10),Natty(11.04),Oneiric(11.10)和Pangolin(12.04)的Ubuntu启动板ppa。

使用它,打开一个控制台并执行:

$ sudo add-apt-repository ppa:floe/libtisch
$ sudo apt-get update
 

之后,您可以使用:

$ sudo apt-get install libfreenect libfreenect-dev libfreenect-demos
 

这将安装libfreenect,开发标题和演示应用程序。

之后,您需要将自己添加到“视频”组并重新登录。该软件包已包含udev守护程序的必要规则,以便组视频中的用户可以访问该设备。

$ sudo adduser $USER video
 

请务必注销并重新登录。您无需重启,只需立即插入kinect设备(如果已连接,请拔下插头并重新插入)。

要启动演示应用程序,请使用:

$ freenect-glview
 

访问设备的问题

如果出现问题,请运行

$ lsusb | grep Xbox
 

应该列出3个设备

> lsusb | grep Xbox                                                 Bus
> 001 Device 021: ID 045e:02ae Microsoft Corp. Xbox NUI Camera Bus 001
> Device 019: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor Bus 001 Device
> 020: ID 045e:02ad Microsoft Corp. Xbox NUI Audio
 

如果它们不存在,请运行

echo -1 | sudo tee -a /sys/module/usbcore/parameters/autosuspend
 

并列出重新连接Kinekt和Kinect Camera

您可以找到以freenect-前缀开头的所有演示应用程序。 Ubuntu手动安装

快速复制粘贴说明,立即启动并运行:

sudo apt-get install git-core cmake libglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev
git clone git://github.com/OpenKinect/libfreenect.git
cd libfreenect
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib64/
sudo freenect-glview
 

注意:如果你收到一个错误,说apt-get找不到libglut3,你可能会在更新版本的Ubuntu上使用freeglut3- *而不是libglut3- *,所以你的初始apt-get安装看起来像:

sudo apt-get install git-core cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev
 

要将Kinect用作非root用户,请执行以下操作:

sudo adduser $USER video
 

还要创建一个包含Linux设备管理器规则的文件:

sudo nano /etc/udev/rules.d/51-kinect.rules
 

复制和粘贴:

# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE="0666"
# ATTR{product}=="Xbox NUI Audio"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE="0666"
# ATTR{product}=="Xbox NUI Camera"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE="0666"
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c2", MODE="0666"
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02be", MODE="0666"
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02bf", MODE="0666"
 

务必注销并重新登录。

如果您无法访问或仍需要root权限才能使用您的设备:在某些情况下,安装的两个驱动程序(libfreenect和primesense)的权限之间可能存在冲突。如果是这种情况,请尝试重新安装primesense的传感器驱动程序并仅保留primesense的规则文件/etc/udev/rules.d/55-primesense-usb.rule s,删除/etc/udev/rules.d/51-kinect.rules 文件,如果您创建它。