Exemplo n.º 1
0
def get_metadata_info(mdata):
  bvxm_batch.init_process("bradGetMetaDataInfoProcess")
  bvxm_batch.set_input_from_db(0, mdata)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  sun_az = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id,type) = bvxm_batch.commit_output(1)
  sun_el = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(2)
  year = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(3)
  month = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(4)
  day = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(5)
  hour = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(6)
  minutes = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(7)
  seconds = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(8)
  gsd = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(9)
  sat_name = bvxm_batch.get_output_string(id)
  bvxm_batch.remove_data(id)
  return sun_az, sun_el, year, month, day, hour, minutes, seconds, gsd, sat_name
Exemplo n.º 2
0
def get_metadata_info(mdata):
    bvxm_batch.init_process("bradGetMetaDataInfoProcess")
    bvxm_batch.set_input_from_db(0, mdata)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    sun_az = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(1)
    sun_el = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(2)
    year = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(3)
    month = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(4)
    day = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(5)
    hour = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(6)
    minutes = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(7)
    seconds = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(8)
    gsd = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(9)
    sat_name = bvxm_batch.get_output_string(id)
    bvxm_batch.remove_data(id)
    return sun_az, sun_el, year, month, day, hour, minutes, seconds, gsd, sat_name
Exemplo n.º 3
0
def isfm_rational_camera_with_init(track_file,
                                   dem_folder,
                                   ll_lon=0.0,
                                   ll_lat=0.0,
                                   ur_lon=0.0,
                                   ur_lat=0.0,
                                   height_diff=20.0,
                                   pixel_radius=2.0):
    bvxm_batch.init_process("vpglIsfmRationalCameraWithInitialProcess")
    bvxm_batch.set_input_string(0, track_file)
    bvxm_batch.set_input_string(1, dem_folder)
    bvxm_batch.set_input_double(2, ll_lon)
    bvxm_batch.set_input_double(3, ll_lat)
    bvxm_batch.set_input_double(4, ur_lon)
    bvxm_batch.set_input_double(5, ur_lat)
    bvxm_batch.set_input_double(6, height_diff)
    bvxm_batch.set_input_float(7, pixel_radius)
    if not bvxm_batch.run_process():
        return None, -1.0, -1.0
    (id, type) = bvxm_batch.commit_output(0)
    cam = dbvalue(id, type)
    (id, type) = bvxm_batch.commit_output(1)
    error = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(2)
    inliers = bvxm_batch.get_output_float(id)
    return cam, error, inliers
Exemplo n.º 4
0
def get_perspective_cam_center(pcam):
    bvxm_batch.init_process("vpglGetPerspectiveCamCenterProcess")
    bvxm_batch.set_input_from_db(0, pcam)
    bvxm_batch.run_process()
    (x_id, x_type) = bvxm_batch.commit_output(0)
    x = bvxm_batch.get_output_float(x_id)
    (y_id, type) = bvxm_batch.commit_output(1)
    y = bvxm_batch.get_output_float(y_id)
    (z_id, type) = bvxm_batch.commit_output(2)
    z = bvxm_batch.get_output_float(z_id)
    return x, y, z
Exemplo n.º 5
0
def get_perspective_camera_center( cam):
  bvxm_batch.init_process("vpglGetPerspectiveCamCenterProcess");
  bvxm_batch.set_input_from_db(0, cam);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  x=bvxm_batch.get_output_float(id);
  (id, type) = bvxm_batch.commit_output(1);
  y=bvxm_batch.get_output_float(id);
  (id, type) = bvxm_batch.commit_output(2);
  z=bvxm_batch.get_output_float(id);
  return x,y,z;
Exemplo n.º 6
0
def get_sun_angles(mdata):
  bvxm_batch.init_process("bradGetSunAnglesProcess")
  bvxm_batch.set_input_from_db(0,mdata)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  sun_az = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id,type) = bvxm_batch.commit_output(1)
  sun_el = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  return sun_az, sun_el
Exemplo n.º 7
0
def get_perspective_cam_center(pcam):
    bvxm_batch.init_process("vpglGetPerspectiveCamCenterProcess")
    bvxm_batch.set_input_from_db(0, pcam)
    bvxm_batch.run_process()
    (x_id, x_type) = bvxm_batch.commit_output(0)
    x = bvxm_batch.get_output_float(x_id)
    (y_id, type) = bvxm_batch.commit_output(1)
    y = bvxm_batch.get_output_float(y_id)
    (z_id, type) = bvxm_batch.commit_output(2)
    z = bvxm_batch.get_output_float(z_id)
    return x, y, z
Exemplo n.º 8
0
def get_sun_angles(mdata):
    bvxm_batch.init_process("bradGetSunAnglesProcess")
    bvxm_batch.set_input_from_db(0, mdata)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    sun_az = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(1)
    sun_el = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return sun_az, sun_el
Exemplo n.º 9
0
def get_view_at_point(persp_cam,x,y,z):
  bvxm_batch.init_process("vpglGetViewDirectionAtPointProcess");
  bvxm_batch.set_input_from_db(0,persp_cam);
  bvxm_batch.set_input_float(1,x);
  bvxm_batch.set_input_float(2,y);
  bvxm_batch.set_input_float(3,z);
  bvxm_batch.run_process();
  (id,type) = bvxm_batch.commit_output(0);
  theta=bvxm_batch.get_output_float(id);
  (id,type) = bvxm_batch.commit_output(1);
  phi=bvxm_batch.get_output_float(id);
  return theta, phi;
Exemplo n.º 10
0
def project_point(camera,x,y,z):
    bvxm_batch.init_process('vpglProjectProcess');
    bvxm_batch.set_input_from_db(0,camera);
    bvxm_batch.set_input_float(1,x);
    bvxm_batch.set_input_float(2,y);
    bvxm_batch.set_input_float(3,z);
    bvxm_batch.run_process();
    (id,type) = bvxm_batch.commit_output(0);
    u = bvxm_batch.get_output_float(id);
    (id,type) = bvxm_batch.commit_output(1);
    v = bvxm_batch.get_output_float(id);
    return (u,v);
Exemplo n.º 11
0
def project_point(camera, x, y, z):
    bvxm_batch.init_process('vpglProjectProcess')
    bvxm_batch.set_input_from_db(0, camera)
    bvxm_batch.set_input_float(1, x)
    bvxm_batch.set_input_float(2, y)
    bvxm_batch.set_input_float(3, z)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    u = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(1)
    v = bvxm_batch.get_output_float(id)
    return (u, v)
Exemplo n.º 12
0
def get_view_at_point(persp_cam, x, y, z):
    bvxm_batch.init_process("vpglGetViewDirectionAtPointProcess")
    bvxm_batch.set_input_from_db(0, persp_cam)
    bvxm_batch.set_input_float(1, x)
    bvxm_batch.set_input_float(2, y)
    bvxm_batch.set_input_float(3, z)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    theta = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(1)
    phi = bvxm_batch.get_output_float(id)
    return theta, phi
Exemplo n.º 13
0
def perturb_camera(cam_in, angle, rng):
    bvxm_batch.init_process('vpglPerturbPerspCamOrientProcess');
    bvxm_batch.set_input_from_db(0,cam_in);
    bvxm_batch.set_input_float(1,angle);
    bvxm_batch.set_input_from_db(2,rng);
    bvxm_batch.run_process();
    (id,type) = bvxm_batch.commit_output(0);
    pert_cam = dbvalue(id,type);
    (theta_id,type) = bvxm_batch.commit_output(1);
    (phi_id,type) = bvxm_batch.commit_output(2);
    theta = bvxm_batch.get_output_float(theta_id);
    phi = bvxm_batch.get_output_float(phi_id);
    return pert_cam, theta, phi;
Exemplo n.º 14
0
def perturb_camera(cam_in, angle, rng):
    bvxm_batch.init_process('vpglPerturbPerspCamOrientProcess')
    bvxm_batch.set_input_from_db(0, cam_in)
    bvxm_batch.set_input_float(1, angle)
    bvxm_batch.set_input_from_db(2, rng)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    pert_cam = dbvalue(id, type)
    (theta_id, type) = bvxm_batch.commit_output(1)
    (phi_id, type) = bvxm_batch.commit_output(2)
    theta = bvxm_batch.get_output_float(theta_id)
    phi = bvxm_batch.get_output_float(phi_id)
    return pert_cam, theta, phi
Exemplo n.º 15
0
def get_3d_from_depth(persp_cam, u, v, t):
    bvxm_batch.init_process("vpglGenerate3dPointFromDepthProcess")
    bvxm_batch.set_input_from_db(0, persp_cam)
    bvxm_batch.set_input_float(1, u)
    bvxm_batch.set_input_float(2, v)
    bvxm_batch.set_input_float(3, t)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    x = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(1)
    y = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(2)
    z = bvxm_batch.get_output_float(id)
    return x, y, z
Exemplo n.º 16
0
def isfm_rational_camera( trackfile, output_folder, pixel_radius):
  bvxm_batch.init_process("vpglIsfmRationalCameraProcess");
  bvxm_batch.set_input_string(0, trackfile);
  bvxm_batch.set_input_string(1, output_folder);
  bvxm_batch.set_input_float(2, pixel_radius);  ## pixel radius to count for inliers
  if not bvxm_batch.run_process():
    return None, -1.0, -1.0
  (id, type) = bvxm_batch.commit_output(0);
  cam = dbvalue(id, type);
  (id, type) = bvxm_batch.commit_output(1);
  error = bvxm_batch.get_output_float(id);
  (id, type) = bvxm_batch.commit_output(2);
  inliers = bvxm_batch.get_output_float(id);
  return cam,error,inliers
Exemplo n.º 17
0
def get_3d_from_depth(persp_cam,u,v,t) :
  bvxm_batch.init_process("vpglGenerate3dPointFromDepthProcess");
  bvxm_batch.set_input_from_db(0,persp_cam);
  bvxm_batch.set_input_float(1,u);
  bvxm_batch.set_input_float(2,v);
  bvxm_batch.set_input_float(3,t);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  x=bvxm_batch.get_output_float(id);
  (id, type) = bvxm_batch.commit_output(1);
  y=bvxm_batch.get_output_float(id);
  (id, type) = bvxm_batch.commit_output(2);
  z=bvxm_batch.get_output_float(id);
  return x,y,z;
Exemplo n.º 18
0
def isfm_rational_camera(trackfile, output_folder, pixel_radius):
    bvxm_batch.init_process("vpglIsfmRationalCameraProcess")
    bvxm_batch.set_input_string(0, trackfile)
    bvxm_batch.set_input_string(1, output_folder)
    # pixel radius to count for inliers
    bvxm_batch.set_input_float(2, pixel_radius)
    if not bvxm_batch.run_process():
        return None, -1.0, -1.0
    (id, type) = bvxm_batch.commit_output(0)
    cam = dbvalue(id, type)
    (id, type) = bvxm_batch.commit_output(1)
    error = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(2)
    inliers = bvxm_batch.get_output_float(id)
    return cam, error, inliers
Exemplo n.º 19
0
def test_classifier_clouds2(tclsf,
                            dictionary_name,
                            image_resource,
                            i,
                            j,
                            width,
                            height,
                            block_size,
                            percent_cat_name,
                            category_id_file=""):
    bvxm_batch.init_process("sdetTextureClassifySatelliteCloudsProcess2")
    bvxm_batch.set_input_from_db(0, tclsf)
    bvxm_batch.set_input_string(1, dictionary_name)
    bvxm_batch.set_input_from_db(2, image_resource)
    bvxm_batch.set_input_unsigned(3, i)
    bvxm_batch.set_input_unsigned(4, j)
    bvxm_batch.set_input_unsigned(5, width)
    bvxm_batch.set_input_unsigned(6, height)
    bvxm_batch.set_input_unsigned(7, block_size)
    bvxm_batch.set_input_string(8, category_id_file)
    bvxm_batch.set_input_string(9, percent_cat_name)
    status = bvxm_batch.run_process()
    if status:
        (out_id, out_type) = bvxm_batch.commit_output(0)
        out_crop = dbvalue(out_id, out_type)
        (out_id, out_type) = bvxm_batch.commit_output(1)
        out_id_map = dbvalue(out_id, out_type)
        (out_id, out_type) = bvxm_batch.commit_output(2)
        out_rgb_map = dbvalue(out_id, out_type)
        (out_id, out_type) = bvxm_batch.commit_output(3)
        percent = bvxm_batch.get_output_float(out_id)
        bvxm_batch.remove_data(out_id)
        return out_crop, out_id_map, out_rgb_map, percent
    else:
        return 0, 0, 0, 100
Exemplo n.º 20
0
def test_classifier_clouds2(tclsf, dictionary_name, image_resource, i, j, width, height, block_size, percent_cat_name, category_id_file=""):
    bvxm_batch.init_process("sdetTextureClassifySatelliteCloudsProcess2")
    bvxm_batch.set_input_from_db(0, tclsf)
    bvxm_batch.set_input_string(1, dictionary_name)
    bvxm_batch.set_input_from_db(2, image_resource)
    bvxm_batch.set_input_unsigned(3, i)
    bvxm_batch.set_input_unsigned(4, j)
    bvxm_batch.set_input_unsigned(5, width)
    bvxm_batch.set_input_unsigned(6, height)
    bvxm_batch.set_input_unsigned(7, block_size)
    bvxm_batch.set_input_string(8, category_id_file)
    bvxm_batch.set_input_string(9, percent_cat_name)
    status = bvxm_batch.run_process()
    if status:
        (out_id, out_type) = bvxm_batch.commit_output(0)
        out_crop = dbvalue(out_id, out_type)
        (out_id, out_type) = bvxm_batch.commit_output(1)
        out_id_map = dbvalue(out_id, out_type)
        (out_id, out_type) = bvxm_batch.commit_output(2)
        out_rgb_map = dbvalue(out_id, out_type)
        (out_id, out_type) = bvxm_batch.commit_output(3)
        percent = bvxm_batch.get_output_float(out_id)
        bvxm_batch.remove_data(out_id)
        return out_crop, out_id_map, out_rgb_map, percent
    else:
        return 0, 0, 0, 100
Exemplo n.º 21
0
def get_sun_angles_date_time(lat, lon, year, month, day, hour, minute):
    bvxm_batch.init_process("bradGetSunAnglesDateTimeProcess")
    bvxm_batch.set_input_float(0, lat)
    bvxm_batch.set_input_float(1, lon)
    bvxm_batch.set_input_int(2, year)
    bvxm_batch.set_input_int(3, month)
    bvxm_batch.set_input_int(4, day)
    bvxm_batch.set_input_int(5, hour)
    bvxm_batch.set_input_int(6, minute)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    sun_az = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(1)
    sun_el = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return sun_az, sun_el
Exemplo n.º 22
0
def get_sun_angles_date_time(lat, lon, year, month, day, hour, minute):
  bvxm_batch.init_process("bradGetSunAnglesDateTimeProcess")
  bvxm_batch.set_input_float(0,lat)
  bvxm_batch.set_input_float(1,lon)
  bvxm_batch.set_input_int(2,year)
  bvxm_batch.set_input_int(3,month)
  bvxm_batch.set_input_int(4,day)
  bvxm_batch.set_input_int(5,hour)
  bvxm_batch.set_input_int(6,minute)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  sun_az = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id,type) = bvxm_batch.commit_output(1)
  sun_el = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  return sun_az, sun_el
Exemplo n.º 23
0
def convert_local_to_global_coordinates(lvcs,x,y,z):
    bvxm_batch.init_process('vpglConvertLocalToGlobalCoordinatesProcess');
    bvxm_batch.set_input_from_db(0,lvcs);
    bvxm_batch.set_input_float(1,x);
    bvxm_batch.set_input_float(2,y);
    bvxm_batch.set_input_float(3,z);
    bvxm_batch.run_process();
    (id,type) = bvxm_batch.commit_output(0);
    lat = bvxm_batch.get_output_float(id);
    bvxm_batch.remove_data(id);
    (id,type) = bvxm_batch.commit_output(1);
    lon = bvxm_batch.get_output_float(id);
    bvxm_batch.remove_data(id);
    (id,type) = bvxm_batch.commit_output(2);
    el = bvxm_batch.get_output_float(id);
    bvxm_batch.remove_data(id);
    return (lat,lon,el);
Exemplo n.º 24
0
def convert_to_local_coordinates2(lvcs,lat,lon,el):
    bvxm_batch.init_process('vpglConvertToLocalCoordinatesProcess2');
    bvxm_batch.set_input_from_db(0,lvcs);
    bvxm_batch.set_input_float(1,lat);
    bvxm_batch.set_input_float(2,lon);
    bvxm_batch.set_input_float(3,el);
    bvxm_batch.run_process();
    (id,type) = bvxm_batch.commit_output(0);
    x = bvxm_batch.get_output_float(id);
    bvxm_batch.remove_data(id);
    (id,type) = bvxm_batch.commit_output(1);
    y = bvxm_batch.get_output_float(id);
    bvxm_batch.remove_data(id);
    (id,type) = bvxm_batch.commit_output(2);
    z = bvxm_batch.get_output_float(id);
    bvxm_batch.remove_data(id);
    return (x,y,z);
Exemplo n.º 25
0
def get_cloud_coverage(mdata):
    bvxm_batch.init_process("bradGetCloudCoverageProcess")
    bvxm_batch.set_input_from_db(0, mdata)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    cloud_coverage = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return cloud_coverage
Exemplo n.º 26
0
def convert_to_local_coordinates(lvcs_filename, lat, lon, el):
    bvxm_batch.init_process('vpglConvertToLocalCoordinatesProcess')
    bvxm_batch.set_input_string(0, lvcs_filename)
    bvxm_batch.set_input_float(1, lat)
    bvxm_batch.set_input_float(2, lon)
    bvxm_batch.set_input_float(3, el)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    x = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(1)
    y = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(2)
    z = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return (x, y, z)
Exemplo n.º 27
0
def get_cloud_coverage(mdata):
    bvxm_batch.init_process("bradGetCloudCoverageProcess")
    bvxm_batch.set_input_from_db(0, mdata)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    cloud_coverage = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return cloud_coverage
Exemplo n.º 28
0
def convert_local_to_global_coordinates(lvcs, x, y, z):
    bvxm_batch.init_process('vpglConvertLocalToGlobalCoordinatesProcess')
    bvxm_batch.set_input_from_db(0, lvcs)
    bvxm_batch.set_input_float(1, x)
    bvxm_batch.set_input_float(2, y)
    bvxm_batch.set_input_float(3, z)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    lat = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(1)
    lon = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(2)
    el = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return (lat, lon, el)
Exemplo n.º 29
0
def convert_to_local_coordinates2(lvcs, lat, lon, el):
    bvxm_batch.init_process('vpglConvertToLocalCoordinatesProcess2')
    bvxm_batch.set_input_from_db(0, lvcs)
    bvxm_batch.set_input_float(1, lat)
    bvxm_batch.set_input_float(2, lon)
    bvxm_batch.set_input_float(3, el)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    x = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(1)
    y = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(2)
    z = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return (x, y, z)
Exemplo n.º 30
0
def isfm_rational_camera_with_init(track_file, dem_folder, ll_lon=0.0, ll_lat=0.0, ur_lon=0.0, ur_lat=0.0, height_diff=20.0, pixel_radius=2.0):
    bvxm_batch.init_process("vpglIsfmRationalCameraWithInitialProcess")
    bvxm_batch.set_input_string(0, track_file)
    bvxm_batch.set_input_string(1, dem_folder)
    bvxm_batch.set_input_double(2, ll_lon)
    bvxm_batch.set_input_double(3, ll_lat)
    bvxm_batch.set_input_double(4, ur_lon)
    bvxm_batch.set_input_double(5, ur_lat)
    bvxm_batch.set_input_double(6, height_diff)
    bvxm_batch.set_input_float(7, pixel_radius)
    if not bvxm_batch.run_process():
        return None, -1.0, -1.0
    (id, type) = bvxm_batch.commit_output(0)
    cam = dbvalue(id, type)
    (id, type) = bvxm_batch.commit_output(1)
    error = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(2)
    inliers = bvxm_batch.get_output_float(id)
    return cam, error, inliers
Exemplo n.º 31
0
def get_view_angles(mdata):
    bvxm_batch.init_process("bradGetMetaDataInfoProcess")
    bvxm_batch.set_input_from_db(0, mdata)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    sun_az = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(1)
    sun_el = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(2)
    year = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(3)
    month = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(4)
    day = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(5)
    hour = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(6)
    minutes = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(7)
    seconds = bvxm_batch.get_output_int(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(8)
    gsd = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(9)
    sat_name = bvxm_batch.get_output_string(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(10)
    view_az = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    (id, type) = bvxm_batch.commit_output(11)
    view_el = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return view_az, view_el
Exemplo n.º 32
0
def get_view_angles(mdata):
  bvxm_batch.init_process("bradGetMetaDataInfoProcess")
  bvxm_batch.set_input_from_db(0, mdata)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  sun_az = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id,type) = bvxm_batch.commit_output(1)
  sun_el = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(2)
  year = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(3)
  month = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(4)
  day = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(5)
  hour = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(6)
  minutes = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(7)
  seconds = bvxm_batch.get_output_int(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(8)
  gsd = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(9)
  sat_name = bvxm_batch.get_output_string(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(10)
  view_az = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  (id, type) = bvxm_batch.commit_output(11)
  view_el = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  return view_az, view_el
Exemplo n.º 33
0
def get_3d_from_cams( cams, points ):
    assert( len(cams) == len(points) and len(cams) > 1 );
    #list of points will just be [u1,v1,u2,v2...];
    ptlist = [];
    for p in points:
        ptlist.append(p[0]);
        ptlist.append(p[1]);
    #list of cam ids (type will be checked in C++);
    camlist = [];
    for cam in cams:
        camlist.append(cam.id);
    bvxm_batch.init_process("vpglGenerate3dPointFromCamsProcess");
    bvxm_batch.set_input_unsigned_array(0, camlist);
    bvxm_batch.set_input_int_array(1, ptlist);
    bvxm_batch.run_process();
    (id, type) = bvxm_batch.commit_output(0);
    x=bvxm_batch.get_output_float(id);
    (id, type) = bvxm_batch.commit_output(1);
    y=bvxm_batch.get_output_float(id);
    (id, type) = bvxm_batch.commit_output(2);
    z=bvxm_batch.get_output_float(id);
    return x,y,z;
Exemplo n.º 34
0
def get_3d_from_cams(cams, points):
    assert (len(cams) == len(points) and len(cams) > 1)
    #list of points will just be [u1,v1,u2,v2...];
    ptlist = []
    for p in points:
        ptlist.append(p[0])
        ptlist.append(p[1])
    #list of cam ids (type will be checked in C++);
    camlist = []
    for cam in cams:
        camlist.append(cam.id)
    bvxm_batch.init_process("vpglGenerate3dPointFromCamsProcess")
    bvxm_batch.set_input_unsigned_array(0, camlist)
    bvxm_batch.set_input_int_array(1, ptlist)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    x = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(1)
    y = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(2)
    z = bvxm_batch.get_output_float(id)
    return x, y, z