protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); mPreview = FindViewById <CameraSourcePreview>(Resource.Id.preview); mGraphicOverlay = FindViewById <GraphicOverlay>(Resource.Id.faceOverlay); //greetingsText = FindViewById<TextView>(Resource.Id.greetingsTextView); eyeSpyAPI = new EyeSpyAPI(); if (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.Camera) == Permission.Granted) { CreateCameraSource(); /*LiveCamHelper.Init(); * LiveCamHelper.GreetingsCallback = (s) => { RunOnUiThread(() => GreetingsText = s); }; * await LiveCamHelper.RegisterFaces();*/ } else { RequestCameraPermission(); } }
public GraphicFaceTracker(MainActivity context, GraphicOverlay overlay, CameraSource cameraSource = null) { mContext = context; mOverlay = overlay; mFaceGraphic = new FaceGraphic(overlay); mCameraSource = cameraSource; }
public FaceGraphic(GraphicOverlay overlay) : base(overlay) { mCurrentColorIndex = (mCurrentColorIndex + 1) % COLOR_CHOICES.Length; var selectedColor = COLOR_CHOICES[mCurrentColorIndex]; mFacePositionPaint = new Paint() { Color = selectedColor }; mIdPaint = new Paint() { Color = selectedColor, TextSize = ID_TEXT_SIZE }; mBoxPaint = new Paint() { Color = selectedColor }; mBoxPaint.SetStyle(Paint.Style.Stroke); mBoxPaint.StrokeWidth = BOX_STROKE_WIDTH; }
public void Start(CameraSource cameraSource, GraphicOverlay overlay) { mOverlay = overlay; Start(cameraSource); }