Showing
1 changed file
with
5 additions
and
8 deletions
... | @@ -6,18 +6,14 @@ | ... | @@ -6,18 +6,14 @@ |
6 | <style> | 6 | <style> |
7 | #container { | 7 | #container { |
8 | margin: 0px auto; | 8 | margin: 0px auto; |
9 | - width: 640px; | 9 | + width: 1280px; |
10 | - height: 480px; | 10 | + height: 1280px; |
11 | border: 10px #333 solid; | 11 | border: 10px #333 solid; |
12 | } | 12 | } |
13 | #videoInput { | 13 | #videoInput { |
14 | - width: 640px; | ||
15 | - height: 480px; | ||
16 | background-color: #666; | 14 | background-color: #666; |
17 | } | 15 | } |
18 | #canvasOutput { | 16 | #canvasOutput { |
19 | - width: 640px; | ||
20 | - height: 480px; | ||
21 | background-color: #666; | 17 | background-color: #666; |
22 | } | 18 | } |
23 | </style> | 19 | </style> |
... | @@ -37,7 +33,7 @@ function load_cascade() | ... | @@ -37,7 +33,7 @@ function load_cascade() |
37 | function main() | 33 | function main() |
38 | { | 34 | { |
39 | let video = document.getElementById("videoInput"); | 35 | let video = document.getElementById("videoInput"); |
40 | -let canvasOutput = document.getElementById('canvasOutput'); | 36 | +let canvasOutput = document.getElementById("canvasOutput"); |
41 | let canvasContext = canvasOutput.getContext('2d'); | 37 | let canvasContext = canvasOutput.getContext('2d'); |
42 | 38 | ||
43 | if (navigator.mediaDevices.getUserMedia){ | 39 | if (navigator.mediaDevices.getUserMedia){ |
... | @@ -48,6 +44,7 @@ if (navigator.mediaDevices.getUserMedia){ | ... | @@ -48,6 +44,7 @@ if (navigator.mediaDevices.getUserMedia){ |
48 | console.log("Something went wrong!"); | 44 | console.log("Something went wrong!"); |
49 | }); | 45 | }); |
50 | } | 46 | } |
47 | + | ||
51 | let src = new cv.Mat(video.height, video.width, cv.CV_8UC4); | 48 | let src = new cv.Mat(video.height, video.width, cv.CV_8UC4); |
52 | let dst = new cv.Mat(video.height, video.width, cv.CV_8UC4); | 49 | let dst = new cv.Mat(video.height, video.width, cv.CV_8UC4); |
53 | let gray = new cv.Mat(); | 50 | let gray = new cv.Mat(); |
... | @@ -99,7 +96,7 @@ setTimeout(processVideo, 0); | ... | @@ -99,7 +96,7 @@ setTimeout(processVideo, 0); |
99 | </head> | 96 | </head> |
100 | <body onload="cv['onRuntimeInitialized']=()=>{ load_cascade() }"> | 97 | <body onload="cv['onRuntimeInitialized']=()=>{ load_cascade() }"> |
101 | <div id="container"> | 98 | <div id="container"> |
102 | -<video autoplay="true" id="videoInput" width=640 height=480 style="display: none"> | 99 | +<video autoplay="true" id="videoInput" width=640 height=480 style="display: none;"> |
103 | 100 | ||
104 | </video> | 101 | </video> |
105 | <canvas id='canvasOutput' width=640 height=480> | 102 | <canvas id='canvasOutput' width=640 height=480> | ... | ... |
-
Please register or login to post a comment