diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index b9a9f6e..8fff6bd 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index b9a9f6e..8fff6bd 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.config b/SubCabinetSolution/App.config index d0606fc..89c5774 100644 --- a/SubCabinetSolution/App.config +++ b/SubCabinetSolution/App.config @@ -7,7 +7,7 @@ - + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index b9a9f6e..8fff6bd 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.config b/SubCabinetSolution/App.config index d0606fc..89c5774 100644 --- a/SubCabinetSolution/App.config +++ b/SubCabinetSolution/App.config @@ -7,7 +7,7 @@ - + diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 0db8e57..7e12d8f 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -121,6 +121,9 @@ + + ..\packages\System.Drawing.Common.5.0.3\lib\net461\System.Drawing.Common.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll @@ -130,9 +133,10 @@ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll True - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Text.Encodings.Web.5.0.0\lib\net461\System.Text.Encodings.Web.dll @@ -148,6 +152,7 @@ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll True + ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll @@ -425,7 +430,6 @@ - @@ -450,6 +454,8 @@ + + @@ -468,4 +474,6 @@ + + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index b9a9f6e..8fff6bd 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.config b/SubCabinetSolution/App.config index d0606fc..89c5774 100644 --- a/SubCabinetSolution/App.config +++ b/SubCabinetSolution/App.config @@ -7,7 +7,7 @@ - + diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 0db8e57..7e12d8f 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -121,6 +121,9 @@ + + ..\packages\System.Drawing.Common.5.0.3\lib\net461\System.Drawing.Common.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll @@ -130,9 +133,10 @@ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll True - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Text.Encodings.Web.5.0.0\lib\net461\System.Text.Encodings.Web.dll @@ -148,6 +152,7 @@ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll True + ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll @@ -425,7 +430,6 @@ - @@ -450,6 +454,8 @@ + + @@ -468,4 +474,6 @@ + + \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/MainViewModel.cs b/SubCabinetSolution/ViewModel/MainViewModel.cs index 974cbbc..e1d7651 100644 --- a/SubCabinetSolution/ViewModel/MainViewModel.cs +++ b/SubCabinetSolution/ViewModel/MainViewModel.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.ObjectModel; using System.Data; using System.Diagnostics; @@ -6,9 +5,7 @@ using System.Drawing.Imaging; using System.IO; using System.Linq; -using System.Threading; using System.Windows; -using System.Windows.Threading; using AForge.Video.DirectShow; using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; @@ -151,18 +148,18 @@ //捕捉画面帧,TODO 人脸检测 window.CameraPreviewPlayer.NewFrame += delegate(object sender, ref Bitmap bitmap) { - // var faceDetector = new FaceDetector(); - // var skBitmap = SKBitmap.Decode(BitmapToBytes(bitmap)); - // var faceInfos = faceDetector.Detect(skBitmap); - // Debug.WriteLine($@"识别到的人脸数量:{faceInfos.Length} 个人脸信息"); - // foreach (var info in faceInfos) - // { - // Debug.WriteLine($"{info.Score:f8}\t{info.Location}"); - // } + var faceDetector = new FaceDetector(); + var skBitmap = SKBitmap.Decode(BitmapToBytes(bitmap)); + var faceInfos = faceDetector.Detect(skBitmap); + Debug.WriteLine($@"识别到的人脸数量:{faceInfos.Length} 个人脸信息"); + foreach (var info in faceInfos) + { + Debug.WriteLine($"{info.Score:f8}\t{info.Location}"); + } }; window.CameraPreviewPlayer.Start(); window.CameraFormsHost.Visibility = Visibility.Visible; - + // Dispatcher.CurrentDispatcher.BeginInvoke(new ThreadStart(delegate { Debug.WriteLine(DateTime.Now); })); } } diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index b9a9f6e..8fff6bd 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.config b/SubCabinetSolution/App.config index d0606fc..89c5774 100644 --- a/SubCabinetSolution/App.config +++ b/SubCabinetSolution/App.config @@ -7,7 +7,7 @@ - + diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 0db8e57..7e12d8f 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -121,6 +121,9 @@ + + ..\packages\System.Drawing.Common.5.0.3\lib\net461\System.Drawing.Common.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll @@ -130,9 +133,10 @@ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll True - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Text.Encodings.Web.5.0.0\lib\net461\System.Text.Encodings.Web.dll @@ -148,6 +152,7 @@ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll True + ..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll @@ -425,7 +430,6 @@ - @@ -450,6 +454,8 @@ + + @@ -468,4 +474,6 @@ + + \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/MainViewModel.cs b/SubCabinetSolution/ViewModel/MainViewModel.cs index 974cbbc..e1d7651 100644 --- a/SubCabinetSolution/ViewModel/MainViewModel.cs +++ b/SubCabinetSolution/ViewModel/MainViewModel.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.ObjectModel; using System.Data; using System.Diagnostics; @@ -6,9 +5,7 @@ using System.Drawing.Imaging; using System.IO; using System.Linq; -using System.Threading; using System.Windows; -using System.Windows.Threading; using AForge.Video.DirectShow; using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; @@ -151,18 +148,18 @@ //捕捉画面帧,TODO 人脸检测 window.CameraPreviewPlayer.NewFrame += delegate(object sender, ref Bitmap bitmap) { - // var faceDetector = new FaceDetector(); - // var skBitmap = SKBitmap.Decode(BitmapToBytes(bitmap)); - // var faceInfos = faceDetector.Detect(skBitmap); - // Debug.WriteLine($@"识别到的人脸数量:{faceInfos.Length} 个人脸信息"); - // foreach (var info in faceInfos) - // { - // Debug.WriteLine($"{info.Score:f8}\t{info.Location}"); - // } + var faceDetector = new FaceDetector(); + var skBitmap = SKBitmap.Decode(BitmapToBytes(bitmap)); + var faceInfos = faceDetector.Detect(skBitmap); + Debug.WriteLine($@"识别到的人脸数量:{faceInfos.Length} 个人脸信息"); + foreach (var info in faceInfos) + { + Debug.WriteLine($"{info.Score:f8}\t{info.Location}"); + } }; window.CameraPreviewPlayer.Start(); window.CameraFormsHost.Visibility = Visibility.Visible; - + // Dispatcher.CurrentDispatcher.BeginInvoke(new ThreadStart(delegate { Debug.WriteLine(DateTime.Now); })); } } diff --git a/SubCabinetSolution/packages.config b/SubCabinetSolution/packages.config index b732c9e..0f50793 100644 --- a/SubCabinetSolution/packages.config +++ b/SubCabinetSolution/packages.config @@ -24,9 +24,10 @@ + + - @@ -49,5 +50,7 @@ + + \ No newline at end of file