Free Motion Capture for Everyone πβ¨
TypeScript
put numframe check in context manager
jon matthis9f6e3cfb8f32
diff --git a/freemocap/dev_scratchpad/dev_alpha/__init__.py b/freemocap/dev_scratchpad/dev_alpha/__init__.pydeleted file mode 100644index e69de29b..00000000diff --git a/freemocap/fmc_runme.py b/freemocap/fmc_runme.pyindex 800ea4a4..5cb6e2c3 100644--- a/freemocap/fmc_runme.py+++ b/freemocap/fmc_runme.py@@ -164,8 +164,8 @@ def RunMe(sessionID=None,if sesh.numFrames is None:a_sync_vid_path = list(sesh.syncedVidPath.glob('*.mp4'))- temp_cap = cv2.VideoCapture(str(a_sync_vid_path[0]))- sesh.numFrames = temp_cap.get(cv2.CAP_PROP_FRAME_COUNT)+ with cv2.VideoCapture(str(a_sync_vid_path[0])) as temp_cap:+ sesh.numFrames = temp_cap.get(cv2.CAP_PROP_FRAME_COUNT)sesh.cgroup, sesh.mean_charuco_fr_mar_xyz = calibrate.CalibrateCaptureVolume(sesh,board, calVideoFrameLength)