#include <opencv2/viz.hpp>
#include <opencv2/viz/viz3d.hpp>
#include <opencv2/viz/vizcore.hpp>

namespace {

const std::string DEFAULT_POINT_CLOUD_FILE = "../data/carbon_bin_picking_gamma_bgcrop.ply";
}

int main(int argc, char **argv)
{
    cv::viz::Viz3d window("Point cloud");
    std::string fileName = argc == 2 ? argv[1] : DEFAULT_POINT_CLOUD_FILE;

    auto pointCloud = cv::viz::readCloud(fileName.c_str());
    cv::viz::WCloud cloudWidget(pointCloud, cv::viz::Color::red());
    window.showWidget("Point cloud", cloudWidget);
    window.spin();

    return 0;
}
