Skip to content
Permalink
Browse files

add option for an initial calibration file

  • Loading branch information
lambdaloop committed Aug 2, 2019
1 parent 4d94320 commit 9c5b23f74808b008d240f7b824653adfc5e936de
Showing with 11 additions and 3 deletions.
  1. +2 βˆ’1 anipose/anipose.py
  2. +7 βˆ’2 anipose/calibrate.py
  3. +2 βˆ’0 config.toml
@@ -10,7 +10,8 @@
DEFAULT_CONFIG = {
'video_extension': 'avi',
'calibration': {
'animal_calibration': False
'animal_calibration': False,
'calibration_init': None
},
'triangulation': {
'ransac': False,
@@ -130,6 +130,7 @@ def process_session(config, session_path):

print(outname)
skip_calib = False
init_extrinsics = True

if os.path.exists(outname):
cgroup = CameraGroup.load(outname)
@@ -142,6 +143,10 @@ def process_session(config, session_path):
error = cgroup.metadata['error']
else:
error = None
elif config['calibration']['calibration_init'] is not None:
calib_path = os.path.join(config['path'], config['calibration']['calibration_init'])
cgroup = CameraGroup.load(calib_path)
init_extrinsics = False
else:
cgroup = CameraGroup.from_names(cam_names)

@@ -160,9 +165,9 @@ def process_session(config, session_path):
size = (params['width'], params['height'])
cam.set_size(size)

error = cgroup.calibrate_rows(all_rows, board)
error = cgroup.calibrate_rows(all_rows, board, init_extrinsics=init_extrinsics)
else:
error, all_rows = cgroup.calibrate_videos(video_list, board)
error, all_rows = cgroup.calibrate_videos(video_list, board, init_extrinsics=init_extrinsics)
with open(rows_fname, 'wb') as f:
pickle.dump(all_rows, f)

@@ -30,6 +30,8 @@ board_square_side_length = 0.5 # mm

animal_calibration = False

calibration_init = 'calibration_init.toml'

[filter]
enabled = true
medfilt = 13

0 comments on commit 9c5b23f

Please sign in to comment.
You can’t perform that action at this time.