Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

added functionlaity to get `sesssion.NumFrames` when a folder of pre-synced vids is processed from stage=3

jon matthisd4315b76af0d
diff --git a/freemocap/dev_scratchpad/dev_alpha/__init__.py b/freemocap/dev_scratchpad/dev_alpha/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/freemocap/fmc_runme.py b/freemocap/fmc_runme.py
index e43fd394..b8014dff 100644
--- a/freemocap/fmc_runme.py
+++ b/freemocap/fmc_runme.py
@@ -12,6 +12,7 @@ from aniposelib.boards import CharucoBoard
import numpy as np
from ruamel.yaml import YAML
+import cv2
#Rich stuff
from rich import print
@@ -161,6 +162,10 @@ def RunMe(sessionID=None,
console.rule('See https://anipose.org for details', style="color({})".format(thisStage))
console.rule(style="color({})".format(thisStage))
+ 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)
sesh.cgroup, sesh.mean_charuco_fr_mar_xyz = calibrate.CalibrateCaptureVolume(sesh,board, calVideoFrameLength)