Esempio n. 1
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;
Esempio n. 2
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
Esempio n. 3
0
def blob_intersection(mp_img, gt_img):
  boxm2_batch.init_process("bripBlobIntersectionProcess")
  boxm2_batch.set_input_from_db(0, mp_img);
  boxm2_batch.set_input_from_db(1, gt_img);  
  boxm2_batch.run_process();
  
  (id,type) = boxm2_batch.commit_output(0);
  tp = boxm2_batch.get_output_int(id);
  (id,type) = boxm2_batch.commit_output(1);
  fp = boxm2_batch.get_output_int(id);
  (id,type) = boxm2_batch.commit_output(2);
  numBlobs = boxm2_batch.get_output_int(id);
  return (tp, fp, numBlobs)
Esempio n. 4
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
Esempio n. 5
0
def blob_intersection(mp_img, gt_img):
    boxm2_batch.init_process("bripBlobIntersectionProcess")
    boxm2_batch.set_input_from_db(0, mp_img)
    boxm2_batch.set_input_from_db(1, gt_img)
    boxm2_batch.run_process()

    (id, type) = boxm2_batch.commit_output(0)
    tp = boxm2_batch.get_output_int(id)
    (id, type) = boxm2_batch.commit_output(1)
    fp = boxm2_batch.get_output_int(id)
    (id, type) = boxm2_batch.commit_output(2)
    numBlobs = boxm2_batch.get_output_int(id)
    return (tp, fp, numBlobs)
Esempio n. 6
0
def nitf_date_time(image_filename):
  boxm2_batch.init_process("vilNITFDateTimeProcess");
  boxm2_batch.set_input_string(0,image_filename);
  boxm2_batch.run_process();
  (id,type)=boxm2_batch.commit_output(0);
  year =  boxm2_batch.get_output_int(id);
  (id,type)=boxm2_batch.commit_output(1);
  month =  boxm2_batch.get_output_int(id);
  (id,type)=boxm2_batch.commit_output(2);
  day =  boxm2_batch.get_output_int(id);
  (id,type)=boxm2_batch.commit_output(3);
  hour = boxm2_batch.get_output_int(id);
  (id,type)=boxm2_batch.commit_output(4);
  minute = boxm2_batch.get_output_int(id);
  return year, month, day, hour, minute
Esempio n. 7
0
def nitf_date_time(image_filename):
    boxm2_batch.init_process("vilNITFDateTimeProcess")
    boxm2_batch.set_input_string(0, image_filename)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    year = boxm2_batch.get_output_int(id)
    (id, type) = boxm2_batch.commit_output(1)
    month = boxm2_batch.get_output_int(id)
    (id, type) = boxm2_batch.commit_output(2)
    day = boxm2_batch.get_output_int(id)
    (id, type) = boxm2_batch.commit_output(3)
    hour = boxm2_batch.get_output_int(id)
    (id, type) = boxm2_batch.commit_output(4)
    minute = boxm2_batch.get_output_int(id)
    return year, month, day, hour, minute
Esempio n. 8
0
def get_info_along_ray(scene,cache,cam,u,v,prefix,identifier="") :
  print("Ray  Probe");
  boxm2_batch.init_process("boxm2CppRayProbeProcess");
  boxm2_batch.set_input_from_db(0,scene);
  boxm2_batch.set_input_from_db(1,cache);
  boxm2_batch.set_input_from_db(2,cam);
  boxm2_batch.set_input_unsigned(3,u);
  boxm2_batch.set_input_unsigned(4,v);
  boxm2_batch.set_input_string(5,prefix);
  boxm2_batch.set_input_string(6,identifier);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  len_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  (id, type) = boxm2_batch.commit_output(1);
  alpha_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  (id, type) = boxm2_batch.commit_output(2);
  vis_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  (id, type) = boxm2_batch.commit_output(3);
  tabs_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  (id, type) = boxm2_batch.commit_output(4);
  res_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  if (prefix != "") :
    (id, type) = boxm2_batch.commit_output(5);
    data_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
    (id, type) = boxm2_batch.commit_output(6);
    nelems = boxm2_batch.get_output_int(id);
    return len_array_1d, alpha_array_1d, vis_array_1d ,tabs_array_1d,res_array_1d, data_array_1d, nelems;
  else :
    return len_array_1d, alpha_array_1d, vis_array_1d ,tabs_array_1d,res_array_1d;
Esempio n. 9
0
def texture_classifier_kernel_margin(dictionary):
    boxm2_batch.init_process("sdetTextureClassifierKernelMarginProcess")
    boxm2_batch.set_input_string(0, dictionary)
    boxm2_batch.run_process()
    (m_id, m_type) = boxm2_batch.commit_output(0)
    margin = boxm2_batch.get_output_int(m_id)
    return margin
Esempio n. 10
0
def texture_classifier_kernel_margin(dictionary):
  boxm2_batch.init_process("sdetTextureClassifierKernelMarginProcess");
  boxm2_batch.set_input_string(0,dictionary);
  boxm2_batch.run_process();
  (m_id, m_type) = boxm2_batch.commit_output(0);
  margin = boxm2_batch.get_output_int(m_id);
  return margin;
Esempio n. 11
0
def get_info_along_ray(scene,cache,cam,u,v,prefix,identifier="") :
  print("Ray  Probe");
  boxm2_batch.init_process("boxm2CppRayProbeProcess");
  boxm2_batch.set_input_from_db(0,scene);
  boxm2_batch.set_input_from_db(1,cache);
  boxm2_batch.set_input_from_db(2,cam);
  boxm2_batch.set_input_unsigned(3,u);
  boxm2_batch.set_input_unsigned(4,v);
  boxm2_batch.set_input_string(5,prefix);
  boxm2_batch.set_input_string(6,identifier);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  len_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  (id, type) = boxm2_batch.commit_output(1);
  alpha_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  (id, type) = boxm2_batch.commit_output(2);
  vis_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  (id, type) = boxm2_batch.commit_output(3);
  tabs_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
  if (prefix != "") :
    (id, type) = boxm2_batch.commit_output(4);
    data_array_1d = boxm2_batch.get_bbas_1d_array_float(id);
    (id, type) = boxm2_batch.commit_output(5);
    nelems = boxm2_batch.get_output_int(id);
    return len_array_1d, alpha_array_1d, vis_array_1d ,tabs_array_1d, data_array_1d, nelems;
  else :
    return len_array_1d, alpha_array_1d, vis_array_1d ,tabs_array_1d;
Esempio n. 12
0
def blob_intersection(mp_img, gt_img):
    boxm2_batch.init_process("bripBlobIntersectionProcess")
    boxm2_batch.set_input_from_db(0, mp_img)
    boxm2_batch.set_input_from_db(1, gt_img)
    boxm2_batch.run_process()

    (id, type) = boxm2_batch.commit_output(0)
    tp = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(1)
    fp = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(2)
    numBlobs = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    return (tp, fp, numBlobs)
Esempio n. 13
0
def get_3d_point_from_index(scene,cache,block_index, index): 
    #Warning, you probably shouldn't be doing this!
    boxm2_batch.init_process("boxm2CppGet3dPointFromIndexProcess");
    boxm2_batch.set_input_from_db(0, scene);
    boxm2_batch.set_input_from_db(1, cache);
    boxm2_batch.set_input_int(2, block_index[0]);
    boxm2_batch.set_input_int(3, block_index[1]);
    boxm2_batch.set_input_int(4, block_index[2]);
    boxm2_batch.set_input_int(5, index);
    boxm2_batch.run_process();

    (id,type) = boxm2_batch.commit_output(0);
    x=boxm2_batch.get_output_float(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(1);
    y=boxm2_batch.get_output_float(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(2);
    z=boxm2_batch.get_output_float(id);
    boxm2_batch.remove_data(id);

    (id,type) = boxm2_batch.commit_output(3);
    xs=boxm2_batch.get_output_float(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(4);
    ys=boxm2_batch.get_output_float(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(5);
    zs=boxm2_batch.get_output_float(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(6);
    leaf=boxm2_batch.get_output_int(id);
    boxm2_batch.remove_data(id);

    return ((x, y, z), (xs, ys, zs), leaf)
Esempio n. 14
0
def get_3d_point_from_index(scene, cache, block_index, index):
    #Warning, you probably shouldn't be doing this!
    boxm2_batch.init_process("boxm2CppGet3dPointFromIndexProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.set_input_from_db(1, cache)
    boxm2_batch.set_input_int(2, block_index[0])
    boxm2_batch.set_input_int(3, block_index[1])
    boxm2_batch.set_input_int(4, block_index[2])
    boxm2_batch.set_input_int(5, index)
    boxm2_batch.run_process()

    (id, type) = boxm2_batch.commit_output(0)
    x = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(1)
    y = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(2)
    z = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)

    (id, type) = boxm2_batch.commit_output(3)
    xs = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(4)
    ys = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(5)
    zs = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(6)
    leaf = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)

    return ((x, y, z), (xs, ys, zs), leaf)
Esempio n. 15
0
def get_info_along_ray(scene, cache, cam, u, v, prefix, identifier=""):
    print("Ray  Probe")
    boxm2_batch.init_process("boxm2CppRayProbeProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.set_input_from_db(1, cache)
    boxm2_batch.set_input_from_db(2, cam)
    boxm2_batch.set_input_unsigned(3, u)
    boxm2_batch.set_input_unsigned(4, v)
    boxm2_batch.set_input_string(5, prefix)
    boxm2_batch.set_input_string(6, identifier)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    len_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    (id, type) = boxm2_batch.commit_output(1)
    alpha_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    (id, type) = boxm2_batch.commit_output(2)
    vis_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    (id, type) = boxm2_batch.commit_output(3)
    tabs_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    (id, type) = boxm2_batch.commit_output(4)
    res_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    if (prefix != ""):
        (id, type) = boxm2_batch.commit_output(5)
        data_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
        (id, type) = boxm2_batch.commit_output(6)
        nelems = boxm2_batch.get_output_int(id)
        return len_array_1d, alpha_array_1d, vis_array_1d, tabs_array_1d, res_array_1d, data_array_1d, nelems
    else:
        return len_array_1d, alpha_array_1d, vis_array_1d, tabs_array_1d, res_array_1d
Esempio n. 16
0
def sun_dir_bin(meta, illum_bin_filename):
    boxm2_batch.init_process("bradSunDirBinProcess")
    boxm2_batch.set_input_from_db(0, meta)
    boxm2_batch.set_input_string(1, illum_bin_filename)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    bin = boxm2_batch.get_output_int(id)
    return bin
Esempio n. 17
0
def sun_dir_bin(meta,illum_bin_filename):
  boxm2_batch.init_process("bradSunDirBinProcess");
  boxm2_batch.set_input_from_db(0,meta);
  boxm2_batch.set_input_string(1,illum_bin_filename);
  boxm2_batch.run_process();
  (id,type)=boxm2_batch.commit_output(0);
  bin = boxm2_batch.get_output_int(id);
  return bin;
Esempio n. 18
0
def find_sun_dir_bin(metadata, output_file):
    boxm2_batch.init_process("bradSunDirBinProcess")
    boxm2_batch.set_input_from_db(0, metadata)
    boxm2_batch.set_input_string(1, output_file)
    boxm2_batch.run_process()
    (bin_id, bin_type) = boxm2_batch.commit_output(0)
    bin = boxm2_batch.get_output_int(bin_id)
    return bin
Esempio n. 19
0
def find_sun_dir_bin(metadata, output_file):
    boxm2_batch.init_process("bradSunDirBinProcess")
    boxm2_batch.set_input_from_db(0, metadata)
    boxm2_batch.set_input_string(1, output_file)
    boxm2_batch.run_process()
    (bin_id, bin_type) = boxm2_batch.commit_output(0)
    bin = boxm2_batch.get_output_int(bin_id)
    return bin
Esempio n. 20
0
def arf_stream(file_path) : 
  boxm2_batch.init_process("bilCreateArfImageIstreamProcess")
  boxm2_batch.set_input_string(0,file_path);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  stream = dbvalue(id, type);
  (id, type) = boxm2_batch.commit_output(1); 
  numImgs = boxm2_batch.get_output_int(id);
  return stream, numImgs 
Esempio n. 21
0
def bae_raw_stream(file_path):
    boxm2_batch.init_process("bilCreateRawImageIstreamProcess")
    boxm2_batch.set_input_string(0, file_path)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    stream = dbvalue(id, type)
    (id, type) = boxm2_batch.commit_output(1)
    numImgs = boxm2_batch.get_output_int(id)
    return stream, numImgs
Esempio n. 22
0
def scene_illumination_info(scene):
    boxm2_batch.init_process("boxm2SceneIlluminationInfoProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.run_process()
    (lon_id, lon_type) = boxm2_batch.commit_output(0)
    longitude = boxm2_batch.get_output_float(lon_id)
    (lat_id, lat_type) = boxm2_batch.commit_output(1)
    latitude = boxm2_batch.get_output_float(lat_id)
    (nb_id, nb_type) = boxm2_batch.commit_output(2)
    nbins = boxm2_batch.get_output_int(nb_id)
    return longitude, latitude, nbins
Esempio n. 23
0
def find_sun_dir_bin(metadata, output_file):
  boxm2_batch.init_process("bradSunDirBinProcess");
  boxm2_batch.set_input_from_db(0,metadata)
  boxm2_batch.set_input_string(1,output_file);
  status = boxm2_batch.run_process();
  bin, angle = None, None
  if status:
      (bin_id,bin_type)=boxm2_batch.commit_output(0);
      bin = boxm2_batch.get_output_int(bin_id);
      (angle_id,angle_type)=boxm2_batch.commit_output(1);
      angle = boxm2_batch.get_output_float(angle_id);
  return bin, angle
Esempio n. 24
0
def nitf_date_time(image_filename):
    boxm2_batch.init_process("vilNITFDateTimeProcess")
    boxm2_batch.set_input_string(0, image_filename)
    status = boxm2_batch.run_process()
    year = month = day = hour = minute = None
    if status:
        (id, type) = boxm2_batch.commit_output(0)
        year = boxm2_batch.get_output_int(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(1)
        month = boxm2_batch.get_output_int(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(2)
        day = boxm2_batch.get_output_int(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(3)
        hour = boxm2_batch.get_output_int(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(4)
        minute = boxm2_batch.get_output_int(id)
        boxm2_batch.remove_data(id)
    return year, month, day, hour, minute
Esempio n. 25
0
def bae_raw_stream(file_path, ni=0, nj=0, pixelsize=0):
    boxm2_batch.init_process("bilCreateRawImageIstreamProcess")
    boxm2_batch.set_input_string(0, file_path)
    boxm2_batch.set_input_int(1, ni)
    boxm2_batch.set_input_int(2, nj)
    boxm2_batch.set_input_int(3, pixelsize)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    stream = dbvalue(id, type)
    (id, type) = boxm2_batch.commit_output(1)
    numImgs = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    return stream, numImgs
Esempio n. 26
0
def bae_raw_stream(file_path, ni=0, nj=0, pixelsize=0):
    boxm2_batch.init_process("bilCreateRawImageIstreamProcess")
    boxm2_batch.set_input_string(0, file_path)
    boxm2_batch.set_input_int(1, ni)
    boxm2_batch.set_input_int(2, nj)
    boxm2_batch.set_input_int(3, pixelsize)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    stream = dbvalue(id, type)
    (id, type) = boxm2_batch.commit_output(1)
    numImgs = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    return stream, numImgs
Esempio n. 27
0
def find_sun_dir_bin(metadata, output_file):
    boxm2_batch.init_process("bradSunDirBinProcess")
    boxm2_batch.set_input_from_db(0, metadata)
    boxm2_batch.set_input_string(1, output_file)
    status = boxm2_batch.run_process()
    bin, angle = None, None
    if status:
        (bin_id, bin_type) = boxm2_batch.commit_output(0)
        bin = boxm2_batch.get_output_int(bin_id)
        boxm2_batch.remove_data(bin_id)
        (angle_id, angle_type) = boxm2_batch.commit_output(1)
        angle = boxm2_batch.get_output_float(angle_id)
        boxm2_batch.remove_data(angle_id)
    return bin, angle
Esempio n. 28
0
def get_index_from_3d_point(scene, cache, point):
    boxm2_batch.init_process("boxm2CppGetIndexFrom3dPointProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.set_input_from_db(1, cache)
    boxm2_batch.set_input_float(2, point[0])
    boxm2_batch.set_input_float(3, point[1])
    boxm2_batch.set_input_float(4, point[2])
    boxm2_batch.run_process()

    (id, type) = boxm2_batch.commit_output(0)
    blk_i = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(1)
    blk_j = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(2)
    blk_k = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)

    (id, type) = boxm2_batch.commit_output(3)
    index = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)

    return ((blk_i, blk_j, blk_k), index)
Esempio n. 29
0
def get_index_from_3d_point(scene,cache,point): 
    boxm2_batch.init_process("boxm2CppGetIndexFrom3dPointProcess");
    boxm2_batch.set_input_from_db(0, scene);
    boxm2_batch.set_input_from_db(1, cache);
    boxm2_batch.set_input_float(2, point[0]);
    boxm2_batch.set_input_float(3, point[1]);
    boxm2_batch.set_input_float(4, point[2]);
    boxm2_batch.run_process();

    (id,type) = boxm2_batch.commit_output(0);
    blk_i=boxm2_batch.get_output_int(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(1);
    blk_j=boxm2_batch.get_output_int(id);
    boxm2_batch.remove_data(id);
    (id,type) = boxm2_batch.commit_output(2);
    blk_k=boxm2_batch.get_output_int(id);
    boxm2_batch.remove_data(id);

    (id,type) = boxm2_batch.commit_output(3);
    index=boxm2_batch.get_output_int(id);
    boxm2_batch.remove_data(id);

    return ((blk_i, blk_j, blk_k), index)
Esempio n. 30
0
def get_info_along_ray(scene, cache, cam, u, v, prefix, identifier=""):
    print("Ray  Probe")
    boxm2_batch.init_process("boxm2CppRayProbeProcess")
    boxm2_batch.set_input_from_db(0, scene)
    boxm2_batch.set_input_from_db(1, cache)
    boxm2_batch.set_input_from_db(2, cam)
    boxm2_batch.set_input_unsigned(3, u)
    boxm2_batch.set_input_unsigned(4, v)
    boxm2_batch.set_input_string(5, prefix)
    boxm2_batch.set_input_string(6, identifier)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    len_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(1)
    alpha_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(2)
    vis_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(3)
    tabs_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(4)
    res_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
    boxm2_batch.remove_data(id)
    if (prefix != ""):
        (id, type) = boxm2_batch.commit_output(5)
        data_array_1d = boxm2_batch.get_bbas_1d_array_float(id)
        boxm2_batch.remove_data(id)
        (id, type) = boxm2_batch.commit_output(6)
        nelems = boxm2_batch.get_output_int(id)
        boxm2_batch.remove_data(id)
        return len_array_1d, alpha_array_1d, vis_array_1d, tabs_array_1d, res_array_1d, data_array_1d, nelems
    else:
        return len_array_1d, alpha_array_1d, vis_array_1d, tabs_array_1d, res_array_1d
Esempio n. 31
0
def refine(scene, cache, thresh=0.3, device=None):
    if cache.type == "boxm2_cache_sptr":
        print "boxm2_batch CPU refine"
        boxm2_batch.init_process("boxm2CppRefineProcess")
        boxm2_batch.set_input_from_db(0, scene)
        boxm2_batch.set_input_from_db(1, cache)
        boxm2_batch.set_input_float(2, thresh)
        boxm2_batch.run_process()
        return 0
    elif cache.type == "boxm2_opencl_cache_sptr" and device:
        print "boxm2_batch GPU refine"
        boxm2_batch.init_process("boxm2OclRefineProcess")
        boxm2_batch.set_input_from_db(0, device)
        boxm2_batch.set_input_from_db(1, scene)
        boxm2_batch.set_input_from_db(2, cache)
        boxm2_batch.set_input_float(3, thresh)
        boxm2_batch.run_process()

        #get and report cells output
        (id, type) = boxm2_batch.commit_output(0)
        nCells = boxm2_batch.get_output_int(id)
        return nCells
    else:
        print "ERROR: Cache type unrecognized: ", cache.type
Esempio n. 32
0
def get_metadata_info(mdata):
    boxm2_batch.init_process("bradGetMetaDataInfoProcess")
    boxm2_batch.set_input_from_db(0, mdata)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    sun_az = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(1)
    sun_el = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(2)
    year = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(3)
    month = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(4)
    day = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(5)
    hour = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(6)
    minutes = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(7)
    seconds = boxm2_batch.get_output_int(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(8)
    gsd = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(9)
    sat_name = boxm2_batch.get_output_string(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(10)
    view_az = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    (id, type) = boxm2_batch.commit_output(11)
    view_el = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    return sun_az, sun_el, year, month, day, hour, minutes, seconds, gsd, sat_name, view_az, view_el
Esempio n. 33
0
def get_metadata_info(mdata):
  boxm2_batch.init_process("bradGetMetaDataInfoProcess")
  boxm2_batch.set_input_from_db(0, mdata)
  boxm2_batch.run_process()
  (id,type) = boxm2_batch.commit_output(0)
  sun_az = boxm2_batch.get_output_float(id)
  boxm2_batch.remove_data(id)
  (id,type) = boxm2_batch.commit_output(1)
  sun_el = boxm2_batch.get_output_float(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(2)
  year = boxm2_batch.get_output_int(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(3)
  month = boxm2_batch.get_output_int(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(4)
  day = boxm2_batch.get_output_int(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(5)
  hour = boxm2_batch.get_output_int(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(6)
  minutes = boxm2_batch.get_output_int(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(7)
  seconds = boxm2_batch.get_output_int(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(8)
  gsd = boxm2_batch.get_output_float(id)
  boxm2_batch.remove_data(id)
  (id, type) = boxm2_batch.commit_output(9)
  sat_name = boxm2_batch.get_output_string(id)
  boxm2_batch.remove_data(id)
  (id,type) = boxm2_batch.commit_output(10)
  view_az = boxm2_batch.get_output_float(id)
  boxm2_batch.remove_data(id)
  (id,type) = boxm2_batch.commit_output(11)
  view_el = boxm2_batch.get_output_float(id)
  boxm2_batch.remove_data(id)
  return sun_az, sun_el, year, month, day, hour, minutes, seconds, gsd, sat_name, view_az, view_el