As I understand the website mentioned, this is really easy. Just record mouseX, mouseY in mousePressed(), using an array. (I would use a PVector ArrayList).
You can also automate the process using the openCV object detection. You could change the code of this example.