Example #1
0
def create_scene(scene_params_xml):
  bvxm_batch.init_process("bvxmCreateVoxelWorldProcess");
  bvxm_batch.set_params_process(scene_params_xml);  ## "./bvxmCreateVoxelWorldProcess.xml"
  bvxm_batch.run_process();
  (world_id, world_type) = bvxm_batch.commit_output(0);
  world = dbvalue(world_id, world_type);
  return world
Example #2
0
def update_edges(world, cropped_cam, cropped_edge_image, update_params_xml, scale=0):
  bvxm_batch.init_process("bvxmUpdateEdgesProcess");
  bvxm_batch.set_input_from_db(0,world);
  bvxm_batch.set_input_from_db(1,cropped_cam);
  bvxm_batch.set_input_from_db(2,cropped_edge_image);
  bvxm_batch.set_input_unsigned(3,0);
  bvxm_batch.set_params_process(update_params_xml); # "./bvxmUpdateEdgesProcess.xml");
  bvxm_batch.run_process();
Example #3
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
Example #4
0
def create_scene(scene_params_xml):
    bvxm_batch.init_process("bvxmCreateVoxelWorldProcess")
    bvxm_batch.set_params_process(scene_params_xml)
    ## "./bvxmCreateVoxelWorldProcess.xml"
    bvxm_batch.run_process()
    (world_id, world_type) = bvxm_batch.commit_output(0)
    world = dbvalue(world_id, world_type)
    return world
Example #5
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
Example #6
0
def create_scene(scene_params_xml):
  bvxm_batch.init_process("bvxmCreateVoxelWorldProcess");
  bvxm_batch.set_params_process(scene_params_xml);  ## "./bvxmCreateVoxelWorldProcess.xml"
  status = bvxm_batch.run_process();
  if status != 1:
      raise Exception('Error creating scene from ' + scene_params_xml)
  (world_id, world_type) = bvxm_batch.commit_output(0);
  world = dbvalue(world_id, world_type);
  return world
Example #7
0
def create_scene(scene_params_xml):
    bvxm_batch.init_process("bvxmCreateVoxelWorldProcess")
    bvxm_batch.set_params_process(scene_params_xml)
    ## "./bvxmCreateVoxelWorldProcess.xml"
    status = bvxm_batch.run_process()
    if status != 1:
        raise Exception('Error creating scene from ' + scene_params_xml)
    (world_id, world_type) = bvxm_batch.commit_output(0)
    world = dbvalue(world_id, world_type)
    return world
def update_edges(world,
                 cropped_cam,
                 cropped_edge_image,
                 update_params_xml,
                 scale=0):
    bvxm_batch.init_process("bvxmUpdateEdgesProcess")
    bvxm_batch.set_input_from_db(0, world)
    bvxm_batch.set_input_from_db(1, cropped_cam)
    bvxm_batch.set_input_from_db(2, cropped_edge_image)
    bvxm_batch.set_input_unsigned(3, 0)
    bvxm_batch.set_params_process(update_params_xml)
    # "./bvxmUpdateEdgesProcess.xml");
    bvxm_batch.run_process()
Example #9
0
def roi_init(image_filename, cam, world, roi_init_params_xml):
  bvxm_batch.init_process("bvxmRoiInitProcess");
  bvxm_batch.set_input_string(0,image_filename);
  bvxm_batch.set_input_from_db(1,cam);
  bvxm_batch.set_input_from_db(2,world);
  bvxm_batch.set_params_process(roi_init_params_xml);  ##"bvxmRoiInitProcess.xml");
  statuscode=bvxm_batch.run_process();
  if statuscode:
    (cropped_cam_id, cropped_cam_type) = bvxm_batch.commit_output(0);
    cropped_cam = dbvalue(cropped_cam_id, cropped_cam_type);
    (cropped_image_id, cropped_image_type) = bvxm_batch.commit_output(1);
    cropped_image=dbvalue(cropped_image_id, cropped_image_type);
    (uncertainty_id,uncertainty_type) = bvxm_batch.commit_output(2);
    uncertainty = dbvalue(uncertainty_id,uncertainty_type);
    return statuscode, cropped_cam, cropped_image, uncertainty
  else:
    return statuscode, dbvalue(0, ""), dbvalue(0, ""), dbvalue(0, "")
Example #10
0
def roi_init(image_filename, cam, world, roi_init_params_xml):
    bvxm_batch.init_process("bvxmRoiInitProcess")
    bvxm_batch.set_input_string(0, image_filename)
    bvxm_batch.set_input_from_db(1, cam)
    bvxm_batch.set_input_from_db(2, world)
    bvxm_batch.set_params_process(roi_init_params_xml)
    ##"bvxmRoiInitProcess.xml");
    statuscode = bvxm_batch.run_process()
    if statuscode:
        (cropped_cam_id, cropped_cam_type) = bvxm_batch.commit_output(0)
        cropped_cam = dbvalue(cropped_cam_id, cropped_cam_type)
        (cropped_image_id, cropped_image_type) = bvxm_batch.commit_output(1)
        cropped_image = dbvalue(cropped_image_id, cropped_image_type)
        (uncertainty_id, uncertainty_type) = bvxm_batch.commit_output(2)
        uncertainty = dbvalue(uncertainty_id, uncertainty_type)
        return statuscode, cropped_cam, cropped_image, uncertainty
    else:
        return statuscode, dbvalue(0, ""), dbvalue(0, ""), dbvalue(0, "")
Example #11
0
def roi_init(image_filename, cam, world, roi_init_params_xml, is_all_bits=False):
    bvxm_batch.init_process("bvxmRoiInitProcess")
    bvxm_batch.set_input_string(0, image_filename)
    bvxm_batch.set_input_from_db(1, cam)
    bvxm_batch.set_input_from_db(2, world)
    bvxm_batch.set_input_bool(3, is_all_bits)
    # "bvxmRoiInitProcess.xml")
    bvxm_batch.set_params_process(roi_init_params_xml)
    statuscode = bvxm_batch.run_process()
    if statuscode:
        (cropped_cam_id, cropped_cam_type) = bvxm_batch.commit_output(0)
        cropped_cam = dbvalue(cropped_cam_id, cropped_cam_type)
        (cropped_image_id, cropped_image_type) = bvxm_batch.commit_output(1)
        cropped_image = dbvalue(cropped_image_id, cropped_image_type)
        (uncertainty_id, uncertainty_type) = bvxm_batch.commit_output(2)
        uncertainty = dbvalue(uncertainty_id, uncertainty_type)
        return statuscode, cropped_cam, cropped_image, uncertainty
    else:
        return statuscode, dbvalue(0, ""), dbvalue(0, ""), dbvalue(0, "")