print bof_dir sys.exit(-1) if not os.path.isdir(k_means_dir + "/"): print "Invalid k-means Dir" sys.exit(-1) if not os.path.isdir(class_histograms_dir + "/"): os.mkdir(class_histograms_dir + "/") # initial starting point means codebook_file = k_means_dir + "/lowest_sse_means.txt" dbrec3d_batch.init_process("bofInitCodebookProcess") dbrec3d_batch.set_input_string(0, codebook_file) dbrec3d_batch.run_process() (id, type) = dbrec3d_batch.commit_output(0) codebook = dbvalue(id, type) # load category info dbrec3d_batch.init_process("bofLoadCategoryInfoProces") dbrec3d_batch.set_input_string(0, bof_dir) dbrec3d_batch.set_input_string(1, "bof_info_train.xml") dbrec3d_batch.set_input_string(2, "bof_category_train_info.xml") dbrec3d_batch.run_process() (id, type) = dbrec3d_batch.commit_output(0) categories = dbvalue(id, type) # parse the number of scenes bof_info_file = bof_dir + "/bof_info_train.xml" nscenes = parse_bof_info(bof_info_file) print "Number of Scenes:"
axes_x=[-1.0,0.0,0.0]; axes_y=[0.0,-1.0,0.0]; axes_z=[0.0,0.0,-1.0]; angle = 0.0; i=1; axis_x = axes_x[i]; axis_y = axes_y[i]; axis_z = axes_z[i]; print("Creating Scene"); dbrec3d_batch.init_process("boxmCreateSceneProcess"); dbrec3d_batch.set_input_string(0, model_dir +"/gauss_response_scene.xml"); dbrec3d_batch.run_process(); (scene_id, scene_type) = dbrec3d_batch.commit_output(0); kernel_scene= dbvalue(scene_id, scene_type); print("Creating 3D edge kernel"); dbrec3d_batch.init_process("bvplCreateEdge3dKernelProcess"); dbrec3d_batch.set_input_int(0,min_x); dbrec3d_batch.set_input_int(1,max_x); dbrec3d_batch.set_input_int(2,min_y); dbrec3d_batch.set_input_int(3,max_y); dbrec3d_batch.set_input_int(4,min_z); dbrec3d_batch.set_input_int(5,max_z); dbrec3d_batch.set_input_float(6,axis_x); dbrec3d_batch.set_input_float(7,axis_y); dbrec3d_batch.set_input_float(8,axis_z); dbrec3d_batch.set_input_float(9,angle); dbrec3d_batch.run_process();
min_y = -30; max_y = 30; min_z = -15; max_z = 15; axes_x=[-1.0,0.0,0.0]; axes_y=[0.0,-1.0,0.0]; axes_z=[0.0,0.0,-1.0]; angle = 0.0; axis_x = axes_x[0]; axis_y = axes_y[0]; axis_z = axes_z[0]; print("Creating 3D edge kernel"); dbrec3d_batch.init_process("bvplCreateEdge3dKernelProcess"); dbrec3d_batch.set_input_int(0,min_x); dbrec3d_batch.set_input_int(1,max_x); dbrec3d_batch.set_input_int(2,min_y); dbrec3d_batch.set_input_int(3,max_y); dbrec3d_batch.set_input_int(4,min_z); dbrec3d_batch.set_input_int(5,max_z); dbrec3d_batch.set_input_float(6,axis_x); dbrec3d_batch.set_input_float(7,axis_y); dbrec3d_batch.set_input_float(8,axis_z); dbrec3d_batch.set_input_float(9,angle); dbrec3d_batch.run_process(); (kernel_id,kernel_type)= dbrec3d_batch.commit_output(0); kernel = dbvalue(kernel_id,kernel_type);
grad_scene_path = "/Users/isa/Experiments/boxm_scili_full/steerable_filters_alpha/steerable_gauss_3d_scene.xml" valid_scene_path = "/Users/isa/Experiments/boxm_scili_full/steerable_filters_alpha/valid_scene.xml" pcd_file = "/Users/isa/Experiments/pcl/tests/boxm_scili_full.pcd" #/Users/isa/Experiments/boxm_cit_only_filtered/steerable_filters_alpha # #grad_scene_path = "/Users/isa/Experiments/helicopter_providence/boxm_scenes/site12/steerable_filters_alpha/steerable_gauss_3d_scene.xml" #valid_scene_path= "/Users/isa/Experiments/helicopter_providence/boxm_scenes/site12/steerable_filters_alpha/valid_scene.xml" #pcd_file = "/Users/isa/Experiments/pcl/tests/site_12.pcd" #load gradient scene print("Creating a Scene"); dbrec3d_batch.init_process("boxmCreateSceneProcess"); dbrec3d_batch.set_input_string(0, grad_scene_path); dbrec3d_batch.run_process(); (scene_id, scene_type) = dbrec3d_batch.commit_output(0); grad_scene= dbvalue(scene_id, scene_type); #load valid scene dbrec3d_batch.init_process("boxmCreateSceneProcess"); dbrec3d_batch.set_input_string(0, valid_scene_path); dbrec3d_batch.run_process(); (scene_id, scene_type) = dbrec3d_batch.commit_output(0); valid_scene= dbvalue(scene_id, scene_type); dbrec3d_batch.init_process("pcl_convert_scene_to_pc_process"); dbrec3d_batch.set_input_from_db(0, grad_scene); dbrec3d_batch.set_input_from_db(1, valid_scene); dbrec3d_batch.set_input_string(2, pcd_file); dbrec3d_batch.run_process();