コード例 #1
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def scale_and_offset_values(img,scale,offset):
  boxm2_batch.init_process("vilScaleAndOffsetValuesProcess")
  boxm2_batch.set_input_from_db(0,img)
  boxm2_batch.set_input_float(1,scale)
  boxm2_batch.set_input_float(2,offset)
  boxm2_batch.run_process()
  return
コード例 #2
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def debayer(img):
  boxm2_batch.init_process("vilDebayerBGGRToRGBProcess")
  boxm2_batch.set_input_from_db(0,img);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  outimg = dbvalue(id,type);
  return outimg;
コード例 #3
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def debayer(img):
    boxm2_batch.init_process("vilDebayerBGGRToRGBProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    outimg = dbvalue(id, type)
    return outimg
コード例 #4
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def fill_holes(img):
  boxm2_batch.init_process("vilFillHolesInRegionsProcess")
  boxm2_batch.set_input_from_db(0,img)
  boxm2_batch.run_process()
  (id,type) = boxm2_batch.commit_output(0)
  outimg = dbvalue(id, type);
  return outimg
コード例 #5
0
ファイル: vil_adaptor.py プロジェクト: mirestrepo/vxl
def histogram_equalize(img):
  boxm2_batch.init_process("vilHistogramEqualizeProcess");
  boxm2_batch.set_input_from_db(0, img);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  img_equalized = dbvalue(id, type);
  return img_equalized;
コード例 #6
0
ファイル: boxm2_scene_adaptor.py プロジェクト: yochju/vxl
    def create_stream_cache(self, imgs, interval=1, types="", max_gb=6.0):

        # write image identifiers to file
        # imgRange = range(0, len(imgs), interval);
        # num_imgs = len(imgRange);
        image_id_fname = self.model_dir + "/image_list.txt"
        fd = open(image_id_fname, "w")
        print >> fd, len(imgs)
        # for i in imgRange:
        #  print >>fd, "img_%05d"%i
        for img in imgs:
            fname, fextension = os.path.splitext(img)
            bname = os.path.basename(fname)
            print >> fd, bname
        fd.close()

        # write type identifiers into file
        type_id_fname = self.model_dir + "/type_names_list.txt"
        fd2 = open(type_id_fname, "w")
        print >> fd2, 4
        print >> fd2, "aux0"
        print >> fd2, "aux1"
        print >> fd2, "aux2"
        print >> fd2, "aux3"
        fd2.close()

        # open the stream cache, this is a read-only cache
        batch.init_process("boxm2CreateStreamCacheProcess")
        batch.set_input_from_db(0, self.scene)
        batch.set_input_string(1, type_id_fname)
        batch.set_input_string(2, image_id_fname)
        batch.set_input_float(3, max_gb)
        batch.run_process()
        (cache_id, cache_type) = batch.commit_output(0)
        self.str_cache = dbvalue(cache_id, cache_type)
コード例 #7
0
ファイル: vil_adaptor.py プロジェクト: mirestrepo/vxl
def get_number_of_planes(img):
  boxm2_batch.init_process("vilGetNumberOfPlanesProcess");
  boxm2_batch.set_input_from_db(0, img);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  n_planes = boxm2_batch.get_output_unsigned(id)
  return n_planes;
コード例 #8
0
def export_points_and_normals(scene,
                              cache,
                              file_out,
                              save_aux=True,
                              prob_thresh=0.0,
                              vis_thresh=0.0,
                              nmag_thresh=0.0,
                              exp_thresh=0.0,
                              bbox_file=""):
    if cache.type == "boxm2_cache_sptr":
        print("Exporting to oriented point cloud")
        batch.init_process("boxm2ExportOrientedPointCloudProcess")
        batch.set_input_from_db(0, scene)
        batch.set_input_from_db(1, cache)
        batch.set_input_string(2, file_out)
        # output aux (prob, vis, normal magnitdue)
        batch.set_input_bool(3, save_aux)
        batch.set_input_float(4, vis_thresh)  # vis threshold
        batch.set_input_float(5, nmag_thresh)  # nmag threshold
        batch.set_input_float(6, prob_thresh)  # prob threshold
        # batch.set_input_float(7,exp_thresh); #exp threshold
        # batch.set_input_string(8, bbox_file); #bb filename
        batch.set_input_string(7, bbox_file)  # bb filename
        return batch.run_process()
    else:
        print "ERROR: Cache type not recognized: ", cache.type
        return False
コード例 #9
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: yochju/vxl
def import_triangle_mesh(scene, cache, ply_filename, occupied_prob=0.99):
    batch.init_process("boxm2ImportTriangleMeshProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, ply_filename)
    batch.set_input_float(3, occupied_prob)
    batch.run_process()
コード例 #10
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: yochju/vxl
def gen_tex_mesh(mesh, in_img_dir, in_cam_dir, out_dir):
    batch.init_process("boxm2TextureMeshProcess")
    batch.set_input_from_db(0, mesh)
    batch.set_input_string(1, in_img_dir)
    batch.set_input_string(2, in_cam_dir)
    batch.set_input_string(3, out_dir)
    batch.run_process()
コード例 #11
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: yochju/vxl
def import_point_cloud(scene, cache, in_file, min_octree_depth=2):
    batch.init_process("boxm2ImportPointCloudProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, in_file)
    batch.set_input_unsigned(3, min_octree_depth)
    batch.run_process()
コード例 #12
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: yochju/vxl
def paint_mesh(scene, cache, in_file, out_file):
    batch.init_process("boxm2PaintMeshProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, in_file)
    batch.set_input_string(3, out_file)
    batch.run_process()
コード例 #13
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: yochju/vxl
def export_stack(scene, cache, outdir, identifier):
    batch.init_process("boxm2ExportStackImagesProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, outdir)
    batch.set_input_string(3, identifier)
    batch.run_process()
コード例 #14
0
    def create_stream_cache(self, imgs, interval=1, types="", max_gb=6.0):

        # write image identifiers to file
        # imgRange = range(0, len(imgs), interval);
        # num_imgs = len(imgRange);
        image_id_fname = self.model_dir + "/image_list.txt"
        fd = open(image_id_fname, "w")
        print >> fd, len(imgs)
        # for i in imgRange:
        #  print >>fd, "img_%05d"%i
        for img in imgs:
            fname, fextension = os.path.splitext(img)
            bname = os.path.basename(fname)
            print >> fd, bname
        fd.close()

        # write type identifiers into file
        type_id_fname = self.model_dir + "/type_names_list.txt"
        fd2 = open(type_id_fname, "w")
        print >>fd2, 4
        print >>fd2, "aux0"
        print >>fd2, "aux1"
        print >>fd2, "aux2"
        print >>fd2, "aux3"
        fd2.close()

        # open the stream cache, this is a read-only cache
        batch.init_process("boxm2CreateStreamCacheProcess")
        batch.set_input_from_db(0, self.scene)
        batch.set_input_string(1, type_id_fname)
        batch.set_input_string(2, image_id_fname)
        batch.set_input_float(3, max_gb)
        batch.run_process()
        (cache_id, cache_type) = batch.commit_output(0)
        self.str_cache = dbvalue(cache_id, cache_type)
コード例 #15
0
ファイル: vil_adaptor.py プロジェクト: mirestrepo/vxl
def BGR_to_RGB(inimg):
  boxm2_batch.init_process("vilBGRToRGBProcess")
  boxm2_batch.set_input_from_db(0, inimg)
  boxm2_batch.run_process()
  (id, type) = boxm2_batch.commit_output(0)
  out_img = dbvalue(id,type)
  return out_img
コード例 #16
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: drewgilliam/vxl
def import_point_cloud(scene, cache, in_file, min_octree_depth=2):
    batch.init_process("boxm2ImportPointCloudProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, in_file)
    batch.set_input_unsigned(3, min_octree_depth)
    batch.run_process()
コード例 #17
0
def get_3d_point_from_index(scene, cache, block_index, index):
    # Warning, you probably shouldn't be doing this!
    batch.init_process("boxm2CppGet3dPointFromIndexProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_int(2, block_index[0])
    batch.set_input_int(3, block_index[1])
    batch.set_input_int(4, block_index[2])
    batch.set_input_int(5, index)
    batch.run_process()

    (id, type) = batch.commit_output(0)
    x = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(1)
    y = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(2)
    z = batch.get_output_float(id)
    batch.remove_data(id)

    (id, type) = batch.commit_output(3)
    xs = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(4)
    ys = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(5)
    zs = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(6)
    leaf = batch.get_output_int(id)
    batch.remove_data(id)

    return ((x, y, z), (xs, ys, zs), leaf)
コード例 #18
0
def get_3d_point_from_index(scene, cache, block_index, index):
    # Warning, you probably shouldn't be doing this!
    batch.init_process("boxm2CppGet3dPointFromIndexProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_int(2, block_index[0])
    batch.set_input_int(3, block_index[1])
    batch.set_input_int(4, block_index[2])
    batch.set_input_int(5, index)
    batch.run_process()

    (id, type) = batch.commit_output(0)
    x = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(1)
    y = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(2)
    z = batch.get_output_float(id)
    batch.remove_data(id)

    (id, type) = batch.commit_output(3)
    xs = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(4)
    ys = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(5)
    zs = batch.get_output_float(id)
    batch.remove_data(id)
    (id, type) = batch.commit_output(6)
    leaf = batch.get_output_int(id)
    batch.remove_data(id)

    return ((x, y, z), (xs, ys, zs), leaf)
コード例 #19
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: drewgilliam/vxl
def import_triangle_mesh(scene, cache, ply_filename, occupied_prob=0.99):
    batch.init_process("boxm2ImportTriangleMeshProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, ply_filename)
    batch.set_input_float(3, occupied_prob)
    batch.run_process()
コード例 #20
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: drewgilliam/vxl
def paint_mesh(scene, cache, in_file, out_file):
    batch.init_process("boxm2PaintMeshProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, in_file)
    batch.set_input_string(3, out_file)
    batch.run_process()
コード例 #21
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: drewgilliam/vxl
def export_stack(scene, cache, outdir, identifier):
    batch.init_process("boxm2ExportStackImagesProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_string(2, outdir)
    batch.set_input_string(3, identifier)
    batch.run_process()
コード例 #22
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def fill_holes(img):
    boxm2_batch.init_process("vilFillHolesInRegionsProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    outimg = dbvalue(id, type)
    return outimg
コード例 #23
0
ファイル: boxm2_mesh_adaptor.py プロジェクト: drewgilliam/vxl
def gen_tex_mesh(mesh, in_img_dir, in_cam_dir, out_dir):
    batch.init_process("boxm2TextureMeshProcess")
    batch.set_input_from_db(0, mesh)
    batch.set_input_string(1, in_img_dir)
    batch.set_input_string(2, in_cam_dir)
    batch.set_input_string(3, out_dir)
    batch.run_process()
コード例 #24
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def scale_and_offset_values(img, scale, offset):
    boxm2_batch.init_process("vilScaleAndOffsetValuesProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_float(1, scale)
    boxm2_batch.set_input_float(2, offset)
    boxm2_batch.run_process()
    return
コード例 #25
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def median_filter_image(img, neighborhood_radius):
    boxm2_batch.init_process("vilMedianFilterProcess")
    boxm2_batch.set_input_from_db(0,img)
    boxm2_batch.set_input_int(1,neighborhood_radius)
    boxm2_batch.run_process()
    (id,type) = boxm2_batch.commit_output(0)
    filt_img = dbvalue(id,type)
    return filt_img
コード例 #26
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def get_plane(img, plane_id):
    boxm2_batch.init_process("vilGetPlaneProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_unsigned(1, plane_id)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    img_plane = dbvalue(id, type)
    return img_plane
コード例 #27
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def img_sum(img, plane_index=0):
    boxm2_batch.init_process("vilImageSumProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_unsigned(1, plane_index)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    value = boxm2_batch.get_output_double(id)
    return value
コード例 #28
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def convert_image(img, type="byte"):
    boxm2_batch.init_process("vilConvertPixelTypeProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_string(1, type)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    cimg = dbvalue(id, type)
    return cimg
コード例 #29
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def detect_shadow_rgb(img, threshold):
    boxm2_batch.init_process("vilShadowDetectionProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_float(1, threshold)
    boxm2_batch.run_process()
    (o_id, o_type) = boxm2_batch.commit_output(0)
    region_img = dbvalue(o_id, o_type)
    return region_img
コード例 #30
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def combine_eo_ir(eo_img, ir_img):
    boxm2_batch.init_process("vilEOIRCombineProcess")
    boxm2_batch.set_input_from_db(0, eo_img)
    boxm2_batch.set_input_from_db(1, ir_img)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    img_out = dbvalue(id, type)
    return img_out
コード例 #31
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def image_mean(img):
    boxm2_batch.init_process("vilImageMeanProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    mean_val = boxm2_batch.get_output_float(id)
    boxm2_batch.remove_data(id)
    return mean_val
コード例 #32
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def max_threshold_image(img, threshold):
    boxm2_batch.init_process("vilThresholdMaxImageProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_float(1, threshold)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    mask = dbvalue(id, type)
    return mask
コード例 #33
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def median_filter_image(img, neighborhood_radius):
    boxm2_batch.init_process("vilMedianFilterProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_int(1, neighborhood_radius)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    filt_img = dbvalue(id, type)
    return filt_img
コード例 #34
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def get_plane(img, plane_id):
  boxm2_batch.init_process("vilGetPlaneProcess");
  boxm2_batch.set_input_from_db(0, img);
  boxm2_batch.set_input_unsigned(1, plane_id);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  img_plane = dbvalue(id, type);
  return img_plane;
コード例 #35
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def max_threshold_image(img, threshold):
    boxm2_batch.init_process("vilThresholdMaxImageProcess")
    boxm2_batch.set_input_from_db(0,img)
    boxm2_batch.set_input_float(1,threshold)
    boxm2_batch.run_process()
    (id,type) = boxm2_batch.commit_output(0)
    mask = dbvalue(id,type)
    return mask
コード例 #36
0
def query_cell_data(scene, cache, point):
    batch.init_process("boxm2CppQueryCellDataProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_float(2, point[0])
    batch.set_input_float(3, point[1])
    batch.set_input_float(4, point[2])
    batch.run_process()
コード例 #37
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def detect_shadow_rgb(img,threshold) :
  boxm2_batch.init_process("vilShadowDetectionProcess");
  boxm2_batch.set_input_from_db(0,img)
  boxm2_batch.set_input_float(1, threshold);
  boxm2_batch.run_process();
  (o_id,o_type) = boxm2_batch.commit_output(0);
  region_img = dbvalue(o_id,o_type);
  return region_img;
コード例 #38
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def image_mean(img):
  boxm2_batch.init_process("vilImageMeanProcess")
  boxm2_batch.set_input_from_db(0,img)
  boxm2_batch.run_process()
  (id,type) = boxm2_batch.commit_output(0)
  mean_val = boxm2_batch.get_output_float(id)
  boxm2_batch.remove_data(id)
  return mean_val
コード例 #39
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def combine_eo_ir(eo_img,ir_img):
  boxm2_batch.init_process("vilEOIRCombineProcess")
  boxm2_batch.set_input_from_db(0,eo_img)
  boxm2_batch.set_input_from_db(1,ir_img)
  boxm2_batch.run_process()
  (id,type) = boxm2_batch.commit_output(0)
  img_out = dbvalue(id,type)
  return img_out
コード例 #40
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def img_sum(img, plane_index=0):
  boxm2_batch.init_process("vilImageSumProcess")
  boxm2_batch.set_input_from_db(0,img)
  boxm2_batch.set_input_unsigned(1,plane_index)
  boxm2_batch.run_process()
  (id,type) = boxm2_batch.commit_output(0)
  value = boxm2_batch.get_output_double(id)
  return value
コード例 #41
0
def query_cell_data(scene, cache, point):
    batch.init_process("boxm2CppQueryCellDataProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_float(2, point[0])
    batch.set_input_float(3, point[1])
    batch.set_input_float(4, point[2])
    batch.run_process()
コード例 #42
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def convert_image(img, type="byte") :
  boxm2_batch.init_process("vilConvertPixelTypeProcess");
  boxm2_batch.set_input_from_db(0, img);
  boxm2_batch.set_input_string(1, type);
  boxm2_batch.run_process();
  (id,type) = boxm2_batch.commit_output(0);
  cimg = dbvalue(id,type);
  return cimg;
コード例 #43
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def undistort_image(img, param_file, iters) :
  boxm2_batch.init_process("vilUndistortImageProcess");
  boxm2_batch.set_input_from_db(0,img)
  boxm2_batch.set_input_string(1, param_file);
  boxm2_batch.set_input_int(2, iters);
  boxm2_batch.run_process();
  (o_id,o_type) = boxm2_batch.commit_output(0);
  out_img = dbvalue(o_id,o_type);
  return out_img;
コード例 #44
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def image_range(img):
    boxm2_batch.init_process('vilImageRangeProcess')
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    minVal = boxm2_batch.get_output_float(id)
    (id, type) = boxm2_batch.commit_output(1)
    maxVal = boxm2_batch.get_output_float(id)
    return minVal, maxVal
コード例 #45
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def truncate_image(img, min_value, max_value):
    boxm2_batch.init_process("vilTruncateImageProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_float(1, min_value)
    boxm2_batch.set_input_float(2, max_value)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    img_out = dbvalue(id, type)
    return img_out
コード例 #46
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def threshold_image(img, value, threshold_above=True):
    boxm2_batch.init_process("vilThresholdImageProcess")
    boxm2_batch.set_input_from_db(0,img)
    boxm2_batch.set_input_float(1,value)
    boxm2_batch.set_input_bool(2,threshold_above)
    boxm2_batch.run_process()
    (id,type) = boxm2_batch.commit_output(0)
    mask = dbvalue(id,type)
    return mask
コード例 #47
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def gradient_angle(Ix, Iy) :
    boxm2_batch.init_process('vilGradientAngleProcess')
    boxm2_batch.set_input_from_db(0,Ix)
    boxm2_batch.set_input_from_db(1,Iy)
    boxm2_batch.run_process()
    #x image
    (id,type) = boxm2_batch.commit_output(0)
    angleImg = dbvalue(id,type)
    return angleImg
コード例 #48
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def image_range(img):
    boxm2_batch.init_process('vilImageRangeProcess')
    boxm2_batch.set_input_from_db(0,img)
    boxm2_batch.run_process()
    (id,type) = boxm2_batch.commit_output(0)
    minVal = boxm2_batch.get_output_float(id)
    (id,type) = boxm2_batch.commit_output(1)
    maxVal = boxm2_batch.get_output_float(id)
    return minVal, maxVal
コード例 #49
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def gradient_angle(Ix, Iy):
    boxm2_batch.init_process('vilGradientAngleProcess')
    boxm2_batch.set_input_from_db(0, Ix)
    boxm2_batch.set_input_from_db(1, Iy)
    boxm2_batch.run_process()
    #x image
    (id, type) = boxm2_batch.commit_output(0)
    angleImg = dbvalue(id, type)
    return angleImg
コード例 #50
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def threshold_image(img, value, threshold_above=True):
    boxm2_batch.init_process("vilThresholdImageProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_float(1, value)
    boxm2_batch.set_input_bool(2, threshold_above)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    mask = dbvalue(id, type)
    return mask
コード例 #51
0
def query_cell_brdf(scene, cache, point, model_type):
    batch.init_process("boxm2CppQueryCellBrdfProcess")
    batch.set_input_from_db(0, scene)
    batch.set_input_from_db(1, cache)
    batch.set_input_float(2, point[0])
    batch.set_input_float(3, point[1])
    batch.set_input_float(4, point[2])
    batch.set_input_string(5, model_type)
    batch.run_process()
コード例 #52
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def mask_image_using_id(img, id_img, input_id):
  boxm2_batch.init_process("vilMaskImageUsingIDsProcess");
  boxm2_batch.set_input_from_db(0, img);
  boxm2_batch.set_input_from_db(1, id_img);
  boxm2_batch.set_input_unsigned(2, input_id);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  masked_img = dbvalue(id, type);
  return masked_img;
コード例 #53
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def binary_img_op(img1, img2, operation="sum"):
  boxm2_batch.init_process("vilBinaryImageOpProcess")
  boxm2_batch.set_input_from_db(0,img1)
  boxm2_batch.set_input_from_db(1,img2)
  boxm2_batch.set_input_string(2,operation)
  boxm2_batch.run_process()
  (id,type) = boxm2_batch.commit_output(0)
  out = dbvalue(id, type);
  return out
コード例 #54
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def binary_img_op(img1, img2, operation="sum"):
    boxm2_batch.init_process("vilBinaryImageOpProcess")
    boxm2_batch.set_input_from_db(0, img1)
    boxm2_batch.set_input_from_db(1, img2)
    boxm2_batch.set_input_string(2, operation)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    out = dbvalue(id, type)
    return out
コード例 #55
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def image_size(img):
    boxm2_batch.init_process('vilImageSizeProcess')
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    ni = boxm2_batch.get_output_unsigned(id)
    (id, type) = boxm2_batch.commit_output(1)
    nj = boxm2_batch.get_output_unsigned(id)
    return ni, nj
コード例 #56
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def undistort_image(img, param_file, iters):
    boxm2_batch.init_process("vilUndistortImageProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_string(1, param_file)
    boxm2_batch.set_input_int(2, iters)
    boxm2_batch.run_process()
    (o_id, o_type) = boxm2_batch.commit_output(0)
    out_img = dbvalue(o_id, o_type)
    return out_img
コード例 #57
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def truncate_image(img,min_value,max_value):
    boxm2_batch.init_process("vilTruncateImageProcess")
    boxm2_batch.set_input_from_db(0,img)
    boxm2_batch.set_input_float(1,min_value)
    boxm2_batch.set_input_float(2,max_value)
    boxm2_batch.run_process()
    (id,type) = boxm2_batch.commit_output(0)
    img_out = dbvalue(id,type)
    return img_out
コード例 #58
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def mask_image_using_id(img, id_img, input_id):
    boxm2_batch.init_process("vilMaskImageUsingIDsProcess")
    boxm2_batch.set_input_from_db(0, img)
    boxm2_batch.set_input_from_db(1, id_img)
    boxm2_batch.set_input_unsigned(2, input_id)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    masked_img = dbvalue(id, type)
    return masked_img
コード例 #59
0
ファイル: vil_adaptor.py プロジェクト: BGratta94/WordAnalysis
def arf_next_frame(rawStream) :
  boxm2_batch.init_process("bilArfReadFrameProcess")
  boxm2_batch.set_input_from_db(0,rawStream);
  boxm2_batch.run_process();
  (id, type) = boxm2_batch.commit_output(0);
  img = dbvalue(id,type);
  (id, type) = boxm2_batch.commit_output(1);
  time = boxm2_batch.get_output_unsigned(id);
  return img, time
コード例 #60
0
ファイル: vil_adaptor.py プロジェクト: caioc2/vxl
def arf_next_frame(rawStream):
    boxm2_batch.init_process("bilArfReadFrameProcess")
    boxm2_batch.set_input_from_db(0, rawStream)
    boxm2_batch.run_process()
    (id, type) = boxm2_batch.commit_output(0)
    img = dbvalue(id, type)
    (id, type) = boxm2_batch.commit_output(1)
    time = boxm2_batch.get_output_unsigned(id)
    return img, time