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 15:59:35 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
871f76937b13ee0eb067e1fe1a1ca76274d0f6ca
871f7693
1 parent
4aa33d34
Update flask
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
flask/config.cnf
flask/templates/register.html
flask/config.cnf
View file @
871f769
[verification_server]
model=models/20200816-080621
threshold=0.
8
threshold=0.
75
image_size=160
...
...
flask/templates/register.html
View file @
871f769
...
...
@@ -31,8 +31,9 @@ function activate()
function
detect_face
()
{
alert
(
tempImage
)
let
canvas
=
document
.
createElement
(
'canvas'
);
canvas
.
width
=
tempImage
.
width
;
canvas
.
height
=
tempImage
.
height
;
let
ctx
=
canvas
.
getContext
(
'2d'
)
ctx
.
drawImage
(
tempImage
,
0
,
0
);
let
src
=
cv
.
imread
(
canvas
);
...
...
@@ -41,7 +42,6 @@ function detect_face()
let
faces
=
new
cv
.
RectVector
();
let
classifier
=
new
cv
.
CascadeClassifier
();
classifier
.
load
(
'haarcascade_frontalface_default.xml'
);
src
.
copyTo
(
dst
);
cv
.
cvtColor
(
dst
,
gray
,
cv
.
COLOR_RGBA2GRAY
,
0
);
let
msize
=
new
cv
.
Size
(
120
,
120
);
...
...
@@ -55,8 +55,8 @@ function detect_face()
cv
.
rectangle
(
dst
,
point1
,
point2
,
[
255
,
0
,
0
,
255
]);
// margin 44
let
rect
=
new
cv
.
Rect
(
Math
.
max
(
face
.
x
-
22
,
0
),
Math
.
max
(
face
.
y
-
22
,
0
),
face
.
width
+
22
,
face
.
height
+
22
);
let
cropped
=
src
.
roi
(
rect
);
cv
.
imshow
(
tempCanvas
,
cropped
);
let
cropped
=
src
.
roi
(
rect
);
cv
.
imshow
(
tempCanvas
,
cropped
);
}
let
preview
=
document
.
getElementById
(
'preview'
);
cv
.
imshow
(
preview
,
dst
);
...
...
@@ -102,7 +102,10 @@ var loadFile = function(event) {
reader
.
readAsDataURL
(
event
.
target
.
files
[
0
]);
reader
.
onload
=
function
()
{
tempImage
.
src
=
reader
.
result
;
detect_face
();
tempImage
.
onload
=
function
()
{
detect_face
();
}
};
};
</script>
...
...
@@ -120,13 +123,13 @@ and is wrapped around the whole page content, except for the footer in this exam
<div
class=
"w3-row"
,
style=
'text-align:center'
>
<h2><b>
얼굴 파일을 등록해주세요 (jpeg only)
</b></h2>
<div>
학번:
<input
type=
"text"
name
=
"student_id"
><br>
이름:
<input
type=
"text"
name
=
"student_name"
><br><br>
학번:
<input
type=
"text"
id
=
"student_id"
><br>
이름:
<input
type=
"text"
id
=
"student_name"
><br><br>
<input
type=
"file"
id=
"fileloader"
name=
"file"
onchange=
"loadFile(event)"
autocomplete=
"off"
accept=
"image/jpeg"
required
disabled
>
<div>
<canvas
id=
"preview"
></canvas>
</div>
<input
id=
"sender"
type=
"button"
onclick=
"submit"
value=
"등록"
disabled
>
<input
id=
"sender"
type=
"button"
onclick=
"submit
()
"
value=
"등록"
disabled
>
</div>
</div>
</div>
...
...
Please
register
or
login
to post a comment