Skip to content

Commit

Permalink
comments on new example
Browse files Browse the repository at this point in the history
  • Loading branch information
shiffman committed Dec 15, 2020
1 parent 4c61b28 commit a154a4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/p5js/Handpose/Handpose_Part_Selection/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ function modelReady() {

function draw() {
image(video, 0, 0, width, height);

// If there is a hand
if (hands.length > 0) {
// Individual parts are in "annotations"
let thumb = hands[0].annotations.thumb;
fill(0, 255, 0);
noStroke();
// The top of the thumb is index 3
ellipse(thumb[3][0], thumb[3][1], 24);
let index = hands[0].annotations.indexFinger;
fill(0, 0, 255);
noStroke();
// The top of the index finger is index 3
ellipse(index[3][0], index[3][1], 24);
}
}

0 comments on commit a154a4d

Please sign in to comment.