笔记是基于Make things See这本书的
原始笔记记于2012年7月份,大三暑假时候,一个假期只研究了这么一个东西
该笔记所记录的方法和类库是一个较早版本的openNI配合processing实现,新版本可能不支持部分函数或是做过改动,抽空研究后,会更新
processing简介:Processing是一种开源编程语言,专门为电子艺术和视觉交互设计而创建,其目的是通过可视化的方式辅助编程教学,并在此基础之上表达数字创意。
OPENNI:OpenNI(开放式的自然交互)是一个由业界领导的非营利组织。该组织专注于提高和改善自然交互设备,应用软件的互操作能力。通过使用这些硬件和中间件(软件)来很方便的访问和使用一些设备。
当时的笔记:记于2012年7月,学完之后,记得简单做了个kinect 手势选择电视频道的东西,后来就再也没跟kinect有过联系了,
后来搬家之后,屋子小,也玩不了体感游戏了,最后来到北京之后,也再没心思玩了.
补充一下.当时用的的processing语言,总以为是个简单语言.后来学多了,才明白,其实这就是java.我的入门语言原来是java
2013.02.21日记
SimpleOpenNI Cheat Sheet
This section attempts to compile a condensed reference to every function and constant available in SimpleOpenNI.
Unless noted, all functions are member functions on a SimpleOpenNI object. Those labeled “PApplet functions” are functions that need to be implement- ed by the PApplet as part of various callback chains. These callback function signatures also include return types so they can be implemented correctly in your sketches. Those labeled “constructors” are constructors.
Return values are noted alongside each function. If no return value is noted, the function returns void. Arguments and their types are noted in the function signature.
Functions and constants are loosely grouped by use case.
No guarantees are made for completeness. Check the website (see “How to Contact Us” on page xviii) for updates since the publication of this book.
// constants
USERS_ALL
SKEL_PROFILE_NONE
SKEL_PROFILE_ALL
SKEL_PROFILE_UPPER
SKEL_PROFILE_LOWER
SKEL_PROFILE_HEAD_HANDS
// currently supported joint constants
SKEL_HEAD
SKEL_NECK
SKEL_TORSO
393
A
Appendix
SKEL_LEFT_SHOULDER
SKEL_LEFT_ELBOW
SKEL_LEFT_HAND
SKEL_RIGHT_SHOULDER
SKEL_RIGHT_ELBOW
SKEL_RIGHT_HAND
SKEL_LEFT_HIP
SKEL_LEFT_KNEE
SKEL_LEFT_ANKLE
SKEL_RIGHT_HIP
SKEL_RIGHT_KNEE
SKEL_RIGHT_ANKLE
// present, but unsupported joint constants (maybe in the future)
SKEL_WAIST
SKEL_LEFT_COLLAR
SKEL_LEFT_WRIST
SKEL_LEFT_FINGERTIP
SKEL_RIGHT_COLLAR
SKEL_RIGHT_WRIST
SKEL_RIGHT_FINGERTIP
SKEL_LEFT_FOOT
SKEL_RIGHT_FOOT
// constant for enableRecorder
RECORD_MEDIUM_FILE
// constructors
SimpleOpenNI(PApplet parent)
SimpleOpenNI(PApplet parent,int runMode)
SimpleOpenNI(PApplet parent, String initXMLFile)
SimpleOpenNI(PApplet parent, String initXMLFile,int runMode)
// setup methods
enableDepth()
enableDepth(int width, int height,int fps)
enableRGB()
enableRGB(int width, int height, int fps)
enableIR()
enableIR(int width, int height, int fps)
enableScene()
enableScene(int width, int height, int fps)
enableUser(int flags)
enableGesture()
enableHands()
setMirror(boolean on)
enableRecorder(int recordMedium, String filePath)
update()
// display methods
depthImage() // return PImage
depthMap() // return int[]
depthMapRealWorld() // return PVector[]
rgbImage() // return PImage
irImage() // return PImage
sceneImage() // return PImage
sceneMap() // return int[]
getSceneFloor(PVector point, PVector normal)
getUsersPixels(int user) // return int[]
394 Appendix A
// calibration and recording
// all methods return boolean success
saveCalibrationDataSkeleton(int user, String calibrationFile)
loadCalibrationDataSkeleton(int user, String calibrationFile)
openFileRecording(String filePath)
// accessing position data
getCoM(int userId, PVector container) // returns boolean success
getJointPositionSkeleton(int userId, int jointId,
PVector container) // returns float confidence
getJointOrientationSkeleton(int userId, int jointId,
PMatrix3D orientation) // returns float confidence
getUsers(IntVEctor userList)
isTrackingSkeleton(int userId) // return boolean
// coordinate system conversion
convertRealWorldToProjective(PVector world, PVector projective)
convertProjectiveToRealWorld(PVector projective, PVector world)
// display helper functions
drawLimb(int userId, int joint1, int joint2)
drawCamFrustum()
// skeleton calibration callback chain
startPoseDetection(String poseId, int userId)
startTrackingSkeleton(int userId);
startPoseDetection(String poseId, int userId);
stopPoseDetection(int userId);
requestCalibrationSkeleton(int userId, boolean somethingTrue);
// skeleton calibration PApplet functions
void onNewUser(int userId)
void onEndCalibration(int userId, boolean successful)
void onStartPose(String pose, int userId)
void onLostUser(int userId)
void onStartCalibration(int userId)
// gesture recognition PApplet functions
void onStartPose(String poseId, int userId)
void onEndPose(String poseId, int userId)
void onRecognizeGesture(String strGesture, PVector idPosition,
PVector endPosition)
void onProgressGesture(String strGesture, PVector idPosition,
float progress)
void onStartSession(PVector position)
void onEndSession(String string, PVector position, float progress)
void onFocusSession()
// gesture recognition setup
addGesture(String gestureId)
// hand-tracking PApplet functions
void onCreateHands(int handId, PVector position, float time)
void onUpdateHands(int handId, PVector position, float time)
void onDestroyHands(int handId, float time)
// hand tracking setup