More Related Content Similar to Kinect introduction (20) More from Kaoru NAKAMURA (20) Kinect introduction1. 初めての
KINECT + OpenNI
プログラム
Ver.1.1 2012/01/17
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
2. ⾃自⼰己紹介
中村 薫
株式会社 ゲッシュ (http://www.geis.co.jp/)
• Windows ⽤用のセキュリティソフトウェアの受託開発
• NUIデバイスを利利⽤用したアプリケーション開発
• Scrumなどのアジャイルな開発⼿手法を利利⽤用した現場改善
• 新⼈人研修やセミナー講師
• nakamura.kaoru@geis.co.jp
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
4. ⾃自⼰己紹介
BP NE
http://techon.nikkeibp.co.jp/article/SEMINAR/20111021/199596/
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
5. ⾃自⼰己紹介
http://www.atmarkit.co.jp/fdotnet/special/comparekinect01/comparekinect01_01.html
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
9. KINECTの販売台数
世界累累計
• 60⽇日で800万台
•5か⽉月で1,000万台
•1年年で1,800万台
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
19. NUI
•NUIとはNatural User Interfaceの略略であ
り、「ユーザーに⾃自然なインタフェース」で
ある
•NIと略略される、Natural Interactionも同
じような意味を持つ
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
25. 福祉
NAIST Ballpool
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
26. 舞台
http://www.uga-web.com/sb/
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
30. さまざまなデバイスへの搭載
http://www.ionroad.com/
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
31. コンピューターの変化
http://www.chrisharrison.net/index.php/Research/OmniTouch
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
32. リアルとバーチャルの融合
http://channel9.msdn.com/coding4fun/kinect/Kinect--3D--Fusion4D
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
33. コンピューター
との関わり
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
35. アプリケーション
開発環境
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
42. Xtion Pro LIVE
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
43. Xtion Pro LIVE
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
46. KINECT for Windows SDK
• KINECT for Windows SDKはMicrosoft社が
公式にリリースしているKINECT専⽤用のSDK。
• 2011年年12⽉月現在はBeta2となっており⾮非商⽤用
限定だが、2012年年の早い時期に商⽤用版がリリー
スされるとアナウンスがある。
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
49. 概要
⼀一般的にOpenNIという場合は
• APIの「OpenNI」
• ミドルウェアの「NITE(ナイト)」
• ドライバの「Sensor」
この3つを合わせたものを指す。
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
57. Context
クラス名 概要
OpenNIの初期化やノード(デバイス)の初期化
Context
を⾏行行う
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
59. Generator
クラス名 概要
ImageGenerator RGBカメラのデータの取得や設定を⾏行行う
DepthGenerator 距離離カメラのデータの取得や設定を⾏行行う
UserGnerator ユーザーの追跡のデータの取得や設定を⾏行行う
HandsGenerator ⼿手の追跡や設定を⾏行行う
GestureGenerator ジェスチャーの検出や設定を⾏行行う
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
60. Generator
クラス名 概要
SceneAnalyzer 床の検出や設定を⾏行行う
AudioGenerator ⾳音声のデータ取得や設定を⾏行行う
IRGenerator ⾚赤外線のデータ取得や設定を⾏行行う
Recorder RGBカメラと距離離カメラのデータを記録する
Player Recorderで記録したデータを再⽣生する
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
62. MetaData
クラス名 概要
ImageMetaData RGBカメラのデータ
DepthMetaData 距離離カメラのデータ
SceneMetaData ユーザーや床のデータ
AudioMetaData ⾳音声のデータ
IRMetaData ⾚赤外線のデータ
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
64. Capability
クラス名 概要
視点機能(RGBと距離離カメラの座標を
AlternativeViewPoint
合わせる)
MirrorCapability ミラー機能
PoseDetectionCapability ポーズの検出機能
SkeletonCapability ⾻骨格の検出、追跡機能
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
68. Session
クラス名 概要
SessionManager セッションの開始や終了了を制御する
MultiProcessFlowClient マルチプロセスでのデータの受信側
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
70. Detector
クラス名 概要
XnVWaveDetector ⼿手の左右動作を検出する
XnVPushDetector ⼿手の前後動作を検出する
XnVCircleDetector ⼿手の円動作を検出する
⼿手の上、下、右、左、前、後ろの各
XnVSwipeDetector
動作を検出する
XnVSteadyDetector ⼿手の静⽌止を検出する
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
72. ⼿手を振ると”Hello”と表
⽰示するアプリ
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
74. // see : http://arena.openni.org/OpenNIArena/Applications/ViewApp.aspx?app_id=424
#include <iostream>
#include <XnOpenNI.h>
#include <XnVNITE.h>
//
static void XN_CALLBACK_TYPE SessionDetected( const XnChar* strFocus,
const XnPoint3D& ptPosition, XnFloat fProgress, void* UserCxt )
{
std::cout << "SessionDetected:" << strFocus << "," << fProgress << std::endl;
}
// Wave
static void XN_CALLBACK_TYPE WaveCB( void* pUserCxt )
{
std::cout << "Hello OpenNI & NITE World!!" << std::endl;
}
void main( int argc, char* argv[] )
{
// OpenNI
xn::Context context;
XnStatus ret = context.InitFromXmlFile( "SamplesConfig.xml" );
// NITE
XnVSessionManager sessionManager;
ret = sessionManager.Initialize( &context, "Wave", "RaiseHand" );
sessionManager.RegisterSession( 0, &SessionStart, 0 , 0 );
// Wave
XnVWaveDetector wave;
wave.RegisterWave( 0, &WaveCB );
sessionManager.AddListener( &wave );
//
while ( true ) {
//
context.WaitAndUpdateAll();
sessionManager.Update( &context );
}
}
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
78. セッション遷移を通知する
コールバックの設定
sessionManager.RegisterSession( 0,
&SessionStart, 0 , 0 );
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
79. セッション開始のコールバック
//
static void XN_CALLBACK_TYPE SessionDetected(const XnChar* strFocus,
const XnPoint3D& ptPosition,XnFloat fProgress, void* UserCxt )
{
std::cout << "SessionDetected:" << strFocus <<
"," << fProgress << std::endl;
}
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
80. Waveジェスチャーの検出設定
// Wave
XnVWaveDetector wave;
wave.RegisterWave( 0, &WaveCB );
sessionManager.AddListener( &wave );
実際にジェスチャーを検出させてみましょう。セッションの開始にWaveを使っていま
すので、そのままWaveジェスチャーを検出させてみます。ジェスチャーの検出は、
ジェスチャーごとに検出⽤用のクラスが⽤用意されています。今回はWaveを検出させるの
でXnVWaveDetectorを使⽤用します。ジェスチャーを検出させるための準備は、⼤大ま
かに次の四ステップとなります。
1.ジェスチャー検出器を作成する
2.ジェスチャー検出器の設定をする(オプション)
3.ジェスチャーを検出した際のコールバックを設定する
4.セッションマネージャーにジェスチャー検出器を登録する
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
81. Waveジェスチャーの検出
// Wave
static void XN_CALLBACK_TYPE WaveCB( void* pUserCxt )
{
std::cout << "Hello OpenNI & NITE World!!" << std::endl;
}
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
82. メインループ
//
while ( true ) {
//
context.WaitAndUpdateAll();
sessionManager.Update( &context );
}
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.
84. <OpenNI>
<Licenses>
<License vendor="PrimeSense" key="insert key here"/>
</Licenses>
<Log writeToConsole="true" writeToFile="false">
<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
<LogLevel value="3"/>
<Masks>
<Mask name="ALL" on="false"/>
</Masks>
<Dumps>
</Dumps>
</Log>
<ProductionNodes>
<Node type="Depth">
<Configuration>
<Mirror on="true"/>
</Configuration>
</Node>
<Node type="Gesture" />
<Node type="Hands" />
</ProductionNodes>
</OpenNI>
KINECT introduction by Geis Co. Ltd. is licensed under a Creative Commons - - 2.1 License.