I installed PCL1.7.2. and I'm trying to use PCL libraries.
I want to show camera parameters using "const", so I want to get camera parameters. But I do not understand how to get the camera settings.
I saw "pcl :: visualization :: Camera Class Reference".
http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_camera.html
and I realized that on the "Camera" object there is a focal, pos, view, etc.
and now I have confirmed that the following code is executing.
but I can’t figure out how to get a member of the camera. this is how to set camera member values. viewer.setCameraPosition (pos_x, pos_y, pos_z, view_x, view_y, view_z, up_x, up_y, up_z, viewport);
so please show me how to get the camera parameters from the following code.
now it is a source of traffic.
#include "stdafx.h"
#include <pcl/visualization/cloud_viewer.h>
#include <iostream>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
int user_data=0;
void
viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(1.0, 0.5, 1.0);
pcl::PointXYZ o;
o.x = 1.0;
o.y = 0;
o.z = 0;
viewer.addSphere(o, 0.25, "sphere", 0);
std::cout << "i only run once" << std::endl;
}
void
viewerPsycho(pcl::visualization::PCLVisualizer& viewer)
{
static unsigned count = 0;
std::stringstream ss;
ss << "Once per viewer loop: " << count++;
viewer.removeShape("text", 0);
viewer.addText(ss.str(), 200, 300, "text", 0);
user_data++;
}
int _tmain(int argc, const _TCHAR** argv)
{
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::io::loadPCDFile("c:\\data\\triceratops\\raw_0.pcd", *cloud);
pcl::visualization::CloudViewer viewer("Cloud Viewer");
viewer.showCloud(cloud);
viewer.runOnVisualizationThreadOnce(viewerOneOff);
viewer.runOnVisualizationThread(viewerPsycho);
while (!viewer.wasStopped())
{
user_data++;
}
return 0;
}