Free Motion Capture for Everyone πβ¨
TypeScript
change default to look through entire video for charuco boards
jon matthis12818ab92164
diff --git a/freemocap/calibrate.py b/freemocap/calibrate.pyindex d4c27f80..a0f27bce 100644--- a/freemocap/calibrate.py+++ b/freemocap/calibrate.py@@ -19,7 +19,7 @@ from rich.console import Consoleconsole = Console()-def CalibrateCaptureVolume(session,board, calVideoFrameLength = .5):+def CalibrateCaptureVolume(session,board, calVideoFrameLength = 1):"""Check if a previous calibration yaml exists, and if not, create a set of shortened calibration videos and run Anipose functionsto create a calibration yaml. Takes the 2D charuco board points and reconstructs them into 3D points that are saved out@@ -37,7 +37,7 @@ def CalibrateCaptureVolume(session,board, calVideoFrameLength = .5):cal_vid_frame_range = [0, session.numFrames]calibrationVideoPath = session.calVidPathelse:- if calVideoFrameLength>0 and calVideoFrameLength<1: #if between 0 and 1, use as a percentage of the total video length+ if calVideoFrameLength>0 and calVideoFrameLength<=1: #if between 0 and 1, use as a percentage of the total video lengthcal_vid_frame_range = [0, round(calVideoFrameLength * session.numFrames)]else: #otherwise, just use the input value as the number of frames to usecal_vid_frame_range = [0, calVideoFrameLength]diff --git a/freemocap/fmc_runme.py b/freemocap/fmc_runme.pyindex b02a6922..75f52fa6 100644--- a/freemocap/fmc_runme.py+++ b/freemocap/fmc_runme.py@@ -58,7 +58,7 @@ def RunMe(sessionID=None,showAnimation = True,reconstructionConfidenceThreshold = .5,charucoSquareSize = 36,#mm - ~the size of the squares when printed on 8.5x11" paper based on parameters in ReadMe.md- calVideoFrameLength = .5,+ calVideoFrameLength = 1,startFrame = 0,useBlender = False,resetBlenderExe = False,@@ -214,11 +214,12 @@ def RunMe(sessionID=None,# %% Stage Fourif stage <= 4:thisStage=4- console.rule(style="color({})".format(thisStage))- console.rule('Starting 2D Point Trackers'.upper(),style="color({})".format(thisStage))+ thisStageColor=12+ console.rule(style="color({})".format(thisStageColor))+ console.rule('Starting 2D Point Trackers'.upper(),style="color({})".format(thisStageColor))stage4_msg ='This step implements various computer vision that track the skeleton (and other objects) in the 2d videos, to produce the data that will be combined with the `camera projection matrices` from the calibration stage to produce the estimates of 3d movement. \n \n Each algorithm is different, but most involve using [bold magenta] convolutional neural networks [/bold magenta] trained from labeled videos to produce a 2d probability map of the likelihood that the tracked bodypart/object/feature (e.g. \'LeftElbow\') is in a given location. \n \n The peak of that distrubtion on each frame is recorded as the pixel-location of that item on that frame (e.g. \'LeftElbow(pixel-x, pixel-y, confidence\') where the a confidence value proportional to the underlying probability distribution (i.e. tall peaks in the probablitiy distribution indicate high confidence that the LeftElbow actually is at this pixel-x, pixel-y location) \n \nThis part is crazy future tech sci fi stuff. Seriously unbelievable this kind of thing is possible β¨'- console.print(Padding(stage4_msg, (1,4)), overflow="fold", justify='center',style="color({})".format(thisStage))- console.rule(style="color({})".format(thisStage))+ console.print(Padding(stage4_msg, (1,4)), overflow="fold", justify='center',style="color({})".format(thisStageColor))+ console.rule(style="color({})".format(thisStageColor))if sesh.useMediaPipe:@@ -318,13 +319,22 @@ def RunMe(sessionID=None,blender_process = subprocess.Popen(command_str,shell=False,- stdout=subprocess.PIPE)+ stdout=subprocess.PIPE,+ stderr=subprocess.PIPE,)while True:output = blender_process.stdout.readline()+ err = blender_process.stderr.readline()if blender_process.poll() is not None:breakif output:- print(output.strip().decode())+ try:+ print(output.strip().decode())+ except:+ pass+ try:+ print(err.strip().decode())+ except:+ passexcept:console.print_exception()