-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoManager.py
More file actions
51 lines (37 loc) · 1.39 KB
/
Copy pathVideoManager.py
File metadata and controls
51 lines (37 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import CameraManager
import cv2
import os
class VideoManager(CameraManager.CameraManager):
def __init__(self, path):
super().__init__()
self.s_manager_name = "VideoManager"
self.cap = cv2.VideoCapture(path)
if self.loadCameraCalibration():
self.setCalibration(True)
def captureCurrentFrame(self):
ret, m_current_frame = self.cap.read()
if ret:
self.m_current_frame = cv2.cvtColor(m_current_frame, cv2.COLOR_BGR2GRAY)
# cv2.imshow('frame', self.m_current_frame)
# cv2.waitKey(1)
else:
self.cap.set(cv2.CAP_PROP_POS_FRAMES, 0)
self.detectAndShowAprilTag()
self.applyCalibrationMatrix()
class CoreVideoManager(CameraManager.CoreManager):
def __init__(self, path):
super().__init__()
self.s_manager_name = "CoreVideoManager"
self.cap = cv2.VideoCapture(path)
if self.loadCameraCalibration():
self.setCalibration(True)
def captureCurrentFrame(self):
ret, m_current_frame = self.cap.read()
if ret:
self.m_current_frame = cv2.cvtColor(m_current_frame, cv2.COLOR_BGR2GRAY)
# cv2.imshow('frame', self.m_current_frame)
# cv2.waitKey(1)
else:
self.cap.set(cv2.CAP_PROP_POS_FRAMES, 0)
self.detectAndShowAprilTag()
self.applyCalibrationMatrix()