Showing
1 changed file
with
3 additions
and
2 deletions
... | @@ -30,7 +30,7 @@ function activate() | ... | @@ -30,7 +30,7 @@ function activate() |
30 | function detect_face(img) | 30 | function detect_face(img) |
31 | { | 31 | { |
32 | let canvas = document.createElement('canvas'); | 32 | let canvas = document.createElement('canvas'); |
33 | - let ctx = canvas.getContext("2d") | 33 | + let ctx = canvas.getContext('2d') |
34 | ctx.src = img; | 34 | ctx.src = img; |
35 | let src = cv.imread(canvas); | 35 | let src = cv.imread(canvas); |
36 | let dst = new cv.Mat(src.cols, src.rows, cv.CV_8UC4); | 36 | let dst = new cv.Mat(src.cols, src.rows, cv.CV_8UC4); |
... | @@ -55,6 +55,8 @@ function detect_face(img) | ... | @@ -55,6 +55,8 @@ function detect_face(img) |
55 | let cropped = src.roi(rect); | 55 | let cropped = src.roi(rect); |
56 | cv.imshow(tempCanvas,cropped); | 56 | cv.imshow(tempCanvas,cropped); |
57 | } | 57 | } |
58 | + let preview = document.getElementById('preview'); | ||
59 | + cv.imshow(preview, dst); | ||
58 | if (faces.size() == 1) | 60 | if (faces.size() == 1) |
59 | { | 61 | { |
60 | let sender = document.getElementById("sender"); | 62 | let sender = document.getElementById("sender"); |
... | @@ -68,7 +70,6 @@ function detect_face(img) | ... | @@ -68,7 +70,6 @@ function detect_face(img) |
68 | { | 70 | { |
69 | alert('하나의 얼굴만 등록해주세요.') | 71 | alert('하나의 얼굴만 등록해주세요.') |
70 | } | 72 | } |
71 | - cv.imshow('preview', dst); | ||
72 | } | 73 | } |
73 | 74 | ||
74 | function submit() | 75 | function submit() | ... | ... |
-
Please register or login to post a comment