├── .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 | 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 | 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 | 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 ThresholdList = new List(); 22 | public Threshold() 23 | { 24 | 25 | } 26 | 27 | public static void RegisterThreshold(string name, T value, T min, T max) where T : System.IComparable 28 | { 29 | value = value.CompareTo(max) > 0 ? max : value; 30 | value = value.CompareTo(min) < 0 ? min : value; 31 | ThresholdModel newModel = new ThresholdModel() 32 | { 33 | Name = name, 34 | Value = value, 35 | Max = max, 36 | Min = min 37 | }; 38 | ThresholdList.Add(newModel); 39 | 40 | } 41 | 42 | 43 | } 44 | 45 | public struct ThresholdModel 46 | { 47 | public string Name; 48 | public T Value; 49 | public T Min; 50 | public T Max; 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /HandDetector/TrackBar.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /HandDetector/TrackBar.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace CURELab.SignLanguage.HandDetector 17 | { 18 | /// 19 | /// TrackBar.xaml 的交互逻辑 20 | /// 21 | public unsafe partial class TrackBar : UserControl,ISubject 22 | { 23 | private double _min; 24 | public double Min { get { return _min; } set { sld_main.Minimum = value; _min = value; } } 25 | private double _max; 26 | public double Max { get { return _max; } set { sld_main.Maximum = value; _max = value; } } 27 | 28 | public double Value 29 | { 30 | get { return sld_main.Value; } 31 | set 32 | { 33 | sld_main.Value = value; 34 | } 35 | } 36 | private double* PtrThresh; 37 | 38 | public string ValueName 39 | { 40 | get { return lbl_Name.Content.ToString(); } 41 | set 42 | { 43 | lbl_Name.Content = value; 44 | } 45 | } 46 | 47 | 48 | public unsafe TrackBar(double* ptr) 49 | { 50 | DataContext = this; 51 | InitializeComponent(); 52 | Min = 0; 53 | Max = 100; 54 | ValueName = "default"; 55 | PtrThresh = ptr; 56 | } 57 | 58 | private void sld_main_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) 59 | { 60 | unsafe 61 | { 62 | *PtrThresh = e.NewValue; 63 | } 64 | NotifyAll(new DataTransferEventArgs(e.NewValue)); 65 | } 66 | 67 | 68 | 69 | 70 | 71 | 72 | #region ISubject 成员 73 | 74 | public event DataTransferEventHandler m_dataTransferEvent; 75 | 76 | public void NotifyAll(DataTransferEventArgs e) 77 | { 78 | if (m_dataTransferEvent != null) 79 | { 80 | m_dataTransferEvent(this, e); 81 | } 82 | } 83 | 84 | #endregion 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /HandDetector/VisualData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Runtime.CompilerServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace CURELab.SignLanguage.HandDetector 10 | { 11 | class VisualData : INotifyPropertyChanged 12 | { 13 | private static VisualData Singleton; 14 | private int currentFrame; 15 | public int CurrentFrame 16 | { 17 | get { return currentFrame; } 18 | set 19 | { 20 | if (value != currentFrame) 21 | { 22 | currentFrame = value; 23 | OnPropertyChanged("CurrentFrame"); 24 | } 25 | } 26 | } 27 | 28 | private int _totalFrames; 29 | public int TotalFrames 30 | { 31 | get { return _totalFrames; } 32 | set 33 | { 34 | _totalFrames = value; 35 | OnPropertyChanged("TotalFrames"); 36 | } 37 | } 38 | 39 | public static VisualData GetSingleton() 40 | { 41 | if (Singleton == null) 42 | { 43 | Singleton = new VisualData(); 44 | } 45 | return Singleton; 46 | } 47 | private VisualData() 48 | { 49 | CurrentFrame = 0; 50 | } 51 | 52 | public event PropertyChangedEventHandler PropertyChanged; 53 | 54 | // Checks if a property already matches a desired value. Notifies listeners only when necessary. 55 | protected bool SetProperty(ref T storage, T value, Boolean flush, [CallerMemberName] String propertyName = null) 56 | { 57 | if (!flush && object.Equals(storage, value)) return false; 58 | 59 | storage = value; 60 | OnPropertyChanged(propertyName); 61 | return true; 62 | } 63 | 64 | // Notifies listeners that a property value has changed. 65 | protected void OnPropertyChanged([CallerMemberName] string propertyName = null) 66 | { 67 | var eventHandler = this.PropertyChanged; 68 | if (eventHandler != null) 69 | { 70 | eventHandler(this, new PropertyChangedEventArgs(propertyName)); 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /HandDetector/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HandShapeDetector/.idea/.name: -------------------------------------------------------------------------------- 1 | HandShapeDetector -------------------------------------------------------------------------------- /HandShapeDetector/.idea/HandShapeDetector.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /HandShapeDetector/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HandShapeDetector/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HandShapeDetector/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /HandShapeDetector/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /HandShapeDetector/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/HandShapeDetector/.metadata/.lock -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index: -------------------------------------------------------------------------------- 1 | /org.eclipse.jdt.corestateVersionNumber27 -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.resources/.root/7.tree: -------------------------------------------------------------------------------- 1 | org.eclipse.jdt.core -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/HandShapeDetector/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | version=1 3 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\n\n 3 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | content_assist_proposals_background=255,255,255 2 | content_assist_proposals_foreground=60,60,60 3 | eclipse.preferences.version=1 4 | fontPropagated=true 5 | org.eclipse.jdt.ui.editor.tab.width= 6 | org.eclipse.jdt.ui.formatterprofiles.version=12 7 | org.eclipse.jdt.ui.javadoclocations.migrated=true 8 | org.eclipse.jface.textfont=1|Monospace|10.0|0|GTK|1|; 9 | proposalOrderMigrated=true 10 | spelling_locale_initialized=true 11 | tabWidthPropagated=true 12 | useAnnotationsPrefPage=true 13 | useQuickDiffPrefPage=true 14 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs: -------------------------------------------------------------------------------- 1 | PROBLEMS_FILTERS_MIGRATE=true 2 | eclipse.preferences.version=1 3 | platformState=1420189952136 4 | quickStart=false 5 | tipsAndTricks=true 6 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | showIntro=false 3 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 |
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 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat: -------------------------------------------------------------------------------- 1 |  ECLIPSE_HOMEJRE_SRC 2 | JUNIT_HOME JRE_SRCROOTJRE_LIBJUNIT_SRC_HOME -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties: -------------------------------------------------------------------------------- 1 | #Cached timestamps 2 | #Fri Jan 02 17:53:05 CST 2015 3 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 |
19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /HandShapeDetector/.metadata/version.ini: -------------------------------------------------------------------------------- 1 | #Fri Jan 02 17:52:07 CST 2015 2 | org.eclipse.core.runtime=2 3 | org.eclipse.platform=4.4.0.v20140925-0400 4 | -------------------------------------------------------------------------------- /HandShapeDetector/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | socket 4 | 5 | 6 | 7 | 8 | 9 | org.python.pydev.PyDevBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.python.pydev.pythonNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /HandShapeDetector/.pydevproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /socket 5 | 6 | python 2.7 7 | Default 8 | 9 | -------------------------------------------------------------------------------- /HandShapeDetector/src/CSVFrameData.py: -------------------------------------------------------------------------------- 1 | import csv 2 | 3 | class CSVFrameData: 4 | 5 | def __init__(self): 6 | self.debug = False 7 | 8 | def load(self, fileName): 9 | self.index = 0 10 | with open(fileName, 'r') as csvfile: 11 | self.data = [tuple(line) for line in csv.reader(csvfile, delimiter=',', quotechar='\'')] 12 | csvfile.close() 13 | 14 | def setDebug(self, debug): 15 | self.debug = debug 16 | 17 | def readFrame(self): 18 | if self.index < len(self.data): 19 | self.index = self.index + 1 20 | if self.debug: 21 | print self.data[self.index-1] 22 | 23 | return True,self.data[self.index-1] 24 | else: 25 | return False,None 26 | 27 | def close(self): 28 | return True 29 | -------------------------------------------------------------------------------- /HandShapeDetector/src/FrameConverter.py: -------------------------------------------------------------------------------- 1 | import base64 2 | from json import JSONEncoder,JSONDecoder 3 | from PIL import Image 4 | import numpy as np 5 | from numpy import array 6 | import io 7 | 8 | 9 | class FrameConverter(object): 10 | 11 | def __init__(self): 12 | self.debug = True 13 | self.encoder = JSONEncoder() 14 | self.decoder = JSONDecoder() 15 | 16 | def setDebug(self, debug): 17 | self.debug = debug 18 | 19 | def encode(self, depthFrame, colorFrame, labelFrame, skeletonFrame): 20 | encodedObject = { 21 | 'depth': self.encode_image(depthFrame), 22 | 'color': self.encode_image(colorFrame), 23 | 'label': labelFrame, 24 | 'skeleton': skeletonFrame 25 | } 26 | encodedJSON = self.encoder.encode(encodedObject) 27 | if self.debug: 28 | decodedFrame = self.decode(encodedJSON) 29 | assert np.array_equal(decodedFrame['depth_image'], depthFrame) 30 | assert np.array_equal(decodedFrame['color_image'], colorFrame) 31 | assert np.array_equal(decodedFrame['label'], labelFrame) 32 | assert np.array_equal(decodedFrame['skeleton'], skeletonFrame) 33 | 34 | return encodedJSON 35 | 36 | def decode(self, json): 37 | decodedDict = self.decoder.decode(json) 38 | depthFrame = self.decode_image(decodedDict['depth']) 39 | colorFrame = self.decode_image(decodedDict['color']) 40 | labelFrame = decodedDict['label'] 41 | skeletonFrame = decodedDict['skeleton'] 42 | 43 | return { 44 | 'depth_image': depthFrame, 45 | 'color_image': colorFrame, 46 | 'label': labelFrame, 47 | 'skeleton': skeletonFrame 48 | } 49 | 50 | def encode_image(self, original_image): 51 | encoded_image = base64.b64encode(original_image) 52 | image_shape = original_image.shape 53 | return { 54 | 'image': encoded_image, 55 | 'shape': image_shape 56 | } 57 | 58 | def decode_image(self, encoded_image_frame): 59 | try: 60 | depthFrame = base64.decodestring(encoded_image_frame) 61 | bytes = bytearray(depthFrame) 62 | image = Image.open(io.BytesIO(bytes)) 63 | encoded_image = array(image) 64 | except: 65 | return "" 66 | return encoded_image 67 | -------------------------------------------------------------------------------- /HandShapeDetector/src/VideoFrameData.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | class VideoFrameData: 4 | 5 | def __init__(self): 6 | self.debug = False 7 | 8 | def load(self, srcVideoPath): 9 | self.cap = cv2.VideoCapture(srcVideoPath) 10 | return self.cap.isOpened() 11 | 12 | def setDebug(self, debug): 13 | self.debug = debug 14 | 15 | def readFrame(self): 16 | if(hasattr(self, 'cap') and self.cap.isOpened()): 17 | ret, frame = self.cap.read() 18 | if not ret: 19 | return False,None 20 | 21 | frame = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB) 22 | return True,frame 23 | return False,None 24 | 25 | def close(self): 26 | self.cap.release() 27 | -------------------------------------------------------------------------------- /HandShapeDetector/src/caffeDL.py: -------------------------------------------------------------------------------- 1 | import caffe 2 | class caffeDL(): 3 | def __init__(self): 4 | caffe_root ="/home/lzz/caffe-master/" 5 | self.net = caffe.Classifier(caffe_root + 'new/proto/lenet_test.prototxt', caffe_root + 'lenet_iter_3500.caffemodel') 6 | self.net.set_phase_test() 7 | self.net.set_mode_cpu() 8 | # input preprocessing: 'data' is the name of the input blob == net.inputs[0] 9 | #net.set_mean('data', np.load(caffe_root + 'mean.binaryproto')) # ImageNet mean 10 | self.net.set_raw_scale('data', 1) # the reference model operates on images in [0,255] range instead of [0,1] 11 | self.net.set_channel_swap('data', (2,1,0)) 12 | -------------------------------------------------------------------------------- /HandShapeDetector/src/caffe_server_handler.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import ConfigParser 3 | from os.path import join,dirname,realpath 4 | 5 | class CaffeServerHandler(object): 6 | def __init__(self): 7 | ROOT_DIRECTORY = join(dirname(realpath(sys.argv[0])), '..') 8 | 9 | config = ConfigParser.RawConfigParser() 10 | config.read(join(ROOT_DIRECTORY, 'config', 'caffe.cfg')) 11 | self.CAFFE_ENABLED = False 12 | 13 | caffe_root = config.get('Directory', 'Caffe Root') 14 | caffe_python = config.get('Directory', 'Caffe Python') 15 | caffe_train_directory = config.get('Directory', 'Train') 16 | caffe_model_definiation_file = join(caffe_train_directory, config.get('File', 'Model Definition')) 17 | caffe_pre_trained_model_file = join(caffe_train_directory, config.get('File', 'Pre-trained model')) 18 | 19 | sys.path.insert(0, join(caffe_root, caffe_python)) 20 | self.caffe_init(caffe_model_definiation_file, caffe_pre_trained_model_file) 21 | 22 | def caffe_init(self, caffe_model_definiation_file, caffe_pre_trained_model_file): 23 | if self.CAFFE_ENABLED: 24 | import caffe 25 | 26 | net = caffe.Classifier(caffe_model_definiation_file, caffe_pre_trained_model_file) 27 | net.set_phase_test() 28 | net.set_mode_cpu() 29 | net.set_raw_scale('data', 255) 30 | net.set_channel_swap('data', (2,1,0)) 31 | 32 | self.net = net 33 | 34 | def handle_data(self, decoded_data): 35 | if self.CAFFE_ENABLED: 36 | self.net.predict([decoded_data['depth']]) 37 | feat = self.net.blobs['fc7'].data[4].flatten().tolist() 38 | tmpS = '' 39 | 40 | for i,f in enumerate(feat): 41 | tmpS += str(f) + ' ' 42 | 43 | f = file('handshape.txt', 'a') 44 | f.write(tmpS) 45 | f.close() 46 | -------------------------------------------------------------------------------- /HandShapeDetector/src/clusterBase.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Created on Oct 14, 2014 3 | 4 | @author: liuzz 5 | ''' 6 | from math import sqrt 7 | 8 | def importData(FIFE = 'D:/eclipse/project/src/blogdata.txt') : 9 | blogwords = [] 10 | blognames = [] 11 | f = open("C:/Users/liuzz/Desktop/1.txt") 12 | words = f.readline().split() 13 | #//remove '\r\n' 14 | for line in f: 15 | blog = line[:-2].split('\t') 16 | blognames.append(blog[0]) 17 | blogwords.append([int(word_c) for word_c in blog[1:]] ) 18 | return blogwords,blognames 19 | 20 | 21 | def pearson_distance(vector1, vector2) : 22 | """ 23 | Calculate distance between two vectors using pearson method 24 | See more : http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient 25 | """ 26 | sum1 = sum(vector1) 27 | sum2 = sum(vector2) 28 | 29 | sum1Sq = sum([pow(v,2) for v in vector1]) 30 | sum2Sq = sum([pow(v,2) for v in vector2]) 31 | 32 | pSum = sum([vector1[i] * vector2[i] for i in range(len(vector1))]) 33 | 34 | num = pSum - (sum1*sum2/len(vector1)) 35 | den = sqrt((sum1Sq - pow(sum1,2)/len(vector1)) * (sum2Sq - pow(sum2,2)/len(vector1))) 36 | 37 | if den == 0 : return 0.0 38 | return 1.0 - num/den -------------------------------------------------------------------------------- /HandShapeDetector/src/configGenerator.py: -------------------------------------------------------------------------------- 1 | import ConfigParser 2 | from os import makedirs,sys 3 | from os.path import join,exists,dirname,realpath 4 | 5 | CONFIG_DIRECTORY = join(dirname(realpath(sys.argv[0])), '..', 'config') 6 | SOCKET_CONFIG_FILE_NAME = 'socket.cfg' 7 | FILE_FORMAT_CONFIG_FILE_NAME = 'file_format.cfg' 8 | DEBUG_CONFIG_FILE_NAME = 'debug.cfg' 9 | SKELETON_CONFIG_FILE_NAME = 'skeleton.cfg' 10 | 11 | if not exists(CONFIG_DIRECTORY): 12 | makedirs(CONFIG_DIRECTORY) 13 | 14 | # For Socket 15 | config = ConfigParser.RawConfigParser() 16 | config.add_section('Server') 17 | config.set('Server', 'address', 'localhost') 18 | config.set('Server', 'port', '57681') 19 | 20 | with open(join(CONFIG_DIRECTORY, SOCKET_CONFIG_FILE_NAME), 'wb') as configfile: 21 | config.write(configfile) 22 | 23 | 24 | # For File Name Format 25 | config = ConfigParser.RawConfigParser() 26 | config.add_section('Directory') 27 | config.set('Directory', 'Label', join('data', 'label')) 28 | config.set('Directory', 'Skeleton', join('data', 'skeleton')) 29 | config.set('Directory', 'Video', join('data', 'video')) 30 | config.set('Directory', 'Result', 'result') 31 | 32 | config.add_section('File') 33 | config.set('File', 'Video Extension', '.avi') 34 | config.set('File', 'Skeleton Extension', '.csv') 35 | config.set('File', 'Skeleton Suffix', '_skeleton') 36 | config.set('File', 'Depth Video Suffix', '_d') 37 | config.set('File', 'Color Video Suffix', '_c') 38 | 39 | with open(join(CONFIG_DIRECTORY, FILE_FORMAT_CONFIG_FILE_NAME), 'wb') as configfile: 40 | config.write(configfile) 41 | 42 | 43 | # For Debugging 44 | config = ConfigParser.RawConfigParser() 45 | config.add_section('Debug') 46 | config.set('Debug', 'Print Debug Message', True) 47 | config.set('Debug', 'Visualize Result', True) 48 | config.set('Debug', 'Save Result to Video', True) 49 | 50 | with open(join(CONFIG_DIRECTORY, DEBUG_CONFIG_FILE_NAME), 'wb') as configfile: 51 | config.write(configfile) 52 | 53 | 54 | # For Skeleton joint mapping 55 | config = ConfigParser.RawConfigParser() 56 | config.add_section('Enumeration') 57 | config.set('Enumeration', 'Joint Types', ','.join(['head', 'shoulderLeft', 'shoulderCenter', 'shoulderRight', 'elbowL', 'elbowR', 'wristL', 'wristR', 'handL', 'handR', 'spine', 'hipL', 'hipCenter', 'hipR'])) 58 | config.set('Enumeration', 'Joint Data Keys', ','.join(['3d_x', '3d_y', '3d_z', 'color_x', 'color_y', 'depth_x', 'depth_y'])) 59 | 60 | with open(join(CONFIG_DIRECTORY, SKELETON_CONFIG_FILE_NAME), 'wb') as configfile: 61 | config.write(configfile) 62 | -------------------------------------------------------------------------------- /HandShapeDetector/src/constant_numbers.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Created on 2014-9-16 3 | 4 | @author: lenovo 5 | ''' 6 | 7 | LSX=0 8 | LSY=1 9 | LSZ=2 10 | RSX=3 11 | RSY=4 12 | RSZ=5 13 | LEX=6 14 | LEY=7 15 | LEZ=8 16 | REX=9 17 | REY=10 18 | REZ=11 19 | LHX=12 20 | LHY=13 21 | LHZ=14 22 | RHX=15 23 | RHY=16 24 | RHZ=17 25 | HX=18 26 | HY=19 27 | HZ=20 28 | HIPCX=21 29 | HIPCY=22 30 | HIPCZ=23 31 | LWX=24 32 | LWY=25 33 | LWZ=26 34 | RWX=27 35 | RWY=28 36 | RWZ=29 37 | LEFT_HOG=30 38 | RIGHT_HOG=31 39 | LEFT_MOG=32 40 | RIGHT_MOG=33 41 | RAW_DATA_LENGTH=34 42 | MIN_FRAME_NUM=20 43 | INIT_THRESHOLD=0.3 44 | MOG_LENGTH=24 45 | FEATURE_SIZE_PER_FRAME=20#+2*MOG_LENGTH 46 | TEMPLATE_THRESHOLD=0.18 -------------------------------------------------------------------------------- /HandShapeDetector/src/echo_client.py: -------------------------------------------------------------------------------- 1 | import asyncore 2 | import asynchat 3 | import logging 4 | import socket 5 | 6 | logging.basicConfig(level=logging.DEBUG,format='%(name)s: %(message)s') 7 | 8 | class EchoClient(asynchat.async_chat): 9 | 10 | def __init__(self, host, port, handler): 11 | self.received_data = [] 12 | self.handler = handler 13 | self.logger = logging.getLogger('EchoClient') 14 | asynchat.async_chat.__init__(self) 15 | self.create_socket(socket.AF_INET, socket.SOCK_STREAM) 16 | self.logger.debug('connecting to %s', (host, port)) 17 | self.connect((host, port)) 18 | self.set_terminator('\n') 19 | 20 | def handle_connect(self): 21 | self.logger.debug('handle_connect()') 22 | 23 | def send_data(self, message): 24 | self.logger.debug('send_data()') 25 | self.push_with_producer(EchoProducer(message)) 26 | asyncore.loop() 27 | 28 | def collect_incoming_data(self, data): 29 | self.logger.debug('collect_incoming_data() -> (%d bytes)', len(data)) 30 | self.received_data.append(data) 31 | 32 | def found_terminator(self): 33 | self.logger.debug('found_terminator()') 34 | received_message = ''.join(self.received_data) 35 | self.handler.callback(received_message) 36 | self.received_data = [] 37 | 38 | class EchoProducer(asynchat.simple_producer): 39 | 40 | logger = logging.getLogger('EchoProducer') 41 | 42 | def more(self): 43 | response = asynchat.simple_producer.more(self) 44 | #self.logger.debug('more() -> (%s bytes)\n"""%s"""', len(response), response) 45 | return response 46 | -------------------------------------------------------------------------------- /HandShapeDetector/src/echo_server.py: -------------------------------------------------------------------------------- 1 | import asyncore 2 | import asynchat 3 | import logging 4 | import socket 5 | import thread 6 | 7 | logging.basicConfig(level=logging.DEBUG,format='%(name)s: %(message)s') 8 | 9 | class EchoServer(asyncore.dispatcher): 10 | def __init__(self, port, received_data_callback): 11 | asyncore.dispatcher.__init__(self) 12 | self.create_socket(socket.AF_INET, socket.SOCK_STREAM) 13 | self.set_reuse_addr() 14 | self.bind(('', port)) 15 | self.address = self.socket.getsockname() 16 | self.listen(5) 17 | 18 | self.received_data_callback = received_data_callback 19 | asyncore.loop() 20 | 21 | def handle_accept(self): 22 | client_info = self.accept() 23 | if client_info is not None: 24 | sock, addr = client_info 25 | logging.debug('connecting to %s, tid %s', repr(addr), thread.get_ident()) 26 | EchoHandler(client_info[0], self.received_data_callback) 27 | 28 | def handle_close(self): 29 | self.close() 30 | 31 | 32 | class EchoHandler(asynchat.async_chat): 33 | 34 | def __init__(self, sock, received_data_callback): 35 | self.received_data = [] 36 | self.received_data_callback = received_data_callback 37 | self.logger = logging.getLogger('EchoHandler') 38 | asynchat.async_chat.__init__(self, sock) 39 | self.set_terminator('#TERMINATOR#') 40 | 41 | def collect_incoming_data(self, data): 42 | #self.logger.debug('collect_incoming_data() -> (%d bytes)\n"""%s"""', len(data), data) 43 | self.received_data.append(data) 44 | 45 | def found_terminator(self): 46 | self.logger.debug('found_terminator()') 47 | response = self.received_data_callback(''.join(self.received_data)) 48 | self.push(response) 49 | self.received_data = [] 50 | -------------------------------------------------------------------------------- /HandShapeDetector/src/hand_shape_client.py: -------------------------------------------------------------------------------- 1 | import time 2 | import logging 3 | from echo_client import EchoClient 4 | from FrameConverter import FrameConverter 5 | 6 | class HandShapeClient(object): 7 | 8 | def __init__(self, host, port): 9 | self.client = EchoClient(host, port, self) 10 | self.converter = FrameConverter() 11 | 12 | def send_data(self, encoded_data): 13 | self.send_time = time.strftime("%H:%M:%S") 14 | self.client.send_data(encoded_data+'\n') 15 | 16 | def callback(self, server_response): 17 | logging.debug('Send: %s, %s' % (self.send_time, server_response)) 18 | -------------------------------------------------------------------------------- /HandShapeDetector/src/hand_shape_server_test.py: -------------------------------------------------------------------------------- 1 | from hand_shape_server import HandShapeServer 2 | 3 | port = 51243 4 | server = HandShapeServer(port) 5 | -------------------------------------------------------------------------------- /HandShapeDetector/src/load.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Created on 2014-9-16 3 | 4 | @author: lenovo 5 | ''' 6 | 7 | import sqlite3 8 | import struct 9 | 10 | def load_templates(template_file="../data/hog_template5.txt"): 11 | ret=[] 12 | templates=open(template_file) 13 | for t in templates: 14 | ret.append([float(i) for i in t.split()]) 15 | # random.shuffle(ret) 16 | # print len(ret) 17 | # ret=ret[0:5]+ret[30:35]+ret[285:290] 18 | return ret 19 | 20 | def load_handshapes(db_file_name="../data/Aaron1-50.db"): 21 | ret=[] 22 | db = sqlite3.connect(db_file_name) 23 | for hog in db.execute("select LeftHandHOG from framedata;"): 24 | if hog[0]: 25 | new_hog= tuple([struct.unpack('f',hog[0][i:i+4])[0] for i in range(0,len(hog[0]),4)]) 26 | ret.append(new_hog) 27 | #print len(new_hog) 28 | for hog in db.execute("select rightHandHOG from framedata;"): 29 | if hog[0]: 30 | new_hog=tuple( [struct.unpack('f',hog[0][i:i+4])[0] for i in range(0,len(hog[0]),4)]) 31 | ret.append(new_hog) 32 | return ret 33 | 34 | -------------------------------------------------------------------------------- /HandShapeDetector/src/try.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import os 3 | modeldic={} 4 | pred_labels=1.0 5 | modelindex=open("/home/lzz/ModelIndex.txt","r") 6 | for line in open("/home/lzz/ModelIndex.txt"): 7 | line = modelindex.readline() 8 | sep=line.split(" ") 9 | modeldic[sep[0]]=sep[1] 10 | wordname=modeldic[str(int(pred_labels))] 11 | dirs=os.listdir("/media/lzz/Data1/Aaron/1-250/") 12 | for dir in dirs: 13 | if(dir.find(wordname)): 14 | video=dir 15 | break 16 | 17 | filename = "/media/lzz/Data1/Aaron/1-250/"+video+"/"+video+"_c.avi" 18 | print filename 19 | win_name=filename 20 | capture = cv2.cv.CaptureFromFile(filename) 21 | 22 | 23 | cv2.cv.NamedWindow(win_name, cv2.cv.CV_WINDOW_AUTOSIZE) 24 | 25 | 26 | while 1: 27 | 28 | 29 | image = cv2.cv.QueryFrame(capture) 30 | 31 | 32 | cv2.cv.ShowImage(win_name, image) 33 | 34 | c = cv2.cv.WaitKey(33) 35 | print image 36 | if(image==None): 37 | break 38 | cv2.cv.DestroyWindow(win_name) -------------------------------------------------------------------------------- /KinectSignLanguage.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LICENSE -------------------------------------------------------------------------------- /LauncherCMD/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /LauncherCMD/LauncherCMD.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using CURELab.SignLanguage.RecognitionSystem; 8 | 9 | namespace CURELab.SignLanguage.Launcher 10 | { 11 | class LauncherCMD 12 | { 13 | static void Main(string[] args) 14 | { 15 | Console.WriteLine("this is a launcher without kinect"); 16 | RecognitionController lc = new RecognitionController(); 17 | lc.BeginTest(); 18 | Console.WriteLine("end"); 19 | Console.Read(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /LauncherKinect/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LauncherKinect/App.xaml.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | //------------------------------------------------------------------------------ 6 | 7 | namespace Microsoft.Samples.Kinect.SkeletonBasics 8 | { 9 | using System.Windows; 10 | 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /LauncherKinect/Images/CURElogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/CURElogo.png -------------------------------------------------------------------------------- /LauncherKinect/Images/CheckedHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/CheckedHover.png -------------------------------------------------------------------------------- /LauncherKinect/Images/CheckedNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/CheckedNormal.png -------------------------------------------------------------------------------- /LauncherKinect/Images/Kinect.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/Kinect.ico -------------------------------------------------------------------------------- /LauncherKinect/Images/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/Logo.png -------------------------------------------------------------------------------- /LauncherKinect/Images/Status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/Status.png -------------------------------------------------------------------------------- /LauncherKinect/Images/UncheckedHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/UncheckedHover.png -------------------------------------------------------------------------------- /LauncherKinect/Images/UncheckedNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/LauncherKinect/Images/UncheckedNormal.png -------------------------------------------------------------------------------- /LauncherKinect/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | //------------------------------------------------------------------------------ 6 | 7 | using System; 8 | using System.Reflection; 9 | using System.Resources; 10 | using System.Runtime.InteropServices; 11 | using System.Windows; 12 | 13 | // General Information about an assembly is controlled through the following 14 | // set of attributes. Change these attribute values to modify the information 15 | // associated with an assembly. 16 | [assembly: AssemblyTitle("Kinect for Windows Developer Toolkit SkeletonBasics - WPF")] 17 | [assembly: AssemblyDescription("")] 18 | [assembly: AssemblyConfiguration("")] 19 | [assembly: AssemblyTrademark("")] 20 | 21 | // Setting ComVisible to false makes the types in this assembly not visible 22 | // to COM components. If you need to access a type in this assembly from 23 | // COM, set the ComVisible attribute to true on that type. 24 | [assembly: ComVisible(false)] 25 | 26 | // In order to begin building localizable applications, set 27 | // CultureYouAreCodingWith in your .csproj file 28 | // inside a . For example, if you are using US english 29 | // in your source files, set the to en-US. Then uncomment 30 | // the NeutralResourceLanguage attribute below. Update the "en-US" in 31 | // the line below to match the UICulture setting in the project file. 32 | 33 | // [assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 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 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | [assembly: NeutralResourcesLanguage("en-US")] 53 | [assembly: CLSCompliant(true)] -------------------------------------------------------------------------------- /LauncherKinect/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.18052 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CURELab.SignLanguage.Launcher.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 | -------------------------------------------------------------------------------- /LauncherKinect/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /LauncherKinect/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /OpenCV/OpenCV.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | -------------------------------------------------------------------------------- /OpenCV/PropertySheet.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath)$(OPENCV_DIR)\..\..\include; 7 | 8 | 9 | 10 | $(OPENCV_DIR)\lib 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /OpenCV/example1.txt: -------------------------------------------------------------------------------- 1 | 0.000000 -------------------------------------------------------------------------------- /OpenCV/hog_template.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenCV/hog_template.txt -------------------------------------------------------------------------------- /OpenCV/hog_template5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenCV/hog_template5.txt -------------------------------------------------------------------------------- /OpenCV/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenCV/main.cpp -------------------------------------------------------------------------------- /OpenCV/mog.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenCV/mog.cpp -------------------------------------------------------------------------------- /OpenNI2/NiWrapper.Net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenNI2/NiWrapper.Net.dll -------------------------------------------------------------------------------- /OpenNI2/NiWrapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenNI2/NiWrapper.dll -------------------------------------------------------------------------------- /OpenNI2/OpenNI.ini: -------------------------------------------------------------------------------- 1 | [Log] 2 | ; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None 3 | Verbosity=3 4 | LogToConsole=0 5 | LogToFile=0 6 | 7 | [Device] 8 | ;Override="" 9 | 10 | [Drivers] 11 | ; Location of the drivers specified by a relative path based on OpenNI's shared library or an absolute path. 12 | ; Path separator "/" can be used to be portable for any platforms. 13 | ; Default - OpenNI2/Drivers 14 | ;Repository=OpenNI2/Drivers 15 | -------------------------------------------------------------------------------- /OpenNI2/OpenNI2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenNI2/OpenNI2.dll -------------------------------------------------------------------------------- /OpenNI2/OpenNI2/Drivers/Kinect.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenNI2/OpenNI2/Drivers/Kinect.dll -------------------------------------------------------------------------------- /OpenNI2/OpenNI2/Drivers/OniFile.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenNI2/OpenNI2/Drivers/OniFile.dll -------------------------------------------------------------------------------- /OpenNI2/OpenNI2/Drivers/PS1080.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenNI2/OpenNI2/Drivers/PS1080.dll -------------------------------------------------------------------------------- /OpenNI2/OpenNI2/Drivers/PSLink.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/OpenNI2/OpenNI2/Drivers/PSLink.dll -------------------------------------------------------------------------------- /Project1/Project1.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Sign-Language-with-Kinect 2 | ========================= 3 | 4 | Sign Language recognition with Kinect by CURE lab in CUHK :) 5 | 6 | -------------------------------------------------------------------------------- /RecognitionSystem/Classifier.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成 4 | // 如果重新生成代码,将丢失对此文件所做的更改。 5 | // 6 | //------------------------------------------------------------------------------ 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Diagnostics; 12 | using System.Runtime.InteropServices; 13 | 14 | namespace CURELab.SignLanguage.RecognitionSystem 15 | { 16 | public class Classifier 17 | { 18 | 19 | private LeariningModel _learningModel; 20 | 21 | public LeariningModel m_learningModel 22 | { 23 | get { return _learningModel; } 24 | set { _learningModel = value; } 25 | } 26 | public Classifier() 27 | { 28 | 29 | } 30 | 31 | 32 | 33 | } 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /RecognitionSystem/DataProcessor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Kinect; 7 | using Microsoft.Xna.Framework; 8 | 9 | using CURELab.SignLanguage.RecognitionSystem.StaticTools; 10 | using CURELab.SignLanguage.RecognitionSystem.DataStorage; 11 | 12 | namespace CURELab.SignLanguage.RecognitionSystem 13 | { 14 | /// 15 | /// Interact with Realtime system module 16 | /// 17 | /// 18 | public class DataProcessor : ISubject 19 | { 20 | public DataWarehouse m_dataWarehouse; 21 | public DataProcessor() 22 | { 23 | m_dataWarehouse = new DataWarehouse(); 24 | 25 | } 26 | 27 | public void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) 28 | { 29 | 30 | using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame()) 31 | { 32 | if (skeletonFrame != null) 33 | { 34 | if (m_dataWarehouse.SetSkeletonFrameData(skeletonFrame)) 35 | { 36 | //notify modules with updated data. 37 | NotifyAll(new DataTransferEventArgs(m_dataWarehouse.m_currentFrame)); 38 | } 39 | 40 | } 41 | } 42 | } 43 | 44 | 45 | 46 | #region ISubject 成员 47 | 48 | public event DataTransferEventHandler m_dataTransferEvent; 49 | 50 | public void NotifyAll(DataTransferEventArgs e) 51 | { 52 | if (m_dataTransferEvent != null) 53 | { 54 | m_dataTransferEvent(this, e); 55 | } 56 | else 57 | { 58 | Console.WriteLine("no boundler"); 59 | } 60 | } 61 | 62 | #endregion 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /RecognitionSystem/DataStorage/FrameData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using CURELab.SignLanguage.RecognitionSystem.StaticTools; 7 | 8 | namespace CURELab.SignLanguage.RecognitionSystem.DataStorage 9 | { 10 | public class FrameData 11 | { 12 | private List _persons; 13 | public List m_persons 14 | { 15 | get { return _persons; } 16 | set { _persons = value; } 17 | } 18 | public Person m_Player1 19 | { 20 | get { return _persons[0]; } 21 | private set { _persons[0] = value; } 22 | } 23 | 24 | private int _frameNumber; 25 | public int m_frameNumer 26 | { 27 | get { return _frameNumber; } 28 | private set { _frameNumber = value; } 29 | } 30 | 31 | public FrameData(int number) 32 | { 33 | m_frameNumer = number; 34 | m_persons = new List(StaticParams.MAX_NUMBER_OF_PLAYERS); 35 | m_persons.Add(new Person()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /RecognitionSystem/DataStorage/JointType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace CURELab.SignLanguage.RecognitionSystem.DataStorage 7 | { 8 | public enum JointType 9 | { 10 | // 摘要: 11 | // The center of the hip. 12 | HipCenter = 0, 13 | // 14 | // 摘要: 15 | // The bottom of the spine. 16 | Spine = 1, 17 | // 18 | // 摘要: 19 | // The center of the shoulders. 20 | ShoulderCenter = 2, 21 | // 22 | // 摘要: 23 | // The players head. 24 | Head = 3, 25 | // 26 | // 摘要: 27 | // The left shoulder. 28 | ShoulderLeft = 4, 29 | // 30 | // 摘要: 31 | // The left elbow. 32 | ElbowLeft = 5, 33 | // 34 | // 摘要: 35 | // The left wrist. 36 | WristLeft = 6, 37 | // 38 | // 摘要: 39 | // The left hand. 40 | HandLeft = 7, 41 | // 42 | // 摘要: 43 | // The right shoulder. 44 | ShoulderRight = 8, 45 | // 46 | // 摘要: 47 | // The right elbow. 48 | ElbowRight = 9, 49 | // 50 | // 摘要: 51 | // The right wrist. 52 | WristRight = 10, 53 | // 54 | // 摘要: 55 | // The right hand. 56 | HandRight = 11, 57 | // 58 | // 摘要: 59 | // The left hip. 60 | HipLeft = 12, 61 | // 62 | // 摘要: 63 | // The left knee. 64 | KneeLeft = 13, 65 | // 66 | // 摘要: 67 | // The left ankle. 68 | AnkleLeft = 14, 69 | // 70 | // 摘要: 71 | // The left foot. 72 | FootLeft = 15, 73 | // 74 | // 摘要: 75 | // The right hip. 76 | HipRight = 16, 77 | // 78 | // 摘要: 79 | // The right knee. 80 | KneeRight = 17, 81 | // 82 | // 摘要: 83 | // The right ankle. 84 | AnkleRight = 18, 85 | // 86 | // 摘要: 87 | // The right foot. 88 | FootRight = 19, 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /RecognitionSystem/DataStorage/Person.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Microsoft.Kinect; 6 | using Microsoft.Xna.Framework; 7 | 8 | namespace CURELab.SignLanguage.RecognitionSystem.DataStorage 9 | { 10 | 11 | public class Person 12 | { 13 | private Skeleton _skeleton; 14 | 15 | public Skeleton m_skeleton 16 | { 17 | get { return _skeleton; } 18 | set { _skeleton = value; } 19 | } 20 | 21 | private Vector3 _position; 22 | 23 | public Vector3 m_position 24 | { 25 | get { return _position; } 26 | set { _position = value; } 27 | } 28 | /// 29 | /// 30 | /// 31 | public Person() 32 | { 33 | m_position = new Vector3(0, 0, 0); 34 | 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /RecognitionSystem/DataStorage/SegmentationData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace CURELab.SignLanguage.RecognitionSystem.DataStorage 7 | { 8 | public struct SegmentationData 9 | { 10 | public int startFrame,endFrame; 11 | /// 12 | /// 1 = very relieble 0 = very un 13 | /// 14 | public float reliebility; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /RecognitionSystem/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.RecognitionSystem 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 | } -------------------------------------------------------------------------------- /RecognitionSystem/FacialExpressionModule.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.RecognitionSystem 13 | { 14 | public class FacialExpressionModule : VisualFeatureModule 15 | { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /RecognitionSystem/FeatureSelector.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.RecognitionSystem 13 | { 14 | public class FeatureSelector 15 | { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /RecognitionSystem/HMM.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.RecognitionSystem 13 | { 14 | public class HMM : LeariningModel 15 | { 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /RecognitionSystem/ISubject.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.RecognitionSystem 13 | { 14 | public delegate void DataTransferEventHandler(Object sender, EventArgs args); 15 | 16 | public interface ISubject 17 | { 18 | event DataTransferEventHandler m_dataTransferEvent; 19 | void NotifyAll(DataTransferEventArgs e); 20 | 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /RecognitionSystem/LeariningModel.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.RecognitionSystem 13 | { 14 | public class LeariningModel 15 | { 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /RecognitionSystem/MotionTrackingModule.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.RecognitionSystem 13 | { 14 | public class MotionTrackingModule : VisualFeatureModule 15 | { 16 | 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /RecognitionSystem/NLPModule.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.RecognitionSystem 13 | { 14 | public class NLPModule 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RecognitionSystem/Postprocessor.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.RecognitionSystem 13 | { 14 | public class Postprocessor 15 | { 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /RecognitionSystem/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("sign_languageLib")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("MS")] 12 | [assembly: AssemblyProduct("sign_languageLib")] 13 | [assembly: AssemblyCopyright("Copyright © MS 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("dbf43fc6-3e1d-414d-a180-2bc2fe6568f7")] 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 | -------------------------------------------------------------------------------- /RecognitionSystem/SVM.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.RecognitionSystem 13 | { 14 | public class SVM : LeariningModel 15 | { 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /RecognitionSystem/StaticTools/StaticParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace CURELab.SignLanguage.RecognitionSystem.StaticTools 7 | { 8 | public static class StaticParams 9 | { 10 | public static int MAX_NUMBER_OF_PLAYERS = 6; 11 | public static float MOVING_SENSETIVITY = 0.006F; 12 | 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /RecognitionSystem/StaticTools/UtilityTools.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Microsoft.Kinect; 6 | using Microsoft.Xna.Framework; 7 | namespace CURELab.SignLanguage.RecognitionSystem.StaticTools 8 | { 9 | public static class UtilityTools 10 | { 11 | public static Vector3 SkeletonPointToVector3(SkeletonPoint sp) 12 | { 13 | return new Vector3(sp.X, sp.Y, sp.Z); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /RecognitionSystem/VisualFeatureModule.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.RecognitionSystem 13 | { 14 | public class VisualFeatureModule 15 | { 16 | protected RecognitionController m_recognitionController; 17 | protected DataWarehouse m_dataWarehouse; 18 | public VisualFeatureModule() { } 19 | public VisualFeatureModule(RecognitionController recognitionController) 20 | { 21 | m_recognitionController = recognitionController; 22 | m_dataWarehouse = m_recognitionController.m_dataProcessor.m_dataWarehouse; 23 | } 24 | 25 | public virtual void OnDataTransfer(Object sender, DataTransferEventArgs args) 26 | { 27 | Console.WriteLine("visual callback:" + args.m_data); 28 | } 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /SLDebugger/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SLDebugger/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SLDebugger/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 SLDebugger 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SLDebugger/Module/ConfigReader.cs: -------------------------------------------------------------------------------- 1 | // author: fyhuang 2 | // created time:2013/11/12 17:55:28 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.Debugger.Module 16 | { 17 | /// 18 | /// add summary here 19 | /// 20 | public class ConfigReader : XMLReader 21 | { 22 | private static ConfigReader singletonInstance; 23 | private ConfigReader():base("Config.xml") 24 | { 25 | 26 | } 27 | 28 | public static ConfigReader GetSingletonConfigReader() 29 | { 30 | if (singletonInstance == null) 31 | { 32 | singletonInstance = new ConfigReader(); 33 | } 34 | return singletonInstance; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /SLDebugger/Module/DBReader.cs: -------------------------------------------------------------------------------- 1 | // author: fyhuang 2 | // created time:2013/10/25 18:18:46 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.Debugger.Module 16 | { 17 | /// 18 | /// add summary here 19 | /// 20 | public class DBReader 21 | { 22 | public DBReader() 23 | { 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SLDebugger/Module/XMLReader.cs: -------------------------------------------------------------------------------- 1 | // author: fyhuang 2 | // created time:2013/10/16 15:37:01 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.Xml; 14 | 15 | 16 | 17 | namespace CURELab.SignLanguage.Debugger.Module 18 | { 19 | /// 20 | /// add summary here 21 | /// 22 | public class XMLReader 23 | { 24 | 25 | private XmlDocument xmlDocument; 26 | public XMLReader(string path) 27 | { 28 | xmlDocument = new XmlDocument(); 29 | xmlDocument.Load(path); 30 | } 31 | 32 | public string GetFileName(string fn) 33 | { 34 | XmlNode node = xmlDocument.SelectSingleNode("configuration"); 35 | node = node.SelectSingleNode("dataFile"); 36 | node = node.SelectSingleNode(fn); 37 | return node.Attributes[0].Value.ToString(); 38 | } 39 | 40 | public string GetColor(string data) 41 | { 42 | XmlNode node = xmlDocument.SelectSingleNode("configuration"); 43 | node = node.SelectSingleNode("graph"); 44 | node = node.SelectSingleNode("line"); 45 | node = node.SelectSingleNode(data); 46 | 47 | return node.Attributes[0].Value.ToString(); 48 | } 49 | 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /SLDebugger/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("SLDebugger")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("SLDebugger")] 15 | [assembly: AssemblyCopyright("Copyright © 2013")] 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 | -------------------------------------------------------------------------------- /SLDebugger/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.18052 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CURELab.SignLanguage.Debugger.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 | -------------------------------------------------------------------------------- /SLDebugger/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SLDebugger/StaticParams/Config.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SLDebugger/StaticParams/DataType.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.Debugger 8 | { 9 | public enum DataType 10 | { 11 | TestedData = 0, 12 | VideoTimestampData = 2, 13 | SegmentData = 3, 14 | OtherData = 4, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SLDebugger/StaticParams/FileName.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.Debugger 8 | { 9 | public class FileName 10 | { 11 | public static string VELOCITY = "velocity"; 12 | public static string ACCELERATION = "acceleration"; 13 | public static string TIMESTAMP = "timestamp"; 14 | public static string AC_SEGMENTATION = "ac_segmentation"; 15 | public static string ANG_SEGMENTATION = "ang_segmentation"; 16 | public static string VEL_SEGMENTATION = "ve_segmentation"; 17 | public static string SKELETON = "skeleton"; 18 | public static string ANGLE = "angle"; 19 | public static string WORDS = "words"; 20 | public static string POSITION = "position"; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /SLDebugger/StaticParams/SegmentType.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.Debugger 8 | { 9 | public enum SegmentType 10 | { 11 | NotSegment = 0, 12 | AccSegment = 1, 13 | VelSegment = 2, 14 | AngSegment = 3, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SLDebugger/View/ChartView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SLDebugger/View/ControlComponentView.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.Debugger 8 | { 9 | class ControlComponentView 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SLDebugger/View/DisplayRange.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.Debugger 8 | { 9 | public class DisplayRange 10 | { 11 | public double Start { get; set; } 12 | public double End { get; set; } 13 | 14 | public DisplayRange(double start, double end) 15 | { 16 | Start = start; 17 | End = end; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SLDebugger/View/SegWordShowBox.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /SLDebugger/View/ViewportAxesRangeRestriction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Research.DynamicDataDisplay.ViewportRestrictions; 7 | using Microsoft.Research.DynamicDataDisplay; 8 | using System.Windows; 9 | 10 | namespace CURELab.SignLanguage.Debugger 11 | { 12 | public class ViewportAxesRangeRestriction : IViewportRestriction 13 | { 14 | public DisplayRange XRange = null; 15 | public DisplayRange YRange = null; 16 | 17 | public Rect Apply(Rect oldVisible, Rect newVisible, Viewport2D viewport) 18 | { 19 | if (XRange != null) 20 | { 21 | newVisible.X = XRange.Start; 22 | newVisible.Width = XRange.End - XRange.Start; 23 | } 24 | 25 | if (YRange != null) 26 | { 27 | newVisible.Y = YRange.Start; 28 | newVisible.Height = YRange.End - YRange.Start; 29 | } 30 | 31 | return newVisible; 32 | } 33 | 34 | public event EventHandler Changed; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SLDebugger/ViewModel/TwoDimensionViewModel.cs: -------------------------------------------------------------------------------- 1 | // author: fyhuang 2 | // created time:2013/10/7 14:35:42 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 Microsoft.Research.DynamicDataDisplay.Common; 14 | 15 | 16 | namespace CURELab.SignLanguage.Debugger.ViewModel 17 | { 18 | /// 19 | /// TwoDimensionViewModel is a data model to be shown in data chart 20 | /// 21 | public class TwoDimensionViewPointCollection : RingArray 22 | { 23 | private const int TOTAL_POINTS = 1000; 24 | 25 | public TwoDimensionViewPointCollection() 26 | : base(TOTAL_POINTS) // here i set how much values to show 27 | { 28 | } 29 | public TwoDimensionViewPointCollection(double[] value, int[] time) 30 | : base(TOTAL_POINTS) 31 | { 32 | int length = Math.Min(value.Length, time.Length); 33 | for (int i = 0 ; i < length; i++) 34 | { 35 | this.Add(new TwoDimensionViewPoint(value[i],time[i])); 36 | } 37 | } 38 | } 39 | 40 | public class TwoDimensionViewPoint 41 | { 42 | public int TimeStamp { get; set; } 43 | 44 | public double Value { get; set; } 45 | 46 | public TwoDimensionViewPoint(double value, int timeStamp) 47 | { 48 | this.TimeStamp = timeStamp; 49 | this.Value = value; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /SignLanguageEducationSystem/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/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 SignLanguageEducationSystem { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/AutoNotifyPropertyChanged.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel; 7 | using System.Runtime.CompilerServices; 8 | 9 | namespace SignLanguageEducationSystem { 10 | public abstract class AutoNotifyPropertyChanged : INotifyPropertyChanged { 11 | public event PropertyChangedEventHandler PropertyChanged; 12 | 13 | // Checks if a property already matches a desired value. Notifies listeners only when necessary. 14 | protected bool SetProperty(ref T storage, T value, Boolean flush, [CallerMemberName] String propertyName = null) { 15 | if (!flush && object.Equals(storage, value)) return false; 16 | 17 | storage = value; 18 | this.OnPropertyChanged(propertyName); 19 | return true; 20 | } 21 | 22 | // Notifies listeners that a property value has changed. 23 | protected void OnPropertyChanged([CallerMemberName] string propertyName = null) { 24 | var eventHandler = this.PropertyChanged; 25 | if (eventHandler != null) { 26 | eventHandler(this, new PropertyChangedEventArgs(propertyName)); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/DTWWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | using NDtw; 15 | 16 | namespace SignLanguageEducationSystem 17 | { 18 | /// 19 | /// Interaction logic for DTW.xaml 20 | /// 21 | public partial class DTWWindow : Window 22 | { 23 | public DTWWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | public void SetData(Dtw dtw) 29 | { 30 | dtwGraph.Dtw = dtw; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/HomePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | using Microsoft.Kinect.Toolkit.Controls; 16 | 17 | namespace SignLanguageEducationSystem { 18 | /// 19 | /// Interaction logic for HomePage.xaml 20 | /// 21 | public partial class HomePage : UserControl { 22 | 23 | private SignBrowserPage signBrowserPage; 24 | 25 | public HomePage(SystemStatusCollection systemStatusCollection) { 26 | InitializeComponent(); 27 | this.DataContext = systemStatusCollection; 28 | KinectRegion.AddHandPointerEnterHandler(btnLearn, btnLearn_Enter); 29 | KinectRegion.AddHandPointerEnterHandler(btnWatchVideo, btnWatchVideo_Enter); 30 | KinectRegion.AddHandPointerLeaveHandler(btnLearn, btnLearn_Leave); 31 | KinectRegion.AddHandPointerLeaveHandler(btnWatchVideo, btnWatchVideo_Leave); 32 | } 33 | 34 | private void btnLearn_Enter(object sender, RoutedEventArgs e) { 35 | txtDescription.Text = "Learning Sign Language NOW. We will score you according to your performance"; 36 | } 37 | 38 | private void btnWatchVideo_Enter(object sender, RoutedEventArgs e) { 39 | txtDescription.Text = "Help! I don't know how to use this software"; 40 | } 41 | 42 | private void btnLearn_Click(object sender, RoutedEventArgs e) { 43 | if (signBrowserPage == null) { 44 | signBrowserPage = new SignBrowserPage((SystemStatusCollection) this.DataContext); 45 | } 46 | 47 | UIElementCollection children = ((Panel)this.Parent).Children; 48 | if (!children.Contains(signBrowserPage)) { 49 | children.Add(signBrowserPage); 50 | } 51 | } 52 | 53 | private void btnWatchVideo_Click(object sender, RoutedEventArgs e) { 54 | } 55 | 56 | private void btnLearn_Leave(object sender, RoutedEventArgs e) { 57 | txtDescription.Text = "Please select one function"; 58 | } 59 | 60 | private void btnWatchVideo_Leave(object sender, RoutedEventArgs e) { 61 | txtDescription.Text = "Please select one function"; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Images/back01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Images/back01.png -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Images/banner.png -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Images/cuhklogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Images/cuhklogo.png -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Images/curelogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Images/curelogo.png -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Images/learn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Images/learn.png -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Images/question.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Images/question.jpg -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Images/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Images/restart.png -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Infrastructure/MultiSelect/IListItemConverter.cs: -------------------------------------------------------------------------------- 1 | namespace SignLanguageEducationSystem.Infrastructure.MultiSelect 2 | { 3 | /// 4 | /// Converts items in the Master list to Items in the target list, and back again. 5 | /// 6 | /// 7 | /// Thanks to Samuel Jack for this code: http://blog.functionalfun.net/2009/02/how-to-databind-to-selecteditems.html 8 | /// 9 | public interface IListItemConverter 10 | { 11 | /// 12 | /// Converts the specified master list item. 13 | /// 14 | /// The master list item. 15 | /// The result of the conversion. 16 | object Convert(object masterListItem); 17 | 18 | /// 19 | /// Converts the specified target list item. 20 | /// 21 | /// The target list item. 22 | /// The result of the conversion. 23 | object ConvertBack(object targetListItem); 24 | } 25 | } -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Infrastructure/MultiSelect/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | using System.Diagnostics; 4 | 5 | namespace SignLanguageEducationSystem.Infrastructure.MultiSelect 6 | { 7 | /// 8 | /// Implements the ICommand interface 9 | /// 10 | /// 11 | /// Thanks to Josh Smith for this code: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx 12 | /// 13 | public class RelayCommand : ICommand 14 | { 15 | #region Fields 16 | 17 | readonly Action _execute; 18 | readonly Predicate _canExecute; 19 | 20 | #endregion // Fields 21 | 22 | #region Constructors 23 | 24 | public RelayCommand(Action execute) 25 | : this(execute, null) 26 | { 27 | } 28 | 29 | public RelayCommand(Action execute, Predicate canExecute) 30 | { 31 | if (execute == null) 32 | throw new ArgumentNullException("execute"); 33 | 34 | _execute = execute; 35 | _canExecute = canExecute; 36 | } 37 | #endregion // Constructors 38 | 39 | #region ICommand Members 40 | 41 | [DebuggerStepThrough] 42 | public bool CanExecute(object parameter) 43 | { 44 | return _canExecute == null ? true : _canExecute(parameter); 45 | } 46 | 47 | public event EventHandler CanExecuteChanged 48 | { 49 | add { CommandManager.RequerySuggested += value; } 50 | remove { CommandManager.RequerySuggested -= value; } 51 | } 52 | 53 | public void Execute(object parameter) 54 | { 55 | _execute(parameter); 56 | } 57 | 58 | #endregion // ICommand Members 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Infrastructure/MultiSelect/TwoListSynchronizer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfuyang/Sign-Language-with-Kinect/d9da0025960d23dd268d1bd4fd22330ad9995784/SignLanguageEducationSystem/Infrastructure/MultiSelect/TwoListSynchronizer.cs -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Infrastructure/StrongTypingHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using System.Reflection; 4 | 5 | namespace SignLanguageEducationSystem.Infrastructure 6 | { 7 | public class StrongTypingHelper 8 | { 9 | //usage: GetPropertyAsString(x => x.MyTypeProperty); 10 | public static string GetPropertyAsString(Expression> expression) 11 | { 12 | return GetProperty(expression).Name; 13 | } 14 | 15 | public static PropertyInfo GetProperty(Expression> expression) 16 | { 17 | var member = expression.Body as MemberExpression; 18 | if (member != null) 19 | return member.Member as PropertyInfo; 20 | if (expression.Body.NodeType == ExpressionType.Convert) 21 | { 22 | member = ((UnaryExpression)expression.Body).Operand as MemberExpression; 23 | if (member != null) 24 | return member.Member as PropertyInfo; 25 | } 26 | 27 | throw new ArgumentException(@"Expression is not a member access", expression.ToString()); 28 | } 29 | 30 | public static PropertyInfo GetProperty(Expression> expression) 31 | { 32 | var member = expression.Body as MemberExpression; 33 | if (member != null) 34 | return (PropertyInfo)member.Member; 35 | if (expression.Body.NodeType == ExpressionType.Convert) 36 | { 37 | member = ((UnaryExpression)expression.Body).Operand as MemberExpression; 38 | if (member != null) 39 | return (PropertyInfo)member.Member; 40 | } 41 | 42 | throw new ArgumentException(@"Expression is not a member access", expression.ToString()); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Infrastructure/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Linq.Expressions; 4 | 5 | namespace SignLanguageEducationSystem.Infrastructure 6 | { 7 | public class ViewModelBase : INotifyPropertyChanged 8 | { 9 | public event PropertyChangedEventHandler PropertyChanged; 10 | protected void NotifyPropertyChanged(Expression> expression) 11 | { 12 | if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(StrongTypingHelper.GetProperty(expression).Name)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Model/SignWord.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 SignLanguageEducationSystem { 8 | public class SignWord { 9 | public String Name { 10 | get; 11 | private set; 12 | } 13 | 14 | public string ID { 15 | get; 16 | private set; 17 | } 18 | public string Path { 19 | get { 20 | return "Data/Videos/" + ID + ".avi"; } 21 | private set { } 22 | } 23 | 24 | public SignWord(String name, String id) { 25 | this.Name = name; 26 | this.ID = id; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/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("SignLanguageEducationSystem")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("SignLanguageEducationSystem")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2014")] 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 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 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 SignLanguageEducationSystem.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 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/README.md: -------------------------------------------------------------------------------- 1 | Sign-Language-with-Kinect 2 | ========================= 3 | 4 | Sign Language recognition with Kinect by CURE lab in CUHK :) 5 | 6 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/SignBrowserPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | using Microsoft.Kinect.Toolkit.Controls; 17 | 18 | namespace SignLanguageEducationSystem { 19 | /// 20 | /// Interaction logic for SignBrowserPage.xaml 21 | /// 22 | public partial class SignBrowserPage : UserControl { 23 | 24 | private SignWordPage signWordPage; 25 | 26 | public SignBrowserPage(SystemStatusCollection systemStatusCollection) { 27 | InitializeComponent(); 28 | this.DataContext = systemStatusCollection; 29 | 30 | foreach (DataRow row in systemStatusCollection.SignWordTable.Rows) { 31 | string name = (string)row["Chinese Name"]; 32 | string id = (string)row["Sign ID"]; 33 | panelSignList.Children.Add(createKinectButton(new SignWord(name, id))); 34 | } 35 | } 36 | 37 | private void btnBack_Click(object sender, RoutedEventArgs e) { 38 | if (this.Parent != null) { 39 | UIElementCollection children = ((Panel)this.Parent).Children; 40 | if (children.Contains(this)) { 41 | children.Remove(this); 42 | } 43 | } 44 | } 45 | 46 | private KinectTileButton createKinectButton(SignWord signWord) { 47 | KinectTileButton button = new KinectTileButton(); 48 | button.DataContext = signWord; 49 | button.Click += btnSignWord_Click; 50 | button.Label = signWord.Name; 51 | return button; 52 | } 53 | 54 | private void btnSignWord_Click(object sender, RoutedEventArgs e) { 55 | KinectTileButton button = (KinectTileButton)sender; 56 | 57 | if (signWordPage == null) { 58 | signWordPage = new SignWordPage((SystemStatusCollection)this.DataContext); 59 | } 60 | ((SystemStatusCollection)this.DataContext).CurrentSignWord = ((SignWord)button.DataContext); 61 | 62 | UIElementCollection children = ((Panel)this.Parent).Children; 63 | if (!children.Contains(signWordPage)) { 64 | children.Add(signWordPage); 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/SignModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Printing.IndexedProperties; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Microsoft.Kinect; 8 | 9 | namespace SignLanguageEducationSystem 10 | { 11 | [Serializable] 12 | public class SignModel 13 | { 14 | private List h_vertical; 15 | 16 | public List H_vertical 17 | { 18 | get { return h_vertical; } 19 | set { h_vertical = value; } 20 | } 21 | private List h_horizantal; 22 | 23 | public List H_horizantal 24 | { 25 | get { return h_horizantal; } 26 | set { h_horizantal = value; } 27 | } 28 | 29 | public SignModel() 30 | { 31 | h_vertical = new List(); 32 | h_horizantal = new List(); 33 | } 34 | 35 | public override string ToString() 36 | { 37 | StringBuilder sb = new StringBuilder(); 38 | sb.Append(Name+':'); 39 | for (int i = 0; i < H_vertical.Count(); i++) 40 | { 41 | sb.Append(H_vertical[i].ToString() + ',' + H_horizantal[i].ToString() + " "); 42 | } 43 | sb.Remove(sb.Length - 1, 1); 44 | return sb.ToString(); 45 | } 46 | 47 | 48 | private string name; 49 | public string Name 50 | { 51 | get { return name; } 52 | set { name = value; } 53 | } 54 | 55 | public static SignModel CreateFromString(string s) 56 | { 57 | string name = s.Split(':')[0]; 58 | var sm = new SignModel(); 59 | sm.Name = name; 60 | string data = s.Split(':')[1]; 61 | string[] datas = data.Split(); 62 | foreach (var item in datas) 63 | { 64 | double v = Convert.ToDouble(item.Split(',')[0]); 65 | double h = Convert.ToDouble(item.Split(',')[1]); 66 | sm.H_horizantal.Add(h); 67 | sm.H_vertical.Add(v); 68 | } 69 | return sm; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/StartPage.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/StartPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace SignLanguageEducationSystem { 17 | /// 18 | /// Interaction logic for StartPage.xaml 19 | /// 20 | public partial class StartPage : UserControl { 21 | 22 | private HomePage homePage; 23 | 24 | public StartPage(SystemStatusCollection systemStatusCollection) { 25 | InitializeComponent(); 26 | this.DataContext = systemStatusCollection; 27 | 28 | BitmapImage bi = new BitmapImage(); 29 | bi.BeginInit(); 30 | bi.UriSource = new Uri("Data/Images/back01.png", UriKind.Relative); 31 | bi.EndInit(); 32 | 33 | ImageBrush b = new ImageBrush(bi); 34 | b.AlignmentY = 0; 35 | b.Stretch = Stretch.Fill; 36 | btnStart.Background = b; 37 | } 38 | 39 | private void KinectTileButton_Click(object sender, RoutedEventArgs e) { 40 | if (homePage == null) { 41 | homePage = new HomePage((SystemStatusCollection)this.DataContext); 42 | } 43 | 44 | UIElementCollection children = ((Panel)this.Parent).Children; 45 | if (!children.Contains(homePage)) { 46 | children.Add(homePage); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SignLanguageEducationSystem/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /UML/ModelDefinition/Package_1413.uml: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /UML/UML.modelproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 2.0 8 | {ecdb4bb5-2c7b-4ba7-b5a8-f7ea8dce1744} 9 | 2.0.0.0 10 | UML 11 | sign_language 12 | 13 | 14 | bin\Debug\ 15 | 16 | 17 | bin\Release\ 18 | 19 | 20 | 10.0 21 | $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion) 22 | 23 | 24 | 25 | 26 | Content 27 | 28 | 29 | Content 30 | 31 | 32 | Content 33 | 34 | 35 | Content 36 | 37 | 38 | Content 39 | RecognitionUML.classdiagram 40 | 41 | 42 | 43 | Content 44 | 45 | 46 | -------------------------------------------------------------------------------- /UnitTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下特性集 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("UnitTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("UnitTest")] 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("fb8027db-d2b3-48af-b7fd-fe937071778c")] 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 | -------------------------------------------------------------------------------- /UnitTest/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace UnitTest 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /XEDParser/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /XEDParser/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /XEDParser/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 XEDParser 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /XEDParser/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 |