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 16:20:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f55ab291b89240085cd8cea3ffa98472752fd415
f55ab291
1 parent
e6c4243c
Change register method
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
flask/templates/index.html
flask/templates/register.html
flask/templates/index.html
View file @
f55ab29
...
...
@@ -39,9 +39,9 @@ function init()
load_cascade
();
});
}).
catch
(
function
(
err0r
)
{
console
.
log
(
"Something went wrong!"
);
streaming
=
false
;
});
console
.
log
(
"Something went wrong!"
);
streaming
=
false
;
});
}
}
...
...
@@ -63,7 +63,6 @@ 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
);
// let gray = new cv.Mat();
let
cap
=
new
cv
.
VideoCapture
(
video
);
let
faces
=
new
cv
.
RectVector
();
let
classifier
=
new
cv
.
CascadeClassifier
();
...
...
@@ -105,7 +104,6 @@ function main()
// clean and stop.
src
.
delete
();
dst
.
delete
();
gray
.
delete
();
faces
.
delete
();
classifier
.
delete
();
return
;
...
...
@@ -115,7 +113,6 @@ function main()
cap
.
read
(
src
);
cv
.
flip
(
src
,
src
,
1
);
src
.
copyTo
(
dst
);
// cv.cvtColor(dst, gray, cv.COLOR_RGBA2GRAY, 0);
// detect faces.
let
msize
=
new
cv
.
Size
(
video
.
width
/
4
,
video
.
height
/
4
);
classifier
.
detectMultiScale
(
dst
,
faces
,
1.1
,
3
,
0
,
msize
);
...
...
flask/templates/register.html
View file @
f55ab29
...
...
@@ -95,7 +95,6 @@ function main()
// clean and stop.
src
.
delete
();
dst
.
delete
();
gray
.
delete
();
faces
.
delete
();
classifier
.
delete
();
return
;
...
...
@@ -105,7 +104,6 @@ function main()
cap
.
read
(
src
);
cv
.
flip
(
src
,
src
,
1
);
src
.
copyTo
(
dst
);
// cv.cvtColor(dst, gray, cv.COLOR_RGBA2GRAY, 0);
// detect faces.
let
msize
=
new
cv
.
Size
(
video
.
width
/
4
,
video
.
height
/
4
);
classifier
.
detectMultiScale
(
dst
,
faces
,
1.1
,
3
,
0
,
msize
);
...
...
@@ -125,6 +123,7 @@ function main()
// 1초동안 인식되면 사진 촬영 종료하고 등록 버튼 활성화
b64encoded
=
tempCanvas
.
toDataURL
(
"image/jpeg"
,
1.0
);
toggle_streaming
();
change_notice
(
"촬영 완료! 정보를 등록해주세요"
);
activate_sender
();
}
}
...
...
@@ -150,13 +149,23 @@ function toggle_streaming()
{
streamButton
=
document
.
getElementById
(
"streamButton"
);
streaming
=
!
streaming
;
if
(
streaming
)
if
(
streaming
)
{
streamButton
.
value
=
"촬영중지"
;
else
change_notice
(
"1초 후 얼굴을 촬영합니다"
);
}
else
{
streamButton
.
value
=
"촬영시작"
;
change_notice
(
"촬영이 중지되었습니다"
);
}
main
();
}
function
change_notice
(
text
)
{
let
notice
=
document
.
getElementById
(
"notice"
);
notice
.
innerHTML
=
text
;
}
function
submit
()
{
let
student_id
=
document
.
getElementById
(
'student_id'
).
value
;
...
...
@@ -191,7 +200,7 @@ and is wrapped around the whole page content, except for the footer in this exam
</header>
<div
class=
"w3-row"
,
style=
'text-align:center'
>
<h2
><b>
얼굴을 등록해주세요 (jpeg only)
</b></h2>
<h2
id=
"notice"
><b>
1초 후 얼굴을 촬영합니다
</b></h2>
<div
id=
"container"
>
<video
autoplay=
"true"
id=
"videoInput"
style=
"display: none; object-fit: cover;"
></video>
<canvas
id=
"canvasOutput"
></canvas>
...
...
Please
register
or
login
to post a comment