SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
Tsukasa SUGIURA
@UnaNancyOwen
Marketing
Kinect for Windows SDK プログラミングガイド (工学社)
http://www.kohgakusha.co.jp/books/detail/978-4-7775-1726-8
12.7[mm]
USB 3.0 micro-B
LED
Leap Motion DEV BOARD v.06.5
Infrared Camera
Infrared LED
Leap Motion DEV BOARD v.04
Leap Motion
• Leap Motionは手,指,ツールを
高精度かつ高フレームレートで検出・追跡できるデバイス
– 精度は1/100mm,フレームレートは290fps
– 有効範囲はデバイスの上方25-600mm,150°の逆ピラミッド状
– 79.99USD + 送料
Hand, Finger, Tool
• Leap Motionで取得できる情報
– 位置
– 移動速度
– 回転角度
– 方向
などの様々な情報が取得可能
指先の方向掌の方向
Gesture
• 様々なジェスチャーを認識可能
Swipe Circle
Key Tap Screen Tap
System Requirement
Hardware
• USB 2.0 or 3.0
OS
• Windows 7 or 8
• Mac OS 10.6 and higher
Language 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
Basic Flow
// Include Header
#include <Leap.h>
// Listener
class 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 */ }
Basic Flow
// Main
int main( int argc, char *argv[] ){
// Create a listener and controller
Listener listener;
Leap::Controller controller;
// Have the listener receive events from the controller
controller.addListener( listener );
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the listener when done
controller.removeListener( listener );
return 0;
}
Calibration
Demo 1 : Leap Visualizer
Youtube :Leap Motion (Leap Visualizer)
http://youtu.be/cxlpjSUrOa0
Demo 2 : Google Earth
Youtube : Control the Google Earth with Leap Motion
http://youtu.be/cL3jCcQXmUc
Example
• PowerPointをジェスチャーで操作する
// onConnect
void Listener::onConnect( const Leap::Controller& controller )
{
// Enable Background App
controller.setPolicyFlags( Leap::Controller::POLICY_BACKGROUND_FRAMES );
// Enable detect Gesture
controller.enableGesture( Leap::Gesture::TYPE_SWIPE );
}
// onFrame
void Listener::onFrame( const Leap::Controller& controller )
{
// Get Frame from Controller
const Leap::Frame frame = controller.frame();
// Get Gesture from Frame
const Leap::GestureList gestureList = frame.gestures();
for( int count = 0; count < gestureList.count(); ++count ){
Leap::Gesture gesture = gestureList[count];
Example
// Switch Gesture Type
switch( gesture.type() ){
// Case of Swipe Gesture
case Leap::Gesture::TYPE_SWIPE:
Leap::SwipeGesture swipeGesture = gesture;
// Swipe direction is horizontal if diff is positive, vertical if diff is negative
float 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;
Example
default:
break;
}
}
}
Summary
• 手,指,ツールを高精度かつ高フレームレートで
検出・追跡できるデバイス
• 様々なジェスチャーを認識できる
• とても安価(79.99USD + 送料)に入手できる
• 使い道は考える必要がある…
– 他のデバイスではなくLeap Motionを使う必然性

Contenu connexe

En vedette (6)

Leap motion
Leap motionLeap motion
Leap motion
 
Leap motion
Leap motionLeap motion
Leap motion
 
Leap motion
Leap motionLeap motion
Leap motion
 
Leap motion
Leap motionLeap motion
Leap motion
 
Leap Motion Basic
Leap Motion BasicLeap Motion Basic
Leap Motion Basic
 
Leap motion controller
Leap motion controllerLeap motion controller
Leap motion controller
 

Plus de Tsukasa Sugiura

Plus de Tsukasa Sugiura (9)

Azure Kinect DK C/C++ 開発概要(仮)
Azure Kinect DK C/C++ 開発概要(仮)Azure Kinect DK C/C++ 開発概要(仮)
Azure Kinect DK C/C++ 開発概要(仮)
 
OpenCVとPCLでのRealSenseのサポート状況+α
OpenCVとPCLでのRealSenseのサポート状況+αOpenCVとPCLでのRealSenseのサポート状況+α
OpenCVとPCLでのRealSenseのサポート状況+α
 
第38回 名古屋CV・PRML勉強会 「Kinect v2本の紹介とPCLの概要」
第38回 名古屋CV・PRML勉強会 「Kinect v2本の紹介とPCLの概要」第38回 名古屋CV・PRML勉強会 「Kinect v2本の紹介とPCLの概要」
第38回 名古屋CV・PRML勉強会 「Kinect v2本の紹介とPCLの概要」
 
Kinect v2 Introduction and Tutorial
Kinect v2 Introduction and TutorialKinect v2 Introduction and Tutorial
Kinect v2 Introduction and Tutorial
 
Introduction to Kinect v2
Introduction to Kinect v2Introduction to Kinect v2
Introduction to Kinect v2
 
ViEW2013 「SS-01 画像センサと応用事例の紹介」
ViEW2013 「SS-01 画像センサと応用事例の紹介」ViEW2013 「SS-01 画像センサと応用事例の紹介」
ViEW2013 「SS-01 画像センサと応用事例の紹介」
 
Leap Motion - 1st Review
Leap Motion - 1st ReviewLeap Motion - 1st Review
Leap Motion - 1st Review
 
OpenCV2.2 Install Guide ver.0.5
OpenCV2.2 Install Guide ver.0.5OpenCV2.2 Install Guide ver.0.5
OpenCV2.2 Install Guide ver.0.5
 
第2回名古屋CV・PRML勉強会 「Kinectの導入」
第2回名古屋CV・PRML勉強会 「Kinectの導入」第2回名古屋CV・PRML勉強会 「Kinectの導入」
第2回名古屋CV・PRML勉強会 「Kinectの導入」
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

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

  • 2. Marketing Kinect for Windows SDK プログラミングガイド (工学社) http://www.kohgakusha.co.jp/books/detail/978-4-7775-1726-8
  • 3. 12.7[mm] USB 3.0 micro-B LED Leap Motion DEV BOARD v.06.5
  • 4. Infrared Camera Infrared LED Leap Motion DEV BOARD v.04
  • 5. Leap Motion • Leap Motionは手,指,ツールを 高精度かつ高フレームレートで検出・追跡できるデバイス – 精度は1/100mm,フレームレートは290fps – 有効範囲はデバイスの上方25-600mm,150°の逆ピラミッド状 – 79.99USD + 送料
  • 6. Hand, Finger, Tool • Leap Motionで取得できる情報 – 位置 – 移動速度 – 回転角度 – 方向 などの様々な情報が取得可能 指先の方向掌の方向
  • 8. System Requirement Hardware • USB 2.0 or 3.0 OS • Windows 7 or 8 • Mac OS 10.6 and higher Language 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. Basic Flow // Include Header #include <Leap.h> // Listener class 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. Basic Flow // Main int main( int argc, char *argv[] ){ // Create a listener and controller Listener listener; Leap::Controller controller; // Have the listener receive events from the controller controller.addListener( listener ); // Keep this process running until Enter is pressed std::cout << "Press Enter to quit..." << std::endl; std::cin.get(); // Remove the listener when done controller.removeListener( listener ); return 0; }
  • 12. Demo 1 : Leap Visualizer Youtube :Leap Motion (Leap Visualizer) http://youtu.be/cxlpjSUrOa0
  • 13. Demo 2 : Google Earth Youtube : Control the Google Earth with Leap Motion http://youtu.be/cL3jCcQXmUc
  • 14. Example • PowerPointをジェスチャーで操作する // onConnect void Listener::onConnect( const Leap::Controller& controller ) { // Enable Background App controller.setPolicyFlags( Leap::Controller::POLICY_BACKGROUND_FRAMES ); // Enable detect Gesture controller.enableGesture( Leap::Gesture::TYPE_SWIPE ); } // onFrame void Listener::onFrame( const Leap::Controller& controller ) { // Get Frame from Controller const Leap::Frame frame = controller.frame(); // Get Gesture from Frame const Leap::GestureList gestureList = frame.gestures(); for( int count = 0; count < gestureList.count(); ++count ){ Leap::Gesture gesture = gestureList[count];
  • 15. Example // Switch Gesture Type switch( gesture.type() ){ // Case of Swipe Gesture case Leap::Gesture::TYPE_SWIPE: Leap::SwipeGesture swipeGesture = gesture; // Swipe direction is horizontal if diff is positive, vertical if diff is negative float 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;
  • 17. Summary • 手,指,ツールを高精度かつ高フレームレートで 検出・追跡できるデバイス • 様々なジェスチャーを認識できる • とても安価(79.99USD + 送料)に入手できる • 使い道は考える必要がある… – 他のデバイスではなくLeap Motionを使う必然性