ERROR_CUTOFF = 50.0 OUTLIER_MAX_DIST = 10.0 PERCENT_OUTLIERS = 2.0 NOISE_SD = 0.05 ADJUST_FREQ = 3 # set up IMPATH = "../Images/TestSeriesCampanile/" files = [f for f in os.listdir(IMPATH) if (not f.startswith(".") and not f == PLYFILE and not f == PKLFILE)] frames = {} frames["files"] = np.array(files) frames["images"] = [] frames["focal_length"] = RATIO * 4100.0 / 1.4 frames["K"] = bf.f2K(frames["focal_length"]) frames["num_images"] = len(files) # graph dictionary # -- motion is the frame-to-frame estimate of [R|t] # -- 3Dmatches maps 3D points to 2D points in specific frames via a dictionary # whose keys are the tuple (kp_idx, most_recent_frame) and values are # the dict ([previous_frames], [xy_positions], [3D_estimates]) graph = {} graph["motion"] = [bf.basePose()] graph["3Dmatches"] = {} graph["frameOffset"] = 0 # make an ORB detector orb = cv2.ORB(nfeatures=50000)
""" Test script. """ import numpy as np import BasicFunctions as bf f = 5.0 K = bf.f2K(f) Rt1 = bf.basePose() R21 = bf.fromAxisAngle(np.array([0, 0, np.pi / 2.0])) C21 = np.matrix([[f], [0], [0]]) Rt21 = np.hstack([R21, -R21 * C21]) """ x1 = np.matrix([[2.0*f],[0]]) x2 = np.matrix([[0],[f]]) print "x1 = " + str(x1.T) print "x2 = " + str(x2.T) p = bf.triangulateLM(Rt1, Rt2, x1, x2, K) print "p = " + str(p.T) px1 = bf.fromHomogenous(K * Rt1 * bf.toHomogenous(p)) px2 = bf.fromHomogenous(K * Rt2 * bf.toHomogenous(p)) print "px1 = " + str(px1.T) print "px2 = " + str(px2.T) """
""" Test script. """ import numpy as np import BasicFunctions as bf f = 5.0 K = bf.f2K(f) Rt1 = bf.basePose() R21 = bf.fromAxisAngle(np.array([0, 0, np.pi/2.0])) C21 = np.matrix([[f], [0], [0]]) Rt21 = np.hstack([R21, -R21 * C21]) """ x1 = np.matrix([[2.0*f],[0]]) x2 = np.matrix([[0],[f]]) print "x1 = " + str(x1.T) print "x2 = " + str(x2.T) p = bf.triangulateLM(Rt1, Rt2, x1, x2, K) print "p = " + str(p.T) px1 = bf.fromHomogenous(K * Rt1 * bf.toHomogenous(p)) px2 = bf.fromHomogenous(K * Rt2 * bf.toHomogenous(p)) print "px1 = " + str(px1.T) print "px2 = " + str(px2.T)
MAX_RMS_ERROR = 0.25 ERROR_CUTOFF = 50.0 OUTLIER_MAX_DIST = 10.0 PERCENT_OUTLIERS = 2.0 NOISE_SD = 0.05 ADJUST_FREQ = 3 # set up IMPATH = "../Images/TestSeriesCampanile/" files = [f for f in os.listdir(IMPATH) if (not f.startswith(".") and not f == PLYFILE and not f == PKLFILE)] frames = {} frames["files"] = np.array(files) frames["images"] = [] frames["focal_length"] = RATIO * 4100.0 / 1.4 frames["K"] = bf.f2K(frames["focal_length"]) frames["num_images"] = len(files) # graph dictionary # -- motion is the frame-to-frame estimate of [R|t] # -- 3Dmatches maps 3D points to 2D points in specific frames via a dictionary # whose keys are the tuple (kp_idx, most_recent_frame) and values are # the dict ([previous_frames], [xy_positions], [3D_estimates]) graph = {} graph["motion"] = [bf.basePose()] graph["3Dmatches"] = {} graph["frameOffset"] = 0 # make an ORB detector orb = cv2.ORB(nfeatures=50000)