没有合适的资源?快使用搜索试试~ 我知道了~
Hacking the Kinect
5星 · 超过95%的资源 需积分: 9 77 下载量 25 浏览量
2014-04-15
16:37:25
上传
评论 2
收藏 17.86MB PDF 举报
温馨提示
试读
258页
Kramer, Parker 12年写的关于openkinect的一些东东,帮助我们更好的理解三维图像的世界 Kinect向PCL转化的必备利器
资源推荐
资源详情
资源评论
Hacking
the Kinect
Write code and create
interesting projects involving
Microsoft’s ground-breaking
voluMetric sensor
Hacking the Kinect
Jeff Kramer, Nicolas Burrus, Florian Echtler,
Daniel Herrera C.,
and Matt Parker
H
acking the Kinect is your guide to developing software and
creating projects using the Kinect, Microsoft’s groundbreak-
ing volumetric sensor. This book introduces you to the Kinect
hardware and helps you master using the device in your own pro-
grams. You’ll learn how to set up a software environment, stream
data from the Kinect, and write code to interpret that data.
Featured in the book are hands-on projects that you can build
while following along with the material. These hands-on projects
give you invaluable insights into how the Kinect functions and
how you can apply it to create fun and educational applications.
Hacking the Kinect teaches you everything you need to devel-
op a 3D application and get it running. You’ll learn the ins and
outs of point clouds, voxel occupancy maps, depth images, and
other fundamentals of volumetric sensor technology. You’ll come
to understand how to:
Turn to Hacking the Kinect and discover an endless world of cre-
ative possibilities. Whether you’re looking to use the Kinect to
drive 3D interactive artwork, create robots capable of responding
to human motion and gesture, or create applications that users
can manipulate with a wave of their hands, Hacking the Kinect
offers you the knowledge and skills you need to get started.
Hacking the Kinect
www.apress.com
US $39.99
Shelve in Computer Hardware/General
User level: Intermediate–Advanced
™
SOURCE CODE ONLINE
Also available:
Kramer
Burrus
Echtler
Herrera C.
Parker
iv
Contents at a Glance
About the Authors...................................................................................................x
About the Technical Reviewer .............................................................................xiii
Acknowledgments ............................................................................................... xiv
Chapter 1: Introducing the Kinect...........................................................................1
Chapter 2: Hardware.............................................................................................11
Chapter 3: Software..............................................................................................41
Chapter 4: Computer Vision..................................................................................65
Chapter 5: Gesture Recognition ............................................................................89
Chapter 6: Voxelization.......................................................................................103
Chapter 7: Point Clouds, Part 1...........................................................................127
Chapter 8: Point Clouds, Part 2...........................................................................151
Chapter 9: Object Modeling and Detection .........................................................173
Chapter 10: Multiple Kinects ..............................................................................207
Index...................................................................................................................247
C H A P T E R 1
1
Introducing the Kinect
Welcome to Hacking the Kinect. This book will introduce you to the Kinect hardware and help you
master using the device in your own programs. We’re going to be covering a large amount of ground—
everything you’ll need to get a 3-D application running—with an eye toward killer algorithms, with no
unusable filler.
Each chapter will introduce more information about the Kinect itself or about the methods to work
with the data. The data methods will be stretched across two chapters: the first introduces the concept
and giving a basic demonstration of algorithms and use, and the second goes into more depth. In that
second chapter, we will show how to avoid or ameliorate common issues, as well as discuss more
advanced algorithms. All chapters, barring this one, will contain a project—some basic, some advanced.
We expect that you will be able to finish each chapter and immediately apply the concepts into a
project of you own; there is plenty of room for ingenuity with the first commercial depth sensor and
camera!
Hardware Requirements and Overview
The Kinect requires the following computer hardware to function correctly. We’ll cover the requirements
more in depth in Chapter 3, but these are the basic requirements:
• A computer with at least one, mostly free, USB 2.0 hub.
• The Kinect takes about 70% of a single hub (not port!) to transmit its data.
• Most systems can achieve this easily, but some palmtops and laptops
cannot. To be certain, flip to Chapter 2, where we give you a quick guide on
how to find out.
• A graphics card capable of handling OpenGL. Most modern computers that have
at least an onboard graphics processor can accomplish this.
• A machine that can handle 20 MB/second of data (multiplied by the number of
Kinects you’re using). Modern computers should be able to handle this easily, but
some netbooks will have trouble.
• A Kinect sensor power supply if your Kinect came with your Xbox 360 console
rather than standalone.
Figure 1-1 shows the Kinect itself. The callouts in the figure identify the major hardware
components of the device. You get two cameras: one infrared and one for standard, visible light. There is
an infrared emitter to provide structured light that the infrared camera uses to calculate the depth
CHAPTER 1 INTRODUCING THE KINECT
2
image. The status light is completely user controlled, but it will tell you when the device is plugged into
the USB (but not necessarily powered!) by flashing green.
Status LED
RGB Camera
IR Laser Emitter
IR Camera
Figure 1-1. Kinect hardware at a glance
Installing Drivers
This book focuses on the OpenKinect driver – a totally open source, low level driver for the Kinect. There
are a few other options (OpenNI and the Kinect for Windows SDK), but for reasons to be further
discussed in Chapter 3, we’ll be using OpenKinect. In short, OpenKinect is totally open source, user
supported and low level, therefore extremely fast. The examples in this book will be written in C/C++,
but you can use your favorite programming language; the concepts will definitely carry over.
Note Installation instructions are split into three parts, one for each available OS to install to. Please skip to the
section for the OS that you’re using.
Windows
While installing and building OpenKinect drivers from source is fairly straightforward, it can be
complicated for first timers. These steps will take you through how to install on Windows 7 (and should
also work for earlier versions of Windows).
1. Download and install Git (http://git-scm.com). Be sure to select “Run git from
the Windows Command Prompt” and “Check out Windows style, commit
Unix-style line endings”.
2. Open your command prompt; go to the directory where you want your source
folder to be installed, and clone/branch as in Listing 1-1. See the “Git Basics”
sidebar for more information.
CHAPTER 1 INTRODUCING THE KINECT
3
Listing 1-1. Git Commands for Pulling the Source Code
C:\> mkdir libfreenect
C:\> cd libfreenect
C:\libfreenect> git clone https://github.com/OpenKinect/libfreenect.git (This will clone into
a new libfreenect directory)
C:\libfreenect> cd libfreenect
C:\libfreenect\libfreenect> git branch –track unstable origin/unstable
3. There are three major dependencies that must be installed for libfreenect to
function: libusb-win32, pthreads-win32, and GLUT. Some of the options you
select in the next section are dependent on your choice of compiler.
a. Download libusb-win32 from http://sourceforge.net/projects/libusb-
win32/.
b. Extract and move the resulting folder into /libfreenect.
c. Download pthreads-win32 from http://sourceware.org/pthreads-win32/.
Find the most recent candidate with release.exe at the end.
d. Extract and store the folder in /libfreenect. If you’re using Microsoft Visual
Studio 2010, copy /Pre-built.2/lib/pthreadVC2.dll to /Windows/System32/. If
using MinGW, copy /Pre-built.2/lib/pthreadGC2.dll to /Windows/System32/
instead.
e. Download GLUT from http://www.xmission.com/~nate/glut.html. Find the
most recent release ending in “-bin.zip”.
f. Extract and store the resulting folder in /libfreenect.
g. Copy glut32.dll to /Windows/System32/. If you’re using Microsoft Visual
Studio 2010, copy glut.h to the /include/GL folder in your Visual Studio tree
and glut32.lib library to /lib in the same tree. If the GL folder does not exist,
create it. However, if you’re using MinGW, copy glut.h to /include/GL folder
in the MinGW root directory.
4. All of the dependencies are in place! Now we can install the low-level Kinect
device driver.
a. Plug in yo
ur Kinect
. After a quick search for drivers, your system should
complain that it cannot find the correct drivers, and the LED on the Kinect
itself will not light. This is normal.
b. Open Device Manager. Start Control Panel Hardware and Sound Device
Manager.
c. Double-click Xbox NUI Motor. Click Update Driver in the new window that
appears.
d. Select “Browse my computer for driver software”, and browse to
/libfreenect/platform/inf/xbox nui motor/.
e. After installation, the LED on the Kinect should be blinking green. Repeat steps
3 and 4 for Xbox NUI Camera and Xbox NUI Audio.
剩余257页未读,继续阅读
资源评论
- michiney2015-01-14书很经典,非常好
wangzhebupt
- 粉丝: 117
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功