20220523_003_skeleton_sequencer/sketch.js
// A function to draw the head
A function to draw the head
A function to draw the head
function drawHead() {
  for (let i = 0; i < poses.length; i++) {
    let pose = poses[i].pose;
    let keypoint = pose.keypoints[0];
    if (keypoint.score > 0.2) {
      fill(255, 0, 0);
      noStroke();
      ellipse(
        keypoint.position.x * scale_width,
        keypoint.position.y * scale_height,
        head_size * scale_mean,
        head_size * scale_mean
      );
    }
  }
}
function drawHead ( ) { for ( let i = 0 ; i < poses . length ; i ++ ) { let pose = poses [ i ] . pose ; let keypoint = pose . keypoints [ 0 ] ; if ( keypoint . score > 0.2 ) { fill ( 255 , 0 , 0 ) ; noStroke ( ) ; ellipse ( keypoint . position . x * scale_width , keypoint . position . y * scale_height , head_size * scale_mean , head_size * scale_mean ) ; } } }
A function to draw the head
A function to draw the head
// Loop through all the poses detected // A keypoint is an object describing a body part (head) // Only draw an ellipse is the pose probability is bigger than 0.2