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-28 22:04:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6428825be2c3954f1ee1fb471041490b5aa1cf35
6428825b
1 parent
2bc34a7c
Update index.html UI
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
flask/templates/index.html
flask/templates/index.html
View file @
6428825
...
...
@@ -66,8 +66,8 @@ function init()
var
ratio
=
1.0
;
video
.
width
=
video
.
videoWidth
;
video
.
height
=
video
.
videoHeight
;
if
(
video
.
width
>
screenWidth
||
video
.
height
+
headerHeight
+
messageboxHeight
/
2
>
screenHeight
){
ratio
=
Math
.
min
(
screenWidth
/
video
.
width
*
1.0
,
screenHeight
/
((
video
.
height
+
headerHeight
+
messageboxHeight
/
2
)
*
1.0
));
if
(
video
.
width
>
screenWidth
||
video
.
height
+
headerHeight
+
messageboxHeight
>
screenHeight
){
ratio
=
Math
.
min
(
screenWidth
/
video
.
width
*
1.0
,
screenHeight
/
((
video
.
height
+
headerHeight
+
messageboxHeight
)
*
1.0
));
}
container
.
style
.
width
=
Math
.
round
(
video
.
width
*
ratio
)
+
'px'
;
container
.
style
.
height
=
Math
.
round
(
video
.
height
*
ratio
)
+
'px'
;
...
...
@@ -100,6 +100,7 @@ function main()
let
canvasContext
=
canvasOutput
.
getContext
(
'2d'
);
let
src
=
new
cv
.
Mat
(
video
.
height
,
video
.
width
,
cv
.
CV_8UC4
);
let
dst
=
new
cv
.
Mat
(
video
.
height
,
video
.
width
,
cv
.
CV_8UC4
);
var
dsize
=
new
cv
.
Size
(
canvasOutput
.
width
,
canvasOutput
.
height
);
let
cap
=
new
cv
.
VideoCapture
(
video
);
let
faces
=
new
cv
.
RectVector
();
let
classifier
=
new
cv
.
CascadeClassifier
();
...
...
@@ -189,26 +190,25 @@ function main()
var
newHead
=
"<div class='message attend'>"
;
var
newTail
=
"</div>"
;
var
newContent
=
'['
+
data
.
student_id
+
'/'
+
data
.
student_name
+
']'
+
"출석되었습니다."
;
$
(
'#messagebox'
).
prepend
(
newHead
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
3
00
);
$
(
'#messagebox'
).
prepend
(
newHead
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
10
00
);
}
else
if
(
data
.
status
==
"already"
){
var
newHead
=
"<div class='message already'>"
;
var
newTail
=
"</div>"
;
var
newContent
=
'['
+
data
.
student_id
+
'/'
+
data
.
student_name
+
']'
+
"이미 출석되었습니다."
;
$
(
'#messagebox'
).
prepend
(
newHead
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
3
00
);
$
(
'#messagebox'
).
prepend
(
newHead
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
10
00
);
}
else
if
(
data
.
status
==
"fail"
){
var
newHead
=
"<div class='message fail'>"
;
var
newTail
=
"</div>"
;
var
newContent
=
"인식 실패"
;
$
(
'#messagebox'
).
prepend
(
newHead
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
3
00
);
$
(
'#messagebox'
).
prepend
(
newHead
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
10
00
);
}
}
});
}
}
// to do resize preview
var
dsize
=
new
cv
.
Size
(
canvasOutput
.
width
,
canvasOutput
.
height
);
cv
.
resize
(
dst
,
dst
,
dsize
,
0
,
0
,
cv
.
INTER_AREA
);
cv
.
imshow
(
'canvasOutput'
,
dst
);
// schedule the next one.
...
...
Please
register
or
login
to post a comment