Exemple #1
0
def crop_ortho_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):
  bvxm_batch.init_process("vpglCropOrthoUsing3DboxPRocess")
  bvxm_batch.set_input_from_db(0, img_res);
  bvxm_batch.set_input_from_db(1, camera);
  bvxm_batch.set_input_double(2, lower_left_lon);
  bvxm_batch.set_input_double(3, lower_left_lat);
  bvxm_batch.set_input_double(4, lower_left_elev);
  bvxm_batch.set_input_double(5, upper_right_lon);
  bvxm_batch.set_input_double(6, upper_right_lat);
  bvxm_batch.set_input_double(7, upper_right_elev);
  status = bvxm_batch.run_process();
  if status:
    (id, type) = bvxm_batch.commit_output(0);
    local_geo_cam  = dbvalue(id, type);
    (id, type) = bvxm_batch.commit_output(1);
    i0 = bvxm_batch.get_output_unsigned(id)
    (id, type) = bvxm_batch.commit_output(2);
    j0 = bvxm_batch.get_output_unsigned(id)
    (id, type) = bvxm_batch.commit_output(3);
    ni = bvxm_batch.get_output_unsigned(id)
    (id, type) = bvxm_batch.commit_output(4);
    nj = bvxm_batch.get_output_unsigned(id)
    return status, local_geo_cam, i0, j0, ni, nj;
  else:
    return status, dbvalue(0, ""), 0, 0, 0, 0;
Exemple #2
0
def convert_local_rational_perspective_camera(local_cam) :
  bvxm_batch.init_process("vpglConvertLocalRationalToPerspectiveProcess");
  bvxm_batch.set_input_from_db(0, local_cam);
  bvxm_batch.run_process();
  (id,type) = bvxm_batch.commit_output(0);
  cam = dbvalue(id,type);
  return cam;
Exemple #3
0
def get_image_coverage(mdata):
    bvxm_batch.init_process("bradGetImageCoverageProcess")
    bvxm_batch.set_input_from_db(0, mdata)
    status = bvxm_batch.run_process()
    if status:
        (id, type) = bvxm_batch.commit_output(0)
        ll_lon = bvxm_batch.get_output_double(id)
        bvxm_batch.remove_data(id)
        (id, type) = bvxm_batch.commit_output(1)
        ll_lat = bvxm_batch.get_output_double(id)
        bvxm_batch.remove_data(id)
        (id, type) = bvxm_batch.commit_output(2)
        ll_elev = bvxm_batch.get_output_double(id)
        bvxm_batch.remove_data(id)
        (id, type) = bvxm_batch.commit_output(3)
        ur_lon = bvxm_batch.get_output_double(id)
        bvxm_batch.remove_data(id)
        (id, type) = bvxm_batch.commit_output(4)
        ur_lat = bvxm_batch.get_output_double(id)
        bvxm_batch.remove_data(id)
        (id, type) = bvxm_batch.commit_output(5)
        ur_elev = bvxm_batch.get_output_double(id)
        bvxm_batch.remove_data(id)
        return ll_lon, ll_lat, ll_elev, ur_lon, ur_lat, ur_elev
    else:
        return 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Exemple #4
0
def model_dir(scene):
  bvxm_batch.init_process("bvxmSceneModelDirProcess");
  bvxm_batch.set_input_from_db(0, scene);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  model_dir = bvxm_batch.get_output_string(id);
  return model_dir;
Exemple #5
0
def get_geocam_footprint(geocam, geotiff_filename, out_kml_filename,init_finish=True):
    bvxm_batch.init_process('vpglGeoFootprintProcess');
    bvxm_batch.set_input_from_db(0,geocam);
    bvxm_batch.set_input_string(1,geotiff_filename);
    bvxm_batch.set_input_string(2,out_kml_filename);
    bvxm_batch.set_input_bool(3,init_finish);
    bvxm_batch.run_process();
Exemple #6
0
def map_sdet_to_volm_ids(sdet_color_class_img):
  bvxm_batch.init_process("volmGenerateClassMapProcess");
  bvxm_batch.set_input_from_db(0,sdet_color_class_img);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  out_img = dbvalue(id, type);
  return out_img
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
Exemple #8
0
def generate_roc3(tclsf, in_prob_img, prefix_for_bin_files, positive_category_name):
  bvxm_batch.init_process("sdetTextureClassifierROCProcess3")
  bvxm_batch.set_input_from_db(0, tclsf)
  bvxm_batch.set_input_from_db(1, in_prob_img)
  bvxm_batch.set_input_string(2, prefix_for_bin_files)
  bvxm_batch.set_input_string(3, positive_category_name)
  status = bvxm_batch.run_process()
  if status:
    (id, type) = bvxm_batch.commit_output(0)
    thres = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(1)
    tp = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(2)
    tn = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(3)
    fp = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(4)
    fn = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(5)
    tpr = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(6)
    fpr = bvxm_batch.get_bbas_1d_array_float(id)
    return thres, tp, tn, fp, fn, tpr, fpr
  else:
    return None, None, None, None, None, None, None
Exemple #9
0
def create_ortho_camera(world):
  bvxm_batch.init_process("bvxmCreateOrthoCameraProcess");
  bvxm_batch.set_input_from_db(0,world);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  ortho_cam = dbvalue(id, type);
  return ortho_cam
Exemple #10
0
def save_occupancy_raw(world, filename, app_model, scale=0):
  bvxm_batch.init_process("bvxmSaveOccupancyRawProcess");
  bvxm_batch.set_input_from_db(0,world);
  bvxm_batch.set_input_string(1,filename);
  bvxm_batch.set_input_unsigned(2, scale);
  bvxm_batch.set_input_string(3, app_model);
  bvxm_batch.run_process();
Exemple #11
0
def interpolate_perspective_cameras(cam0,cam1,ncams,outdir):
    bvxm_batch.init_process("vpglInterpolatePerspectiveCamerasProcess");
    bvxm_batch.set_input_from_db(0, cam0);
    bvxm_batch.set_input_from_db(1, cam1);
    bvxm_batch.set_input_unsigned(2, ncams);
    bvxm_batch.set_input_string(3, outdir);
    return bvxm_batch.run_process();
Exemple #12
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
Exemple #13
0
def add_to_filter_bank(tclsf, img_name, plane, filter_folder):
  bvxm_batch.init_process("sdetAddtoFilterBankProcess");
  bvxm_batch.set_input_from_db(0,tclsf);      # classifier instance
  bvxm_batch.set_input_string(1,img_name);
  bvxm_batch.set_input_unsigned(2,plane);  ## pass which plane to extract the gauss response from
  bvxm_batch.set_input_string(3,filter_folder);
  bvxm_batch.run_process();
Exemple #14
0
def region_wise_roc_analysis(in_img, in_cam, positive_kml, negative_kml):
  bvxm_batch.init_process("volmDetectionRateROCProcess")
  bvxm_batch.set_input_from_db(0, in_img)
  bvxm_batch.set_input_from_db(1, in_cam)
  bvxm_batch.set_input_string(2, positive_kml)
  bvxm_batch.set_input_string(3, negative_kml)
  status = bvxm_batch.run_process()
  if status:
    (id, type) = bvxm_batch.commit_output(0)
    thres_out = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(1)
    tp = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(2)
    tn = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(3)
    fp = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(4)
    fn = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(5)
    tpr = bvxm_batch.get_bbas_1d_array_float(id)
    (id, type) = bvxm_batch.commit_output(6)
    fpr = bvxm_batch.get_bbas_1d_array_float(id)
    return thres_out, tp, tn, fp, fn, tpr, fpr
  else:
    return None, None, None, None, None, None, None
Exemple #15
0
def correct_ransac_process(res, cor_file, output_folder, pixel_radius):
  bvxm_batch.init_process("volmCorrectRationalCamerasRANSACProcess");
  bvxm_batch.set_input_from_db(0, res);
  bvxm_batch.set_input_string(1, cor_file);
  bvxm_batch.set_input_string(2, output_folder);
  bvxm_batch.set_input_float(3, pixel_radius);  ## pixel radius to count for inliers
  bvxm_batch.run_process();
Exemple #16
0
def volm_id_color_img(id_img, id_to_color_txt=""):
  bvxm_batch.init_process("volmGenerateColorClassMapProcess")
  bvxm_batch.set_input_from_db(0,id_img);
  bvxm_batch.set_input_string(1,id_to_color_txt)
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  out_img = dbvalue(id, type);
  return out_img;
Exemple #17
0
def create_ortho_camera(world, is_utm=False):
    bvxm_batch.init_process("bvxmCreateOrthoCameraProcess")
    bvxm_batch.set_input_from_db(0, world)
    bvxm_batch.set_input_bool(1, is_utm)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    ortho_cam = dbvalue(id, type)
    return ortho_cam
Exemple #18
0
def radiometrically_calibrate(cropped_image, meta):
  bvxm_batch.init_process("bradNITFAbsRadiometricCalibrationProcess")
  bvxm_batch.set_input_from_db(0, cropped_image)
  bvxm_batch.set_input_from_db(1, meta)
  bvxm_batch.run_process()
  (id, type) = bvxm_batch.commit_output(0)
  cropped_img_cal = dbvalue(id, type)
  return cropped_img_cal
Exemple #19
0
def create_ortho_camera(world, is_utm=False):
    bvxm_batch.init_process("bvxmCreateOrthoCameraProcess")
    bvxm_batch.set_input_from_db(0, world)
    bvxm_batch.set_input_bool(1, is_utm)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    ortho_cam = dbvalue(id, type)
    return ortho_cam
Exemple #20
0
def correct_ransac_process(res, cor_file, output_folder, pixel_radius):
    bvxm_batch.init_process("volmCorrectRationalCamerasRANSACProcess")
    bvxm_batch.set_input_from_db(0, res)
    bvxm_batch.set_input_string(1, cor_file)
    bvxm_batch.set_input_string(2, output_folder)
    bvxm_batch.set_input_float(3, pixel_radius)
    ## pixel radius to count for inliers
    bvxm_batch.run_process()
Exemple #21
0
def truncate_nitf_image(img, is_short = True):
  bvxm_batch.init_process("bripTruncateNITFBitProcess");
  bvxm_batch.set_input_from_db(0, img);
  bvxm_batch.set_input_bool(1, is_short);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  out_img = dbvalue(id, type);
  return out_img;
Exemple #22
0
def find_seed_sat_resources(res, poly_kml, downsample_factor, sat_res_file):
  bvxm_batch.init_process("volmFindOverlappingSatResourcesProcess")
  bvxm_batch.set_input_from_db(0,res);             # satellite resource
  bvxm_batch.set_input_string(1,poly_kml);         # kml polygon filename
  bvxm_batch.set_input_float(2,downsample_factor); # factor by which to downsample resource footprints when 
                                                   # computing the raster (smaller factor takes more time & memory)
  bvxm_batch.set_input_string(3,sat_res_file);     # output file to print the list (this will also save a kml version)
  bvxm_batch.run_process();
Exemple #23
0
def add_responses_to_filter_bank(tclsf, img_name, img, filter_folder, filter_name):
  bvxm_batch.init_process("sdetAddResponsestoFilterBankProcess");
  bvxm_batch.set_input_from_db(0,tclsf);      # classifier instance
  bvxm_batch.set_input_string(1,img_name);
  bvxm_batch.set_input_from_db(2,img);
  bvxm_batch.set_input_string(3,filter_folder);
  bvxm_batch.set_input_string(4,filter_name);  ## pass a unique name to be used to write to filter_folder
  bvxm_batch.run_process();
Exemple #24
0
def find_sun_dir_bin(metadata, output_file):
    bvxm_batch.init_process("bradSunDirBinProcess")
    bvxm_batch.set_input_from_db(0, metadata)
    bvxm_batch.set_input_string(1, output_file)
    bvxm_batch.run_process()
    (bin_id, bin_type) = bvxm_batch.commit_output(0)
    bin = bvxm_batch.get_output_int(bin_id)
    return bin
Exemple #25
0
def volm_id_color_img(id_img, id_to_color_txt=""):
    bvxm_batch.init_process("volmGenerateColorClassMapProcess")
    bvxm_batch.set_input_from_db(0, id_img)
    bvxm_batch.set_input_string(1, id_to_color_txt)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out_img = dbvalue(id, type)
    return out_img
Exemple #26
0
def bvxm_detect_edges(cropped_image, edge_params_xml):
  bvxm_batch.init_process("bvxmDetectEdgesProcess");
  bvxm_batch.set_input_from_db(0,cropped_image);
  bvxm_batch.set_params_process(edge_params_xml);
  bvxm_batch.run_process();
  (cropped_edge_image_id,cropped_edge_image) = bvxm_batch.commit_output(0);
  cropped_edge_image = dbvalue(cropped_edge_image_id,cropped_edge_image);
  return cropped_edge_image
Exemple #27
0
def find_sun_dir_bin(metadata, output_file):
  bvxm_batch.init_process("bradSunDirBinProcess");
  bvxm_batch.set_input_from_db(0,metadata)
  bvxm_batch.set_input_string(1,output_file);
  bvxm_batch.run_process();
  (bin_id,bin_type)=bvxm_batch.commit_output(0);
  bin = bvxm_batch.get_output_int(bin_id);
  return bin
Exemple #28
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
Exemple #29
0
def bvxm_detect_edges(cropped_image, edge_params_xml):
    bvxm_batch.init_process("bvxmDetectEdgesProcess")
    bvxm_batch.set_input_from_db(0, cropped_image)
    bvxm_batch.set_params_process(edge_params_xml)
    bvxm_batch.run_process()
    (cropped_edge_image_id, cropped_edge_image) = bvxm_batch.commit_output(0)
    cropped_edge_image = dbvalue(cropped_edge_image_id, cropped_edge_image)
    return cropped_edge_image
Exemple #30
0
def add_to_filter_bank(tclsf, img_name, plane, filter_folder):
    bvxm_batch.init_process("sdetAddtoFilterBankProcess")
    bvxm_batch.set_input_from_db(0, tclsf)
    # classifier instance
    bvxm_batch.set_input_string(1, img_name)
    bvxm_batch.set_input_unsigned(2, plane)
    ## pass which plane to extract the gauss response from
    bvxm_batch.set_input_string(3, filter_folder)
    bvxm_batch.run_process()
Exemple #31
0
def get_full_path(res, name):
  bvxm_batch.init_process("volmGetFullPathProcess");
  bvxm_batch.set_input_from_db(0,res);
  bvxm_batch.set_input_string(1,name);
  statuscode=bvxm_batch.run_process();
  (f_id, f_type) = bvxm_batch.commit_output(0);
  full_path = bvxm_batch.get_output_string(f_id);
  bvxm_batch.remove_data(f_id);
  return full_path
Exemple #32
0
def translate_geo_camera(geocam, x, y):
    bvxm_batch.init_process("vpglTranslateGeoCameraProcess");
    bvxm_batch.set_input_from_db(0, geocam);
    bvxm_batch.set_input_double(1, x);
    bvxm_batch.set_input_double(2, y);
    bvxm_batch.run_process();
    (c_id, c_type) = bvxm_batch.commit_output(0);
    cam = dbvalue(c_id, c_type);
    return cam;
Exemple #33
0
def correct_rational_camera(cam_in, offset_x, offset_y):
    bvxm_batch.init_process('vpglCorrectRationalCameraProcess');
    bvxm_batch.set_input_from_db(0,cam_in);
    bvxm_batch.set_input_double(1,offset_x);
    bvxm_batch.set_input_double(2,offset_y);
    bvxm_batch.run_process();
    (id,type) = bvxm_batch.commit_output(0);
    corrected_cam = dbvalue(id,type);
    return corrected_cam;
Exemple #34
0
def rotate_perspective_camera(cam_in, theta, phi):
    bvxm_batch.init_process('vpglRotatePerspCamProcess');
    bvxm_batch.set_input_from_db(0,cam_in);
    bvxm_batch.set_input_float(1,theta);
    bvxm_batch.set_input_float(2,phi);
    bvxm_batch.run_process();
    (id,type) = bvxm_batch.commit_output(0);
    rot_cam = dbvalue(id,type);
    return rot_cam;
Exemple #35
0
def truncate_nitf_image(img, is_byte=True, is_scale=False):
    bvxm_batch.init_process("bripTruncateNITFBitProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_bool(1, is_byte)
    bvxm_batch.set_input_bool(2, is_scale)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out_img = dbvalue(id, type)
    return out_img
Exemple #36
0
def translate_geo_camera(geocam, x, y):
    bvxm_batch.init_process("vpglTranslateGeoCameraProcess")
    bvxm_batch.set_input_from_db(0, geocam)
    bvxm_batch.set_input_double(1, x)
    bvxm_batch.set_input_double(2, y)
    bvxm_batch.run_process()
    (c_id, c_type) = bvxm_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam
Exemple #37
0
def load_geotiff_from_header(filename, lvcs=0):
    bvxm_batch.init_process("vpglLoadGeotiffCamFromHeaderProcess");
    bvxm_batch.set_input_string(0, filename);
    if lvcs != 0:
      bvxm_batch.set_input_from_db(1, lvcs);
    bvxm_batch.run_process();
    (c_id,c_type) = bvxm_batch.commit_output(0);
    cam = dbvalue(c_id,c_type);
    return cam;
Exemple #38
0
def correct_rational_camera(cam_in, offset_x, offset_y):
    bvxm_batch.init_process('vpglCorrectRationalCameraProcess')
    bvxm_batch.set_input_from_db(0, cam_in)
    bvxm_batch.set_input_double(1, offset_x)
    bvxm_batch.set_input_double(2, offset_y)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    corrected_cam = dbvalue(id, type)
    return corrected_cam
Exemple #39
0
def rotate_perspective_camera(cam_in, theta, phi):
    bvxm_batch.init_process('vpglRotatePerspCamProcess')
    bvxm_batch.set_input_from_db(0, cam_in)
    bvxm_batch.set_input_float(1, theta)
    bvxm_batch.set_input_float(2, phi)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    rot_cam = dbvalue(id, type)
    return rot_cam
Exemple #40
0
def load_geotiff_from_header(filename, lvcs=0):
    bvxm_batch.init_process("vpglLoadGeotiffCamFromHeaderProcess")
    bvxm_batch.set_input_string(0, filename)
    if lvcs != 0:
        bvxm_batch.set_input_from_db(1, lvcs)
    bvxm_batch.run_process()
    (c_id, c_type) = bvxm_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam
Exemple #41
0
def get_full_path(res, name):
    bvxm_batch.init_process("volmGetFullPathProcess")
    bvxm_batch.set_input_from_db(0, res)
    bvxm_batch.set_input_string(1, name)
    statuscode = bvxm_batch.run_process()
    (f_id, f_type) = bvxm_batch.commit_output(0)
    full_path = bvxm_batch.get_output_string(f_id)
    bvxm_batch.remove_data(f_id)
    return full_path
Exemple #42
0
def truncate_nitf_image(img, is_byte=True, is_scale=False):
    bvxm_batch.init_process("bripTruncateNITFBitProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_bool(1, is_byte)
    bvxm_batch.set_input_bool(2, is_scale)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out_img = dbvalue(id, type)
    return out_img
Exemple #43
0
def project_osm_to_ortho_img(img_byte, ortho_cam, osm_file):
    bvxm_batch.init_process("volmMapOSMProcess")
    bvxm_batch.set_input_from_db(0, img_byte)
    bvxm_batch.set_input_from_db(1, ortho_cam)
    bvxm_batch.set_input_string(2, osm_file)
    # process returns true if any osm objects hit the image area in this tile
    hit = bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out_img = dbvalue(id, type)
    return hit, out_img
Exemple #44
0
def get_geocam_footprint(geocam,
                         geotiff_filename,
                         out_kml_filename,
                         init_finish=True):
    bvxm_batch.init_process('vpglGeoFootprintProcess')
    bvxm_batch.set_input_from_db(0, geocam)
    bvxm_batch.set_input_string(1, geotiff_filename)
    bvxm_batch.set_input_string(2, out_kml_filename)
    bvxm_batch.set_input_bool(3, init_finish)
    bvxm_batch.run_process()
Exemple #45
0
def create_perspective_camera2(pcam, cent_x, cent_y, cent_z):
    bvxm_batch.init_process("vpglCreatePerspectiveCameraProcess2")
    bvxm_batch.set_input_from_db(0, pcam)
    bvxm_batch.set_input_float(1, cent_x)
    bvxm_batch.set_input_float(2, cent_y)
    bvxm_batch.set_input_float(3, cent_z)
    bvxm_batch.run_process()
    (c_id, c_type) = bvxm_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam
Exemple #46
0
def render_uncertainty_img(input_cam, ni, nj, world):
    bvxm_batch.init_process("bvxmUncertaintyProcess")
    bvxm_batch.set_input_from_db(0, world)
    bvxm_batch.set_input_from_db(1, input_cam)
    bvxm_batch.set_input_unsigned(2, ni)
    bvxm_batch.set_input_unsigned(3, nj)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out_img = dbvalue(id, type)
    return out_img
Exemple #47
0
def persp2gen(pcam, ni, nj, level=0):
    bvxm_batch.init_process("vpglConvertToGenericCameraProcess")
    bvxm_batch.set_input_from_db(0, pcam)
    bvxm_batch.set_input_unsigned(1, ni)
    bvxm_batch.set_input_unsigned(2, nj)
    bvxm_batch.set_input_unsigned(3, level)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    gcam = dbvalue(id, type)
    return gcam
Exemple #48
0
def find_seed_sat_resources(res, poly_kml, downsample_factor, sat_res_file):
    bvxm_batch.init_process("volmFindOverlappingSatResourcesProcess")
    bvxm_batch.set_input_from_db(0, res)  # satellite resource
    bvxm_batch.set_input_string(1, poly_kml)  # kml polygon filename
    # factor by which to downsample resource footprints when
    bvxm_batch.set_input_float(2, downsample_factor)
    # computing the raster (smaller factor takes more time & memory)
    # output file to print the list (this will also save a kml version)
    bvxm_batch.set_input_string(3, sat_res_file)
    bvxm_batch.run_process()
def render_height_map_with_cam(world, input_cam, ni, nj):
    bvxm_batch.init_process("bvxmHeightmapProcess")
    bvxm_batch.set_input_from_db(0, input_cam)
    bvxm_batch.set_input_unsigned(1, ni)
    bvxm_batch.set_input_unsigned(2, nj)
    bvxm_batch.set_input_from_db(3, world)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out_d_img = dbvalue(id, type)
    return out_d_img
Exemple #50
0
def scene_lvcs(world):
    bvxm_batch.init_process("bvxmSceneLvcsProcess")
    bvxm_batch.set_input_from_db(0, world)
    status = bvxm_batch.run_process()
    if status:
        (id, type) = bvxm_batch.commit_output(0)
        lvcs = dbvalue(id, type)
        return lvcs
    else:
        return 0
Exemple #51
0
def write_perspective_cam_vrml(vrml_filename, pcam, camera_rad, axis_length, r, g, b):
    bvxm_batch.init_process("bvrmlWritePerspectiveCamProcess")
    bvxm_batch.set_input_string(0, vrml_filename)
    bvxm_batch.set_input_from_db(1, pcam)
    bvxm_batch.set_input_float(2, camera_rad)
    bvxm_batch.set_input_float(3, axis_length)
    bvxm_batch.set_input_float(4, r)
    bvxm_batch.set_input_float(5, g)
    bvxm_batch.set_input_float(6, b)
    bvxm_batch.run_process()
Exemple #52
0
def render_height_map(world):
    print("Rendering height map")
    bvxm_batch.init_process("bvxmHeightmapOrthoProcess")
    bvxm_batch.set_input_from_db(0, world)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out_d_img = dbvalue(id, type)
    (id, type) = bvxm_batch.commit_output(1)
    out_h_img = dbvalue(id, type)
    return out_h_img, out_d_img
Exemple #53
0
def add_responses_to_filter_bank(tclsf, img_name, img, filter_folder,
                                 filter_name):
    bvxm_batch.init_process("sdetAddResponsestoFilterBankProcess")
    bvxm_batch.set_input_from_db(0, tclsf)  # classifier instance
    bvxm_batch.set_input_string(1, img_name)
    bvxm_batch.set_input_from_db(2, img)
    bvxm_batch.set_input_string(3, filter_folder)
    # pass a unique name to be used to write to filter_folder
    bvxm_batch.set_input_string(4, filter_name)
    bvxm_batch.run_process()
Exemple #54
0
def convert_to_generic_camera(cam_in, ni, nj, level=0):
    bvxm_batch.init_process('vpglConvertToGenericCameraProcess')
    bvxm_batch.set_input_from_db(0, cam_in)
    bvxm_batch.set_input_unsigned(1, ni)
    bvxm_batch.set_input_unsigned(2, nj)
    bvxm_batch.set_input_unsigned(3, level)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    generic_cam = dbvalue(id, type)
    return generic_cam
Exemple #55
0
def rational_cam_nadirness(camera, lat, lon, elev):
    bvxm_batch.init_process("vpglRationalCamNadirnessProcess")
    bvxm_batch.set_input_from_db(0, camera)
    bvxm_batch.set_input_double(1, lat)
    bvxm_batch.set_input_double(2, lon)
    bvxm_batch.set_input_double(3, elev)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    val = bvxm_batch.get_output_double(id)
    return val
Exemple #56
0
def resample_perspective_camera(cam, size0, size1):
    bvxm_batch.init_process("vpglResamplePerspectiveCameraProcess")
    bvxm_batch.set_input_from_db(0, cam)
    bvxm_batch.set_input_int(1, size0[0])
    bvxm_batch.set_input_int(2, size0[1])
    bvxm_batch.set_input_int(3, size1[0])
    bvxm_batch.set_input_int(4, size1[1])
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out = dbvalue(id, type)
    return out
Exemple #57
0
def geo2generic(geocam, ni, nj, scene_height, level):
    bvxm_batch.init_process("vpglConvertGeoCameraToGenericProcess")
    bvxm_batch.set_input_from_db(0, geocam)
    bvxm_batch.set_input_int(1, ni)
    bvxm_batch.set_input_int(2, nj)
    bvxm_batch.set_input_double(3, scene_height)
    bvxm_batch.set_input_int(4, level)
    bvxm_batch.run_process()
    (c_id, c_type) = bvxm_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam
Exemple #58
0
def geo_cam_global_to_img(geocam, lon, lat):
    bvxm_batch.init_process("vpglGeoGlobalToImgProcess")
    bvxm_batch.set_input_from_db(0, geocam)
    bvxm_batch.set_input_double(1, lon)
    bvxm_batch.set_input_double(2, lat)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    u = bvxm_batch.get_output_int(id)
    (id, type) = bvxm_batch.commit_output(1)
    v = bvxm_batch.get_output_int(id)
    return u, v
Exemple #59
0
def load_geotiff_cam(tfw_filename, lvcs=0, utm_zone=0, utm_hemisphere=0):
    bvxm_batch.init_process("vpglLoadGeoCameraProcess")
    bvxm_batch.set_input_string(0, tfw_filename)
    if lvcs != 0:
        bvxm_batch.set_input_from_db(1, lvcs)
    bvxm_batch.set_input_int(2, utm_zone)
    bvxm_batch.set_input_unsigned(3, utm_hemisphere)
    bvxm_batch.run_process()
    (c_id, c_type) = bvxm_batch.commit_output(0)
    cam = dbvalue(c_id, c_type)
    return cam