91
self.CVThreading =
def
resume(self):
'''
Resume the thread
'''
self.__flag.set()
def
run(self):
'''
Process video frames in the background thread
'''
while
1:
self.__flag.wait()
self.CVThreading =
self.doOpenCV(self.imgCV)
class
Camera(BaseCamera):
video_source = 0
def
__init__(self):
if
os.environ.get('OPENCV_CAMERA_SOURCE'):
Camera.set_video_source(int(os.environ['OPENCV_CAMERA_SOURCE']))
super(Camera, self).__init__()
@staticmethod
def
set_video_source(source):
Camera.video_source = source
@staticmethod
def
frames():
camera = cv2.VideoCapture(Camera.video_source)
if not
camera.isOpened():
raise
RuntimeError('Could not start camera.')
'''
Instantiation CVThread()
'''
cvt = CVThread()
cvt.start()
while True:
# read current frame
0
1
Need help?
Do you have a question about the AWR Adeept Wheeled Robot and is the answer not in the manual?