diff --git a/Resources/BodyBasics-XAML/App.xaml b/Resources/BodyBasics-XAML/App.xaml deleted file mode 100644 index 608c4bd..0000000 --- a/Resources/BodyBasics-XAML/App.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/Resources/BodyBasics-XAML/App.xaml.cs b/Resources/BodyBasics-XAML/App.xaml.cs deleted file mode 100644 index 258018d..0000000 --- a/Resources/BodyBasics-XAML/App.xaml.cs +++ /dev/null @@ -1,119 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 - -namespace Microsoft.Samples.Kinect.BodyBasics -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - sealed partial class App : Application - { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - this.Suspending += OnSuspending; - } - - /// - /// Invoked when the application is launched normally by the end user. Other entry points - /// will be used when the application is launched to open a specific file, to display - /// search results, and so forth. - /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs args) - { - -#if DEBUG - if (System.Diagnostics.Debugger.IsAttached) - { - this.DebugSettings.EnableFrameRateCounter = true; - } -#endif - - Frame rootFrame = Window.Current.Content as Frame; - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == null) - { - // Create a Frame to act as the navigation context and navigate to the first page - rootFrame = new Frame(); - - // Set the default language - rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; - - rootFrame.NavigationFailed += OnNavigationFailed; - - if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) - { - //TODO: Load state from previously suspended application - } - - // Place the frame in the current Window - Window.Current.Content = rootFrame; - } - - if (rootFrame.Content == null) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - if (!rootFrame.Navigate(typeof(MainPage), args.Arguments)) - { - throw new Exception("Failed to create initial page"); - } - } - // Ensure the current window is active - Window.Current.Activate(); - } - - /// - /// Invoked when Navigation to a certain page fails - /// - /// The Frame which failed navigation - /// Details about the navigation failure - void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - } - - /// - /// Invoked when application execution is being suspended. Application state is saved - /// without knowing whether the application will be terminated or resumed with the contents - /// of memory still intact. - /// - /// The source of the suspend request. - /// Details about the suspend request. - private void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - //TODO: Save application state and stop any background activity - deferral.Complete(); - } - } -} diff --git a/Resources/BodyBasics-XAML/Assets/Logo.png b/Resources/BodyBasics-XAML/Assets/Logo.png deleted file mode 100644 index e26771c..0000000 Binary files a/Resources/BodyBasics-XAML/Assets/Logo.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/Assets/SmallLogo.png b/Resources/BodyBasics-XAML/Assets/SmallLogo.png deleted file mode 100644 index 1eb0d9d..0000000 Binary files a/Resources/BodyBasics-XAML/Assets/SmallLogo.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-100.png b/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-100.png deleted file mode 100644 index 0fa37e6..0000000 Binary files a/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-100.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-140.png b/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-140.png deleted file mode 100644 index 7734119..0000000 Binary files a/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-140.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-180.png b/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-180.png deleted file mode 100644 index 958dba4..0000000 Binary files a/Resources/BodyBasics-XAML/Assets/SplashScreen.scale-180.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/Assets/StoreLogo.png b/Resources/BodyBasics-XAML/Assets/StoreLogo.png deleted file mode 100644 index dcb6727..0000000 Binary files a/Resources/BodyBasics-XAML/Assets/StoreLogo.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/BodyBasics-XAML.csproj b/Resources/BodyBasics-XAML/BodyBasics-XAML.csproj deleted file mode 100644 index 3a72a8b..0000000 --- a/Resources/BodyBasics-XAML/BodyBasics-XAML.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Debug - x86 - {F90CC85F-30CB-4214-8D5E-42F597C2783A} - AppContainerExe - Properties - BodyBasics_XAML - BodyBasics-XAML - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - BodyBasics-XAML_TemporaryKey.pfx - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - true - - - - App.xaml - - - MainPage.xaml - - - - - - Designer - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - Microsoft Visual C++ Runtime Package - - - WindowsPreview.Kinect - - - - 11.0 - - - - \ No newline at end of file diff --git a/Resources/BodyBasics-XAML/BodyBasics-XAML.sln b/Resources/BodyBasics-XAML/BodyBasics-XAML.sln deleted file mode 100644 index cef8970..0000000 --- a/Resources/BodyBasics-XAML/BodyBasics-XAML.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BodyBasics-XAML", "BodyBasics-XAML.csproj", "{F90CC85F-30CB-4214-8D5E-42F597C2783A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Debug|x64.ActiveCfg = Debug|x64 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Debug|x64.Build.0 = Debug|x64 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Debug|x64.Deploy.0 = Debug|x64 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Debug|x86.ActiveCfg = Debug|x86 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Debug|x86.Build.0 = Debug|x86 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Debug|x86.Deploy.0 = Debug|x86 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Release|x64.ActiveCfg = Release|x64 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Release|x64.Build.0 = Release|x64 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Release|x64.Deploy.0 = Release|x64 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Release|x86.ActiveCfg = Release|x86 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Release|x86.Build.0 = Release|x86 - {F90CC85F-30CB-4214-8D5E-42F597C2783A}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Resources/BodyBasics-XAML/Common/StandardStyles.xaml b/Resources/BodyBasics-XAML/Common/StandardStyles.xaml deleted file mode 100644 index 9e0a2e8..0000000 --- a/Resources/BodyBasics-XAML/Common/StandardStyles.xaml +++ /dev/null @@ -1,1829 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mouse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/BodyBasics-XAML/Images/Kinect.ico b/Resources/BodyBasics-XAML/Images/Kinect.ico deleted file mode 100644 index db8b818..0000000 Binary files a/Resources/BodyBasics-XAML/Images/Kinect.ico and /dev/null differ diff --git a/Resources/BodyBasics-XAML/Images/Logo.png b/Resources/BodyBasics-XAML/Images/Logo.png deleted file mode 100644 index 4b3a5ab..0000000 Binary files a/Resources/BodyBasics-XAML/Images/Logo.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/Images/Status.png b/Resources/BodyBasics-XAML/Images/Status.png deleted file mode 100644 index 7dc48bd..0000000 Binary files a/Resources/BodyBasics-XAML/Images/Status.png and /dev/null differ diff --git a/Resources/BodyBasics-XAML/MainPage.xaml b/Resources/BodyBasics-XAML/MainPage.xaml deleted file mode 100644 index 6e08693..0000000 --- a/Resources/BodyBasics-XAML/MainPage.xaml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - Body Basics - - - - - - - - - - diff --git a/Resources/BodyBasics-XAML/MainPage.xaml.cs b/Resources/BodyBasics-XAML/MainPage.xaml.cs deleted file mode 100644 index b898b69..0000000 --- a/Resources/BodyBasics-XAML/MainPage.xaml.cs +++ /dev/null @@ -1,817 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using Windows.ApplicationModel.Resources; -using Windows.Foundation; -using Windows.UI; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Shapes; -using WindowsPreview.Kinect; - -namespace Microsoft.Samples.Kinect.BodyBasics -{ - /// - /// Main page for sample - /// - public sealed partial class MainPage : Page, INotifyPropertyChanged - { - /// - /// Resource loader for string resources - /// -#if WIN81ORLATER - private ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView("Resources"); -#else - private ResourceLoader resourceLoader = new ResourceLoader("Resources"); -#endif - - /// - /// Radius of drawn hand circles - /// - private const double HighConfidenceHandSize = 40; - - /// - /// Radius of drawn hand circles - /// - private const double LowConfidenceHandSize = 20; - - /// - /// Thickness of drawn joint lines - /// - private const double JointThickness = 8.0; - - /// - /// Thickness of seen bone lines - /// - private const double TrackedBoneThickness = 4.0; - - /// - /// Thickness of inferred joint lines - /// - private const double InferredBoneThickness = 1.0; - - /// - /// Thickness of clip edge rectangles - /// - private const double ClipBoundsThickness = 5; - - /// - /// Constant for clamping Z values of camera space points from being negative - /// - private const float InferredZPositionClamp = 0.1f; - - /// - /// Active Kinect sensor - /// - private KinectSensor kinectSensor = null; - - /// - /// Coordinate mapper to map one type of point to another - /// - private CoordinateMapper coordinateMapper = null; - - /// - /// Reader for body frames - /// - private BodyFrameReader bodyFrameReader = null; - - /// - /// Array for the bodies - /// - private Body[] bodies = null; - - /// - /// Current status text to display - /// - private string statusText = null; - - /// - /// Main Canvas that contains all visual objects for all bodies and clipped edges - /// - private Canvas drawingCanvas; - - /// - /// List of BodyInfo objects for each potential body - /// - private BodyInfo[] BodyInfos; - - /// - /// List of colors for each body tracked - /// - private List BodyColors; - - /// - /// Clipped edges rectangles - /// - private Rectangle LeftClipEdge; - private Rectangle RightClipEdge; - private Rectangle TopClipEdge; - private Rectangle BottomClipEdge; - - private int BodyCount - { - set - { - if (value == 0) - { - this.BodyInfos = null; - return; - } - - // creates instances of BodyInfo objects for potential number of bodies - if (this.BodyInfos == null || this.BodyInfos.Length != value) - { - this.BodyInfos = new BodyInfo[value]; - - for (int bodyIndex = 0; bodyIndex < this.bodies.Length; bodyIndex++) - { - this.BodyInfos[bodyIndex] = new BodyInfo(this.BodyColors[bodyIndex]); - } - } - } - - get { return this.BodyInfos == null ? 0 : this.BodyInfos.Length; } - } - - private float JointSpaceWidth { get; set; } - - private float JointSpaceHeight { get; set; } - - /// - /// Initializes a new instance of the MainPage class. - /// - public MainPage() - { - // one sensor is currently supported - this.kinectSensor = KinectSensor.GetDefault(); - - // get the coordinate mapper - this.coordinateMapper = this.kinectSensor.CoordinateMapper; - - // get the depth (display) extents - FrameDescription frameDescription = this.kinectSensor.DepthFrameSource.FrameDescription; - - // get size of joint space - this.JointSpaceWidth = frameDescription.Width; - this.JointSpaceHeight = frameDescription.Height; - - // get total number of bodies from BodyFrameSource - this.bodies = new Body[this.kinectSensor.BodyFrameSource.BodyCount]; - - // open the reader for the body frames - this.bodyFrameReader = this.kinectSensor.BodyFrameSource.OpenReader(); - - // wire handler for frame arrival - this.bodyFrameReader.FrameArrived += this.Reader_BodyFrameArrived; - - // set IsAvailableChanged event notifier - this.kinectSensor.IsAvailableChanged += this.Sensor_IsAvailableChanged; - - // populate body colors, one for each BodyIndex - this.BodyColors = new List - { - Colors.Red, - Colors.Orange, - Colors.Green, - Colors.Blue, - Colors.Indigo, - Colors.Violet - }; - - // sets total number of possible tracked bodies - // create ellipses and lines for drawing bodies - this.BodyCount = this.kinectSensor.BodyFrameSource.BodyCount; - - // Instantiate a new Canvas - this.drawingCanvas = new Canvas(); - - // open the sensor - this.kinectSensor.Open(); - - // set the status text - this.StatusText = this.kinectSensor.IsAvailable ? resourceLoader.GetString("RunningStatusText") - : resourceLoader.GetString("NoSensorStatusText"); - - // use the window object as the view model in this simple example - this.DataContext = this; - - // initialize the components (controls) of the window - this.InitializeComponent(); - - // set the clip rectangle to prevent rendering outside the canvas - this.drawingCanvas.Clip = new RectangleGeometry(); - this.drawingCanvas.Clip.Rect = new Rect(0.0, 0.0, this.DisplayGrid.Width, this.DisplayGrid.Height); - - // create visual objects for drawing joints, bone lines, and clipped edges - this.PopulateVisualObjects(); - - // add canvas to DisplayGrid - this.DisplayGrid.Children.Add(this.drawingCanvas); - } - - /// - /// INotifyPropertyChangedPropertyChanged event to allow window controls to bind to changeable data - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Gets or sets the current status text to display - /// - public string StatusText - { - get - { - return this.statusText; - } - - set - { - if (this.statusText != value) - { - this.statusText = value; - - // notify any bound elements that the text has changed - if (this.PropertyChanged != null) - { - this.PropertyChanged(this, new PropertyChangedEventArgs("StatusText")); - } - } - } - } - - /// - /// Execute shutdown tasks - /// - /// object sending the event - /// event arguments - private void MainPage_Unloaded(object sender, RoutedEventArgs e) - { - if (this.bodyFrameReader != null) - { - // BodyFrameReder is IDisposable - this.bodyFrameReader.Dispose(); - this.bodyFrameReader = null; - } - - // Body is IDisposable - if (this.bodies != null) - { - foreach (Body body in this.bodies) - { - if (body != null) - { - body.Dispose(); - } - } - } - - if (this.kinectSensor != null) - { - this.kinectSensor.Close(); - this.kinectSensor = null; - } - } - - /// - /// Handles the body frame data arriving from the sensor - /// - /// object sending the event - /// event arguments - private void Reader_BodyFrameArrived(object sender, BodyFrameArrivedEventArgs e) - { - bool dataReceived = false; - bool hasTrackedBody = false; - - using (BodyFrame bodyFrame = e.FrameReference.AcquireFrame()) - { - if (bodyFrame != null) - { - bodyFrame.GetAndRefreshBodyData(this.bodies); - dataReceived = true; - } - } - - if (dataReceived) - { - this.BeginBodiesUpdate(); - - // iterate through each body - for (int bodyIndex = 0; bodyIndex < this.bodies.Length; bodyIndex++) - { - Body body = this.bodies[bodyIndex]; - - if (body.IsTracked) - { - // check if this body clips an edge - this.UpdateClippedEdges(body, hasTrackedBody); - - this.UpdateBody(body, bodyIndex); - - hasTrackedBody = true; - } - else - { - // collapse this body from canvas as it goes out of view - this.ClearBody(bodyIndex); - } - } - - if (!hasTrackedBody) - { - // clear clipped edges if no bodies are tracked - this.ClearClippedEdges(); - } - } - } - - /// - /// Clear update status of all bodies - /// - internal void BeginBodiesUpdate() - { - if (this.BodyInfos != null) - { - foreach (var bodyInfo in this.BodyInfos) - { - bodyInfo.Updated = false; - } - } - } - - /// - /// Update body data for each body that is tracked. - /// - /// body for getting joint info - /// index for body we are currently updating - internal void UpdateBody(Body body, int bodyIndex) - { - IReadOnlyDictionary joints = body.Joints; - var jointPointsInDepthSpace = new Dictionary(); - - var bodyInfo = this.BodyInfos[bodyIndex]; - - CoordinateMapper coordinateMapper = this.kinectSensor.CoordinateMapper; - - // update all joints - foreach (var jointType in body.Joints.Keys) - { - // sometimes the depth(Z) of an inferred joint may show as negative - // clamp down to 0.1f to prevent coordinatemapper from returning (-Infinity, -Infinity) - CameraSpacePoint position = body.Joints[jointType].Position; - if (position.Z < 0) - { - position.Z = InferredZPositionClamp; - } - - // map joint position to depth space - DepthSpacePoint depthSpacePoint = coordinateMapper.MapCameraPointToDepthSpace(position); - jointPointsInDepthSpace[jointType] = new Point(depthSpacePoint.X, depthSpacePoint.Y); - - // modify the joint's visibility and location - this.UpdateJoint(bodyInfo.JointPoints[jointType], joints[jointType], jointPointsInDepthSpace[jointType]); - - // modify hand ellipse colors based on hand states - // modity hand ellipse sizes based on tracking confidences - if (jointType == JointType.HandRight) - { - this.UpdateHand(bodyInfo.HandRightEllipse, body.HandRightState, body.HandRightConfidence, jointPointsInDepthSpace[jointType]); - } - - if (jointType == JointType.HandLeft) - { - this.UpdateHand(bodyInfo.HandLeftEllipse, body.HandLeftState, body.HandLeftConfidence, jointPointsInDepthSpace[jointType]); - } - } - - // update all bones - foreach (var bone in bodyInfo.Bones) - { - this.UpdateBone(bodyInfo.BoneLines[bone], joints[bone.Item1], joints[bone.Item2], - jointPointsInDepthSpace[bone.Item1], - jointPointsInDepthSpace[bone.Item2]); - } - } - - /// - /// Collapse the body from the canvas. - /// - /// - private void ClearBody(int bodyIndex) - { - var bodyInfo = this.BodyInfos[bodyIndex]; - - // collapse all joint ellipses - foreach (var joint in bodyInfo.JointPoints) - { - joint.Value.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - - // collapse all bone lines - foreach (var bone in bodyInfo.Bones) - { - bodyInfo.BoneLines[bone].Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - - // collapse handstate ellipses - bodyInfo.HandLeftEllipse.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - - bodyInfo.HandRightEllipse.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - - /// - /// Updates hand state ellipses depending on tracking state and it's confidence. - /// - /// ellipse representing handstate - /// open, closed, or lasso - /// confidence of handstate - /// location of handjoint - private void UpdateHand(Ellipse ellipse, HandState handState, TrackingConfidence trackingConfidence, Point point) - { - ellipse.Fill = new SolidColorBrush(this.HandStateToColor(handState)); - - // draw handstate ellipse based on tracking confidence - ellipse.Width = ellipse.Height = (trackingConfidence == TrackingConfidence.Low) ? LowConfidenceHandSize : HighConfidenceHandSize; - - ellipse.Visibility = Windows.UI.Xaml.Visibility.Visible; - - // don't draw handstate if hand joints are not tracked - if (!Double.IsInfinity(point.X) && !Double.IsInfinity(point.Y)) - { - Canvas.SetLeft(ellipse, point.X - ellipse.Width / 2); - Canvas.SetTop(ellipse, point.Y - ellipse.Width / 2); - } - } - - /// - /// Update a joint. - /// - /// - /// - /// - private void UpdateJoint(Ellipse ellipse, Joint joint, Point point) - { - TrackingState trackingState = joint.TrackingState; - - // only draw if joint is tracked or inferred - if (trackingState != TrackingState.NotTracked) - { - if (trackingState == TrackingState.Tracked) - { - ellipse.Fill = new SolidColorBrush(Colors.Green); - } - else - { - // inferred joints are yellow - ellipse.Fill = new SolidColorBrush(Colors.Yellow); - } - - Canvas.SetLeft(ellipse, point.X - JointThickness / 2); - Canvas.SetTop(ellipse, point.Y - JointThickness / 2); - - ellipse.Visibility = Windows.UI.Xaml.Visibility.Visible; - } - else - { - ellipse.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - } - - /// - /// Update a bone line. - /// - /// line representing a bone line - /// start joint of bone line - /// end joint of bone line - /// location of start joint - /// location of end joint - private void UpdateBone(Line line, Joint startJoint, Joint endJoint, Point startPoint, Point endPoint) - { - // don't draw if neither joints are tracked - if (startJoint.TrackingState == TrackingState.NotTracked || endJoint.TrackingState == TrackingState.NotTracked) - { - line.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - return; - } - - // all lines are inferred thickness unless both joints are tracked - line.StrokeThickness = InferredBoneThickness; - - if (startJoint.TrackingState == TrackingState.Tracked && - endJoint.TrackingState == TrackingState.Tracked) - { - line.StrokeThickness = TrackedBoneThickness; - } - - line.Visibility = Windows.UI.Xaml.Visibility.Visible; - - line.X1 = startPoint.X; - line.Y1 = startPoint.Y; - line.X2 = endPoint.X; - line.Y2 = endPoint.Y; - } - - /// - /// Draws indicators to show which edges are clipping body data. - /// - /// body to draw clipping information for - /// bool to determine if another body is triggering a clipped edge - private void UpdateClippedEdges(Body body, bool hasTrackedBody) - { - // BUG (waiting for confirmation): - // Clip dectection works differently for top and right edges compared to left and bottom edges - // due to the current joint confidence model. This is an ST issue. - // Joints become inferred immediately as they touch the left/bottom edges and clip detection triggers. - // Joints squish on the right/top edges and clip detection doesn't trigger until more joints of - // the body goes out of view (e.g all hand joints vs only handtip). - - FrameEdges clippedEdges = body.ClippedEdges; - - if (clippedEdges.HasFlag(FrameEdges.Left)) - { - this.LeftClipEdge.Visibility = Windows.UI.Xaml.Visibility.Visible; - } - else if(!hasTrackedBody) - { - // don't clear this edge if another body is triggering clipped edge - this.LeftClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - - if (clippedEdges.HasFlag(FrameEdges.Right)) - { - this.RightClipEdge.Visibility = Windows.UI.Xaml.Visibility.Visible; - } - else if (!hasTrackedBody) - { - this.RightClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - - if (clippedEdges.HasFlag(FrameEdges.Top)) - { - this.TopClipEdge.Visibility = Windows.UI.Xaml.Visibility.Visible; - } - else if (!hasTrackedBody) - { - this.TopClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - - if (clippedEdges.HasFlag(FrameEdges.Bottom)) - { - this.BottomClipEdge.Visibility = Windows.UI.Xaml.Visibility.Visible; - } - else if (!hasTrackedBody) - { - this.BottomClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - } - - /// - /// Clear all clipped edges. - /// - private void ClearClippedEdges() - { - this.LeftClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - - this.RightClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - - this.TopClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - - this.BottomClipEdge.Visibility = Windows.UI.Xaml.Visibility.Collapsed; - } - - /// - /// Select color of hand state - /// - /// - /// - private Color HandStateToColor(HandState handState) - { - switch (handState) - { - case HandState.Open: - return Colors.Green; - - case HandState.Closed: - return Colors.Red; - - case HandState.Lasso: - return Colors.Blue; - } - - return Colors.Transparent; - } - - /// - /// Instantiate new objects for joints, bone lines, and clipped edge rectangles - /// - private void PopulateVisualObjects() - { - // create clipped edges and set to collapsed initially - this.LeftClipEdge = new Rectangle() - { - Fill = new SolidColorBrush(Colors.Red), - Width = ClipBoundsThickness, - Height = this.DisplayGrid.Height, - Visibility = Windows.UI.Xaml.Visibility.Collapsed - }; - - this.RightClipEdge = new Rectangle() - { - Fill = new SolidColorBrush(Colors.Red), - Width = ClipBoundsThickness, - Height = this.DisplayGrid.Height, - Visibility = Windows.UI.Xaml.Visibility.Collapsed - }; - - this.TopClipEdge = new Rectangle() - { - Fill = new SolidColorBrush(Colors.Red), - Width = this.DisplayGrid.Width, - Height = ClipBoundsThickness, - Visibility = Windows.UI.Xaml.Visibility.Collapsed - }; - - this.BottomClipEdge = new Rectangle() - { - Fill = new SolidColorBrush(Colors.Red), - Width = this.DisplayGrid.Width, - Height = ClipBoundsThickness, - Visibility = Windows.UI.Xaml.Visibility.Collapsed - }; - - foreach (var bodyInfo in this.BodyInfos) - { - // add left and right hand ellipses of all bodies to canvas - this.drawingCanvas.Children.Add(bodyInfo.HandLeftEllipse); - this.drawingCanvas.Children.Add(bodyInfo.HandRightEllipse); - - // add joint ellipses of all bodies to canvas - foreach (var joint in bodyInfo.JointPoints) - { - this.drawingCanvas.Children.Add(joint.Value); - } - - // add bone lines of all bodies to canvas - foreach (var bone in bodyInfo.Bones) - { - this.drawingCanvas.Children.Add(bodyInfo.BoneLines[bone]); - } - } - - // add clipped edges rectanges to main canvas - this.drawingCanvas.Children.Add(this.LeftClipEdge); - this.drawingCanvas.Children.Add(this.RightClipEdge); - this.drawingCanvas.Children.Add(this.TopClipEdge); - this.drawingCanvas.Children.Add(this.BottomClipEdge); - - // position the clipped edges - Canvas.SetLeft(this.LeftClipEdge, 0); - Canvas.SetTop(this.LeftClipEdge, 0); - Canvas.SetLeft(this.RightClipEdge, this.DisplayGrid.Width - ClipBoundsThickness); - Canvas.SetTop(this.RightClipEdge, 0); - Canvas.SetLeft(this.TopClipEdge, 0); - Canvas.SetTop(this.TopClipEdge, 0); - Canvas.SetLeft(this.BottomClipEdge, 0); - Canvas.SetTop(this.BottomClipEdge, this.DisplayGrid.Height - ClipBoundsThickness); - } - - /// - /// BodyInfo class that contains joint ellipses, handstate ellipses, lines for bones between two joints. - /// - private class BodyInfo - { - public bool Updated { get; set; } - - public Color BodyColor { get; set; } - - // ellipse representing left handstate - public Ellipse HandLeftEllipse { get; set; } - - // ellipse representing right handstate - public Ellipse HandRightEllipse { get; set; } - - // dictionary of all joints in a body - public Dictionary JointPoints { get; private set; } - - // definition of bones - public TupleList Bones { get; private set; } - - // collection of bones associated with the line object - public Dictionary, Line> BoneLines { get; private set; } - - public BodyInfo(Color bodyColor) - { - this.BodyColor = bodyColor; - - // create hand state ellipses - this.HandLeftEllipse = new Ellipse() - { - Visibility = Windows.UI.Xaml.Visibility.Collapsed - }; - - this.HandRightEllipse = new Ellipse() - { - Visibility = Windows.UI.Xaml.Visibility.Collapsed - }; - - // a joint defined as a jointType with a point location in XY space represented by an ellipse - this.JointPoints = new Dictionary(); - - // pre-populate list of joints and set to non-visible initially - foreach (JointType jointType in Enum.GetValues(typeof(JointType))) - { - this.JointPoints.Add(jointType, new Ellipse() - { - Visibility = Windows.UI.Xaml.Visibility.Collapsed, - Fill = new SolidColorBrush(BodyColor), - Width = JointThickness, - Height = JointThickness - }); - } - - // collection of bones - this.BoneLines = new Dictionary, Line>(); - - // a bone defined as a line between two joints - this.Bones = new TupleList - { - // Torso - { JointType.Head, JointType.Neck }, - { JointType.Neck, JointType.SpineShoulder }, - { JointType.SpineShoulder, JointType.SpineMid }, - { JointType.SpineMid, JointType.SpineBase }, - { JointType.SpineShoulder, JointType.ShoulderRight }, - { JointType.SpineShoulder, JointType.ShoulderLeft }, - { JointType.SpineBase, JointType.HipRight }, - { JointType.SpineBase, JointType.HipLeft }, - - // Right Arm - { JointType.ShoulderRight, JointType.ElbowRight }, - { JointType.ElbowRight, JointType.WristRight }, - { JointType.WristRight, JointType.HandRight }, - { JointType.HandRight, JointType.HandTipRight }, - { JointType.WristRight, JointType.ThumbRight }, - - // Left Arm - { JointType.ShoulderLeft, JointType.ElbowLeft }, - { JointType.ElbowLeft, JointType.WristLeft }, - { JointType.WristLeft, JointType.HandLeft }, - { JointType.HandLeft, JointType.HandTipLeft }, - { JointType.WristLeft, JointType.ThumbLeft }, - - // Right Leg - { JointType.HipRight, JointType.KneeRight }, - { JointType.KneeRight, JointType.AnkleRight }, - { JointType.AnkleRight, JointType.FootRight }, - - // Left Leg - { JointType.HipLeft, JointType.KneeLeft }, - { JointType.KneeLeft, JointType.AnkleLeft }, - { JointType.AnkleLeft, JointType.FootLeft }, - }; - - // pre-populate list of bones that are non-visible initially - foreach (var bone in this.Bones) - { - this.BoneLines.Add(bone, new Line() - { - Stroke = new SolidColorBrush(BodyColor), - Visibility = Visibility.Collapsed - }); - } - } - } - - private class TupleList : List> - { - public void Add(T1 item, T2 item2) - { - this.Add(new Tuple(item, item2)); - } - } - - /// - /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged). - /// - /// object sending the event - /// event arguments - private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e) - { - // on failure, set the status text - if (!this.kinectSensor.IsAvailable) - { - this.StatusText = resourceLoader.GetString("SensorNotAvailableStatusText"); - } - else - { - this.StatusText = resourceLoader.GetString("RunningStatusText"); - } - } - } -} diff --git a/Resources/BodyBasics-XAML/Package.appxmanifest b/Resources/BodyBasics-XAML/Package.appxmanifest deleted file mode 100644 index 7a08c5d..0000000 --- a/Resources/BodyBasics-XAML/Package.appxmanifest +++ /dev/null @@ -1,29 +0,0 @@ - - - - - BodyBasics-XAML - Kinect for Windows Samples - Assets\StoreLogo.png - - - 6.2.1 - 6.2.1 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Resources/BodyBasics-XAML/Properties/AssemblyInfo.cs b/Resources/BodyBasics-XAML/Properties/AssemblyInfo.cs deleted file mode 100644 index e8fc4eb..0000000 --- a/Resources/BodyBasics-XAML/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BodyBasics-XAML")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BodyBasics-XAML")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Resources/BodyBasics-XAML/Resources.resw b/Resources/BodyBasics-XAML/Resources.resw deleted file mode 100644 index eaf9553..0000000 --- a/Resources/BodyBasics-XAML/Resources.resw +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - No ready Kinect found! - - - Running - - - Kinect not available! - - - FPS= {0:N1} Time = {1} - - \ No newline at end of file diff --git a/Resources/ColorBasics-XAML/App.xaml b/Resources/ColorBasics-XAML/App.xaml deleted file mode 100644 index 1ae1998..0000000 --- a/Resources/ColorBasics-XAML/App.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - diff --git a/Resources/ColorBasics-XAML/App.xaml.cs b/Resources/ColorBasics-XAML/App.xaml.cs deleted file mode 100644 index 05201fb..0000000 --- a/Resources/ColorBasics-XAML/App.xaml.cs +++ /dev/null @@ -1,108 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; - -namespace Microsoft.Samples.Kinect.ColorBasics -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - sealed partial class App : Application - { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - this.Suspending += OnSuspending; - } - - /// - /// Invoked when the application is launched normally by the end user. Other entry points - /// will be used when the application is launched to open a specific file, to display - /// search results, and so forth. - /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs args) - { - -#if DEBUG - if (System.Diagnostics.Debugger.IsAttached) - { - this.DebugSettings.EnableFrameRateCounter = true; - } -#endif - - Frame rootFrame = Window.Current.Content as Frame; - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == null) - { - // Create a Frame to act as the navigation context and navigate to the first page - rootFrame = new Frame(); - - // Set the default language - rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; - - rootFrame.NavigationFailed += OnNavigationFailed; - - if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) - { - //TODO: Load state from previously suspended application - } - - // Place the frame in the current Window - Window.Current.Content = rootFrame; - } - - if (rootFrame.Content == null) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - if (!rootFrame.Navigate(typeof(MainPage), args.Arguments)) - { - throw new Exception("Failed to create initial page"); - } - } - // Ensure the current window is active - Window.Current.Activate(); - } - - /// - /// Invoked when Navigation to a certain page fails - /// - /// The Frame which failed navigation - /// Details about the navigation failure - void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - } - - /// - /// Invoked when application execution is being suspended. Application state is saved - /// without knowing whether the application will be terminated or resumed with the contents - /// of memory still intact. - /// - /// The source of the suspend request. - /// Details about the suspend request. - private void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - //TODO: Save application state and stop any background activity - deferral.Complete(); - } - } -} diff --git a/Resources/ColorBasics-XAML/Assets/Logo.png b/Resources/ColorBasics-XAML/Assets/Logo.png deleted file mode 100644 index e26771c..0000000 Binary files a/Resources/ColorBasics-XAML/Assets/Logo.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/Assets/SmallLogo.png b/Resources/ColorBasics-XAML/Assets/SmallLogo.png deleted file mode 100644 index 1eb0d9d..0000000 Binary files a/Resources/ColorBasics-XAML/Assets/SmallLogo.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-100.png b/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-100.png deleted file mode 100644 index 0fa37e6..0000000 Binary files a/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-100.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-140.png b/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-140.png deleted file mode 100644 index 7734119..0000000 Binary files a/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-140.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-180.png b/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-180.png deleted file mode 100644 index 958dba4..0000000 Binary files a/Resources/ColorBasics-XAML/Assets/SplashScreen.scale-180.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/Assets/StoreLogo.png b/Resources/ColorBasics-XAML/Assets/StoreLogo.png deleted file mode 100644 index dcb6727..0000000 Binary files a/Resources/ColorBasics-XAML/Assets/StoreLogo.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/ColorBasics-XAML.csproj b/Resources/ColorBasics-XAML/ColorBasics-XAML.csproj deleted file mode 100644 index a813a1f..0000000 --- a/Resources/ColorBasics-XAML/ColorBasics-XAML.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Debug - x86 - {7775112C-5F13-4C95-A095-69D1852A7CAA} - AppContainerExe - Properties - ColorBasics_XAML - ColorBasics-XAML - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ColorBasics-XAML_TemporaryKey.pfx - True - A57D8A6618953508D60FE39FF19F61E80A2257F4 - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - true - - - - App.xaml - - - MainPage.xaml - - - - - - Designer - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - - - - Microsoft Visual C++ Runtime Package - - - WindowsPreview.Kinect - - - - 11.0 - - - - - \ No newline at end of file diff --git a/Resources/ColorBasics-XAML/ColorBasics-XAML.sln b/Resources/ColorBasics-XAML/ColorBasics-XAML.sln deleted file mode 100644 index b37cfad..0000000 --- a/Resources/ColorBasics-XAML/ColorBasics-XAML.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorBasics-XAML", "ColorBasics-XAML.csproj", "{7775112C-5F13-4C95-A095-69D1852A7CAA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Debug|x64.ActiveCfg = Debug|x64 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Debug|x64.Build.0 = Debug|x64 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Debug|x64.Deploy.0 = Debug|x64 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Debug|x86.ActiveCfg = Debug|x86 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Debug|x86.Build.0 = Debug|x86 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Debug|x86.Deploy.0 = Debug|x86 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Release|x64.ActiveCfg = Release|x64 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Release|x64.Build.0 = Release|x64 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Release|x64.Deploy.0 = Release|x64 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Release|x86.ActiveCfg = Release|x86 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Release|x86.Build.0 = Release|x86 - {7775112C-5F13-4C95-A095-69D1852A7CAA}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Resources/ColorBasics-XAML/Common/StandardStyles.xaml b/Resources/ColorBasics-XAML/Common/StandardStyles.xaml deleted file mode 100644 index 9e0a2e8..0000000 --- a/Resources/ColorBasics-XAML/Common/StandardStyles.xaml +++ /dev/null @@ -1,1829 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mouse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/ColorBasics-XAML/Images/Kinect.ico b/Resources/ColorBasics-XAML/Images/Kinect.ico deleted file mode 100644 index db8b818..0000000 Binary files a/Resources/ColorBasics-XAML/Images/Kinect.ico and /dev/null differ diff --git a/Resources/ColorBasics-XAML/Images/Logo.png b/Resources/ColorBasics-XAML/Images/Logo.png deleted file mode 100644 index 4b3a5ab..0000000 Binary files a/Resources/ColorBasics-XAML/Images/Logo.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/Images/Status.png b/Resources/ColorBasics-XAML/Images/Status.png deleted file mode 100644 index 7dc48bd..0000000 Binary files a/Resources/ColorBasics-XAML/Images/Status.png and /dev/null differ diff --git a/Resources/ColorBasics-XAML/MainPage.xaml b/Resources/ColorBasics-XAML/MainPage.xaml deleted file mode 100644 index 720aad0..0000000 --- a/Resources/ColorBasics-XAML/MainPage.xaml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - Color Basics - - - - - - - - - - - - \ No newline at end of file diff --git a/Resources/ColorBasics-XAML/MainPage.xaml.cs b/Resources/ColorBasics-XAML/MainPage.xaml.cs deleted file mode 100644 index be49257..0000000 --- a/Resources/ColorBasics-XAML/MainPage.xaml.cs +++ /dev/null @@ -1,205 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System.ComponentModel; -using System.IO; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.ApplicationModel.Resources; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media.Imaging; -using WindowsPreview.Kinect; - -namespace Microsoft.Samples.Kinect.ColorBasics -{ - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class MainPage : Page, INotifyPropertyChanged - { - /// - /// Resource loader for string resources - /// - private ResourceLoader resourceLoader = new ResourceLoader("Resources"); - - /// - /// Size of the RGB pixel in the bitmap - /// - private readonly uint bytesPerPixel; - - /// - /// Active Kinect sensor - /// - private KinectSensor kinectSensor = null; - - /// - /// Reader for color frames - /// - private ColorFrameReader colorFrameReader = null; - - /// - /// Bitmap to display - /// - private WriteableBitmap bitmap = null; - - /// - /// Intermediate storage for receiving frame data from the sensor - /// - private byte[] colorPixels = null; - - /// - /// Current status text to display - /// - private string statusText = null; - - /// - /// Initializes a new instance of the MainPage class. - /// - public MainPage() - { - // get the kinectSensor object - this.kinectSensor = KinectSensor.GetDefault(); - - // open the reader for the color frames - this.colorFrameReader = this.kinectSensor.ColorFrameSource.OpenReader(); - - // wire handler for frame arrival - this.colorFrameReader.FrameArrived += this.Reader_ColorFrameArrived; - - // create the colorFrameDescription from the ColorFrameSource using rgba format - FrameDescription colorFrameDescription = this.kinectSensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Rgba); - - // rgba is 4 bytes per pixel - this.bytesPerPixel = colorFrameDescription.BytesPerPixel; - - // allocate space to put the pixels to be rendered - this.colorPixels = new byte[colorFrameDescription.Width * colorFrameDescription.Height * this.bytesPerPixel]; - - // create the bitmap to display - this.bitmap = new WriteableBitmap(colorFrameDescription.Width, colorFrameDescription.Height); - - // set IsAvailableChanged event notifier - this.kinectSensor.IsAvailableChanged += this.Sensor_IsAvailableChanged; - - // open the sensor - this.kinectSensor.Open(); - - // set the status text - this.StatusText = this.kinectSensor.IsAvailable ? resourceLoader.GetString("RunningStatusText") - : resourceLoader.GetString("NoSensorStatusText"); - - // use the window object as the view model in this simple example - this.DataContext = this; - - // initialize the components (controls) of the window - this.InitializeComponent(); - theImage.Source = this.bitmap; - } - - /// - /// INotifyPropertyChangedPropertyChanged event to allow window controls to bind to changeable data. - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Gets or sets the current status text to display - /// - public string StatusText - { - get - { - return this.statusText; - } - - set - { - if (this.statusText != value) - { - this.statusText = value; - - // notify any bound elements that the text has changed - if (this.PropertyChanged != null) - { - this.PropertyChanged(this, new PropertyChangedEventArgs("StatusText")); - } - } - } - } - - /// - /// Execute shutdown tasks. - /// - /// object sending the event - /// event arguments - private void MainPage_Unloaded(object sender, RoutedEventArgs e) - { - if (this.colorFrameReader != null) - { - // ColorFrameReder is IDisposable - this.colorFrameReader.Dispose(); - this.colorFrameReader = null; - } - - if (this.kinectSensor != null) - { - this.kinectSensor.Close(); - this.kinectSensor = null; - } - } - - /// - /// Handles the color frame data arriving from the sensor. - /// - /// object sending the event - /// event arguments - private void Reader_ColorFrameArrived(object sender, ColorFrameArrivedEventArgs e) - { - bool colorFrameProcessed = false; - - // ColorFrame is IDisposable - using (ColorFrame colorFrame = e.FrameReference.AcquireFrame()) - { - if (colorFrame != null) - { - FrameDescription colorFrameDescription = colorFrame.FrameDescription; - - // verify data and write the new color frame data to the Writeable bitmap - if ((colorFrameDescription.Width == this.bitmap.PixelWidth) && (colorFrameDescription.Height == this.bitmap.PixelHeight)) - { - if (colorFrame.RawColorImageFormat == ColorImageFormat.Bgra) - { - colorFrame.CopyRawFrameDataToBuffer(this.bitmap.PixelBuffer); - } - else - { - colorFrame.CopyConvertedFrameDataToBuffer(this.bitmap.PixelBuffer, ColorImageFormat.Bgra); - } - - colorFrameProcessed = true; - } - } - } - - // we got a frame, render - if (colorFrameProcessed) - { - this.bitmap.Invalidate(); - } - } - - /// - /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged). - /// - /// object sending the event - /// event arguments - private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e) - { - // on failure, set the status text - this.StatusText = this.kinectSensor.IsAvailable ? resourceLoader.GetString("RunningStatusText") - : resourceLoader.GetString("SensorNotAvailableStatusText"); - } - } -} diff --git a/Resources/ColorBasics-XAML/Package.appxmanifest b/Resources/ColorBasics-XAML/Package.appxmanifest deleted file mode 100644 index 5311baf..0000000 --- a/Resources/ColorBasics-XAML/Package.appxmanifest +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - ColorBasics-XAML - Kinect for Windows Samples - Assets\StoreLogo.png - - - - 6.2.1 - 6.2.1 - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/ColorBasics-XAML/Properties/AssemblyInfo.cs b/Resources/ColorBasics-XAML/Properties/AssemblyInfo.cs deleted file mode 100644 index c86c111..0000000 --- a/Resources/ColorBasics-XAML/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ColorBasics-XAML")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ColorBasics-XAML")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Resources/ColorBasics-XAML/Resources.resw b/Resources/ColorBasics-XAML/Resources.resw deleted file mode 100644 index eaf9553..0000000 --- a/Resources/ColorBasics-XAML/Resources.resw +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - No ready Kinect found! - - - Running - - - Kinect not available! - - - FPS= {0:N1} Time = {1} - - \ No newline at end of file diff --git a/Resources/DepthBasics-XAML/App.xaml b/Resources/DepthBasics-XAML/App.xaml deleted file mode 100644 index 62b9423..0000000 --- a/Resources/DepthBasics-XAML/App.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - diff --git a/Resources/DepthBasics-XAML/App.xaml.cs b/Resources/DepthBasics-XAML/App.xaml.cs deleted file mode 100644 index 4dcaa11..0000000 --- a/Resources/DepthBasics-XAML/App.xaml.cs +++ /dev/null @@ -1,109 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; - -namespace Microsoft.Samples.Kinect.DepthBasics -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - sealed partial class App : Application - { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - this.Suspending += OnSuspending; - } - - /// - /// Invoked when the application is launched normally by the end user. Other entry points - /// will be used when the application is launched to open a specific file, to display - /// search results, and so forth. - /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs args) - { - -#if DEBUG - if (System.Diagnostics.Debugger.IsAttached) - { - this.DebugSettings.EnableFrameRateCounter = true; - } -#endif - - Frame rootFrame = Window.Current.Content as Frame; - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == null) - { - // Create a Frame to act as the navigation context and navigate to the first page - rootFrame = new Frame(); - - // Set the default language - rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; - - rootFrame.NavigationFailed += OnNavigationFailed; - - - if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) - { - //TODO: Load state from previously suspended application - } - - // Place the frame in the current Window - Window.Current.Content = rootFrame; - } - - if (rootFrame.Content == null) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - if (!rootFrame.Navigate(typeof(MainPage), args.Arguments)) - { - throw new Exception("Failed to create initial page"); - } - } - // Ensure the current window is active - Window.Current.Activate(); - } - - /// - /// Invoked when Navigation to a certain page fails - /// - /// The Frame which failed navigation - /// Details about the navigation failure - void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - } - - /// - /// Invoked when application execution is being suspended. Application state is saved - /// without knowing whether the application will be terminated or resumed with the contents - /// of memory still intact. - /// - /// The source of the suspend request. - /// Details about the suspend request. - private void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - //TODO: Save application state and stop any background activity - deferral.Complete(); - } - } -} diff --git a/Resources/DepthBasics-XAML/Assets/Logo.png b/Resources/DepthBasics-XAML/Assets/Logo.png deleted file mode 100644 index e26771c..0000000 Binary files a/Resources/DepthBasics-XAML/Assets/Logo.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Assets/SmallLogo.png b/Resources/DepthBasics-XAML/Assets/SmallLogo.png deleted file mode 100644 index 1eb0d9d..0000000 Binary files a/Resources/DepthBasics-XAML/Assets/SmallLogo.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-100.png b/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-100.png deleted file mode 100644 index 0fa37e6..0000000 Binary files a/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-100.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-140.png b/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-140.png deleted file mode 100644 index 7734119..0000000 Binary files a/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-140.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-180.png b/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-180.png deleted file mode 100644 index 958dba4..0000000 Binary files a/Resources/DepthBasics-XAML/Assets/SplashScreen.scale-180.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Assets/StoreLogo.png b/Resources/DepthBasics-XAML/Assets/StoreLogo.png deleted file mode 100644 index dcb6727..0000000 Binary files a/Resources/DepthBasics-XAML/Assets/StoreLogo.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Common/StandardStyles.xaml b/Resources/DepthBasics-XAML/Common/StandardStyles.xaml deleted file mode 100644 index 9e0a2e8..0000000 --- a/Resources/DepthBasics-XAML/Common/StandardStyles.xaml +++ /dev/null @@ -1,1829 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mouse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/DepthBasics-XAML/DepthBasics-XAML.csproj b/Resources/DepthBasics-XAML/DepthBasics-XAML.csproj deleted file mode 100644 index 7f3d0a5..0000000 --- a/Resources/DepthBasics-XAML/DepthBasics-XAML.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Debug - AnyCPU - {2861D2C8-9DD8-4D70-A364-F274A66BE96A} - AppContainerExe - Properties - DepthBasics_XAML - DepthBasics-XAML - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - DepthBasics-XAML_TemporaryKey.pfx - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - true - - - - App.xaml - - - MainPage.xaml - - - - - - Designer - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - Microsoft Visual C++ Runtime Package - - - WindowsPreview.Kinect - - - - 11.0 - - - - \ No newline at end of file diff --git a/Resources/DepthBasics-XAML/DepthBasics-XAML.sln b/Resources/DepthBasics-XAML/DepthBasics-XAML.sln deleted file mode 100644 index aec29e8..0000000 --- a/Resources/DepthBasics-XAML/DepthBasics-XAML.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DepthBasics-XAML", "DepthBasics-XAML.csproj", "{2861D2C8-9DD8-4D70-A364-F274A66BE96A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Debug|x64.ActiveCfg = Debug|x64 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Debug|x64.Build.0 = Debug|x64 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Debug|x64.Deploy.0 = Debug|x64 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Debug|x86.ActiveCfg = Debug|x86 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Debug|x86.Build.0 = Debug|x86 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Debug|x86.Deploy.0 = Debug|x86 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Release|x64.ActiveCfg = Release|x64 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Release|x64.Build.0 = Release|x64 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Release|x64.Deploy.0 = Release|x64 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Release|x86.ActiveCfg = Release|x86 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Release|x86.Build.0 = Release|x86 - {2861D2C8-9DD8-4D70-A364-F274A66BE96A}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Resources/DepthBasics-XAML/Images/Kinect.ico b/Resources/DepthBasics-XAML/Images/Kinect.ico deleted file mode 100644 index db8b818..0000000 Binary files a/Resources/DepthBasics-XAML/Images/Kinect.ico and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Images/Logo.png b/Resources/DepthBasics-XAML/Images/Logo.png deleted file mode 100644 index 4b3a5ab..0000000 Binary files a/Resources/DepthBasics-XAML/Images/Logo.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/Images/Status.png b/Resources/DepthBasics-XAML/Images/Status.png deleted file mode 100644 index 7dc48bd..0000000 Binary files a/Resources/DepthBasics-XAML/Images/Status.png and /dev/null differ diff --git a/Resources/DepthBasics-XAML/MainPage.xaml b/Resources/DepthBasics-XAML/MainPage.xaml deleted file mode 100644 index 1fb6f43..0000000 --- a/Resources/DepthBasics-XAML/MainPage.xaml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - Depth Basics - - - - - - - - - - - diff --git a/Resources/DepthBasics-XAML/MainPage.xaml.cs b/Resources/DepthBasics-XAML/MainPage.xaml.cs deleted file mode 100644 index 9879855..0000000 --- a/Resources/DepthBasics-XAML/MainPage.xaml.cs +++ /dev/null @@ -1,267 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System.ComponentModel; -using System.IO; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.ApplicationModel.Resources; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media.Imaging; -using WindowsPreview.Kinect; - -namespace Microsoft.Samples.Kinect.DepthBasics -{ - /// - /// Main page for sample - /// - public sealed partial class MainPage : Page, INotifyPropertyChanged - { - /// - /// Map depth range to byte range - /// - private const int MapDepthToByte = 8000 / 256; - - /// - /// Resource loader for string resources - /// -#if WIN81ORLATER - private ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView("Resources"); -#else - private ResourceLoader resourceLoader = new ResourceLoader("Resources"); -#endif - - - /// - /// Size of the RGB pixel in the bitmap - /// - private readonly int cbytesPerPixel = 4; - - /// - /// Active Kinect sensor - /// - private KinectSensor kinectSensor = null; - - /// - /// Reader for depth frames - /// - private DepthFrameReader depthFrameReader = null; - - /// - /// Bitmap to display - /// - private WriteableBitmap bitmap = null; - - /// - /// Intermediate storage for receiving frame data from the sensor - /// - private ushort[] depthFrameData = null; - - /// - /// Intermediate storage for frame data converted to color - /// - private byte[] depthPixels = null; - - /// - /// Current status text to display - /// - private string statusText = null; - - /// - /// Initializes a new instance of the MainPage class. - /// - public MainPage() - { - // get the kinectSensor object - this.kinectSensor = KinectSensor.GetDefault(); - - // get the depthFrameDescription from the DepthFrameSource - FrameDescription depthFrameDescription = this.kinectSensor.DepthFrameSource.FrameDescription; - - // open the reader for the depth frames - this.depthFrameReader = this.kinectSensor.DepthFrameSource.OpenReader(); - - // wire handler for frame arrival - this.depthFrameReader.FrameArrived += this.Reader_DepthFrameArrived; - - // allocate space to put the pixels being received and converted - this.depthFrameData = new ushort[depthFrameDescription.Width * depthFrameDescription.Height]; - this.depthPixels = new byte[depthFrameDescription.Width * depthFrameDescription.Height * this.cbytesPerPixel]; - - // create the bitmap to display - this.bitmap = new WriteableBitmap(depthFrameDescription.Width, depthFrameDescription.Height);//, 96.0, 96.0, PixelFormats.Bgr32, null); - - // set IsAvailableChanged event notifier - this.kinectSensor.IsAvailableChanged += this.Sensor_IsAvailableChanged; - - // open the sensor - this.kinectSensor.Open(); - - // set the status text - this.StatusText = this.kinectSensor.IsAvailable ? resourceLoader.GetString("RunningStatusText") - : resourceLoader.GetString("NoSensorStatusText"); - - // use the window object as the view model in this simple example - this.DataContext = this; - - // initialize the components (controls) of the window - this.InitializeComponent(); - } - - /// - /// INotifyPropertyChangedPropertyChanged event to allow window controls to bind to changeable data. - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Gets or sets the current status text to display - /// - public string StatusText - { - get - { - return this.statusText; - } - - set - { - if (this.statusText != value) - { - this.statusText = value; - - // notify any bound elements that the text has changed - if (this.PropertyChanged != null) - { - this.PropertyChanged(this, new PropertyChangedEventArgs("StatusText")); - } - } - } - } - - /// - /// Execute shutdown tasks. - /// - /// object sending the event - /// event arguments - private void MainPage_Unloaded(object sender, RoutedEventArgs e) - { - if (this.depthFrameReader != null) - { - // DepthFrameReder is IDisposable - this.depthFrameReader.Dispose(); - this.depthFrameReader = null; - } - - if (this.kinectSensor != null) - { - this.kinectSensor.Close(); - this.kinectSensor = null; - } - } - - /// - /// Handles the depth frame data arriving from the sensor. - /// - /// object sending the event - /// event arguments - private void Reader_DepthFrameArrived(object sender, DepthFrameArrivedEventArgs e) - { - ushort minDepth = 0; - ushort maxDepth = 0; - - bool depthFrameProcessed = false; - - // DepthFrame is IDisposable - using (DepthFrame depthFrame = e.FrameReference.AcquireFrame()) - { - if (depthFrame != null) - { - FrameDescription depthFrameDescription = depthFrame.FrameDescription; - - // verify data and write the new depth frame data to the display bitmap - if (((depthFrameDescription.Width * depthFrameDescription.Height) == this.depthFrameData.Length) && - (depthFrameDescription.Width == this.bitmap.PixelWidth) && (depthFrameDescription.Height == this.bitmap.PixelHeight)) - { - // Copy the pixel data from the image to a temporary array - depthFrame.CopyFrameDataToArray(this.depthFrameData); - - minDepth = depthFrame.DepthMinReliableDistance; - - // Note: In order to see the full range of depth (including the less reliable far field depth) - // we are setting maxDepth to the extreme potential depth threshold - maxDepth = ushort.MaxValue; - - // If you wish to filter by reliable depth distance, uncomment the following line: - //// maxDepth = depthFrame.DepthMaxReliableDistance - - depthFrameProcessed = true; - } - } - } - - // we got a frame, convert and render - if (depthFrameProcessed) - { - ConvertDepthData(minDepth, maxDepth); - - RenderDepthPixels(this.depthPixels); - } - } - - /// - /// Converts depth to RGB. - /// - /// - private void ConvertDepthData(ushort minDepth, ushort maxDepth) - { - int colorPixelIndex = 0; - for (int i = 0; i < this.depthFrameData.Length; ++i) - { - // Get the depth for this pixel - ushort depth = this.depthFrameData[i]; - - // To convert to a byte, we're mapping the depth value to the byte range. - // Values outside the reliable depth range are mapped to 0 (black). - byte intensity = (byte)(depth >= minDepth && depth <= maxDepth ? (depth / MapDepthToByte) : 0); - - // Write out blue byte - this.depthPixels[colorPixelIndex++] = intensity; - - // Write out green byte - this.depthPixels[colorPixelIndex++] = intensity; - - // Write out red byte - this.depthPixels[colorPixelIndex++] = intensity; - - // Write out alpha byte - this.depthPixels[colorPixelIndex++] = 255; - } - } - - /// - /// Renders color pixels into the writeableBitmap. - /// - /// pixel data - private void RenderDepthPixels(byte[] pixels) - { - pixels.CopyTo(this.bitmap.PixelBuffer); - this.bitmap.Invalidate(); - theImage.Source = this.bitmap; - } - - /// - /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged). - /// - /// object sending the event - /// event arguments - private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e) - { - // on failure, set the status text - this.StatusText = this.kinectSensor.IsAvailable ? resourceLoader.GetString("RunningStatusText") - : resourceLoader.GetString("SensorNotAvailableStatusText"); - } - } -} diff --git a/Resources/DepthBasics-XAML/Package.appxmanifest b/Resources/DepthBasics-XAML/Package.appxmanifest deleted file mode 100644 index f78c3f4..0000000 --- a/Resources/DepthBasics-XAML/Package.appxmanifest +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - DepthBasics-XAML - Kinect for Windows Samples - Assets\StoreLogo.png - - - - 6.2.1 - 6.2.1 - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/DepthBasics-XAML/Properties/AssemblyInfo.cs b/Resources/DepthBasics-XAML/Properties/AssemblyInfo.cs deleted file mode 100644 index 8f1888c..0000000 --- a/Resources/DepthBasics-XAML/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DepthBasics-XAML")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("DepthBasics-XAML")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Resources/DepthBasics-XAML/Resources.resw b/Resources/DepthBasics-XAML/Resources.resw deleted file mode 100644 index eaf9553..0000000 --- a/Resources/DepthBasics-XAML/Resources.resw +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - No ready Kinect found! - - - Running - - - Kinect not available! - - - FPS= {0:N1} Time = {1} - - \ No newline at end of file diff --git a/Resources/InfraredBasics-XAML/App.xaml b/Resources/InfraredBasics-XAML/App.xaml deleted file mode 100644 index 406157f..0000000 --- a/Resources/InfraredBasics-XAML/App.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - diff --git a/Resources/InfraredBasics-XAML/App.xaml.cs b/Resources/InfraredBasics-XAML/App.xaml.cs deleted file mode 100644 index 0eda091..0000000 --- a/Resources/InfraredBasics-XAML/App.xaml.cs +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; - -namespace Microsoft.Samples.Kinect.InfraredBasics -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - sealed partial class App : Application - { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - this.Suspending += OnSuspending; - } - - /// - /// Invoked when the application is launched normally by the end user. Other entry points - /// will be used such as when the application is launched to open a specific file. - /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs e) - { - -#if DEBUG - if (System.Diagnostics.Debugger.IsAttached) - { - this.DebugSettings.EnableFrameRateCounter = true; - } -#endif - - Frame rootFrame = Window.Current.Content as Frame; - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == null) - { - // Create a Frame to act as the navigation context and navigate to the first page - rootFrame = new Frame(); - // Set the default language - rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; - - rootFrame.NavigationFailed += OnNavigationFailed; - - if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) - { - //TODO: Load state from previously suspended application - } - - // Place the frame in the current Window - Window.Current.Content = rootFrame; - } - - if (rootFrame.Content == null) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - rootFrame.Navigate(typeof(MainPage), e.Arguments); - } - // Ensure the current window is active - Window.Current.Activate(); - } - - /// - /// Invoked when Navigation to a certain page fails - /// - /// The Frame which failed navigation - /// Details about the navigation failure - void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - } - - /// - /// Invoked when application execution is being suspended. Application state is saved - /// without knowing whether the application will be terminated or resumed with the contents - /// of memory still intact. - /// - /// The source of the suspend request. - /// Details about the suspend request. - private void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - //TODO: Save application state and stop any background activity - deferral.Complete(); - } - } -} diff --git a/Resources/InfraredBasics-XAML/Assets/Logo.png b/Resources/InfraredBasics-XAML/Assets/Logo.png deleted file mode 100644 index e26771c..0000000 Binary files a/Resources/InfraredBasics-XAML/Assets/Logo.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Assets/SmallLogo.png b/Resources/InfraredBasics-XAML/Assets/SmallLogo.png deleted file mode 100644 index 1eb0d9d..0000000 Binary files a/Resources/InfraredBasics-XAML/Assets/SmallLogo.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-100.png b/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-100.png deleted file mode 100644 index 0fa37e6..0000000 Binary files a/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-100.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-140.png b/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-140.png deleted file mode 100644 index 7734119..0000000 Binary files a/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-140.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-180.png b/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-180.png deleted file mode 100644 index 958dba4..0000000 Binary files a/Resources/InfraredBasics-XAML/Assets/SplashScreen.scale-180.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Assets/StoreLogo.png b/Resources/InfraredBasics-XAML/Assets/StoreLogo.png deleted file mode 100644 index dcb6727..0000000 Binary files a/Resources/InfraredBasics-XAML/Assets/StoreLogo.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Common/StandardStyles.xaml b/Resources/InfraredBasics-XAML/Common/StandardStyles.xaml deleted file mode 100644 index 9e0a2e8..0000000 --- a/Resources/InfraredBasics-XAML/Common/StandardStyles.xaml +++ /dev/null @@ -1,1829 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mouse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/InfraredBasics-XAML/Images/Kinect.ico b/Resources/InfraredBasics-XAML/Images/Kinect.ico deleted file mode 100644 index db8b818..0000000 Binary files a/Resources/InfraredBasics-XAML/Images/Kinect.ico and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Images/Logo.png b/Resources/InfraredBasics-XAML/Images/Logo.png deleted file mode 100644 index 4b3a5ab..0000000 Binary files a/Resources/InfraredBasics-XAML/Images/Logo.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/Images/Status.png b/Resources/InfraredBasics-XAML/Images/Status.png deleted file mode 100644 index 7dc48bd..0000000 Binary files a/Resources/InfraredBasics-XAML/Images/Status.png and /dev/null differ diff --git a/Resources/InfraredBasics-XAML/InfraredBasics-XAML.csproj b/Resources/InfraredBasics-XAML/InfraredBasics-XAML.csproj deleted file mode 100644 index b99010f..0000000 --- a/Resources/InfraredBasics-XAML/InfraredBasics-XAML.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Debug - x86 - {C5BB9835-588E-41A0-A722-CB66863E7AAF} - AppContainerExe - Properties - InfraredBasics_XAML - InfraredBasics-XAML - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - InfraredBasics-XAML_TemporaryKey.pfx - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - true - - - - App.xaml - - - MainPage.xaml - - - - - - Designer - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - Microsoft Visual C++ Runtime Package - - - WindowsPreview.Kinect - - - - 11.0 - - - - \ No newline at end of file diff --git a/Resources/InfraredBasics-XAML/InfraredBasics-XAML.sln b/Resources/InfraredBasics-XAML/InfraredBasics-XAML.sln deleted file mode 100644 index 843583c..0000000 --- a/Resources/InfraredBasics-XAML/InfraredBasics-XAML.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InfraredBasics-XAML", "InfraredBasics-XAML.csproj", "{C5BB9835-588E-41A0-A722-CB66863E7AAF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Debug|x86.ActiveCfg = Debug|x86 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Debug|x86.Build.0 = Debug|x86 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Debug|x86.Deploy.0 = Debug|x86 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Release|x86.ActiveCfg = Release|x86 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Release|x86.Build.0 = Release|x86 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Release|x86.Deploy.0 = Release|x86 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Debug|x64.ActiveCfg = Debug|x64 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Debug|x64.Build.0 = Debug|x64 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Debug|x64.Deploy.0 = Debug|x64 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Release|x64.ActiveCfg = Release|x64 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Release|x64.Build.0 = Release|x64 - {C5BB9835-588E-41A0-A722-CB66863E7AAF}.Release|x64.Deploy.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Resources/InfraredBasics-XAML/MainPage.xaml b/Resources/InfraredBasics-XAML/MainPage.xaml deleted file mode 100644 index 72bb44b..0000000 --- a/Resources/InfraredBasics-XAML/MainPage.xaml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - Infrared Basics - - - - - - - - - - diff --git a/Resources/InfraredBasics-XAML/MainPage.xaml.cs b/Resources/InfraredBasics-XAML/MainPage.xaml.cs deleted file mode 100644 index 2c3b38f..0000000 --- a/Resources/InfraredBasics-XAML/MainPage.xaml.cs +++ /dev/null @@ -1,289 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.IO; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.ApplicationModel.Resources; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media.Imaging; -using WindowsPreview.Kinect; - -namespace Microsoft.Samples.Kinect.InfraredBasics -{ - /// - /// Main page for sample - /// - public sealed partial class MainPage : Page, INotifyPropertyChanged - { - /// - /// InfraredSourceValueMaximum is the highest value that can be returned in the InfraredFrame. - /// It is cast to a float for readability in the visualization code. - /// - private const float InfraredSourceValueMaximum = (float)ushort.MaxValue; - - /// - /// The InfraredOutputValueMinimum value is used to set the lower limit, post processing, of the - /// infrared data that we will render. - /// Increasing or decreasing this value sets a brightness "wall" either closer or further away. - /// - private const float InfraredOutputValueMinimum = 0.01f; - - /// - /// The InfraredOutputValueMaximum value is the upper limit, post processing, of the - /// infrared data that we will render. - /// - private const float InfraredOutputValueMaximum = 1.0f; - - /// - /// The InfraredSceneValueAverage value specifies the average infrared value of the scene. - /// This value was selected by analyzing the average pixel intensity for a given scene. - /// Depending on the visualization requirements for a given application, this value can be - /// hard coded, as was done here, or calculated by averaging the intensity for each pixel prior - /// to rendering. - /// - private const float InfraredSceneValueAverage = 0.08f; - - /// - /// The InfraredSceneStandardDeviations value specifies the number of standard deviations - /// to apply to InfraredSceneValueAverage. This value was selected by analyzing data - /// from a given scene. - /// Depending on the visualization requirements for a given application, this value can be - /// hard coded, as was done here, or calculated at runtime. - /// - private const float InfraredSceneStandardDeviations = 3.0f; - - /// - /// Size of the RGB pixel in the bitmap - /// - private const int BytesPerPixel = 4; - - /// - /// Resource loader for string resources - /// -#if WIN81ORLATER - private ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView("Resources"); -#else - private ResourceLoader resourceLoader = new ResourceLoader("Resources"); -#endif - - /// - /// Active Kinect sensor - /// - private KinectSensor kinectSensor = null; - - /// - /// Reader for infrared frames - /// - private InfraredFrameReader infraredFrameReader = null; - - /// - /// Bitmap to display - /// - private WriteableBitmap bitmap = null; - - /// - /// Intermediate storage for receiving frame data from the sensor - /// - private ushort[] infraredFrameData = null; - - /// - /// Intermediate storage for frame data converted to color - /// - private byte[] infraredPixels = null; - - /// - /// Current status text to display - /// - private string statusText = null; - - /// - /// Initializes a new instance of the MainPage class. - /// - public MainPage() - { - // get the kinectSensor object - this.kinectSensor = KinectSensor.GetDefault(); - - // get the infraredFrameDescription from the InfraredFrameSource - FrameDescription infraredFrameDescription = this.kinectSensor.InfraredFrameSource.FrameDescription; - - // open the reader for the infrared frames - this.infraredFrameReader = this.kinectSensor.InfraredFrameSource.OpenReader(); - - // wire handler for frame arrival - this.infraredFrameReader.FrameArrived += this.Reader_InfraredFrameArrived; - - // allocate space to put the pixels being received and converted - this.infraredFrameData = new ushort[infraredFrameDescription.Width * infraredFrameDescription.Height]; - this.infraredPixels = new byte[infraredFrameDescription.Width * infraredFrameDescription.Height * BytesPerPixel]; - - // create the bitmap to display - this.bitmap = new WriteableBitmap(infraredFrameDescription.Width, infraredFrameDescription.Height); - - // set IsAvailableChanged event notifier - this.kinectSensor.IsAvailableChanged += this.Sensor_IsAvailableChanged; - - // open the sensor - this.kinectSensor.Open(); - - // set the status text - this.StatusText = this.kinectSensor.IsAvailable ? resourceLoader.GetString("RunningStatusText") - : resourceLoader.GetString("NoSensorStatusText"); - - // use the window object as the view model in this simple example - this.DataContext = this; - - // initialize the components (controls) of the window - this.InitializeComponent(); - } - - /// - /// INotifyPropertyChangedPropertyChanged event to allow window controls to bind to changeable data. - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Gets or sets the current status text to display - /// - public string StatusText - { - get - { - return this.statusText; - } - - set - { - if (this.statusText != value) - { - this.statusText = value; - - // notify any bound elements that the text has changed - if (this.PropertyChanged != null) - { - this.PropertyChanged(this, new PropertyChangedEventArgs("StatusText")); - } - } - } - } - - /// - /// Execute shutdown tasks. - /// - /// object sending the event - /// event arguments - private void MainPage_Unloaded(object sender, RoutedEventArgs e) - { - if (this.infraredFrameReader != null) - { - // InfraredFrameReder is IDisposable - this.infraredFrameReader.Dispose(); - this.infraredFrameReader = null; - } - - if (this.kinectSensor != null) - { - this.kinectSensor.Close(); - this.kinectSensor = null; - } - } - - /// - /// Handles the infrared frame data arriving from the sensor. - /// - /// object sending the event - /// event arguments - private void Reader_InfraredFrameArrived(object sender, InfraredFrameArrivedEventArgs e) - { - bool infraredFrameProcessed = false; - - // InfraredFrame is IDisposable - using (InfraredFrame infraredFrame = e.FrameReference.AcquireFrame()) - { - if (infraredFrame != null) - { - FrameDescription infraredFrameDescription = infraredFrame.FrameDescription; - - // verify data and write the new infrared frame data to the display bitmap - if (((infraredFrameDescription.Width * infraredFrameDescription.Height) == this.infraredFrameData.Length) && - (infraredFrameDescription.Width == this.bitmap.PixelWidth) && (infraredFrameDescription.Height == this.bitmap.PixelHeight)) - { - // Copy the pixel data from the image to a temporary array - infraredFrame.CopyFrameDataToArray(this.infraredFrameData); - - infraredFrameProcessed = true; - } - } - } - - // we got a frame, convert and render - if (infraredFrameProcessed) - { - this.ConvertInfraredData(); - this.RenderInfraredPixels(this.infraredPixels); - } - } - - /// - /// Convert infrared to RGB. - /// - private void ConvertInfraredData() - { - // Convert the infrared to RGB - int colorPixelIndex = 0; - for (int i = 0; i < this.infraredFrameData.Length; ++i) - { - // normalize the incoming infrared data (ushort) to a float ranging from - // [InfraredOutputValueMinimum, InfraredOutputValueMaximum] by - // 1. dividing the incoming value by the source maximum value - float intensityRatio = (float)this.infraredFrameData[i] / InfraredSourceValueMaximum; - - // 2. dividing by the (average scene value * standard deviations) - intensityRatio /= InfraredSceneValueAverage * InfraredSceneStandardDeviations; - - // 3. limiting the value to InfraredOutputValueMaximum - intensityRatio = Math.Min(InfraredOutputValueMaximum, intensityRatio); - - // 4. limiting the lower value InfraredOutputValueMinimym - intensityRatio = Math.Max(InfraredOutputValueMinimum, intensityRatio); - - // 5. converting the normalized value to a byte and using the result - // as the RGB components required by the image - byte intensity = (byte)(intensityRatio * 255.0f); - this.infraredPixels[colorPixelIndex++] = intensity; - this.infraredPixels[colorPixelIndex++] = intensity; - this.infraredPixels[colorPixelIndex++] = intensity; - this.infraredPixels[colorPixelIndex++] = 255; - } - } - - /// - /// Renders color pixels into the writeableBitmap. - /// - /// pixel data - private void RenderInfraredPixels(byte[] pixels) - { - pixels.CopyTo(this.bitmap.PixelBuffer); - this.bitmap.Invalidate(); - theImage.Source = this.bitmap; - } - - /// - /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged). - /// - /// object sending the event - /// event arguments - private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e) - { - // on failure, set the status text - this.StatusText = this.kinectSensor.IsAvailable ? resourceLoader.GetString("RunningStatusText") - : resourceLoader.GetString("SensorNotAvailableStatusText"); - } - } -} diff --git a/Resources/InfraredBasics-XAML/Package.appxmanifest b/Resources/InfraredBasics-XAML/Package.appxmanifest deleted file mode 100644 index bd643c2..0000000 --- a/Resources/InfraredBasics-XAML/Package.appxmanifest +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - InfraredBasics-XAML - Kinect for Windows Samples - Assets\StoreLogo.png - - - - 6.2.1 - 6.2.1 - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/InfraredBasics-XAML/Properties/AssemblyInfo.cs b/Resources/InfraredBasics-XAML/Properties/AssemblyInfo.cs deleted file mode 100644 index baa5c3f..0000000 --- a/Resources/InfraredBasics-XAML/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("InfraredBasics-XAML")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("InfraredBasics-XAML")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Resources/InfraredBasics-XAML/Resources.resw b/Resources/InfraredBasics-XAML/Resources.resw deleted file mode 100644 index eaf9553..0000000 --- a/Resources/InfraredBasics-XAML/Resources.resw +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - No ready Kinect found! - - - Running - - - Kinect not available! - - - FPS= {0:N1} Time = {1} - - \ No newline at end of file diff --git a/Sujets/exo1_subject.md b/Sujets/exo1_subject.md deleted file mode 100644 index 9c5bbaf..0000000 --- a/Sujets/exo1_subject.md +++ /dev/null @@ -1,391 +0,0 @@ -[Home](./README.md) -| **Exercise 1 - Kinect Streams** -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - -# Exercise 1: Kinect Sensor and Kinect Streams - -*Advised duration*: 4 hours -*Maximum advised duration*: 6 hours - -# Prerequisites -- WPF & XAML - - Data binding - - (not mandatory) converters -- events -- IDisposable -- (*not mandatory*) MVVM and/or MVVM Community Toolkit - -# Resources -- 🔜 How to turn a **WPF Application (.NET Framework)** to a **SDK-style csproj**? -- 🔜 Microsoft Kinect Samples -- 🔜 videos about events -- 🔜 XAML -- 🔜 Data Binding -- 🔜 Converters - -# Requested Work - -The goal of this exercise is to create a WPF Application allowing to get these different **Kinect** streams (🚨 are mandatory): -- 🚨 color stream, - -- depth stream, - -- infrared stream, - -- 🚨 body stream, - -- body & color streams (a combination of color and body streams, where the skeleton is drawn above the color image). - -The main (and only) window of your application, could look like this: - -- the upper part indicates if the **Kinect** sensor is available and running or not. It should display a **red dot** and a convenient text if the **Kinect** sensor is unplugged or not running yet. It should display a **green dot** and a convenient text otherwise. -- below this part, stands an horizontal bar of buttons allowing to switch between streams. The available streams are **color** (mandatory), **depth**, **infrared**, **body** (mandatory), and **body and color** streams. All this buttons should no be clickable if the **Kinect** is not available. -- at last, the remaining of the window will display the content of the selected stream. - -# Steps to reproduce -This part is given as a set of advises to realize your application. -I use some symbols in it: -symbol | signification ---- | --- -💡 | be smart: this can obviously be done before practical works and without the kinect sensor! -🎬 | evaluated at the end of all the practical works -🚨 | mandatory if you want at least 10/20 -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality (it's always better when it's beautiful 🥹) -> Note about difficulty: -> It's obviously completely subjective... - -## 💡🚨🟢 Create the Window -- Create your repository -- Create a **WPF Application (.NET Framework)** -- Turn it to *SDK-style csproj* (especially if you want to use *MVVM Community Toolkit*, otherwise it is useless) -- Create the UI of your window (XAML) -## 🚨🟢 Kinect connection -- 💡 Read the Microsoft Kinect Samples (especially the **Color Basics-XAML** sample) and find how the **Kinect** sensor is managed -- Tip about how to encapsulate your **Kinect** sensor. You could write a ```KinectManager``` class like this one: -```mermaid -classDiagram -class KinectManager { - +/Status: bool - +/StatusText: string - +StartSensor() - +StopSensor() - -KinectSensor_IsAvailableChanged(sender, args) -} -class KinectSensor { - +/IsOpen: bool - +GetDefault()$ KinectSensor - +~~event~~IsAvailableChanged - +Open() - +Close() -} -KinectSensor <-- KinectManager -``` -This class could be able to start and stop the sensor and listen to the IsAvailableChanged event from the ```KinectSensor```. It would also give access to status information through ```Status``` and ```StatusText```. -> TIP: -> If you like MVVM, consider using it directly to get more points (read next sections below). -- Use this class with your app: - - to start the sensor if it is plugged, when the window loads - - to stop the sensor when the window unloads - - use the status feedbacks to update the upper part of the window -## 🚨🟢 Display Color Image Stream -- 💡 Read the Microsoft Kinect Samples (especially the **Color Basics-XAML** sample) and find how to get the color stream -- Create your own class ```ColorImageStream``` to retrieve and give access to the kinect color stream -- Beware of copy and paste! Keep only what's useful! -- Consider adding ```Start``` and ```Stop``` methods -- Update the window so that it displays the color stream when you click on the **Color** button. -## 🟡🔖 Use MVVM -The two previous mandatory sections can bring more points if you use MVVM (or better, **MVVM Community Toolkit**). -If you do so, your code will be less cumbersome, simpler to write, read and plug to the window. -If you are not found of MVVM, it will be a nightmare. -Make your choice. -## 🟢 Display Depth Image Stream -It's exactly the same as for the Color Image Stream. Same difficulties, minor changes. -So it is easy, it does not take a lot of time, but it does not bring more knowledges. -This is why it is not mandatory, and bring less points. -## 🟢 Display IR Image Stream -It's exactly the same as for the Color Image Stream. Same difficulties, minor changes. -So it is easy, it does not take a lot of time, but it does not bring more knowledges. -This is why it is not mandatory, and bring less points. -## 🟡🔖 Architecture -- If you have prepared the three streams (but you can do it even with only one), you could decide to enhance your architecture by using inheritance. -```mermaid -classDiagram -direction TB -class KinectStream { - #Sensor : KinectSensor - +Start() - +Stop() -} - -KinectStream --> "1" KinectManager : #KinectManager - -KinectStream <|-- ColorImageStream -KinectStream <|-- DepthImageStream -KinectStream <|-- InfraredImageStream -``` -- Once it is done, you could make the change between one stream and another easier by using a factory: -```mermaid -classDiagram -direction LR -class KinectStreamsFactory { - +ctor(kinect: KinectManager) - -streamFactory : Dictionary~KinectStreams, Func~KinectStream~~ - +this[stream: KinectStreams] : KinectStream -} - -class KinectStreams { - <> - None - Color - Depth - IR -} - -KinectStreamsFactory --> "1" KinectManager -KinectStreamsFactory ..> KinectStreams -KinectStreamsFactory ..> KinectStream -KinectStream --> KinectManager -KinectStream <|-- ColorImageStream -KinectStream <|-- DepthImageStream -KinectStream <|-- InfraredImageStream -``` -The idea here is to provide a collection of method to create and start ```KinectStream```s. These methods are ```Func``` stored in a ```Dictionary``` that you could access through an indexer. -- If you update now your window with this factory, now your code-behind (or better, your view model) should be very very simple and beautiful (🥹). - -## 🚨🟡 Display Body Stream -- 💡 Read the Microsoft Kinect Samples (especially the **Body Basics-XAML** sample) and find how to get the body stream. You will see that their sample is a little bit complex as they have decided to modify the image. I suggest we go in a simpler direction, by providing a canvas with ellipses representing the joints of the body, and lines representing the bones. -- Beware of copy and paste! Keep only what's useful! -- Update the window so that it displays the body stream when you click on the **Body** button. -## 🟡🔖 Update and use the architecture -If you have used the advised architecture, use it to make your new ```BodyStream``` class a subclass of the ```KinectStream``` abstract class. You may need to change some things in the base class as the body stream uses a canvas. -## 🔴 Display Body and Color Streams in the meantime -If you still have some time, find a way to display simultaneously color and body streams! -## 🟡🔖 Update and use the architecture -Obviously, integrate it in your architecture if you have done one. -## 🟢🔖 Make a class library -As all your classes may be used by other applications, make a class library! - -# Evaluation criteria -To earned points, remember that you must validate your knowledge with your teacher, during the practical work. - - -**Signification** -symbol | signification ---- | --- -☢️ | if not respected => 0/20 -🎬 | evaluated at the end of all the practical works -🚨 | mandatory -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality - - -**Criteria** -@ | category | description | coeff ---- | --- | --- | --- -☢️ | | the repositories must be accessible by the teacher | ☢️ -☢️ | | a .gitignore file must be use at the creation of the repository or at the first push | ☢️ -🎬 | | all *class libraries* and *applications* build | 6 -🎬 | | *applications* run without any bug | 6 -🚨🟢 | XAML of the Window | | 1 -🚨🟢 | Kinect Connection | Use of the Kinect sensor | 2 -🚨🟢 | Kinect Connection | Use of the Kinect event | 6 -🚨🟢🔖 | Kinect Connection | Encapsulation | 6 -🚨🟢 | Kinect Connection | Connect when the Window is loaded | 4 -🚨🟢 | Kinect Connection | Disconnect when the Window is unloaded | 2 -🚨🟢 | Kinect Connection | Status feedback in the Window | 6 -🔴🔖 | Kinect Connection | Using MVVM (commands for window loaded and unloaded) | 6 -🟡🔖 | Kinect Connection | Using MVVM (status feedback) | 6 -🚨🟢🔖 | Color Stream | Encapsulation - ColorImageStream class with **ONLY** necessary members (beware of mindless copy and paste) | 6 -🚨🟢 | Color Stream | retrieving the frame and processing it | 6 -🚨🟢 | Color Stream | start and stop acquisition | 6 -🚨🟢 | Color Stream | updating the window (start when clicking the button) | 6 -🚨🟢 | Color Stream | updating the window (display the color stream) | 6 -🟡🔖 | Color Stream | Using MVVM (button click + commands) | 6 -🟢🔖 | Color Stream | Using MVVM (data bind the color stream to the image) | 6 -🎬🚨🟢 | Color Stream | *test* runs without any bug | 4 -🟢🔖 | Depth Stream | Encapsulation - DepthImageStream class with **ONLY** necessary members (beware of mindless copy and paste) | 1 -🟢 | Depth Stream | retrieving the frame and processing it | 1 -🟢 | Depth Stream | start and stop acquisition | 1 -🟢 | Depth Stream | updating the window (start when clicking the button, stop when clicking another button) | 1 -🟢 | Depth Stream | updating the window (display the color stream) | 1 -🟡🔖 | Depth Stream | Using MVVM (button click + commands) | 1 -🟢🔖 | Depth Stream | Using MVVM (data bind the depth stream to the image) | 1 -🎬🟢 | Depth Stream | *test* runs without any bug | 1 -🟢🔖 | IR Stream | Encapsulation - InfraredImageStream class with **ONLY** necessary members (beware of mindless copy and paste) | 1 -🟢 | IR Stream | retrieving the frame and processing it | 1 -🟢 | IR Stream | start and stop acquisition | 1 -🟢 | IR Stream | updating the window (start when clicking the button, stop when clicking another button) | 1 -🟢 | IR Stream | updating the window (display the IR stream) | 1 -🟡🔖 | IR Stream | Using MVVM (button click + commands) | 1 -🟢🔖 | IR Stream | Using MVVM (data bind the infrared stream to the image) | 1 -🎬🟢 | IR Stream | *test* runs without any bug | 1 -🟡🔖 | Architecture | Abstract class to factorize | 12 -🔴🔖 | Architecture | Abstract class to factorize (using MVVM) | 6 -🔴🔖 | Architecture | Factory to allow choosing between one stream or another | 12 -🎬🔴🔖 | Architecture | *test* runs without any bug using the architecture and MVVM | 3 -🚨🟢🔖 | Body Stream | Encapsulation - BodyStream class with **ONLY** necessary members (beware of mindless copy and paste) | 6 -🚨🟢 | Body Stream | retrieving the frame and processing it, retrieving the body of the closest user | 6 -🚨🟢 | Body Stream | start and stop acquisition | 6 -🚨🟡 | Body Stream | fill a Canvas with Ellipses and Lines corresponding to the skeleton | 6 -🚨🟢 | Body Stream | updating the window (start when clicking the button, stop when clicking another button) | 6 -🚨🟡 | Body Stream | updating the window (display the body stream) | 6 -🔴🔖 | Body Stream | Using MVVM (button click + commands) | 1 -🔴🔖 | Body Stream | Using MVVM (data bind the body stream to the image) | 6 -🎬🚨🔴 | Body Stream | *test* runs without any bug | 4 -🔴🔖 | Architecture | Use the Body Stream with the abstract class and the Factory to allow choosing between one stream or another | 6 -🎬🔴🔖 | Architecture | *test* runs without any bug using the architecture and MVVM | 3 -🟡🔖 | Body and Color Streams | Encapsulation - BodyAndColorStream class (be smart) | 4 -🟡🔖 | Body and Color Streams | updating the window (start when clicking the button, stop when clicking another button) | 4 -🔴🔖 | Body and Color Streams | updating the window (display the body stream) | 4 -🔴🔖 | Body and Color Streams | Using MVVM (button click + commands) | 1 -🔴🔖 | Body and Color Streams | Using MVVM (data bind the body and color streams to the image) | 4 -🎬🔴🔖 | Body and Color Streams | *test* runs without any bug | 2 -🎬🔴🔖 | Architecture | *test* runs without any bug using the architecture and MVVM | 3 -🟢🔖 | Architecture | Create a class library | 6 -🎬🟢 | Documentation | ReadMe, comments, wiki... | 4 - -> Some samples if you wonder... -> - if you do only the 🚨 criteria, you get => 10/20 -> - for the ```KinectManager``` (without MVVM) => 2,22 pts -> - for the Color Stream (without MVVM and without considering tests) => 2,56 pts -> - for depth and IR streams (without MVVM and without considering tests) => 0,85 pts -> - for body stream (without MVVM and without considering tests) => 3,08 pts -> - for body & color streams (without MVVM and without considering tests) => 1,03 pt -> - architecture => 3,08 pts -> - if you use MVVM (everywhere when indicated) => 4,7 pts -> - if all your tests pass and if you have done documentation => 2,48 pts - -> Note : -> Coefficients may change and are here only indicative - ---- - -[Home](./README.md) -| **Exercise 1 - Kinect Streams** -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - ---- - -Copyright © 2023-2024 Marc Chevaldonné - ---- - -While preparing these practical works, I was listening to... - - - - - - -
- - -
-

Trident

-

McCoy Tyner (1975)

-
-
- - - - - -
- - -
-

Sweet Return

-

Freddie Hubbard (1983)

-
-
- - - - - -
- - -
-

Renaissance Man

-

Jamaaladeen Tacuma (1984)

-
-
- - - - - -
- - -
-

Back In The USA

-

MC5 (1970)

-
-
- - - - - -
- - -
-

Blues & Roots

-

Charlie Mingus (1960)

-
-
- - - - - -
- - -
-

The Magic of Ju-Ju

-

Archie Shepp (1967)

-
-
- - - - - -
- - -
-

Loaded

-

The Velvet Underground (1970)

-
-
- - - - - -
- - -
-

Symphonie Fantastique / Tristia

-

Hector Berlioz - The Cleveland Orchestra & Chrosu - Pierre Boulez (1830 - 1997)

-
-
diff --git a/Sujets/exo2_1_subject.md b/Sujets/exo2_1_subject.md deleted file mode 100644 index 5874291..0000000 --- a/Sujets/exo2_1_subject.md +++ /dev/null @@ -1,257 +0,0 @@ -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| **Exercise 2 part 1 - Postures** -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - -# Exercise 2: Gesture Recognition part1 (Postures) - -# Prerequisites -- the ```KinectManager``` from exercise 1 -- inheritance in C# and abstract classes and methods -- polymorphism -- static methods and classes -- event in C# and Event Standard Pattern - -# Resources -- 🔜 event and Event Standard Pattern -- 🔜 inheritance in C# - -# Requested Work -As indicating in the introduction, the goal is to prepare the base classes of the gesture recognition system, and to develop and test postures. -```mermaid -classDiagram -class BaseGesture { - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized() - +GestureName : string -} -class Posture { - +TestGesture(Body body)* - #TestPosture(Body body)* bool -} -class GestureManager { - <> - +EventHandler~GestureRecognizedEventArgs~ GestureRecognized$ - +AddGestures(IGestureFactory: factory)$ - +AddGestures(params BaseGesture[])$ - +RemoveGesture(BaseGesture)$ - +StartAcquiringFrames(KinectManager)$ - +StopAcquiringFrame()$ -} -BaseGesture <|-- Posture -Posture <|-- PostureRightHandUp -Posture <|-- PostureTwoHandsDragon -BaseGesture "*" <-- GestureManager : +KnownGestures -GestureManager --> "1" KinectManager : KinectManager - -``` - -# Steps to reproduce -This part is given as a set of advises to realize your application. -I use some symbols in it: -symbol | signification ---- | --- -💡 | be smart: this can obviously be done before practical works and without the kinect sensor! -🎬 | evaluated at the end of all the practical works -🚨 | mandatory if you want at least 10/20 -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality (it's always better when it's beautiful 🥹) -> Note about difficulty: -> It's obviously completely subjective... - -## 🚨🟢🔖 KinectUtils class library -- Create a .NET Framework class library -- Add your KinectManager -- Create all the base classes (```BaseGesture``` and ```Posture```) - -## 🚨🟡🔖 MyGesturesBank class library -- Create a .NET Framework class library -- Add 2 concrete postures to it -> Suggestions: -> Hand up, Hand on the head, Join hands, hands on hips... -- Test your postures in a Console App (.NET Framework) - -## 🚨🟡🔖 GestureManager -- add the ```GestureManager``` class to your KinectUtils class library -- manage the collection of gestures -- manage the acquisition of frames -- manage the ```GestureRecognized``` event so that the user subscribe only once to an event (this one) in order to be subscribed to all events of ```GestureManager``` gestures -- (not mandatory) find a way (or make your teacher talk) to allow automatic subscriptions to all gestures event, without event bouncing. In other words, ```GestureManager``` should not be subscribed to all gestures event, and re-fire an event if one occurs. -- (not mandatory) find a way (or...) to allow late subscriptions to gestures event. In other words, if the user has already subscribed to ```GestureRecognized``` of ```GestureManager```, if she adds a new gesture to the collection, she should be also subscribed without having to reset the subscription. -- Test your ```GestureManager``` in a Console App - -## 🟡🔖 Posture specific events -As your posture is tested at every frame, it should send the event everytime it is recognized, so a dozen of times if you keep the pose. -Modify your ```Posture``` class so that it sends to more events: -- PostureRecognized if it is recognized although it wasn't at the previous frame -- PostureUnrecognized if it is not recognized although it was at the previous frame -- Test it in a Console App - -# Evaluation criteria -To earned points, remember that you must validate your knowledge with your teacher, during the practical work. - - -**Signification** -symbol | signification ---- | --- -☢️ | if not respected => 0/20 -🎬 | evaluated at the end of all the practical works -🚨 | mandatory -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality - - -**Criteria** -@ | category | description | coeff ---- | --- | --- | --- -☢️ | | the repositories must be accessible by the teacher | ☢️ -☢️ | | a .gitignore file must be use at the creation of the repository or at the first push | ☢️ -🎬 | | all *class libraries* and *applications* build | 4 -🎬 | | *applications* run without any bug | 4 -🚨🟢🔖 | KinectUtils class library | with KinectManager | 1 -🚨🟢🔖 | KinectUtils class library | BaseGesture with event | 4 -🚨🟢🔖 | KinectUtils class library | Posture | 1 -🚨🟢 | KinectUtils class library | Posture.TestPosture | 1 -🚨🟡🔖 | MyGesturesBank class library | 1st posture | 6 -🟡 | MyGesturesBank class library | 2nd posture | 2 -🚨🟡 | Test | Console test | 4 -🚨🟢🔖 | GestureManager | collection of gestures | 1 -🚨🟡🔖 | GestureManager | acquiring frames | 6 -🚨🟡 | GestureManager | event (dirty but working) | 6 -🔴🔖 | GestureManager | event automatic subscriptions to collection of gestures | 6 -🔴🔖 | GestureManager | event late subscriptions | 6 -🚨🟡 | Test | Console test | 4 -🟡🔖 | Posture specific events | PostureRecognized and PostureUnrecognized | 6 -🟡🔖 | Posture specific events | Update GestureManager | 6 -🟡 | Test | Console test | 4 -🎬🟢 | Documentation | ReadMe, comments, wiki... | 4 - -> Some samples if you wonder... -> - if you do only the 🚨 criteria and your application is building and running, you get => 11,05/20 -> - for the Bases of *KinectUtils* class library (```BaseGesture``` and ```Posture```) => 1,84 pt -> - for two concrete postures => 2,1 pts -> - for ```GestureManager``` => 6,6 pts -> - for the management of the two specific events on ```Posture``` and ```GestureManager``` => 3,2 pts -> - for all your tests (the three ones) => 3,2 pts -> - quality (building, running and documentation) => 3,2 pts - -> Note : -> Coefficients may change and are here only indicative - ---- - -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| **Exercise 2 part 1 - Postures** -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - ---- - -Copyright © 2023-2024 Marc Chevaldonné - ---- - -While preparing these practical works, I was listening to... - - - - - - -
- - -
-

After The Gold Rush

-

Neil Young (1970)

-
-
- - - - - -
- - -
-

Monk's Music

-

Thelonious Monk Septet (1957)

-
-
- - - - - -
- - -
-

Special Identity

-

Joanne Brackeen (1982)

-
-
- - - - - -
- - -
-

Where Have I Known You Before

-

Return To Forever (1974)

-
-
- - - - - -
- - -
-

Live

-

Bozilo (2009)

-
-
- - - - - -
- - -
-

Look Out!

-

Stanley Turrentine (1960)

-
-
- - - - - -
- - -
-

Moanin'

-

Art Blakey and The Jazz Messengers (1958)

-
-
\ No newline at end of file diff --git a/Sujets/exo2_2_subject.md b/Sujets/exo2_2_subject.md deleted file mode 100644 index 40732ba..0000000 --- a/Sujets/exo2_2_subject.md +++ /dev/null @@ -1,229 +0,0 @@ -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| **Exercise 2 part 2 - Gestures** -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - -# Exercise 2: Gesture Recognition part2 (Gestures) - -# Prerequisites -- classes from part 1 -- inheritance in C# and abstract classes and methods -- polymorphism -- static methods and classes -- event in C# and Event Standard Pattern -- interfaces in C# - -# Resources -- 🔜 event and Event Standard Pattern -- 🔜 inheritance in C# -- 🔜 interfaces - - -# Requested Work -As indicating in the introduction, the goal is to develop and test dynamic gestures. -```mermaid -classDiagram -class BaseGesture { - <> - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized(Body) - +GestureName : string -} -class Gesture { - +IsTesting : bool - #MinNbOfFrames : int - #MaxNbOfFrames : int - -mCurrentFrameCount : int - #TestInitialConditions(Body body)* bool - #TestPosture(Body body)* bool - #TestRunningGesture(Body body)* bool - #TestEndConditions(Body body)* bool - +TestGesture(Body body)* -} -BaseGesture <|-- Gesture -Gesture <|-- SwipeRightHand -Gesture <|-- ClapHands -``` -```Gesture``` represents a *dynamic* gesture and thus, should override the ```TestGesture``` method. -The algorithm can be separated in four important pieces: -- we start the gesture recognition if **initial conditions** are met (```TestInitialConditions```) -- at every frame, we check if the static current posture corresponds to a pose of this gesture (```TestPosture```) (for instance, for a swipe, my hand shouldn't be higher than my head) -- at every frame, we check if the pose, in comparison with the previous ones, is valid or not (```TestRunningGesture```). In other terms, we test the *dynamic* of the gesture. For instance, in a swipe, my hand should not go on the left, then on the right, then on the left, then on the right... -- at every frame, we check if the ending conditions are met (```TestEndingConditions```). - -Moreover, we count the number of frames since the initial conditions were met and we check that the number of counted frames is in [```MinNbOfFrames```;```MaxNbOfFrames```] when ending conditions are met, in order to filter too slow or too fast gestures. - -Next, you will develop 2 or 3 gestures and add them to your *MyGesturesBank* library. - -At last, you will take care of the factory to ease the use of many gestures. -```mermaid -classDiagram -class IGestureFactory { - +CreateGestures() IEnumerable~BaseGesture~ -} -<> IGestureFactory - -class GestureManager { - <> - +EventHandler~GestureRecognizedEventArgs~ GestureRecognized$ - +AddGestures(IGestureFactory: factory)$ - +AddGestures(params BaseGesture[])$ - +RemoveGesture(BaseGesture)$ - +StartAcquiringFrames(KinectManager)$ - +StopAcquiringFrame()$ -} -BaseGesture "*" <-- GestureManager : +KnownGestures -KinectManager "1" <-- GestureManager : KinectManager - -IGestureFactory "1" <.. GestureManager : Factory - -IGestureFactory <|.. AllGesturesFactory -``` -The ```IGestureFactory``` allows creating all at once, by calling ```CreateGestures()```, a collection of gestures. -Users can thus implement this interface to create their own collection of gestures. -At last, you will update ```GestureManager``` so that it can take a ```IGestureFactory``` as parameter in ```AddGestures``` to fill the collection of gestures. - -# Steps to reproduce -This part is given as a set of advises to realize your application. -I use some symbols in it: -symbol | signification ---- | --- -💡 | be smart: this can obviously be done before practical works and without the kinect sensor! -🎬 | evaluated at the end of all the practical works -🚨 | mandatory if you want at least 10/20 -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality (it's always better when it's beautiful 🥹) -> Note about difficulty: -> It's obviously completely subjective... - -## 🚨🟡 Gesture & TestGesture -- 💡 Prepare an algorithm based on this subject. It's not that difficult, but it's not that easy neither... -- Code the abstract class ```Gesture``` and above all, the ```TestGesture``` method - -## 🚨🟡 Gesture - 1st subclass -- choose a gesture and code it -- test it in a console app -> What gesture? -> If you do not know what to code, you can begin with simple gestures: swipes, clap hands, hands up. -> Avoid more complex gesture made of multiple steps (waves for instance) - -## 🔴 Gesture: use body referential instead of kinect referential -If you have tested your gesture in a Kinect referential (_ie_ using the X, Y, Z axis of the Kinect), you may have different results if the body is not facing the Kinect. You could use another referential centered on the user body (for instance, use the axis made by the hips, the spin and the neck, etc.). -- update the gesture (or code another) using a body centered referential -- test it - -## 🚨🟢🔖 IGestureFactory -- add the ```IGestureFactory``` to the correct class library -- implement this interace in the correct class library -- update your test - -## 🟡 Gesture - 2nd subclass -- add a second gesture -- test it - -# Evaluation criteria -To earned points, remember that you must validate your knowledge with your teacher, during the practical work. - - -**Signification** -symbol | signification ---- | --- -☢️ | if not respected => 0/20 -🎬 | evaluated at the end of all the practical works -🚨 | mandatory -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality - - -**Criteria** -@ | category | description | coeff ---- | --- | --- | --- -☢️ | | the repositories must be accessible by the teacher | ☢️ -☢️ | | a .gitignore file must be use at the creation of the repository or at the first push | ☢️ -🎬 | | all *class libraries* and *applications* build | 2 -🎬 | | *applications* run without any bug | 2 -🚨🟡 | Gesture | TestGesture | 3 -🚨🟡 | Gesture | 1st subclass | 2 -🔴 | Gesture | use body referential instead of kinect referential | 2 -🚨🟢 | Test | Console Test | 2 -🚨🟢🔖 | IGestureFactory | interface and implementation | 1 -🚨🟢 | Test | Console Test | 1 -🟡 | Gesture | 2nd subclass | 2 -🟢 | Test | Console Test | 1 -🎬🟢 | Documentation | ReadMe, comments, wiki... | 2 - -> Some samples if you wonder... -> - if you do only the 🚨 criteria and your application is building and running, you get => 13/20 -> - a coeff 3 criterium => 3 pts -> - a coeff 2 criterium => 2 pts -> - a coeff 1 criterium => 1 pt -(Note: this is just because the sum of coeffs is 20...) - -> Note : -> Coefficients may change and are here only indicative - ---- - -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| **Exercise 2 part 2 - Gestures** -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - ---- - -Copyright © 2023-2024 Marc Chevaldonné - ---- - -While preparing these practical works, I was listening to... - - - - - - -
- - -
-

As Is

-

Bojan Z (2023)

-
-
- - - - - -
- - -
-

Darkness On The Edge Of Town

-

Bruce Springsteen & the E Street Band (1978)

-
-
- - - - - -
- - -
-

Modernistic

-

Jason Moran (2002)

-
-
\ No newline at end of file diff --git a/Sujets/exo2_3_subject.md b/Sujets/exo2_3_subject.md deleted file mode 100644 index 5be9f73..0000000 --- a/Sujets/exo2_3_subject.md +++ /dev/null @@ -1,243 +0,0 @@ -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| **Exercise 2 part 3 - Mapping** -| [Exercise 3 - Free App](./exo3_subject.md) - -# Exercise 3: Gesture Recognition part3 (Mapping) - -# Prerequisites -- classes from part 1 & 2 -- inheritance in C# and abstract classes and methods -- polymorphism -- static methods and classes -- event in C# and Event Standard Pattern -- generic classes - -# Resources -- 🔜 event and Event Standard Pattern -- 🔜 inheritance in C# -- 🔜 interfaces -- 🔜 generics - -# Requested Work - -This third and last part aims at mapping body movements to _something else_ movement (an ellipse, a cat, a nounours, a dinosaur...). - -In order to do that, benefit from generic classes, as we do not know in advance what to map with a body. - -The ```BaseMapping``` generic class is very simple: -- its ```Mapping``` abstract method has the responsability to return a ```T``` value or instance at every frame, based on a ```Body``` -- the ```TestMapping``` will check if ```Mapping``` can be called or not. -- ```SubscribeToStartGesture```, ```SubscribeToEndGesture``` and ```SubscribeToToggleGesture``` methods toggle a boolean indicating if the mapping is runnning or not when it receives event from gestures. For instance, every time the posture _LeftHandUp_ is received, it starts the mapping, or every time the gesture _SwipeRightHand_ is received, it stops the mapping... The ```SubscribeToToggleGesture``` method is used in order to use the same gesture to start and stop the mapping. So the user will have to either use start gesture and stop gesture, or use toggle gesture. But, in fact, he could also use multiple gestures! -- ```GestureManager``` will fire an event ```BodyFrameArrived``` every time it detects a body in a frame. This event should be catch by instances of ```BaseMapping```. In order to do that, mappings will subscribe (unsubscribe) to the ```BodyFrameArrived``` event when the ```GestureManager.AddMapping``` method is called (```RemoveMapping``` to unsubscribe). -- every time a mapping receives the ```BodyFrameArrived``` event, it calls ```TestMapping``` and if it returns ```true```, it fires itself its event ```OnMapping``` -- ```OnMapping``` is the event to which you can subscribe in your app to do a mapping - -```mermaid -classDiagram -direction TB -class BaseGesture { - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized(Body) - +GestureName : string -} - -class BaseMapping~T~ { - -running : bool - +EventHandler : OnMapping - +SubscribeToStartGesture(gesture: BaseGesture) - +SubscribeToEndGesture(gesture: BaseGesture) - +SubscribeToToggleGesture(gesture: BaseGesture) - #Mapping(Body body)* T - ~TestMapping(Body body, out T ouput) bool - ~#OnBodyFrameArrived(object, BodyFrameArrivedEventArgs) -} - -class MapLeftHandToMouse { - #Mapping(Body body)* Point -} - -BaseMapping~T~ <|-- MapLeftHandToMouse : T <- Point - -BaseGesture <.. BaseMapping~T~ - -class GestureManager { - <> - +EventHandler~GestureRecognizedEventArgs~ : GestureRecognized$ - +EventHandler~BodyFrameArrivedEventArgs~ : BodyFrameArrived$ - +AddGestures(IGestureFactory: factory)$ - +AddGestures(params BaseGesture[])$ - +RemoveGesture(BaseGesture)$ - +AddMapping~T~(BaseMapping~T~: mapping)$ - +RemoveMapping~T~(BaseMapping~T~: mapping)$ - +StartAcquiringFrames(KinectManager)$ - +StopAcquiringFrame()$ -} -BaseGesture "*" <-- GestureManager : +KnownGestures -BaseMapping <.. GestureManager - -``` - - -# Steps to reproduce -This part is given as a set of advises to realize your application. -I use some symbols in it: -symbol | signification ---- | --- -💡 | be smart: this can obviously be done before practical works and without the kinect sensor! -🎬 | evaluated at the end of all the practical works -🚨 | mandatory if you want at least 10/20 -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality (it's always better when it's beautiful 🥹) -> Note about difficulty: -> It's obviously completely subjective... - -## 🚨🟡 Mapping and TestGesture -- create the ```BaseMapping``` generic class -- manage the ```running``` boolean member so that it changes when the events ```GestureRecognized``` are received -- add the methods ```Mapping``` (abstract) and ```TestMapping``` calling the former one and return a ```bool``` and the result from ```Mapping```. -- add constructors with either the start and end gestures, or the toggle gesture - -## 🚨🟡 GestureManager - BodyFrameArrived -- add a new event ```BodyFrameArrived``` to ```GestureManager``` whose arguments give access to bodies in the frame and also the closest one to the kinect sensor -- change ```GestureManager``` so that it fires this event when it acquires and processes body frames from the kinect sensor - -## 🟢 IGestureFactory & access to gestures -As you may need access to the gestures of a factory, and as we do not have given any public access, add an indexer to get a gesture by its name (if you do not know nor want to use an indexer, use a method...) - -## 🔴 ConcreteMapping -- Create a concrete mapping (for instance to the 2D position of an hand). -- Test it. - -## 🔴🔖 OnMapping -- add and manage the ```OnMapping``` event to ```BaseMapping```. Its arguments should give access to the mapped value -- fire this event when the mapping is running -- update and test your program - -# Evaluation criteria -To earned points, remember that you must validate your knowledge with your teacher, during the practical work. - - -**Signification** -symbol | signification ---- | --- -☢️ | if not respected => 0/20 -🎬 | evaluated at the end of all the practical works -🚨 | mandatory -🟢 | difficulty: low -🟡 | difficulty: medium -🔴 | difficulty: high -🔖 | quality - - -**Criteria** -@ | category | description | coeff ---- | --- | --- | --- -☢️ | | the repositories must be accessible by the teacher | ☢️ -☢️ | | a .gitignore file must be use at the creation of the repository or at the first push | ☢️ -🎬 | | all *class libraries* and *applications* build | 1 -🎬 | | *applications* run without any bug | 1 -🚨🟡 | Mapping | TestGesture | 1 -🚨🟡 | GestureManager | BodyFrameArrived | 1 -🟢 | IGestureFactory | indexer | 1 -🔴 | ConcreteMapping | BodyFrameArrived | 1 -🚨🟢 | Test | Console Test | 1 -🔴🔖 | OnMapping | BodyFrameArrived + OnMapping | 1 -🟢 | Test | Console Test | 1 -🎬🟢 | Documentation | ReadMe, comments, wiki... | 1 - -> Some samples if you wonder... -> - if you do only the 🚨 criteria and your application is building and running, you get => 10/20 - -> Note : -> Coefficients may change and are here only indicative - ---- - -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| **Exercise 2 part 3 - Mapping** -| [Exercise 3 - Free App](./exo3_subject.md) - ---- - -Copyright © 2023-2024 Marc Chevaldonné - ---- - -While preparing these practical works, I was listening to... - - - - - - -
- - -
-

Hypersuites

-

Marina Baranova (2016)

-
-
- - - - - -
- - -
-

Dracula

-

Pierre Henry (2003)

-
-
- - - - - -
- - -
-

1935-1936

-

Fats Waller (1935-1936)

-
-
- - - - - -
- - -
-

Just Jazz

-

Aldo Romano (2008)

-
-
- - - - - -
- - -
-

Carolina Shout

-

James P. Johnson (1920's - 1930's)

-
-
\ No newline at end of file diff --git a/Sujets/exo2_subject.md b/Sujets/exo2_subject.md deleted file mode 100644 index e6102f7..0000000 --- a/Sujets/exo2_subject.md +++ /dev/null @@ -1,305 +0,0 @@ -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| **Exercise 2 - Introduction** -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - -# Exercise 2: Gesture recognition - -*Advised duration*: 4 hours -*Maximum advised duration*: 6 hours - -This exercise can be splitted in three parts but they are all bound and you should do them in the right order. - -The main objective is to develop a simple gesture recognition system. It is not based on AI or *Machine Learning*. It is rather made of **Q&D**¹ solutions. - -# Just a glimpse on the work to be done - -Our **gesture recognition** will be able to: -- recognize **postures** _ie_ static body poses (your body does not move, it is tested on a single frame), -- recognize **gestures** _ie_ dynamic body movements (your body does move, it is tested during several frames), -- do **mapping** of body movement on whatever computer thing (a cursor, an ellipse, a dinosaur...). - -You will have to develop the following assemblies (except *Exercise3.WpfApp*, and the Nuget Packages *Microsoft.Kinect* and *CommunityToolkit.Mvvm*): -```mermaid -flowchart LR -subgraph Exercise2 - MyGesturesBank - KinectUtils - Tests -end -MyGesturesBank -.-> KinectUtils -KinectUtils -.-> Microsoft.Kinect -KinectUtils -.-> CommunityToolkit.Mvvm -Tests -.-> MyGesturesBank -Tests -.-> KinectUtils -style Microsoft.Kinect fill:#eee,color:#111,stroke:#999 -style CommunityToolkit.Mvvm fill:#eee,color:#111,stroke:#999 -subgraph Exercise3 - WpfApp -end -WpfApp -.-> MyGesturesBank -WpfApp -.-> KinectUtils -``` - -**KinectUtils** will contain all the base types to do gesture recognition and mapping. It will be updated in the three parts of this exercise. - -**MyGesturesBank** will contain specific implementation of postures and gestures that could then be used in different applications. - -**Tests** are only one or several *Console app* tests to verify that our system is working well. - -Here is just a glimpse of the classes you will develop. More details will be given later or by your teacher on demand: -- ```BaseGesture``` will represent any gesture, _ie_ any ```Posture``` or ```Gesture``` (dynamic). To be tested, you will have to call ```TestGesture``` that will fire the event ```GestureRecognized``` if it is recognized. -- ```Posture``` is a specialization of ```BaseGesture``` for postures. -- ```Gesture``` is a specialization of ```BaseGesture``` for dynamic gestures. -- ```GestureManager``` is a static mediator for all gestures. It will ease the use of the gesture recognition system as the user will have to subscribe only once to the ```GestureManager.GestureRecognized``` event and not to every gesture event. -- ```BaseMapping``` is a generic class that allow mapping a body on a ```T```. It will use ```BaseGesture``` to start or stop the mapping. -- To avoid plumbery of creating every gesture for every app or tests, we will finally add a ```IGestureFactory``` storing gestures to be used in an app. - -```mermaid -classDiagram -class BaseGesture { - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized() - +GestureName : string -} -class Gesture { - +IsRecognitionRunning : bool - #MinNbOfFrames : int - #MaxNbOfFrames : int - -currentFrameCount : int - #TestInitialConditions(Body body)* bool - #TestPosture(Body body)* bool - #TestRunningGesture(Body body)* bool - #TestEndConditions(Body body)* bool - +TestGesture(Body body)* -} -class Posture { - +TestGesture(Body body)* - #TestPosture(Body body)* bool -} -class IGestureFactory { - +CreateGestures() IEnumerable~BaseGesture~ -} -<> IGestureFactory - -class GestureManager { - <> - +EventHandler~GestureRecognizedEventArgs~ GestureRecognized$ - +AddGestures(IGestureFactory: factory)$ - +AddGestures(params BaseGesture[])$ - +RemoveGesture(BaseGesture)$ - +StartAcquiringFrames(KinectManager)$ - +StopAcquiringFrame()$ -} - -BaseGesture <|-- Gesture -BaseGesture <|-- Posture -Posture <|-- PostureRightHandUp -Posture <|-- PostureTwoHandsDragon -Gesture <|-- SwipeRightHand -Gesture <|-- ClapHands -IGestureFactory "1" <-- GestureManager : Factory - -class BaseMapping~T~ { - +SubscribeToStartGesture(gesture: BaseGesture) - +SubscribeToEndGesture(gesture: BaseGesture) - +SubscribeToToggleGesture(gesture: BaseGesture) - #Mapping(Body body)* T - +TestMapping(Body body, out T ouput) bool -} - -BaseMapping~T~ <|-- MapLeftHandToMouse : T <- Point - -class MapLeftHandToMouse { - #Mapping(Body body)* Point -} - -BaseGesture <.. BaseMapping~T~ -BaseGesture "*" <-- GestureManager : +KnownGestures - -IGestureFactory <|.. AllGesturesFactory -GestureManager --> "1" KinectManager : KinectManager - -``` - -## Deeper informations -Here are more details about what we are going to do. **Do not hesitate to come back to this section later**. - -- ```BaseGesture```: it represents the base class for every gesture, _ie_ a **posture** (static position of a body) or a **dynamic gesture** (a movement). It owns a name and sends and event ```GestureRecognized``` when the gesture is ... recognized. To test the gesture, the type owns an abstract method ```TestGesture``` that will be overriden in the different subclasses. -```mermaid -classDiagram -class BaseGesture { - <> - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized(Body) - +GestureName : string -} -``` -- ```Posture```: this abstract subclass of ```BaseGesture``` is the base class for every **posture** (_ie_ every static position of a body). It overrides the ```TestGesture``` method that will send the event ```GestureRecognized``` event if the ```TestPosture``` abstract method returns ```true```. It is the base class for every other **posture** class of your coming application (_ie_ ```PostureRightHandUp```, ```PostureTwoHandsDragon```). -```mermaid -classDiagram -class BaseGesture { - <> - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized(Body) - +GestureName : string -} -class Posture { - <> - +TestGesture(Body body) - #TestPosture(Body body)* bool -} -BaseGesture <|-- Posture -Posture <|-- RightHandUp -Posture <|-- TwoHandsDragon -``` -- ```Gesture```: it represents a **dynamic gesture**. It is also a subclass of ```BaseGesture``` and overrides the ```TestGesture``` method to fire the event ```GestureRecognized``` event, but its algorithm is a little bit more complicated, and based on four abstract methods that will be explained later. But here is a summary: - - ```TestInitialConditions```: tests the body to see if the posture corresponds to a possible initial condition of this gesture - - ```TestPose```: tests the body to see if its current pose is valid for this gesture (like a picture or a pause in a movie) - - ```TestDynamicPoses```: tests the current pose but in comparison with the previous ones, to see if the dynamic of the movement corresponds to the gesture - - ```TestEndingConditions```: tests the current pose to see if it corresponds to the end of the gesture. - - Moreover, it also checks that the gesture is done in more than a minimum number of frames (otherwise it is just noise) or in less than a maximum number of frames (otherwise, it is too slow to be intentional). - > Note: - > This algorithm is far from being efficient, but it is simple... - - Subclasses of ```Gesture``` will only have to override these methods. -```mermaid -classDiagram -class BaseGesture { - <> - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized(Body) - +GestureName : string -} -class Posture { - <> - +TestGesture(Body body) - #TestPosture(Body body)* bool -} -class Gesture { - +IsRecognitionRunning : bool - #MinNbOfFrames : int - #MaxNbOfFrames : int - -mCurrentFrameCount : int - #TestInitialConditions(Body body)* bool - #TestPosture(Body body)* bool - #TestRunningGesture(Body body)* bool - #TestEndConditions(Body body)* bool - +TestGesture(Body body)* -} -BaseGesture <|-- Posture -BaseGesture <|-- Gesture -Gesture <|-- SwipeRightHand -Gesture <|-- ClapHands -``` -- To simplify the creation of different gestures and postures, we will use **gesture factories**. Every gesture factory implements the interface ```IGestureFactory``` whose contract asks for just one method ```CreateGestures``` returning the collection of ```BaseGesture``` to be tested in your app. This way, you won't have to test a hundred colliding gestures if you need only a dozen. -```mermaid -classDiagram -direction TB -class BaseGesture { - <> - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized(Body) - +GestureName : string -} -class IGestureFactory { - <> - +CreateGestures() IEnumerable~BaseGesture~ -} -BaseGesture <.. IGestureFactory -IGestureFactory <|.. AllGesturesFactory -``` -- At last, to avoid the user to subscribe to multiple ```GestureRecognized``` events (one per gesture), the static class ```GestureManager``` plays the role of a mediator or a façade for our library, simplifying the subscription and use of the gestures. It also uses the previous factory. -One particular precious thing, is that it sends a static event ```GestureRecognized``` which you can subscribe to. This event is only one to which the user should subscribe. Its subscription will internally subscribes to all ```knownGestures```. Easier and beautiful. -```mermaid -classDiagram -class BaseGesture { - <> - +TestGesture(Body body)* - +GestureRecognized : EventHandler~GestureRecognizedEventArgs~ - #OnGestureRecognized(Body) - +GestureName : string -} -class IGestureFactory { - <> - +CreateGestures() IEnumerable~BaseGesture~ -} - -class GestureManager { - <> - +EventHandler~GestureRecognizedEventArgs~ GestureRecognized$ - +StartAcquiringFrames()$ - +StopAcquiringFrames()$ -} -BaseGesture "*" <-- GestureManager : -mKnownGestures -IGestureFactory "1" <-- GestureManager : Factory -``` - -# Plan - -## Part1: Gesture Recognition (Postures) -The first part will focus on the basics of our gesture recognition system and postures. -In other words, you will have to code: -- ```BaseGesture``` -- ```Posture``` -- ```GestureManager``` -- and some concrete postures to be tested in a test - -## Part2: Gesture Recognition (Dynamic Gestures) -In the second part, you will code: -- ```Gesture``` -- some concrete gestures to be tested in a console app -- *MyGesturesBank* -- ```IGestureFactory``` -- a concrete factory with the previous gestures and postures - -## Part3: Gesture Recognition (Mapping) -In this last part, you will have to code: -- ```BaseMapping``` -- a concrete mapping -- and a final test. - ---- - -¹ *Q&D stands for Quick & Dirty in tribute to Seattle Computer Products and QDOS* - - ---- - -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| **Exercise 2 - Introduction** -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| [Exercise 3 - Free App](./exo3_subject.md) - ---- - -Copyright © 2023-2024 Marc Chevaldonné - ---- - -While preparing this practical works, I was listening to... - - - - - - -
- - -
-

In The Court Of The Crimson King

-

King Crimson (1969)

-
-
\ No newline at end of file diff --git a/Sujets/exo3_subject.md b/Sujets/exo3_subject.md deleted file mode 100644 index 7d5753d..0000000 --- a/Sujets/exo3_subject.md +++ /dev/null @@ -1,91 +0,0 @@ -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| **Exercise 3 - Free App** - -# Exercise 3: Gesture Recognition part3 (Mapping) - -# Prerequisites -- exercises 1 & 2 -- Dispatcher -- Timer - -# Resources -- 🔜 Dispatcher -- 🔜 Timer - -# Requested Work -A WPF application with body interaction through the use of the Kinect Sensor. -The application must: -- be interactive -- use the results of the two first exercises -- if possible, be original - -[🎥 Here are some samples](https://opencast.dsi.uca.fr/paella/ui/watch.html?id=020468ca-165e-493f-8938-32043c4632df) of what students were able to do the last years. - - -# Evaluation criteria -To earned points, remember that you must validate your knowledge with your teacher, during the practical work. - -**Criteria** -@ | description | coeff ---- | --- | --- -☢️ | the repositories must be accessible by the teacher | ☢️ -☢️ | a .gitignore file must be use at the creation of the repository or at the first push | ☢️ -🎬 | all *class libraries* and *applications* build | ~1 -🎬 | *applications* run without any bug | ~2 -🚨🟢 | Use of gestures recognition (postures and/or gestures and/or mapping) | ~2 -🚨🟡 | Use of content (shapes, images, animations...) | ~2 -🚨🔴 | Interactive application | ~2 -🎬🟢 | Documentation (how to play, how to run the app...) | ~1 - -> Note : -> Coefficients may change and are here only indicative - ---- - -[Home](./README.md) -| [Exercise 1 - Kinect Streams](./exo1_subject.md) -| [Exercise 2 - Introduction](./exo2_subject.md) -| [Exercise 2 part 1 - Postures](./exo2_1_subject.md) -| [Exercise 2 part 2 - Gestures](./exo2_2_subject.md) -| [Exercise 2 part 3 - Mapping](./exo2_3_subject.md) -| **Exercise 3 - Free App** - ---- - -Copyright © 2023-2024 Marc Chevaldonné - ---- - -While preparing these practical works, I was listening to... - - - - - - -
- - -
-

Live At Fip

-

Popa Chubby (2003)

-
-
- - - - - -
- - -
-

Sarah Vaughan

-

Sarah Vaughan (1955)

-
-
\ No newline at end of file diff --git a/Sujets/subject_intro.md b/Sujets/subject_intro.md deleted file mode 100644 index c2c2f0d..0000000 --- a/Sujets/subject_intro.md +++ /dev/null @@ -1,89 +0,0 @@ -# Introduction - -- [Introduction](#introduction) -- [Kinect sensor](#kinect-sensor) - - [What's inside the Kinect sensor?](#whats-inside-the-kinect-sensor) - - [Software and SDK](#software-and-sdk) -- [Course of the practical work](#course-of-the-practical-work) -- [Evaluation](#evaluation) - - -The goal of this resource is to go deeper into *Object Oriented Programming* through the use of an (formerly) innovative device (**KinecT**) and simple gesture detection algorithms. -It is made of three exercises: -- the first one aims at retrieving information from the **Kinect** (4 hours) -- the second one aims at writing a gesture detection algorithm (4 hours) -- and the last one is a free subject exercise where you are asked to develop a simple app using the former two exercises. - -This document is a quick introduction to the **Kinect** sensor. - -# Kinect sensor - -**Kinect** is a device designed by Microsoft, initially for the **Xbox360** and **Windows**, and then also for **Xbox One**. -Its purpose is to allow controlling applications (mainly games) without any physical device, with your own body. It is then a **Natural User Interface**. - -It has first been sold in late 2010 (v1), and later in february 2012 (v2), and the windows version in july 2014. The production has ended in 2017. -But since 2019, the new **Azure Kinect** has been released. I do not have tested it yet. - -> Tip 💡 -> The word **Kinect** is a puzzle between *kinetic* (movement) and *connect*. - -## What's inside the Kinect sensor? -The **Kinect** sensor owns various sensors. -It is an horizontal bar with: -- an infrared projector, -- cameras (RGB camera, time of flight camera), -- depth sensor, -- a special microchip generating a grid to allow position calculation -- a motorized pivot to position automatically the bar towards the users -- microphones - -It allows: -- full body 3D motion capture (skeleton tracking) -- facial recognition -- voice recognition - -## Software and SDK -If you want to use the **Kinect** sensor v2, you need to use the [**Kinect for Windows SDK 2.0**](https://www.microsoft.com/en-us/download/details.aspx?id=44561). You can then use C# (XAML), C++ or VB.NET. -However, due to its released date, it is not possible to use it with .NET Core or MAUI. You have to use a **.NET Framework** project to develop for the **Kinect**. - -# Course of the practical work -You have only 1 hour of introduction in theater, and then 14 hours of practical work. This can be done only in the **C21** room where the **Kinect SDK** is installed. -> ⚠️ Available material ⚠️ -> Due to the small number of **Kinect** sensors owned by IUT Clermont Auvergne, it is not possible to borrow one for the period, a weekend, or a night. If you want to work with the sensor outside of the practical work, you can borrow one during the day, if it is not used by another group. But all sensors should be returned at the end of the day. - -You have three exercises to realize. It is advised to use: -- 4 to 6 hours for the first one, -- 4 to 6 hours for the second one, -- 2 to 6 hours for the third one. - -Some parts of the exercises are mandatory to access the next exercise, some are not. - -It is advised to organized yourself: -- before practical work: - - study the advised themes via resources given in the subjects, - - prepare your questions if you have some -- during the practical work: - - realize the different tasks - - validate your new skills acquisition with your teacher -- after the practical work: - - update and analyze your *to do list* - - check the skills that have not been vaidated yet with your teacher. - -# Evaluation - -You will be evaluated three times (one for each exercise). It will be done during the practical works. -In order to help you, we deliver you a *skill list* that you will have to fill by validating skills with your teacher. -To obtain a validation, you will have to prove your skill knowledge to your teacher through an oral interview or a test. -The final note will be composed of all the validated skills by the teacher at the end of the last minute of the last practical work hour. - -Exercise | Subject | Coefficient ---- | --- | --- -1 | Kinect Streams | 7 -2.1 | Gesture Recognition (Bases & Postures) | 3 -2.2 | Gesture Recognition (Dynamic Gestures) | 2 -2.3 | Gesture Recognition (Mapping) | 2 -3 | Free App | 7 - ---- - -Copyright © 2023-2024 Marc Chevaldonné \ No newline at end of file diff --git a/images/after_the_gold_rush.jpg b/images/after_the_gold_rush.jpg deleted file mode 100644 index 407b2a0..0000000 Binary files a/images/after_the_gold_rush.jpg and /dev/null differ diff --git a/images/as_is.jpg b/images/as_is.jpg deleted file mode 100644 index 6ebeb1a..0000000 Binary files a/images/as_is.jpg and /dev/null differ diff --git a/images/back_in_the_usa.jpg b/images/back_in_the_usa.jpg deleted file mode 100644 index 9dc0128..0000000 Binary files a/images/back_in_the_usa.jpg and /dev/null differ diff --git a/images/black_stars.jpg b/images/black_stars.jpg deleted file mode 100644 index 6f23b92..0000000 Binary files a/images/black_stars.jpg and /dev/null differ diff --git a/images/blues_and_roots.jpg b/images/blues_and_roots.jpg deleted file mode 100644 index 33bb7e4..0000000 Binary files a/images/blues_and_roots.jpg and /dev/null differ diff --git a/images/bozilo.jpg b/images/bozilo.jpg deleted file mode 100644 index d7680e8..0000000 Binary files a/images/bozilo.jpg and /dev/null differ diff --git a/images/carolina_shout.jpg b/images/carolina_shout.jpg deleted file mode 100644 index ea183d1..0000000 Binary files a/images/carolina_shout.jpg and /dev/null differ diff --git a/images/darkness_on_the_edge_of_town.jpg b/images/darkness_on_the_edge_of_town.jpg deleted file mode 100644 index cf85910..0000000 Binary files a/images/darkness_on_the_edge_of_town.jpg and /dev/null differ diff --git a/images/dracula.jpg b/images/dracula.jpg deleted file mode 100644 index 6e1a654..0000000 Binary files a/images/dracula.jpg and /dev/null differ diff --git a/images/fats_1935_1936.jpg b/images/fats_1935_1936.jpg deleted file mode 100644 index 346394b..0000000 Binary files a/images/fats_1935_1936.jpg and /dev/null differ diff --git a/images/forsubjects/IR.PNG b/images/forsubjects/IR.PNG deleted file mode 100644 index 441307a..0000000 Binary files a/images/forsubjects/IR.PNG and /dev/null differ diff --git a/images/forsubjects/body.PNG b/images/forsubjects/body.PNG deleted file mode 100644 index d074d49..0000000 Binary files a/images/forsubjects/body.PNG and /dev/null differ diff --git a/images/forsubjects/color.PNG b/images/forsubjects/color.PNG deleted file mode 100644 index ae03710..0000000 Binary files a/images/forsubjects/color.PNG and /dev/null differ diff --git a/images/forsubjects/depth.PNG b/images/forsubjects/depth.PNG deleted file mode 100644 index 4784c47..0000000 Binary files a/images/forsubjects/depth.PNG and /dev/null differ diff --git a/images/forsubjects/sketch01.png b/images/forsubjects/sketch01.png deleted file mode 100644 index 66b21e2..0000000 Binary files a/images/forsubjects/sketch01.png and /dev/null differ diff --git a/images/hypersuites.jpg b/images/hypersuites.jpg deleted file mode 100644 index 7c18f64..0000000 Binary files a/images/hypersuites.jpg and /dev/null differ diff --git a/images/in_the_court_of_the_crimson_king.jpg b/images/in_the_court_of_the_crimson_king.jpg deleted file mode 100644 index 4fb21ba..0000000 Binary files a/images/in_the_court_of_the_crimson_king.jpg and /dev/null differ diff --git a/images/just_jazz.jpg b/images/just_jazz.jpg deleted file mode 100644 index b529949..0000000 Binary files a/images/just_jazz.jpg and /dev/null differ diff --git a/images/live_at_fip.jpg b/images/live_at_fip.jpg deleted file mode 100644 index 3a794aa..0000000 Binary files a/images/live_at_fip.jpg and /dev/null differ diff --git a/images/loaded.jpg b/images/loaded.jpg deleted file mode 100644 index 96d77bc..0000000 Binary files a/images/loaded.jpg and /dev/null differ diff --git a/images/look_out.jpg b/images/look_out.jpg deleted file mode 100644 index d723eab..0000000 Binary files a/images/look_out.jpg and /dev/null differ diff --git a/images/moanin.jpg b/images/moanin.jpg deleted file mode 100644 index 7009672..0000000 Binary files a/images/moanin.jpg and /dev/null differ diff --git a/images/modernistic.jpg b/images/modernistic.jpg deleted file mode 100644 index beab172..0000000 Binary files a/images/modernistic.jpg and /dev/null differ diff --git a/images/monk_s_music.jpg b/images/monk_s_music.jpg deleted file mode 100644 index 68e2529..0000000 Binary files a/images/monk_s_music.jpg and /dev/null differ diff --git a/images/renaissance_man.jpg b/images/renaissance_man.jpg deleted file mode 100644 index 8e0f9cd..0000000 Binary files a/images/renaissance_man.jpg and /dev/null differ diff --git a/images/sarah_vaughan.jpg b/images/sarah_vaughan.jpg deleted file mode 100644 index 646f7ae..0000000 Binary files a/images/sarah_vaughan.jpg and /dev/null differ diff --git a/images/scalarproduct.png b/images/scalarproduct.png deleted file mode 100644 index 2353655..0000000 Binary files a/images/scalarproduct.png and /dev/null differ diff --git a/images/special_identity.jpg b/images/special_identity.jpg deleted file mode 100644 index f472e8f..0000000 Binary files a/images/special_identity.jpg and /dev/null differ diff --git a/images/sweet_return.jpg b/images/sweet_return.jpg deleted file mode 100644 index 35653c1..0000000 Binary files a/images/sweet_return.jpg and /dev/null differ diff --git a/images/symphonie_fantastique.jpg b/images/symphonie_fantastique.jpg deleted file mode 100644 index ece7b53..0000000 Binary files a/images/symphonie_fantastique.jpg and /dev/null differ diff --git a/images/the_magic_of_ju-ju.jpg b/images/the_magic_of_ju-ju.jpg deleted file mode 100644 index ec489c8..0000000 Binary files a/images/the_magic_of_ju-ju.jpg and /dev/null differ diff --git a/images/trident.jpg b/images/trident.jpg deleted file mode 100644 index b0471f4..0000000 Binary files a/images/trident.jpg and /dev/null differ diff --git a/images/where_have_i_known_you_before.jpg b/images/where_have_i_known_you_before.jpg deleted file mode 100644 index 1f97f33..0000000 Binary files a/images/where_have_i_known_you_before.jpg and /dev/null differ