@@ -324,7 +324,7 @@ void init(int argc, char** argv,bool show){
324324 viewer->setBackgroundColor (0.0 , 0.0 , 0.0 , 0.0 ); // Setting background to a dark
325325
326326 int numClust = 0 ;
327- viewer->addPointCloud (cloud," Original_Cloud" ,PORT1);
327+ // viewer->addPointCloud(cloud,"Original_Cloud",PORT1);
328328
329329 std::random_device seeder;
330330 std::ranlux48 gen (seeder ());
@@ -358,7 +358,10 @@ void init(int argc, char** argv,bool show){
358358 viewer->addPointCloud (cluster_rgb,nameId.c_str (),PORT2);
359359 numClust += 1 ;
360360 }
361-
361+
362+ double scale = 1 ;
363+
364+ viewer->addCoordinateSystem (scale);
362365 pcl::PointXYZ p11, p22, p33;
363366 p11.getArray3fMap () << 1 , 0 , 0 ;
364367 p22.getArray3fMap () << 0 , 1 , 0 ;
@@ -367,6 +370,14 @@ void init(int argc, char** argv,bool show){
367370 viewer->addText3D (" x" , p11, 0.2 , 1 , 0 , 0 , " x_" );
368371 viewer->addText3D (" y" , p22, 0.2 , 0 , 1 , 0 , " y_" );
369372 viewer->addText3D (" z" , p33, 0.2 , 0 , 0 , 1 , " z_" );
373+
374+ if (cloud->points [0 ].r <= 0 and cloud->points [0 ].g <= 0 and cloud->points [0 ].b <= 0 ){
375+ pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZRGB> color_handler (cloud,255 ,255 ,0 );
376+ viewer->addPointCloud (cloud,color_handler," Original_Cloud" ,PORT1);
377+ }else {
378+ viewer->addPointCloud (cloud," Original_Cloud" ,PORT1);
379+ }
380+
370381
371382 viewer->initCameraParameters ();
372383 viewer->resetCamera ();
@@ -375,8 +386,8 @@ void init(int argc, char** argv,bool show){
375386
376387 while (!viewer->wasStopped ()){
377388 viewer->spin ();
378- }
379- }
389+ }
390+ }
380391}
381392
382393
0 commit comments