コード例 #1
0
ファイル: test_cooker.cpp プロジェクト: snumrl/TillingPatch
TEST(Ingredient, DISABLED_cook_patches)
{
  Ingredient * ingre = new Ingredient();
  //mix_by_itself(*ingre);
  mix_raw_data(*ingre);
  cout << "motion size: " << ingre->size_mot() << " & " << "posture size: " << ingre->size_pos() << endl;
  PatchCooker cooker_(ingre);

  time_t start_time;
  time(&start_time);
  vector<pair_section> psec = cooker_.init_interactions();
  time_t cur_time;
  time(&cur_time);
  cout << "Interactions Detecting time is " << difftime(cur_time, start_time) << endl; 

  cooker_.init_EETable();

  time_t mid_time;
  time(&mid_time);
  cooker_.agglomerative_cluster();
  time(&cur_time);
  cout << "Clustering time is " << difftime(cur_time, mid_time) << endl; 

  /*size_t boundary_pose_size = 6;
  cooker_.mold_motion_patches(boundary_pose_size);
  cooker_.cook_motion_patches();*/
  cooker_.tcook_motion_patches();
  time(&cur_time);
  cout << "Total time is " << difftime(cur_time, start_time) << endl; 

  if (!cooker_.patches->empty()) {
	cooker_.evaluate_this_system();
	string save_file_str = "cooked_rawData_chicken_6";
	//write_patches(cooker_.get_all_patches(), save_file_str);
	PatchesViewer * v = new PatchesViewer(cooker_.get_all_patches());
	//v->set_origin_motions(cooker_);
	v->get_camera().distance += 2;		
  }

  for (size_t i = 0; i < ingre->bunch_size(); ++i) {
	vector<pair_section> bunch_sect;
	for (auto it = psec.begin(); it != psec.end(); ++it) {
	  if (it->bunch_idx == i) {
		bunch_sect.push_back(*it);
	  }
	}
	MotionsViewer * v = new MotionsViewer(ingre->raw_before_cook[i]);
	v->interact_pair = bunch_sect;
	v->get_camera().distance += 2;
  } 
}
コード例 #2
0
ファイル: test_cooker.cpp プロジェクト: snumrl/TillingPatch
TEST(Ingredient, DISABLED_comb_determine)
{
  Ingredient * ingre = new Ingredient();
  //mix_by_itself(*ingre);
  mix_raw_data(*ingre);
  cout << "motion size: " << ingre->size_mot() << " & " << "posture size: " << ingre->size_pos() << endl;
  PatchCooker cooker_(ingre);

  time_t start_time;
  time(&start_time);
  vector<pair_section> psec = cooker_.init_interactions();
  time_t cur_time;
  time(&cur_time);
  cout << "Interactions Detecting time is " << difftime(cur_time, start_time) << endl; 

  cooker_.init_EETable();

  time_t mid_time;
  time(&mid_time);
  cooker_.agglomerative_cluster(3.5);
  time(&cur_time);
  cout << "Clustering time is " << difftime(cur_time, mid_time) << endl; 

  cooker_.comb_cook_motion_patches(4);
  time(&cur_time);
  cout << "Total time is " << difftime(cur_time, start_time) << endl; 
  
  vector<pair_section> bunch_sect;
  for (size_t i = 0; i < ingre->bunch_size(); ++i) {	
	for (auto it = psec.begin(); it != psec.end(); ++it) {
	  if (it->bunch_idx == i) {
		bunch_sect.push_back(*it);
	  }
	}	
	MotionsViewer * v = new MotionsViewer(ingre->raw_before_cook[i]);
	v->interact_pair = bunch_sect;
	v->get_camera().distance += 2;	
  }
  if (!cooker_.patches->empty()) {
	cooker_.evaluate_this_system();	
	PatchesViewer * pv = new PatchesViewer(cooker_.get_all_patches());
	pv->interact_pair = bunch_sect;
	pv->set_origin_motions(cooker_);
	pv->get_camera().distance += 2;	
  }
}
コード例 #3
0
ファイル: test_cooker.cpp プロジェクト: snumrl/TillingPatch
TEST(Ingredient, DISABLED_combi_save_patches)
{
  Ingredient * ingre = new Ingredient();
  //mix_by_itself(*ingre);
  mix_raw_data(*ingre);
  cout << "motion size: " << ingre->size_mot() << " & " << "posture size: " << ingre->size_pos() << endl;
  PatchCooker cooker_(ingre);

  time_t start_time;
  time(&start_time);
  vector<pair_section> psec = cooker_.init_interactions();
  time_t cur_time;
  time(&cur_time);
  cout << "Interactions Detecting time is " << difftime(cur_time, start_time) << endl; 

  cooker_.init_EETable();

  time_t mid_time;
  time(&mid_time);
  cooker_.agglomerative_cluster();
  time(&cur_time);
  cout << "Clustering time is " << difftime(cur_time, mid_time) << endl; 

  cooker_.comb_cook_motion_patches();
  time(&cur_time);
  cout << "Total time is " << difftime(cur_time, start_time) << endl; 

  if (!cooker_.patches->empty()) {
	cooker_.evaluate_this_system();	
	
	string save_file_str = "cooked_rawData_chicken_combi_6";
	write_patches(cooker_.get_all_patches(), save_file_str);

	PatchesViewer * v = new PatchesViewer(cooker_.get_all_patches());
	//v->set_origin_motions(cooker_);
	v->get_camera().distance += 2;	
  }
}