#feature_tracker = feature_tracker_factory(min_num_features=num_features, detector_type = FeatureDetectorTypes.AKAZE, descriptor_type = FeatureDescriptorTypes.AKAZE, tracker_type = tracker_type) #feature_tracker = feature_tracker_factory(min_num_features=num_features, detector_type = FeatureDetectorTypes.SIFT, descriptor_type = FeatureDescriptorTypes.SIFT, tracker_type = tracker_type) #feature_tracker = feature_tracker_factory(min_num_features=num_features, detector_type = FeatureDetectorTypes.SURF, descriptor_type = FeatureDescriptorTypes.SURF, tracker_type = tracker_type) # create visual odometry object vo = VisualOdometry(cam, grountruth, feature_tracker) is_draw_traj_img = True traj_img_size = 800 traj_img = np.zeros((traj_img_size, traj_img_size, 3), dtype=np.uint8) half_traj_img_size = int(0.5 * traj_img_size) draw_scale = 1 is_draw_3d = True if use_pangolin: display = Viewer3D() else: plt3d = Mplot3d(title='3D trajectory') is_draw_err = True err_plt = Mplot2d(xlabel='img id', ylabel='m', title='error') is_draw_matched_points = True matched_points_plt = Mplot2d(xlabel='img id', ylabel='# matches', title='# matches') img_id = 0 while dataset.isOk(): img = dataset.getImage(img_id)
tracker_config['num_features'] = num_features feature_tracker = feature_tracker_factory(**tracker_config) # create visual odometry object vo = VisualOdometry(cam, groundtruth, feature_tracker) is_draw_traj_img = True traj_img_size = 800 traj_img = np.zeros((traj_img_size, traj_img_size, 3), dtype=np.uint8) half_traj_img_size = int(0.5*traj_img_size) draw_scale = 1 is_draw_3d = True if kUsePangolin: viewer3D = Viewer3D() else: plt3d = Mplot3d(title='3D trajectory') is_draw_err = True err_plt = Mplot2d(xlabel='img id', ylabel='m',title='error') is_draw_matched_points = True matched_points_plt = Mplot2d(xlabel='img id', ylabel='# matches',title='# matches') img_id = 0 while dataset.isOk(): img = dataset.getImage(img_id) if img is not None:
import numpy as np import os, cv2, json, math, time import OpenGL.GL as gl from scipy.cluster.hierarchy import ward, fcluster from scipy.spatial.distance import pdist # this file present date from json file and csv file o nterh map 3D # and calculate the position of opints using DBSCAN and present in map import viewer3D from viewer3D import Viewer3D viewer = Viewer3D() def convert_to_array(s): tab = [] t = s.split(' ') for a in t: if a != "": tab.append(a) return tab def get_data_from_file(file_number): json_file, csv_file = False, False # check if json file exist # if os.path.exists('data/object_in_'+str(file_number)+'.json'): # # read the object and position in image form file # json_file = True