本文整理汇总了C++中TicToc::toc_print方法的典型用法代码示例。如果您正苦于以下问题:C++ TicToc::toc_print方法的具体用法?C++ TicToc::toc_print怎么用?C++ TicToc::toc_print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TicToc
的用法示例。
在下文中一共展示了TicToc::toc_print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: green
void
view (const CloudConstPtr &src, const CloudConstPtr &tgt, const CorrespondencesPtr &correspondences)
{
if (!visualize || !vis) return;
PointCloudColorHandlerCustom<PointT> green (tgt, 0, 255, 0);
if (!vis->updatePointCloud<PointT> (src, "source"))
{
vis->addPointCloud<PointT> (src, "source");
vis->resetCameraViewpoint ("source");
}
if (!vis->updatePointCloud<PointT> (tgt, green, "target")) vis->addPointCloud<PointT> (tgt, green, "target");
vis->setPointCloudRenderingProperties (PCL_VISUALIZER_OPACITY, 0.5, "source");
vis->setPointCloudRenderingProperties (PCL_VISUALIZER_OPACITY, 0.7, "target");
vis->setPointCloudRenderingProperties (PCL_VISUALIZER_POINT_SIZE, 6, "source");
TicToc tt;
tt.tic ();
if (!vis->updateCorrespondences<PointT> (src, tgt, *correspondences, 1))
vis->addCorrespondences<PointT> (src, tgt, *correspondences, 1, "correspondences");
tt.toc_print ();
vis->setShapeRenderingProperties (PCL_VISUALIZER_LINE_WIDTH, 5, "correspondences");
//vis->setShapeRenderingProperties (PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, "correspondences");
vis->spin ();
}
示例2: camera
void
display ()
{
float* reference = new float[range_likelihood_->getRowHeight () * range_likelihood_->getColWidth ()];
const float* depth_buffer = range_likelihood_->getDepthBuffer ();
// Copy one image from our last as a reference.
for (int i = 0, n = 0; i < range_likelihood_->getRowHeight (); ++i)
{
for (int j = 0; j < range_likelihood_->getColWidth (); ++j)
{
reference[n++] = depth_buffer[ (i + range_likelihood_->getRowHeight () * range_likelihood_->getRows () / 2) * range_likelihood_->getWidth ()
+ j + range_likelihood_->getColWidth () * range_likelihood_->getCols () / 2];
}
}
float* reference_vis = new float[range_likelihood_visualization_->getRowHeight () * range_likelihood_visualization_->getColWidth ()];
const float* depth_buffer_vis = range_likelihood_visualization_->getDepthBuffer ();
// Copy one image from our last as a reference.
for (int i = 0, n = 0; i < range_likelihood_visualization_->getRowHeight (); ++i)
{
for (int j = 0; j < range_likelihood_visualization_->getColWidth (); ++j)
{
reference_vis[n++] = depth_buffer_vis[i*range_likelihood_visualization_->getWidth () + j];
}
}
std::vector<Eigen::Isometry3d, Eigen::aligned_allocator<Eigen::Isometry3d> > poses;
std::vector<float> scores;
// Render a single pose for visualization
poses.clear ();
poses.push_back (camera_->getPose ());
range_likelihood_visualization_->computeLikelihoods (reference_vis, poses, scores);
glDrawBuffer (GL_BACK);
glReadBuffer (GL_BACK);
// Draw the resulting images from the range_likelihood
glViewport (range_likelihood_visualization_->getWidth (), 0,
range_likelihood_visualization_->getWidth (), range_likelihood_visualization_->getHeight ());
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
// Draw the color image
glColorMask (true, true, true, true);
glClearColor (0, 0, 0, 0);
glClearDepth (1);
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDisable (GL_DEPTH_TEST);
glRasterPos2i (-1,-1);
glDrawPixels (range_likelihood_visualization_->getWidth (), range_likelihood_visualization_->getHeight (),
GL_RGB, GL_UNSIGNED_BYTE, range_likelihood_visualization_->getColorBuffer ());
// Draw the depth image
glViewport (0, 0, range_likelihood_visualization_->getWidth (), range_likelihood_visualization_->getHeight ());
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
display_depth_image (range_likelihood_visualization_->getDepthBuffer (),
range_likelihood_visualization_->getWidth (), range_likelihood_visualization_->getHeight ());
poses.clear ();
for (int i = 0; i < range_likelihood_->getRows (); ++i)
{
for (int j = 0; j < range_likelihood_->getCols (); ++j)
{
Camera camera (*camera_);
camera.move ((j - range_likelihood_->getCols () / 2.0) * 0.1,
(i - range_likelihood_->getRows () / 2.0) * 0.1,
0.0);
poses.push_back (camera.getPose ());
}
}
std::cout << std::endl;
TicToc tt;
tt.tic();
range_likelihood_->computeLikelihoods (reference, poses, scores);
tt.toc();
tt.toc_print();
if (gllib::getGLError () != GL_NO_ERROR)
{
std::cerr << "GL Error: RangeLikelihood::computeLikelihoods: finished" << std::endl;
}
#if 0
std::cout << "score: ";
for (size_t i = 0; i < scores.size (); ++i)
{
std::cout << " " << scores[i];
}
std::cout << std::endl;
#endif
//.........这里部分代码省略.........