Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
klorydryk
FacialRecoTrackingScore
Commits
5a94445a
Commit
5a94445a
authored
Jan 26, 2020
by
klorydryk
Browse files
Update logo to technopolice - move gradient to half the height
parent
a4000a8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
logo.png
View replaced file @
a4000a8b
View file @
5a94445a
12.9 KB
|
W:
|
H:
2.04 KB
|
W:
|
H:
2-up
Swipe
Onion skin
trackmultiplefaces.py
View file @
5a94445a
...
...
@@ -34,9 +34,9 @@ GREEN = (0, 255, 0)
suspiciousColors
=
{
0
:(
0
,
0
,
0
),
1
:
GREEN
,
2
:
ORANGE
,
3
:
RED
}
avSusRectWidth
=
5
0
avSusRectWidth
=
6
0
cursorSize
=
(
5
0
,
2
0
)
cursorSize
=
(
3
0
,
3
0
)
cursor
=
cv2
.
imread
(
'logo.png'
)
# Read the file
cursor
=
cv2
.
resize
(
cursor
,
cursorSize
)
...
...
@@ -63,21 +63,26 @@ def displayGradientOn(resultImage, value):
colors
=
list
(
red
.
range_to
(
orange
,
10
))
colors
+=
list
(
orange
.
range_to
(
Color
(
"green"
),
10
))
pixelColorSize
=
5
height
=
resultImage
.
shape
[
0
]
width
=
resultImage
.
shape
[
1
]
cursor_height
=
cursor
.
shape
[
0
]
cursor_width
=
cursor
.
shape
[
1
]
gradient_height
=
len
(
colors
)
*
pixelColorSize
start_position
=
height
/
2
-
gradient_height
/
2
pixelColorSize
=
5
i
=
0
for
color
in
colors
:
h
=
color
.
hex
.
lstrip
(
'#'
)
if
(
len
(
h
)
==
6
):
cv2
.
rectangle
(
resultImage
,
(
int
(
width
-
avSusRectWidth
),
i
*
pixelColorSize
),
(
int
(
width
),
(
i
+
1
)
*
pixelColorSize
),
tuple
(
int
(
h
[
j
:
j
+
2
],
16
)
for
j
in
(
4
,
2
,
0
)),
-
1
)
cv2
.
rectangle
(
resultImage
,
(
int
(
width
-
avSusRectWidth
),
int
(
start_position
+
i
*
pixelColorSize
)
)
,
(
int
(
width
),
int
(
start_position
+
(
i
+
1
)
*
pixelColorSize
)
)
,
tuple
(
int
(
h
[
j
:
j
+
2
],
16
)
for
j
in
(
4
,
2
,
0
)),
-
1
)
else
:
cv2
.
rectangle
(
resultImage
,
(
int
(
width
-
avSusRectWidth
),
i
*
pixelColorSize
),
(
int
(
width
),
(
i
+
1
)
*
pixelColorSize
),
tuple
(
int
(
h
[
j
:
j
+
2
],
16
)
for
j
in
(
2
,
1
,
0
)),
-
1
)
cv2
.
rectangle
(
resultImage
,
(
int
(
width
-
avSusRectWidth
),
int
(
start_position
+
i
*
pixelColorSize
)
)
,
(
int
(
width
),
int
(
start_position
+
(
i
+
1
)
*
pixelColorSize
)
)
,
tuple
(
int
(
h
[
j
:
j
+
2
],
16
)
for
j
in
(
2
,
1
,
0
)),
-
1
)
i
+=
1
x_offset
=
width
-
avSusRectWidth
y_offset
=
int
((
i
)
*
pixelColorSize
*
(
2
-
(
value
-
1
))
/
2
)
resultImage
[
y_offset
:
y_offset
+
cursor
.
shape
[
0
]
,
x_offset
:
x_offset
+
cursor
.
shape
[
1
]
]
=
cursor
x_offset
=
width
-
avSusRectWidth
-
30
y_offset
=
int
((
start_position
-
cursor_height
/
2
)
+
gradient_height
*
(
2
-
(
value
-
1
))
/
2
)
resultImage
[
y_offset
:
y_offset
+
cursor
_height
,
x_offset
:
x_offset
+
cursor
_width
]
=
cursor
def
calculateAverageSuspicious
(
faceSuspicion
):
global
averageSuspicious
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment