本文整理汇总了C++中pcl::visualization::PCLVisualizer::setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C++ PCLVisualizer::setBackgroundColor方法的具体用法?C++ PCLVisualizer::setBackgroundColor怎么用?C++ PCLVisualizer::setBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pcl::visualization::PCLVisualizer
的用法示例。
在下文中一共展示了PCLVisualizer::setBackgroundColor方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: viewerOneOff
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor (0.3, 0.3, 0.3);
viewer.addCoordinateSystem(1.0, 0);
viewer.initCameraParameters();
viewer.camera_.pos[2] = 30;
viewer.updateCamera();
}
示例2: initViewer
void initViewer(pcl::visualization::PCLVisualizer &viewer) {
viewer.setBackgroundColor(0, 0, 0);
viewer.addCoordinateSystem(1.0, "reference");
viewer.initCameraParameters();
viewer.setRepresentationToPointsForAllActors();
viewer.setCameraPosition(0, 0, -1, 0, 0, 0, 0, -1, 0);
viewer.registerKeyboardCallback(keyboardCallback);
}
示例3: main
int main(int argc, char* argv[]) {
if(argc < 3) {
PCL_ERROR("run as ./project /path/to/cloud1/ /path/to/cloud2/ [pcd format]");
return -1;
}
string fCloud1 = "";
string fCloud2 = "";
string models = "";
string training = "";
int NN;
pcl::console::parse_argument(argc, argv, "-cloud1", fCloud1);
pcl::console::parse_argument(argc, argv, "-cloud2", fCloud2);
pcl::console::parse_argument(argc, argv, "-models", models);
pcl::console::parse_argument(argc, argv, "-training", training);
pcl::console::parse_argument(argc, argv, "-nn", NN);
moi.setVerbose(true);
classificator.setModelsDir(models);
classificator.setTrainingDir(training);
classificator.setNN(NN);
classificator.setup();
viewer.registerKeyboardCallback(&keyboard_cb, NULL);
viewer.setBackgroundColor(0, 0, 0);
viewer.initCameraParameters();
if(fCloud1 != "" && fCloud2 != "") {
if(pcl::io::loadPCDFile<pcl::PointXYZ>(fCloud1, *cloud1) == -1) {
PCL_ERROR("Cloud1 reading failed\n");
return(-1);
}
if(pcl::io::loadPCDFile<pcl::PointXYZ>(fCloud2, *cloud2) == -1) {
PCL_ERROR("Cloud2 reading failed\n");
return(-1);
}
findObjectsAndClassify();
} else {
keyboardCbLock = false;
printInstructions();
}
while(!viewer.wasStopped()) {
viewer.spinOnce(100);
boost::this_thread::sleep (boost::posix_time::milliseconds(100));
}
return 0;
}
示例4: viewerOneOff
void viewerOneOff (pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor (1.0, 0.5, 1.0);
pcl::PointXYZ o;
o.x = 0;
o.y = 0;
o.z = 0;
viewer.addSphere (o, 0.25, "sphere", 0);
std::cout << "i only run once" << std::endl;
}
示例5: viewerOneOff
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(1.0, 0.5, 1.0);
pcl::PointXYZ pt;
pt.x = 1.0;
pt.y = 0;
pt.z = 0;
viewer.addSphere(pt, 0.25, "sphere", 0);
std::cout << "I only run once..." << std::endl;
}
示例6: PCDOrganizedMultiPlaneSegmentation
PCDOrganizedMultiPlaneSegmentation (typename pcl::PointCloud<PointT>::ConstPtr cloud_, bool refine)
: viewer ("Viewer")
, cloud (cloud_)
, refine_ (refine)
, threshold_ (0.02f)
, depth_dependent_ (true)
, polygon_refinement_ (false)
{
viewer.setBackgroundColor (0, 0, 0);
//viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "cloud");
//viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, 0.15, "cloud");
viewer.addCoordinateSystem (1.0, "global");
viewer.initCameraParameters ();
viewer.registerKeyboardCallback(&PCDOrganizedMultiPlaneSegmentation::keyboard_callback, *this, 0);
}
示例7:
void
initVisualizer (pcl::visualization::PCLVisualizer &viewer)
{
// Setting the initial viewer parameters
viewer.initCameraParameters ();
viewer.setBackgroundColor (0, 0, 0);
viewer.addCoordinateSystem (1000);
viewer.camera_.view[0] = 0;
viewer.camera_.view[1] = 0;
viewer.camera_.view[2] = 1;
viewer.camera_.pos[0] = 8000;
viewer.camera_.pos[1] = 20000;
viewer.camera_.pos[2] = 2500;
viewer.updateCamera ();
viewer.addText ("Shift + click to select noisy objects. \nPress 0 to confirm the removal.", 50, 300, "user");
}
示例8: main
int main (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZ>);
pcl::io::loadPCDFile (argv[1], *cloud);
pcl::copyPointCloud( *cloud,*cloud_filtered);
float i ;
float j;
float k;
cv::namedWindow( "picture");
cvCreateTrackbar("X_limit", "picture", &a, 30, NULL);
cvCreateTrackbar("Y_limit", "picture", &b, 30, NULL);
cvCreateTrackbar("Z_limit", "picture", &c, 30, NULL);
char last_c = 0;
// pcl::visualization::PCLVisualizer viewer ("picture");
viewer.setBackgroundColor (0.0, 0.0, 0.5);//set backgroung according to the color of points
pcl::PassThrough<pcl::PointXYZ> pass;
while (!viewer.wasStopped ())
{
pcl::copyPointCloud(*cloud_filtered, *cloud);
i = 0.1*((float)a);
j = 0.1*((float)b);
k = 0.1*((float)c);
// cout << "i = " << i << " j = " << j << " k = " << k << endl;
pass.setInputCloud (cloud);
pass.setFilterFieldName ("y");
pass.setFilterLimits (-j, j);
pass.filter (*cloud);
pass.setInputCloud (cloud);
pass.setFilterFieldName ("x");
pass.setFilterLimits (-i, i);
pass.filter (*cloud);
pass.setInputCloud (cloud);
pass.setFilterFieldName ("z");
pass.setFilterLimits (-k,k);
pass.filter (*cloud);
viewer.addPointCloud (cloud, "scene_cloud");
viewer.spinOnce ();
viewer.removePointCloud("scene_cloud");
waitKey(10);
}
return 0;
}
示例9: background_color
void background_color (pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor (1.0, 1.0, 1.0);
}
示例10: drawArrow
void drawArrow(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor (0.0, 0.0, 0.0);
viewer.removeShape("line", 0);
viewer.addArrow(o1, o2, 1.0, 0.0, 0.0, "line", 0);
}