第22回名古屋CV・PRML勉強会 「Leap Motion」

15,977 views

Published on

2013/04/27
第22回 名古屋CV/PRML勉強会 「Leap Motion」
http://partake.in/events/f5d0c496-6428-4f8e-88f5-76b49f606b98

Ustream - セッション2 「LeapMotionの紹介」-2
http://ustre.am/:2al27

Togetter
http://togetter.com/li/494350

Published in: Technology
0 Comments
13 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
15,977
On SlideShare
0
From Embeds
0
Number of Embeds
11,149
Actions
Shares
0
Downloads
69
Comments
0
Likes
13
Embeds 0
No embeds

No notes for slide

第22回名古屋CV・PRML勉強会 「Leap Motion」

  1. 1. Tsukasa SUGIURA@UnaNancyOwen
  2. 2. MarketingKinect for Windows SDK プログラミングガイド (工学社)http://www.kohgakusha.co.jp/books/detail/978-4-7775-1726-8
  3. 3. 12.7[mm]USB 3.0 micro-BLEDLeap Motion DEV BOARD v.06.5
  4. 4. Infrared CameraInfrared LEDLeap Motion DEV BOARD v.04
  5. 5. Leap Motion• Leap Motionは手,指,ツールを高精度かつ高フレームレートで検出・追跡できるデバイス– 精度は1/100mm,フレームレートは290fps– 有効範囲はデバイスの上方25-600mm,150°の逆ピラミッド状– 79.99USD + 送料
  6. 6. Hand, Finger, Tool• Leap Motionで取得できる情報– 位置– 移動速度– 回転角度– 方向などの様々な情報が取得可能指先の方向掌の方向
  7. 7. Gesture• 様々なジェスチャーを認識可能Swipe CircleKey Tap Screen Tap
  8. 8. System RequirementHardware• USB 2.0 or 3.0OS• Windows 7 or 8• Mac OS 10.6 and higherLanguage and Compiler• C++– Visual Studio 2008, 2010, 2012– Xcode 3.0+, clang 3.0+ and gcc• Objective-C– Xcode 4.2+, clang 3.0+• Unity Pro 4.0• C#– .NET Framework 3.5, 4.0– Mono 2.10• Java 6, 7• Python 2.7.3• JavaScript• Linux Ubuntu 12.04 LTS, 12.10
  9. 9. Basic Flow// Include Header#include <Leap.h>// Listenerclass Listener : public Leap::Listener{public:virtual void onInit( const Leap::Controller& );virtual void onConnect( const Leap::Controller& );virtual void onDisconnect( const Leap::Controller& );virtual void onFrame( const Leap::Controller& );virtual void onExit( const Leap::Controller& );};void Listener::onInit( const Leap::Controller& controller ){ /* Processing */ }void Listener::onConnect( const Leap::Controller& controller ){ /* Processing */ }void Listener::onDisconnect( const Leap::Controller& controller ){ /* Processing */ }void Listener::onFrame( const Leap::Controller& controller ){ /* Processing */ }void Listener::onExit( const Leap::Controller& controller ){ /* Processing */ }
  10. 10. Basic Flow// Mainint main( int argc, char *argv[] ){// Create a listener and controllerListener listener;Leap::Controller controller;// Have the listener receive events from the controllercontroller.addListener( listener );// Keep this process running until Enter is pressedstd::cout << "Press Enter to quit..." << std::endl;std::cin.get();// Remove the listener when donecontroller.removeListener( listener );return 0;}
  11. 11. Calibration
  12. 12. Demo 1 : Leap VisualizerYoutube :Leap Motion (Leap Visualizer)http://youtu.be/cxlpjSUrOa0
  13. 13. Demo 2 : Google EarthYoutube : Control the Google Earth with Leap Motionhttp://youtu.be/cL3jCcQXmUc
  14. 14. Example• PowerPointをジェスチャーで操作する// onConnectvoid Listener::onConnect( const Leap::Controller& controller ){// Enable Background Appcontroller.setPolicyFlags( Leap::Controller::POLICY_BACKGROUND_FRAMES );// Enable detect Gesturecontroller.enableGesture( Leap::Gesture::TYPE_SWIPE );}// onFramevoid Listener::onFrame( const Leap::Controller& controller ){// Get Frame from Controllerconst Leap::Frame frame = controller.frame();// Get Gesture from Frameconst Leap::GestureList gestureList = frame.gestures();for( int count = 0; count < gestureList.count(); ++count ){Leap::Gesture gesture = gestureList[count];
  15. 15. Example// Switch Gesture Typeswitch( gesture.type() ){// Case of Swipe Gesturecase Leap::Gesture::TYPE_SWIPE:Leap::SwipeGesture swipeGesture = gesture;// Swipe direction is horizontal if diff is positive, vertical if diff is negativefloat diff = std::abs( swipeGesture.direction().x ) - std::abs( swipeGesture.direction().y );if( diff > 0.0f ){// Swipe Left ( <- )if( swipeGesture.direction().x > 0.0f ){if( swipeGesture.state() == Leap::Gesture::STATE_START ){keybd_event( VK_RIGHT, 0, 0, 0 );keybd_event( VK_RIGHT, 0, KEYEVENTF_KEYUP, 0 );}}// Swipe Right ( -> )else{if( swipeGesture.state() == Leap::Gesture::STATE_START ){keybd_event( VK_LEFT, 0, 0, 0 );keybd_event( VK_LEFT, 0, KEYEVENTF_KEYUP, 0 );}}}break;
  16. 16. Exampledefault:break;}}}
  17. 17. Summary• 手,指,ツールを高精度かつ高フレームレートで検出・追跡できるデバイス• 様々なジェスチャーを認識できる• とても安価(79.99USD + 送料)に入手できる• 使い道は考える必要がある…– 他のデバイスではなくLeap Motionを使う必然性

×