示例#1
0
    boxm_batch.init_process("vilImageSizeProcess")
    boxm_batch.set_input_from_db(0, image)
    boxm_batch.run_process()
    (ni_id, type) = boxm_batch.commit_output(0)
    (nj_id, type) = boxm_batch.commit_output(1)
    ni = boxm_batch.get_input_unsigned(ni_id)
    nj = boxm_batch.get_input_unsigned(nj_id)
    if ni > nj:
        sizes.append(ni)
    else:
        sizes.append(nj)

# set up the connectivity table to be used for computing tracks from the
# matches
boxm_batch.init_process("baplCreateConnTableProcess")
boxm_batch.set_input_int(0, img_cnt)
boxm_batch.run_process()
(id, type) = boxm_batch.commit_output(0)
conn_table = dbvalue(id, type)

key_sets = []
for i in range(0, img_cnt, 1):

    if keys_available:
        # warning: remove this option
        boxm_batch.init_process("baplLoadKeypointsProcess")
        boxm_batch.set_input_string(0, output_path + out_key_name % i)
        boxm_batch.run_process()
        (id, type) = boxm_batch.commit_output(0)
        out_set = dbvalue(id, type)
        key_sets.append(out_set)
model_dir ="/Users/isa/Experiments/CapitolBOXM_6_4_4";
output_path = "/Users/isa/Experiments/tests/ocl_scene";
if not os.path.isdir( output_path + "/"):
  os.mkdir( output_path + "/");

max_mb = -1;


print("Creating a Scene");
boxm_batch.init_process("boxmCreateSceneProcess");
boxm_batch.set_input_string(0, model_dir + "/capitol_scene.xml");
boxm_batch.run_process();
(scene_id, scene_type) = boxm_batch.commit_output(0);
scene = dbvalue(scene_id, scene_type);

print("Convert Scene");
boxm_batch.init_process("boxmOclConvertBoxmToOclProcess");
boxm_batch.set_input_from_db(0, scene);
boxm_batch.set_input_string(1, output_path);
boxm_batch.set_input_int(2, -1);
boxm_batch.set_input_bool(3, 0);
boxm_batch.run_process();


# print("Refine Scene");
# boxm_batch.init_process("boxmOclRefineProcess");
# boxm_batch.set_input_string(0, "F:/APl/try4ocl/scene.xml");
# boxm_batch.set_input_float(1, prob_thresh);
# boxm_batch.run_process();

示例#3
0
    boxm_batch.init_process("vilImageSizeProcess")
    boxm_batch.set_input_from_db(0, image)
    boxm_batch.run_process()
    (ni_id, type) = boxm_batch.commit_output(0)
    (nj_id, type) = boxm_batch.commit_output(1)
    ni = boxm_batch.get_input_unsigned(ni_id)
    nj = boxm_batch.get_input_unsigned(nj_id)
    if ni > nj:
        sizes.append(ni)
    else:
        sizes.append(nj)

# set up the connectivity table to be used for computing tracks from the
# matches
boxm_batch.init_process("baplCreateConnTableProcess")
boxm_batch.set_input_int(0, img_cnt)
boxm_batch.run_process()
(id, type) = boxm_batch.commit_output(0)
conn_table = dbvalue(id, type)

key_sets = []
for i in range(0, img_cnt, 1):

    if keys_available:
        # warning: remove this option
        boxm_batch.init_process("baplLoadKeypointsProcess")
        boxm_batch.set_input_string(0, output_path + out_key_name % i)
        boxm_batch.run_process()
        (id, type) = boxm_batch.commit_output(0)
        out_set = dbvalue(id, type)
        key_sets.append(out_set)
  boxm_batch.set_input_from_db(0, image);
  boxm_batch.run_process();
  (ni_id, type) = boxm_batch.commit_output(0);
  (nj_id, type) = boxm_batch.commit_output(1);
  ni=boxm_batch.get_input_unsigned(ni_id);
  nj=boxm_batch.get_input_unsigned(nj_id);
  if ni > nj:
    sizes.append(ni);
  else:
    sizes.append(nj);

  boxm_batch.remove_data(image.id);
    
# set up the connectivity table to be used for computing tracks from the matches
boxm_batch.init_process("baplCreateConnTableProcess");
boxm_batch.set_input_int(0, img_cnt);
boxm_batch.run_process();
(id,type) = boxm_batch.commit_output(0);
conn_table = dbvalue(id,type);

for i in range(0,img_cnt,1):
  print("Loading Image");
  boxm_batch.init_process("vilLoadImageViewProcess");
  boxm_batch.set_input_string(0,img_path + img_name % (i*every_nth+1));
  boxm_batch.run_process();
  (id,type) = boxm_batch.commit_output(0);
  image = dbvalue(id,type);

  if keypoints_available:
    boxm_batch.init_process("baplLoadKeypointsProcess");
    boxm_batch.set_input_string(0,output_path + out_key_name % (i*every_nth+1));