SlideShare a Scribd company logo
Developing Natural User 
Interface Applications With 
RealSenseTM Devices 
Pete O’Hanlon @peteohanlon
Evolution of Perceptual Computing 
 Allows computer to perceive depth in a similar way we do 
 Uses 2D and 3D depth camera 
 Allows us to interact with computers in a completely new way
Different types of camera 
 Front facing camera 
 Track hands and fingers 
 Capture face movements 
 Detect and differentiate between foreground and background 
 Rear facing camera 
 Scan, measure rooms and objects 
 Snapshot camera
The SDK 
 Runs on Windows 8.1 as well as in the browser and Android 
 Available for different languages 
 C++ 
 C# 
 Java 
 JavaScript 
 Processing (OS framework for developing visual oriented apps – Java like) 
 Runs on popular game engines 
 Unity supported
What you need 
Hardware 
 4th generation Intel® Core™ Haswell 
 Minimum 8GB free hard disk 
 USB 3 port 
 RealSenseTM 3D Camera 
Software 
 Windows 8.1 64 bit 
 Visual Studio 2010+ 
 .NET 4+ 
 Unity PRO 4.1.0+ 
 Web Browser 
 Processing 2.1.2+ 
 JDK 1.7.0_11+
IR Camera 
Full HD 1080p Image Sensor 
IR Laser Projector
SDK Based Application 
Language specific interfaces 
SDK interfaces 
SDK Core I/O Algorithm Algorithm
Natural User Interfaces
Framework features 
 Emotion detection 
 Face tracking 
 Facial recognition 
 Hand tracking 
 Gesture recognition 
 Object tracking 
 Speech recognition 
 Speech synthesis 
 Touchless controller 
 Segmentation
The potential 
 Touch free kiosks 
 Games 
 Interactive books 
 Collaboration 
 Enhanced tutoring 
 Many more…
Developing 
Setting up
Initialisation 
private PXCMSenseManager senseManager; 
private PXCMHandModule handModule; 
private PXCMHandConfiguration handConfiguration; 
private PXCMSpeechSynthesis speechSynthesis; 
private PXCMAudio.AudioInfo audioInfo; 
private PXCMTouchlessController touchlessController; 
private PXCMFaceModule faceModule; 
private PXCMFaceConfiguration faceConfiguration; 
senseManager = PXCMSenseManager.CreateInstance();
if (status >= pxcmStatus.PXCM_STATUS_NO_ERROR) 
{ 
PXCMCapture.Device device = 
senseManager.captureManager.device; 
device.SetDepthConfidenceThreshold(10); 
device.SetIVCAMLaserPower(16); 
device.SetIVCAMAccuracy( 
PXCMCapture.Device. 
IVCAMAccuracy.IVCAM_ACCURACY_COARSE); 
device.SetIVCAMMotionRangeTradeOff(21); 
device.SetIVCAMFilterOption(6); 
if (senseManager.StreamFrames(false) 
>= pxcmStatus.PXCM_STATUS_NO_ERROR) 
{ 
// We are streaming data,,, 
} 
}
Emotion detection
senseManager.EnableEmotion(); 
private pxcmStatus ProcessFrame(… 
{ 
switch (moduleId) 
{ 
case PXCMEmotion.CUID: 
ProcessEmotionData(module); 
break; 
} 
return pxcmStatus.PXCM_STATUS_NO_ERROR; 
}
private void ProcessEmotionData( 
PXCMBase module) 
{ 
PXCMEmotion emotion = 
module.QueryInstance<PXCMEmotion>(); 
int numberOfFaces = emotion.QueryNumFaces(); 
for (int face = 0; face < numberOfFaces; 
face++) 
{ 
PXCMEmotion.EmotionData[] emotionData = 
new PXCMEmotion.EmotionData[10]; 
emotion.QueryAllEmotionData(face, 
out emotionData); 
FindStrongestEmotion(emotionData); 
} 
}
private void FindStrongestEmotion( 
PXCMEmotion.EmotionData[] emotionData) 
{ 
PXCMEmotion.EmotionData strongestEmotion = 
emotionData[0]; 
int index = 0; 
for (int emotionIndex = 1; emotionIndex < 7; 
emotionIndex++) 
{ 
if (emotionData[emotionIndex].evidence > 
strongestEmotion.evidence) 
{ 
index = emotionIndex; 
strongestEmotion = 
emotionData[emotionIndex]; 
} 
} 
}
Segmentation
senseManager.Enable3DSeg(); 
private pxcmStatus ProcessFrame( 
int moduleId, 
PXCMBase module, 
PXCMCapture.Sample captureSample) 
{ 
switch (moduleId) 
{ 
case PXCM3DSeg.CUID: 
ProcessSegmentData(module); 
break; 
} 
return pxcmStatus.PXCM_STATUS_NO_ERROR; 
}
private void ProcessSegmentData( 
PXCMBase module) 
{ 
PXCM3DSeg segment = 
module.QueryInstance<PXCM3DSeg>(); 
if (segment != null) 
{ 
using (PXCMImage image = 
segment.AcquireSegmentedImage()) 
{ 
if (image != null) 
{ 
ExtractForeground (image); 
} 
} 
} 
}
private void ExtractForeground(PXCMImage image) 
{ 
PXCMImage.ImageData segmentImage; 
image.AcquireAccess( 
PXCMImage.Access.ACCESS_READ_WRITE, 
PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, 
out segmentImage); 
try 
{ 
ProcessImage(image, segmentImage); 
} 
finally 
{ 
image.ReleaseAccess(segmentImage); 
} 
WriteableBitmap bmp = 
segmentImage.ToWritableBitmap( 
0, 
image.info.width, 
image.info.height, 96, 96); 
}
PXCMImage.ImageInfo info = image.QueryInfo(); 
for (int y = 0; y < height; y++) 
{ 
unsafe 
{ 
byte* pixel = (byte*)segmentImage.planes[0] 
+ y * segmentImage.pitches[0]; 
for (int x = 0; x < width; x++){ 
if (pixel[3] == 0){ 
for (int ch = 0; ch < 3; ch++) 
{ 
pixel[ch] = (byte)0; 
} 
} 
pixel += 4; 
} 
} 
}
Hands 
Touchless Control
senseManager.EnableTouchlessController(null); 
touchlessController = 
senseManager.QueryTouchlessController(); 
touchlessController.SubscribeEvent( 
new PXCMTouchlessController 
.OnFiredUXEventDelegate( 
OnTouchlessControllerUXEvent)); 
PXCMTouchlessController.ProfileInfo 
profileInfo; 
touchlessController.QueryProfile(out 
profileInfo); 
profileInfo.config = PXCMTouchlessController 
.ProfileInfo.Configuration 
.Configuration_Scroll_Horizontally; 
touchlessController.SetProfile(profileInfo);
private void OnTouchlessControllerUXEvent( 
PXCMTouchlessController.UXEventData data) 
{ 
switch (data.type) 
{ 
case PXCMTouchlessController 
.UXEventData.UXEventType 
.UXEvent_StartScroll: 
break; 
case PXCMTouchlessController 
.UXEventData.UXEventType 
.UXEvent_Scroll: 
break; 
case PXCMTouchlessController 
.UXEventData.UXEventType 
.UXEvent_Select: 
break; 
} 
}
Speech Synthesis
private void SetupSpeechSynthesis() 
{ 
if (senseManager.session.CreateImpl<PXCMSpeechSynthesis> 
(out speechSynthesis) 
>= pxcmStatus.PXCM_STATUS_NO_ERROR) 
{ 
PXCMSpeechSynthesis 
.ProfileInfo profileInfo; 
if (speechSynthesis.QueryProfile(0, 
out profileInfo) 
>= pxcmStatus.PXCM_STATUS_NO_ERROR) 
{ 
profileInfo.voice = 
PXCMSpeechSynthesis.VoiceType 
.VOICE_ANY; 
audioInfo = profileInfo.outputs; 
speechSynthesis 
.SetProfile(profileInfo); 
} 
} 
}
public void Say(string sentence) 
{ 
if (speechSynthesis != null) 
{ 
speechSynthesis.BuildSentence(1, sentence); 
int buffer = 
speechSynthesis.QueryBufferNum(1); 
VoiceOut voiceOut = 
new VoiceOut(audioInfo); 
for (int i = 0; i < buffer; i++) 
{ 
PXCMAudio audio = 
speechSynthesis.QueryBuffer(1, i); 
voiceOut.RenderAudio(audio); 
} 
voiceOut.Close(); 
speechSynthesis.ReleaseSentence(1); 
} 
}
Face tracking
senseManager.EnableFace(); 
PXCMFaceModule faceModule = senseManager.QueryFace(); 
PXCMFaceConfiguration config = 
faceModule.CreateActiveConfiguration(); 
config.detection.isEnabled = true; 
config.detection.maxTrackedFaces = 2; 
config.landmarks.isEnabled = true; 
config.ApplyChanges();
private pxcmStatus ProcessFrame( 
int moduleId, 
PXCMBase module, 
PXCMCapture.Sample captureSample) 
{ 
switch (moduleId) 
{ 
case PXCMFaceModule.CUID: 
ProcessFace(module); 
break; 
} 
return pxcmStatus.PXCM_STATUS_NO_ERROR; 
}
private void ProcessFace(PXCMBase module) 
{ 
using (PXCMFaceModule faceModule = 
module.QueryInstance<PXCMFaceModule>()) 
{ 
using (PXCMFaceData faceData = faceModule.CreateOutput()) 
{ 
int faceCount = faceData.QueryNumberOfDetectedFaces(); 
for (int faceIndex = 0; faceIndex < faceCount; 
faceIndex++) 
{ 
PXCMFaceData.Face face = 
faceData.QueryFaceByIndex(faceIndex); 
GetFaceBounds(face); 
GetLandmarkData(face); 
} 
} 
} 
}
private static void GetLandmarkData( 
PXCMFaceData.Face face) 
{ 
PXCMFaceData.LandmarkPoint[] landmarks; 
PXCMFaceData.LandmarksData landmarkData = 
face.QueryLandmarks(); 
landmarkData.QueryPoints(out landmarks); 
} 
private static void GetFaceBounds( 
PXCMFaceData.Face face) 
{ 
PXCMFaceData.DetectionData detectionData = 
face.QueryDetection(); 
PXCMRectI32 boundingRect; 
detectionData.QueryBoundingRect( 
out boundingRect); 
}
Starting the loop
PXCMSenseManager.Handler handler = new 
PXCMSenseManager.Handler 
{ 
onModuleProcessedFrame = ProcessFrame 
}; 
private pxcmStatus ProcessFrame( 
int moduleId, 
PXCMBase module, 
PXCMCapture.Sample captureSample) 
{ 
return pxcmStatus.PXCM_STATUS_NO_ERROR; 
} 
pxcmStatus status = senseManager.Init(handler);
What next? 
 Order your camera 
 http://click.intel.com/intel-realsense-developer-kit.html 
 Download the SDK 
 https://software.intel.com/en-us/realsense/intel-realsense-sdk-for-windows 
 Code

More Related Content

Similar to Developing natural user interface applications with real sense devices

HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
Ankara JUG
 
Perceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichPerceptual Computing Workshop in Munich
Perceptual Computing Workshop in Munich
BeMyApp
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
Laurence Svekis ✔
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
Heiko Behrens
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
PVS-Studio
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
Andrey Karpov
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
Sergey Shekyan
 
There's more than web
There's more than webThere's more than web
There's more than webMatt Evans
 
Bigger Stronger Faster
Bigger Stronger FasterBigger Stronger Faster
Bigger Stronger Faster
Chris Love
 
156-useful-run-commands.pdf
156-useful-run-commands.pdf156-useful-run-commands.pdf
156-useful-run-commands.pdf
MuhammadFaizalAbdull3
 
Pandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 Agent
Pandora FMS
 
Start to Finish: Porting to BlackBerry 10
Start to Finish: Porting to BlackBerry 10Start to Finish: Porting to BlackBerry 10
Start to Finish: Porting to BlackBerry 10ardiri
 
Silverlight in Internet Scenarios
Silverlight in Internet ScenariosSilverlight in Internet Scenarios
Silverlight in Internet Scenarios
Ricardo Fiel
 
Developing AIR for Android with Flash Professional
Developing AIR for Android with Flash ProfessionalDeveloping AIR for Android with Flash Professional
Developing AIR for Android with Flash Professional
Chris Griffith
 
Using the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam HannaUsing the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam Hanna
Codemotion
 
2012 star west-t10
2012 star west-t102012 star west-t10
2012 star west-t10
Eing Ong
 
Unity3D Programming
Unity3D ProgrammingUnity3D Programming
Unity3D Programming
Michael Ivanov
 
Google Fit, Android Wear & Xamarin
Google Fit, Android Wear & XamarinGoogle Fit, Android Wear & Xamarin
Google Fit, Android Wear & Xamarin
Peter Friese
 

Similar to Developing natural user interface applications with real sense devices (20)

HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Perceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichPerceptual Computing Workshop in Munich
Perceptual Computing Workshop in Munich
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
 
There's more than web
There's more than webThere's more than web
There's more than web
 
Bigger Stronger Faster
Bigger Stronger FasterBigger Stronger Faster
Bigger Stronger Faster
 
156-useful-run-commands.pdf
156-useful-run-commands.pdf156-useful-run-commands.pdf
156-useful-run-commands.pdf
 
Pandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 Agent
 
Start to Finish: Porting to BlackBerry 10
Start to Finish: Porting to BlackBerry 10Start to Finish: Porting to BlackBerry 10
Start to Finish: Porting to BlackBerry 10
 
Silverlight in Internet Scenarios
Silverlight in Internet ScenariosSilverlight in Internet Scenarios
Silverlight in Internet Scenarios
 
Developing AIR for Android with Flash Professional
Developing AIR for Android with Flash ProfessionalDeveloping AIR for Android with Flash Professional
Developing AIR for Android with Flash Professional
 
Using the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam HannaUsing the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam Hanna
 
2012 star west-t10
2012 star west-t102012 star west-t10
2012 star west-t10
 
Unity3D Programming
Unity3D ProgrammingUnity3D Programming
Unity3D Programming
 
Google Fit, Android Wear & Xamarin
Google Fit, Android Wear & XamarinGoogle Fit, Android Wear & Xamarin
Google Fit, Android Wear & Xamarin
 

Recently uploaded

Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 

Recently uploaded (20)

Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 

Developing natural user interface applications with real sense devices

  • 1. Developing Natural User Interface Applications With RealSenseTM Devices Pete O’Hanlon @peteohanlon
  • 2. Evolution of Perceptual Computing  Allows computer to perceive depth in a similar way we do  Uses 2D and 3D depth camera  Allows us to interact with computers in a completely new way
  • 3. Different types of camera  Front facing camera  Track hands and fingers  Capture face movements  Detect and differentiate between foreground and background  Rear facing camera  Scan, measure rooms and objects  Snapshot camera
  • 4. The SDK  Runs on Windows 8.1 as well as in the browser and Android  Available for different languages  C++  C#  Java  JavaScript  Processing (OS framework for developing visual oriented apps – Java like)  Runs on popular game engines  Unity supported
  • 5. What you need Hardware  4th generation Intel® Core™ Haswell  Minimum 8GB free hard disk  USB 3 port  RealSenseTM 3D Camera Software  Windows 8.1 64 bit  Visual Studio 2010+  .NET 4+  Unity PRO 4.1.0+  Web Browser  Processing 2.1.2+  JDK 1.7.0_11+
  • 6. IR Camera Full HD 1080p Image Sensor IR Laser Projector
  • 7. SDK Based Application Language specific interfaces SDK interfaces SDK Core I/O Algorithm Algorithm
  • 9. Framework features  Emotion detection  Face tracking  Facial recognition  Hand tracking  Gesture recognition  Object tracking  Speech recognition  Speech synthesis  Touchless controller  Segmentation
  • 10. The potential  Touch free kiosks  Games  Interactive books  Collaboration  Enhanced tutoring  Many more…
  • 12.
  • 13. Initialisation private PXCMSenseManager senseManager; private PXCMHandModule handModule; private PXCMHandConfiguration handConfiguration; private PXCMSpeechSynthesis speechSynthesis; private PXCMAudio.AudioInfo audioInfo; private PXCMTouchlessController touchlessController; private PXCMFaceModule faceModule; private PXCMFaceConfiguration faceConfiguration; senseManager = PXCMSenseManager.CreateInstance();
  • 14. if (status >= pxcmStatus.PXCM_STATUS_NO_ERROR) { PXCMCapture.Device device = senseManager.captureManager.device; device.SetDepthConfidenceThreshold(10); device.SetIVCAMLaserPower(16); device.SetIVCAMAccuracy( PXCMCapture.Device. IVCAMAccuracy.IVCAM_ACCURACY_COARSE); device.SetIVCAMMotionRangeTradeOff(21); device.SetIVCAMFilterOption(6); if (senseManager.StreamFrames(false) >= pxcmStatus.PXCM_STATUS_NO_ERROR) { // We are streaming data,,, } }
  • 16. senseManager.EnableEmotion(); private pxcmStatus ProcessFrame(… { switch (moduleId) { case PXCMEmotion.CUID: ProcessEmotionData(module); break; } return pxcmStatus.PXCM_STATUS_NO_ERROR; }
  • 17. private void ProcessEmotionData( PXCMBase module) { PXCMEmotion emotion = module.QueryInstance<PXCMEmotion>(); int numberOfFaces = emotion.QueryNumFaces(); for (int face = 0; face < numberOfFaces; face++) { PXCMEmotion.EmotionData[] emotionData = new PXCMEmotion.EmotionData[10]; emotion.QueryAllEmotionData(face, out emotionData); FindStrongestEmotion(emotionData); } }
  • 18. private void FindStrongestEmotion( PXCMEmotion.EmotionData[] emotionData) { PXCMEmotion.EmotionData strongestEmotion = emotionData[0]; int index = 0; for (int emotionIndex = 1; emotionIndex < 7; emotionIndex++) { if (emotionData[emotionIndex].evidence > strongestEmotion.evidence) { index = emotionIndex; strongestEmotion = emotionData[emotionIndex]; } } }
  • 20. senseManager.Enable3DSeg(); private pxcmStatus ProcessFrame( int moduleId, PXCMBase module, PXCMCapture.Sample captureSample) { switch (moduleId) { case PXCM3DSeg.CUID: ProcessSegmentData(module); break; } return pxcmStatus.PXCM_STATUS_NO_ERROR; }
  • 21. private void ProcessSegmentData( PXCMBase module) { PXCM3DSeg segment = module.QueryInstance<PXCM3DSeg>(); if (segment != null) { using (PXCMImage image = segment.AcquireSegmentedImage()) { if (image != null) { ExtractForeground (image); } } } }
  • 22. private void ExtractForeground(PXCMImage image) { PXCMImage.ImageData segmentImage; image.AcquireAccess( PXCMImage.Access.ACCESS_READ_WRITE, PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, out segmentImage); try { ProcessImage(image, segmentImage); } finally { image.ReleaseAccess(segmentImage); } WriteableBitmap bmp = segmentImage.ToWritableBitmap( 0, image.info.width, image.info.height, 96, 96); }
  • 23. PXCMImage.ImageInfo info = image.QueryInfo(); for (int y = 0; y < height; y++) { unsafe { byte* pixel = (byte*)segmentImage.planes[0] + y * segmentImage.pitches[0]; for (int x = 0; x < width; x++){ if (pixel[3] == 0){ for (int ch = 0; ch < 3; ch++) { pixel[ch] = (byte)0; } } pixel += 4; } } }
  • 25. senseManager.EnableTouchlessController(null); touchlessController = senseManager.QueryTouchlessController(); touchlessController.SubscribeEvent( new PXCMTouchlessController .OnFiredUXEventDelegate( OnTouchlessControllerUXEvent)); PXCMTouchlessController.ProfileInfo profileInfo; touchlessController.QueryProfile(out profileInfo); profileInfo.config = PXCMTouchlessController .ProfileInfo.Configuration .Configuration_Scroll_Horizontally; touchlessController.SetProfile(profileInfo);
  • 26. private void OnTouchlessControllerUXEvent( PXCMTouchlessController.UXEventData data) { switch (data.type) { case PXCMTouchlessController .UXEventData.UXEventType .UXEvent_StartScroll: break; case PXCMTouchlessController .UXEventData.UXEventType .UXEvent_Scroll: break; case PXCMTouchlessController .UXEventData.UXEventType .UXEvent_Select: break; } }
  • 28. private void SetupSpeechSynthesis() { if (senseManager.session.CreateImpl<PXCMSpeechSynthesis> (out speechSynthesis) >= pxcmStatus.PXCM_STATUS_NO_ERROR) { PXCMSpeechSynthesis .ProfileInfo profileInfo; if (speechSynthesis.QueryProfile(0, out profileInfo) >= pxcmStatus.PXCM_STATUS_NO_ERROR) { profileInfo.voice = PXCMSpeechSynthesis.VoiceType .VOICE_ANY; audioInfo = profileInfo.outputs; speechSynthesis .SetProfile(profileInfo); } } }
  • 29. public void Say(string sentence) { if (speechSynthesis != null) { speechSynthesis.BuildSentence(1, sentence); int buffer = speechSynthesis.QueryBufferNum(1); VoiceOut voiceOut = new VoiceOut(audioInfo); for (int i = 0; i < buffer; i++) { PXCMAudio audio = speechSynthesis.QueryBuffer(1, i); voiceOut.RenderAudio(audio); } voiceOut.Close(); speechSynthesis.ReleaseSentence(1); } }
  • 31. senseManager.EnableFace(); PXCMFaceModule faceModule = senseManager.QueryFace(); PXCMFaceConfiguration config = faceModule.CreateActiveConfiguration(); config.detection.isEnabled = true; config.detection.maxTrackedFaces = 2; config.landmarks.isEnabled = true; config.ApplyChanges();
  • 32. private pxcmStatus ProcessFrame( int moduleId, PXCMBase module, PXCMCapture.Sample captureSample) { switch (moduleId) { case PXCMFaceModule.CUID: ProcessFace(module); break; } return pxcmStatus.PXCM_STATUS_NO_ERROR; }
  • 33. private void ProcessFace(PXCMBase module) { using (PXCMFaceModule faceModule = module.QueryInstance<PXCMFaceModule>()) { using (PXCMFaceData faceData = faceModule.CreateOutput()) { int faceCount = faceData.QueryNumberOfDetectedFaces(); for (int faceIndex = 0; faceIndex < faceCount; faceIndex++) { PXCMFaceData.Face face = faceData.QueryFaceByIndex(faceIndex); GetFaceBounds(face); GetLandmarkData(face); } } } }
  • 34. private static void GetLandmarkData( PXCMFaceData.Face face) { PXCMFaceData.LandmarkPoint[] landmarks; PXCMFaceData.LandmarksData landmarkData = face.QueryLandmarks(); landmarkData.QueryPoints(out landmarks); } private static void GetFaceBounds( PXCMFaceData.Face face) { PXCMFaceData.DetectionData detectionData = face.QueryDetection(); PXCMRectI32 boundingRect; detectionData.QueryBoundingRect( out boundingRect); }
  • 36. PXCMSenseManager.Handler handler = new PXCMSenseManager.Handler { onModuleProcessedFrame = ProcessFrame }; private pxcmStatus ProcessFrame( int moduleId, PXCMBase module, PXCMCapture.Sample captureSample) { return pxcmStatus.PXCM_STATUS_NO_ERROR; } pxcmStatus status = senseManager.Init(handler);
  • 37. What next?  Order your camera  http://click.intel.com/intel-realsense-developer-kit.html  Download the SDK  https://software.intel.com/en-us/realsense/intel-realsense-sdk-for-windows  Code