Commit e126d1b0 authored by klorydryk's avatar klorydryk
Browse files

test caméras multiple mais simple affichage

parent 87cefec3
......@@ -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()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment