Skip to content

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

TypeScript

Add pickle files and timestamp data to RawVideos folder

Aaron Cheriane66bc1363d07
diff --git a/freemocap/runcams.py b/freemocap/runcams.py
index b3c21131..dcb2feb7 100644
--- a/freemocap/runcams.py
+++ b/freemocap/runcams.py
@@ -54,7 +54,7 @@ def RecordCams(session,camInputs,parameterDictionary,rotationInputs):
) in (
numCamRange
): # open the saved pickle file for each camera, and add the timestamps to the dataList list
- with open(session.sessionPath/camIDs[e], "rb") as f:
+ with open(session.rawVidPath/camIDs[e], "rb") as f:
camTimeList = pickle.load(f)
timeStampList.append(camTimeList)
@@ -71,8 +71,8 @@ def RecordCams(session,camInputs,parameterDictionary,rotationInputs):
timeDictionary, orient="index"
) # create a data frame from this dictionary
timeStampData = df.transpose()
- csvName = session.sessionID + ".csv" # create our csv filename
- csvPath = session.sessionPath / csvName
+ csvName = session.sessionID + "_timestamps.csv"
+ csvPath = session.rawVidPath / csvName
timeStampData.to_csv(csvPath) # turn dataframe into a CSV
session.numCams = numCams
diff --git a/freemocap/webcam/startcamrecording.py b/freemocap/webcam/startcamrecording.py
index 3e6edb48..4abc87a5 100644
--- a/freemocap/webcam/startcamrecording.py
+++ b/freemocap/webcam/startcamrecording.py
@@ -78,7 +78,7 @@ def CamRecording(
success
): # while the camera is opened, record the data until the escape button is hit
if flag: # when the flag is triggered, stop recording and dump the data
- with open(session.sessionPath/camID, "wb") as f:
+ with open(session.rawVidPath/camID, "wb") as f:
pickle.dump(timeStamps, f)
break
success, frame = cam.read()
@@ -92,7 +92,7 @@ def CamRecording(
key = cv2.waitKey(20)
if key == 27: # exit on ESC
flag = True # set flag to true to shut down all other webcams
- with open(session.sessionPath/camID, "wb") as f:
+ with open(session.rawVidPath/camID, "wb") as f:
pickle.dump(timeStamps, f) # dump the data
break
cv2.destroyWindow(camID)
diff --git a/freemocap/webcamGUI.py b/freemocap/webcamGUI.py
index 246ad8c6..3a77041c 100644
--- a/freemocap/webcamGUI.py
+++ b/freemocap/webcamGUI.py
@@ -112,8 +112,8 @@ def initialize(session, stage, board):
rotationDict = session.session_settings['recording_parameters']['RotationInputs']
session.rotationInputs = list(rotationDict.values())
#initialize the path to the timestamp csv
- csvName = session.sessionID + '.csv'
- csvPath = session.sessionPath/csvName
+ csvName = session.sessionID + '_timestamps.csv'
+ csvPath = session.rawVidPath/csvName
#read CSV data, turn it into a data frame
timeStampData = pd.read_csv (csvPath)