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


C++ SimpleOpenNIViewer::run方法代码示例

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


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

示例1:

int 
main ()
 {
   SimpleOpenNIViewer v;
   v.run ();
   return 0;
 } 
开发者ID:nikyarora,项目名称:Stanford-Robotics-Lab-Project,代码行数:7,代码来源:simple_openni_viewer.cpp

示例2: main

int main(int argc, char* argv[])
{
    std::cout << "Press 's' key to capture a pcd\n";
    
    if( argc > 4 )
    {
        help(argv[0]);
        return 0;
    }
    else
    {
        for(int i = 1; i < argc; i++ )
        {
	  const char* s = argv[i];
	  
	  if( strcmp( s, "-f" ) == 0 )
	  {
	      i++;
	      filename = argv[i];
	  }
	  else
	  {
	      help(argv[0]);
	      return fprintf( stderr, "Unknown option %s\n", s ), -1;
	  }
        }
    }
    
    SimpleOpenNIViewer v;
    v.run ();
    
    return 0;
}
开发者ID:josetascon,项目名称:mop,代码行数:33,代码来源:capture_pcd.cpp

示例3: num_cameras

int
main (int argc, char** argv)
{
  // Default values
  int num_cameras(1);

  /*
   * Parse command line arguments
   */
  if (pcl::console::find_argument (argc, argv, "-h") >= 0)
  {
    printUsage (argv[0]);
    return 0;
  }

  // Number of cameras
  if (pcl::console::find_argument(argc, argv, "-n") >= 0)
  {
    pcl::console::parse_argument(argc, argv, "-n", num_cameras);
  }

  SimpleOpenNIViewer v (num_cameras);
  v.run ();
  return 0;
}
开发者ID:peyton,项目名称:darpa-planning,代码行数:25,代码来源:main.cpp

示例4: main

 int main (int argc, char* argv[])
 {
	assert(argc > 1);
	id = (atoi(argv[1]));
   SimpleOpenNIViewer v;
   v.run ();
   return 0;
 }
开发者ID:cerdogan,项目名称:multikinect,代码行数:8,代码来源:01-cloudViewer.cpp

示例5: main

int main ()
{
	boost::thread workerThread(visualize); 
	SimpleOpenNIViewer v;
	v.run ();
    workerThread.join();  
	return 0;
}
开发者ID:khaledhady,项目名称:Kinstruct,代码行数:8,代码来源:openni_writer.cpp

示例6: return

int
main (int, char **)
{
  SimpleOpenNIViewer v;
  v.run ();

  return (0);
}
开发者ID:taketwo,项目名称:pcl,代码行数:8,代码来源:openni_shift_to_depth_conversion.cpp

示例7: return

int
main (int argc, char **argv)
{
  SimpleOpenNIViewer v;
  v.run ();

  return (0);
}
开发者ID:yutarochan,项目名称:dev-platform,代码行数:8,代码来源:point_cloud_compression.cpp

示例8: main

/* ******************************************************************************************** */
int main (int argc, char* argv[]) {
	assert(argc > 1);
	id = (atoi(argv[1]));
	pthread_mutex_init(&lock, NULL);
	pthread_mutex_init(&lock2, NULL);
	SimpleOpenNIViewer v;
	v.run ();
	return 0;
}
开发者ID:cerdogan,项目名称:multikinect,代码行数:10,代码来源:05-detectBall.cpp

示例9: main

 int main ()
 {
	InitSharedMemory();
	SimpleOpenNIViewer v;
   
	//pcl::gpu::printShortCudaDeviceInfo
   
	v.run ();
	return 0;
 }
开发者ID:dalek7,项目名称:Algorithms,代码行数:10,代码来源:openni_grabber.cpp

示例10: field_name


//.........这里部分代码省略.........
      // apply profile settings
      pointResolution = selectedProfile.pointResolution;
      octreeResolution = float (selectedProfile.octreeResolution);
      doVoxelGridDownDownSampling = selectedProfile.doVoxelGridDownSampling;
      iFrameRate = selectedProfile.iFrameRate;
      doColorEncoding = selectedProfile.doColorEncoding;
      colorBitResolution = selectedProfile.colorBitResolution;
    }
  }

  if (pcl::console::find_argument (argc, argv, "-?")>0) 
  {
    print_usage ("");
    return 1;
  }

  if (!validArguments)
  {
    print_usage ("Please specify compression mode..\n");
    return -1;
  }

  octreeCoder = new OctreePointCloudCompression<PointXYZRGBA> (compressionProfile, showStatistics, pointResolution,
                                                               octreeResolution, doVoxelGridDownDownSampling, iFrameRate,
                                                               doColorEncoding, static_cast<unsigned char> (colorBitResolution));


  if (!bServerFileMode) 
  {
    if (bEnDecode) 
    {
      // ENCODING
      ofstream compressedPCFile;
      compressedPCFile.open (fileName.c_str(), ios::out | ios::trunc | ios::binary);

      if (!bShowInputCloud) 
      {
        EventHelper v (compressedPCFile, octreeCoder, field_name, min_v, max_v);
        v.run ();
      } 
      else
      {
        SimpleOpenNIViewer v (compressedPCFile, octreeCoder);
        v.run ();
      }

    } else
    {
      // DECODING
      ifstream compressedPCFile;
      compressedPCFile.open (fileName.c_str(), ios::in | ios::binary);
      compressedPCFile.seekg (0);
      compressedPCFile.unsetf (ios_base::skipws);

      pcl::visualization::CloudViewer viewer ("PCL Compression Viewer");

      while (!compressedPCFile.eof())
      {
        PointCloud<PointXYZRGBA>::Ptr cloudOut (new PointCloud<PointXYZRGBA> ());
        octreeCoder->decodePointCloud ( compressedPCFile, cloudOut);
        viewer.showCloud (cloudOut);
      }
    }
  } else
  {
    // switch to ONLINE profiles
开发者ID:hitsjt,项目名称:StanfordPCL,代码行数:67,代码来源:openni_octree_compression.cpp

示例11: device_id

int
main (int argc, char ** argv)
{
    std::string device_id ("");
    pcl::OpenNIGrabber::Mode image_mode = pcl::OpenNIGrabber::OpenNI_Default_Mode;

    if (argc >= 2)
    {
        device_id = argv[1];
        if (device_id == "--help" || device_id == "-h")
        {
            usage (argv);
            return (0);
        }
        else if (device_id == "-l")
        {
            if (argc >= 3)
            {
                pcl::OpenNIGrabber grabber (argv[2]);
                boost::shared_ptr<openni_wrapper::OpenNIDevice> device = grabber.getDevice ();
                std::vector<std::pair<int, XnMapOutputMode> > modes;

                if (device->hasImageStream ())
                {
                    cout << endl << "Supported image modes for device: " << device->getVendorName () << " , " << device->getProductName () << endl;
                    modes = grabber.getAvailableImageModes ();
                    for (std::vector<std::pair<int, XnMapOutputMode> >::const_iterator it = modes.begin (); it != modes.end (); ++it)
                    {
                        cout << it->first << " = " << it->second.nXRes << " x " << it->second.nYRes << " @ " << it->second.nFPS << endl;
                    }
                }
            }
            else
            {
                openni_wrapper::OpenNIDriver& driver = openni_wrapper::OpenNIDriver::getInstance ();
                if (driver.getNumberDevices () > 0)
                {
                    for (unsigned deviceIdx = 0; deviceIdx < driver.getNumberDevices (); ++deviceIdx)
                    {
                        cout << "Device: " << deviceIdx + 1 << ", vendor: " << driver.getVendorName (deviceIdx) << ", product: " << driver.getProductName (deviceIdx)
                             << ", connected: " << driver.getBus (deviceIdx) << " @ " << driver.getAddress (deviceIdx) << ", serial number: \'" << driver.getSerialNumber (deviceIdx) << "\'" << endl;
                    }

                }
                else
                    cout << "No devices connected." << endl;

                cout <<"Virtual Devices available: ONI player" << endl;
            }
            return (0);
        }
    }
    else
    {
        openni_wrapper::OpenNIDriver& driver = openni_wrapper::OpenNIDriver::getInstance ();
        if (driver.getNumberDevices() > 0)
            cout << "Device Id not set, using first device." << endl;
    }

    unsigned mode;
    if (pcl::console::parse (argc, argv, "-imagemode", mode) != -1)
        image_mode = static_cast<pcl::OpenNIGrabber::Mode> (mode);

    pcl::OpenNIGrabber grabber (device_id, pcl::OpenNIGrabber::OpenNI_Default_Mode, image_mode);
    SimpleOpenNIViewer v (grabber);
    v.run ();

    return (0);
}
开发者ID:lloves,项目名称:PCL-1,代码行数:69,代码来源:openni_image.cpp

示例12: device_id

int
main(int argc, char ** argv)
{
  std::string device_id("");
  pcl::OpenNIGrabber::Mode depth_mode = pcl::OpenNIGrabber::OpenNI_Default_Mode;
  pcl::OpenNIGrabber::Mode image_mode = pcl::OpenNIGrabber::OpenNI_Default_Mode;
  bool xyz = false;
  
  if (argc >= 2)
  {
    device_id = argv[1];
    if (device_id == "--help" || device_id == "-h")
    {
      usage(argv);
      return 0;
    }
    else if (device_id == "-l")
    {
      if (argc >= 3)
      {
        pcl::OpenNIGrabber grabber(argv[2]);
        boost::shared_ptr<openni_wrapper::OpenNIDevice> device = grabber.getDevice();
        cout << "Supported depth modes for device: " << device->getVendorName() << " , " << device->getProductName() << endl;
        std::vector<std::pair<int, XnMapOutputMode > > modes = grabber.getAvailableDepthModes();
        for (std::vector<std::pair<int, XnMapOutputMode > >::const_iterator it = modes.begin(); it != modes.end(); ++it)
        {
          cout << it->first << " = " << it->second.nXRes << " x " << it->second.nYRes << " @ " << it->second.nFPS << endl;
        }

        if (device->hasImageStream ())
        {
          cout << endl << "Supported image modes for device: " << device->getVendorName() << " , " << device->getProductName() << endl;
          modes = grabber.getAvailableImageModes();
          for (std::vector<std::pair<int, XnMapOutputMode > >::const_iterator it = modes.begin(); it != modes.end(); ++it)
          {
            cout << it->first << " = " << it->second.nXRes << " x " << it->second.nYRes << " @ " << it->second.nFPS << endl;
          }
        }
      }
      else
      {
        openni_wrapper::OpenNIDriver& driver = openni_wrapper::OpenNIDriver::getInstance();
        if (driver.getNumberDevices() > 0)
        {
          for (unsigned deviceIdx = 0; deviceIdx < driver.getNumberDevices(); ++deviceIdx)
          {
            cout << "Device: " << deviceIdx + 1 << ", vendor: " << driver.getVendorName(deviceIdx) << ", product: " << driver.getProductName(deviceIdx)
              << ", connected: " << (int) driver.getBus(deviceIdx) << " @ " << (int) driver.getAddress(deviceIdx) << ", serial number: \'" << driver.getSerialNumber(deviceIdx) << "\'" << endl;
          }

        }
        else
          cout << "No devices connected." << endl;
        
        cout <<"Virtual Devices available: ONI player" << endl;
      }
      return 0;
    }
  }
  else
  {
    openni_wrapper::OpenNIDriver& driver = openni_wrapper::OpenNIDriver::getInstance();
    if (driver.getNumberDevices() > 0)
      cout << "Device Id not set, using first device." << endl;
  }
  
  unsigned mode;
  if (pcl::console::parse(argc, argv, "-depthmode", mode) != -1)
    depth_mode = (pcl::OpenNIGrabber::Mode) mode;

  if (pcl::console::parse(argc, argv, "-imagemode", mode) != -1)
    image_mode = (pcl::OpenNIGrabber::Mode) mode;
  
  if (pcl::console::find_argument(argc, argv, "-xyz") != -1)
    xyz = true;
  
  pcl::OpenNIGrabber grabber (device_id, depth_mode, image_mode);
  
  if (xyz) // only if xyz flag is set, since grabber provides at least XYZ and XYZI pointclouds
  {
    SimpleOpenNIViewer<pcl::PointXYZ> v (grabber);
    v.run ();
  }
  else if (grabber.providesCallback<pcl::OpenNIGrabber::sig_cb_openni_point_cloud_rgb> ())
  {
    SimpleOpenNIViewer<pcl::PointXYZRGBA> v (grabber);
    v.run ();
  }
  else
  {
    SimpleOpenNIViewer<pcl::PointXYZI> v (grabber);
    v.run ();
  }

  return (0);
}
开发者ID:diegodgs,项目名称:PCL,代码行数:96,代码来源:openni_viewer_simple.cpp

示例13: v

int
main (int argc, char **argv)
{
  OrganizedPointCloudCompression<PointXYZRGBA>* organizedCoder;

  bool showStatistics;
  bool doColorEncoding;
  bool bShowInputCloud;
  bool bRawImageEncoding;
  bool bGrayScaleConversion;

  std::string fileName = "pc_compressed.pcc";
  std::string hostName = "localhost";

  bool bServerFileMode;
  bool bEnDecode;
  bool validArguments;

  validArguments = false;
  bServerFileMode = false;
  bEnDecode = false;

  showStatistics = false;
  doColorEncoding = false;
  bShowInputCloud = false;
  bRawImageEncoding = false;
  bGrayScaleConversion = false;

  if (pcl::console::find_argument (argc, argv, "-e")>0) 
    bShowInputCloud = true;

  if (pcl::console::find_argument (argc, argv, "-r")>0)
    bRawImageEncoding = true;

  if (pcl::console::find_argument (argc, argv, "-g")>0)
    bGrayScaleConversion = true;

  if (pcl::console::find_argument (argc, argv, "-s")>0) 
  {
    bEnDecode = true;
    bServerFileMode = true;
    validArguments = true;
  }

  if (pcl::console::parse_argument (argc, argv, "-c", hostName)>0) 
  {
    bEnDecode = false;
    bServerFileMode = true;
    validArguments = true;
  }

  if (pcl::console::find_argument (argc, argv, "-a")>0)
  {
    doColorEncoding = true;
  }

  if (pcl::console::find_argument (argc, argv, "-x")>0) 
  {
    bEnDecode = true;
    bServerFileMode = false;
    validArguments = true;
  }

  if (pcl::console::find_argument (argc, argv, "-d")>0) 
  {
    bEnDecode = false;
    bServerFileMode = false;
    validArguments = true;
  }

  if (pcl::console::find_argument (argc, argv, "-t")>0) 
    showStatistics = true;

  pcl::console::parse_argument (argc, argv, "-f", fileName);


  if (pcl::console::find_argument (argc, argv, "-?")>0) 
  {
    print_usage ("");
    return 1;
  }

  if (!validArguments)
  {
    print_usage ("Please specify compression mode..\n");
    return -1;
  }

  organizedCoder = new OrganizedPointCloudCompression<PointXYZRGBA> ();


  if (!bServerFileMode) 
  {
    if (bEnDecode) 
    {
      // ENCODING
      ofstream compressedPCFile;
      compressedPCFile.open (fileName.c_str(), ios::out | ios::trunc | ios::binary);

      if (!bShowInputCloud) 
//.........这里部分代码省略.........
开发者ID:PointCloudLibrary,项目名称:pcl,代码行数:101,代码来源:openni_organized_compression.cpp


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