SlideShare a Scribd company logo
1 of 29
ROME 11-12 april 2014ROME 11-12 april 2014
Kinect V2: NUI for dummies!!
massimo.bonanni@tiscali.it
@massimobonanni
http://codetailor.blogspot.com
Massimo Bonanni
ROME 11-12 april 2014 - Speaker’s name
Agenda
• Prerequisiti
• Hardware
• Architettura
• Kinect Source
ROME 11-12 april 2014
Prerequisiti
• Sistemi Operativi Supportati
– Windows 8, Windows 8.1
• Configurazione Hardware
– Processore 64 bit (x64) i7 2.5Ghz (o superiore)
– Memoria 4 GB (o più)
– Built-in USB 3.0 host controller (chipset Intel o Renesas);
– Scheda grafica DirectX11: ATI Radeon (HD 5400 series, HD 6570,
HD 7800), NVidia Quadro (600, K1000M), NVidia GeForce (GT
640, GTX 660), Intel HD 4000
– Sensore Kinect v2 (con alimentatore e USB hub)
• Software Requirements
– Visual Studio 2012 (2013)
ROME 11-12 april 2014
Kinect for Windows v2
sensor
Hardware
Kinect for Windows v2
USB hub
Kinect for Windows v2
power supply
ROME 11-12 april 2014
Hardware
• Color camera con risoluzione 1920x1080 pixel, 30 fps
• Infrared camera con risoluzione 512x424 pixel, 30 fps
• Range di profondità da 0.5 a 4.5 m
• Utilizzo di camera ad infrarossi e a colori
contemporaneamente
• No motore per “brandeggiamento” verticale
ROME 11-12 april 2014
Kinect V1 vs Kinect V2
Feature Kinect for Windows 1 Kinect for Windows 2
Color Camera 640 x 480 @ 30 fps 1920 x 1080 @ 30 fps
Depth Camera 320 x 240 512 x 424
Max Depth Distance ~4.5 M ~4.5 M
Min Depth Distance 40 cm in near mode 50 cm
Horizontal Field of View 57 degrees 70 degrees
Vertical Field of View 43 degrees 60 degrees
Tilt Motor yes no
Skeleton Joints Defined 20 joints 25 joints
Full Skeletons Tracked 2 6
USB Standard 2.0 3.0
Supported OS Win 7, Win 8 Win 8-8.1 (WSA)
Price $299 TBD
ROME 11-12 april 2014
Architettura
Kinect Sensor
Kinect Drivers
Kinect Runtime
Native API .NET API WinRT API
Native Apps .NET Apps WSA
Maggior parte delle
elaborazioni anche
sfruttando la GPU
Applicazioni
COM/C++
Applicazioni
Desktop
Windows Store
Apps
ROME 11-12 april 2014
Architettura
• L’architettura prevede delle sorgenti (source) e dei reader
• Ogni stream fornito dal device è una sorgente dalla quale
possiamo ricavare uno o più reader
• Ogni reader fornisce degli eventi per recuperare dei reference ai
singoli frame provenienti dal device
• Dal singolo frame si possono recuperare i dati relativi al tipo di
sorgente (ad esempio lo scheletro del giocatore)
Sensor Source Reader
Frame
Ref
Frame
ROME 11-12 april 2014
Architettura: V1 vs V2
Stream
ReaderSource
Una sola
applicazione alla
volta
Più applicazioni
contemporanee
ROME 11-12 april 2014
Sensor
• Utilizzo del sensore
– Recuperare un’istanza di KinectSensor
– Aprire il sensore
– Usare il sensore
– Chiudere il sensore
• In caso di sconnessione del device
– L’istanza di KinectSensor rimane valida
– Non vengono inviati più frame
– La proprietà IsAvailable ci dice se il sensore è
attaccato o meno.
• Possono essere gestiti più sensori
Sensor = KinectSensor.Default
Sensor.Open()
'
'
'
Sensor.Close()
Dim kinectList = KinectSensor.KinectSensors _
.Where(Function(k) k.IsAvailable = True)
Sensor Source Reader
Frame
Ref
Frame
ROME 11-12 april 2014
Source
• Espone i metadati della sorgente e
permette di accedere al reader
• Il sensore espone una sorgente per ogni
tipo di funzionalità
Sensor Source Reader
Frame
Ref
Frame
ROME 11-12 april 2014
Reader
• Permette di accedere ai frame
– Polling
– Eventi
• Si possono avere più reader per una singola sorgente
• Un reader può essere messo in pausa
Sensor Source Reader
Frame
Ref
Frame
Dim infraredReader As InfraredFrameReader = Sensor.InfraredFrameSource.OpenReader()
AddHandler infraredReader.FrameArrived, AddressOf InfraredFrameArrivedHandler
'
'
'
infraredReader.Dispose()
ROME 11-12 april 2014
Frame reference
• Permette di accedere al frame corrente attraverso il metodo
AcquireFrame()
• Nell’intervallo di tempo in cui l’app richiama AcquireFrame()
il frame stesso potrebbe essere scaduto
• RelativeTime permette di mettere in correlazione frame
differenti
Sensor Source Reader
Frame
Ref
Frame
Using frame As ColorFrame = e.FrameReference.AcquireFrame()
If frame IsNot Nothing Then
'
'
'
End If
End Using
ROME 11-12 april 2014
Frame
• Permette l’accesso ai dati effettivi del frame
– Eseguire una copia locale dei dati
– Accedere al buffer raw direttamente
• Contiene i metadati del frame (ad esempio, per il
colore formato, altezza, larghezza)
• Va gestito rapidamente e rilasciato (se un frame non
viene rilasciato si potrebbe non ricevere più alcun
frame)
Sensor Source Reader
Frame
Ref
Frame
ROME 11-12 april 2014
Demo
ROME 11-12 april 2014
Funzionalità “di serie”
• Color source
• Depth source
• Infrared source
• Body Index source
• Body source (scheletro, hand tracking,
espressioni…)
• Audio source
ROME 11-12 april 2014
Infrared source
• 512 x 424 pixel @ 30 fps
• Due sorgenti:
– Infrared: singolo frame infrarosso
– LongExposureInfrared: sovrapposizione di 3 frame (miglior rapporto
segnale/rumore ma immagini meno precise e con effetto sfocato)
• Stesso sensore fisico della sorgente di profondità
• Ogni pixel è formato da 2 byte (16-bit)
e rappresenta l’intensità della riflessione
infrarossa.
• L’SDK recupera solo la riflessione della luce
infrarossa proiettata dal device
ROME 11-12 april 2014
Color source
• 1920 x 1080 pixel @ 30 fps (15 fps in scarsa luminosità)
• Formati multipli (RGBA, BGRA, YUY2, …), i frame arrivano
dal device in formato raw (in questo momento YUY2)
• I dati del frame possono:
– essere utilizzati nel formato raw
– convertiti in un altro formato (con un costo computativo
leggermente maggiore)
• Il buffer è un array di bytes. Il numero di byte
per pixel dipende dal formato raw dell’imagine
(in questo momento 4 byte per pixel).
ROME 11-12 april 2014
Depth source
• 512 x 424 pixel @ 30 fps
• Ogni pixel del frame è composto da 2 byte (16-bit) e contiene
la distanza, in mm, dal piano focale del device
• Non c’è riferimento all’indice del player presente nel punto
corrispondente
• Distanze di lavoro:
– DepthMinReliableDistance = 0,5 m
– DepthMaxReliableDistance = 4,5 m
ROME 11-12 april 2014
• 512 x 424 @ 30 fps
• Ogni pixel del frame è composto da 1 byte:
-1: nessun player in corrispondenza del punto
0 - 5: indice del player (tracciato con la sorgente
Body)
Body Index source
ROME 11-12 april 2014
Body source
• Ogni frame restituisce un array di oggetti di tipo Body
• Ogni body espone:
– 25 joint
– Hand tracking (mano aperta, chiusa, “lasso”)
– Activities (occhi chiusi, bocca aperta, ..)
– Appearance (ad esempio indossare occhiali)
– Espressioni del viso (neutral, sorridente)
– Orientamento delle ossa del corpo
– ….
• Le API del body source sono
ottimizzate per il consumo di memoria
ed il riciclo degli oggetti
ROME 11-12 april 2014
NUI
Body - Joint
• La classe Body :
– Joints: tracciamento e posizione nello
spazio del punto corrispondente;
– Orientation: orientamento nello spazio
dell’articolazione.
• Un joint può essere:
– Not Tracked
– Tracked
– Inferred
• Migliorata affidabilità e accuratezza
• Tracciati completamente fino a 6 player
ROME 11-12 april 2014
• La classe Body espone lo stato delle mani attraverso le
proprietà HandLeftState e HandRightState:
– Unknown
– Not Tracked
– Open
– Closed
– Lasso
• “Confidence” dello stato:
– High
– Low
• Il tracking delle mani è attualmente limitato a 2 player ma è
possibile decidere quali player tracciare. Il numero di player
tracciati verrà aumentato in futuro.
Body – Hand Tracking
ROME 11-12 april 2014
Body – Activity, Appearance, Expression
• Activity:
– EyeLeftClosed
– EyeRightClosed
– MouthOpen
– MouthMoved
– LookingAway
• Appearance
– WearingGlasses
• Expression:
– Happy
– Neutral
• Tre dictionary
– La chiave è l’ activity, l’appearance o l’expression da verificare (ad esempio EyeLeftClosed o
WearingGlasses);
– Il valore indica la probabilità che l’activity, l’appearance o l’expression sia in atto
(Unknown, MayBe, Yes, No)
• In futuro verranno aggiunte altre activity, appearance e expression.
ROME 11-12 april 2014
Demo
ROME 11-12 april 2014
Multi Frame
• MultiSourceFrameReader è, di fatto, un
reader che può agire su più sorgenti
contemporaneamente sincronizzando i frame;
• Viene generato un evento quando i frame
delle sorgenti collegati sono disponibili
MultiReader = Sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color Or
FrameSourceTypes.BodyIndex Or
FrameSourceTypes.Body)
ROME 11-12 april 2014
Multi Frame
• MultiSourceFrame contiene il riferimento ad ogni frame
delle sorgenti
• Il frame rate è il minore tra i frame rate delle sorgenti
selezionate
frame = frameReference.AcquireFrame()
If frame IsNot Nothing Then
Using colorFrame = frame.ColorFrameReference.AcquireFrame(),
bodyFrame = frame.BodyFrameReference.AcquireFrame(),
bodyIndexFrame = frame.BodyIndexFrameReference.AcquireFrame()
'
'
'
End Using
End If
ROME 11-12 april 2014
Demo
ROME 11-12 april 2014
Risorse
• Kinect for Windows Dev Center
http://www.microsoft.com/en-us/kinectforwindowsdev/default.aspx
• Kinect for Windows Web Site
http://www.microsoft.com/en-us/kinectforwindows/
• Kinect for Windows Blog
http://blogs.msdn.com/b/kinectforwindows/
• Kinect V2 on Microsoft Curah!
http://curah.microsoft.com/55200/kinect-v2-beta

More Related Content

Similar to Kinect v2: NUI for dummies - Bonanni

Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...Codemotion
 
Jug Roma - Wii Remote
Jug Roma - Wii RemoteJug Roma - Wii Remote
Jug Roma - Wii Remotedecabyte
 
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...ObserveIT
 
Creare un Information Radiator con Delphi
Creare un Information Radiator con DelphiCreare un Information Radiator con Delphi
Creare un Information Radiator con DelphiMarco Breveglieri
 
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDBPolyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDBSteve Maraspin
 
Software libero nei sistemi embedded
Software libero nei sistemi embeddedSoftware libero nei sistemi embedded
Software libero nei sistemi embeddedDaniele Costarella
 
Network_Forensics_Analysis_Tool.pptx
Network_Forensics_Analysis_Tool.pptxNetwork_Forensics_Analysis_Tool.pptx
Network_Forensics_Analysis_Tool.pptxManlioSantonastaso
 
2014 terraè - raspberry pi - risparmio energetico
2014 terraè - raspberry pi - risparmio energetico2014 terraè - raspberry pi - risparmio energetico
2014 terraè - raspberry pi - risparmio energeticoStefano Morandi
 
Pre-Production Design - Azara
Pre-Production Design - AzaraPre-Production Design - Azara
Pre-Production Design - AzaraCodemotion
 
CodingGym - Lezione 2 - Corso Linux, Android e Internet of Things
CodingGym - Lezione 2 - Corso Linux, Android e Internet of ThingsCodingGym - Lezione 2 - Corso Linux, Android e Internet of Things
CodingGym - Lezione 2 - Corso Linux, Android e Internet of ThingsMirko Mancin
 
DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...
DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...
DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...Deft Association
 
Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...
Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...
Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...Fulvio Corno
 
Writing apps for android with .net
Writing apps for android with .net Writing apps for android with .net
Writing apps for android with .net Leonardo Alario
 
Introduzione User Mode Linux
Introduzione User Mode LinuxIntroduzione User Mode Linux
Introduzione User Mode LinuxMajong DevJfu
 
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT LinuxDeftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT LinuxDeft Association
 
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT LinuxDeftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT LinuxSandro Rossetti
 
Matteo baccan raspberry pi - linox 2014
Matteo baccan   raspberry pi - linox 2014Matteo baccan   raspberry pi - linox 2014
Matteo baccan raspberry pi - linox 2014Matteo Baccan
 

Similar to Kinect v2: NUI for dummies - Bonanni (19)

Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
Internet of things: rendere facile il difficile attraverso l'utile - Guglielm...
 
Jug Roma - Wii Remote
Jug Roma - Wii RemoteJug Roma - Wii Remote
Jug Roma - Wii Remote
 
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
ObserveIt -Record and replay SSH, RDP & Citrix sessions-product datasheet- It...
 
Creare un Information Radiator con Delphi
Creare un Information Radiator con DelphiCreare un Information Radiator con Delphi
Creare un Information Radiator con Delphi
 
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDBPolyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
 
Software libero nei sistemi embedded
Software libero nei sistemi embeddedSoftware libero nei sistemi embedded
Software libero nei sistemi embedded
 
Linux console
Linux consoleLinux console
Linux console
 
Network_Forensics_Analysis_Tool.pptx
Network_Forensics_Analysis_Tool.pptxNetwork_Forensics_Analysis_Tool.pptx
Network_Forensics_Analysis_Tool.pptx
 
2014 terraè - raspberry pi - risparmio energetico
2014 terraè - raspberry pi - risparmio energetico2014 terraè - raspberry pi - risparmio energetico
2014 terraè - raspberry pi - risparmio energetico
 
Pre-Production Design - Azara
Pre-Production Design - AzaraPre-Production Design - Azara
Pre-Production Design - Azara
 
CodingGym - Lezione 2 - Corso Linux, Android e Internet of Things
CodingGym - Lezione 2 - Corso Linux, Android e Internet of ThingsCodingGym - Lezione 2 - Corso Linux, Android e Internet of Things
CodingGym - Lezione 2 - Corso Linux, Android e Internet of Things
 
DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...
DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...
DEFTCON 2014 – Luigi Ranzato - Windows Registry Artifacts: "Most Recently Use...
 
Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...
Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...
Condivisione di dischi - NFS - Reti miste Windows/Linux - SMB e NetBIOS - Sam...
 
Writing apps for android with .net
Writing apps for android with .net Writing apps for android with .net
Writing apps for android with .net
 
Fmdp Total System Monitor
Fmdp Total System MonitorFmdp Total System Monitor
Fmdp Total System Monitor
 
Introduzione User Mode Linux
Introduzione User Mode LinuxIntroduzione User Mode Linux
Introduzione User Mode Linux
 
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT LinuxDeftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
 
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT LinuxDeftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
Deftcon 2012 - Marco Giorgi - Acquisizione di memorie di massa con DEFT Linux
 
Matteo baccan raspberry pi - linox 2014
Matteo baccan   raspberry pi - linox 2014Matteo baccan   raspberry pi - linox 2014
Matteo baccan raspberry pi - linox 2014
 

More from Codemotion

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Codemotion
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyCodemotion
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaCodemotion
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserCodemotion
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Codemotion
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Codemotion
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Codemotion
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 - Codemotion
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Codemotion
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Codemotion
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Codemotion
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Codemotion
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Codemotion
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Codemotion
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...Codemotion
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Codemotion
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Codemotion
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Codemotion
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Codemotion
 

More from Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Kinect v2: NUI for dummies - Bonanni

  • 1. ROME 11-12 april 2014ROME 11-12 april 2014 Kinect V2: NUI for dummies!! massimo.bonanni@tiscali.it @massimobonanni http://codetailor.blogspot.com Massimo Bonanni
  • 2. ROME 11-12 april 2014 - Speaker’s name Agenda • Prerequisiti • Hardware • Architettura • Kinect Source
  • 3. ROME 11-12 april 2014 Prerequisiti • Sistemi Operativi Supportati – Windows 8, Windows 8.1 • Configurazione Hardware – Processore 64 bit (x64) i7 2.5Ghz (o superiore) – Memoria 4 GB (o più) – Built-in USB 3.0 host controller (chipset Intel o Renesas); – Scheda grafica DirectX11: ATI Radeon (HD 5400 series, HD 6570, HD 7800), NVidia Quadro (600, K1000M), NVidia GeForce (GT 640, GTX 660), Intel HD 4000 – Sensore Kinect v2 (con alimentatore e USB hub) • Software Requirements – Visual Studio 2012 (2013)
  • 4. ROME 11-12 april 2014 Kinect for Windows v2 sensor Hardware Kinect for Windows v2 USB hub Kinect for Windows v2 power supply
  • 5. ROME 11-12 april 2014 Hardware • Color camera con risoluzione 1920x1080 pixel, 30 fps • Infrared camera con risoluzione 512x424 pixel, 30 fps • Range di profondità da 0.5 a 4.5 m • Utilizzo di camera ad infrarossi e a colori contemporaneamente • No motore per “brandeggiamento” verticale
  • 6. ROME 11-12 april 2014 Kinect V1 vs Kinect V2 Feature Kinect for Windows 1 Kinect for Windows 2 Color Camera 640 x 480 @ 30 fps 1920 x 1080 @ 30 fps Depth Camera 320 x 240 512 x 424 Max Depth Distance ~4.5 M ~4.5 M Min Depth Distance 40 cm in near mode 50 cm Horizontal Field of View 57 degrees 70 degrees Vertical Field of View 43 degrees 60 degrees Tilt Motor yes no Skeleton Joints Defined 20 joints 25 joints Full Skeletons Tracked 2 6 USB Standard 2.0 3.0 Supported OS Win 7, Win 8 Win 8-8.1 (WSA) Price $299 TBD
  • 7. ROME 11-12 april 2014 Architettura Kinect Sensor Kinect Drivers Kinect Runtime Native API .NET API WinRT API Native Apps .NET Apps WSA Maggior parte delle elaborazioni anche sfruttando la GPU Applicazioni COM/C++ Applicazioni Desktop Windows Store Apps
  • 8. ROME 11-12 april 2014 Architettura • L’architettura prevede delle sorgenti (source) e dei reader • Ogni stream fornito dal device è una sorgente dalla quale possiamo ricavare uno o più reader • Ogni reader fornisce degli eventi per recuperare dei reference ai singoli frame provenienti dal device • Dal singolo frame si possono recuperare i dati relativi al tipo di sorgente (ad esempio lo scheletro del giocatore) Sensor Source Reader Frame Ref Frame
  • 9. ROME 11-12 april 2014 Architettura: V1 vs V2 Stream ReaderSource Una sola applicazione alla volta Più applicazioni contemporanee
  • 10. ROME 11-12 april 2014 Sensor • Utilizzo del sensore – Recuperare un’istanza di KinectSensor – Aprire il sensore – Usare il sensore – Chiudere il sensore • In caso di sconnessione del device – L’istanza di KinectSensor rimane valida – Non vengono inviati più frame – La proprietà IsAvailable ci dice se il sensore è attaccato o meno. • Possono essere gestiti più sensori Sensor = KinectSensor.Default Sensor.Open() ' ' ' Sensor.Close() Dim kinectList = KinectSensor.KinectSensors _ .Where(Function(k) k.IsAvailable = True) Sensor Source Reader Frame Ref Frame
  • 11. ROME 11-12 april 2014 Source • Espone i metadati della sorgente e permette di accedere al reader • Il sensore espone una sorgente per ogni tipo di funzionalità Sensor Source Reader Frame Ref Frame
  • 12. ROME 11-12 april 2014 Reader • Permette di accedere ai frame – Polling – Eventi • Si possono avere più reader per una singola sorgente • Un reader può essere messo in pausa Sensor Source Reader Frame Ref Frame Dim infraredReader As InfraredFrameReader = Sensor.InfraredFrameSource.OpenReader() AddHandler infraredReader.FrameArrived, AddressOf InfraredFrameArrivedHandler ' ' ' infraredReader.Dispose()
  • 13. ROME 11-12 april 2014 Frame reference • Permette di accedere al frame corrente attraverso il metodo AcquireFrame() • Nell’intervallo di tempo in cui l’app richiama AcquireFrame() il frame stesso potrebbe essere scaduto • RelativeTime permette di mettere in correlazione frame differenti Sensor Source Reader Frame Ref Frame Using frame As ColorFrame = e.FrameReference.AcquireFrame() If frame IsNot Nothing Then ' ' ' End If End Using
  • 14. ROME 11-12 april 2014 Frame • Permette l’accesso ai dati effettivi del frame – Eseguire una copia locale dei dati – Accedere al buffer raw direttamente • Contiene i metadati del frame (ad esempio, per il colore formato, altezza, larghezza) • Va gestito rapidamente e rilasciato (se un frame non viene rilasciato si potrebbe non ricevere più alcun frame) Sensor Source Reader Frame Ref Frame
  • 15. ROME 11-12 april 2014 Demo
  • 16. ROME 11-12 april 2014 Funzionalità “di serie” • Color source • Depth source • Infrared source • Body Index source • Body source (scheletro, hand tracking, espressioni…) • Audio source
  • 17. ROME 11-12 april 2014 Infrared source • 512 x 424 pixel @ 30 fps • Due sorgenti: – Infrared: singolo frame infrarosso – LongExposureInfrared: sovrapposizione di 3 frame (miglior rapporto segnale/rumore ma immagini meno precise e con effetto sfocato) • Stesso sensore fisico della sorgente di profondità • Ogni pixel è formato da 2 byte (16-bit) e rappresenta l’intensità della riflessione infrarossa. • L’SDK recupera solo la riflessione della luce infrarossa proiettata dal device
  • 18. ROME 11-12 april 2014 Color source • 1920 x 1080 pixel @ 30 fps (15 fps in scarsa luminosità) • Formati multipli (RGBA, BGRA, YUY2, …), i frame arrivano dal device in formato raw (in questo momento YUY2) • I dati del frame possono: – essere utilizzati nel formato raw – convertiti in un altro formato (con un costo computativo leggermente maggiore) • Il buffer è un array di bytes. Il numero di byte per pixel dipende dal formato raw dell’imagine (in questo momento 4 byte per pixel).
  • 19. ROME 11-12 april 2014 Depth source • 512 x 424 pixel @ 30 fps • Ogni pixel del frame è composto da 2 byte (16-bit) e contiene la distanza, in mm, dal piano focale del device • Non c’è riferimento all’indice del player presente nel punto corrispondente • Distanze di lavoro: – DepthMinReliableDistance = 0,5 m – DepthMaxReliableDistance = 4,5 m
  • 20. ROME 11-12 april 2014 • 512 x 424 @ 30 fps • Ogni pixel del frame è composto da 1 byte: -1: nessun player in corrispondenza del punto 0 - 5: indice del player (tracciato con la sorgente Body) Body Index source
  • 21. ROME 11-12 april 2014 Body source • Ogni frame restituisce un array di oggetti di tipo Body • Ogni body espone: – 25 joint – Hand tracking (mano aperta, chiusa, “lasso”) – Activities (occhi chiusi, bocca aperta, ..) – Appearance (ad esempio indossare occhiali) – Espressioni del viso (neutral, sorridente) – Orientamento delle ossa del corpo – …. • Le API del body source sono ottimizzate per il consumo di memoria ed il riciclo degli oggetti
  • 22. ROME 11-12 april 2014 NUI Body - Joint • La classe Body : – Joints: tracciamento e posizione nello spazio del punto corrispondente; – Orientation: orientamento nello spazio dell’articolazione. • Un joint può essere: – Not Tracked – Tracked – Inferred • Migliorata affidabilità e accuratezza • Tracciati completamente fino a 6 player
  • 23. ROME 11-12 april 2014 • La classe Body espone lo stato delle mani attraverso le proprietà HandLeftState e HandRightState: – Unknown – Not Tracked – Open – Closed – Lasso • “Confidence” dello stato: – High – Low • Il tracking delle mani è attualmente limitato a 2 player ma è possibile decidere quali player tracciare. Il numero di player tracciati verrà aumentato in futuro. Body – Hand Tracking
  • 24. ROME 11-12 april 2014 Body – Activity, Appearance, Expression • Activity: – EyeLeftClosed – EyeRightClosed – MouthOpen – MouthMoved – LookingAway • Appearance – WearingGlasses • Expression: – Happy – Neutral • Tre dictionary – La chiave è l’ activity, l’appearance o l’expression da verificare (ad esempio EyeLeftClosed o WearingGlasses); – Il valore indica la probabilità che l’activity, l’appearance o l’expression sia in atto (Unknown, MayBe, Yes, No) • In futuro verranno aggiunte altre activity, appearance e expression.
  • 25. ROME 11-12 april 2014 Demo
  • 26. ROME 11-12 april 2014 Multi Frame • MultiSourceFrameReader è, di fatto, un reader che può agire su più sorgenti contemporaneamente sincronizzando i frame; • Viene generato un evento quando i frame delle sorgenti collegati sono disponibili MultiReader = Sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color Or FrameSourceTypes.BodyIndex Or FrameSourceTypes.Body)
  • 27. ROME 11-12 april 2014 Multi Frame • MultiSourceFrame contiene il riferimento ad ogni frame delle sorgenti • Il frame rate è il minore tra i frame rate delle sorgenti selezionate frame = frameReference.AcquireFrame() If frame IsNot Nothing Then Using colorFrame = frame.ColorFrameReference.AcquireFrame(), bodyFrame = frame.BodyFrameReference.AcquireFrame(), bodyIndexFrame = frame.BodyIndexFrameReference.AcquireFrame() ' ' ' End Using End If
  • 28. ROME 11-12 april 2014 Demo
  • 29. ROME 11-12 april 2014 Risorse • Kinect for Windows Dev Center http://www.microsoft.com/en-us/kinectforwindowsdev/default.aspx • Kinect for Windows Web Site http://www.microsoft.com/en-us/kinectforwindows/ • Kinect for Windows Blog http://blogs.msdn.com/b/kinectforwindows/ • Kinect V2 on Microsoft Curah! http://curah.microsoft.com/55200/kinect-v2-beta