public HandTrackingValue(ClassificationList classificationList, NormalizedLandmarkList landmarkList, NormalizedRect rect, List <Detection> detections)
 {
     Handedness       = classificationList;
     HandLandmarkList = landmarkList;
     HandRect         = rect;
     PalmDetections   = detections;
 }
Esempio n. 2
0
 public void Draw(Transform screenTransform, ClassificationList handedness, NormalizedLandmarkList handLandmarkList,
                  NormalizedRect handRect, List <Detection> palmDetections, bool isFlipped = false)
 {
     handednessAnnotation.GetComponent <ClassificationAnnotationController>().Draw(screenTransform, handedness);
     handLandmarkListAnnotation.GetComponent <HandLandmarkListAnnotationController>().Draw(screenTransform, handLandmarkList, isFlipped);
     handRectAnnotation.GetComponent <RectAnnotationController>().Draw(screenTransform, handRect, isFlipped);
     palmDetectionsAnnotation.GetComponent <DetectionListAnnotationController>().Draw(screenTransform, palmDetections, isFlipped);
 }
Esempio n. 3
0
        /// <summary>
        ///   Renders a text on a screen.
        ///   It is assumed that the screen is vertical to terrain and not inverted.
        /// </summary>
        public void Draw(Transform screenTransform, ClassificationList classificationList)
        {
            var arr = classificationList.Classification;

            if (arr.Count == 0 || arr[0].Score < 0.5)
            {
                Clear();
                return;
            }

            gameObject.GetComponent <TextMesh>().text = arr[0].Label;

            var localScale = screenTransform.localScale;

            gameObject.transform.position = new Vector3(-10 * localScale.x / 2, 10 * localScale.z / 2, screenTransform.position.z);
        }
Esempio n. 4
0
        private List <ClassificationList> BuildClassification(List <Classification> sundayClassificationFromDB)
        {
            if (sundayClassificationFromDB != null && sundayClassificationFromDB.Count() > 0)
            {
                List <ClassificationList> classificationList = new List <ClassificationList>();

                foreach (Classification fromDB in sundayClassificationFromDB)
                {
                    ClassificationList classification = new ClassificationList();
                    PlayerResume       playerResume   = new PlayerResume();

                    playerResume.PlayerID   = fromDB.PlayerID;
                    playerResume.PlayerName = fromDB.Player.Name;
                    playerResume.Games      = fromDB.NumGames;
                    playerResume.Goals      = fromDB.Goals;
                    playerResume.Wins       = fromDB.Wins;
                    playerResume.Draws      = fromDB.Draws;
                    playerResume.Loses      = fromDB.Loses;

                    classification.Player      = playerResume;
                    classification.PlayerName  = fromDB.Player.Name;
                    classification.NumGames    = fromDB.NumGames;
                    classification.Goals       = fromDB.Goals;
                    classification.Wins        = fromDB.Wins;
                    classification.Draws       = fromDB.Draws;
                    classification.Loses       = fromDB.Loses;
                    classification.TotalPoints = fromDB.TotalPoints;

                    classificationList.Add(classification);
                }

                if (classificationList.Count() > 0)
                {
                    classificationList = classificationList.OrderByDescending(c => c.TotalPoints).ThenByDescending(c => c.Goals).
                                         ToList <ClassificationList>();
                }
                return(classificationList);
            }

            return(null);
        }
Esempio n. 5
0
        private void InitializeCustomListBox()
        {
            var CList = new ClassificationList();

            CList.HorizontalAlignment = HorizontalAlignment.Center;
            CList.VerticalAlignment   = VerticalAlignment.Center;

            CList.AddCollection(new ClassificationButton(CList)
            {
                Color     = new SolidColorBrush(Color.FromRgb(236, 58, 88)),
                Text      = "Top secret1",
                Name      = "testBtn1",
                SortIndex = 6
            });
            CList.AddCollection(new ClassificationButton(CList)
                                //2
            {
                Color     = new SolidColorBrush(Color.FromRgb(252, 120, 84)),
                Text      = "Top secret",
                Name      = "testBtn2",
                SortIndex = 5
            });
            CList.AddCollection(new ClassificationButton(CList)
                                //3
            {
                Color     = new SolidColorBrush(Color.FromRgb(236, 58, 88)),
                Text      = "Top guarded long headljnjnjnjnj",
                Name      = "testBtn3",
                SortIndex = 4
            });
            CList.AddCollection(new ClassificationButton(CList)
                                //4
            {
                Color     = new SolidColorBrush(Color.FromRgb(252, 222, 83)),
                Text      = "Guarded",
                Name      = "testBtn4",
                SortIndex = 3
            });
            CList.AddCollection(new ClassificationButton(CList)
                                //5
            {
                Color     = new SolidColorBrush(Color.FromRgb(72, 247, 150)),
                Text      = "Classified B",
                Name      = "testBtn5",
                SortIndex = 2
            });
            CList.AddCollection(new ClassificationButton(CList)
                                //6
            {
                Color     = new SolidColorBrush(Colors.White),
                Text      = "Top secretFirst",
                Name      = "None",
                SortIndex = 1
            });
            CList.AddCollection(new ClassificationButton(CList)
                                //6
            {
                Color     = new SolidColorBrush(Colors.White),
                Text      = "None",
                Name      = "None",
                SortIndex = 0
            });


            XAMLStackPanel.Children.Add(CList); // add to Xaml

            CList.Name      = "CList";
            CList.Margin    = new Thickness(5);
            CList.IsUseMore = true;
        }
 public HandTrackingValue(ClassificationList classificationList, NormalizedLandmarkList landmarkList, NormalizedRect rect) :
     this(classificationList, landmarkList, rect, new List <Detection>())
 {
 }