├── .gitignore
├── Calculator
├── CSDataProcessor.cs
├── Calculator.csproj
├── IDataProcessor.cs
└── Properties
│ └── AssemblyInfo.cs
├── DataModule
├── DataManager.cs
├── DataModule.csproj
├── Model
│ ├── DataModel.cs
│ └── SegmentedWordModel.cs
└── Properties
│ └── AssemblyInfo.cs
├── EducationSystem
├── AbstractKinectFramesHandler.cs
├── ActiveUserDetector.cs
├── App.config
├── App.xaml
├── App.xaml.cs
├── EducationSystem.csproj
├── GameInformationModel.cs
├── GameIntroductionPage.xaml
├── GameIntroductionPage.xaml.cs
├── GameOverPage.xaml
├── GameOverPage.xaml.cs
├── GamePage.xaml
├── GamePage.xaml.cs
├── GamePlayPage.xaml
├── GamePlayPage.xaml.cs
├── GameSelectionPage.xaml
├── GameSelectionPage.xaml.cs
├── HomePage.xaml
├── HomePage.xaml.cs
├── KinectState.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── SignNumGame
│ ├── GameManager.cs
│ ├── GameSignNumPlayPage.xaml
│ ├── GameSignNumPlayPage.xaml.cs
│ ├── Grid.cs
│ ├── Point.cs
│ └── Tile.cs
├── SplashPage.xaml
├── SplashPage.xaml.cs
└── util
│ ├── AutoNotifyPropertyChanged.cs
│ └── ImagePathConverter.cs
├── EmguTest
├── App.config
├── EmguTest.csproj
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── PointHelper.cs
├── Program.cs
└── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── GestureComparison
└── src
│ └── validation
│ ├── abstract_classes.py
│ ├── body_box_extractor.py
│ ├── body_box_presenter.py
│ ├── bspline_preprocessor.py
│ ├── bspline_presenter.py
│ ├── csv_reader.py
│ ├── data_checker.py
│ ├── dtw_presenter.py
│ ├── dtw_processor.py
│ ├── hand_presenter.py
│ ├── hand_selector.py
│ ├── task_runner.py
│ └── validation_test.py
├── HandDetector
├── .project
├── .pydevproject
├── App.config
├── App.xaml
├── App.xaml.cs
├── Colorizer.cs
├── ConsoleManager.cs
├── DBManager.cs
├── DataTransferEventArgs.cs
├── HandDetector.csproj
├── HandShapeClassifier.cs
├── HandShapeModel.cs
├── ISubject.cs
├── ImageConverter.cs
├── KalmanFilter.cs
├── KinectController.cs
├── KinectSDKController.cs
├── KinectStudioController.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Model
│ ├── MyJoint.cs
│ ├── MyJointType.cs
│ └── MySkeleton.cs
├── OpenCVController.cs
├── OpenNIController.cs
├── PointHelper.cs
├── Properties
│ ├── Annotations.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── ReadWriteCsv.cs
├── SignWordModel.cs
├── Threshold.cs
├── TrackBar.xaml
├── TrackBar.xaml.cs
├── VideoProcessor.cs
├── VisualData.cs
├── packages.config
└── win32API.cs
├── HandShapeDetector
├── .idea
│ ├── .name
│ ├── HandShapeDetector.iml
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ ├── vcs.xml
│ └── workspace.xml
├── .metadata
│ ├── .lock
│ ├── .plugins
│ │ ├── org.eclipse.core.resources
│ │ │ ├── .root
│ │ │ │ ├── .indexes
│ │ │ │ │ ├── history.version
│ │ │ │ │ ├── properties.index
│ │ │ │ │ └── properties.version
│ │ │ │ └── 7.tree
│ │ │ └── .safetable
│ │ │ │ └── org.eclipse.core.resources
│ │ ├── org.eclipse.core.runtime
│ │ │ └── .settings
│ │ │ │ ├── org.eclipse.core.resources.prefs
│ │ │ │ ├── org.eclipse.debug.ui.prefs
│ │ │ │ ├── org.eclipse.jdt.ui.prefs
│ │ │ │ ├── org.eclipse.ui.ide.prefs
│ │ │ │ └── org.eclipse.ui.prefs
│ │ ├── org.eclipse.e4.workbench
│ │ │ └── workbench.xmi
│ │ ├── org.eclipse.equinox.p2.ui
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.jdt.core
│ │ │ ├── assumedExternalFilesCache
│ │ │ ├── externalFilesCache
│ │ │ ├── invalidArchivesCache
│ │ │ ├── nonChainingJarsCache
│ │ │ └── variablesAndContainers.dat
│ │ ├── org.eclipse.jdt.ui
│ │ │ ├── OpenTypeHistory.xml
│ │ │ ├── QualifiedTypeNameHistory.xml
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.pde.core
│ │ │ └── .cache
│ │ │ │ └── clean-cache.properties
│ │ ├── org.eclipse.ui.ide
│ │ │ └── dialog_settings.xml
│ │ └── org.eclipse.ui.workbench
│ │ │ ├── dialog_settings.xml
│ │ │ └── workingsets.xml
│ └── version.ini
├── .project
├── .pydevproject
└── src
│ ├── CSVFrameData.py
│ ├── FrameConverter.py
│ ├── SLServer.py
│ ├── VideoFrameData.py
│ ├── basic.py
│ ├── caffeDL.py
│ ├── caffe_server_handler.py
│ ├── clusterBase.py
│ ├── configGenerator.py
│ ├── constant_numbers.py
│ ├── echo_client.py
│ ├── echo_server.py
│ ├── hand_shape_client.py
│ ├── hand_shape_client_test.py
│ ├── hand_shape_server.py
│ ├── hand_shape_server_test.py
│ ├── hodmodule.py
│ ├── hogmodule.py
│ ├── kMedoid.py
│ ├── load.py
│ ├── slWord.py
│ ├── svmmodule.py
│ ├── train.py
│ └── try.py
├── KinectSignLanguage.sln
├── KinectSignLanguage.sln.DotSettings
├── LICENSE
├── LauncherCMD
├── App.config
├── LauncherCMD.cs
└── LauncherCMD.csproj
├── LauncherKinect
├── App.xaml
├── App.xaml.cs
├── Images
│ ├── CURElogo.png
│ ├── CheckedHover.png
│ ├── CheckedNormal.png
│ ├── Kinect.ico
│ ├── Logo.png
│ ├── Status.png
│ ├── UncheckedHover.png
│ └── UncheckedNormal.png
├── LauncherKinect.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── app.config
├── OpenCV
├── OpenCV.vcxproj
├── OpenCV.vcxproj.filters
├── PropertySheet.props
├── example.txt
├── example1.txt
├── hog_template.txt
├── hog_template5.txt
├── main.cpp
└── mog.cpp
├── OpenNI2
├── NiWrapper.Net.dll
├── NiWrapper.dll
├── OpenNI.ini
├── OpenNI2.dll
└── OpenNI2
│ └── Drivers
│ ├── Kinect.dll
│ ├── OniFile.dll
│ ├── PS1080.dll
│ ├── PS1080.ini
│ └── PSLink.dll
├── Project1
├── Project1.vcxproj
└── Project1.vcxproj.filters
├── README.md
├── RecognitionSystem
├── Classifier.cs
├── DataProcessor.cs
├── DataStorage
│ ├── FrameData.cs
│ ├── JointType.cs
│ ├── Person.cs
│ └── SegmentationData.cs
├── DataTransferEventArgs.cs
├── DataWarehouse.cs
├── FacialExpressionModule.cs
├── FeatureSelector.cs
├── GestureModule.cs
├── HMM.cs
├── ISubject.cs
├── LeariningModel.cs
├── MotionTrackingModule.cs
├── NLPModule.cs
├── Postprocessor.cs
├── Properties
│ └── AssemblyInfo.cs
├── RecognitionController.cs
├── RecognitionSystem.csproj
├── SVM.cs
├── SegmentationModule.cs
├── StaticTools
│ ├── ConsoleManager.cs
│ ├── StaticParams.cs
│ └── UtilityTools.cs
└── VisualFeatureModule.cs
├── SLDebugger
├── App.config
├── App.xaml
├── App.xaml.cs
├── ConsoleManager.cs
├── DataManager.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Module
│ ├── ConfigReader.cs
│ ├── DBReader.cs
│ ├── DataReader.cs
│ └── XMLReader.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── SLDebugger.csproj
├── StaticParams
│ ├── Config.xml
│ ├── DataType.cs
│ ├── FileName.cs
│ └── SegmentType.cs
├── View
│ ├── ChartView.xaml
│ ├── ChartView.xaml.cs
│ ├── ControlComponentView.cs
│ ├── DisplayRange.cs
│ ├── SegWordShowBox.xaml
│ ├── SegWordShowBox.xaml.cs
│ ├── TrajectoryView.cs
│ └── ViewportAxesRangeRestriction.cs
└── ViewModel
│ └── TwoDimensionViewModel.cs
├── SignLanguageEducationSystem
├── App.config
├── App.xaml
├── App.xaml.cs
├── AutoNotifyPropertyChanged.cs
├── DTWViewModel.cs
├── DTWWindow.xaml
├── DTWWindow.xaml.cs
├── HomePage.xaml
├── HomePage.xaml.cs
├── Images
│ ├── back01.png
│ ├── banner.png
│ ├── cuhklogo.png
│ ├── curelogo.png
│ ├── learn.png
│ ├── question.jpg
│ └── restart.png
├── Infrastructure
│ ├── MultiSelect
│ │ ├── IListItemConverter.cs
│ │ ├── MultiSelectorBehaviours.cs
│ │ ├── RelayCommand.cs
│ │ └── TwoListSynchronizer.cs
│ ├── StrongTypingHelper.cs
│ └── ViewModelBase.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Model
│ └── SignWord.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── README.md
├── SignBrowserPage.xaml
├── SignBrowserPage.xaml.cs
├── SignLanguageEducationSystem.csproj
├── SignModel.cs
├── SignWordPage.xaml
├── SignWordPage.xaml.cs
├── StartPage.xaml
├── StartPage.xaml.cs
├── SystemStatusCollection.cs
└── packages.config
├── UML
├── CodeGeneration.Log.xml
├── ModelDefinition
│ ├── Package_1413.uml
│ └── sign_language.uml
├── RecognitionUML.classdiagram
├── RecognitionUML.classdiagram.layout
└── UML.modelproj
├── UnitTest
├── Properties
│ └── AssemblyInfo.cs
├── UnitTest.csproj
└── UnitTest1.cs
├── XEDParser
├── App.config
├── App.xaml
├── App.xaml.cs
├── Colorizer.cs
├── ConsoleManager.cs
├── ImageConverter.cs
├── KinectStudioController.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── ImageConverter.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── XEDParser.csproj
├── XEDParser.rar
└── win32API.cs
└── readme
/Calculator/IDataProcessor.cs:
--------------------------------------------------------------------------------
1 | // author: fyhuang
2 | // created time:2013/11/8 18:47:56
3 | // organizatioin:CURE lab, CUHK
4 | // copyright: 2013-2015
5 | // CLR: 4.0.30319.18052
6 | // project link:https://github.com/huangfuyang/Sign-Language-with-Kinect
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 |
13 |
14 | namespace CURELab.SignLanguage.Calculator
15 | {
16 | ///
17 | /// add summary here
18 | ///
19 | public interface IDataProcessor
20 | {
21 | void GaussianFilter(ref double[] data);
22 |
23 | double[] MeanFilter(double[] data);
24 |
25 | double[] CalVelocity(double[] data);
26 |
27 | double[] CalAcceleration(double[] data);
28 |
29 |
30 |
31 | }
32 | }
--------------------------------------------------------------------------------
/Calculator/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Calculator")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Calculator")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("f2e71ec0-d95a-4e2a-97db-1540fe3316df")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DataModule/DataModule.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {E1A45C64-6EDA-4DD7-BEAD-E3F998A89E32}
8 | Library
9 | Properties
10 | CURELab.SignLanguage.DataModule
11 | DataModule
12 | v4.0
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
56 |
--------------------------------------------------------------------------------
/DataModule/Model/DataModel.cs:
--------------------------------------------------------------------------------
1 | // author: fyhuang
2 | // created time:2013/10/16 18:14:55
3 | // organizatioin:CURE lab, CUHK
4 | // copyright: 2013-2015
5 | // CLR: 4.0.30319.18052
6 | // project link:https://github.com/huangfuyang/Sign-Language-with-Kinect
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 | using System.Windows.Media.Media3D;
14 |
15 | namespace CURELab.SignLanguage.DataModule
16 | {
17 | ///
18 | /// add summary here
19 | ///
20 | public class DataModel
21 | {
22 | public int timeStamp;
23 | public double v_right;
24 | public double v_left;
25 | public double a_right;
26 | public double a_left;
27 | public double angle_right;
28 | public double angle_left;
29 | public Vector3D position_right;
30 | public Vector3D position_left;
31 | public bool isSegByAcc;
32 | public bool isSegByAngle;
33 | public Point position_2D_right;
34 | public Point position_2D_left;
35 | public DataModel()
36 | {
37 | timeStamp = -1;
38 | }
39 | }
40 |
41 |
42 | public struct Point
43 | {
44 | public double x, y;
45 | }
46 | }
--------------------------------------------------------------------------------
/DataModule/Model/SegmentedWordModel.cs:
--------------------------------------------------------------------------------
1 | // author: fyhuang
2 | // created time:2013/10/17 17:23:52
3 | // organizatioin:CURE lab, CUHK
4 | // copyright: 2013-2015
5 | // CLR: 4.0.30319.18052
6 | // project link:https://github.com/huangfuyang/Sign-Language-with-Kinect
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 |
14 |
15 | namespace CURELab.SignLanguage.DataModule
16 | {
17 | ///
18 | /// add summary here
19 | ///
20 |
21 | public class SegmentedWordCollection : List
22 | {
23 | private const int TOTAL_POINTS = 1000;
24 |
25 | public SegmentedWordCollection()
26 | : base(TOTAL_POINTS) // here i set how much values to show
27 | {
28 | }
29 | }
30 |
31 | public class SegmentedWordModel
32 | {
33 |
34 |
35 | public string Word { get; set; }
36 |
37 | public int StartTime { get; set; }
38 | public int EndTime { get; set; }
39 |
40 | public SegmentedWordModel(string word, int from, int to)
41 | {
42 | this.Word = word;
43 | this.StartTime = from;
44 | this.EndTime = to;
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/DataModule/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("DataModule")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("DataModule")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("703b7b33-f081-4131-8b33-29556da536ae")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/EducationSystem/ActiveUserDetector.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Collections.Generic;
3 | using Microsoft.Kinect.Toolkit.Controls;
4 | namespace EducationSystem
5 | {
6 | class ActiveUserDetector : AbstractKinectFramesHandler
7 | {
8 |
9 | private int _activeUserCount;
10 | public int ActiveUserCount
11 | {
12 | get { return _activeUserCount; }
13 | set { SetProperty(ref _activeUserCount, value, true); }
14 | }
15 |
16 | public override void HandPointersCallback(long timestamp, HandPointer[] handPointers)
17 | {
18 | HashSet activeUserIds = new HashSet();
19 |
20 | foreach (HandPointer handPointer in handPointers)
21 | {
22 | if (handPointer.IsActive)
23 | {
24 | activeUserIds.Add(handPointer.TrackingId);
25 | }
26 | }
27 |
28 | ActiveUserCount = activeUserIds.Count;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/EducationSystem/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/EducationSystem/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/EducationSystem/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace EducationSystem
4 | {
5 | ///
6 | /// Interaction logic for App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/EducationSystem/GameInformationModel.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Xml;
3 | namespace EducationSystem
4 | {
5 | public class GameInformationModel
6 | {
7 | private string _title;
8 | public string Title
9 | {
10 | get { return _title; }
11 | }
12 |
13 | private string _shortDescription;
14 | public string ShortDescription
15 | {
16 | get { return _shortDescription; }
17 | }
18 |
19 | private string _description;
20 | public string Description
21 | {
22 | get { return _description; }
23 | }
24 |
25 | private string _gamePageType;
26 | public string GamePageType
27 | {
28 | get { return _gamePageType; }
29 | }
30 |
31 | public GameInformationModel(XmlNode source)
32 | {
33 | _title = source["Title"].InnerText;
34 | _shortDescription = source["ShortDescription"].InnerText;
35 | _description = source["Description"].InnerText;
36 | _gamePageType = source["GamePageType"].InnerText;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/EducationSystem/GameIntroductionPage.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/EducationSystem/GameIntroductionPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Controls;
3 | using System.Windows.Media.Imaging;
4 |
5 | namespace EducationSystem
6 | {
7 | ///
8 | /// Interaction logic for GameIntroductionPage.xaml
9 | ///
10 | public partial class GameIntroductionPage : Page
11 | {
12 |
13 | private string _gameDescriptionImagePath = "Data/Images/back01.png";
14 | public BitmapImage GameDescriptionImage
15 | {
16 | get
17 | {
18 | BitmapImage bi = new BitmapImage();
19 | bi.BeginInit();
20 | bi.UriSource = new Uri(_gameDescriptionImagePath, UriKind.Relative);
21 | bi.EndInit();
22 | return bi;
23 | }
24 | }
25 |
26 | public GameIntroductionPage(GameInformationModel informationModel)
27 | {
28 | this.DataContext = informationModel;
29 | _gameDescriptionImagePath = "Images/Signing.png";
30 | InitializeComponent();
31 | }
32 |
33 | private void btnStartGame_Click(object sender, System.Windows.RoutedEventArgs e)
34 | {
35 | string gamePlayTypeString = String.Format("{0}.{1}", this.GetType().Namespace, ((GameInformationModel)this.DataContext).GamePageType);
36 | Page gamePlayPage = (Page)Activator.CreateInstance(Type.GetType(gamePlayTypeString));
37 | this.NavigationService.Navigate(gamePlayPage);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/EducationSystem/GameOverPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/EducationSystem/GameOverPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace EducationSystem
4 | {
5 | ///
6 | /// Interaction logic for GameOverPage.xaml
7 | ///
8 | public partial class GameOverPage : Page
9 | {
10 | public GameOverPage()
11 | {
12 | InitializeComponent();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/EducationSystem/GamePage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Data;
4 |
5 | namespace EducationSystem
6 | {
7 | ///
8 | /// Interaction logic for GamePage.xaml
9 | ///
10 | public partial class GamePage : Page
11 | {
12 | public readonly DependencyProperty ActiveUserCount = DependencyProperty.Register("ActiveUserCount", typeof(int), typeof(GamePage));
13 |
14 | private GameIntroductionPage gameIntroduction;
15 |
16 | public GamePage(GameIntroductionPage gameIntroduction)
17 | {
18 | this.gameIntroduction = gameIntroduction;
19 | InitializeComponent();
20 |
21 | ActiveUserDetector activeUserDetector = (ActiveUserDetector)this.Resources["ActiveUserDetector"];
22 | activeUserDetector.RegisterCallbackToSensor(KinectState.Instance.CurrentKinectSensor);
23 | Binding myBinding = new Binding("ActiveUserCount");
24 | myBinding.Source = activeUserDetector;
25 | this.SetBinding(this.ActiveUserCount, myBinding);
26 | }
27 |
28 | private void btnStartGame_Click(object sender, RoutedEventArgs e)
29 | {
30 | this.NavigationService.Navigate(gameIntroduction);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/EducationSystem/GamePlayPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/EducationSystem/GameSelectionPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/EducationSystem/GameSelectionPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Windows.Controls;
3 | using System.Xml;
4 | using Microsoft.Kinect.Toolkit.Controls;
5 |
6 | namespace EducationSystem
7 | {
8 | ///
9 | /// Interaction logic for GameSelectionPage.xaml
10 | ///
11 | public partial class GameSelectionPage : Page
12 | {
13 |
14 | private const string GAME_INTRODUCTION_FILE_PATH = "Data/XML/gameIntroduction.xml";
15 |
16 | public GameSelectionPage()
17 | {
18 | InitializeComponent();
19 | LoadGameInformation();
20 | }
21 |
22 | private void LoadGameInformation()
23 | {
24 | XmlDocument xmldoc = new XmlDocument();
25 | FileStream fs = new FileStream(GAME_INTRODUCTION_FILE_PATH, FileMode.Open, FileAccess.Read);
26 |
27 | xmldoc.Load(fs);
28 |
29 | ItemCollection models = GamePanel.Items;
30 | foreach (XmlNode gameInfo in xmldoc.GetElementsByTagName("GameInformation"))
31 | {
32 | models.Add(new GameInformationModel(gameInfo));
33 | }
34 | }
35 |
36 | void GameButton_Click(object sender, System.Windows.RoutedEventArgs e)
37 | {
38 | GameInformationModel gameInformationModel = (sender as KinectTileButton).Tag as GameInformationModel;
39 | GameIntroductionPage gameIntroductionPage = new GameIntroductionPage(gameInformationModel);
40 | this.NavigationService.Navigate(gameIntroductionPage);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/EducationSystem/HomePage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/EducationSystem/HomePage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Controls;
3 |
4 | namespace EducationSystem
5 | {
6 | ///
7 | /// Interaction logic for HomePage.xaml
8 | ///
9 | public partial class HomePage : Page
10 | {
11 | public HomePage()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void btnGame_Click(object sender, System.Windows.RoutedEventArgs e)
17 | {
18 | this.NavigationService.Navigate(new Uri("GameSelectionPage.xaml", UriKind.Relative));
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/EducationSystem/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/EducationSystem/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using Microsoft.Kinect.Toolkit;
3 |
4 | namespace EducationSystem
5 | {
6 | ///
7 | /// Interaction logic for MainWindow.xaml
8 | ///
9 | public partial class MainWindow : Window
10 | {
11 | public MainWindow()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void Window_Loaded(object sender, RoutedEventArgs e)
17 | {
18 | KinectSensorChooser sensorChooser = (KinectSensorChooser)this.Resources["sensorChooser"];
19 |
20 | KinectState.Instance.KinectRegion = kinectRegion;
21 |
22 | KinectState.Instance.PropertyChanged += KinectState_PropertyChanged;
23 | sensorChooser.KinectChanged += KinectState.Instance.OnKinectChanged;
24 | sensorChooser.Start();
25 | }
26 |
27 | void KinectState_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
28 | {
29 | if ("CurrentKinectSensor".Equals(e.PropertyName))
30 | {
31 | frmPageContainer.Source = new System.Uri("SplashPage.xaml", System.UriKind.RelativeOrAbsolute);
32 | }
33 | }
34 |
35 | private void Window_Closed(object sender, System.EventArgs e)
36 | {
37 | KinectState.Instance.StopKinect();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/EducationSystem/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("EducationSystem")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Microsoft")]
14 | [assembly: AssemblyProduct("EducationSystem")]
15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/EducationSystem/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18408
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EducationSystem.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/EducationSystem/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/EducationSystem/SignNumGame/GameSignNumPlayPage.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/EducationSystem/SignNumGame/Point.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace EducationSystem.SignNumGame
3 | {
4 | public class Point
5 | {
6 | public int X { get; set; }
7 | public int Y { get; set; }
8 |
9 | public Point(int x, int y)
10 | {
11 | this.X = x;
12 | this.Y = y;
13 | }
14 |
15 | public Point Add(Point other)
16 | {
17 | return new Point(this.X + other.X, this.Y + other.Y);
18 | }
19 |
20 | public override bool Equals(object obj)
21 | {
22 | if (obj == null || !(obj is Point))
23 | {
24 | return false;
25 | }
26 | else
27 | {
28 | Point point = obj as Point;
29 | return (this.X == point.X) && (this.Y == point.Y);
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/EducationSystem/SignNumGame/Tile.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace EducationSystem.SignNumGame
3 | {
4 | public class Tile
5 | {
6 | public int Value { get; set; }
7 |
8 | private Point _position;
9 | public Point Position
10 | {
11 | get { return _position; }
12 | }
13 |
14 | private Point _previousPosition;
15 | public Point PreviousPosition
16 | {
17 | get { return _previousPosition; }
18 | }
19 |
20 | public Tile MergeFrom { get; set; }
21 |
22 |
23 | public Tile(int x, int y, int value)
24 | {
25 | this.Value = value;
26 | this._position = new Point(x, y);
27 | this._previousPosition = new Point(x, y);
28 | this.MergeFrom = null;
29 | }
30 |
31 | public void UpdatePosition(Point newPosition)
32 | {
33 | _previousPosition.X = _position.X;
34 | _previousPosition.Y = _position.Y;
35 | _position.X = newPosition.X;
36 | _position.Y = newPosition.Y;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/EducationSystem/SplashPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/EducationSystem/SplashPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Controls;
3 | using System.Windows.Media;
4 | using System.Windows.Media.Imaging;
5 |
6 | namespace EducationSystem
7 | {
8 | ///
9 | /// Interaction logic for SplashPage.xaml
10 | ///
11 | public partial class SplashPage : Page
12 | {
13 | public SplashPage()
14 | {
15 | InitializeComponent();
16 |
17 | BitmapImage bi = new BitmapImage();
18 | bi.BeginInit();
19 | bi.UriSource = new Uri("Data/Images/back01.png", UriKind.Relative);
20 | bi.EndInit();
21 |
22 | ImageBrush b = new ImageBrush(bi);
23 | b.AlignmentY = 0;
24 | b.Stretch = Stretch.Fill;
25 | btnStart.Background = b;
26 | }
27 |
28 | private void btnStart_Click(object sender, System.Windows.RoutedEventArgs e)
29 | {
30 | this.NavigationService.Navigate(new Uri("HomePage.xaml", UriKind.Relative));
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/EducationSystem/util/AutoNotifyPropertyChanged.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Runtime.CompilerServices;
4 |
5 | namespace EducationSystem
6 | {
7 | public abstract class AutoNotifyPropertyChanged : INotifyPropertyChanged
8 | {
9 | public event PropertyChangedEventHandler PropertyChanged;
10 |
11 | // Checks if a property already matches a desired value. Notifies listeners only when necessary.
12 | protected bool SetProperty(ref T storage, T value, Boolean flush, [CallerMemberName] String propertyName = null)
13 | {
14 | if (!flush && object.Equals(storage, value)) return false;
15 |
16 | storage = value;
17 | this.OnPropertyChanged(propertyName);
18 | return true;
19 | }
20 |
21 | // Notifies listeners that a property value has changed.
22 | protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
23 | {
24 | var eventHandler = this.PropertyChanged;
25 | if (eventHandler != null)
26 | {
27 | eventHandler(this, new PropertyChangedEventArgs(propertyName));
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/EducationSystem/util/ImagePathConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Data;
2 | using System.Windows.Media.Imaging;
3 |
4 | namespace EducationSystem.util
5 | {
6 | class ImagePathConverter : IValueConverter
7 | {
8 | public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
9 | {
10 | BitmapImage bitmapImage = new BitmapImage();
11 |
12 | bitmapImage.BeginInit();
13 | bitmapImage.UriSource = new System.Uri(string.Format("Data/Images/SignNum/{0}.png", value), System.UriKind.RelativeOrAbsolute);
14 | bitmapImage.EndInit();
15 |
16 | return bitmapImage;
17 | }
18 |
19 | public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
20 | {
21 | throw new System.NotImplementedException();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/EmguTest/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/EmguTest/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EmguTest
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.imageBox1 = new Emgu.CV.UI.ImageBox();
33 | ((System.ComponentModel.ISupportInitialize)(this.imageBox1)).BeginInit();
34 | this.SuspendLayout();
35 | //
36 | // imageBox1
37 | //
38 | this.imageBox1.Location = new System.Drawing.Point(27, 12);
39 | this.imageBox1.Name = "imageBox1";
40 | this.imageBox1.Size = new System.Drawing.Size(760, 570);
41 | this.imageBox1.TabIndex = 2;
42 | this.imageBox1.TabStop = false;
43 | //
44 | // Form1
45 | //
46 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
48 | this.ClientSize = new System.Drawing.Size(858, 605);
49 | this.Controls.Add(this.imageBox1);
50 | this.Name = "Form1";
51 | this.Text = "Form1";
52 | this.Load += new System.EventHandler(this.Form1_Load);
53 | ((System.ComponentModel.ISupportInitialize)(this.imageBox1)).EndInit();
54 | this.ResumeLayout(false);
55 |
56 | }
57 |
58 | #endregion
59 |
60 | private Emgu.CV.UI.ImageBox imageBox1;
61 | }
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/EmguTest/PointHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace EmguTest
9 | {
10 | static class PointHelper
11 | {
12 | public static float DistanceTo(this PointF p1, PointF p2)
13 | {
14 | return (float)Math.Sqrt((p1.X - p2.X) * (p1.X - p2.X) + (p1.Y - p2.Y) * (p1.Y - p2.Y));
15 |
16 | }
17 |
18 | public static PointF add(this PointF p1, PointF p2)
19 | {
20 | return new PointF(p1.X + p2.X, p1.Y + p2.Y);
21 | }
22 | public static Point ToPoint(this PointF p)
23 | {
24 | try
25 | {
26 | int x = (int)p.X < 0 ? 0 : (int)p.X;
27 | int y = (int)p.Y < 0 ? 0 : (int)p.Y;
28 | return new Point(x, y);
29 | }
30 | catch (Exception e)
31 | {
32 | Console.WriteLine(e);
33 | }
34 | return new Point(0, 0);
35 |
36 | }
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/EmguTest/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace EmguTest
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/EmguTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("EmguTest")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("MS")]
12 | [assembly: AssemblyProduct("EmguTest")]
13 | [assembly: AssemblyCopyright("Copyright © MS 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("a9c37826-ab5d-47ff-8b5b-31a0ffafecf3")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/EmguTest/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.18444
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EmguTest.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的、缓存的 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EmguTest.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
56 | /// 方法是使用此强类型资源类。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/EmguTest/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EmguTest.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/EmguTest/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/abstract_classes.py:
--------------------------------------------------------------------------------
1 | class AbstractTask(object):
2 | def __init__(self, name):
3 | self.name = name
4 |
5 | def timing(self, run_function, data):
6 | import time
7 |
8 | start = time.clock()
9 | return_val = run_function(data)
10 | end = time.clock()
11 |
12 | print '"%s" used %fs'%(self.name, end-start)
13 |
14 | return return_val
15 |
16 | class AbstractProcessor(AbstractTask):
17 | def __init__(self, name, presenters=None):
18 | super(AbstractProcessor, self).__init__(name)
19 | self.presenters = presenters
20 |
21 | def doProcess(self, data):
22 | processed_data = self.timing(self.process, data)
23 |
24 | if(hasattr(self, 'presenters') and self.presenters is not None):
25 | for i in xrange(0, len(self.presenters)):
26 | self.presenters[i].timing(self.presenters[i].display, processed_data)
27 |
28 | return processed_data
29 |
30 |
31 | def process(self, data):
32 | raise NotImplementedError("Subclasses of AbstractProcessor should implement this!")
33 |
34 | class AbstractPresenter(AbstractTask):
35 |
36 | def __init__(self, name):
37 | super(AbstractPresenter, self).__init__(name)
38 |
39 | def display(self, data):
40 | raise NotImplementedError("Subclasses of AbstractPesenter should implement this!")
41 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/body_box_extractor.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from abstract_classes import AbstractProcessor
3 |
4 | class BodyBoxExtractor(AbstractProcessor):
5 | def __init__(self, name, presenters):
6 | super(BodyBoxExtractor, self).__init__(name, presenters)
7 |
8 | def process(self, data):
9 | raw_data = data['raw_data']
10 | names = ['head', 'shoulder_left', 'shoulder_center', 'shoulder_right', 'elbow_left', 'elbow_right', 'wrist_left', 'wrist_right', 'hand_left', 'hand_right', 'spine', 'hip_left', 'hip_center', 'hip_right']
11 | data_mappings = [('3d', (0,3)), ('color', (3,5)), ('depth', xrange(5,7))]
12 |
13 | data['body_box'] = {}
14 |
15 | for i,name in enumerate(names):
16 | selected_data = raw_data[:, i*7:i*7+7]
17 |
18 | data['body_box'][name] = {}
19 |
20 | for d,(start,end) in data_mappings:
21 | data['body_box'][name][d] = {
22 | 'first': selected_data[0, start:end],
23 | 'last': selected_data[-1, start:end],
24 | 'min': np.min(selected_data[:, start:end], axis=0),
25 | 'mean': np.mean(selected_data[:, start:end], axis=0),
26 | 'max': np.max(selected_data[:, start:end], axis=0),
27 | 'std': np.std(selected_data[:, start:end], axis=0)
28 | }
29 |
30 | return data
31 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/body_box_presenter.py:
--------------------------------------------------------------------------------
1 | from mayavi import mlab
2 | from abstract_classes import AbstractPresenter
3 | import numpy as np
4 |
5 | class BodyBoxPresenter(AbstractPresenter):
6 |
7 | colormaps = ['Blues', 'Oranges', 'Greens']
8 | currentColorIndex = 0
9 |
10 | def __init__(self, name):
11 | super(BodyBoxPresenter, self).__init__(name)
12 |
13 | def display(self, data):
14 | figBSpline = mlab.figure('Original BSpline')
15 | points = np.array([
16 | data['body_box']['shoulder_left']['3d']['mean'],
17 | data['body_box']['shoulder_right']['3d']['mean'],
18 | data['body_box']['hip_right']['3d']['mean'],
19 | data['body_box']['hip_left']['3d']['mean'],
20 | data['body_box']['shoulder_left']['3d']['mean']
21 | ])
22 | points = points[~np.all(points < 1e-6, axis=1)]
23 | mlab.plot3d(points[:,0],points[:,1],points[:,2], range(0,len(points[:,2])), tube_radius=0.0025, colormap=self.colormaps[self.currentColorIndex], figure=figBSpline)
24 | self.currentColorIndex = (self.currentColorIndex + 1) % len(self.colormaps)
25 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/bspline_preprocessor.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import scipy.interpolate as si
3 | from abstract_classes import AbstractProcessor
4 |
5 | class BSplinePreprocessor(AbstractProcessor):
6 |
7 | def __init__(self, name, smoothing, sampling_rate, presenters):
8 | super(BSplinePreprocessor, self).__init__(name, presenters)
9 | self.smoothing = smoothing
10 | self.sampling_rate = sampling_rate
11 |
12 | def process(self, data):
13 | (tck, uu) = si.splprep(data['hands'].transpose(), s=self.smoothing)
14 | space = np.linspace(0,1,self.sampling_rate)
15 |
16 | data['tck'] = tck
17 | data['uu'] = uu
18 | data['spline'] = np.array(si.splev(space, tck)).transpose()
19 |
20 | return data
21 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/bspline_presenter.py:
--------------------------------------------------------------------------------
1 | from mayavi import mlab
2 | from abstract_classes import AbstractPresenter
3 |
4 | class BSplinePresenter(AbstractPresenter):
5 |
6 | colormaps = ['Blues', 'Oranges', 'Greens']
7 | currentColorIndex = 0
8 |
9 | def __init__(self, name):
10 | super(BSplinePresenter, self).__init__(name)
11 |
12 | def display(self, data):
13 | figBSpline = mlab.figure('Original BSpline')
14 | mlab.plot3d(data['spline'][:,0], data['spline'][:,1], data['spline'][:,2], range(0,len(data['spline'][:,0])), tube_radius=0.0025, colormap=self.colormaps[self.currentColorIndex], figure=figBSpline)
15 | self.currentColorIndex = (self.currentColorIndex + 1) % len(self.colormaps)
16 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/csv_reader.py:
--------------------------------------------------------------------------------
1 | from os.path import join
2 | import numpy as np
3 |
4 | class CSVReader(object):
5 |
6 | def __init__(self, root_directory):
7 | self.root_directory = root_directory
8 |
9 | def set_file(self, filename):
10 | self.filename = filename
11 |
12 | def read(self):
13 | # Read file
14 | src_file = open(join(self.root_directory, self.filename), 'rU')
15 | read_lines = src_file.readlines()
16 | src_file.close()
17 |
18 | arr = None
19 | no_of_dropped_frame = 0
20 | for i in xrange(0,len(read_lines)):
21 | current_line = read_lines[i]
22 |
23 | if current_line.startswith('untracked'):
24 | # Ignore untracked frames and reset
25 | no_of_dropped_frame = 0
26 | elif current_line.startswith('null'):
27 | # Count number of dropped frames for interpolation
28 | no_of_dropped_frame = no_of_dropped_frame + 1
29 | else:
30 | current_line_data = np.fromstring(current_line, sep=',')
31 |
32 | if arr is None:
33 | arr = np.atleast_2d(current_line_data)
34 | else:
35 | if no_of_dropped_frame > 0:
36 | # Check for dropped frame
37 | last_data = arr[-1,:]
38 | diff_data = (current_line_data-last_data) / (no_of_dropped_frame+1)
39 |
40 | # Fill dropped frames using linear interpolation
41 | for i in xrange(1,no_of_dropped_frame+1):
42 | temp_data = last_data + diff_data * i
43 | arr = np.vstack((arr, temp_data))
44 |
45 | no_of_dropped_frame = 0
46 |
47 | arr = np.vstack((arr, current_line_data))
48 |
49 | return arr
50 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/data_checker.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from os import listdir
3 | from os.path import join,dirname,realpath,isdir
4 | import json
5 | from csv_reader import CSVReader
6 | from body_box_extractor import BodyBoxExtractor
7 |
8 | ROOT_DIRECTORY = join(dirname(realpath(sys.argv[0])), '..', '..', 'res')
9 | data_directories = [f for f in listdir(ROOT_DIRECTORY) if isdir(join(ROOT_DIRECTORY, f))]
10 | csv_reader = CSVReader(ROOT_DIRECTORY)
11 | body_box_extractor = BodyBoxExtractor('', None)
12 | check_results = {}
13 |
14 | for data_directory in data_directories:
15 | try:
16 | type_json_file = open(join(ROOT_DIRECTORY, data_directory, 'type.json'))
17 | type_data = json.load(type_json_file)
18 |
19 | csv_reader.set_file(join(data_directory, data_directory+'.csv'))
20 | skeleton_data = {'raw_data': csv_reader.read()}
21 | data = body_box_extractor.process(skeleton_data)
22 |
23 | check_results[data_directory] = type_data
24 | check_results[data_directory]['has_shoulder'] = all(abs(data['body_box']['shoulder_left']['3d']['mean']) > 0.001) and all(abs(data['body_box']['shoulder_left']['3d']['mean']) > 0.001)
25 | check_results[data_directory]['has_hip'] = all(abs(data['body_box']['hip_left']['3d']['mean']) > 0.001) and all(abs(data['body_box']['hip_right']['3d']['mean']) > 0.001)
26 |
27 | except IOError:
28 | continue
29 |
30 | selected_signs = [data_name for data_name,data in check_results.items() if data['has_hip'] and data['oneOrTwo'] is 1 and data['handRecognized']]
31 | print sorted(selected_signs)
32 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/dtw_presenter.py:
--------------------------------------------------------------------------------
1 | import matplotlib.pyplot as plt
2 | import matplotlib.cm as cm
3 | from mayavi import mlab
4 | from abstract_classes import AbstractPresenter
5 |
6 | class DTWPresenter(AbstractPresenter):
7 |
8 | def __init__(self, name):
9 | super(DTWPresenter, self).__init__(name)
10 |
11 | def display(self, data):
12 | input_data = data['input']
13 | path = data['output']['path']
14 | cost = data['output']['cost']
15 |
16 | fig = plt.figure(1)
17 | ax = fig.add_subplot(111)
18 | plot1 = plt.imshow(cost.T, origin='lower', cmap=cm.gray, interpolation='nearest')
19 | plot2 = plt.plot(path[0], path[1], 'w')
20 | xlim = ax.set_xlim((-0.5, cost.shape[0]-0.5))
21 | ylim = ax.set_ylim((-0.5, cost.shape[1]-0.5))
22 | plt.show()
23 |
24 | figDTW = mlab.figure('DTW BSpline')
25 | mlab.plot3d(input_data[0]['spline'][:,0], input_data[0]['spline'][:,1], input_data[0]['spline'][:,2], range(0,len(input_data[0]['spline'][:,0])), tube_radius=0.0025, colormap='Blues', figure=figDTW)
26 | mlab.plot3d(input_data[1]['spline'][:,0], input_data[1]['spline'][:,1], input_data[1]['spline'][:,2], range(0,len(input_data[1]['spline'][:,0])), tube_radius=0.0025, colormap='Oranges', figure=figDTW)
27 |
28 | for i in xrange(0, len(path[0])):
29 | point1 = input_data[0]['spline'][path[0][i]]
30 | point2 = input_data[1]['spline'][path[1][i]]
31 | mlab.plot3d([point1[0], point2[0]], [point1[1], point2[1]], [point1[2], point2[2]], tube_radius=0.001, color=(1,1,0), figure=figDTW)
32 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/dtw_processor.py:
--------------------------------------------------------------------------------
1 | from dtw import dtw
2 | from abstract_classes import AbstractProcessor
3 |
4 | class DTWProcessor(AbstractProcessor):
5 |
6 | def __init__(self, name, norm, presenters):
7 | super(DTWProcessor, self).__init__(name, presenters)
8 | self.norm = norm
9 |
10 | def cost_3d(self, a, b):
11 | return sum((a-b)**self.norm)**(1.0/self.norm)
12 |
13 | def process(self, data):
14 | dist, cost, path = dtw(data[0]['spline'], data[1]['spline'], dist=self.cost_3d)
15 | processed_data = {'input': data, 'output': {'dist': dist, 'cost': cost, 'path': path}}
16 |
17 | return processed_data
18 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/hand_presenter.py:
--------------------------------------------------------------------------------
1 | from mayavi import mlab
2 | from abstract_classes import AbstractPresenter
3 |
4 | class HandPresenter(AbstractPresenter):
5 |
6 | colormaps = ['Blues', 'Oranges', 'Greens']
7 | currentColorIndex = 0
8 |
9 | def __init__(self, name):
10 | super(HandPresenter, self).__init__(name)
11 |
12 | def display(self, data):
13 | figBSpline = mlab.figure('Original BSpline')
14 | mlab.plot3d(data['hands'][:,0], data['hands'][:,1], data['hands'][:,2], range(0,len(data['raw_data'][:,0])), tube_radius=0.0025, colormap=self.colormaps[self.currentColorIndex], figure=figBSpline)
15 | self.currentColorIndex = (self.currentColorIndex + 1) % len(self.colormaps)
16 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/hand_selector.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from abstract_classes import AbstractProcessor
3 |
4 | class HandSelector(AbstractProcessor):
5 | def __init__(self, name, select_left, select_right, presenters):
6 | super(HandSelector, self).__init__(name, presenters)
7 | self.select_left = select_left
8 | self.select_right = select_right
9 |
10 | def process(self, data):
11 | raw_data = data['raw_data']
12 | if self.select_left and self.select_right:
13 | data['hands'] = np.concatenate((raw_data[:,56:59], raw_data[:,63:66]))
14 | elif self.select_left:
15 | data['hands'] = raw_data[:,56:59]
16 | elif self.select_right:
17 | data['hands'] = raw_data[:,63:66]
18 |
19 | return data
20 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/task_runner.py:
--------------------------------------------------------------------------------
1 | class TaskRunner(object):
2 |
3 | preprocessed_data = []
4 |
5 | def __init__(self, reader, preprocessors, processor):
6 | self.reader = reader
7 | self.preprocessors = preprocessors
8 | self.processor = processor
9 | self.remove_data()
10 |
11 | def remove_data(self):
12 | self.preprocessed_data = []
13 |
14 | def add_data(self):
15 | try:
16 | data = self.reader.read()
17 | except AttributeError:
18 | print 'Error: No reader is defined'
19 | return
20 |
21 | try:
22 | filtered_data = {'raw_data': data}
23 | for preprocessor in self.preprocessors:
24 | filtered_data = preprocessor.doProcess(filtered_data)
25 |
26 | self.preprocessed_data.append(filtered_data)
27 | except AttributeError:
28 | pass
29 |
30 |
31 | def process(self):
32 | try:
33 | self.processor.doProcess(self.preprocessed_data)
34 | except AttributeError:
35 | print 'Error: No processor is defined'
36 | return
37 |
--------------------------------------------------------------------------------
/GestureComparison/src/validation/validation_test.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from os.path import join,dirname,realpath
3 |
4 | from hand_presenter import HandPresenter
5 | from bspline_presenter import BSplinePresenter
6 | from body_box_presenter import BodyBoxPresenter
7 | from dtw_presenter import DTWPresenter
8 |
9 | from csv_reader import CSVReader
10 | from hand_selector import HandSelector
11 | from body_box_extractor import BodyBoxExtractor
12 | from bspline_preprocessor import BSplinePreprocessor
13 | from dtw_processor import DTWProcessor
14 | from task_runner import TaskRunner
15 |
16 | ROOT_DIRECTORY = join(dirname(realpath(sys.argv[0])), '..', '..')
17 |
18 | left_hand = False
19 | right_hand = True
20 | smoothing = 0.01
21 | sampling_rate = 100
22 |
23 | hand_presenter = HandPresenter("Hand Presenter")
24 | bspline_presenter = BSplinePresenter("B-Spline Presenter")
25 | body_box_presenter = BodyBoxPresenter("Body Box Presenter")
26 | dtw_presenter = DTWPresenter("DTW Presenter")
27 |
28 | csv_reader = CSVReader(ROOT_DIRECTORY)
29 | hand_selector = HandSelector("Hand Selector", left_hand, right_hand, [hand_presenter])
30 | body_box_extractor = BodyBoxExtractor("Body Box Extractor", [body_box_presenter])
31 | bspline_preprocessor = BSplinePreprocessor("B-Spline Preprocessor", smoothing, sampling_rate, [bspline_presenter])
32 | dtw_processor = DTWProcessor("DTW Processor", 2, [dtw_presenter])
33 | task_runner = TaskRunner(csv_reader, [hand_selector, body_box_extractor, bspline_preprocessor], dtw_processor)
34 |
35 | input_files = ['res/HKG_001_a_0002 Aaron 41/HKG_001_a_0002 Aaron 41.csv', 'res/HKG_001_a_0001 Aaron 22/HKG_001_a_0001 Aaron 22.csv']
36 | for input_file in input_files:
37 | csv_reader.set_file(input_file)
38 | task_runner.add_data()
39 | task_runner.process()
40 |
--------------------------------------------------------------------------------
/HandDetector/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | clientserver
4 |
5 |
6 |
7 |
8 |
9 | org.python.pydev.PyDevBuilder
10 |
11 |
12 |
13 |
14 |
15 | org.python.pydev.pythonNature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/HandDetector/.pydevproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | /clientserver
5 |
6 | python 2.7
7 | Default
8 |
9 |
--------------------------------------------------------------------------------
/HandDetector/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/HandDetector/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/HandDetector/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace HandDetector
10 | {
11 | ///
12 | /// App.xaml 的交互逻辑
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/HandDetector/DataTransferEventArgs.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成
4 | // 如果重新生成代码,将丢失对此文件所做的更改。
5 | //
6 | //------------------------------------------------------------------------------
7 | using System;
8 | using System.Collections.Generic;
9 | using System.Linq;
10 | using System.Text;
11 |
12 | namespace CURELab.SignLanguage.HandDetector
13 | {
14 | public class DataTransferEventArgs : EventArgs
15 | {
16 | public Object m_data;
17 |
18 | public DataTransferEventArgs(Object data)
19 | {
20 | m_data = data;
21 | }
22 | }
23 |
24 |
25 | }
--------------------------------------------------------------------------------
/HandDetector/ISubject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CURELab.SignLanguage.HandDetector
7 | {
8 | public delegate void DataTransferEventHandler(Object sender, DataTransferEventArgs args);
9 |
10 | public interface ISubject
11 | {
12 | event DataTransferEventHandler m_dataTransferEvent;
13 | void NotifyAll(DataTransferEventArgs e);
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/HandDetector/KalmanFilter.cs:
--------------------------------------------------------------------------------
1 | // author: Administrator
2 | // created time:2014/2/17 20:34:12
3 | // organizatioin:CURE lab, CUHK
4 | // copyright: 2014-2015
5 | // CLR: 4.0.30319.18063
6 | // project link:https://github.com/huangfuyang/Sign-Language-with-Kinect
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 |
13 | using Emgu.CV;
14 | using Emgu.CV.Structure;
15 | using Emgu.CV.UI;
16 | using Emgu.CV.Util;
17 |
18 | namespace CURELab.SignLanguage.HandDetector
19 | {
20 | ///
21 | /// add summary here
22 | ///
23 | public class KalmanFilter
24 | {
25 | public KalmanFilter()
26 | {
27 |
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/HandDetector/Model/MyJoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Microsoft.Kinect;
8 |
9 | namespace CURELab.SignLanguage.HandDetector.Model
10 | {
11 |
12 | public class MyJoint
13 | {
14 | public SkeletonPoint Pos3D { get; set; }
15 | public Point PosDepth { get; set; }
16 | public Point PosColor { get; set; }
17 | public MyJoint()
18 | {
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/HandDetector/Model/MyJointType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CURELab.SignLanguage.HandDetector.Model
8 | {
9 | // Summary:
10 | // This contains all of the possible joint types.
11 | public enum MyJointType
12 | {
13 |
14 | Head = 0,
15 | ShoulderLeft = 1,
16 |
17 | ShoulderCenter = 2,
18 |
19 | ShoulderRight = 3,
20 |
21 | ElbowL = 4,
22 |
23 | ElbowR = 5,
24 |
25 | WristL = 6,
26 |
27 | WristR = 7,
28 |
29 | HandL = 8,
30 |
31 | HandR = 9,
32 |
33 | Spine = 10,
34 |
35 | HipL = 11,
36 |
37 | HipCenter = 12,
38 |
39 | HipR = 13,
40 |
41 | AnkleLeft = 14,
42 |
43 | FootLeft = 15,
44 |
45 | //
46 | // Summary:
47 | // The right knee.
48 | KneeRight = 17,
49 | //
50 | // Summary:
51 | // The right ankle.
52 | AnkleRight = 18,
53 | //
54 | // Summary:
55 | // The right foot.
56 | FootRight = 19,
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/HandDetector/Model/MySkeleton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net.NetworkInformation;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Controls.Primitives;
8 | using Microsoft.Kinect;
9 |
10 | namespace CURELab.SignLanguage.HandDetector.Model
11 | {
12 | public class MySkeleton
13 | {
14 | public MyJoint[] Joints
15 | { get; set; }
16 |
17 | public bool Tracked;
18 |
19 | public MySkeleton(int count = 20)
20 | {
21 | Joints = new MyJoint[20];
22 | Tracked = true;
23 |
24 | }
25 | public MyJoint this[MyJointType key]
26 | {
27 | get
28 | {
29 | return Joints[(int)key];
30 | }
31 | set
32 | {
33 | Joints[(int)key] = value;
34 | }
35 | }
36 |
37 | public MyJoint this[int key]
38 | {
39 | get
40 | {
41 | return Joints[key];
42 | }
43 | set
44 | {
45 | Joints[key] = value;
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/HandDetector/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // 有关程序集的常规信息通过以下
8 | // 特性集控制。更改这些特性值可修改
9 | // 与程序集关联的信息。
10 | [assembly: AssemblyTitle("HandDetector")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("MS")]
14 | [assembly: AssemblyProduct("HandDetector")]
15 | [assembly: AssemblyCopyright("Copyright © MS 2014")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // 将 ComVisible 设置为 false 使此程序集中的类型
20 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
21 | // 则将该类型上的 ComVisible 特性设置为 true。
22 | [assembly: ComVisible(false)]
23 |
24 | //若要开始生成可本地化的应用程序,请在
25 | // 中的 .csproj 文件中
26 | //设置 CultureYouAreCodingWith。例如,如果您在源文件中
27 | //使用的是美国英语,请将 设置为 en-US。然后取消
28 | //对以下 NeutralResourceLanguage 特性的注释。更新
29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置
36 | //(在页面或应用程序资源词典中
37 | // 未找到某个资源的情况下使用)
38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
39 | //(在页面、应用程序或任何主题特定资源词典中
40 | // 未找到某个资源的情况下使用)
41 | )]
42 |
43 |
44 | // 程序集的版本信息由下面四个值组成:
45 | //
46 | // 主版本
47 | // 次版本
48 | // 生成号
49 | // 修订号
50 | //
51 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
52 | // 方法是按如下所示使用“*”:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/HandDetector/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CURELab.SignLanguage.HandDetector.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/HandDetector/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/HandDetector/SignWordModel.cs:
--------------------------------------------------------------------------------
1 | // author: Administrator
2 | // created time:2014/5/9 5:15:42
3 | // organizatioin:CURE lab, CUHK
4 | // copyright: 2014-2015
5 | // CLR: 4.0.30319.18444
6 | // project link:https://github.com/huangfuyang/Sign-Language-with-Kinect
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 |
13 |
14 | namespace CURELab.SignLanguage.HandDetector
15 | {
16 | ///
17 | /// add summary here
18 | ///
19 | public class SignWordModel
20 | {
21 | public string SignID;
22 | public string Signer;
23 | public string File;
24 | public string FullName;
25 | public string Chinese;
26 | public string English;
27 | public SignWordModel(string sign, string signer,string fullName, string file)
28 | {
29 | SignID = sign;
30 | Signer = signer;
31 | File = file;
32 | FullName = fullName;
33 |
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/HandDetector/Threshold.cs:
--------------------------------------------------------------------------------
1 | // author: Administrator
2 | // created time:2014/1/22 16:23:40
3 | // organizatioin:CURE lab, CUHK
4 | // copyright: 2014-2015
5 | // CLR: 4.0.30319.18052
6 | // project link:https://github.com/huangfuyang/Sign-Language-with-Kinect
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 |
13 |
14 | namespace CURELab.SignLanguage.HandDetector
15 | {
16 | ///
17 | /// add summary here
18 | ///
19 | public class Threshold
20 | {
21 | private static List