Ejemplo n.º 1
0
 public FeedbackView(Sign sign, int skeletonScore, int handScore)
 {
     this.InitializeComponent();
     this.Cursor = Cursors.None;
     this.sign = sign;
     ShowFeedback(skeletonScore, handScore);
 }
Ejemplo n.º 2
0
 private static void TestSignsLessResourcesAreEqual(Sign expected, Sign actual)
 {
     // ignore resources, as they will be validated
     Assert.AreEqual(expected.SignClass, actual.SignClass);
     Assert.AreEqual(expected.SignName, actual.SignName);
     HMMTest.AssertHMMAreEqual(expected.SignModel.HandHMM.CHMM, actual.SignModel.HandHMM.CHMM);
     HMMTest.AssertHMMAreEqual(expected.SignModel.SkelHMM.CHMM, actual.SignModel.SkelHMM.CHMM);
 }
Ejemplo n.º 3
0
        private static void TestSignResourcesAreValid(Sign actual)
        {
            Assert.IsTrue(File.Exists(actual.ImgLocation) || Sign.InvalidImageFile.Equals(actual.ImgLocation),
                "image ({0}) not found", actual.ImgLocation);

            Assert.IsTrue(File.Exists(actual.VidLocation) || Sign.InvalidVideoFile.Equals(actual.VidLocation),
                "video ({0}) not found", actual.VidLocation);
        }
        private Sign s; // current sign which contains all the updates

        #endregion Fields

        #region Constructors

        public ModifySignClassification(Sign s, List<Sequence> examples, string filePath)
        {
            this.InitializeComponent();

            this.s = s;
            this.filePath = filePath;
            this.examples = examples;
        }
Ejemplo n.º 5
0
        private AsyncDelegateCommand trainingCommand; // asynchronously build the model

        #endregion Fields

        #region Constructors

        public SignModifyView(string filePath)
        {
            this.InitializeComponent();
            this.filePath = filePath;
            this.examples = null;
            sign = Sign.FromFile(filePath); // grabs the sign based on the location
            SetValuesInControls(); // set the sign information to the textboxes
        }
Ejemplo n.º 6
0
 public void CreateSignModel()
 {
     #if KINECT
     Sign newSign = new Sign(sign.SignName, sign.SignClass, sign.ImgLocation, sign.VidLocation, EngineModel.CreateFromTrainingSequences(examples));
     #else
     Sign newSign = new Sign(sign.SignName, sign.SignClass, sign.ImgLocation, sign.VidLocation, null);
     #endif
     Sign.ToFile(newSign); // save the new sign
     isTrainingDone = true;
 }
Ejemplo n.º 7
0
 public void CreateSignModel()
 {
     #if KINECT
     Sign newSign = new Sign(name, signClass, pictureURL, videoURL, EngineModel.CreateFromTrainingSequences(examples));
     #else
     Sign newSign = new Sign(name, signClass, pictureURL, videoURL, null);
     #endif
     Sign.ToFile(newSign);
     isTrainingDone = true;
 }
Ejemplo n.º 8
0
        public void TestSavingThenLoadingResultsInNoChanges()
        {
            var engine = new EngineModel(skelHMM, handHMM);
            var orig = new Sign(SignName, HandShape, ImageFile, VideoFile, engine);
            var saveLocation = Sign.ToFile(orig);

            var loaded = Sign.FromFile(saveLocation);
            TestSignResourcesAreValid(loaded);
            Directory.GetCurrentDirectory();
            TestSignsLessResourcesAreEqual(orig, loaded);
        }
Ejemplo n.º 9
0
        public PreviewView(Sign sign)
        {
            this.InitializeComponent();

            this.sign = sign;

            lblSignName.Content = sign.SignName; // loads the sign name
            ImageBrush myBrush = new ImageBrush();
            myBrush.ImageSource = new BitmapImage(new Uri(sign.ImgLocation, UriKind.Relative));
            imgSign.Fill = myBrush; // Set the image picture for the sign
            mediaElement.Source = new Uri(sign.VidLocation, UriKind.Relative); // set the video for the sign
        }
Ejemplo n.º 10
0
        private string videoURL; // video location of the new sign

        #endregion Fields

        #region Constructors

        public NewSignFinish(Sign s, List<Sequence> examples)
        {
            this.InitializeComponent();
            this.Cursor = Cursors.None;
            this.name = s.SignName;
            this.pictureURL = s.ImgLocation;
            this.signClass = s.SignClass;
            this.videoURL = s.VidLocation;
            this.examples = examples;
            this.s = s;
            processingCounter = 0;
        }
Ejemplo n.º 11
0
        public StoryFeedbackView(Sign sign, int skeletonScore, int handScore, LinkedList<Scenario>.Enumerator iter)
        {
            InitializeComponent();
            this.Cursor = Cursors.None;

            this.iter = iter;
            this.sign = sign;
            ShowFeedback(skeletonScore, handScore);

            if (skeletonScore < 50)
            {
                btnDone.Visibility = Visibility.Hidden;
            }
        }
Ejemplo n.º 12
0
 public NewSignRecord(Sign s, List<Sequence> examples)
 {
     this.InitializeComponent();
     this.Cursor = Cursors.None;
     #if KINECT
     KinectHandler.Get().AddVideoListener(NUIVideoFrameReady);
     skeletonDrawer = new SkeletonDrawer(SkeletonImage);
     skeletonDrawer.StartDrawing();
     CursorController.Get().StartListening();
     #endif
     this.s = s;
     this.examples = examples;
     this.currentCount = -1;
     lblTrainExampleNum.Content = "Number of Training Examples: " + examples.Count;
 }
Ejemplo n.º 13
0
        private DispatcherTimer timer; // timer to indicate the change in movement

        #endregion Fields

        #region Constructors

        public PerformView(Sign sign)
        {
            this.InitializeComponent();
            this.Cursor = Cursors.None;
            this.sign = sign;
            #if KINECT
            skeletonDrawer = new SkeletonDrawer(SkeletonImage);
            skeletonDrawer.StartDrawing();
            model = sign.SignModel;
            KinectHandler.Get().AddVideoListener(NUIVideoFrameReady);
            CursorController.Get().StartListening();
            #else
            model = new MockModel();
            #endif
            this.currentCount = -1;
            this.timer = new DispatcherTimer { IsEnabled = true, Interval = TimeSpan.FromSeconds(1) };
        }
Ejemplo n.º 14
0
        public SignModifyView(Sign s, List<Sequence> examples, string filePath)
        {
            this.InitializeComponent();
            this.filePath = filePath;
            this.examples = examples;
            sign = s;

            // if new training has been added, show indication (number of ADDITIONAL training)
            if(examples != null)
            {
                if (examples.Count != 0)
                {
                    lblNewExampleCount.Visibility = Visibility.Visible;
                    lblNewExampleCount.Content = examples.Count + " new training examples have been trained";
                }
            }
            SetValuesInControls();
        }
Ejemplo n.º 15
0
 public NewSignName(Sign s)
 {
     this.InitializeComponent();
     this.s = s;
     txtSignName.Text = s.SignName;
 }
Ejemplo n.º 16
0
        /// <summary>
        /// Save the file to file in a directory determined by its handshape.
        /// </summary>
        /// <param name="sign">The sign to save</param>
        /// <returns>The location of the file in which the sign has been saved</returns>
        public static string ToFile(Sign sign)
        {
            string outputDirectory = Directory.GetCurrentDirectory() + "\\" + sign.SignClass;
            if (!Directory.Exists(outputDirectory))
                Directory.CreateDirectory(outputDirectory);

            string outFile = outputDirectory + "\\" + sign.SignName + ".sign";
            using (var outFS = new FileStream(outFile, FileMode.Create, FileAccess.Write, FileShare.Write))
            {
                (new BinaryFormatter()).Serialize(outFS, sign);
            }

            return outFile;
        }
 public NewSignClassification(Sign s)
 {
     this.InitializeComponent();
     this.s = s;
 }
Ejemplo n.º 18
0
 public NewSignVideo(Sign s)
 {
     this.InitializeComponent();
     this.s = s;
     txtVideoURL.Text = s.VidLocation;
 }
Ejemplo n.º 19
0
 public NewSignPicture(Sign s)
 {
     this.InitializeComponent();
     this.s = s;
     txtPictureURL.Text = s.ImgLocation;
 }
Ejemplo n.º 20
0
 public NewSignName()
 {
     this.InitializeComponent();
     s = new Sign();
 }
Ejemplo n.º 21
0
        private bool TrySetupScenario()
        {
            var current = sceneIterator.Current;
            if (current == null) return false;

            wordtimer = new DispatcherTimer();
            words = current.EnglishLine.Split(' ');
            wordtimer.IsEnabled = true;
            wordtimer.Interval = TimeSpan.FromSeconds(1);
            wordtimer.Tick += OnTimerWordReader;
            wordtimer.Start();

            lblSignGrammar.Content = "Signs: " + current.SignLine;
            lblPreviousLines.Text = current.PreviousLines;

            sign = Sign.FromName(current.SignName);

            if (sign == null)
            {
                MessageBox.Show("Sign " + current.SignName + " cannot be found. Exiting");
                return false;
            }
            return true;
        }