protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); cameraPreview = FindViewById <CameraPreview>(Resource.Id.preview); faceOverlay = FindViewById <FaceOverlay>(Resource.Id.faceOverlay); // Check permission for camera if (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.Camera) == Permission.Granted) { CreateCamera(); } else { RequestCameraPermission(); } }
public FaceGraphic(FaceOverlay 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, FaceOverlay overlay) { theOverlay = overlay; Start(cameraSource); }
public GraphicFaceTracker(FaceOverlay theOverlay, CameraSource theCameraSource = null) { overlay = theOverlay; faceGraphic = new FaceGraphic(overlay); cameraSource = theCameraSource; }