Browse Source

made finger detection (especially thumb) more stable

Alexander Hendrich 7 years ago
parent
commit
f22fd2def0

BIN
.vs/bbiwarg/v14/.suo


BIN
bbiwarg.v12.suo


+ 6 - 6
bbiwarg/Parameters.cs

@@ -195,12 +195,12 @@ namespace BBIWARG
         /// <summary>
         /// the number of missed slices until the trail expansion stops
         /// </summary>
-        public static readonly int FingerMaxGapCounter = 3;
+        public static readonly int FingerMaxGapCounter = 4;
 
         /// <summary>
         /// the maximum slice length difference of two consecutive slices (used to drop outliers)
         /// </summary>
-        public static int FingerMaxSliceLengthDifferencePerStep { get { return InputSource == InputType.RS300 ? 10 : 5; } }
+        public static int FingerMaxSliceLengthDifferencePerStep { get { return InputSource == InputType.RS300 ? 20 : 5; } }
 
         /// <summary>
         /// maximum finger slice length (in pixels)
@@ -210,12 +210,12 @@ namespace BBIWARG
         /// <summary>
         /// maximum finger slice length (in mm)
         /// </summary>
-        public static float FingerMaxWidth3D { get { return InputSource == InputType.RS300 ? 50.0f : 35.0f; } }
+        public static float FingerMaxWidth3D { get { return InputSource == InputType.RS300 ? 70.0f : 35.0f; } }
 
         /// <summary>
         /// the minimum number of slices a finger must have
         /// </summary>
-        public static readonly int FingerMinNumSlices = 20;
+        public static readonly int FingerMinNumSlices = 15;
 
         // TODO remove and replace with 3Dwidth
 
@@ -227,7 +227,7 @@ namespace BBIWARG
         /// <summary>
         /// the number of slices used to calculate the start and end directions
         /// </summary>
-        public static readonly int FingerNumSlicesForRelativeDirection = 5;
+        public static readonly int FingerNumSlicesForRelativeDirection = 10;
 
         /// <summary>
         /// the distance of a point to be considered beside the finger (in pixels)
@@ -237,7 +237,7 @@ namespace BBIWARG
         /// <summary>
         /// the number of slices that are removed when the finger expansion starts in opposite direction (because initial slices don't have the correct direction)
         /// </summary>
-        public static readonly int FingerRemoveNumSlicesForCorrection = 10;
+        public static readonly int FingerRemoveNumSlicesForCorrection = 5;
 
         #endregion finger detection
 

+ 10 - 3
bbiwarg/Recognition/FingerRecognition/FingerSliceTrail.cs

@@ -89,6 +89,7 @@ namespace BBIWARG.Recognition.FingerRecognition
         public FingerSliceTrail(FingerSlice slice)
         {
             Slices = new List<FingerSlice>();
+            Slices.Capacity = 200;
             addSlice(slice);
             lineSegmentUpToDate = false;
             fittedDirectionUpToDate = false;
@@ -107,9 +108,15 @@ namespace BBIWARG.Recognition.FingerRecognition
         /// <param name="slice">the slice that should be added</param>
         public void addSlice(FingerSlice slice)
         {
-            Slices.Add(slice);
-            lineSegmentUpToDate = false;
-            fittedDirectionUpToDate = false;
+            try
+            {
+                Slices.Add(slice);
+                lineSegmentUpToDate = false;
+                fittedDirectionUpToDate = false;
+            }
+            catch (OutOfMemoryException e) {
+                // do nothing...
+            }
         }
 
         /// <summary>

+ 2 - 2
bbiwarg/bbiwarg.csproj

@@ -5,7 +5,7 @@
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{12271049-82D6-436D-A51E-E6614C8E9C50}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
+    <OutputType>Exe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>BBIWARG</RootNamespace>
     <AssemblyName>bbiwarg</AssemblyName>
@@ -42,7 +42,7 @@
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
     <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
+    <Optimize>false</Optimize>
     <OutputPath>bin\Release\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>