当前位置: 首页>>代码示例>>C++>>正文


C++ ModelManager::stop方法代码示例

本文整理汇总了C++中ModelManager::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelManager::stop方法的具体用法?C++ ModelManager::stop怎么用?C++ ModelManager::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelManager的用法示例。


在下文中一共展示了ModelManager::stop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
                */

                /* Activate the accelerometer when the 'A' key is pressed. */
                //if (wiimote.keys.a) {
                //        wiimote.mode.acc = 1;
                //}
                //else {
                //        wiimote.mode.acc = 0;
                //}


   // Image<PixRGB<byte> > img(255,255,ZEROS);

//    drawLine(img, Point2D<int>(128, 128), Point2D<int>(128+(int)(wiimote.force.x*400), 128), PixRGB<byte>(255,0,0),3);
//    drawLine(img, Point2D<int>(128, 128), Point2D<int>(128, 128+(int)(wiimote.force.y*400)), PixRGB<byte>(0,255,0),3);
//    drawLine(img, Point2D<int>(128, 128), Point2D<int>(128+(int)(wiimote.force.z*400), 128), PixRGB<byte>(0,0,255),3);

   // ofs->writeRGB(img, "Output", FrameInfo("output", SRC_POS));

 /*
    int key = getKey(ofs);
    if (key != -1)
    {
      switch(key)
      {
        case 10:  //l
          speed += 10;
          break;
        case 24:
          speed -= 10;
          break;
        case KEY_UP:
          motor1_dir = 2;
          motor2_dir = 2;
          break;
        case KEY_DOWN:
          motor1_dir = 1;
          motor2_dir = 1;
          break;
        case KEY_LEFT:
          motor1_dir = 2;
          motor2_dir = 1;
          break;
        case KEY_RIGHT:
          motor1_dir = 1;
          motor2_dir = 2;
          break;
        case 65: //space
          motor1_dir = 4; motor1_vel = 0;
          motor2_dir = 4; motor2_vel = 0;
          break;

      }
        LINFO("Key: %d  -- Sending Motor Command...", key);
    //send the data to the wiimote
    wiimote_write_byte(&wiimote, 0x04a40001, motor1_dir);
    wiimote_write_byte(&wiimote, 0x04a40002, speed);
    wiimote_write_byte(&wiimote, 0x04a40003, motor2_dir);
    wiimote_write_byte(&wiimote, 0x04a40004, speed);
    }*/



          /*
                LINFO("KEYS %04x one=%d two=%d a=%d b=%d <=%d >=%d ^=%d v=%d h=%d +=%d -=%d\n",
                        wiimote.keys.bits,
                        wiimote.keys.one,
                        wiimote.keys.two,
                        wiimote.keys.a,
                        wiimote.keys.b,
                        wiimote.keys.left,
                        wiimote.keys.right,
                        wiimote.keys.up,
                        wiimote.keys.down,
                        wiimote.keys.home,
                        wiimote.keys.plus,
                        wiimote.keys.minus);

                LINFO("TILT x=%.3f y=%.3f z=%.3f\n",
                        wiimote.tilt.x,
                        wiimote.tilt.y,
                        wiimote.tilt.z);

                LINFO("FORCE x=%.3f y=%.3f z=%.3f (sum=%.3f)\n",
                        wiimote.force.x,
                        wiimote.force.y,
                        wiimote.force.z,
      sqrt(wiimote.force.x*wiimote.force.x+wiimote.force.y*wiimote.force.y+wiimote.force.z*wiimote.force.z));*/

//  }

  // stop all our ModelComponents
  manager->stop();
#else
  LFATAL("Need the libwiimote");
#endif

  // all done!
  return 0;
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:101,代码来源:test-pwiibot.C

示例2: main

int main(const int argc, const char **argv)
{
  MYLOGVERB = LOG_INFO;
  ModelManager *mgr = new ModelManager("Test ObjRec");

  nub::ref<OutputFrameSeries> ofs(new OutputFrameSeries(*mgr));
  mgr->addSubComponent(ofs);

  nub::ref<InputFrameSeries> ifs(new InputFrameSeries(*mgr));
  mgr->addSubComponent(ifs);

  nub::ref<EnvSegmenterCannyContour> seg(new EnvSegmenterCannyContour(*mgr));
  mgr->addSubComponent(seg);

  mgr->exportOptions(MC_RECURSE);

  if (mgr->parseCommandLine(
        (const int)argc, (const char**)argv, "", 0, 0) == false)
    return 1;

  mgr->start();

  seg->setModelParamVal("CannyMinCos", 1.0);
  seg->setModelParamVal("CannyMaxArea", 6000);
  seg->setModelParamVal("CannyMaxArea", 12000);

  itsObjectDB.loadFrom("cards.vdb");
  while(1)
  {
    Image< PixRGB<byte> > inputImg;
    const FrameState is = ifs->updateNext();
    if (is == FRAME_COMPLETE)
      break;

    //grab the images
    GenericFrame input = ifs->readFrame();
    if (!input.initialized())
      break;
    inputImg = input.asRgb();

    Image<PixRGB<byte> > out;

    const Rectangle cardbox = seg->getFoa(inputImg, Point2D<int>(), NULL, &out);

    ofs->writeRGB(out, "input", FrameInfo("input", SRC_POS));

    if (cardbox.isValid())
    {
      Image<PixRGB<byte> > card =
        crop(inputImg, cardbox.getOverlap(inputImg.getBounds()));

      std::string cardName = recCard(card);

      if (cardName.length() == 0)
      {
        LINFO("Enter name for card:");
        std::getline(std::cin, cardName, '\n');

        if (cardName.length() > 0)
          trainCard(card, cardName);
      }

      writeText(card, Point2D<int>(0,0), cardName.c_str(),
          PixRGB<byte>(255), PixRGB<byte>(127));

      ofs->writeRGB(card, "card", FrameInfo("card", SRC_POS));
    }

    ofs->updateNext();
  }
  mgr->stop();

  return 0;

}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:75,代码来源:test-cardRec.C


注:本文中的ModelManager::stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。