def load_affine_camera(file_path, viewing_dist=1000): boxm2_batch.init_process("vpglLoadAffineCameraProcess") boxm2_batch.set_input_string(0, file_path) boxm2_batch.set_input_double(1, viewing_dist) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) cam = dbvalue(id, type) return cam
def correct_rational_camera(cam_in, offset_x, offset_y): boxm2_batch.init_process('vpglCorrectRationalCameraProcess') boxm2_batch.set_input_from_db(0, cam_in) boxm2_batch.set_input_double(1, offset_x) boxm2_batch.set_input_double(2, offset_y) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) corrected_cam = dbvalue(id, type) return corrected_cam
def translate_geo_camera(geocam, x, y): boxm2_batch.init_process("vpglTranslateGeoCameraProcess") boxm2_batch.set_input_from_db(0, geocam) boxm2_batch.set_input_double(1, x) boxm2_batch.set_input_double(2, y) boxm2_batch.run_process() (c_id, c_type) = boxm2_batch.commit_output(0) cam = dbvalue(c_id, c_type) return cam
def correct_rational_camera(cam_in, offset_x, offset_y): boxm2_batch.init_process('vpglCorrectRationalCameraProcess'); boxm2_batch.set_input_from_db(0,cam_in); boxm2_batch.set_input_double(1,offset_x); boxm2_batch.set_input_double(2,offset_y); boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); corrected_cam = dbvalue(id,type); return corrected_cam;
def translate_geo_camera(geocam, x, y): boxm2_batch.init_process("vpglTranslateGeoCameraProcess"); boxm2_batch.set_input_from_db(0, geocam); boxm2_batch.set_input_double(1, x); boxm2_batch.set_input_double(2, y); boxm2_batch.run_process(); (c_id, c_type) = boxm2_batch.commit_output(0); cam = dbvalue(c_id, c_type); return cam;
def geo_cam_global_to_img(geocam, lon, lat): boxm2_batch.init_process("vpglGeoGlobalToImgProcess"); boxm2_batch.set_input_from_db(0, geocam); boxm2_batch.set_input_double(1, lon); boxm2_batch.set_input_double(2, lat); boxm2_batch.run_process(); (id, type) = boxm2_batch.commit_output(0); u = boxm2_batch.get_output_int(id); (id, type) = boxm2_batch.commit_output(1); v = boxm2_batch.get_output_int(id); return u, v;
def geo2generic(geocam, ni, nj, scene_height, level): boxm2_batch.init_process("vpglConvertGeoCameraToGenericProcess"); boxm2_batch.set_input_from_db(0, geocam); boxm2_batch.set_input_int(1, ni); boxm2_batch.set_input_int(2, nj); boxm2_batch.set_input_double(3, scene_height); boxm2_batch.set_input_int(4, level); boxm2_batch.run_process(); (c_id, c_type) = boxm2_batch.commit_output(0); cam = dbvalue(c_id, c_type); return cam;
def geo2generic(geocam, ni, nj, scene_height, level): boxm2_batch.init_process("vpglConvertGeoCameraToGenericProcess") boxm2_batch.set_input_from_db(0, geocam) boxm2_batch.set_input_int(1, ni) boxm2_batch.set_input_int(2, nj) boxm2_batch.set_input_double(3, scene_height) boxm2_batch.set_input_int(4, level) boxm2_batch.run_process() (c_id, c_type) = boxm2_batch.commit_output(0) cam = dbvalue(c_id, c_type) return cam
def geo_cam_global_to_img(geocam, lon, lat): boxm2_batch.init_process("vpglGeoGlobalToImgProcess") boxm2_batch.set_input_from_db(0, geocam) boxm2_batch.set_input_double(1, lon) boxm2_batch.set_input_double(2, lat) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) u = boxm2_batch.get_output_int(id) (id, type) = boxm2_batch.commit_output(1) v = boxm2_batch.get_output_int(id) return u, v
def geo_cam_global_to_img(geocam, lon, lat): boxm2_batch.init_process("vpglGeoGlobalToImgProcess") boxm2_batch.set_input_from_db(0, geocam) boxm2_batch.set_input_double(1, lon) boxm2_batch.set_input_double(2, lat) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) u = boxm2_batch.get_output_int(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(1) v = boxm2_batch.get_output_int(id) boxm2_batch.remove_data(id) return u, v
def image_mutual_info(image1, image2, min_val, max_val, n_bins): boxm2_batch.init_process("bripImageMutualInfoProcess") boxm2_batch.set_input_from_db(0, image1) boxm2_batch.set_input_from_db(1, image2) boxm2_batch.set_input_double(2, min_val) boxm2_batch.set_input_double(3, max_val) boxm2_batch.set_input_unsigned(4, n_bins) status = boxm2_batch.run_process() if status: (id, type) = boxm2_batch.commit_output(0) mutual_info = boxm2_batch.get_output_double(id) return mutual_info else: return -1.0
def generate_xyz_from_shadow(scene, height_img, generic_cam, dem_fname, scale): boxm2_batch.init_process("boxm2ShadowHeightsToXYZProcess") boxm2_batch.set_input_from_db(0, scene) boxm2_batch.set_input_from_db(1, height_img) boxm2_batch.set_input_from_db(2, generic_cam) boxm2_batch.set_input_string(3, dem_fname) boxm2_batch.set_input_double(4, scale) boxm2_batch.run_process() (xi_id, xi_type) = boxm2_batch.commit_output(0) x_img = dbvalue(xi_id, xi_type) (yi_id, yi_type) = boxm2_batch.commit_output(1) y_img = dbvalue(yi_id, yi_type) (zi_id, zi_type) = boxm2_batch.commit_output(2) z_img = dbvalue(zi_id, zi_type) return x_img, y_img, z_img
def load_affine_camera(file_path, viewing_dist=1000, look_dir=(0, 0, -1)): """ load an affine camera from a text file containing the projection matrix The viewing rays will be flipped such that the dot product with look_dir is positive """ boxm2_batch.init_process("vpglLoadAffineCameraProcess") boxm2_batch.set_input_string(0, file_path) boxm2_batch.set_input_double(1, viewing_dist) boxm2_batch.set_input_double(2, look_dir[0]) boxm2_batch.set_input_double(3, look_dir[1]) boxm2_batch.set_input_double(4, look_dir[2]) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) cam = dbvalue(id, type) return cam
def geo2generic_nonnadir(geocam, ni, nj, scene_height, dir_x, dir_y, dir_z, level): boxm2_batch.init_process("vpglConvertNonNadirGeoCameraToGenericProcess") boxm2_batch.set_input_from_db(0, geocam) boxm2_batch.set_input_int(1, ni) boxm2_batch.set_input_int(2, nj) boxm2_batch.set_input_double(3, scene_height) boxm2_batch.set_input_int(4, level) boxm2_batch.set_input_double(5, dir_x) boxm2_batch.set_input_double(6, dir_y) boxm2_batch.set_input_double(7, dir_z) boxm2_batch.run_process() (c_id, c_type) = boxm2_batch.commit_output(0) cam = dbvalue(c_id, c_type) return cam
def load_affine_camera(file_path, viewing_dist=1000, look_dir=(0,0,-1)) : """ load an affine camera from a text file containing the projection matrix The viewing rays will be flipped such that the dot product with look_dir is positive """ boxm2_batch.init_process("vpglLoadAffineCameraProcess"); boxm2_batch.set_input_string(0, file_path); boxm2_batch.set_input_double(1, viewing_dist); boxm2_batch.set_input_double(2, look_dir[0]) boxm2_batch.set_input_double(3, look_dir[1]) boxm2_batch.set_input_double(4, look_dir[2]) boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); cam = dbvalue(id,type); return cam;
def generate_xyz_from_dem(scene, refine_level, geotiff_dem, geoid_height, bilin=False): boxm2_batch.init_process("boxm2DemToXYZProcess") boxm2_batch.set_input_from_db(0, scene) boxm2_batch.set_input_unsigned(1, refine_level) boxm2_batch.set_input_string(2, geotiff_dem) boxm2_batch.set_input_double(3, geoid_height) boxm2_batch.set_input_bool(4, bilin) boxm2_batch.run_process() (xi_id, xi_type) = boxm2_batch.commit_output(0) x_img = dbvalue(xi_id, xi_type) (yi_id, yi_type) = boxm2_batch.commit_output(1) y_img = dbvalue(yi_id, yi_type) (zi_id, zi_type) = boxm2_batch.commit_output(2) z_img = dbvalue(zi_id, zi_type) (dem_id, dem_type) = boxm2_batch.commit_output(3) dem_img = dbvalue(dem_id, dem_type) (demr_id, demr_type) = boxm2_batch.commit_output(4) dem_res_img = dbvalue(demr_id, demr_type) return x_img, y_img, z_img, dem_img, dem_res_img
def create_lvcs(lat,lon,el,csname): boxm2_batch.init_process('vpglCreateLVCSProcess'); boxm2_batch.set_input_double(0,lat); boxm2_batch.set_input_double(1,lon); boxm2_batch.set_input_double(2,el); boxm2_batch.set_input_string(3,csname); boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); lvcs = dbvalue(id,type); return lvcs;
def create_lvcs(lat, lon, el, csname): boxm2_batch.init_process('vpglCreateLVCSProcess') boxm2_batch.set_input_double(0, lat) boxm2_batch.set_input_double(1, lon) boxm2_batch.set_input_double(2, el) boxm2_batch.set_input_string(3, csname) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) lvcs = dbvalue(id, type) return lvcs
def convert_local_to_global_coordinates(lvcs, x, y, z): boxm2_batch.init_process('vpglConvertLocalToGlobalCoordinatesProcess') boxm2_batch.set_input_from_db(0, lvcs) boxm2_batch.set_input_double(1, x) boxm2_batch.set_input_double(2, y) boxm2_batch.set_input_double(3, z) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) lat = boxm2_batch.get_output_double(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(1) lon = boxm2_batch.get_output_double(id) boxm2_batch.remove_data(id) (id, type) = boxm2_batch.commit_output(2) el = boxm2_batch.get_output_double(id) boxm2_batch.remove_data(id) return (lat, lon, el)
def convert_local_to_global_coordinates(lvcs,x,y,z): boxm2_batch.init_process('vpglConvertLocalToGlobalCoordinatesProcess'); boxm2_batch.set_input_from_db(0,lvcs); boxm2_batch.set_input_double(1,x); boxm2_batch.set_input_double(2,y); boxm2_batch.set_input_double(3,z); boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); lat = boxm2_batch.get_output_double(id); boxm2_batch.remove_data(id); (id,type) = boxm2_batch.commit_output(1); lon = boxm2_batch.get_output_double(id); boxm2_batch.remove_data(id); (id,type) = boxm2_batch.commit_output(2); el = boxm2_batch.get_output_double(id); boxm2_batch.remove_data(id); return (lat,lon,el);
def init_trajectory(scene, startInc, endInc, radius, ni=1280, nj=720): boxm2_batch.init_process("boxm2ViewInitTrajectoryProcess") boxm2_batch.set_input_from_db(0, scene) boxm2_batch.set_input_double(1, float(startInc)) #incline0 boxm2_batch.set_input_double(2, float(endInc)) #incline1 boxm2_batch.set_input_double(3, float(radius)) #radius boxm2_batch.set_input_unsigned(4, ni) #ni boxm2_batch.set_input_unsigned(5, nj) #nj boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) trajectory = dbvalue(id, type) return trajectory
def create_perspective_camera_from_kml(ni, nj, right_fov, top_fov, altitude, heading, tilt, roll, cent_x, cent_y) : boxm2_batch.init_process("vpglCreatePerspCameraFromKMLProcess"); boxm2_batch.set_input_unsigned(0, ni); boxm2_batch.set_input_unsigned(1, nj); boxm2_batch.set_input_double(2, right_fov); boxm2_batch.set_input_double(3, top_fov); boxm2_batch.set_input_double(4, altitude); boxm2_batch.set_input_double(5, heading); boxm2_batch.set_input_double(6, tilt); boxm2_batch.set_input_double(7, roll); boxm2_batch.set_input_double(8, cent_x); boxm2_batch.set_input_double(9, cent_y); boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); cam = dbvalue(id,type); return cam;
def affine_rectify_images(img1, affine_cam1, img2, affine_cam2, min_x, min_y, min_z, max_x, max_y, max_z, n_points=100): boxm2_batch.init_process("vpglAffineRectifyImagesProcess") boxm2_batch.set_input_from_db(0, img1) boxm2_batch.set_input_from_db(1, affine_cam1) boxm2_batch.set_input_from_db(2, img2) boxm2_batch.set_input_from_db(3, affine_cam2) boxm2_batch.set_input_double(4, min_x) boxm2_batch.set_input_double(5, min_y) boxm2_batch.set_input_double(6, min_z) boxm2_batch.set_input_double(7, max_x) boxm2_batch.set_input_double(8, max_y) boxm2_batch.set_input_double(9, max_z) boxm2_batch.set_input_unsigned(10, n_points) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) out_img1 = dbvalue(id, type) (id, type) = boxm2_batch.commit_output(1) out_cam1 = dbvalue(id, type) (id, type) = boxm2_batch.commit_output(2) out_img2 = dbvalue(id, type) (id, type) = boxm2_batch.commit_output(3) out_cam2 = dbvalue(id, type) return out_img1, out_cam1, out_img2, out_cam2
def affine_rectify_images(img1, affine_cam1, img2, affine_cam2, min_x, min_y, min_z, max_x, max_y, max_z, n_points=100): boxm2_batch.init_process("vpglAffineRectifyImagesProcess"); boxm2_batch.set_input_from_db(0, img1); boxm2_batch.set_input_from_db(1, affine_cam1); boxm2_batch.set_input_from_db(2, img2); boxm2_batch.set_input_from_db(3, affine_cam2); boxm2_batch.set_input_double(4, min_x); boxm2_batch.set_input_double(5, min_y); boxm2_batch.set_input_double(6, min_z); boxm2_batch.set_input_double(7, max_x); boxm2_batch.set_input_double(8, max_y); boxm2_batch.set_input_double(9, max_z); boxm2_batch.set_input_unsigned(10, n_points); boxm2_batch.run_process(); (id, type) = boxm2_batch.commit_output(0); out_img1 = dbvalue(id, type); (id, type) = boxm2_batch.commit_output(1); out_cam1 = dbvalue(id, type); (id, type) = boxm2_batch.commit_output(2); out_img2 = dbvalue(id, type); (id, type) = boxm2_batch.commit_output(3); out_cam2 = dbvalue(id, type); return out_img1, out_cam1, out_img2, out_cam2
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 vrml_write_box(vrml_filename, bbox, is_wire, r, g, b): boxm2_batch.init_process("bvrmlWriteBoxProcess"); boxm2_batch.set_input_string(0,vrml_filename); boxm2_batch.set_input_double(1,bbox[0]); # minx boxm2_batch.set_input_double(2,bbox[1]); # miny boxm2_batch.set_input_double(3,bbox[2]); # minz boxm2_batch.set_input_double(4,bbox[3]); # maxx boxm2_batch.set_input_double(5,bbox[4]); # maxy boxm2_batch.set_input_double(6,bbox[5]); # maxz boxm2_batch.set_input_bool(7,is_wire); boxm2_batch.set_input_float(8,r); boxm2_batch.set_input_float(9,g); boxm2_batch.set_input_float(10,b); boxm2_batch.run_process();
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 create_perspective_camera_from_kml(ni, nj, right_fov, top_fov, altitude, heading, tilt, roll, cent_x, cent_y): boxm2_batch.init_process("vpglCreatePerspCameraFromKMLProcess") boxm2_batch.set_input_unsigned(0, ni) boxm2_batch.set_input_unsigned(1, nj) boxm2_batch.set_input_double(2, right_fov) boxm2_batch.set_input_double(3, top_fov) boxm2_batch.set_input_double(4, altitude) boxm2_batch.set_input_double(5, heading) boxm2_batch.set_input_double(6, tilt) boxm2_batch.set_input_double(7, roll) boxm2_batch.set_input_double(8, cent_x) boxm2_batch.set_input_double(9, cent_y) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) cam = dbvalue(id, type) return cam
def create_perspective_camera(scale, ppoint, center, look_pt, up=[0, 1, 0]): boxm2_batch.init_process("vpglCreatePerspectiveCameraProcess") boxm2_batch.set_input_double(0, scale[0]) boxm2_batch.set_input_double(1, ppoint[0]) boxm2_batch.set_input_double(2, scale[1]) boxm2_batch.set_input_double(3, ppoint[1]) boxm2_batch.set_input_double(4, center[0]) boxm2_batch.set_input_double(5, center[1]) boxm2_batch.set_input_double(6, center[2]) boxm2_batch.set_input_double(7, look_pt[0]) boxm2_batch.set_input_double(8, look_pt[1]) boxm2_batch.set_input_double(9, look_pt[2]) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) cam = dbvalue(id, type) return cam
def compute_affine_from_local_rational(cropped_cam, min_x, min_y, min_z, max_x, max_y, max_z, n_points=100): boxm2_batch.init_process("vpglComputeAffineFromRationalProcess"); boxm2_batch.set_input_from_db(0, cropped_cam); boxm2_batch.set_input_double(1, min_x); boxm2_batch.set_input_double(2, min_y); boxm2_batch.set_input_double(3, min_z); boxm2_batch.set_input_double(4, max_x); boxm2_batch.set_input_double(5, max_y); boxm2_batch.set_input_double(6, max_z); boxm2_batch.set_input_unsigned(7, n_points); boxm2_batch.run_process(); (id, type) = boxm2_batch.commit_output(0); out_cam = dbvalue(id, type); return out_cam
def create_perspective_camera( scale, ppoint, center, look_pt,up = [0,1,0] ) : boxm2_batch.init_process("vpglCreatePerspectiveCameraProcess"); boxm2_batch.set_input_double(0, scale[0]); boxm2_batch.set_input_double(1, ppoint[0]); boxm2_batch.set_input_double(2, scale[1]); boxm2_batch.set_input_double(3, ppoint[1]); boxm2_batch.set_input_double(4, center[0]); boxm2_batch.set_input_double(5, center[1]); boxm2_batch.set_input_double(6, center[2]); boxm2_batch.set_input_double(7, look_pt[0]); boxm2_batch.set_input_double(8, look_pt[1]); boxm2_batch.set_input_double(9, look_pt[2]); boxm2_batch.run_process(); (id,type) = boxm2_batch.commit_output(0); cam = dbvalue(id,type); return cam;
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 compute_affine_from_local_rational(cropped_cam, min_x, min_y, min_z, max_x, max_y, max_z, n_points=100): boxm2_batch.init_process("vpglComputeAffineFromRationalProcess") boxm2_batch.set_input_from_db(0, cropped_cam) boxm2_batch.set_input_double(1, min_x) boxm2_batch.set_input_double(2, min_y) boxm2_batch.set_input_double(3, min_z) boxm2_batch.set_input_double(4, max_x) boxm2_batch.set_input_double(5, max_y) boxm2_batch.set_input_double(6, max_z) boxm2_batch.set_input_unsigned(7, n_points) boxm2_batch.run_process() (id, type) = boxm2_batch.commit_output(0) out_cam = dbvalue(id, type) return out_cam
def vrml_write_box(vrml_filename, bbox, is_wire, r, g, b): boxm2_batch.init_process("bvrmlWriteBoxProcess") boxm2_batch.set_input_string(0, vrml_filename) boxm2_batch.set_input_double(1, bbox[0]) # minx boxm2_batch.set_input_double(2, bbox[1]) # miny boxm2_batch.set_input_double(3, bbox[2]) # minz boxm2_batch.set_input_double(4, bbox[3]) # maxx boxm2_batch.set_input_double(5, bbox[4]) # maxy boxm2_batch.set_input_double(6, bbox[5]) # maxz boxm2_batch.set_input_bool(7, is_wire) boxm2_batch.set_input_float(8, r) boxm2_batch.set_input_float(9, g) boxm2_batch.set_input_float(10, b) boxm2_batch.run_process()