nenadmarkus / picojs

A face detection library in 200 lines of JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to change the circle to square and take the photo by its coordinate?

Primtek-Dev opened this issue · comments

how to change the circle to square and take the photo by its coordinate?

There is a line of code at "/picojs/examples/webcam.html", line 94
ctx.arc(dets[i][1], dets[i][0], dets[i][2]/2, 0, 2*Math.PI, false);

Replace this line with this:
ctx.strokeRect(dets[i][1] - dets[i][2]/2, dets[i][0] - dets[i][2]/2, dets[i][2], dets[i][2]);