Skip to content

Commit

Permalink
refactor calibration code to save detections earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdaloop committed Aug 4, 2019
1 parent a46684c commit 5cadde4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions anipose/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,15 @@ def process_session(config, session_path):
if os.path.exists(rows_fname):
with open(rows_fname, 'rb') as f:
all_rows = pickle.load(f)

for cam, cam_videos in zip(cgroup.cameras, video_list):
for vnum, vidname in enumerate(cam_videos):
params = get_video_params(vidname)
size = (params['width'], params['height'])
cam.set_size(size)

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

cgroup.set_camera_sizes_videos(video_list)
error = cgroup.calibrate_rows(all_rows, board,
init_extrinsics=init_extrinsics)

if config['calibration']['animal_calibration']:
all_points, all_scores = load_2d_data(config, calibration_path)
imgp = process_points_for_calibration(all_points, all_scores)
Expand Down

0 comments on commit 5cadde4

Please sign in to comment.