/// <summary>
        /// Handle result when process success
        /// </summary>
        /// <param name="results"></param>
        private void ProcessSuccess(IList <MLSkeleton> results)
        {
            graphicOverlay.Clear();
            SkeletonGraphic skeletonGraphic = new SkeletonGraphic(graphicOverlay, results);

            graphicOverlay.Add(skeletonGraphic);
        }
        public override void OnUpdate(Detector.Detections detections, Java.Lang.Object item)
        {
            var face = item as Face;

            mOverlay.Add(mFaceGraphic);
            mFaceGraphic.UpdateFace(face);
        }
        /// <summary>
        /// Add keypoints to imageView
        /// </summary>
        private void ProcessSuccess(IList <MLHandKeypoints> results)
        {
            mGraphicOverlay.Clear();
            HandKeypointGraphic handGraphic = new HandKeypointGraphic(mGraphicOverlay, results);

            mGraphicOverlay.Add(handGraphic);
        }
Exemple #4
0
        public override void OnUpdate(Detector.Detections detections, Java.Lang.Object item)
        {
            var face = item as Face;

            mOverlay.Add(mFaceGraphic);
            mFaceGraphic.UpdateFace(face);
            if (detections.DetectedItems.Size() != 0)
            {
                if (ArduinoConnection != null && ArduinoConnection.State != true)
                {
                    ArduinoConnection.On();
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// Implemented from MLAnalyzer.IMLTransactor interface.
        /// Process the results returned by the analyzer.
        /// </summary>
        public void TransactResult(MLAnalyzer.Result result)
        {
            mOverlay.Clear();
            SparseArray imageSegmentationResult = result.AnalyseList;
            IList <MLSceneDetection> list       = new List <MLSceneDetection>();

            for (int i = 0; i < imageSegmentationResult.Size(); i++)
            {
                list.Add((MLSceneDetection)imageSegmentationResult.ValueAt(i));
            }
            MLSceneDetectionGraphic sceneDetectionGraphic = new MLSceneDetectionGraphic(mOverlay, list);

            mOverlay.Add(sceneDetectionGraphic);
            mOverlay.PostInvalidate();
        }
        public override void OnUpdate(Detections detectionResults, Java.Lang.Object item)
        {
            mOverlay.Add(mEyesGraphic);
            var face = item as Face;

            updatePreviousProportions(item);

            PointF leftPosition  = getLandmarkPosition(face, (int)LandmarkType.LeftEye);
            PointF rightPosition = getLandmarkPosition(face, (int)LandmarkType.RightEye);

            float leftOpenScore = face.IsLeftEyeOpenProbability;
            bool  isLeftOpen;

            if (leftOpenScore == Face.UncomputedProbability)
            {
                isLeftOpen = mPreviousIsLeftOpen;
            }
            else
            {
                isLeftOpen          = (leftOpenScore > EYE_CLOSED_THRESHOLD);
                mPreviousIsLeftOpen = isLeftOpen;
            }

            float rightOpenScore = face.IsRightEyeOpenProbability;
            bool  isRightOpen;

            if (rightOpenScore == Face.UncomputedProbability)
            {
                isRightOpen = mPreviousIsRightOpen;
            }
            else
            {
                isRightOpen          = (rightOpenScore > EYE_CLOSED_THRESHOLD);
                mPreviousIsRightOpen = isRightOpen;
            }

            mEyesGraphic.updateEyes(leftPosition, isLeftOpen, rightPosition, isRightOpen);
        }
Exemple #7
0
 /**
  * Update the position/characteristics of the barcode within the overlay.
  */
 public override void OnUpdate(Detector.Detections detections, Java.Lang.Object item)
 {
     _overlay.Add(_barcodeGraphic);
     _barcodeGraphic.UpdateBarcode(item.JavaCast <Android.Gms.Vision.Barcodes.Barcode>());
 }
 /**
  * Update the position/characteristics of the face within the overlay.
  */
 public override void OnUpdate(Detector.Detections detections, Java.Lang.Object item)
 {
     mOverlay.Add(mFaceGraphic);
     mFaceGraphic.UpdateFace(item.JavaCast <Face>());
 }