# Define number of points and camera parameters n = 10 sigma = 0.0005 n_range = range(5, 25) sigma_range = np.arange(0.0001, 0.001, 0.0001) f = 1.0 cx = 0.0 cy = 0.0 cam_intrinsic = np.array([[f, 0.0, cx], [0.0, f, cy], [0.0, 0.0, 1.0]]) # Define constants for serial outputting results checkmark = u'\u2713' l_progress_bar = 50 # Instantiate pnp module pnp = pymrpt.pnp(n) # Define settings for comparison module algos = [pnp.dls, pnp.epnp, pnp.p3p, pnp.rpnp, pnp.ppnp, pnp.posit, pnp.lhm] algo_names = ['dls', 'epnp', 'p3p', 'rpnp', 'ppnp', 'posit', 'lhm'] algo_ls = [':', '-', '--', '-', '--', '-', '-'] n_algos = len(algos) n_iter = 100 class HighlightLines(plugins.PluginBase): # css format for interactive d3 plots """A plugin for an interactive legend. Inspired by http://bl.ocks.org/simzou/6439398 """
plt.plot(t,arr[i,:],label=names[i]) plt.xlabel(xtitle) plt.ylabel(ytitle) plt.title(title) ax=plt.gca() ax.set_ylim([0,10]) # Define number of points and camera parameters n=6 f=1.0 cx=0.0 cy=0.0 # Instantiate pnp module pnp = pymrpt.pnp(n) # Define object points and image points obj_pts=np.array([[0,0,0],[0,0,-50.0],[2,0,35],[5,-40,25],[10,15,9],[-20,50,7]]) img_pts=np.empty([n,2]) img_pts_=np.empty([n,3]) img_pts_[:,2]=1 pose_epnp=np.empty([6,1]) pose_upnp=np.empty([6,1]) pose_dls=np.empty([6,1]) pose_p3p=np.empty([6,1]) pose_ppnp=np.empty([6,1]) pose_posit=np.empty([6,1]) pose_mat_orig=np.empty([4,4])