From this question: Redirecting function output to /dev/null I have tried to employ the following code:
std::ofstream catchPCLStream("/dev/null");
std::streambuf *originalOutputBuffer = std::cout.rdbuf();
std::cout.rdbuf(catchPCLStream.rdbuf());
std::cerr.rdbuf(catchPCLStream.rdbuf());
icp_.align(dataCloudTransformedByIcp_, icpInternalUpdatePose_);
std::cout.rdbuf(originalOutputBuffer);
std::cerr.rdbuf(originalOutputBuffer);
But I still get a huge amount of output from the registration library:
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters.
Is there something different about this output that stops it from being caught by this? Is it not going to cout
or cerr
?