Share
Embed
Transcript
24 slides
-
• Cámara VGA + Sensor de profundidad + Micrófono •
Vamos, para hacer el idiota delante de la TV… …pero sin mando ¿Qué es Kinect? -
• 640x480 8-bit RGB (30 FPS) • 1280x1024 8-bit RGB
(15 FPS) • 320x240 11-bit monocromo • FOV 57 • Reconocimiento de colores (RGB) • Reconocimiento facial * Cámara VGA * No implementado en el SDK (al menos de momento) -
• Proyector de infrarrojos + sensor CMOS monocromo • Permite
ver la habitación en 3D sin importar la iluminación • 320x240 Sensor de Profundidad -
• Realmente son 4 micrófonos :) • Aisla voces del
ruido ambiental y eco • Elimina ruido del propio videojuego • Permite obtener la dirección del sonido • Puedes dar comandos de voz – Pensado para la consola – Pero en Windows se puede usar la Speech API Micrófono -
• Reconocimiento de figuras – TB y meses de training
para “aprender” a reconocer objetos • Reconocimiento facial – Requiere training para cada usuario • Reconocimiento de gestures • Reconocimiento de voces Software * No implementado en el SDK (al menos de momento) -
• Reconoce el entorno y la profundidad del mismo •
Reconoce a los jugadores, sus articulaciones (32 puntos *) y les mapea a un esqueleto ¿Y cómo funciona? * Menos en el SDK (al menos de momento) -
• Beta (muy beta) • Sólo para Windows 7 (x86/x64)
• Managed & Unmanaged code • Free para uso no comercial • Envia 3 Streams al Natural User Interfaces Lib.: SDK: Features -
• Tracking de skeleton con 20 Joints • No necesita
training SDK: Features -
• Referenciar assembly: Microsoft.Research.Kinect.dll • Usings: using Microsoft.Research.Kinect.Nui; using Microsoft.Research.Kinect.Audio;
• Inicializar runtime del NUI: kinect = new Runtime(); kinect.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor); SDK: Libs & Init. -
• Abrir el videostream: kinect.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color); • Handler
para recibir frames: kinect.VideoFrameReady += VideoFrame; public void VideoFrame (object sender, ImageFrameReadyEventArgs e) { PlanarImage Image = e.ImageFrame.Image; BitmapSource ColorBitmap = BitmapSource.Create( Image.Width, Image.Height, 96, 96, PixelFormats.Bgr32, null, Image.Bits, Image.Width * Image.BytesPerPixel); } SDK: Video -
• Abrir el depthstream: kinect.DepthStream.Open(ImageStreamType.Depth,2, ImageResolution.Resolution320x240,ImageType.DepthAndPlayerIndex); • Handler para recibir
frames: kinect.DepthFrameReady += DepthFrame; • Código más complejo, pero básicamente: • Stream de 320x240 o 80x60 • Depth: Arrays de int16 – 13 high bits: profundidad (mm) – 3 low bits: player index (0 = fondo/No player) SDK: Depth -
• Handler para recibir frames: kinect.SkeletonFrameReady += SkeletonFrame; void SkeletonFrame(object
sender, SkeletonFrameReadyEventArgs e) { SkeletonFrame skeletonFrame = e.SkeletonFrame; … foreach(SkeletonData data in skeletonFrame.Skeletons) { if (data.TrackingState == SkeletonTrackingState.Tracked) { … foreach (Joint joint in data.Joints) { … } } } } SDK: Skeleton -
• Métodos para mapear el esqueleto a 2D… runtime.SkeletonEngine.SkeletonToDepthImage() …GetColorPixelCoordinatesFromDepthPixel()
• Enum de Joint IDs: Microsoft.Research.Kinect.Nui.JointID • Joint: Vector4 (x, y, z, q) – Z: Dist. del sensor. Regla de la mano derecha. – q: Quality [0,1] (parecido a la precisión) • Cada Skeleton tiene un TrackingID fijo • Max. 2 Skeletons de momento en el SDK SDK: Skeleton -
• Se puede aplicar smoothing kinect.SkeletonEngine.TransformSmooth = true; var parameters
= new TransformSmoothParameters { Smoothing = 1.0f, Correction = 0.1f, Prediction = 0.1f, JitterRadius = 0.05f, MaxDeviationRadius = 0.05f }; kinect.SkeletonEngine.SmoothParameters = parameters; SDK: Skeleton -
• Instanciar fuente de audio: var audioSource = new KinectAudioSource
{SystemMode = SystemMode.OptibeamArrayOnly}; • Obtener stream de audio: byte[] buffer = new byte[16000]; var audioStream = audioSource.Start(); audioStream.Read(buffer, 0, buffer.Length); • 16-kHz 16 bit mono PCM SDK: Audio -
• Activar beams (detección de dirección): source.MicArrayMode = MicArrayMode.MicArrayAdaptiveBeam; •
Modos: automático, manual, central, todos… • Handler para recibir beams: audioSource.BeamChanged += AudioBeamChanged; static void AudioBeamChanged(object sender, BeamChangedEventArgs e) { … e.Angle … // en radianes } • Relativo al centro del Kinect. • Mirando de frente al Kinect: – Angle > 0: Origen por la derecha – Angle < 0: Origen por la izquierda SDK: Audio -
• De momento no implementadas :( • Librería no oficial
con buena pinta: http://kinecttoolbox.codeplex.com/ • Reconocimiento facial tampoco hay :( SDK: Gestures?