예제 #1
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def load_affine_camera(file_path, viewing_dist=1000):
    boxm2_batch.init_process("vpglLoadAffineCameraProcess")
    boxm2_batch.set_input_string(0, file_path)
    boxm2_batch.set_input_double(1, viewing_dist)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    cam = dbvalue(id, type)
    return cam
예제 #2
0
def load_affine_camera(file_path, viewing_dist=1000):
    boxm2_batch.init_process("vpglLoadAffineCameraProcess")
    boxm2_batch.set_input_string(0, file_path)
    boxm2_batch.set_input_double(1, viewing_dist)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    cam = dbvalue(id, type)
    return cam
예제 #3
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def correct_rational_camera(cam_in, offset_x, offset_y):
    boxm2_batch.init_process('vpglCorrectRationalCameraProcess')
    boxm2_batch.set_input_from_db(0, cam_in)
    boxm2_batch.set_input_double(1, offset_x)
    boxm2_batch.set_input_double(2, offset_y)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    corrected_cam = dbvalue(id, type)
    return corrected_cam
예제 #4
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def translate_geo_camera(geocam, x, y):
    boxm2_batch.init_process("vpglTranslateGeoCameraProcess")
    boxm2_batch.set_input_from_db(0, geocam)
    boxm2_batch.set_input_double(1, x)
    boxm2_batch.set_input_double(2, y)
    boxm2_batch.run_process()
    (c_id, c_type) = boxm2_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam
예제 #5
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def correct_rational_camera(cam_in, offset_x, offset_y):
    boxm2_batch.init_process('vpglCorrectRationalCameraProcess');
    boxm2_batch.set_input_from_db(0,cam_in);
    boxm2_batch.set_input_double(1,offset_x);
    boxm2_batch.set_input_double(2,offset_y);
    boxm2_batch.run_process();
    (id,type) = boxm2_batch.commit_output(0);
    corrected_cam = dbvalue(id,type);
    return corrected_cam;
예제 #6
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def translate_geo_camera(geocam, x, y):
    boxm2_batch.init_process("vpglTranslateGeoCameraProcess");
    boxm2_batch.set_input_from_db(0, geocam);
    boxm2_batch.set_input_double(1, x);
    boxm2_batch.set_input_double(2, y);
    boxm2_batch.run_process();
    (c_id, c_type) = boxm2_batch.commit_output(0);
    cam = dbvalue(c_id, c_type);
    return cam;
예제 #7
0
def geo_cam_global_to_img(geocam, lon, lat):
    boxm2_batch.init_process("vpglGeoGlobalToImgProcess");
    boxm2_batch.set_input_from_db(0, geocam);
    boxm2_batch.set_input_double(1, lon);
    boxm2_batch.set_input_double(2, lat);
    boxm2_batch.run_process();
    (id, type) = boxm2_batch.commit_output(0);
    u = boxm2_batch.get_output_int(id);
    (id, type) = boxm2_batch.commit_output(1);
    v = boxm2_batch.get_output_int(id);
    return u, v;
예제 #8
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def geo2generic(geocam, ni, nj, scene_height, level):
    boxm2_batch.init_process("vpglConvertGeoCameraToGenericProcess");
    boxm2_batch.set_input_from_db(0, geocam);
    boxm2_batch.set_input_int(1, ni);
    boxm2_batch.set_input_int(2, nj);
    boxm2_batch.set_input_double(3, scene_height);
    boxm2_batch.set_input_int(4, level);
    boxm2_batch.run_process();
    (c_id, c_type) = boxm2_batch.commit_output(0);
    cam = dbvalue(c_id, c_type);
    return cam;
예제 #9
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def geo2generic(geocam, ni, nj, scene_height, level):
    boxm2_batch.init_process("vpglConvertGeoCameraToGenericProcess")
    boxm2_batch.set_input_from_db(0, geocam)
    boxm2_batch.set_input_int(1, ni)
    boxm2_batch.set_input_int(2, nj)
    boxm2_batch.set_input_double(3, scene_height)
    boxm2_batch.set_input_int(4, level)
    boxm2_batch.run_process()
    (c_id, c_type) = boxm2_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam
예제 #10
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def geo_cam_global_to_img(geocam, lon, lat):
    boxm2_batch.init_process("vpglGeoGlobalToImgProcess")
    boxm2_batch.set_input_from_db(0, geocam)
    boxm2_batch.set_input_double(1, lon)
    boxm2_batch.set_input_double(2, lat)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    u = boxm2_batch.get_output_int(id)
    (id, type) = boxm2_batch.commit_output(1)
    v = boxm2_batch.get_output_int(id)
    return u, v
예제 #11
0
def geo_cam_global_to_img(geocam, lon, lat):
    boxm2_batch.init_process("vpglGeoGlobalToImgProcess")
    boxm2_batch.set_input_from_db(0, geocam)
    boxm2_batch.set_input_double(1, lon)
    boxm2_batch.set_input_double(2, lat)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    u = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(1)
    v = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    return u, v
예제 #12
0
파일: brip_adaptor.py 프로젝트: jhoare/vxl
def image_mutual_info(image1, image2, min_val, max_val, n_bins):
  boxm2_batch.init_process("bripImageMutualInfoProcess")
  boxm2_batch.set_input_from_db(0, image1)
  boxm2_batch.set_input_from_db(1, image2)
  boxm2_batch.set_input_double(2, min_val)
  boxm2_batch.set_input_double(3, max_val)
  boxm2_batch.set_input_unsigned(4, n_bins)
  status = boxm2_batch.run_process()
  if status:
    (id, type) = boxm2_batch.commit_output(0)
    mutual_info = boxm2_batch.get_output_double(id)
    return mutual_info
  else:
    return -1.0
예제 #13
0
def generate_xyz_from_shadow(scene, height_img, generic_cam, dem_fname, scale):
    boxm2_batch.init_process("boxm2ShadowHeightsToXYZProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.set_input_from_db(1, height_img)
    boxm2_batch.set_input_from_db(2, generic_cam)
    boxm2_batch.set_input_string(3, dem_fname)
    boxm2_batch.set_input_double(4, scale)
    boxm2_batch.run_process()
    (xi_id, xi_type) = boxm2_batch.commit_output(0)
    x_img = dbvalue(xi_id, xi_type)
    (yi_id, yi_type) = boxm2_batch.commit_output(1)
    y_img = dbvalue(yi_id, yi_type)
    (zi_id, zi_type) = boxm2_batch.commit_output(2)
    z_img = dbvalue(zi_id, zi_type)
    return x_img, y_img, z_img
예제 #14
0
def load_affine_camera(file_path, viewing_dist=1000, look_dir=(0, 0, -1)):
    """ load an affine camera from a text file containing the projection matrix
      The viewing rays will be flipped such that the dot product with look_dir is positive
  """
    boxm2_batch.init_process("vpglLoadAffineCameraProcess")
    boxm2_batch.set_input_string(0, file_path)
    boxm2_batch.set_input_double(1, viewing_dist)
    boxm2_batch.set_input_double(2, look_dir[0])
    boxm2_batch.set_input_double(3, look_dir[1])
    boxm2_batch.set_input_double(4, look_dir[2])
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    cam = dbvalue(id, type)
    return cam
예제 #15
0
def geo2generic_nonnadir(geocam, ni, nj, scene_height, dir_x, dir_y, dir_z, level):
    boxm2_batch.init_process("vpglConvertNonNadirGeoCameraToGenericProcess")
    boxm2_batch.set_input_from_db(0, geocam)
    boxm2_batch.set_input_int(1, ni)
    boxm2_batch.set_input_int(2, nj)
    boxm2_batch.set_input_double(3, scene_height)
    boxm2_batch.set_input_int(4, level)
    boxm2_batch.set_input_double(5, dir_x)
    boxm2_batch.set_input_double(6, dir_y)
    boxm2_batch.set_input_double(7, dir_z)
    boxm2_batch.run_process()
    (c_id, c_type) = boxm2_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam
예제 #16
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def load_affine_camera(file_path, viewing_dist=1000, look_dir=(0,0,-1)) :
  """ load an affine camera from a text file containing the projection matrix
      The viewing rays will be flipped such that the dot product with look_dir is positive
  """
  boxm2_batch.init_process("vpglLoadAffineCameraProcess");
  boxm2_batch.set_input_string(0, file_path);
  boxm2_batch.set_input_double(1, viewing_dist);
  boxm2_batch.set_input_double(2, look_dir[0])
  boxm2_batch.set_input_double(3, look_dir[1])
  boxm2_batch.set_input_double(4, look_dir[2])
  boxm2_batch.run_process();
  (id,type) = boxm2_batch.commit_output(0);
  cam = dbvalue(id,type);
  return cam;
예제 #17
0
def generate_xyz_from_dem(scene,
                          refine_level,
                          geotiff_dem,
                          geoid_height,
                          bilin=False):
    boxm2_batch.init_process("boxm2DemToXYZProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.set_input_unsigned(1, refine_level)
    boxm2_batch.set_input_string(2, geotiff_dem)
    boxm2_batch.set_input_double(3, geoid_height)
    boxm2_batch.set_input_bool(4, bilin)
    boxm2_batch.run_process()
    (xi_id, xi_type) = boxm2_batch.commit_output(0)
    x_img = dbvalue(xi_id, xi_type)
    (yi_id, yi_type) = boxm2_batch.commit_output(1)
    y_img = dbvalue(yi_id, yi_type)
    (zi_id, zi_type) = boxm2_batch.commit_output(2)
    z_img = dbvalue(zi_id, zi_type)
    (dem_id, dem_type) = boxm2_batch.commit_output(3)
    dem_img = dbvalue(dem_id, dem_type)
    (demr_id, demr_type) = boxm2_batch.commit_output(4)
    dem_res_img = dbvalue(demr_id, demr_type)
    return x_img, y_img, z_img, dem_img, dem_res_img
예제 #18
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def create_lvcs(lat,lon,el,csname):
    boxm2_batch.init_process('vpglCreateLVCSProcess');
    boxm2_batch.set_input_double(0,lat);
    boxm2_batch.set_input_double(1,lon);
    boxm2_batch.set_input_double(2,el);
    boxm2_batch.set_input_string(3,csname);
    boxm2_batch.run_process();
    (id,type) = boxm2_batch.commit_output(0);
    lvcs = dbvalue(id,type);
    return lvcs;
예제 #19
0
def create_lvcs(lat, lon, el, csname):
    boxm2_batch.init_process('vpglCreateLVCSProcess')
    boxm2_batch.set_input_double(0, lat)
    boxm2_batch.set_input_double(1, lon)
    boxm2_batch.set_input_double(2, el)
    boxm2_batch.set_input_string(3, csname)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    lvcs = dbvalue(id, type)
    return lvcs
예제 #20
0
def convert_local_to_global_coordinates(lvcs, x, y, z):
    boxm2_batch.init_process('vpglConvertLocalToGlobalCoordinatesProcess')
    boxm2_batch.set_input_from_db(0, lvcs)
    boxm2_batch.set_input_double(1, x)
    boxm2_batch.set_input_double(2, y)
    boxm2_batch.set_input_double(3, z)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    lat = boxm2_batch.get_output_double(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(1)
    lon = boxm2_batch.get_output_double(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(2)
    el = boxm2_batch.get_output_double(id)
    boxm2_batch.remove_data(id)
    return (lat, lon, el)
예제 #21
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def convert_local_to_global_coordinates(lvcs,x,y,z):
    boxm2_batch.init_process('vpglConvertLocalToGlobalCoordinatesProcess');
    boxm2_batch.set_input_from_db(0,lvcs);
    boxm2_batch.set_input_double(1,x);
    boxm2_batch.set_input_double(2,y);
    boxm2_batch.set_input_double(3,z);
    boxm2_batch.run_process();
    (id,type) = boxm2_batch.commit_output(0);
    lat = boxm2_batch.get_output_double(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(1);
    lon = boxm2_batch.get_output_double(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(2);
    el = boxm2_batch.get_output_double(id);
    boxm2_batch.remove_data(id);
    return (lat,lon,el);
예제 #22
0
def init_trajectory(scene, startInc, endInc, radius, ni=1280, nj=720):
    boxm2_batch.init_process("boxm2ViewInitTrajectoryProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.set_input_double(1, float(startInc))
    #incline0
    boxm2_batch.set_input_double(2, float(endInc))
    #incline1
    boxm2_batch.set_input_double(3, float(radius))
    #radius
    boxm2_batch.set_input_unsigned(4, ni)
    #ni
    boxm2_batch.set_input_unsigned(5, nj)
    #nj
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    trajectory = dbvalue(id, type)
    return trajectory
예제 #23
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def create_perspective_camera_from_kml(ni, nj, right_fov, top_fov, altitude, heading, tilt, roll, cent_x, cent_y) :
  boxm2_batch.init_process("vpglCreatePerspCameraFromKMLProcess");
  boxm2_batch.set_input_unsigned(0, ni);
  boxm2_batch.set_input_unsigned(1, nj);
  boxm2_batch.set_input_double(2, right_fov);
  boxm2_batch.set_input_double(3, top_fov);
  boxm2_batch.set_input_double(4, altitude);
  boxm2_batch.set_input_double(5, heading);
  boxm2_batch.set_input_double(6, tilt);
  boxm2_batch.set_input_double(7, roll);
  boxm2_batch.set_input_double(8, cent_x);
  boxm2_batch.set_input_double(9, cent_y);
  boxm2_batch.run_process();
  (id,type) = boxm2_batch.commit_output(0);
  cam = dbvalue(id,type);
  return cam;
예제 #24
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def affine_rectify_images(img1,
                          affine_cam1,
                          img2,
                          affine_cam2,
                          min_x,
                          min_y,
                          min_z,
                          max_x,
                          max_y,
                          max_z,
                          n_points=100):
    boxm2_batch.init_process("vpglAffineRectifyImagesProcess")
    boxm2_batch.set_input_from_db(0, img1)
    boxm2_batch.set_input_from_db(1, affine_cam1)
    boxm2_batch.set_input_from_db(2, img2)
    boxm2_batch.set_input_from_db(3, affine_cam2)
    boxm2_batch.set_input_double(4, min_x)
    boxm2_batch.set_input_double(5, min_y)
    boxm2_batch.set_input_double(6, min_z)
    boxm2_batch.set_input_double(7, max_x)
    boxm2_batch.set_input_double(8, max_y)
    boxm2_batch.set_input_double(9, max_z)
    boxm2_batch.set_input_unsigned(10, n_points)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    out_img1 = dbvalue(id, type)
    (id, type) = boxm2_batch.commit_output(1)
    out_cam1 = dbvalue(id, type)
    (id, type) = boxm2_batch.commit_output(2)
    out_img2 = dbvalue(id, type)
    (id, type) = boxm2_batch.commit_output(3)
    out_cam2 = dbvalue(id, type)
    return out_img1, out_cam1, out_img2, out_cam2
예제 #25
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def affine_rectify_images(img1, affine_cam1, img2, affine_cam2, min_x, min_y, min_z, max_x, max_y, max_z, n_points=100):
  boxm2_batch.init_process("vpglAffineRectifyImagesProcess");
  boxm2_batch.set_input_from_db(0, img1);
  boxm2_batch.set_input_from_db(1, affine_cam1);
  boxm2_batch.set_input_from_db(2, img2);
  boxm2_batch.set_input_from_db(3, affine_cam2);
  boxm2_batch.set_input_double(4, min_x);
  boxm2_batch.set_input_double(5, min_y);
  boxm2_batch.set_input_double(6, min_z);
  boxm2_batch.set_input_double(7, max_x);
  boxm2_batch.set_input_double(8, max_y);
  boxm2_batch.set_input_double(9, max_z);
  boxm2_batch.set_input_unsigned(10, n_points);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  out_img1 = dbvalue(id, type);
  (id, type) = boxm2_batch.commit_output(1);
  out_cam1 = dbvalue(id, type);
  (id, type) = boxm2_batch.commit_output(2);
  out_img2 = dbvalue(id, type);
  (id, type) = boxm2_batch.commit_output(3);
  out_cam2 = dbvalue(id, type);
  return out_img1, out_cam1, out_img2, out_cam2
예제 #26
0
def crop_image_using_3d_box(img_res, camera, lower_left_lon, lower_left_lat, lower_left_elev, upper_right_lon, upper_right_lat, upper_right_elev, uncertainty, lvcs=0):
    boxm2_batch.init_process("vpglCropImgUsing3DboxProcess")
    boxm2_batch.set_input_from_db(0, img_res)
    boxm2_batch.set_input_from_db(1, camera)
    boxm2_batch.set_input_double(2, lower_left_lon)
    boxm2_batch.set_input_double(3, lower_left_lat)
    boxm2_batch.set_input_double(4, lower_left_elev)
    boxm2_batch.set_input_double(5, upper_right_lon)
    boxm2_batch.set_input_double(6, upper_right_lat)
    boxm2_batch.set_input_double(7, upper_right_elev)
    boxm2_batch.set_input_double(8, uncertainty)
    if lvcs:
        boxm2_batch.set_input_from_db(9, lvcs)
    status = boxm2_batch.run_process()
    if status:
        (id, type) = boxm2_batch.commit_output(0)
        local_cam = dbvalue(id, type)
        (id, type) = boxm2_batch.commit_output(1)
        i0 = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(2)
        j0 = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(3)
        ni = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(4)
        nj = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        return status, local_cam, i0, j0, ni, nj
    else:
        return status, dbvalue(0, ""), 0, 0, 0, 0
예제 #27
0
def vrml_write_box(vrml_filename, bbox, is_wire, r, g, b):
  boxm2_batch.init_process("bvrmlWriteBoxProcess");
  boxm2_batch.set_input_string(0,vrml_filename);
  boxm2_batch.set_input_double(1,bbox[0]);  # minx
  boxm2_batch.set_input_double(2,bbox[1]);  # miny
  boxm2_batch.set_input_double(3,bbox[2]);  # minz
  boxm2_batch.set_input_double(4,bbox[3]);  # maxx
  boxm2_batch.set_input_double(5,bbox[4]);  # maxy
  boxm2_batch.set_input_double(6,bbox[5]);  # maxz
  boxm2_batch.set_input_bool(7,is_wire);
  boxm2_batch.set_input_float(8,r);
  boxm2_batch.set_input_float(9,g);
  boxm2_batch.set_input_float(10,b);
  boxm2_batch.run_process();
예제 #28
0
def crop_image_using_3d_box(img_res, camera, lower_left_lon, lower_left_lat, lower_left_elev, upper_right_lon, upper_right_lat, upper_right_elev, uncertainty):
  boxm2_batch.init_process("vpglCropImgUsing3DboxProcess");
  boxm2_batch.set_input_from_db(0, img_res);
  boxm2_batch.set_input_from_db(1, camera);
  boxm2_batch.set_input_double(2, lower_left_lon);
  boxm2_batch.set_input_double(3, lower_left_lat);
  boxm2_batch.set_input_double(4, lower_left_elev);
  boxm2_batch.set_input_double(5, upper_right_lon);
  boxm2_batch.set_input_double(6, upper_right_lat);
  boxm2_batch.set_input_double(7, upper_right_elev);
  boxm2_batch.set_input_double(8, uncertainty);
  status = boxm2_batch.run_process();
  if status:
    (id, type) = boxm2_batch.commit_output(0);
    local_cam  = dbvalue(id, type);
    (id, type) = boxm2_batch.commit_output(1);
    i0 = boxm2_batch.get_output_unsigned(id)
    (id, type) = boxm2_batch.commit_output(2);
    j0 = boxm2_batch.get_output_unsigned(id)
    (id, type) = boxm2_batch.commit_output(3);
    ni = boxm2_batch.get_output_unsigned(id)
    (id, type) = boxm2_batch.commit_output(4);
    nj = boxm2_batch.get_output_unsigned(id)
    return status, local_cam, i0, j0, ni, nj;
  else:
    return status, dbvalue(0, ""), 0, 0, 0, 0;
예제 #29
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def create_perspective_camera_from_kml(ni, nj, right_fov, top_fov, altitude,
                                       heading, tilt, roll, cent_x, cent_y):
    boxm2_batch.init_process("vpglCreatePerspCameraFromKMLProcess")
    boxm2_batch.set_input_unsigned(0, ni)
    boxm2_batch.set_input_unsigned(1, nj)
    boxm2_batch.set_input_double(2, right_fov)
    boxm2_batch.set_input_double(3, top_fov)
    boxm2_batch.set_input_double(4, altitude)
    boxm2_batch.set_input_double(5, heading)
    boxm2_batch.set_input_double(6, tilt)
    boxm2_batch.set_input_double(7, roll)
    boxm2_batch.set_input_double(8, cent_x)
    boxm2_batch.set_input_double(9, cent_y)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    cam = dbvalue(id, type)
    return cam
예제 #30
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def create_perspective_camera(scale, ppoint, center, look_pt, up=[0, 1, 0]):
    boxm2_batch.init_process("vpglCreatePerspectiveCameraProcess")
    boxm2_batch.set_input_double(0, scale[0])
    boxm2_batch.set_input_double(1, ppoint[0])
    boxm2_batch.set_input_double(2, scale[1])
    boxm2_batch.set_input_double(3, ppoint[1])
    boxm2_batch.set_input_double(4, center[0])
    boxm2_batch.set_input_double(5, center[1])
    boxm2_batch.set_input_double(6, center[2])
    boxm2_batch.set_input_double(7, look_pt[0])
    boxm2_batch.set_input_double(8, look_pt[1])
    boxm2_batch.set_input_double(9, look_pt[2])
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    cam = dbvalue(id, type)
    return cam
예제 #31
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def compute_affine_from_local_rational(cropped_cam, min_x, min_y, min_z, max_x, max_y, max_z, n_points=100):
    boxm2_batch.init_process("vpglComputeAffineFromRationalProcess");
    boxm2_batch.set_input_from_db(0, cropped_cam);
    boxm2_batch.set_input_double(1, min_x);
    boxm2_batch.set_input_double(2, min_y);
    boxm2_batch.set_input_double(3, min_z);
    boxm2_batch.set_input_double(4, max_x);
    boxm2_batch.set_input_double(5, max_y);
    boxm2_batch.set_input_double(6, max_z);
    boxm2_batch.set_input_unsigned(7, n_points);
    boxm2_batch.run_process();
    (id, type) = boxm2_batch.commit_output(0);
    out_cam = dbvalue(id, type);
    return out_cam
예제 #32
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def create_perspective_camera( scale, ppoint, center, look_pt,up = [0,1,0] ) :
  boxm2_batch.init_process("vpglCreatePerspectiveCameraProcess");
  boxm2_batch.set_input_double(0, scale[0]);
  boxm2_batch.set_input_double(1, ppoint[0]);
  boxm2_batch.set_input_double(2, scale[1]);
  boxm2_batch.set_input_double(3, ppoint[1]);
  boxm2_batch.set_input_double(4, center[0]);
  boxm2_batch.set_input_double(5, center[1]);
  boxm2_batch.set_input_double(6, center[2]);
  boxm2_batch.set_input_double(7, look_pt[0]);
  boxm2_batch.set_input_double(8, look_pt[1]);
  boxm2_batch.set_input_double(9, look_pt[2]);
  boxm2_batch.run_process();
  (id,type) = boxm2_batch.commit_output(0);
  cam = dbvalue(id,type);
  return cam;
예제 #33
0
파일: vpgl_adaptor.py 프로젝트: jhoare/vxl
def offset_cam_using_3d_box(camera, lower_left_lon, lower_left_lat, lower_left_elev, upper_right_lon, upper_right_lat, upper_right_elev, uncertainty, lvcs=None):
  boxm2_batch.init_process("vpglOffsetCamUsing3DboxProcess");
  boxm2_batch.set_input_from_db(0, camera);
  boxm2_batch.set_input_double(1, lower_left_lon);
  boxm2_batch.set_input_double(2, lower_left_lat);
  boxm2_batch.set_input_double(3, lower_left_elev);
  boxm2_batch.set_input_double(4, upper_right_lon);
  boxm2_batch.set_input_double(5, upper_right_lat);
  boxm2_batch.set_input_double(6, upper_right_elev);
  boxm2_batch.set_input_double(7, uncertainty);
  if lvcs:
    boxm2_batch.set_input_from_db(8, lvcs);
  status = boxm2_batch.run_process();
  if status:
    (id, type) = boxm2_batch.commit_output(0);
    local_cam  = dbvalue(id, type);
    (id, type) = boxm2_batch.commit_output(1);
    i0 = boxm2_batch.get_output_unsigned(id)
    boxm2_batch.remove_data(id);
    (id, type) = boxm2_batch.commit_output(2);
    j0 = boxm2_batch.get_output_unsigned(id)
    boxm2_batch.remove_data(id);
    (id, type) = boxm2_batch.commit_output(3);
    ni = boxm2_batch.get_output_unsigned(id)
    boxm2_batch.remove_data(id);
    (id, type) = boxm2_batch.commit_output(4);
    nj = boxm2_batch.get_output_unsigned(id)
    boxm2_batch.remove_data(id);
    return status, local_cam, i0, j0, ni, nj;
  else:
    return status, dbvalue(0, ""), 0, 0, 0, 0;
예제 #34
0
파일: vpgl_adaptor.py 프로젝트: caioc2/vxl
def compute_affine_from_local_rational(cropped_cam,
                                       min_x,
                                       min_y,
                                       min_z,
                                       max_x,
                                       max_y,
                                       max_z,
                                       n_points=100):
    boxm2_batch.init_process("vpglComputeAffineFromRationalProcess")
    boxm2_batch.set_input_from_db(0, cropped_cam)
    boxm2_batch.set_input_double(1, min_x)
    boxm2_batch.set_input_double(2, min_y)
    boxm2_batch.set_input_double(3, min_z)
    boxm2_batch.set_input_double(4, max_x)
    boxm2_batch.set_input_double(5, max_y)
    boxm2_batch.set_input_double(6, max_z)
    boxm2_batch.set_input_unsigned(7, n_points)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    out_cam = dbvalue(id, type)
    return out_cam
예제 #35
0
파일: bbas_adaptor.py 프로젝트: marcge/vxl
def vrml_write_box(vrml_filename, bbox, is_wire, r, g, b):
    boxm2_batch.init_process("bvrmlWriteBoxProcess")
    boxm2_batch.set_input_string(0, vrml_filename)
    boxm2_batch.set_input_double(1, bbox[0])
    # minx
    boxm2_batch.set_input_double(2, bbox[1])
    # miny
    boxm2_batch.set_input_double(3, bbox[2])
    # minz
    boxm2_batch.set_input_double(4, bbox[3])
    # maxx
    boxm2_batch.set_input_double(5, bbox[4])
    # maxy
    boxm2_batch.set_input_double(6, bbox[5])
    # maxz
    boxm2_batch.set_input_bool(7, is_wire)
    boxm2_batch.set_input_float(8, r)
    boxm2_batch.set_input_float(9, g)
    boxm2_batch.set_input_float(10, b)
    boxm2_batch.run_process()
예제 #36
0
def crop_image_using_3d_box(img_res,
                            camera,
                            lower_left_lon,
                            lower_left_lat,
                            lower_left_elev,
                            upper_right_lon,
                            upper_right_lat,
                            upper_right_elev,
                            uncertainty,
                            lvcs=0):
    boxm2_batch.init_process("vpglCropImgUsing3DboxProcess")
    boxm2_batch.set_input_from_db(0, img_res)
    boxm2_batch.set_input_from_db(1, camera)
    boxm2_batch.set_input_double(2, lower_left_lon)
    boxm2_batch.set_input_double(3, lower_left_lat)
    boxm2_batch.set_input_double(4, lower_left_elev)
    boxm2_batch.set_input_double(5, upper_right_lon)
    boxm2_batch.set_input_double(6, upper_right_lat)
    boxm2_batch.set_input_double(7, upper_right_elev)
    boxm2_batch.set_input_double(8, uncertainty)
    if lvcs:
        boxm2_batch.set_input_from_db(9, lvcs)
    status = boxm2_batch.run_process()
    if status:
        (id, type) = boxm2_batch.commit_output(0)
        local_cam = dbvalue(id, type)
        (id, type) = boxm2_batch.commit_output(1)
        i0 = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(2)
        j0 = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(3)
        ni = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(4)
        nj = boxm2_batch.get_output_unsigned(id)
        boxm2_batch.remove_data(id)
        return status, local_cam, i0, j0, ni, nj
    else:
        return status, dbvalue(0, ""), 0, 0, 0, 0