Пример #1
0
static void writeLinemod(const cv::Ptr<cv::linemod::Detector>& detector, const std::string& filename)
{
  cv::FileStorage fs(filename, cv::FileStorage::WRITE);
  detector->write(fs);

  std::vector<cv::String> ids = detector->classIds();
  fs << "classes" << "[";
  for (int i = 0; i < (int)ids.size(); ++i)
  {
    fs << "{";
    detector->writeClass(ids[i], fs);
    fs << "}"; // current class
  }
  fs << "]"; // classes
}
Пример #2
0
static void
writeLinemod (const cv::Ptr<cv::linemod::Detector>& detector,
              const std::string& filename)
{
  std::cout << "IN WRITE LINEMOD FUNCTION ...\n";

  cv::FileStorage fs (filename, cv::FileStorage::WRITE);
  detector->write (fs);

  std::vector<std::string> ids = detector->classIds ();
  fs << "classes" << "[";
//  std::cout << "classes" << "[";
  for (int i = 0; i < (int) ids.size (); ++i)
  {
    fs << "{";
    detector->writeClass (ids[i], fs);
    fs << "}";  // current class
  }
  fs << "]";  // classes

  fs.release ();
}