logo资料库

Making.Things.See.pdf

第1页 / 共440页
第2页 / 共440页
第3页 / 共440页
第4页 / 共440页
第5页 / 共440页
第6页 / 共440页
第7页 / 共440页
第8页 / 共440页
资料共440页,剩余部分请下载后查看
Preface
1. What Is the Kinect?
How Does It Work? Where Did It Come From?
Kinect Artists
2. Working with the Depth Image
Images and Pixels
Project 1: Installing the SimpleOpenNI Processing Library
Project 2: Your First Kinect Program
Project 3: Looking at a Pixel
Converting to Real-World Distances
Project 4: A Wireless Tape Measure
Project 5: Tracking the Nearest Object
Projects
Project 6: Invisible Pencil
Project 7: Minority Report Photos
Exercises
3. Working with Point Clouds
What You’ll Learn in This Chapter
Welcome to the Third Dimension
Drawing Our First Point Cloud
Making the Point Cloud Move
Viewing the Point Cloud in Color
Making the Point Cloud Interactive
Projects
Project 8: Air Drum Kit
Project 9: Virtual Kinect
Conclusion
4. Working with the Skeleton Data
A Note About Calibration
Stages in the Calibration Process
User Detection
Accessing Joint Positions
Skeleton Anatomy Lesson
Measuring the Distance Between Two Joints
Transferring Orientation in 3D
Background Removal, User Pixels, and the Scene Map
Tracking Without Calibration: Hand Tracking and Center of Mass
Projects
Project 10: Exercise Measurement
Project 11: “Stayin’ Alive”: Dance Move Triggers MP3
Conclusion
5. Scanning for Fabrication
Intro to Modelbuilder
Intro to MeshLab
Making a Mesh from the Kinect Data
Looking at Our First Scan
Cleaning Up the Mesh
Looking at Our Corrected Model
Prepping for Printing
Reduce Polygons in MeshLab
Printing our Model on a MakerBot
Sending Our Model to Shapeways
Conclusion: Comparing Prints
6. Using the Kinect for Robotics
Forward Kinematics
Inverse Kinematics
Conclusion
7. Conclusion: What’s Next?
Beyond Processing: Other Frameworks and Languages
Topics in 3D Programming to Explore
Ideas for Projects
A. Appendix
Index
Making Things See 3D Vision with Kinect, Processing, Arduino, and MakerBot Greg Borenstein Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo
Making Things See by Greg Borenstein Copyright 2012 © Greg Borenstein. All rights reserved. Printed in Canada. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly Media books may be purchased for educational, business, or sales promotional use. Online editions are also avail- able for most titles (my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. Editors: Andrew Odewahn, Brian Jepson Production Editor: Holly Bauer Proofreader: Linley Dolby Indexer: Fred Brown Compositor: Nancy Kotary Cover Designer: Mark Paglietti Interior Designer: Ron Bilodeau Illustrator: Rebecca Demarest January 2012: Revision History for the First Edition: 2012-01-04 First Edition. First release See http://oreilly.com/catalog/errata.csp?isbn=0636920020684 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. ISBN: 978-1-449-30707-3 [TI]
For Jacob and Ellie and Sophie and Amalia. The future is yours.
Contents Preface.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii 1.. What.Is.the.Kinect?.. . . . . . . . . . . . . . . . . . . . . . . . . . 1 How Does It Work? Where Did It Come From? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Kinect Artists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.. Working.with.the.Depth.Image.. . . . . . . . . . . . 43 Images and Pixels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Project 1: Installing the SimpleOpenNI Processing Library . . . . . . . . . . . . . . . . . . 45 Project 2: Your First Kinect Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Project 3: Looking at a Pixel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Converting to Real-World Distances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Project 4: A Wireless Tape Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Project 5: Tracking the Nearest Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Project 6: Invisible Pencil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Project 7: Minority Report Photos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 3.. Working.with.Point.Clouds.. . . . . . . . . . . . . . . . 109 What You’ll Learn in This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Welcome to the Third Dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Drawing Our First Point Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Making the Point Cloud Move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Viewing the Point Cloud in Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Making the Point Cloud Interactive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Project 8: Air Drum Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Project 9: Virtual Kinect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 v
4.. Working.with.the.Skeleton.Data. . . . . . . . . . 185 A Note About Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Stages in the Calibration Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 User Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Accessing Joint Positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Skeleton Anatomy Lesson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Measuring the Distance Between Two Joints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 Transferring Orientation in 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Background Removal, User Pixels, and the Scene Map . . . . . . . . . . . . . . . . . . . 246 Tracking Without Calibration: Hand Tracking and Center of Mass . . . . . . . . 254 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Project 10: Exercise Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Project 11: “Stayin’ Alive”: Dance Move Triggers MP3 . . . . . . . . . . . . . . . . . . . . . . 279 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 5.. Scanning.for.Fabrication.. . . . . . . . . . . . . . . . . . 301 Intro to Modelbuilder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 Intro to MeshLab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 Making a Mesh from the Kinect Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 Looking at Our First Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 Cleaning Up the Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 Looking at Our Corrected Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 Prepping for Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 Reduce Polygons in MeshLab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 Printing Our Model on a MakerBot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 Sending Our Model to Shapeways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 Conclusion: Comparing Prints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 6.. Using.the.Kinect.for.Robotics.. . . . . . . . . . . 345 Forward Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 Inverse Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 7.. Conclusion:.What’s.Next?.. . . . . . . . . . . . . . . . . 379 Beyond Processing: Other Frameworks and Languages . . . . . . . . . . . . . . . . . . 380 Topics in 3D Programming to Explore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 Ideas for Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 A.. Appendix.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 Index.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 vi Contents
分享到:
收藏