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-25 23:17:20 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a69f41b2ed378fe05059887d5c5130d5d116a08c
a69f41b2
1 parent
a25f1020
Update flask
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
flask/templates/register.html
flask/templates/register.html
View file @
a69f41b
...
...
@@ -11,6 +11,7 @@
<script
type=
'text/javascript'
src=
"{{url_for('static', filename='js/utils.js')}}"
></script>
<script
type=
'text/javascript'
src=
"https://code.jquery.com/jquery-1.12.4.min.js"
></script>
<script
type=
'text/javascript'
>
let
tempCanvas
=
document
.
createElement
(
"canvas"
);
function
load_cascade
()
{
let
faceCascadeFile
=
'haarcascade_frontalface_default.xml'
...
...
@@ -26,11 +27,15 @@ function activate()
fileloader
.
disabled
=
false
;
}
function
detect_face
()
function
detect_face
(
img
)
{
let
classifier
=
new
cv
.
CascadeClassifier
();
classifier
.
load
(
'haarcascade_frontalface_default.xml'
);
let
src
=
cv
.
imread
(
'imagefile'
);
let
canvas
=
document
.
createElement
(
'canvas'
);
let
ctx
=
canvas
.
getContext
(
"2d"
)
ctx
.
src
=
img
;
let
src
=
cv
.
imread
(
canvas
);
let
dst
=
new
cv
.
Mat
(
video
.
height
,
video
.
width
,
cv
.
CV_8UC4
);
let
gray
=
new
cv
.
Mat
();
src
.
copyTo
(
dst
);
...
...
@@ -91,13 +96,10 @@ var loadFile = function(event) {
var
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
event
.
target
.
files
[
0
]);
reader
.
onload
=
function
()
{
var
output
=
document
.
getElementById
(
'imagefile'
);
output
.
src
=
reader
.
result
;
detect_face
();
let
img
=
reader
.
result
;
detect_face
(
img
);
};
};
let
tempCanvas
=
document
.
createElement
(
"canvas"
);
</script>
</head>
<body
onload=
"cv['onRuntimeInitialized']=()=>{load_cascade();};"
class=
"w3-light-grey"
>
...
...
@@ -117,7 +119,6 @@ and is wrapped around the whole page content, except for the footer in this exam
이름:
<input
type=
"text"
name=
"student_name"
><br><br>
<input
type=
"file"
id=
"fileloader"
name=
"file"
onchange=
"loadFile(event)"
autocomplete=
"off"
accept=
"image/jpeg"
required
disabled
>
<div>
<img
id=
"imagefile"
>
<canvas
id=
"preview"
></canvas>
</div>
<input
id=
"sender"
type=
"button"
onclick=
"submit"
value=
"등록"
disabled
>
...
...
Please
register
or
login
to post a comment