コード例 #1
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
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()
コード例 #2
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
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();
コード例 #3
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
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();
コード例 #4
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
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()
コード例 #5
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
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();
コード例 #6
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
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
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def rgb2gray(img):
    bstm_batch.init_process("vilRGBToGreyProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    outimg = dbvalue(id, type)
    return outimg
コード例 #8
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
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
コード例 #9
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def rgb2gray(img):
    bstm_batch.init_process("vilRGBToGreyProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    outimg = dbvalue(id, type)
    return outimg
コード例 #10
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
def trajectory_next(trajectory):
    bstm_batch.init_process("bstmViewTrajectoryNextProcess")
    bstm_batch.set_input_from_db(0, trajectory)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    cam = dbvalue(id, type)
    return cam
コード例 #11
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
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();
コード例 #12
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
def trajectory_next(trajectory) :
  bstm_batch.init_process("bstmViewTrajectoryNextProcess");
  bstm_batch.set_input_from_db(0, trajectory);
  bstm_batch.run_process();
  (id,type) = bstm_batch.commit_output(0);
  cam = dbvalue(id,type);
  return cam;
コード例 #13
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
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
コード例 #14
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
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()
コード例 #15
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def img_sum(img, plane_index=0):
    bstm_batch.init_process("vilImageSumProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_unsigned(1, plane_index)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    value = bstm_batch.get_output_double(id)
    return value
コード例 #16
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def convert_image(img, type="byte"):
    bstm_batch.init_process("vilConvertPixelTypeProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_string(1, type)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    cimg = dbvalue(id, type)
    return cimg
コード例 #17
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
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
コード例 #18
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def image_mean(img):
    bstm_batch.init_process("vilImageMeanProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    mean_val = bstm_batch.get_output_float(id)
    bstm_batch.remove_data(id)
    return mean_val
コード例 #19
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def image_mean(img):
    bstm_batch.init_process("vilImageMeanProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    mean_val = bstm_batch.get_output_float(id)
    bstm_batch.remove_data(id)
    return mean_val
コード例 #20
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
def trajectory_size(trajectory):
    bstm_batch.init_process("bstmViewTrajectorySizeProcess")
    bstm_batch.set_input_from_db(0, trajectory)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    size = bstm_batch.get_output_unsigned(id)
    bstm_batch.remove_data(id)
    return size
コード例 #21
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
def write_cache(cache, do_clear=0):
    if cache.type == "bstm_cache_sptr":
        bstm_batch.init_process("bstmWriteCacheProcess")
        bstm_batch.set_input_from_db(0, cache)
        bstm_batch.set_input_bool(1, do_clear)
        bstm_batch.run_process()
    else:
        print "ERROR: Cache type needs to be bstm_cache_sptr, not ", cache.type
コード例 #22
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
def write_cache(cache, do_clear = 0) :
  if cache.type == "bstm_cache_sptr" :
    bstm_batch.init_process("bstmWriteCacheProcess");
    bstm_batch.set_input_from_db(0,cache);
    bstm_batch.set_input_bool(1,do_clear);
    bstm_batch.run_process();
  else :
    print "ERROR: Cache type needs to be bstm_cache_sptr, not ", cache.type;
コード例 #23
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
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
コード例 #24
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def convert_image(img, type="byte"):
    bstm_batch.init_process("vilConvertPixelTypeProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_string(1, type)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    cimg = dbvalue(id, type)
    return cimg
コード例 #25
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def img_sum(img, plane_index=0):
    bstm_batch.init_process("vilImageSumProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_unsigned(1, plane_index)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    value = bstm_batch.get_output_double(id)
    return value
コード例 #26
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
def trajectory_size(trajectory):
  bstm_batch.init_process("bstmViewTrajectorySizeProcess")
  bstm_batch.set_input_from_db(0, trajectory)
  bstm_batch.run_process()
  (id,type) = bstm_batch.commit_output(0)
  size = bstm_batch.get_output_unsigned(id)
  bstm_batch.remove_data(id)
  return size
コード例 #27
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def binary_img_op(img1, img2, operation="sum"):
    bstm_batch.init_process("vilBinaryImageOpProcess")
    bstm_batch.set_input_from_db(0, img1)
    bstm_batch.set_input_from_db(1, img2)
    bstm_batch.set_input_string(2, operation)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    out = dbvalue(id, type)
    return out
コード例 #28
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def pixel(img, point):
    bstm_batch.init_process("vilPixelValueProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_int(1, int(point[0]))
    bstm_batch.set_input_int(2, int(point[1]))
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    val = bstm_batch.get_output_float(id)
    return val
コード例 #29
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def image_range(img):
    bstm_batch.init_process("vilImageRangeProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    minVal = bstm_batch.get_output_float(id)
    (id, type) = bstm_batch.commit_output(1)
    maxVal = bstm_batch.get_output_float(id)
    return minVal, maxVal
コード例 #30
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def pixel(img, point):
    bstm_batch.init_process("vilPixelValueProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_int(1, int(point[0]))
    bstm_batch.set_input_int(2, int(point[1]))
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    val = bstm_batch.get_output_float(id)
    return val
コード例 #31
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def binary_img_op(img1, img2, operation="sum"):
    bstm_batch.init_process("vilBinaryImageOpProcess")
    bstm_batch.set_input_from_db(0, img1)
    bstm_batch.set_input_from_db(1, img2)
    bstm_batch.set_input_string(2, operation)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    out = dbvalue(id, type)
    return out
コード例 #32
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def image_size(img):
    bstm_batch.init_process("vilImageSizeProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    ni = bstm_batch.get_output_unsigned(id)
    (id, type) = bstm_batch.commit_output(1)
    nj = bstm_batch.get_output_unsigned(id)
    return ni, nj
コード例 #33
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def image_size(img):
    bstm_batch.init_process('vilImageSizeProcess')
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    ni = bstm_batch.get_output_unsigned(id)
    (id, type) = bstm_batch.commit_output(1)
    nj = bstm_batch.get_output_unsigned(id)
    return ni, nj
コード例 #34
0
ファイル: bstm_vil_adaptor.py プロジェクト: spendres/vxl
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
コード例 #35
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def gradient_angle(Ix, Iy):
    bstm_batch.init_process("vilGradientAngleProcess")
    bstm_batch.set_input_from_db(0, Ix)
    bstm_batch.set_input_from_db(1, Iy)
    bstm_batch.run_process()
    # x image
    (id, type) = bstm_batch.commit_output(0)
    angleImg = dbvalue(id, type)
    return angleImg
コード例 #36
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def gradient_angle(Ix, Iy):
    bstm_batch.init_process('vilGradientAngleProcess')
    bstm_batch.set_input_from_db(0, Ix)
    bstm_batch.set_input_from_db(1, Iy)
    bstm_batch.run_process()
    # x image
    (id, type) = bstm_batch.commit_output(0)
    angleImg = dbvalue(id, type)
    return angleImg
コード例 #37
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def image_range(img):
    bstm_batch.init_process('vilImageRangeProcess')
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    minVal = bstm_batch.get_output_float(id)
    (id, type) = bstm_batch.commit_output(1)
    maxVal = bstm_batch.get_output_float(id)
    return minVal, maxVal
コード例 #38
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def resize(img, ni, nj, pixel="float"):
    bstm_batch.init_process("vilResampleProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_int(1, ni)
    bstm_batch.set_input_int(2, nj)
    bstm_batch.set_input_string(3, pixel)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    img = dbvalue(id, type)
    return img
コード例 #39
0
def convert_to_generic_camera(cam_in, ni, nj, level=0):
    bstm_batch.init_process('vpglConvertToGenericCameraProcess')
    bstm_batch.set_input_from_db(0, cam_in)
    bstm_batch.set_input_unsigned(1, ni)
    bstm_batch.set_input_unsigned(2, nj)
    bstm_batch.set_input_unsigned(3, level)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    generic_cam = dbvalue(id, type)
    return generic_cam
コード例 #40
0
def persp2gen(pcam, ni, nj, level=0):
    bstm_batch.init_process("vpglConvertToGenericCameraProcess")
    bstm_batch.set_input_from_db(0, pcam)
    bstm_batch.set_input_unsigned(1, ni)
    bstm_batch.set_input_unsigned(2, nj)
    bstm_batch.set_input_unsigned(3, level)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    gcam = dbvalue(id, type)
    return gcam
コード例 #41
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def resize(img, ni, nj, pixel="float"):
    bstm_batch.init_process("vilResampleProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_int(1, ni)
    bstm_batch.set_input_int(2, nj)
    bstm_batch.set_input_string(3, pixel)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    img = dbvalue(id, type)
    return img
コード例 #42
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
def clear_cache(cache):
    if cache.type == "bstm_cache_sptr":
        bstm_batch.init_process("bstmClearCacheProcess")
        bstm_batch.set_input_from_db(0, cache)
        bstm_batch.run_process()
    elif cache.type == "bstm_opencl_cache_sptr":
        bstm_batch.init_process("bstmOclClearCacheProcess")
        bstm_batch.set_input_from_db(0, cache)
        bstm_batch.run_process()
    else:
        print "ERROR: Cache type needs to be bstm_cache_sptr, not ", cache.type
コード例 #43
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
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();
コード例 #44
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
def ocl_info():
    #print("Init Manager");
    bstm_batch.init_process("boclInitManagerProcess")
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    mgr = dbvalue(id, type)

    print("Get OCL info")
    bstm_batch.init_process("bocl_info_process")
    bstm_batch.set_input_from_db(0, mgr)
    bstm_batch.run_process()
コード例 #45
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
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()
コード例 #46
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def crop_image(img, i0, j0, ni, nj):
    bstm_batch.init_process("vilCropImageProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_unsigned(1, i0)
    bstm_batch.set_input_unsigned(2, j0)
    bstm_batch.set_input_unsigned(3, ni)
    bstm_batch.set_input_unsigned(4, nj)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    img_out = dbvalue(id, type)
    return img_out
コード例 #47
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def crop_image(img, i0, j0, ni, nj):
    bstm_batch.init_process("vilCropImageProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.set_input_unsigned(1, i0)
    bstm_batch.set_input_unsigned(2, j0)
    bstm_batch.set_input_unsigned(3, ni)
    bstm_batch.set_input_unsigned(4, nj)
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    img_out = dbvalue(id, type)
    return img_out
コード例 #48
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
def ocl_info():
  #print("Init Manager");
  bstm_batch.init_process("boclInitManagerProcess");
  bstm_batch.run_process();
  (id, type) = bstm_batch.commit_output(0);
  mgr = dbvalue(id, type);

  print("Get OCL info");
  bstm_batch.init_process("bocl_info_process");
  bstm_batch.set_input_from_db(0,mgr)
  bstm_batch.run_process();
コード例 #49
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
def clear_cache(cache) :
  if cache.type == "bstm_cache_sptr" :
    bstm_batch.init_process("bstmClearCacheProcess");
    bstm_batch.set_input_from_db(0,cache);
    bstm_batch.run_process();
  elif cache.type == "bstm_opencl_cache_sptr" :
    bstm_batch.init_process("bstmOclClearCacheProcess");
    bstm_batch.set_input_from_db(0,cache);
    bstm_batch.run_process();
  else :
    print "ERROR: Cache type needs to be bstm_cache_sptr, not ", cache.type;
コード例 #50
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
def scene_statistics(scene, cache):
    bstm_batch.init_process("bstmSceneStatisticsProcess");
    bstm_batch.set_input_from_db(0, scene );
    bstm_batch.set_input_from_db(1, cache );
    bstm_batch.run_process();
    (s1_id, s1_type) = bstm_batch.commit_output(0);
    (s2_id, s2_type) = bstm_batch.commit_output(1);
    (s3_id, s3_type) = bstm_batch.commit_output(2);
    s1 = bstm_batch.get_output_float(s1_id);
    s2 = bstm_batch.get_output_float(s2_id);
    s3 = bstm_batch.get_output_unsigned(s3_id);
    return [s1,s2,s3]
コード例 #51
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)
コード例 #52
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
def init_trajectory(scene, startInc, endInc, radius, ni=1280, nj=720):
    bstm_batch.init_process("bstmViewInitTrajectoryProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_double(1, float(startInc))  # incline0
    bstm_batch.set_input_double(2, float(endInc))  # incline1
    bstm_batch.set_input_double(3, float(radius))  # radius
    bstm_batch.set_input_unsigned(4, ni)  # ni
    bstm_batch.set_input_unsigned(5, nj)  # nj
    bstm_batch.run_process()
    (id, type) = bstm_batch.commit_output(0)
    trajectory = dbvalue(id, type)
    return trajectory
コード例 #53
0
ファイル: bstm_adaptor.py プロジェクト: Skylion007/vxl
def scene_statistics(scene, cache):
    bstm_batch.init_process("bstmSceneStatisticsProcess")
    bstm_batch.set_input_from_db(0, scene)
    bstm_batch.set_input_from_db(1, cache)
    bstm_batch.run_process()
    (s1_id, s1_type) = bstm_batch.commit_output(0)
    (s2_id, s2_type) = bstm_batch.commit_output(1)
    (s3_id, s3_type) = bstm_batch.commit_output(2)
    s1 = bstm_batch.get_output_float(s1_id)
    s2 = bstm_batch.get_output_float(s2_id)
    s3 = bstm_batch.get_output_unsigned(s3_id)
    return [s1, s2, s3]
コード例 #54
0
ファイル: bstm_adaptor.py プロジェクト: marcge/vxl
def init_trajectory(scene, startInc, endInc, radius, ni=1280, nj=720) :
  bstm_batch.init_process("bstmViewInitTrajectoryProcess");
  bstm_batch.set_input_from_db(0, scene);
  bstm_batch.set_input_double(1, float(startInc) );  #incline0
  bstm_batch.set_input_double(2, float(endInc) ); #incline1
  bstm_batch.set_input_double(3, float(radius) ); #radius
  bstm_batch.set_input_unsigned(4, ni); #ni
  bstm_batch.set_input_unsigned(5, nj); #nj
  bstm_batch.run_process();
  (id,type) = bstm_batch.commit_output(0);
  trajectory = dbvalue(id,type);
  return trajectory;
コード例 #55
0
ファイル: bstm_vil_adaptor.py プロジェクト: rfabbri/vpe
def gradient(img):
    bstm_batch.init_process('vilGradientProcess')
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    # x image
    (id, type) = bstm_batch.commit_output(0)
    dIdx = dbvalue(id, type)
    # y image
    (id, type) = bstm_batch.commit_output(1)
    dIdy = dbvalue(id, type)
    # mag image
    (id, type) = bstm_batch.commit_output(2)
    magImg = dbvalue(id, type)
    return dIdx, dIdy, magImg
コード例 #56
0
ファイル: bstm_vil_adaptor.py プロジェクト: jhoare/vxl
def gradient(img):
    bstm_batch.init_process("vilGradientProcess")
    bstm_batch.set_input_from_db(0, img)
    bstm_batch.run_process()
    # x image
    (id, type) = bstm_batch.commit_output(0)
    dIdx = dbvalue(id, type)
    # y image
    (id, type) = bstm_batch.commit_output(1)
    dIdy = dbvalue(id, type)
    # mag image
    (id, type) = bstm_batch.commit_output(2)
    magImg = dbvalue(id, type)
    return dIdx, dIdy, magImg