示例#1
0
def refine_time(scene, cpu_cache, change_prob_t, time):
    bstm_batch.init_process("bstmCppRefineTTProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cpu_cache);
    bstm_batch.set_input_float(2,change_prob_t);
    bstm_batch.set_input_float(3,time);
    bstm_batch.run_process();
示例#2
0
def change_btw_frames(scene, cpu_cache, time0, time1):
    bstm_batch.init_process("bstmCppChangeBtwFramesProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cpu_cache);
    bstm_batch.set_input_float(2,time0);
    bstm_batch.set_input_float(3,time1);
    bstm_batch.run_process();
示例#3
0
def merge(scene, cpu_cache, p_threshold, time):
    bstm_batch.init_process("bstmCppMergeTTProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cpu_cache)
    bstm_batch.set_input_float(2, p_threshold)
    bstm_batch.set_input_float(3, time)
    bstm_batch.run_process()
示例#4
0
def refine(scene, cpu_cache, p_threshold, time):
    bstm_batch.init_process("bstmCppRefineSpacetimeProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cpu_cache);
    bstm_batch.set_input_float(2,p_threshold);
    bstm_batch.set_input_float(3,time);
    bstm_batch.run_process();
示例#5
0
def change_btw_frames(scene, cpu_cache, time0, time1):
    bstm_batch.init_process("bstmCppChangeBtwFramesProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cpu_cache)
    bstm_batch.set_input_float(2, time0)
    bstm_batch.set_input_float(3, time1)
    bstm_batch.run_process()
示例#6
0
def refine(scene, cpu_cache, p_threshold, time):
    bstm_batch.init_process("bstmCppRefineSpacetimeProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cpu_cache)
    bstm_batch.set_input_float(2, p_threshold)
    bstm_batch.set_input_float(3, time)
    bstm_batch.run_process()
示例#7
0
def scale_and_offset_values(img, scale, offset):
    bstm_batch.init_process("vilScaleAndOffsetValuesProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_float(1, scale)
    bstm_batch.set_input_float(2, offset)
    bstm_batch.run_process()
    return
示例#8
0
def refine_time(scene, cpu_cache, change_prob_t, time):
    bstm_batch.init_process("bstmCppRefineTTProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cpu_cache)
    bstm_batch.set_input_float(2, change_prob_t)
    bstm_batch.set_input_float(3, time)
    bstm_batch.run_process()
示例#9
0
def scale_and_offset_values(img, scale, offset):
    bstm_batch.init_process("vilScaleAndOffsetValuesProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_float(1, scale)
    bstm_batch.set_input_float(2, offset)
    bstm_batch.run_process()
    return
示例#10
0
def render(scene,
           device,
           cache,
           cam,
           time=0,
           ni=1624,
           nj=1224,
           render_label=False):
    if cache.type == "bstm_cache_sptr":
        print "bstm_batch CPU render grey and vis not yet implemented"
        return
    elif cache.type == "bstm_opencl_cache_sptr" and device:
        bstm_batch.init_process("bstmOclRenderExpectedImageProcess")
        bstm_batch.set_input_from_db(0, device)
        bstm_batch.set_input_from_db(1, scene)
        bstm_batch.set_input_from_db(2, cache)
        bstm_batch.set_input_from_db(3, cam)
        bstm_batch.set_input_unsigned(4, ni)
        bstm_batch.set_input_unsigned(5, nj)
        bstm_batch.set_input_float(6, time)
        bstm_batch.set_input_bool(7, render_label)
        bstm_batch.run_process()
        (id, type) = bstm_batch.commit_output(0)
        exp_image = dbvalue(id, type)
        (id, type) = bstm_batch.commit_output(1)
        vis_image = dbvalue(id, type)
        return exp_image, vis_image
    else:
        print "ERROR: Cache type not recognized: ", cache.type
示例#11
0
def merge(scene, cpu_cache, p_threshold, time):
    bstm_batch.init_process("bstmCppMergeTTProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cpu_cache);
    bstm_batch.set_input_float(2,p_threshold);
    bstm_batch.set_input_float(3,time);
    bstm_batch.run_process();
示例#12
0
def close_image(img, disk_radius):
    bstm_batch.init_process("vilImageClosingDiskProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_float(1, disk_radius)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    cimg = dbvalue(id, type)
    return cimg
示例#13
0
def close_image(img, disk_radius):
    bstm_batch.init_process("vilImageClosingDiskProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_float(1, disk_radius)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    cimg = dbvalue(id, type)
    return cimg
示例#14
0
def threshold_image(img, value, threshold_above=True):
    bstm_batch.init_process("vilThresholdImageProcess")
    bstm_batch.set_input_from_db(0,img)
    bstm_batch.set_input_float(1,value)
    bstm_batch.set_input_bool(2,threshold_above)
    bstm_batch.run_process()
    (id,type) = bstm_batch.commit_output(0)
    mask = dbvalue(id,type)
    return mask
示例#15
0
def label_change(scene, device, cache, cam, change_img, change_t, label, time) :
    bstm_batch.init_process("bstmOclLabelRayProcess");
    bstm_batch.set_input_from_db(0,device);
    bstm_batch.set_input_from_db(1,scene);
    bstm_batch.set_input_from_db(2,cache);
    bstm_batch.set_input_from_db(3,cam);
    bstm_batch.set_input_from_db(4,change_img);
    bstm_batch.set_input_float(5, change_t);
    bstm_batch.set_input_float(6, time);
    bstm_batch.set_input_int(7, label);
    bstm_batch.run_process();
示例#16
0
def label_change(scene, device, cache, cam, change_img, change_t, label, time):
    bstm_batch.init_process("bstmOclLabelRayProcess")
    bstm_batch.set_input_from_db(0, device)
    bstm_batch.set_input_from_db(1, scene)
    bstm_batch.set_input_from_db(2, cache)
    bstm_batch.set_input_from_db(3, cam)
    bstm_batch.set_input_from_db(4, change_img)
    bstm_batch.set_input_float(5, change_t)
    bstm_batch.set_input_float(6, time)
    bstm_batch.set_input_int(7, label)
    bstm_batch.run_process()
示例#17
0
def update_color(scene, device, cache, cam, img, time, mog_var = -1, mask_img = None, update_alpha = True):
    bstm_batch.init_process("bstmOclUpdateColorProcess");
    bstm_batch.set_input_from_db(0,device);
    bstm_batch.set_input_from_db(1,scene);
    bstm_batch.set_input_from_db(2,cache);
    bstm_batch.set_input_from_db(3,cam);
    bstm_batch.set_input_from_db(4,img);
    bstm_batch.set_input_float(5,time);
    bstm_batch.set_input_float(6,mog_var);
    bstm_batch.set_input_from_db(7,mask_img);
    bstm_batch.set_input_bool(8,update_alpha);
    bstm_batch.run_process();
示例#18
0
def update_change(scene, device, cache, cam, img, time, mask_img=None):
    bstm_batch.init_process("bstmOclUpdateChangeProcess")
    bstm_batch.set_input_from_db(0, device)
    bstm_batch.set_input_from_db(1, scene)
    bstm_batch.set_input_from_db(2, cache)
    bstm_batch.set_input_from_db(3, cam)
    bstm_batch.set_input_from_db(4, img)
    bstm_batch.set_input_from_db(5, mask_img)
    bstm_batch.set_input_float(6, time)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    cd_img = dbvalue(id, type)
    return cd_img
示例#19
0
def update_change(scene, device, cache, cam, img, time, mask_img = None):
    bstm_batch.init_process("bstmOclUpdateChangeProcess");
    bstm_batch.set_input_from_db(0,device);
    bstm_batch.set_input_from_db(1,scene);
    bstm_batch.set_input_from_db(2,cache);
    bstm_batch.set_input_from_db(3,cam);
    bstm_batch.set_input_from_db(4,img);
    bstm_batch.set_input_from_db(5,mask_img);
    bstm_batch.set_input_float(6,time);
    bstm_batch.run_process();
    (id,type) = bstm_batch.commit_output(0);
    cd_img = dbvalue(id,type);
    return cd_img;
示例#20
0
def update(scene, device, cache, cam, img, time, mog_var=-1, mask_img=None, update_alpha=True, update_changes_only=False):
    bstm_batch.init_process("bstmOclUpdateProcess")
    bstm_batch.set_input_from_db(0, device)
    bstm_batch.set_input_from_db(1, scene)
    bstm_batch.set_input_from_db(2, cache)
    bstm_batch.set_input_from_db(3, cam)
    bstm_batch.set_input_from_db(4, img)
    bstm_batch.set_input_float(5, time)
    bstm_batch.set_input_float(6, mog_var)
    bstm_batch.set_input_from_db(7, mask_img)
    bstm_batch.set_input_bool(8, update_alpha)
    bstm_batch.set_input_bool(9, update_changes_only)

    bstm_batch.run_process()
示例#21
0
def change_detect(scene, device, cache, cam, img, time, mask_img=None, raybelief="", max_mode=False) :
    bstm_batch.init_process("bstmOclChangeDetectionProcess");
    bstm_batch.set_input_from_db(0,device);
    bstm_batch.set_input_from_db(1,scene);
    bstm_batch.set_input_from_db(2,cache);
    bstm_batch.set_input_from_db(3,cam);
    bstm_batch.set_input_from_db(4,img);
    bstm_batch.set_input_from_db(5,mask_img);
    bstm_batch.set_input_string(6, raybelief);
    bstm_batch.set_input_bool(7, max_mode);
    bstm_batch.set_input_float(8, time);

    bstm_batch.run_process();
    (id,type) = bstm_batch.commit_output(0);
    cd_img = dbvalue(id,type);
    return cd_img;
示例#22
0
def change_detect(scene, device, cache, cam, img, time, mask_img=None, raybelief="", max_mode=False):
    bstm_batch.init_process("bstmOclChangeDetectionProcess")
    bstm_batch.set_input_from_db(0, device)
    bstm_batch.set_input_from_db(1, scene)
    bstm_batch.set_input_from_db(2, cache)
    bstm_batch.set_input_from_db(3, cam)
    bstm_batch.set_input_from_db(4, img)
    bstm_batch.set_input_from_db(5, mask_img)
    bstm_batch.set_input_string(6, raybelief)
    bstm_batch.set_input_bool(7, max_mode)
    bstm_batch.set_input_float(8, time)

    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    cd_img = dbvalue(id, type)
    return cd_img
示例#23
0
def render_change(scene, device, cache, cam, time=0, ni=1624, nj=1224):
    if cache.type == "bstm_cache_sptr":
        print "bstm_batch CPU render grey and vis not yet implemented"
        return
    elif cache.type == "bstm_opencl_cache_sptr" and device:
        bstm_batch.init_process("bstmOclRenderExpectedChangeProcess")
        bstm_batch.set_input_from_db(0, device)
        bstm_batch.set_input_from_db(1, scene)
        bstm_batch.set_input_from_db(2, cache)
        bstm_batch.set_input_from_db(3, cam)
        bstm_batch.set_input_unsigned(4, ni)
        bstm_batch.set_input_unsigned(5, nj)
        bstm_batch.set_input_float(6, time)
        bstm_batch.run_process()
        (id, type) = bstm_batch.commit_output(0)
        exp_image = dbvalue(id, type)
        return exp_image
    else:
        print "ERROR: Cache type not recognized: ", cache.type
示例#24
0
def render_change(scene, device, cache, cam, time=0, ni=1624, nj=1224) :
  if cache.type == "bstm_cache_sptr" :
    print "bstm_batch CPU render grey and vis not yet implemented";
    return;
  elif cache.type == "bstm_opencl_cache_sptr" and device :
    bstm_batch.init_process("bstmOclRenderExpectedChangeProcess");
    bstm_batch.set_input_from_db(0,device);
    bstm_batch.set_input_from_db(1,scene);
    bstm_batch.set_input_from_db(2,cache);
    bstm_batch.set_input_from_db(3,cam);
    bstm_batch.set_input_unsigned(4,ni);
    bstm_batch.set_input_unsigned(5,nj);
    bstm_batch.set_input_float(6, time );
    bstm_batch.run_process();
    (id,type) = bstm_batch.commit_output(0);
    exp_image = dbvalue(id,type);
    return exp_image;
  else :
    print "ERROR: Cache type not recognized: ", cache.type;
示例#25
0
def render(scene, device, cache, cam, time=0, ni=1624, nj=1224, render_label=False) :
  if cache.type == "bstm_cache_sptr" :
    print "bstm_batch CPU render grey and vis not yet implemented";
    return;
  elif cache.type == "bstm_opencl_cache_sptr" and device :
    bstm_batch.init_process("bstmOclRenderExpectedImageProcess");
    bstm_batch.set_input_from_db(0,device);
    bstm_batch.set_input_from_db(1,scene);
    bstm_batch.set_input_from_db(2,cache);
    bstm_batch.set_input_from_db(3,cam);
    bstm_batch.set_input_unsigned(4,ni);
    bstm_batch.set_input_unsigned(5,nj);
    bstm_batch.set_input_float(6,time);
    bstm_batch.set_input_bool(7,render_label);
    bstm_batch.run_process();
    (id,type) = bstm_batch.commit_output(0);
    exp_image = dbvalue(id,type);
    (id,type) = bstm_batch.commit_output(1);
    vis_image = dbvalue(id,type);
    return exp_image,vis_image;
  else :
    print "ERROR: Cache type not recognized: ", cache.type;
示例#26
0
def update(scene,
           device,
           cache,
           cam,
           img,
           time,
           mog_var=-1,
           mask_img=None,
           update_alpha=True,
           update_changes_only=False):
    bstm_batch.init_process("bstmOclUpdateProcess")
    bstm_batch.set_input_from_db(0, device)
    bstm_batch.set_input_from_db(1, scene)
    bstm_batch.set_input_from_db(2, cache)
    bstm_batch.set_input_from_db(3, cam)
    bstm_batch.set_input_from_db(4, img)
    bstm_batch.set_input_float(5, time)
    bstm_batch.set_input_float(6, mog_var)
    bstm_batch.set_input_from_db(7, mask_img)
    bstm_batch.set_input_bool(8, update_alpha)
    bstm_batch.set_input_bool(9, update_changes_only)

    bstm_batch.run_process()
示例#27
0
def project_point(camera, x, y, z):
    bstm_batch.init_process('vpglProjectProcess')
    bstm_batch.set_input_from_db(0, camera)
    bstm_batch.set_input_float(1, x)
    bstm_batch.set_input_float(2, y)
    bstm_batch.set_input_float(3, z)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    u = bstm_batch.get_output_float(id)
    (id, type) = bstm_batch.commit_output(1)
    v = bstm_batch.get_output_float(id)
    return (u, v)
示例#28
0
def export_pt_cloud(scene, cache, output_filename, prob_t, time, output_aux=True):
    bstm_batch.init_process("bstmCppExtractPointCloudProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cache)
    bstm_batch.set_input_float(2, prob_t)
    bstm_batch.set_input_float(3, time)
    bstm_batch.run_process()

    bstm_batch.init_process("bstmCppExportPointCloudProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cache)
    bstm_batch.set_input_string(2, output_filename)
    bstm_batch.set_input_bool(3, output_aux)
    bstm_batch.set_input_float(4, time)

    bstm_batch.run_process()
    return
示例#29
0
def export_pt_cloud(scene, cache, output_filename, prob_t, time, output_aux=True):
    bstm_batch.init_process("bstmCppExtractPointCloudProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cache);
    bstm_batch.set_input_float(2, prob_t);
    bstm_batch.set_input_float(3, time);
    bstm_batch.run_process();

    bstm_batch.init_process("bstmCppExportPointCloudProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cache);
    bstm_batch.set_input_string(2, output_filename);
    bstm_batch.set_input_bool(3, output_aux);
    bstm_batch.set_input_float(4, time);

    bstm_batch.run_process();
    return;
示例#30
0
def filter_changes(scene, cpu_cache, time):
    bstm_batch.init_process("bstmCppMajorityFilterProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cpu_cache);
    bstm_batch.set_input_float(2,time);
    bstm_batch.run_process();
示例#31
0
def copy_data_to_future(scene, cpu_cache, time):
    bstm_batch.init_process("bstmCppCopyDataToFutureProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cpu_cache)
    bstm_batch.set_input_float(2, time)
    bstm_batch.run_process()
示例#32
0
def filter_changes(scene, cpu_cache, time):
    bstm_batch.init_process("bstmCppMajorityFilterProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cpu_cache)
    bstm_batch.set_input_float(2, time)
    bstm_batch.run_process()
示例#33
0
def copy_data_to_future(scene, cpu_cache, time):
    bstm_batch.init_process("bstmCppCopyDataToFutureProcess");
    bstm_batch.set_input_from_db(0,scene);
    bstm_batch.set_input_from_db(1,cpu_cache);
    bstm_batch.set_input_float(2,time);
    bstm_batch.run_process();