SlideShare uma empresa Scribd logo
1 de 30
WIN07 - Applicazioni Windows
Store con Kinect
Massimo Bonanni
massimo.bonanni@tiscali.it
@massimobonanni
http://codetailor.blogspot.com/
#CDays15 – Milano 24, 25 e 26 Marzo 2015
Grazie a
Platinum
Sponsor
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Agenda
• Kinect Recap
• Architettura
• Sources & Reader
• Kinect sensor in Windows Store
• Face Detection
• Gesture Recognition
• XAML - Window Store App
#CDays14 – Milano 25, 26 e 27 Febbraio 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)
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Funzionalità
• 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
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
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
Architettura – Building Block
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Architettura – Sorgenti & Reader
• 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
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Sensor
• Utilizzo del sensore
1. Recuperare un’istanza di KinectSensor
2. Aprire il sensore
3. Usare il sensore
4. 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.
Sensor = KinectSensor.GetDefault()
Sensor.Open()
'
'
'
Sensor.Close()
Sensor Source Reader
Frame
Ref
Frame
Sensor = KinectSensor.GetDefault();
Sensor.Open();
//
//
//
Sensor.Close();
#CDays14 – Milano 25, 26 e 27 Febbraio 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
#CDays14 – Milano 25, 26 e 27 Febbraio 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
InfraredFrameReader infraredReader = Sensor.InfraredFrameSource.OpenReader();
infraredReader.FrameArrived += InfraredFrameArrivedHandler;
//
//
infraredReader.Dispose();
Dim infraredReader As InfraredFrameReader = Sensor.InfraredFrameSource.OpenReader()
AddHandler infraredReader.FrameArrived, AddressOf InfraredFrameArrivedHandler
'
'
infraredReader.Dispose()
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Frame Reference
• Permette di accedere al frame corrente attraverso il metodo
AcquireFrame()
• Nell’intervallo di tempo in cui l’applicazione richiama AcquireFrame()
il frame stesso potrebbe essere scaduto
• RelativeTime permette di mettere in correlazione frame differenti
Sensor Source Reader
Frame
Ref
Frame
using (ColorFrame frame = e.FrameReference.AcquireFrame()) {
if (frame != null) {
//
//
//
}
}
Using frame As ColorFrame = e.FrameReference.AcquireFrame()
If frame IsNot Nothing Then
'
'
'
End If
End Using
#CDays14 – Milano 25, 26 e 27 Febbraio 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
#CDays14 – Milano 25, 26 e 27 Febbraio 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
Sensor Source Reader
Frame
Ref
Frame
MultiSourceFrameReader MultiReader = Sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color |
FrameSourceTypes.BodyIndex | FrameSourceTypes.Body);
MultiReader = Sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color Or
FrameSourceTypes.BodyIndex Or
FrameSourceTypes.Body)
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Multi Frame
• MultiSourceFrame contiene il riferimento ad ogni frame delle sorgenti
• Il frame rate è il minore tra i frame rate delle sorgenti selezionate
Sensor Source Reader
Frame
Ref
Frame
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
var frame = args.FrameReference.AcquireFrame();
if (frame != null) {
using (colorFrame = frame.ColorFrameReference.AcquireFrame())
using (bodyFrame = frame.BodyFrameReference.AcquireFrame())
using (bodyIndexFrame = frame.BodyIndexFrameReference.AcquireFrame())
{
//
//
//
}
}
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
MultiFrameSource
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Sorgenti “indirette”
Le sorgenti indirette non sono esposte dalla classe KinectSensor e forniscono
funzionalità accessorie:
• FaceFrameSource
• HighDefinitionFaceFrameSource
• VisualGestureBuilderFrameSource
Le sorgenti indirette accettano un’istanza di KinectSensor per poter ricevere i dati
dal sensore e un BodyTrackingId per poter agire sullo specifico player (vengono
utilizzate in cooperazione con BodyFrameSource).
E’ un modo per poter estendere le funzionalità dell’SDK.
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
Face Detection
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Kinect Studio
• Permette di registrare gli stream provenienti dalle sorgenti del Kinect;
• Permette di riprodurre (anche in loop) registrazioni eseguite in precedenza;
• Può essere utilizzato per testare le nostre app in mancanza del sensore
fisico;
• Sono disponibili delle API per poter gestire registrazione e riproduzione
(deve essere installato l’SDK).
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Gesture recognition
Due possibili modalità:
• Euristica : dobbiamo implementare algoritmicamente il riconoscimento della
gesture;
• Machine Learning : insegnamo al Kinect la gesture che dobbiamo
riconoscere.
Nel primo caso ci si arma di pazienza, nel secondo del Gesture Builder.
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
Gesture Recognition - Euristica
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Gesture Builder
• Nuovo strumento rilasciato con l’SDK del Kinect V2
• Permette di costruire le gesture utilizzando il machine learning
• Adaptive Boosting (AdaBoost): determina se il player sta eseguendo una gesture;
• Random Forest Regression (RFR) Progress: determina l’avanzamento di una gesture eseguita da un
player;
• Permette di dare un senso alle gesture utilizzando dei tag
• Organizza le gesture in solution e progetti
• Esegue l’analisi e il test per il gesture detection
• Live preview dei risultati
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Gesture Builder
Your Application
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Gesture Recognition
Euristica
• E’ un problema di coding
• Facile se le gesture/posture
sono semplici
• Possibili complicazioni
nell’evoluzione (regression)
Machine Learning (ML) con G.B.
• E’ un problema di dati
• La gesture potrebbe non essere
semplice da riprodurre a livello
di algoritmo (lo swing di una
mazza da baseball)
• Deve essere speso tempo per il
machine learning
• Attenzione ai troppi dati perche’
possono generare falsi positivi
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
Gesture Recognition – Gesture Builder
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
XAML Controls
• Referenziare Microsoft.Kinect.Xaml.Controls e
Microsoft.Kinect.Toolkit.Input;
• E’ necessario l’assembly la Microsoft Visual C++ 2013 Runtime Package
for Windows
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
XAML Controls - KinectRegion
• Il controllo KinectRegion delimita una “porzione” di XAML all’interno
della quale l’utente può utilizzare il Kinect;
• Gesture disponibili “out-of-the-box” in una KinectRegion:
• Click
• Grab
• Pan
• Zoom
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
XAML Controls - KinectUserViewer
KinectUserViewer permette di dare un dare un feedback visivo
all’utente del fatto che si tracciato o meno.
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
demo
Windows Store App
#CDays14 – Milano 25, 26 e 27 Febbraio 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
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Q&A
Tutto il materiale di questa sessione su
http://www.communitydays.it/
Lascia subito il feedback su questa sessione,
potrai essere estratto per i nostri premi!
Seguici su
Twitter @CommunityDaysIT
Facebook http://facebook.com/cdaysit
#CDays15

Mais conteúdo relacionado

Destaque

Initializr - come iniziare
Initializr - come iniziareInitializr - come iniziare
Initializr - come iniziareSalvatore Paone
 
Sviluppare per Microsoft Band
Sviluppare per Microsoft BandSviluppare per Microsoft Band
Sviluppare per Microsoft BandMassimo Bonanni
 
Windows App Studio: da zero allo store in 60 minuti!
Windows App Studio: da zero allo store in 60 minuti!Windows App Studio: da zero allo store in 60 minuti!
Windows App Studio: da zero allo store in 60 minuti!Massimo Bonanni
 
Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!
Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!
Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!Massimo Bonanni
 
HTMLslide html
HTMLslide htmlHTMLslide html
HTMLslide htmlritalerede
 
HTML5 e Css3 - 1 | WebMaster & WebDesigner
HTML5 e Css3 - 1 | WebMaster & WebDesignerHTML5 e Css3 - 1 | WebMaster & WebDesigner
HTML5 e Css3 - 1 | WebMaster & WebDesignerMatteo Magni
 
HTML5 e Css3 - 3 | WebMaster & WebDesigner
HTML5 e Css3 - 3 | WebMaster & WebDesignerHTML5 e Css3 - 3 | WebMaster & WebDesigner
HTML5 e Css3 - 3 | WebMaster & WebDesignerMatteo Magni
 
Introduzione allo sviluppo UWP per xBox
Introduzione allo sviluppo UWP per xBoxIntroduzione allo sviluppo UWP per xBox
Introduzione allo sviluppo UWP per xBoxMassimo Bonanni
 
Introduzione ai Sistemi Operativi
Introduzione ai Sistemi OperativiIntroduzione ai Sistemi Operativi
Introduzione ai Sistemi OperativiorestJump
 
Guida introduttiva al css
Guida introduttiva al cssGuida introduttiva al css
Guida introduttiva al cssEnrico Mainero
 
Struttura di una pagina html
Struttura di una pagina htmlStruttura di una pagina html
Struttura di una pagina htmlEnrico Mainero
 
Tecnologie informatiche
Tecnologie informaticheTecnologie informatiche
Tecnologie informaticheorestJump
 
Html5 appunti.0
Html5   appunti.0Html5   appunti.0
Html5 appunti.0orestJump
 
HTML5 e Css3 - 4 | WebMaster & WebDesigner
HTML5 e Css3 - 4 | WebMaster & WebDesignerHTML5 e Css3 - 4 | WebMaster & WebDesigner
HTML5 e Css3 - 4 | WebMaster & WebDesignerMatteo Magni
 
Html5 e css3 nuovi strumenti per un nuovo web
Html5 e css3 nuovi strumenti per un nuovo webHtml5 e css3 nuovi strumenti per un nuovo web
Html5 e css3 nuovi strumenti per un nuovo webMassimo Bonanni
 
HTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco Casario
HTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco CasarioHTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco Casario
HTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco CasarioCodemotion
 

Destaque (20)

Initializr - come iniziare
Initializr - come iniziareInitializr - come iniziare
Initializr - come iniziare
 
Sviluppare per Microsoft Band
Sviluppare per Microsoft BandSviluppare per Microsoft Band
Sviluppare per Microsoft Band
 
Windows App Studio: da zero allo store in 60 minuti!
Windows App Studio: da zero allo store in 60 minuti!Windows App Studio: da zero allo store in 60 minuti!
Windows App Studio: da zero allo store in 60 minuti!
 
Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!
Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!
Windows Hello e Intel(r) RealSense(tm): attenti a questi due!!
 
HTMLslide html
HTMLslide htmlHTMLslide html
HTMLslide html
 
Corso di HTML5 e CSS
Corso di HTML5 e CSSCorso di HTML5 e CSS
Corso di HTML5 e CSS
 
Html5
Html5Html5
Html5
 
HTML5 e Css3 - 1 | WebMaster & WebDesigner
HTML5 e Css3 - 1 | WebMaster & WebDesignerHTML5 e Css3 - 1 | WebMaster & WebDesigner
HTML5 e Css3 - 1 | WebMaster & WebDesigner
 
HTML5 e Css3 - 3 | WebMaster & WebDesigner
HTML5 e Css3 - 3 | WebMaster & WebDesignerHTML5 e Css3 - 3 | WebMaster & WebDesigner
HTML5 e Css3 - 3 | WebMaster & WebDesigner
 
Introduzione allo sviluppo UWP per xBox
Introduzione allo sviluppo UWP per xBoxIntroduzione allo sviluppo UWP per xBox
Introduzione allo sviluppo UWP per xBox
 
HTML - Primi Passi
HTML - Primi PassiHTML - Primi Passi
HTML - Primi Passi
 
Php mysql3
Php mysql3Php mysql3
Php mysql3
 
Introduzione ai Sistemi Operativi
Introduzione ai Sistemi OperativiIntroduzione ai Sistemi Operativi
Introduzione ai Sistemi Operativi
 
Guida introduttiva al css
Guida introduttiva al cssGuida introduttiva al css
Guida introduttiva al css
 
Struttura di una pagina html
Struttura di una pagina htmlStruttura di una pagina html
Struttura di una pagina html
 
Tecnologie informatiche
Tecnologie informaticheTecnologie informatiche
Tecnologie informatiche
 
Html5 appunti.0
Html5   appunti.0Html5   appunti.0
Html5 appunti.0
 
HTML5 e Css3 - 4 | WebMaster & WebDesigner
HTML5 e Css3 - 4 | WebMaster & WebDesignerHTML5 e Css3 - 4 | WebMaster & WebDesigner
HTML5 e Css3 - 4 | WebMaster & WebDesigner
 
Html5 e css3 nuovi strumenti per un nuovo web
Html5 e css3 nuovi strumenti per un nuovo webHtml5 e css3 nuovi strumenti per un nuovo web
Html5 e css3 nuovi strumenti per un nuovo web
 
HTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco Casario
HTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco CasarioHTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco Casario
HTML5, CSS3 e JavaScript: Web app per tutti gli schermi by Marco Casario
 

Semelhante a Applicazioni Windows Store con Kinect 2

KInect Lab @ Community Days 2014 - Roma
KInect Lab @ Community Days 2014 - RomaKInect Lab @ Community Days 2014 - Roma
KInect Lab @ Community Days 2014 - RomaMassimo Bonanni
 
Kinect v2: NUI for dummies - Bonanni
Kinect v2: NUI for dummies - BonanniKinect v2: NUI for dummies - Bonanni
Kinect v2: NUI for dummies - BonanniCodemotion
 
Kinect V2: NUI for dummies!!
Kinect V2: NUI for dummies!!Kinect V2: NUI for dummies!!
Kinect V2: NUI for dummies!!Massimo Bonanni
 
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...DotNetCampus
 
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo nataleSanta Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo nataleAlessio Iafrate
 
Kinect and brave new applications
Kinect and brave new applicationsKinect and brave new applications
Kinect and brave new applicationsIgor Antonacci
 
Present kinect4 windows
Present kinect4 windowsPresent kinect4 windows
Present kinect4 windowsI3P
 
IoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge deviceIoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge deviceAlessio Biasiutti
 
Custom vision on edge device
Custom vision on edge deviceCustom vision on edge device
Custom vision on edge deviceAlessio Biasiutti
 
Studio ed implementazione di schemi di crittografia visuale progressiva
Studio ed implementazione di schemi di crittografia visuale progressivaStudio ed implementazione di schemi di crittografia visuale progressiva
Studio ed implementazione di schemi di crittografia visuale progressivaAndrea Fiano
 
Tesi - L'autenticazione nel cloud computing
Tesi - L'autenticazione nel cloud computingTesi - L'autenticazione nel cloud computing
Tesi - L'autenticazione nel cloud computingfrancesco pesare
 
DotNetCampus 2014 - Introduzione a Kinect
DotNetCampus 2014 - Introduzione a KinectDotNetCampus 2014 - Introduzione a Kinect
DotNetCampus 2014 - Introduzione a KinectMassimo Bonanni
 
SkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimentoSkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimentoMavigex srl
 
Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...
Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...
Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...Dominopoint - Italian Lotus User Group
 

Semelhante a Applicazioni Windows Store con Kinect 2 (20)

KInect Lab @ Community Days 2014 - Roma
KInect Lab @ Community Days 2014 - RomaKInect Lab @ Community Days 2014 - Roma
KInect Lab @ Community Days 2014 - Roma
 
Kinect v2: NUI for dummies - Bonanni
Kinect v2: NUI for dummies - BonanniKinect v2: NUI for dummies - Bonanni
Kinect v2: NUI for dummies - Bonanni
 
Kinect V2: NUI for dummies!!
Kinect V2: NUI for dummies!!Kinect V2: NUI for dummies!!
Kinect V2: NUI for dummies!!
 
Xamarin Robotics
Xamarin RoboticsXamarin Robotics
Xamarin Robotics
 
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
 
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo nataleSanta Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
 
Kinect and brave new applications
Kinect and brave new applicationsKinect and brave new applications
Kinect and brave new applications
 
Present kinect4 windows
Present kinect4 windowsPresent kinect4 windows
Present kinect4 windows
 
IoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge deviceIoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge device
 
Custom vision on edge device
Custom vision on edge deviceCustom vision on edge device
Custom vision on edge device
 
Mobile e Smart Client
Mobile e Smart ClientMobile e Smart Client
Mobile e Smart Client
 
Aperitech winml
Aperitech winmlAperitech winml
Aperitech winml
 
Game matching with SignalR
Game matching with SignalRGame matching with SignalR
Game matching with SignalR
 
Game matching with SignalR
Game matching with SignalRGame matching with SignalR
Game matching with SignalR
 
Kinect : Just for fun?
Kinect : Just for fun?Kinect : Just for fun?
Kinect : Just for fun?
 
Studio ed implementazione di schemi di crittografia visuale progressiva
Studio ed implementazione di schemi di crittografia visuale progressivaStudio ed implementazione di schemi di crittografia visuale progressiva
Studio ed implementazione di schemi di crittografia visuale progressiva
 
Tesi - L'autenticazione nel cloud computing
Tesi - L'autenticazione nel cloud computingTesi - L'autenticazione nel cloud computing
Tesi - L'autenticazione nel cloud computing
 
DotNetCampus 2014 - Introduzione a Kinect
DotNetCampus 2014 - Introduzione a KinectDotNetCampus 2014 - Introduzione a Kinect
DotNetCampus 2014 - Introduzione a Kinect
 
SkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimentoSkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimento
 
Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...
Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...
Dati, dati, dati! - Sfruttare le potenzialità delle XPages con Google Chart T...
 

Mais de Massimo Bonanni

Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!Massimo Bonanni
 
Durable Functions vs Logic App : la guerra dei workflow!!
Durable Functions vs Logic App : la guerra dei workflow!!Durable Functions vs Logic App : la guerra dei workflow!!
Durable Functions vs Logic App : la guerra dei workflow!!Massimo Bonanni
 
Stateful pattern con Azure Functions
Stateful pattern con Azure FunctionsStateful pattern con Azure Functions
Stateful pattern con Azure FunctionsMassimo Bonanni
 
Architetture Serverless con SQL Server e Azure Functions
Architetture Serverless con SQL Server e Azure FunctionsArchitetture Serverless con SQL Server e Azure Functions
Architetture Serverless con SQL Server e Azure FunctionsMassimo Bonanni
 
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...Massimo Bonanni
 
Stateful patterns in Azure Functions
Stateful patterns in Azure FunctionsStateful patterns in Azure Functions
Stateful patterns in Azure FunctionsMassimo Bonanni
 
The art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoringThe art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoringMassimo Bonanni
 
Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!Massimo Bonanni
 
The art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoringThe art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoringMassimo Bonanni
 
Everything you always wanted to know about API Management (but were afraid to...
Everything you always wanted to know about API Management (but were afraid to...Everything you always wanted to know about API Management (but were afraid to...
Everything you always wanted to know about API Management (but were afraid to...Massimo Bonanni
 
Workflow as code with Azure Durable Functions
Workflow as code with Azure Durable FunctionsWorkflow as code with Azure Durable Functions
Workflow as code with Azure Durable FunctionsMassimo Bonanni
 
Xmas Serverless Transformation: when the elf doesn’t scale!
Xmas Serverless Transformation: when the elf doesn’t scale!Xmas Serverless Transformation: when the elf doesn’t scale!
Xmas Serverless Transformation: when the elf doesn’t scale!Massimo Bonanni
 
Welcome Azure Functions 2. 0
Welcome Azure Functions 2. 0Welcome Azure Functions 2. 0
Welcome Azure Functions 2. 0Massimo Bonanni
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelMassimo Bonanni
 
Testing a Service Fabric solution and live happy!!
Testing a Service Fabric solution and live happy!!Testing a Service Fabric solution and live happy!!
Testing a Service Fabric solution and live happy!!Massimo Bonanni
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelMassimo Bonanni
 
Soluzioni IoT con le tecnologie Microsoft
Soluzioni IoT con le tecnologie MicrosoftSoluzioni IoT con le tecnologie Microsoft
Soluzioni IoT con le tecnologie MicrosoftMassimo Bonanni
 
Project Gesture & Real Sense: il potere nelle mani!!
Project Gesture & Real Sense: il potere nelle mani!!Project Gesture & Real Sense: il potere nelle mani!!
Project Gesture & Real Sense: il potere nelle mani!!Massimo Bonanni
 

Mais de Massimo Bonanni (20)

Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!
 
Durable Functions vs Logic App : la guerra dei workflow!!
Durable Functions vs Logic App : la guerra dei workflow!!Durable Functions vs Logic App : la guerra dei workflow!!
Durable Functions vs Logic App : la guerra dei workflow!!
 
Stateful pattern con Azure Functions
Stateful pattern con Azure FunctionsStateful pattern con Azure Functions
Stateful pattern con Azure Functions
 
Architetture Serverless con SQL Server e Azure Functions
Architetture Serverless con SQL Server e Azure FunctionsArchitetture Serverless con SQL Server e Azure Functions
Architetture Serverless con SQL Server e Azure Functions
 
IoT in salsa serverless
IoT in salsa serverlessIoT in salsa serverless
IoT in salsa serverless
 
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
 
Stateful patterns in Azure Functions
Stateful patterns in Azure FunctionsStateful patterns in Azure Functions
Stateful patterns in Azure Functions
 
IoT in salsa Serverless
IoT in salsa ServerlessIoT in salsa Serverless
IoT in salsa Serverless
 
The art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoringThe art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoring
 
Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!Empower every Azure Function to achieve more!!
Empower every Azure Function to achieve more!!
 
The art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoringThe art of Azure Functions (unit) testing and monitoring
The art of Azure Functions (unit) testing and monitoring
 
Everything you always wanted to know about API Management (but were afraid to...
Everything you always wanted to know about API Management (but were afraid to...Everything you always wanted to know about API Management (but were afraid to...
Everything you always wanted to know about API Management (but were afraid to...
 
Workflow as code with Azure Durable Functions
Workflow as code with Azure Durable FunctionsWorkflow as code with Azure Durable Functions
Workflow as code with Azure Durable Functions
 
Xmas Serverless Transformation: when the elf doesn’t scale!
Xmas Serverless Transformation: when the elf doesn’t scale!Xmas Serverless Transformation: when the elf doesn’t scale!
Xmas Serverless Transformation: when the elf doesn’t scale!
 
Welcome Azure Functions 2. 0
Welcome Azure Functions 2. 0Welcome Azure Functions 2. 0
Welcome Azure Functions 2. 0
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor model
 
Testing a Service Fabric solution and live happy!!
Testing a Service Fabric solution and live happy!!Testing a Service Fabric solution and live happy!!
Testing a Service Fabric solution and live happy!!
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor model
 
Soluzioni IoT con le tecnologie Microsoft
Soluzioni IoT con le tecnologie MicrosoftSoluzioni IoT con le tecnologie Microsoft
Soluzioni IoT con le tecnologie Microsoft
 
Project Gesture & Real Sense: il potere nelle mani!!
Project Gesture & Real Sense: il potere nelle mani!!Project Gesture & Real Sense: il potere nelle mani!!
Project Gesture & Real Sense: il potere nelle mani!!
 

Applicazioni Windows Store con Kinect 2

  • 1. WIN07 - Applicazioni Windows Store con Kinect Massimo Bonanni massimo.bonanni@tiscali.it @massimobonanni http://codetailor.blogspot.com/
  • 2. #CDays15 – Milano 24, 25 e 26 Marzo 2015 Grazie a Platinum Sponsor
  • 3. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Agenda • Kinect Recap • Architettura • Sources & Reader • Kinect sensor in Windows Store • Face Detection • Gesture Recognition • XAML - Window Store App
  • 4. #CDays14 – Milano 25, 26 e 27 Febbraio 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)
  • 5. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Funzionalità • 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. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 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 Architettura – Building Block
  • 7. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Architettura – Sorgenti & Reader • 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
  • 8. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Sensor • Utilizzo del sensore 1. Recuperare un’istanza di KinectSensor 2. Aprire il sensore 3. Usare il sensore 4. 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. Sensor = KinectSensor.GetDefault() Sensor.Open() ' ' ' Sensor.Close() Sensor Source Reader Frame Ref Frame Sensor = KinectSensor.GetDefault(); Sensor.Open(); // // // Sensor.Close();
  • 9. #CDays14 – Milano 25, 26 e 27 Febbraio 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
  • 10. #CDays14 – Milano 25, 26 e 27 Febbraio 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 InfraredFrameReader infraredReader = Sensor.InfraredFrameSource.OpenReader(); infraredReader.FrameArrived += InfraredFrameArrivedHandler; // // infraredReader.Dispose(); Dim infraredReader As InfraredFrameReader = Sensor.InfraredFrameSource.OpenReader() AddHandler infraredReader.FrameArrived, AddressOf InfraredFrameArrivedHandler ' ' infraredReader.Dispose()
  • 11. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Frame Reference • Permette di accedere al frame corrente attraverso il metodo AcquireFrame() • Nell’intervallo di tempo in cui l’applicazione richiama AcquireFrame() il frame stesso potrebbe essere scaduto • RelativeTime permette di mettere in correlazione frame differenti Sensor Source Reader Frame Ref Frame using (ColorFrame frame = e.FrameReference.AcquireFrame()) { if (frame != null) { // // // } } Using frame As ColorFrame = e.FrameReference.AcquireFrame() If frame IsNot Nothing Then ' ' ' End If End Using
  • 12. #CDays14 – Milano 25, 26 e 27 Febbraio 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
  • 13. #CDays14 – Milano 25, 26 e 27 Febbraio 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 Sensor Source Reader Frame Ref Frame MultiSourceFrameReader MultiReader = Sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.BodyIndex | FrameSourceTypes.Body); MultiReader = Sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color Or FrameSourceTypes.BodyIndex Or FrameSourceTypes.Body)
  • 14. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Multi Frame • MultiSourceFrame contiene il riferimento ad ogni frame delle sorgenti • Il frame rate è il minore tra i frame rate delle sorgenti selezionate Sensor Source Reader Frame Ref Frame 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 var frame = args.FrameReference.AcquireFrame(); if (frame != null) { using (colorFrame = frame.ColorFrameReference.AcquireFrame()) using (bodyFrame = frame.BodyFrameReference.AcquireFrame()) using (bodyIndexFrame = frame.BodyIndexFrameReference.AcquireFrame()) { // // // } }
  • 15. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 demo MultiFrameSource
  • 16. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Sorgenti “indirette” Le sorgenti indirette non sono esposte dalla classe KinectSensor e forniscono funzionalità accessorie: • FaceFrameSource • HighDefinitionFaceFrameSource • VisualGestureBuilderFrameSource Le sorgenti indirette accettano un’istanza di KinectSensor per poter ricevere i dati dal sensore e un BodyTrackingId per poter agire sullo specifico player (vengono utilizzate in cooperazione con BodyFrameSource). E’ un modo per poter estendere le funzionalità dell’SDK.
  • 17. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 demo Face Detection
  • 18. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Kinect Studio • Permette di registrare gli stream provenienti dalle sorgenti del Kinect; • Permette di riprodurre (anche in loop) registrazioni eseguite in precedenza; • Può essere utilizzato per testare le nostre app in mancanza del sensore fisico; • Sono disponibili delle API per poter gestire registrazione e riproduzione (deve essere installato l’SDK).
  • 19. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Gesture recognition Due possibili modalità: • Euristica : dobbiamo implementare algoritmicamente il riconoscimento della gesture; • Machine Learning : insegnamo al Kinect la gesture che dobbiamo riconoscere. Nel primo caso ci si arma di pazienza, nel secondo del Gesture Builder.
  • 20. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 demo Gesture Recognition - Euristica
  • 21. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Gesture Builder • Nuovo strumento rilasciato con l’SDK del Kinect V2 • Permette di costruire le gesture utilizzando il machine learning • Adaptive Boosting (AdaBoost): determina se il player sta eseguendo una gesture; • Random Forest Regression (RFR) Progress: determina l’avanzamento di una gesture eseguita da un player; • Permette di dare un senso alle gesture utilizzando dei tag • Organizza le gesture in solution e progetti • Esegue l’analisi e il test per il gesture detection • Live preview dei risultati
  • 22. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Gesture Builder Your Application
  • 23. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Gesture Recognition Euristica • E’ un problema di coding • Facile se le gesture/posture sono semplici • Possibili complicazioni nell’evoluzione (regression) Machine Learning (ML) con G.B. • E’ un problema di dati • La gesture potrebbe non essere semplice da riprodurre a livello di algoritmo (lo swing di una mazza da baseball) • Deve essere speso tempo per il machine learning • Attenzione ai troppi dati perche’ possono generare falsi positivi
  • 24. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 demo Gesture Recognition – Gesture Builder
  • 25. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 XAML Controls • Referenziare Microsoft.Kinect.Xaml.Controls e Microsoft.Kinect.Toolkit.Input; • E’ necessario l’assembly la Microsoft Visual C++ 2013 Runtime Package for Windows
  • 26. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 XAML Controls - KinectRegion • Il controllo KinectRegion delimita una “porzione” di XAML all’interno della quale l’utente può utilizzare il Kinect; • Gesture disponibili “out-of-the-box” in una KinectRegion: • Click • Grab • Pan • Zoom
  • 27. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 XAML Controls - KinectUserViewer KinectUserViewer permette di dare un dare un feedback visivo all’utente del fatto che si tracciato o meno.
  • 28. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 demo Windows Store App
  • 29. #CDays14 – Milano 25, 26 e 27 Febbraio 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
  • 30. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Q&A Tutto il materiale di questa sessione su http://www.communitydays.it/ Lascia subito il feedback su questa sessione, potrai essere estratto per i nostri premi! Seguici su Twitter @CommunityDaysIT Facebook http://facebook.com/cdaysit #CDays15

Notas do Editor

  1. Slide da mostrare prima di iniziare la sessione – non rimuovere!
  2. Ultima slide, obbligatoria