Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2014104149
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Graduate
2020-11-23 14:19:42 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f84bb815bcaaecf1b5b3ebd5a6e4a8fe18b820dc
f84bb815
1 parent
da52a162
Complete opencv.js face detection
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
flask/templates/index.html
flask/templates/index.html
View file @
f84bb81
...
...
@@ -8,7 +8,7 @@
#container
{
margin
:
0px
auto
;
width
:
640px
;
height
:
96
0px
;
height
:
48
0px
;
border
:
10px
#333
solid
;
}
#videoInput
{
...
...
@@ -76,10 +76,9 @@ function processVideo() {
cap
.
read
(
src
);
src
.
copyTo
(
dst
);
cv
.
cvtColor
(
dst
,
gray
,
cv
.
COLOR_RGBA2GRAY
,
0
);
alert
(
'd'
);
// detect faces.
classifier
.
detectMultiScale
(
gray
,
faces
,
1.1
,
3
,
0
);
alert
(
'e'
);
let
msize
=
new
cv
.
Size
(
120
,
12
0
);
classifier
.
detectMultiScale
(
gray
,
faces
,
1.1
,
3
,
0
,
msize
);
// draw faces.
for
(
let
i
=
0
;
i
<
faces
.
size
();
++
i
)
{
let
face
=
faces
.
get
(
i
);
...
...
@@ -87,7 +86,6 @@ function processVideo() {
let
point2
=
new
cv
.
Point
(
face
.
x
+
face
.
width
,
face
.
y
+
face
.
height
);
cv
.
rectangle
(
dst
,
point1
,
point2
,
[
255
,
0
,
0
,
255
]);
}
alert
(
'f'
);
cv
.
imshow
(
'canvasOutput'
,
dst
);
// schedule the next one.
let
delay
=
1000
/
FPS
-
(
Date
.
now
()
-
begin
);
...
...
@@ -102,7 +100,7 @@ setTimeout(processVideo, 0);
</head>
<body
onload=
"cv['onRuntimeInitialized']=()=>{ load_cascade() }"
>
<div
id=
"container"
>
<video
autoplay=
"true"
id=
"videoInput"
width=
640
height=
480
>
<!-- style="visibility: hidden"--
>
<video
autoplay=
"true"
id=
"videoInput"
width=
640
height=
480
style=
"display: none"
>
</video>
<canvas
id=
'canvasOutput'
width=
640
height=
480
>
...
...
Please
register
or
login
to post a comment