How to save pcl :: histogram file in png or jpg?

I would like to save the same image in the file that I get using the PCLHistogramVisualizer PCL API.

This is a variable with a histogram that I need to save at points [0].

pcl::PointCloud<Histogram<100> > hist;

I thought this could be done using

pcl::io::savePNGFile(path, *hist);

but this is the error i get

warning: ‘void pcl::io::savePNGFile(const string&, const pcl::PointCloud<PointT>&) [with T = pcl::Histogram<50>, std::string = std::basic_string<char>]’ is deprecated (declared at /usr/local/include/pcl-1.7/pcl/io/png_io.h:123): pcl::io::savePNGFile<typename T> (file_name, cloud) is deprecated, please use a new generic function pcl::io::savePNGFile (file_name, cloud, field_name) with "rgb" as the field name. [-Wdeprecated-declarations]

/usr/local/include/pcl-1.7/pcl/io/png_io.h:129:9: error: ‘const struct pcl::Histogram<50>’ has no member named ‘r’

/usr/local/include/pcl-1.7/pcl/io/png_io.h:130:9: error: ‘const struct pcl::Histogram<50>’ has no member named ‘g’

/usr/local/include/pcl-1.7/pcl/io/png_io.h:131:9: error: ‘const struct pcl::Histogram<50>’ has no member named ‘b’

So I cannot do this because it does not have any rgb fields, but I really need to save a huge number of histograms, and I cannot take a screenshot all the time.

+4
source share
1 answer

I recommend that you use the PCL mailing list on these specific issues. Developers are likely to answer there.

+1

Source: https://habr.com/ru/post/1526053/


All Articles