SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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...
 

Ähnlich wie 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
 
Gesture controlled-mouse-using-python37-open cv3
Gesture controlled-mouse-using-python37-open cv3Gesture controlled-mouse-using-python37-open cv3
Gesture controlled-mouse-using-python37-open cv3ssuserd8a01a
 
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
 

Ähnlich wie 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
 
First kinectslides
First kinectslidesFirst kinectslides
First kinectslides
 
cs247 slides
cs247 slidescs247 slides
cs247 slides
 
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
 
Gesture controlled-mouse-using-python37-open cv3
Gesture controlled-mouse-using-python37-open cv3Gesture controlled-mouse-using-python37-open cv3
Gesture controlled-mouse-using-python37-open cv3
 
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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 

Kürzlich hochgeladen (20)

Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 

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