20220105_002_pose_net_sample/sketch.js
// A function to draw the skeletons
A function to draw the skeletons
A function to draw the skeletons
function drawSkeleton() {
  for (let i = 0; i < poses.length; i++) {
    let skeleton = poses[i].skeleton;
    for (let j = 0; j < skeleton.length; j++) {
      let partA = skeleton[j][0];
      let partB = skeleton[j][1];
      stroke(255, 0, 0);
      strokeWeight(10 * scale_mean);
      line(
        partA.position.x * scale_width,
        partA.position.y * scale_height,
        partB.position.x * scale_width,
        partB.position.y * scale_height
      );
    }
  }
}
function drawSkeleton ( ) { for ( let i = 0 ; i < poses . length ; i ++ ) { let skeleton = poses [ i ] . skeleton ; for ( let j = 0 ; j < skeleton . length ; j ++ ) { let partA = skeleton [ j ] [ 0 ] ; let partB = skeleton [ j ] [ 1 ] ; stroke ( 255 , 0 , 0 ) ; strokeWeight ( 10 * scale_mean ) ; line ( partA . position . x * scale_width , partA . position . y * scale_height , partB . position . x * scale_width , partB . position . y * scale_height ) ; } } }
A function to draw the skeletons
A function to draw the skeletons
// Loop through all the skeletons detected // For every skeleton, loop through all body connections