Example #1
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 #2
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 #3
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 #4
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 #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 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 #7
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 #8
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 #9
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 #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 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 #12
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 #13
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 #14
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 #15
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 #16
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 #17
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 #18
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 #19
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 #20
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 #21
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 #22
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 #23
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 #24
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 #25
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 #26
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 #27
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 #28
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 #29
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 #30
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 #31
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 #32
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 #33
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 #34
0
def image_size(img):
    bvxm_batch.init_process('vilImageSizeProcess')
    bvxm_batch.set_input_from_db(0,img)
    bvxm_batch.run_process()
    (id,type) = bvxm_batch.commit_output(0)
    ni = bvxm_batch.get_output_unsigned(id)
    (id,type) = bvxm_batch.commit_output(1)
    nj = bvxm_batch.get_output_unsigned(id)
    return ni,nj
Example #35
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 #36
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 #37
0
def gradient_angle(Ix, Iy):
    bvxm_batch.init_process('vilGradientAngleProcess')
    bvxm_batch.set_input_from_db(0, Ix)
    bvxm_batch.set_input_from_db(1, Iy)
    bvxm_batch.run_process()
    #x image
    (id, type) = bvxm_batch.commit_output(0)
    angleImg = dbvalue(id, type)
    return angleImg
Example #38
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 #39
0
def pixel(img, point):
    bvxm_batch.init_process("vilPixelValueProcess")
    bvxm_batch.set_input_from_db(0,img)
    bvxm_batch.set_input_int(1, int(point[0]))
    bvxm_batch.set_input_int(2, int(point[1]))
    bvxm_batch.run_process()
    (id,type) = bvxm_batch.commit_output(0)
    val = bvxm_batch.get_output_float(id)
    return val
Example #40
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 #41
0
def image_range(img):
    bvxm_batch.init_process('vilImageRangeProcess')
    bvxm_batch.set_input_from_db(0,img)
    bvxm_batch.run_process()
    (id,type) = bvxm_batch.commit_output(0)
    minVal = bvxm_batch.get_output_float(id)
    (id,type) = bvxm_batch.commit_output(1)
    maxVal = bvxm_batch.get_output_float(id)
    return minVal, maxVal
Example #42
0
def gradient_angle(Ix, Iy) :
    bvxm_batch.init_process('vilGradientAngleProcess')
    bvxm_batch.set_input_from_db(0,Ix)
    bvxm_batch.set_input_from_db(1,Iy)
    bvxm_batch.run_process()
    #x image
    (id,type) = bvxm_batch.commit_output(0)
    angleImg = dbvalue(id,type)
    return angleImg
Example #43
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 #44
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 #45
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 #46
0
def image_entropy(img, block_size=5, bins=16):
    bvxm_batch.init_process("vilBlockEntropyProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_unsigned(1, block_size)
    bvxm_batch.set_input_unsigned(2, bins)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    entropy_img = dbvalue(id, type)
    return entropy_img
Example #47
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 #48
0
def pixel(img, point):
    bvxm_batch.init_process("vilPixelValueProcess")
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.set_input_int(1, int(point[0]))
    bvxm_batch.set_input_int(2, int(point[1]))
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    val = bvxm_batch.get_output_float(id)
    return val
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 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 #51
0
def image_size(img):
    bvxm_batch.init_process('vilImageSizeProcess')
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    ni = bvxm_batch.get_output_unsigned(id)
    (id, type) = bvxm_batch.commit_output(1)
    nj = bvxm_batch.get_output_unsigned(id)
    return ni, nj
Example #52
0
def image_range(img):
    bvxm_batch.init_process('vilImageRangeProcess')
    bvxm_batch.set_input_from_db(0, img)
    bvxm_batch.run_process()
    (id, type) = bvxm_batch.commit_output(0)
    minVal = bvxm_batch.get_output_float(id)
    (id, type) = bvxm_batch.commit_output(1)
    maxVal = bvxm_batch.get_output_float(id)
    return minVal, maxVal
Example #53
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;