コード例 #1
0
 /// Export in two separate files the feats and their corresponding descriptors.
 bool saveToFile(
   const std::string& sfileNameFeats,
   const std::string& sfileNameDescs) const
 {
   return saveFeatsToFile(sfileNameFeats, _feats)
         & saveDescsToFile(sfileNameDescs, _descs);
 }
コード例 #2
0
ファイル: unit_test.cpp プロジェクト: ZhouCS/libvot
TEST(OpenmvgDescriptor, NONBINARY) {
  	// Create an input series of descriptor
  	Descs_T vec_descs;
  	for(int i = 0; i < CARD; ++i)  {
  		Desc_T desc;
  		for (int j = 0; j < DESC_LENGTH; ++j)
  			desc[j] = i*DESC_LENGTH+j;
  		vec_descs.push_back(desc);
  	}

  	//Save them to a file
  	saveDescsToFile("tempDescs.desc", vec_descs);

  	//Read the saved data and compare to input (to check write/read IO)
  	Descs_T vec_descs_read;
  	loadDescsFromFile("tempDescs.desc", vec_descs_read);
  	EXPECT_EQ(CARD, vec_descs_read.size());

  	for(int i = 0; i < CARD; ++i) 
  	{
  		for (int j = 0; j < DESC_LENGTH; ++j)
  			EXPECT_EQ(vec_descs[i][j], vec_descs_read[i][j]);
  	}
}