Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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()
Beispiel #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
Beispiel #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
Beispiel #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;
Beispiel #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
Beispiel #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
Beispiel #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;
Beispiel #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
Beispiel #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;
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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;
Beispiel #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
Beispiel #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;
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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;
Beispiel #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;
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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;
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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;