Example #1
0
def histogram_equalize(img):
    bvxm_batch.init_process("vilHistogramEqualizeProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    img_equalized = dbvalue(id, type)
    return img_equalized
Example #2
0
def rgb_to_grey(img):
    bvxm_batch.init_process("vilRGBToGreyProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    outimg = dbvalue(id, type)
    return outimg
Example #3
0
def get_number_of_planes(img):
    bvxm_batch.init_process("vilGetNumberOfPlanesProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    n_planes = bvxm_batch.get_output_unsigned(id)
    return n_planes
Example #4
0
def img_registration_by_rmse(src_img, tgr_img, sx, sy, sz = 0.0, pixel_res=1.0, invalid_pixel=-9999.0, mask_img=None):
  bvxm_batch.init_process("vilImageRegistrationProcess")
  bvxm_batch.set_input_from_db(0, src_img)
  bvxm_batch.set_input_from_db(1, tgr_img)
  bvxm_batch.set_input_unsigned(2,sx)
  bvxm_batch.set_input_unsigned(3,sy)
  bvxm_batch.set_input_double(4, sz)
  bvxm_batch.set_input_double(5, pixel_res)
  bvxm_batch.set_input_float(6,invalid_pixel)
  if mask_img:
    bvxm_batch.set_input_from_db(7,mask_img)
  status = bvxm_batch.run_process()
  if status:
    (id, type) = bvxm_batch.commit_output(0)
    trans_x = bvxm_batch.get_output_double(id)
    (id, type) = bvxm_batch.commit_output(1)
    trans_y = bvxm_batch.get_output_double(id)
    (id, type) = bvxm_batch.commit_output(2)
    trans_z = bvxm_batch.get_output_double(id)
    (id, type) = bvxm_batch.commit_output(3)
    rmse_z = bvxm_batch.get_output_double(id)
    (id, type) = bvxm_batch.commit_output(4)
    var_z  = bvxm_batch.get_output_double(id)
    return trans_x, trans_y, trans_z, rmse_z, var_z
  else:
    return -1.0, -1.0, -1.0, -1.0, -1.0
Example #5
0
def scene_local_box(scene):
    batch.init_process("bvxmSceneLocalBoxProcess")
    batch.set_input_from_db(0, scene)
    batch.run_process()
    (id, type) = batch.commit_output(0)
    lower_left_x = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(1)
    lower_left_y = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(2)
    upper_right_x = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(3)
    upper_right_y = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(4)
    voxel_size = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(5)
    lower_left_z = batch.get_output_double(id)  # min z
    batch.remove_data(id)
    (id, type) = batch.commit_output(6)
    upper_right_z = batch.get_output_double(id)  # max z
    batch.remove_data(id)
    return lower_left_x, lower_left_y, upper_right_x, upper_right_y, voxel_size, lower_left_z, upper_right_z
Example #6
0
def pixel_wise_roc2(class_img, gt_img, negative_gt_img = None, positive_sign = "high", mask_img=None):
  bvxm_batch.init_process("vilPixelwiseRocProcess2")
  bvxm_batch.set_input_from_db(0, class_img)
  bvxm_batch.set_input_from_db(1, gt_img)
  if negative_gt_img:
    bvxm_batch.set_input_from_db(2, negative_gt_img)
  if mask_img:
    bvxm_batch.set_input_from_db(3, mask_img)
  bvxm_batch.set_input_string(4, positive_sign)
  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
Example #7
0
def model_dir(scene):
    batch.init_process("bvxmSceneModelDirProcess")
    batch.set_input_from_db(0, scene)
    batch.run_process()
    (id, type) = batch.commit_output(0)
    model_dir = batch.get_output_string(id)
    return model_dir
Example #8
0
def img_registration_by_rmse(src_img,
                             tgr_img,
                             sx,
                             sy,
                             sz=0.0,
                             pixel_res=1.0,
                             invalid_pixel=-9999.0,
                             mask_img=None):
    bvxm_batch.init_process("vilImageRegistrationProcess")
    bvxm_batch.set_input_from_db(0, src_img)
    bvxm_batch.set_input_from_db(1, tgr_img)
    bvxm_batch.set_input_unsigned(2, sx)
    bvxm_batch.set_input_unsigned(3, sy)
    bvxm_batch.set_input_double(4, sz)
    bvxm_batch.set_input_double(5, pixel_res)
    bvxm_batch.set_input_float(6, invalid_pixel)
    if mask_img:
        bvxm_batch.set_input_from_db(7, mask_img)
    status = bvxm_batch.run_process()
    if status:
        (id, type) = bvxm_batch.commit_output(0)
        trans_x = bvxm_batch.get_output_double(id)
        (id, type) = bvxm_batch.commit_output(1)
        trans_y = bvxm_batch.get_output_double(id)
        (id, type) = bvxm_batch.commit_output(2)
        trans_z = bvxm_batch.get_output_double(id)
        (id, type) = bvxm_batch.commit_output(3)
        rmse_z = bvxm_batch.get_output_double(id)
        (id, type) = bvxm_batch.commit_output(4)
        var_z = bvxm_batch.get_output_double(id)
        return trans_x, trans_y, trans_z, rmse_z, var_z
    else:
        return -1.0, -1.0, -1.0, -1.0, -1.0
Example #9
0
def scene_local_box(scene):
    batch.init_process("bvxmSceneLocalBoxProcess")
    batch.set_input_from_db(0, scene)
    batch.run_process()
    (id, type) = batch.commit_output(0)
    lower_left_x = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(1)
    lower_left_y = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(2)
    upper_right_x = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(3)
    upper_right_y = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(4)
    voxel_size = batch.get_output_double(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(5)
    lower_left_z = batch.get_output_double(id)  # min z
    batch.remove_data(id)
    (id, type) = batch.commit_output(6)
    upper_right_z = batch.get_output_double(id)  # max z
    batch.remove_data(id)
    return lower_left_x, lower_left_y, upper_right_x, upper_right_y, voxel_size, lower_left_z, upper_right_z
Example #10
0
def get_number_of_planes(img):
  bvxm_batch.init_process("vilGetNumberOfPlanesProcess");
  bvxm_batch.set_input_from_db(0, img);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  n_planes = bvxm_batch.get_output_unsigned(id)
  return n_planes;
Example #11
0
def create_scene_large_scale(roi_kml,
                             scene_root,
                             world_dir,
                             dem_folder,
                             world_size=500.0,
                             voxel_size=1.0,
                             height_diff=120.0,
                             height_sub=25.0,
                             land_folder=""):
    batch.init_process("bvxmCreateSceneXmlLargeScaleProcess")
    batch.set_input_string(0, roi_kml)
    batch.set_input_string(1, scene_root)
    batch.set_input_string(2, world_dir)
    batch.set_input_string(3, dem_folder)
    batch.set_input_string(4, land_folder)
    batch.set_input_float(5, world_size)
    batch.set_input_float(6, voxel_size)
    batch.set_input_float(7, height_diff)
    batch.set_input_float(8, height_sub)
    status = batch.run_process()
    if status:
        (id, type) = batch.commit_output(0)
        n_scenes = batch.get_output_unsigned(id)
        return n_scenes
    else:
        return 0
Example #12
0
def save_occupancy_raw(world, filename, app_model, scale=0):
    batch.init_process("bvxmSaveOccupancyRawProcess")
    batch.set_input_from_db(0, world)
    batch.set_input_string(1, filename)
    batch.set_input_unsigned(2, scale)
    batch.set_input_string(3, app_model)
    batch.run_process()
Example #13
0
def debayer(img):
  bvxm_batch.init_process("vilDebayerBGGRToRGBProcess")
  bvxm_batch.set_input_from_db(0,img);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  outimg = dbvalue(id,type);
  return outimg;
Example #14
0
def read_CLIF07(indir,outdir,camnum,datatype="CLIF06") :
  bvxm_batch.init_process("bilReadCLIF07DataProcess")
  bvxm_batch.set_input_string(0,indir);
  bvxm_batch.set_input_string(1,outdir);
  bvxm_batch.set_input_int(2,camnum);
  bvxm_batch.set_input_string(3,datatype);
  bvxm_batch.run_process();
Example #15
0
def save_occupancy_raw(world, filename, app_model, scale=0):
    batch.init_process("bvxmSaveOccupancyRawProcess")
    batch.set_input_from_db(0, world)
    batch.set_input_string(1, filename)
    batch.set_input_unsigned(2, scale)
    batch.set_input_string(3, app_model)
    batch.run_process()
Example #16
0
def create_scene_xml(scene_xml,
                     world_dir,
                     lvcs,
                     lvcs_file,
                     dim_x,
                     dim_y,
                     dim_z,
                     voxel_size=1.0,
                     corner_x=0.0,
                     corner_y=0.0,
                     corner_z=0.0,
                     min_ocp_prob=0.001,
                     max_ocp_prob=0.999,
                     max_scale=1):
    batch.init_process("bvxmCreateSceneXmlProcess")
    batch.set_input_string(0, scene_xml)
    batch.set_input_string(1, world_dir)
    batch.set_input_float(2, corner_x)
    batch.set_input_float(3, corner_y)
    batch.set_input_float(4, corner_z)
    batch.set_input_unsigned(5, dim_x)
    batch.set_input_unsigned(6, dim_y)
    batch.set_input_unsigned(7, dim_z)
    batch.set_input_float(8, voxel_size)
    batch.set_input_from_db(9, lvcs)
    batch.set_input_string(10, lvcs_file)
    batch.set_input_float(11, min_ocp_prob)
    batch.set_input_float(12, max_ocp_prob)
    batch.set_input_unsigned(13, max_scale)
    return batch.run_process()
Example #17
0
def rpc_registration(world,
                     cropped_cam,
                     cropped_edge_image,
                     uncertainty,
                     shift_3d_flag=0,
                     scale=0,
                     is_uncertainty_float=0):
    batch.init_process("bvxmRpcRegistrationProcess")
    batch.set_input_from_db(0, world)
    batch.set_input_from_db(1, cropped_cam)
    batch.set_input_from_db(2, cropped_edge_image)
    batch.set_input_bool(3, shift_3d_flag)
    if is_uncertainty_float == 1:
        print "uncertainty = ", uncertainty
        batch.set_input_float(4, uncertainty)
    else:
        batch.set_input_from_db(4, uncertainty)
    batch.set_input_unsigned(5, scale)
    batch.run_process()
    (cam_id, cam_type) = batch.commit_output(0)
    cam = dbvalue(cam_id, cam_type)
    (expected_edge_image_id, expected_edge_image_type) = batch.commit_output(1)
    expected_edge_image = dbvalue(expected_edge_image_id,
                                  expected_edge_image_type)
    (offset_u_id, offset_u_type) = batch.commit_output(2)
    offset_u = batch.get_output_double(offset_u_id)
    (offset_v_id, offset_v_type) = batch.commit_output(3)
    offset_v = batch.get_output_double(offset_v_id)
    return cam, expected_edge_image, offset_u, offset_v
Example #18
0
def histogram_equalize(img):
  bvxm_batch.init_process("vilHistogramEqualizeProcess");
  bvxm_batch.set_input_from_db(0, img);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  img_equalized = dbvalue(id, type);
  return img_equalized;
Example #19
0
def rgb_to_grey(img):
  bvxm_batch.init_process("vilRGBToGreyProcess");
  bvxm_batch.set_input_from_db(0,img)
  bvxm_batch.run_process()
  (id, type) = bvxm_batch.commit_output(0)
  outimg = dbvalue(id, type);
  return outimg
Example #20
0
def pixel_wise_roc2(class_img,
                    gt_img,
                    negative_gt_img=None,
                    positive_sign="high",
                    mask_img=None):
    bvxm_batch.init_process("vilPixelwiseRocProcess2")
    bvxm_batch.set_input_from_db(0, class_img)
    bvxm_batch.set_input_from_db(1, gt_img)
    if negative_gt_img:
        bvxm_batch.set_input_from_db(2, negative_gt_img)
    if mask_img:
        bvxm_batch.set_input_from_db(3, mask_img)
    bvxm_batch.set_input_string(4, positive_sign)
    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
Example #21
0
def fill_holes(img):
    bvxm_batch.init_process("vilFillHolesInRegionsProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    outimg = dbvalue(id, type)
    return outimg
Example #22
0
def read_CLIF07(indir, outdir, camnum, datatype="CLIF06"):
    bvxm_batch.init_process("bilReadCLIF07DataProcess")
    bvxm_batch.set_input_string(0, indir)
    bvxm_batch.set_input_string(1, outdir)
    bvxm_batch.set_input_int(2, camnum)
    bvxm_batch.set_input_string(3, datatype)
    bvxm_batch.run_process()
Example #23
0
def fill_holes(img):
  bvxm_batch.init_process("vilFillHolesInRegionsProcess")
  bvxm_batch.set_input_from_db(0,img)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  outimg = dbvalue(id, type);
  return outimg
Example #24
0
def model_dir(scene):
    batch.init_process("bvxmSceneModelDirProcess")
    batch.set_input_from_db(0, scene)
    batch.run_process()
    (id, type) = batch.commit_output(0)
    model_dir = batch.get_output_string(id)
    return model_dir
Example #25
0
def debayer(img):
    bvxm_batch.init_process("vilDebayerBGGRToRGBProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    outimg = dbvalue(id, type)
    return outimg
Example #26
0
def scale_and_offset_values(img, scale, offset):
    bvxm_batch.init_process("vilScaleAndOffsetValuesProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_float(1, scale)
    bvxm_batch.set_input_float(2, offset)
    bvxm_batch.run_process()
    return
Example #27
0
def scale_and_offset_values(img,scale,offset):
  bvxm_batch.init_process("vilScaleAndOffsetValuesProcess")
  bvxm_batch.set_input_from_db(0,img)
  bvxm_batch.set_input_float(1,scale)
  bvxm_batch.set_input_float(2,offset)
  bvxm_batch.run_process()
  return
Example #28
0
def convert_image(img, type="byte") :
  bvxm_batch.init_process("vilConvertPixelTypeProcess");
  bvxm_batch.set_input_from_db(0, img);
  bvxm_batch.set_input_string(1, type);
  bvxm_batch.run_process();
  (id,type) = bvxm_batch.commit_output(0);
  cimg = dbvalue(id,type);
  return cimg;
Example #29
0
def get_plane(img, plane_id):
  bvxm_batch.init_process("vilGetPlaneProcess");
  bvxm_batch.set_input_from_db(0, img);
  bvxm_batch.set_input_unsigned(1, plane_id);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  img_plane = dbvalue(id, type);
  return img_plane;
Example #30
0
def img_sum(img, plane_index=0):
  bvxm_batch.init_process("vilImageSumProcess")
  bvxm_batch.set_input_from_db(0,img)
  bvxm_batch.set_input_unsigned(1,plane_index)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  value = bvxm_batch.get_output_double(id)
  return value
Example #31
0
def image_mean(img):
  bvxm_batch.init_process("vilImageMeanProcess")
  bvxm_batch.set_input_from_db(0,img)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  mean_val = bvxm_batch.get_output_float(id)
  bvxm_batch.remove_data(id)
  return mean_val
Example #32
0
def median_filter(img, operator_half_size):
    bvxm_batch.init_process("vilMedianFilterProcess")
    bvxm_batch.set_input_from_db(0,img)
    bvxm_batch.set_input_int(1, operator_half_size)
    bvxm_batch.run_process()
    (id,type) = bvxm_batch.commit_output(0)
    img_out = dbvalue(id,type)
    return img_out
Example #33
0
def combine_eo_ir(eo_img,ir_img):
  bvxm_batch.init_process("vilEOIRCombineProcess")
  bvxm_batch.set_input_from_db(0,eo_img)
  bvxm_batch.set_input_from_db(1,ir_img)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  img_out = dbvalue(id,type)
  return img_out
Example #34
0
def detect_shadow_rgb(img,threshold) :
  bvxm_batch.init_process("vilShadowDetectionProcess");
  bvxm_batch.set_input_from_db(0,img)
  bvxm_batch.set_input_float(1, threshold);
  bvxm_batch.run_process();
  (o_id,o_type) = bvxm_batch.commit_output(0);
  region_img = dbvalue(o_id,o_type);
  return region_img;
Example #35
0
def create_ortho_camera(world, is_utm=False):
    batch.init_process("bvxmCreateOrthoCameraProcess")
    batch.set_input_from_db(0, world)
    batch.set_input_bool(1, is_utm)
    batch.run_process()
    (id, type) = batch.commit_output(0)
    ortho_cam = dbvalue(id, type)
    return ortho_cam
Example #36
0
def image_entropy(img, block_size = 5):
  bvxm_batch.init_process("vilBlockEntropyProcess");
  bvxm_batch.set_input_from_db(0, img);
  bvxm_batch.set_input_unsigned(1, block_size);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  entropy_img = dbvalue(id, type);
  return entropy_img;
Example #37
0
def bvxm_detect_edges(cropped_image, edge_params_xml):
    batch.init_process("bvxmDetectEdgesProcess")
    batch.set_input_from_db(0, cropped_image)
    batch.set_params_process(edge_params_xml)
    batch.run_process()
    (cropped_edge_image_id, cropped_edge_image) = batch.commit_output(0)
    cropped_edge_image = dbvalue(cropped_edge_image_id, cropped_edge_image)
    return cropped_edge_image
Example #38
0
def image_mean(img):
    bvxm_batch.init_process("vilImageMeanProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    mean_val = bvxm_batch.get_output_float(id)
    bvxm_batch.remove_data(id)
    return mean_val
Example #39
0
def create_ortho_camera(world, is_utm=False):
    batch.init_process("bvxmCreateOrthoCameraProcess")
    batch.set_input_from_db(0, world)
    batch.set_input_bool(1, is_utm)
    batch.run_process()
    (id, type) = batch.commit_output(0)
    ortho_cam = dbvalue(id, type)
    return ortho_cam
Example #40
0
def get_plane(img, plane_id):
    bvxm_batch.init_process("vilGetPlaneProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_unsigned(1, plane_id)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    img_plane = dbvalue(id, type)
    return img_plane
Example #41
0
def image_entropy(img, block_size=5):
    bvxm_batch.init_process("vilBlockEntropyProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_unsigned(1, block_size)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    entropy_img = dbvalue(id, type)
    return entropy_img
Example #42
0
def bvxm_detect_edges(cropped_image, edge_params_xml):
    batch.init_process("bvxmDetectEdgesProcess")
    batch.set_input_from_db(0, cropped_image)
    batch.set_params_process(edge_params_xml)
    batch.run_process()
    (cropped_edge_image_id, cropped_edge_image) = batch.commit_output(0)
    cropped_edge_image = dbvalue(cropped_edge_image_id, cropped_edge_image)
    return cropped_edge_image
Example #43
0
def img_sum(img, plane_index=0):
    bvxm_batch.init_process("vilImageSumProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_unsigned(1, plane_index)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    value = bvxm_batch.get_output_double(id)
    return value
Example #44
0
def convert_image(img, type="byte"):
    bvxm_batch.init_process("vilConvertPixelTypeProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_string(1, type)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    cimg = dbvalue(id, type)
    return cimg
Example #45
0
def median_filter(img, operator_half_size):
    bvxm_batch.init_process("vilMedianFilterProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_int(1, operator_half_size)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    img_out = dbvalue(id, type)
    return img_out
Example #46
0
def detect_shadow_rgb(img, threshold):
    bvxm_batch.init_process("vilShadowDetectionProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_float(1, threshold)
    bvxm_batch.run_process()
    (o_id, o_type) = bvxm_batch.commit_output(0)
    region_img = dbvalue(o_id, o_type)
    return region_img
Example #47
0
def combine_eo_ir(eo_img, ir_img):
    bvxm_batch.init_process("vilEOIRCombineProcess")
    bvxm_batch.set_input_from_db(0, eo_img)
    bvxm_batch.set_input_from_db(1, ir_img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    img_out = dbvalue(id, type)
    return img_out
Example #48
0
def undistort_image(img, param_file, iters) :
  bvxm_batch.init_process("vilUndistortImageProcess");
  bvxm_batch.set_input_from_db(0,img)
  bvxm_batch.set_input_string(1, param_file);
  bvxm_batch.set_input_int(2, iters);
  bvxm_batch.run_process();
  (o_id,o_type) = bvxm_batch.commit_output(0);
  out_img = dbvalue(o_id,o_type);
  return out_img;
Example #49
0
def binary_img_op(img1, img2, operation="sum"):
  bvxm_batch.init_process("vilBinaryImageOpProcess")
  bvxm_batch.set_input_from_db(0,img1)
  bvxm_batch.set_input_from_db(1,img2)
  bvxm_batch.set_input_string(2,operation)
  bvxm_batch.run_process()
  (id,type) = bvxm_batch.commit_output(0)
  out = dbvalue(id, type);
  return out
Example #50
0
def next_frame(rawStream):
    bvxm_batch.init_process("bilReadFrameProcess")
    bvxm_batch.set_input_from_db(0, rawStream)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    img = dbvalue(id, type)
    #(id, type) = bvxm_batch.commit_output(1);
    #time = bvxm_batch.get_output_unsigned(id);
    return img
Example #51
0
def undistort_image(img, param_file, iters):
    bvxm_batch.init_process("vilUndistortImageProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_string(1, param_file)
    bvxm_batch.set_input_int(2, iters)
    bvxm_batch.run_process()
    (o_id, o_type) = bvxm_batch.commit_output(0)
    out_img = dbvalue(o_id, o_type)
    return out_img
Example #52
0
def threshold_image(img, value, threshold_above=True):
    bvxm_batch.init_process("vilThresholdImageProcess")
    bvxm_batch.set_input_from_db(0,img)
    bvxm_batch.set_input_float(1,value)
    bvxm_batch.set_input_bool(2,threshold_above)
    bvxm_batch.run_process()
    (id,type) = bvxm_batch.commit_output(0)
    mask = dbvalue(id,type)
    return mask
Example #53
0
def mask_image_using_id(img, id_img, input_id):
  bvxm_batch.init_process("vilMaskImageUsingIDsProcess");
  bvxm_batch.set_input_from_db(0, img);
  bvxm_batch.set_input_from_db(1, id_img);
  bvxm_batch.set_input_unsigned(2, input_id);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  masked_img = dbvalue(id, type);
  return masked_img;
Example #54
0
def binary_img_op(img1, img2, operation="sum"):
    bvxm_batch.init_process("vilBinaryImageOpProcess")
    bvxm_batch.set_input_from_db(0, img1)
    bvxm_batch.set_input_from_db(1, img2)
    bvxm_batch.set_input_string(2, operation)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    out = dbvalue(id, type)
    return out
Example #55
0
def bvxm_truncate_image(img,min_value,max_value):
    bvxm_batch.init_process("vilTruncateImageProcess")
    bvxm_batch.set_input_from_db(0,img)
    bvxm_batch.set_input_float(1,min_value)
    bvxm_batch.set_input_float(2,max_value)
    bvxm_batch.run_process()
    (id,type) = bvxm_batch.commit_output(0)
    img_out = dbvalue(id,type)
    return img_out
Example #56
0
def combine_planes(img_red, img_green, img_blue):
    bvxm_batch.init_process("vilCombinePlanesProcess")
    bvxm_batch.set_input_from_db(0, img_red)
    bvxm_batch.set_input_from_db(1, img_green)
    bvxm_batch.set_input_from_db(2, img_blue)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    img_out = dbvalue(id, type)
    return img_out
Example #57
0
def mask_image_using_id(img, id_img, input_id):
    bvxm_batch.init_process("vilMaskImageUsingIDsProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_from_db(1, id_img)
    bvxm_batch.set_input_unsigned(2, input_id)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    masked_img = dbvalue(id, type)
    return masked_img
Example #58
0
def combine_planes(img_red, img_green, img_blue):
  bvxm_batch.init_process("vilCombinePlanesProcess");
  bvxm_batch.set_input_from_db(0, img_red);
  bvxm_batch.set_input_from_db(1, img_green);
  bvxm_batch.set_input_from_db(2, img_blue);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  img_out = dbvalue(id, type);
  return img_out;
Example #59
0
def arf_stream(file_path) :
  bvxm_batch.init_process("bilCreateArfImageIstreamProcess")
  bvxm_batch.set_input_string(0,file_path);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  stream = dbvalue(id, type);
  (id, type) = bvxm_batch.commit_output(1);
  numImgs = bvxm_batch.get_output_int(id);
  return stream, numImgs
Example #60
0
def next_frame(rawStream) :
  bvxm_batch.init_process("bilReadFrameProcess")
  bvxm_batch.set_input_from_db(0,rawStream);
  bvxm_batch.run_process();
  (id, type) = bvxm_batch.commit_output(0);
  img = dbvalue(id,type);
  #(id, type) = bvxm_batch.commit_output(1);
  #time = bvxm_batch.get_output_unsigned(id);
  return img