Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -29,8 +29,9 @@ function activate() | ... | @@ -29,8 +29,9 @@ function activate() |
29 | function detect_face() | 29 | function detect_face() |
30 | { | 30 | { |
31 | let classifier = new cv.CascadeClassifier(); | 31 | let classifier = new cv.CascadeClassifier(); |
32 | + let imgElement = document.getElementById('imagefile'); | ||
32 | classifier.load('haarcascade_frontalface_default.xml'); | 33 | classifier.load('haarcascade_frontalface_default.xml'); |
33 | - let src = cv.imread('imagefile'); | 34 | + let src = cv.imread(imgElement); |
34 | let dst = new cv.Mat(video.height, video.width, cv.CV_8UC4); | 35 | let dst = new cv.Mat(video.height, video.width, cv.CV_8UC4); |
35 | let gray = new cv.Mat(); | 36 | let gray = new cv.Mat(); |
36 | src.copyTo(dst); | 37 | src.copyTo(dst); | ... | ... |
-
Please register or login to post a comment