public GraphicFaceTracker(GraphicOverlay overlay, ImageButton img, CameraSource cameraSource = null) { mOverlay = overlay; mFaceGraphic = new FaceGraphic(overlay); mCameraSource = cameraSource; _img = img; }
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; }
protected override async void OnCreate(Bundle bundle) { RequestWindowFeature(WindowFeatures.NoTitle); 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); _switchCamBtn = FindViewById <ImageButton>(Resource.Id.imageButton1); _trainNewFaceButton = FindViewById <ImageButton>(Resource.Id.trainNewFaceButton); //greetingsText = FindViewById<TextView>(Resource.Id.greetingsTextView); var personLoggedIn = this.Intent.Extras.GetString("Person"); Console.WriteLine(personLoggedIn + "--------"); jsonOfLoggedInPerson = JObject.Parse(personLoggedIn); Toast.MakeText(this, "Welcome back " + jsonOfLoggedInPerson.GetValue("Name") + "!", ToastLength.Long).Show(); _switchCamBtn.Click += SwichCamBtnClick; _trainNewFaceButton.Click += _trainNewFaceButton_Click; if (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.Camera) == Permission.Granted) { CreateCameraSource(CameraFacing.Front); //LiveCamHelper.Init(); //LiveCamHelper.GreetingsCallback = (s) => { RunOnUiThread(()=> GreetingsText = s ); }; //await LiveCamHelper.RegisterFaces(); } else { RequestCameraPermission(); } }
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); 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(GraphicOverlay overlay, CameraSource cameraSource = null) { mOverlay = overlay; mFaceGraphic = new FaceGraphic(overlay); mCameraSource = cameraSource; }
public Graphic(GraphicOverlay overlay) { mOverlay = overlay; }
public void Start(CameraSource cameraSource, GraphicOverlay overlay) { mOverlay = overlay; Start(cameraSource); }