2

I'm using Mediapipe js to detect lips and apply a filter on them but by using draw connectors I'm getting the boundary over lips but I want to fill colour within the boundary how can I fill colour within the landmarks detected and not just colour the boundary

  // Draw the overlays.
  canvasCtx.save();
  canvasCtx.fillRect(0, 0, canvasElement.width, canvasElement.height);
  canvasCtx.drawImage(
      results.image, 0, 0, canvasElement.width, canvasElement.height);
  if (results.multiFaceLandmarks) {
    for (const landmarks of results.multiFaceLandmarks) {
      drawingUtils.drawConnectors(
          canvasCtx, landmarks,);
      
     
      drawingUtils.drawConnectors(
          canvasCtx, landmarks, mpFaceMesh.FACEMESH_LIPS, {color: 'red' ,lineWidth: 1 });
          
          
          
    }
  }
 
  canvasCtx.restore();
}

0 Answers0