ORB - added cam video looping, added python 2.7 compatibility. Made test view work off of video. Added pose cells and initial view cells.
This commit is contained in:
@@ -9,3 +9,8 @@ class CamCtrl:
|
||||
def stop_cam(cam_id # type: Union[int, str]
|
||||
):
|
||||
pubsub.publish("cvcamhandlers." + str(cam_id) + ".cmd", 'q')
|
||||
|
||||
@staticmethod
|
||||
def reset_vid(cam_id # type: Union[int, str]
|
||||
):
|
||||
pubsub.publish("cvcamhandlers." + str(cam_id) + ".cmd", 'r')
|
||||
|
||||
@@ -29,6 +29,7 @@ def pub_cam_loop(cam_id, # type: Union[int, str]
|
||||
msg = ''
|
||||
cam = cv2.VideoCapture(cam_id)
|
||||
# cam.set(cv2.CAP_PROP_CONVERT_RGB, 0)
|
||||
frame_counter = 0
|
||||
|
||||
if high_speed:
|
||||
cam.set(cv2.CAP_PROP_FOURCC, cv2.CAP_OPENCV_MJPEG)
|
||||
@@ -48,10 +49,14 @@ def pub_cam_loop(cam_id, # type: Union[int, str]
|
||||
cam.release()
|
||||
pubsub.publish("cvcams." + str(cam_id) + ".status", "failed")
|
||||
return False
|
||||
if cam.get(cv2.CAP_PROP_FRAME_COUNT) > 0:
|
||||
frame_counter+=1
|
||||
if frame_counter >= cam.get(cv2.CAP_PROP_FRAME_COUNT):
|
||||
frame_counter = 0
|
||||
cam = cv2.VideoCapture(cam_id)
|
||||
pubsub.publish("cvcams." + str(cam_id) + ".vid", (frame,))
|
||||
msg = listen_default(sub, block=False, empty='')
|
||||
|
||||
pass
|
||||
cam.release()
|
||||
return True
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ frame_dict = {}
|
||||
|
||||
|
||||
# todo: figure out how to get the red x button to work. Try: https://stackoverflow.com/a/37881722/782170
|
||||
def sub_win_loop(*,
|
||||
def sub_win_loop(
|
||||
names, # type: List[str]
|
||||
input_vid_global_names, # type: List[str]
|
||||
callbacks=(None,),
|
||||
@@ -31,3 +31,4 @@ def sub_win_loop(*,
|
||||
for c in input_cams:
|
||||
CamCtrl.stop_cam(c)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user