boundingBox; final double headEulerAngleY; final double headEulerAngleZ; final double leftEyeOpenProbability; final double rightEyeOpenProbability; final double smilingProbability; final int trackingId; FaceLadmark getLandmark( FaceLandmarkType landmark, ) => _landmarks[landmark]
just add all of this in a function • Make a call to setState • Mark the state as updated once face detection is complete • Add this function in the FAB on pressed we talked about earlier
Faces list with coordinnates • Faces are detected properly • But I still need to modify the image itself to show a bounding box over face • Any guesses, what should I use?
size) { canvas.drawImage(image, Offset.zero, Paint()); for (var i = 0; i < faces.length; i++) { canvas.drawRect(rects[i], paint); } } Draw the original image
size) { canvas.drawImage(image, Offset.zero, Paint()); for (var i = 0; i < faces.length; i++) { canvas.drawRect(rects[i], paint); } } Draw an unfilled rectangle on each face
size) { canvas.drawImage(image, Offset.zero, Paint()); for (var i = 0; i < faces.length; i++) { canvas.drawRect(rects[i], paint); } } Draw an unfilled rectangle on each face
when you try to draw something out of canvas • Image can go outside of your canvas SizedBox( width: _image.width.toDouble(), height: _image.height.toDouble(), child: CustomPaint( painter: FacePainter(_image, _faces), ),