SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Ing. Matteo Valoriani
               matteo.valoriani@studentpartner.com




KINECT Programming
The ColorImageStream object model




            KINECT Programming
CAMERA DATA
• Events return ImageFrame
  •   PixelDataLength
  •   FrameNumber
  •   Timestamp
  •   Dimensions: Height, Width


• Use AllFramesReady event to synchronize


                      KINECT Programming
ColorImageFormat
ColorImageFormat                 What it means
Undefined                        The image resolution is indeterminate.
RgbResolution640x480Fps30        The image resolution is 640x480, pixel data is
                                 RGB32 format at 30 frames per second.
RgbResolution1280x960Fps12       The image resolution is 1280x960, pixel data is
                                 RGB32 format at 12 frames per second.
YuvResolution640x480Fps15        The image resolution is 640x480, pixel data is
                                 YUV format at 15 frames per second.
RawYuvResolution640x480Fps15     The image resolution is 640x480, pixel data is raw
                                 YUV format at 15 frames per second.

colorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);

                               KINECT Programming
BYTES PER PIXEL
The stream Format determines the pixel format and therefore the meaning
of the bytes.

ColorImageFormat.RgbResolution640x480Fps30  pixel format is Bgra32 32
bits (4 bytes) per pixel.

The 1st byte is the blue channel value, the 2nd is green, and the 3th is red.
The fourth byte determines the alpha or opacity of the pixel (unused)

640x480 = height * width * BytesPerPixel = 640 * 480 * 4 = 122880 bytes

Stride is the number of bytes for a row of pixels.
Stride = width * BytesPerPixel


                                 KINECT Programming
KINECT Programming
private WriteableBitmap _ColorImageBitmap;
private Int32Rect _ColorImageBitmapRect;
private int _ColorImageStride;

private void InitializeKinect(KinectSensor sensor) {

if (sensor != null){
           ColorImageStream colorStream = sensor.ColorStream;
           colorStream.Enable();

           this._ColorImageBitmap = new WriteableBitmap(colorStream.FrameWidth,
                                                            colorStream.FrameHeight, 96, 96,
                                                            PixelFormats.Bgr32, null);
           this._ColorImageBitmapRect = new Int32Rect(0, 0, colorStream.FrameWidth,
                                                           colorStream.FrameHeight);
           this._ColorImageStride = colorStream.FrameWidth * colorStream.FrameBytesPerPixel;
           ColorImageElement.Source = this._ColorImageBitmap;

           sensor.ColorFrameReady += Kinect_ColorFrameReady;
           sensor.Start();
           }
}


                                             KINECT Programming
private void Kinect_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)
        {
            using (ColorImageFrame frame = e.OpenColorImageFrame())
            {
                if (frame != null)
                {
                    byte[] pixelData = new byte[frame.PixelDataLength];
                    frame.CopyPixelDataTo(pixelData);

                   this._ColorImageBitmap.WritePixels(this._ColorImageBitmapRect,
                                                       pixelData,
                                                      this._ColorImageStride, 0);
               }
           }
       }




                                   KINECT Programming
KINECT Programming
private void TakePictureButton_Click(object sender, RoutedEventArgs e)   {
           string fileName = "snapshot.jpg";

          if (File.Exists(fileName))     {
              File.Delete(fileName);
          }

          using (FileStream savedSnapshot = new FileStream(fileName, FileMode.CreateNew))   {
              BitmapSource image = (BitmapSource)VideoStreamElement.Source;

              JpegBitmapEncoder jpgEncoder = new JpegBitmapEncoder();
              jpgEncoder.QualityLevel = 70;
              jpgEncoder.Frames.Add(BitmapFrame.Create(image));
              jpgEncoder.Save(savedSnapshot);

              savedSnapshot.Flush();
              savedSnapshot.Close();
              savedSnapshot.Dispose();
          }
      }


                                             KINECT Programming
KINECT Programming
What does it see?




    KINECT Programming
Depth Sensing




                              IR Depth
                 IR Emitter
                               Sensor
  KINECT Programming
Mathematical Model

                               𝑑 = 𝑥𝑙 − 𝑥 𝑟

                              𝑏+𝑥 𝑙 − 𝑥 𝑟         𝑏
                                            =
                                𝑍−𝑓               𝑍

                                            𝑏∗𝑓
                                  Z=
                                             𝑑
b

         KINECT Programming
Mathematical Model(2)
    Reference plane distance



=




                                           Disparity   Image Plane
                      KINECT Programming
Precision
• – spatial x/y resolution: 3mm @2m distance
• – depth z resolution:
  • 1cm @2m distance
  • 10 cm @ 4 m distance
• Operation range: 0.8m~3.5m




                    KINECT Programming
DEPTH DATA

• Returns the distance and player for every pixel
  • Ex: 320x240 = 76,800 pixels
• Distance
  • Distance in mm from Kinect ex: 2,000mm
• Player
  • 1-6 players


                     KINECT Programming
MODE
           Mode       Depth & Player         Center Hip Joint    Other 19 Joints

           Default          Yes                        Yes            Yes
            Near            Yes                        Yes        No, for v1.0



  Meters    .4   .8     3     4                              8

Default
 Mode
 Near
 Mode

                                  KINECT Programming
FORMULAS
• Distance Formula
  int depth = depthPoint >> DepthImageFrame.PlayerIndexBitmaskWidth;



• Player Formula
  int player = depthPoint & DepthImageFrame.PlayerIndexBitmask;




                           KINECT Programming
DEPTH MAP FORMAT
• 320 x 240 resolution
• 16 bits per pixel
   Upper 13 bits: depth in mm: 800 mm to 4000 mm range
   Lower 3 bits: segmentation mask
• Depth value 0 means unknown
   Shadows, low reflectivity, and high reflectivity among the few reasons
• Segmentation index
   0 – no player
   1 – skeleton 0
   2 – skeleton 1
   …
                               KINECT Programming
PROVIDED DATA
Depth and Segmentation map




                        KINECT Programming
The DepthImageFrame Object Model




            KINECT Programming
The DepthImageStream Object Model




            KINECT Programming
KINECT Programming
Kinect.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);
Kinect.DepthFrameReady += Kinect_DepthFrameReady;

void Kinect_DepthFrameReady(object sender, DepthImageFrameReadyEventArgs e) {

    using (DepthImageFrame frame = e.OpenDepthImageFrame()) {

        if (frame != null) {
            short[] pixelData = new short[frame.PixelDataLength];
            frame.CopyPixelDataTo(pixelData);

            int stride = frame.Width * frame.BytesPerPixel;
            ImageDepth.Source = BitmapSource.Create(frame.Width,
                    frame.Height, 96, 96,
          PixelFormats.Gray16, null, pixelData,
          stride);
        } } }
}

                                    KINECT Programming

Contenu connexe

Tendances

Kinect Hacks for Dummies
Kinect Hacks for DummiesKinect Hacks for Dummies
Kinect Hacks for DummiesTomoto Washio
 
Kinect for Windows SDK - Programming Guide
Kinect for Windows SDK - Programming GuideKinect for Windows SDK - Programming Guide
Kinect for Windows SDK - Programming GuideKatsuhito Okada
 
Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2Jeff Sipko
 
PyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using PythonPyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using Pythonpycontw
 
How Augment your Reality: Different perspective on the Reality / Virtuality C...
How Augment your Reality: Different perspective on the Reality / Virtuality C...How Augment your Reality: Different perspective on the Reality / Virtuality C...
How Augment your Reality: Different perspective on the Reality / Virtuality C...Matteo Valoriani
 
Kinect Sensors as Natural User Interfaces
Kinect Sensors as Natural User InterfacesKinect Sensors as Natural User Interfaces
Kinect Sensors as Natural User InterfacesRumen Filkov
 
Odessa .NET User Group - Kinect v2
Odessa .NET User Group - Kinect v2Odessa .NET User Group - Kinect v2
Odessa .NET User Group - Kinect v2Dmytro Mindra
 
Introduction to Kinect v2
Introduction to Kinect v2Introduction to Kinect v2
Introduction to Kinect v2Tsukasa Sugiura
 
Introduction to development
Introduction to developmentIntroduction to development
Introduction to developmentMatteo Valoriani
 
Final_draft_Practice_School_II_report
Final_draft_Practice_School_II_reportFinal_draft_Practice_School_II_report
Final_draft_Practice_School_II_reportRishikesh Bagwe
 
Advanced Approach to Play a Atari Game
Advanced Approach to Play a Atari GameAdvanced Approach to Play a Atari Game
Advanced Approach to Play a Atari Gameijceronline
 
DWT-SVD Based Visual Cryptography Scheme for Audio Watermarking
DWT-SVD Based Visual Cryptography Scheme for Audio WatermarkingDWT-SVD Based Visual Cryptography Scheme for Audio Watermarking
DWT-SVD Based Visual Cryptography Scheme for Audio Watermarkinginventionjournals
 
A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...
A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...
A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...Tomohiro Fukuda
 
Availability of Mobile Augmented Reality System for Urban Landscape Simulation
Availability of Mobile Augmented Reality System for Urban Landscape SimulationAvailability of Mobile Augmented Reality System for Urban Landscape Simulation
Availability of Mobile Augmented Reality System for Urban Landscape SimulationTomohiro Fukuda
 
Riva Vr Rehab 07 Neuro Vr
Riva Vr Rehab 07 Neuro VrRiva Vr Rehab 07 Neuro Vr
Riva Vr Rehab 07 Neuro VrRiva Giuseppe
 
DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...
DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...
DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...Tomohiro Fukuda
 

Tendances (20)

Kinect Hacks for Dummies
Kinect Hacks for DummiesKinect Hacks for Dummies
Kinect Hacks for Dummies
 
Kinect for Windows SDK - Programming Guide
Kinect for Windows SDK - Programming GuideKinect for Windows SDK - Programming Guide
Kinect for Windows SDK - Programming Guide
 
Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2
 
Kinect Tutorial
Kinect Tutorial Kinect Tutorial
Kinect Tutorial
 
PyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using PythonPyKinect: Body Iteration Application Development Using Python
PyKinect: Body Iteration Application Development Using Python
 
Kinect sensor
Kinect sensorKinect sensor
Kinect sensor
 
How Augment your Reality: Different perspective on the Reality / Virtuality C...
How Augment your Reality: Different perspective on the Reality / Virtuality C...How Augment your Reality: Different perspective on the Reality / Virtuality C...
How Augment your Reality: Different perspective on the Reality / Virtuality C...
 
Getmoving as3kinect
Getmoving as3kinectGetmoving as3kinect
Getmoving as3kinect
 
Kinect Sensors as Natural User Interfaces
Kinect Sensors as Natural User InterfacesKinect Sensors as Natural User Interfaces
Kinect Sensors as Natural User Interfaces
 
Odessa .NET User Group - Kinect v2
Odessa .NET User Group - Kinect v2Odessa .NET User Group - Kinect v2
Odessa .NET User Group - Kinect v2
 
Introduction to Kinect v2
Introduction to Kinect v2Introduction to Kinect v2
Introduction to Kinect v2
 
Introduction to development
Introduction to developmentIntroduction to development
Introduction to development
 
Kinect connect
Kinect connectKinect connect
Kinect connect
 
Final_draft_Practice_School_II_report
Final_draft_Practice_School_II_reportFinal_draft_Practice_School_II_report
Final_draft_Practice_School_II_report
 
Advanced Approach to Play a Atari Game
Advanced Approach to Play a Atari GameAdvanced Approach to Play a Atari Game
Advanced Approach to Play a Atari Game
 
DWT-SVD Based Visual Cryptography Scheme for Audio Watermarking
DWT-SVD Based Visual Cryptography Scheme for Audio WatermarkingDWT-SVD Based Visual Cryptography Scheme for Audio Watermarking
DWT-SVD Based Visual Cryptography Scheme for Audio Watermarking
 
A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...
A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...
A STUDY OF VARIATION OF NORMAL OF POLY-GONS CREATED BY POINT CLOUD DATA FOR A...
 
Availability of Mobile Augmented Reality System for Urban Landscape Simulation
Availability of Mobile Augmented Reality System for Urban Landscape SimulationAvailability of Mobile Augmented Reality System for Urban Landscape Simulation
Availability of Mobile Augmented Reality System for Urban Landscape Simulation
 
Riva Vr Rehab 07 Neuro Vr
Riva Vr Rehab 07 Neuro VrRiva Vr Rehab 07 Neuro Vr
Riva Vr Rehab 07 Neuro Vr
 
DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...
DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...
DISTRIBUTED AND SYNCHRONISED VR MEETING USING CLOUD COMPUTING: Availability a...
 

Similaire à 3 track kinect@Bicocca - sdk e camere

Image_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptImage_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptLOUISSEVERINOROMANO
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphicsLOKESH KUMAR
 
Image processing for robotics
Image processing for roboticsImage processing for robotics
Image processing for roboticsSALAAMCHAUS
 
A New Algorithm for Digital Colour Image Encryption and Decryption
A New Algorithm for Digital Colour Image Encryption and DecryptionA New Algorithm for Digital Colour Image Encryption and Decryption
A New Algorithm for Digital Colour Image Encryption and DecryptionIRJET Journal
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricksdeanhudson
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer ToolsMark Billinghurst
 
Rendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR FoundationRendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR FoundationUnity Technologies
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Lviv Startup Club
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 
Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)Joel P
 
COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsMark Billinghurst
 
Prinsip gambar digital
Prinsip gambar digitalPrinsip gambar digital
Prinsip gambar digitalOno Trader
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsAdri Jovin
 

Similaire à 3 track kinect@Bicocca - sdk e camere (20)

Image_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptImage_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.ppt
 
cs247 slides
cs247 slidescs247 slides
cs247 slides
 
First kinectslides
First kinectslidesFirst kinectslides
First kinectslides
 
Scmad Chapter07
Scmad Chapter07Scmad Chapter07
Scmad Chapter07
 
Work With Images
Work With ImagesWork With Images
Work With Images
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
 
Bitmap management like a boss
Bitmap management like a bossBitmap management like a boss
Bitmap management like a boss
 
Resize image vb.net
Resize image vb.netResize image vb.net
Resize image vb.net
 
Image processing for robotics
Image processing for roboticsImage processing for robotics
Image processing for robotics
 
A New Algorithm for Digital Colour Image Encryption and Decryption
A New Algorithm for Digital Colour Image Encryption and DecryptionA New Algorithm for Digital Colour Image Encryption and Decryption
A New Algorithm for Digital Colour Image Encryption and Decryption
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricks
 
Unit 11. Graphics
Unit 11. GraphicsUnit 11. Graphics
Unit 11. Graphics
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
 
Rendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR FoundationRendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)Image compression 14_04_2020 (1)
Image compression 14_04_2020 (1)
 
COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer Tools
 
Prinsip gambar digital
Prinsip gambar digitalPrinsip gambar digital
Prinsip gambar digital
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 

Plus de Matteo Valoriani

Immerge yourself in a new Reality
Immerge yourself in a new RealityImmerge yourself in a new Reality
Immerge yourself in a new RealityMatteo Valoriani
 
Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools Matteo Valoriani
 
More Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and WearablesMore Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and WearablesMatteo Valoriani
 
Etna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic ApplicationsEtna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic ApplicationsMatteo Valoriani
 
Etna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic DevelopmentEtna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic DevelopmentMatteo Valoriani
 
Etna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLensEtna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLensMatteo Valoriani
 
Mixed Reality from demo to product
Mixed Reality from demo to productMixed Reality from demo to product
Mixed Reality from demo to productMatteo Valoriani
 
Intel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - RomeIntel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - RomeMatteo Valoriani
 
Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Matteo Valoriani
 
Programming with RealSense using .NET
Programming with RealSense using .NETProgramming with RealSense using .NET
Programming with RealSense using .NETMatteo Valoriani
 
Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity? Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity? Matteo Valoriani
 
Corso pratico di C# - 2013
Corso pratico di C# - 2013Corso pratico di C# - 2013
Corso pratico di C# - 2013Matteo Valoriani
 
Smart and beyond - Perchè
Smart and beyond - PerchèSmart and beyond - Perchè
Smart and beyond - PerchèMatteo Valoriani
 
Uxconf2012 - Interactive technologies for children: new frontiers
Uxconf2012 - Interactive technologies for children: new frontiersUxconf2012 - Interactive technologies for children: new frontiers
Uxconf2012 - Interactive technologies for children: new frontiersMatteo Valoriani
 

Plus de Matteo Valoriani (20)

Immerge yourself in a new Reality
Immerge yourself in a new RealityImmerge yourself in a new Reality
Immerge yourself in a new Reality
 
Hour ofcode
Hour ofcodeHour ofcode
Hour ofcode
 
Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools
 
More Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and WearablesMore Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and Wearables
 
Etna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic ApplicationsEtna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic Applications
 
Etna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic DevelopmentEtna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic Development
 
Etna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLensEtna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLens
 
Mixed Reality from demo to product
Mixed Reality from demo to productMixed Reality from demo to product
Mixed Reality from demo to product
 
Intel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - RomeIntel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - Rome
 
Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2
 
Programming with RealSense using .NET
Programming with RealSense using .NETProgramming with RealSense using .NET
Programming with RealSense using .NET
 
Face recognition
Face recognitionFace recognition
Face recognition
 
Communitydays2015
Communitydays2015Communitydays2015
Communitydays2015
 
Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity? Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity?
 
Intel real sense handson
Intel real sense handsonIntel real sense handson
Intel real sense handson
 
Communityday2013
Communityday2013Communityday2013
Communityday2013
 
Communitydays2014
Communitydays2014Communitydays2014
Communitydays2014
 
Corso pratico di C# - 2013
Corso pratico di C# - 2013Corso pratico di C# - 2013
Corso pratico di C# - 2013
 
Smart and beyond - Perchè
Smart and beyond - PerchèSmart and beyond - Perchè
Smart and beyond - Perchè
 
Uxconf2012 - Interactive technologies for children: new frontiers
Uxconf2012 - Interactive technologies for children: new frontiersUxconf2012 - Interactive technologies for children: new frontiers
Uxconf2012 - Interactive technologies for children: new frontiers
 

Dernier

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Dernier (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

3 track kinect@Bicocca - sdk e camere

  • 1. Ing. Matteo Valoriani matteo.valoriani@studentpartner.com KINECT Programming
  • 2. The ColorImageStream object model KINECT Programming
  • 3. CAMERA DATA • Events return ImageFrame • PixelDataLength • FrameNumber • Timestamp • Dimensions: Height, Width • Use AllFramesReady event to synchronize KINECT Programming
  • 4. ColorImageFormat ColorImageFormat What it means Undefined The image resolution is indeterminate. RgbResolution640x480Fps30 The image resolution is 640x480, pixel data is RGB32 format at 30 frames per second. RgbResolution1280x960Fps12 The image resolution is 1280x960, pixel data is RGB32 format at 12 frames per second. YuvResolution640x480Fps15 The image resolution is 640x480, pixel data is YUV format at 15 frames per second. RawYuvResolution640x480Fps15 The image resolution is 640x480, pixel data is raw YUV format at 15 frames per second. colorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30); KINECT Programming
  • 5. BYTES PER PIXEL The stream Format determines the pixel format and therefore the meaning of the bytes. ColorImageFormat.RgbResolution640x480Fps30  pixel format is Bgra32 32 bits (4 bytes) per pixel. The 1st byte is the blue channel value, the 2nd is green, and the 3th is red. The fourth byte determines the alpha or opacity of the pixel (unused) 640x480 = height * width * BytesPerPixel = 640 * 480 * 4 = 122880 bytes Stride is the number of bytes for a row of pixels. Stride = width * BytesPerPixel KINECT Programming
  • 7. private WriteableBitmap _ColorImageBitmap; private Int32Rect _ColorImageBitmapRect; private int _ColorImageStride; private void InitializeKinect(KinectSensor sensor) { if (sensor != null){ ColorImageStream colorStream = sensor.ColorStream; colorStream.Enable(); this._ColorImageBitmap = new WriteableBitmap(colorStream.FrameWidth, colorStream.FrameHeight, 96, 96, PixelFormats.Bgr32, null); this._ColorImageBitmapRect = new Int32Rect(0, 0, colorStream.FrameWidth, colorStream.FrameHeight); this._ColorImageStride = colorStream.FrameWidth * colorStream.FrameBytesPerPixel; ColorImageElement.Source = this._ColorImageBitmap; sensor.ColorFrameReady += Kinect_ColorFrameReady; sensor.Start(); } } KINECT Programming
  • 8. private void Kinect_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e) { using (ColorImageFrame frame = e.OpenColorImageFrame()) { if (frame != null) { byte[] pixelData = new byte[frame.PixelDataLength]; frame.CopyPixelDataTo(pixelData); this._ColorImageBitmap.WritePixels(this._ColorImageBitmapRect, pixelData, this._ColorImageStride, 0); } } } KINECT Programming
  • 10. private void TakePictureButton_Click(object sender, RoutedEventArgs e) { string fileName = "snapshot.jpg"; if (File.Exists(fileName)) { File.Delete(fileName); } using (FileStream savedSnapshot = new FileStream(fileName, FileMode.CreateNew)) { BitmapSource image = (BitmapSource)VideoStreamElement.Source; JpegBitmapEncoder jpgEncoder = new JpegBitmapEncoder(); jpgEncoder.QualityLevel = 70; jpgEncoder.Frames.Add(BitmapFrame.Create(image)); jpgEncoder.Save(savedSnapshot); savedSnapshot.Flush(); savedSnapshot.Close(); savedSnapshot.Dispose(); } } KINECT Programming
  • 12. What does it see? KINECT Programming
  • 13. Depth Sensing IR Depth IR Emitter Sensor KINECT Programming
  • 14. Mathematical Model 𝑑 = 𝑥𝑙 − 𝑥 𝑟 𝑏+𝑥 𝑙 − 𝑥 𝑟 𝑏 = 𝑍−𝑓 𝑍 𝑏∗𝑓 Z= 𝑑 b KINECT Programming
  • 15. Mathematical Model(2) Reference plane distance = Disparity Image Plane KINECT Programming
  • 16. Precision • – spatial x/y resolution: 3mm @2m distance • – depth z resolution: • 1cm @2m distance • 10 cm @ 4 m distance • Operation range: 0.8m~3.5m KINECT Programming
  • 17. DEPTH DATA • Returns the distance and player for every pixel • Ex: 320x240 = 76,800 pixels • Distance • Distance in mm from Kinect ex: 2,000mm • Player • 1-6 players KINECT Programming
  • 18. MODE Mode Depth & Player Center Hip Joint Other 19 Joints Default Yes Yes Yes Near Yes Yes No, for v1.0 Meters .4 .8 3 4 8 Default Mode Near Mode KINECT Programming
  • 19. FORMULAS • Distance Formula int depth = depthPoint >> DepthImageFrame.PlayerIndexBitmaskWidth; • Player Formula int player = depthPoint & DepthImageFrame.PlayerIndexBitmask; KINECT Programming
  • 20. DEPTH MAP FORMAT • 320 x 240 resolution • 16 bits per pixel Upper 13 bits: depth in mm: 800 mm to 4000 mm range Lower 3 bits: segmentation mask • Depth value 0 means unknown Shadows, low reflectivity, and high reflectivity among the few reasons • Segmentation index 0 – no player 1 – skeleton 0 2 – skeleton 1 … KINECT Programming
  • 21. PROVIDED DATA Depth and Segmentation map KINECT Programming
  • 22. The DepthImageFrame Object Model KINECT Programming
  • 23. The DepthImageStream Object Model KINECT Programming
  • 25. Kinect.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30); Kinect.DepthFrameReady += Kinect_DepthFrameReady; void Kinect_DepthFrameReady(object sender, DepthImageFrameReadyEventArgs e) { using (DepthImageFrame frame = e.OpenDepthImageFrame()) { if (frame != null) { short[] pixelData = new short[frame.PixelDataLength]; frame.CopyPixelDataTo(pixelData); int stride = frame.Width * frame.BytesPerPixel; ImageDepth.Source = BitmapSource.Create(frame.Width, frame.Height, 96, 96, PixelFormats.Gray16, null, pixelData, stride); } } } } KINECT Programming