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
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
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
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
def pixel(img, point): boxm2_batch.init_process("vilPixelValueProcess") boxm2_batch.set_input_from_db(0,img) boxm2_batch.set_input_int(1, int(point[0])) boxm2_batch.set_input_int(2, int(point[1])) boxm2_batch.run_process() (id,type) = boxm2_batch.commit_output(0) val = boxm2_batch.get_output_float(id) return val
def pixel(img, point): boxm2_batch.init_process("vilPixelValueProcess") boxm2_batch.set_input_from_db(0, img) boxm2_batch.set_input_int(1, int(point[0])) boxm2_batch.set_input_int(2, int(point[1])) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) val = boxm2_batch.get_output_float(id) return val
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)
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)
def get_output_float(id): fval = boxm2_batch.get_output_float(id) return fval
def get_output_float(id): fval = boxm2_batch.get_output_float(id) return fval