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
e126d1b0
Commit
e126d1b0
authored
Apr 27, 2021
by
klorydryk
Browse files
test caméras multiple mais simple affichage
parent
87cefec3
Changes
1
Hide whitespace changes
Inline
Side-by-side
trackmultiplefaces.py
View file @
e126d1b0
...
...
@@ -623,17 +623,39 @@ class facetracker:
return
color
def
test_display_cam
(
self
):
video_capture
=
cv2
.
VideoCapture
(
self
.
camera_number
)
videoName
=
"cam"
+
str
(
self
.
camera_number
)
while
True
:
# Capture frame-by-frame
ret
,
frame
=
video_capture
.
read
()
if
(
ret
):
# Display the resulting frame
cv2
.
imshow
(
videoName
,
frame
)
if
cv2
.
waitKey
(
1
)
&
0xFF
==
ord
(
'q'
):
break
# When everything is done, release the capture
video_capture
.
release
()
cv2
.
destroyAllWindows
()
if
__name__
==
'__main__'
:
for
camera_id
in
list_available_cameras
():
camera
=
facetracker
(
camera_id
)
thread
=
Thread
(
target
=
camera
.
detectAndTrackMultipleFaces
,
args
=
{
# False: Names are directly printed on screen, no new thread
'start_thread'
:
False
,
# Select only names with letters and whitespace. Any other value will select printable.
'charset'
:
"letters"
,
# If True, then rectangle color around people' face will turn red if dangerous
'draw_person_dangerosity'
:
True
,
# Add a warning message if dangerous
'add_warning_message'
:
True
,
})
thread
=
Thread
(
target
=
camera
.
test_display_cam
)
thread
.
start
()
# thread = Thread( target=camera.detectAndTrackMultipleFaces, args={
# # False: Names are directly printed on screen, no new thread
# 'start_thread' : False,
# # Select only names with letters and whitespace. Any other value will select printable.
# 'charset' : "letters",
# # If True, then rectangle color around people' face will turn red if dangerous
# 'draw_person_dangerosity' : True,
# # Add a warning message if dangerous
# 'add_warning_message' : True,
# })
# thread.start()
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