コード例 #1
0
if not os.path.isdir(args.output_path):
    os.makedirs(args.output_path)

# folder source
folder_source = os.path.join(args.dataset_path, source_seq)
# folder target
folder_target = os.path.join(args.dataset_path, target_seq)

# initialize bf_matcher object
bf_matcher = cv2.BFMatcher(normType=cv2.NORM_L2, crossCheck=True)

# initialize stereoBM object
stereo = cv2.StereoBM_create(numDisparities=32, blockSize=15)

# load camMatrix and baseline
camMatrix, baseline = load_calibration(os.path.join(folder_source, 'Calibration'))

for tsk in tasks:

    # reloc file
    reloc_file = os.path.join(args.dataset_path, source_seq, 'RelocalizationFilesTest',
                              'relocalizationFile_' + target_seq + '_' + tsk + '.txt')

    # Result file
    reloc_result = open(
        os.path.join(args.output_path, 'relocalizationResult_d2_net_eccv-challenge-' + target_seq + '_' + tsk + '.txt'),
        'w')

    # Process the file
    with open(reloc_file, 'r') as f:
        lines = f.readlines()
コード例 #2
0
    mode_sequence = True
elif float(sys.argv[2]) == 2:
    logfilename = get_logfile(subject_id, 'rnd')
else:
    logfilename = get_logfile(subject_id, 'ctrl')
    mode_ctrl = True

#
# RT FROM TRAINING
#
min_median_ref = get_min_rt_from_rtfile(subject_id)

#
# get joystick range
#
joy_range = load_calibration()

#
# Start THREAD
#
poll_thread = THREAD(joy_range, logfilename, joy_input)
poll_thread.daemon = True
poll_thread.start()

##############################
# Start DISPLAY
mode = DISPLAY('USB connection', poll_thread, task_info, FPS, fullscreen_on,
               debug_mode)

mode.task_info['subject_id'] = subject_id
コード例 #3
0
    mode_sequence = True
elif float(sys.argv[2]) == 2:
    logfilename = get_logfile(subject_id,'rnd')
else:
    logfilename = get_logfile(subject_id,'ctrl')
    mode_ctrl = True

#
# RT FROM TRAINING
#
min_median_ref = get_min_rt_from_rtfile(subject_id)

#
# get joystick range
#
joy_range = load_calibration()

#
# Start THREAD
#
poll_thread = THREAD(joy_range, logfilename, joy_input)
poll_thread.daemon = True
poll_thread.start()

##############################
# Start DISPLAY
mode = DISPLAY('USB connection', poll_thread, task_info, FPS, fullscreen_on, debug_mode)

mode.task_info['subject_id'] = subject_id

#
コード例 #4
0
 def LoadCalib(self, calib_file):
     self.calib = load_calibration(calib_file)