Esempio n. 1
0
        private void InitializeControls()
        {
            // Can overlap
            Topmost = false;

            // Init Validation Unit
            grdContainer2.Children.Add(new DirectionViewer3D {
                Photo = DirectionViewer3D.LoadPhotoFromFile("Photos/Dasha.png")
            });
            (grdContainer2.Children[0] as DirectionViewer3D).DashaTest();

            // Add 2 Composite Units
            grdContainer0.Children.Add(new CompositeVisionUnit());

            var unit2 = new CompositeVisionUnit();

            grdContainer1.Children.Add(unit2);

            //grdContainer1.Children.Add(new LoadingCircle());
            //grdContainer2.Children.Add(new LoadingPicture { Padding = new Thickness(0, 15, 0, 30) });
        }
        private async void CalculateDirection()
        {
            // Loading
            grdContainer.Children.Clear();
            grdContainer.Children.Add(new LoadingPicture {
                Padding = new Thickness(0, 15, 0, 30)
            });

            // Send MS request
            var image = DirectionViewer3D.LoadPhotoFromFile(_photoPath);

            _msResult = await FaceRecognition.Core.MicrosoftAPIs.ComparationAPI.
                        Commands.CommandsInstance.DetectFaceWithLandmarks(image);

            try
            {
                FaceRecognition.Core.ImageProcessing.ImageProcessingInstance.ClearCache();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            // Select what to show
            // Show new seletion window

            // Show resutls
            grdContainer.Children.Clear();
            _viewer = new DirectionViewer3D()
            {
                Photo = image
            };
            grdContainer.Children.Add(_viewer);

            // Render 3d graphics
            Render3D();
        }