Пример #1
0
# reset-matches-ned3.py does more error checking and validation.

parser = argparse.ArgumentParser(description='Keypoint projection.')
parser.add_argument('--project', required=True, help='project directory')

args = parser.parse_args()

proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()
proj.load_features()
proj.undistort_keypoints()
proj.load_match_pairs()

# setup SRTM ground interpolator
ref = proj.ned_reference_lla
sss = SRTM.NEDGround(ref, 2000, 2000, 30)

# compute keypoint usage map
proj.compute_kp_usage()

# fast way:
# 1. make a grid (i.e. 8x8) of uv coordinates covering the whole image
# 2. undistort these uv coordinates
# 3. project them into vectors
# 4. intersect them with the srtm terrain to get ned coordinates
# 5. use linearndinterpolator ... g = scipy.interpolate.LinearNDInterpolator([[0,0],[1,0],[0,1],[1,1]], [[0,4,8],[1,3,2],[2,2,-4],[4,1,0]])
#    with origin uv vs. 3d location to build a table
# 6. interpolate original uv coordinates to 3d locations
proj.fastProjectKeypointsTo3d(sss)

print "Constructing unified match structure..."
Пример #2
0
#!/usr/bin/python

# good starting point for working with dem's in python:
#   https://stevendkay.wordpress.com/2009/09/05/beginning-digital-elevation-model-work-with-python/

# source for 3 arcsec dem:
#   http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/

import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")

import numpy as np

sys.path.append('../lib')
import SRTM

#lla_ref = [ 45.220697421008396, -93.14530573529404, 0.0 ]
lla_ref = [ 33.220697421008396, -110.14530573529404, 0.0 ]
sss = SRTM.NEDGround( lla_ref, 100000, 100000, 75 )

Пример #3
0
    type=int,
    default=512,
    help=
    'texture resolution (should be 2**n, so numbers like 256, 512, 1024, etc.')
parser.add_argument('--ground', type=float, help='ground elevation in meters')
parser.add_argument('--sba', action='store_true', help='use sba pose')

args = parser.parse_args()

proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()

ref = proj.ned_reference_lla

# setup SRTM ground interpolator
sss = SRTM.NEDGround(ref, 6000, 6000, 30)

ac3d_steps = 8

# compute the uv grid for each image and project each point out into
# ned space, then intersect each vector with the srtm ground.

# build our local image list for placing
print(args.sba)
if not args.sba:
    image_list = proj.image_list
else:
    image_list = []
    for image in proj.image_list:
        if image.camera_pose_sba != None:
            #print image.camera_pose_sba
# undistort and project keypoints and cull any the blow up in the fringes

parser = argparse.ArgumentParser(description='Keypoint projection.')
parser.add_argument('--project', required=True, help='project directory')

args = parser.parse_args()

proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()
proj.load_features()
proj.undistort_keypoints()

# setup SRTM ground interpolator
ref = proj.ned_reference_lla
sss = SRTM.NEDGround(ref, 5000, 5000, 30)

# compute keypoint usage map
proj.compute_kp_usage(all=True)

# fast way:
# 1. make a grid (i.e. 8x8) of uv coordinates covering the whole image
# 2. undistort these uv coordinates
# 3. project them into vectors
# 4. intersect them with the srtm terrain to get ned coordinates
# 5. use linearndinterpolator ... g = scipy.interpolate.LinearNDInterpolator([[0,0],[1,0],[0,1],[1,1]], [[0,4,8],[1,3,2],[2,2,-4],[4,1,0]])
#    with origin uv vs. 3d location to build a table
# 6. interpolate original uv coordinates to 3d locations
proj.fastProjectKeypointsTo3d(sss)

# at this point image.coord_list will contain nans for any troublesome