Task #14811

Support #14808: création d'une vidéo au ralenti par opencv

Code qui execute des taches periodeique chaque minute

Added by Sebastien LENGAGNE 2 months ago. Updated 2 months ago.

Status:NewStart date:11/22/2022
Priority:NormalDue date:
Assignee:Marouane SOBTI% Done:

80%

Category:-
Target version:Polytech Projets GE - Troisième Itération 2022
Remaining (hours)

Description

import cv2
import sched, time

s = sched.scheduler(time.time, time.sleep)

def capture_each_minute(sc):
print("Capturing")
vidcap = cv2.VideoCapture(0)

if vidcap.isOpened():
ret, frame = vidcap.read() #capture a frame from live video
if ret:
while(True):
cv2.imshow("Frame",frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
else:
print("Error : Failed to capture frame")
else:
print("Cannot open camera")
sc.enter(60, 1, capture_each_minute, (sc,))

s.enter(60, 1, capture_each_minute, (s,))
s.run()


Related issues

Copied from Task #14732: Code qui execute des taches periodeique chaque minute New 11/22/2022

History

#1 Updated by Sebastien LENGAGNE 2 months ago

  • Copied from Task #14732: Code qui execute des taches periodeique chaque minute added

Also available in: Atom PDF