def crop_image_using_3d_box(img_res, camera, lower_left_lon, lower_left_lat, lower_left_elev, upper_right_lon, upper_right_lat, upper_right_elev, uncertainty): boxm2_batch.init_process("vpglCropImgUsing3DboxProcess"); boxm2_batch.set_input_from_db(0, img_res); boxm2_batch.set_input_from_db(1, camera); boxm2_batch.set_input_double(2, lower_left_lon); boxm2_batch.set_input_double(3, lower_left_lat); boxm2_batch.set_input_double(4, lower_left_elev); boxm2_batch.set_input_double(5, upper_right_lon); boxm2_batch.set_input_double(6, upper_right_lat); boxm2_batch.set_input_double(7, upper_right_elev); boxm2_batch.set_input_double(8, uncertainty); status = boxm2_batch.run_process(); if status: (id, type) = boxm2_batch.commit_output(0); local_cam = dbvalue(id, type); (id, type) = boxm2_batch.commit_output(1); i0 = boxm2_batch.get_output_unsigned(id) (id, type) = boxm2_batch.commit_output(2); j0 = boxm2_batch.get_output_unsigned(id) (id, type) = boxm2_batch.commit_output(3); ni = boxm2_batch.get_output_unsigned(id) (id, type) = boxm2_batch.commit_output(4); nj = boxm2_batch.get_output_unsigned(id) return status, local_cam, i0, j0, ni, nj; else: return status, dbvalue(0, ""), 0, 0, 0, 0;
def crop_image_using_3d_box(img_res, camera, lower_left_lon, lower_left_lat, lower_left_elev, upper_right_lon, upper_right_lat, upper_right_elev, uncertainty, lvcs=0): boxm2_batch.init_process("vpglCropImgUsing3DboxProcess") boxm2_batch.set_input_from_db(0, img_res) boxm2_batch.set_input_from_db(1, camera) boxm2_batch.set_input_double(2, lower_left_lon) boxm2_batch.set_input_double(3, lower_left_lat) boxm2_batch.set_input_double(4, lower_left_elev) boxm2_batch.set_input_double(5, upper_right_lon) boxm2_batch.set_input_double(6, upper_right_lat) boxm2_batch.set_input_double(7, upper_right_elev) boxm2_batch.set_input_double(8, uncertainty) if lvcs: boxm2_batch.set_input_from_db(9, lvcs) status = boxm2_batch.run_process() if status: (id, type) = boxm2_batch.commit_output(0) local_cam = dbvalue(id, type) (id, type) = boxm2_batch.commit_output(1) i0 = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(2) j0 = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(3) ni = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(4) nj = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id) return status, local_cam, i0, j0, ni, nj else: return status, dbvalue(0, ""), 0, 0, 0, 0
def offset_cam_using_3d_box(camera, lower_left_lon, lower_left_lat, lower_left_elev, upper_right_lon, upper_right_lat, upper_right_elev, uncertainty, lvcs=None): boxm2_batch.init_process("vpglOffsetCamUsing3DboxProcess"); boxm2_batch.set_input_from_db(0, camera); boxm2_batch.set_input_double(1, lower_left_lon); boxm2_batch.set_input_double(2, lower_left_lat); boxm2_batch.set_input_double(3, lower_left_elev); boxm2_batch.set_input_double(4, upper_right_lon); boxm2_batch.set_input_double(5, upper_right_lat); boxm2_batch.set_input_double(6, upper_right_elev); boxm2_batch.set_input_double(7, uncertainty); if lvcs: boxm2_batch.set_input_from_db(8, lvcs); status = boxm2_batch.run_process(); if status: (id, type) = boxm2_batch.commit_output(0); local_cam = dbvalue(id, type); (id, type) = boxm2_batch.commit_output(1); i0 = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id); (id, type) = boxm2_batch.commit_output(2); j0 = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id); (id, type) = boxm2_batch.commit_output(3); ni = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id); (id, type) = boxm2_batch.commit_output(4); nj = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id); return status, local_cam, i0, j0, ni, nj; else: return status, dbvalue(0, ""), 0, 0, 0, 0;
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
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
def load_image(file_path): boxm2_batch.init_process("vilLoadImageViewProcess") boxm2_batch.set_input_string(0, file_path) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) (ni_id, ni_type) = boxm2_batch.commit_output(1) (nj_id, nj_type) = boxm2_batch.commit_output(2) ni = boxm2_batch.get_output_unsigned(ni_id) nj = boxm2_batch.get_output_unsigned(nj_id) img = dbvalue(id, type) boxm2_batch.remove_data(ni_id) boxm2_batch.remove_data(nj_id) return img, ni, nj
def load_image(file_path) : boxm2_batch.init_process("vilLoadImageViewProcess"); boxm2_batch.set_input_string(0, file_path); boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); (ni_id, ni_type) = boxm2_batch.commit_output(1); (nj_id, nj_type) = boxm2_batch.commit_output(2); ni = boxm2_batch.get_output_unsigned(ni_id); nj = boxm2_batch.get_output_unsigned(nj_id); img = dbvalue(id,type); boxm2_batch.remove_data(ni_id) boxm2_batch.remove_data(nj_id) return img, ni, nj;
def load_image_resource(file_path): boxm2_batch.init_process("vilLoadImageResourceProcess"); boxm2_batch.set_input_string(0, file_path); status = boxm2_batch.run_process(); img_res = ni = nj = None; if status: (id, type) = boxm2_batch.commit_output(0); (ni_id, ni_type) = boxm2_batch.commit_output(1); (nj_id, nj_type) = boxm2_batch.commit_output(2); ni = boxm2_batch.get_output_unsigned(ni_id); nj = boxm2_batch.get_output_unsigned(nj_id); img_res = dbvalue(id, type); boxm2_batch.remove_data(ni_id); boxm2_batch.remove_data(nj_id); return img_res, ni, nj;
def load_image_resource(file_path): boxm2_batch.init_process("vilLoadImageResourceProcess") boxm2_batch.set_input_string(0, file_path) status = boxm2_batch.run_process() img_res = ni = nj = None if status: (id, type) = boxm2_batch.commit_output(0) (ni_id, ni_type) = boxm2_batch.commit_output(1) (nj_id, nj_type) = boxm2_batch.commit_output(2) ni = boxm2_batch.get_output_unsigned(ni_id) nj = boxm2_batch.get_output_unsigned(nj_id) img_res = dbvalue(id, type) boxm2_batch.remove_data(ni_id) boxm2_batch.remove_data(nj_id) return img_res, ni, nj
def load_image(file_path): boxm2_batch.init_process("vilLoadImageViewProcess") boxm2_batch.set_input_string(0, file_path) status = boxm2_batch.run_process() img = ni = nj = None if status: (id, type) = boxm2_batch.commit_output(0) (ni_id, ni_type) = boxm2_batch.commit_output(1) (nj_id, nj_type) = boxm2_batch.commit_output(2) ni = boxm2_batch.get_output_unsigned(ni_id) nj = boxm2_batch.get_output_unsigned(nj_id) img = dbvalue(id, type) boxm2_batch.remove_data(ni_id) boxm2_batch.remove_data(nj_id) return img, ni, nj
def compute_sun_affine_camera(scene, sun_az, sun_el, astro_coords=True): boxm2_batch.init_process("boxm2ComputeSunAffineCameraProcess") boxm2_batch.set_input_from_db(0, scene) boxm2_batch.set_input_float(1, sun_el) boxm2_batch.set_input_float(2, sun_az) boxm2_batch.set_input_bool(3, astro_coords) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) sun_cam = dbvalue(id, type) (ni_id, type) = boxm2_batch.commit_output(1) (nj_id, type) = boxm2_batch.commit_output(2) ni = boxm2_batch.get_output_unsigned(ni_id) nj = boxm2_batch.get_output_unsigned(nj_id) boxm2_batch.remove_data(ni_id) boxm2_batch.remove_data(nj_id) return sun_cam, ni, nj
def persp2genWmargin(pcam, ni, nj, margin, level=0) : boxm2_batch.init_process("vpglConvertToGenericCameraWithMarginProcess"); boxm2_batch.set_input_from_db(0, pcam); boxm2_batch.set_input_unsigned(1, ni); boxm2_batch.set_input_unsigned(2, nj); boxm2_batch.set_input_unsigned(3, level); boxm2_batch.set_input_int(4, margin); boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); gcam = dbvalue(id,type); (id,type) = boxm2_batch.commit_output(1); ni = boxm2_batch.get_output_unsigned(id); (id,type) = boxm2_batch.commit_output(2); nj = boxm2_batch.get_output_unsigned(id); (id,type) = boxm2_batch.commit_output(3); new_pers_cam = dbvalue(id,type); return (gcam, ni, nj, new_pers_cam);
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) boxm2_batch.remove_data(id) return n_planes
def persp2genWmargin(pcam, ni, nj, margin, level=0): boxm2_batch.init_process("vpglConvertToGenericCameraWithMarginProcess") boxm2_batch.set_input_from_db(0, pcam) boxm2_batch.set_input_unsigned(1, ni) boxm2_batch.set_input_unsigned(2, nj) boxm2_batch.set_input_unsigned(3, level) boxm2_batch.set_input_int(4, margin) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) gcam = dbvalue(id, type) (id, type) = boxm2_batch.commit_output(1) ni = boxm2_batch.get_output_unsigned(id) (id, type) = boxm2_batch.commit_output(2) nj = boxm2_batch.get_output_unsigned(id) (id, type) = boxm2_batch.commit_output(3) new_pers_cam = dbvalue(id, type) return (gcam, ni, nj, new_pers_cam)
def trajectory_size(trajectory): boxm2_batch.init_process("boxm2ViewTrajectorySizeProcess") boxm2_batch.set_input_from_db(0, trajectory) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) size = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id) return size
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
def next_frame(rawStream): boxm2_batch.init_process("bilReadFrameProcess") 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
def arf_seek_frame(rawStream, frame): boxm2_batch.init_process("bilArfSeekFrameProcess") boxm2_batch.set_input_from_db(0, rawStream) boxm2_batch.set_input_unsigned(1, frame) 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
def persp2genWmargin(pcam, ni, nj, margin, level=0): boxm2_batch.init_process("vpglConvertToGenericCameraWithMarginProcess") boxm2_batch.set_input_from_db(0, pcam) boxm2_batch.set_input_unsigned(1, ni) boxm2_batch.set_input_unsigned(2, nj) boxm2_batch.set_input_unsigned(3, level) boxm2_batch.set_input_int(4, margin) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) gcam = dbvalue(id, type) (id, type) = boxm2_batch.commit_output(1) ni = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(2) nj = boxm2_batch.get_output_unsigned(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(3) new_pers_cam = dbvalue(id, type) return (gcam, ni, nj, new_pers_cam)
def arf_seek_frame(rawStream, frame): boxm2_batch.init_process("bilArfSeekFrameProcess") boxm2_batch.set_input_from_db(0, rawStream) boxm2_batch.set_input_unsigned(1, frame) 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) boxm2_batch.remove_data(id) return img, time