本文整理汇总了C++中Pose::isFound方法的典型用法代码示例。如果您正苦于以下问题:C++ Pose::isFound方法的具体用法?C++ Pose::isFound怎么用?C++ Pose::isFound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pose
的用法示例。
在下文中一共展示了Pose::isFound方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc,char* argv[]){
if (argc != 2 && argc != 3){
printf("usage:\n %s /path/to/recoding/filename.oni\n",argv[0]);
return 0;
}
Xn_sensor sensor(WIDTH,HEIGHT);
sensor.play(argv[1],false);
cvNamedWindow( "Model Extractor Viewer", 1 );
IplImage* rgb_image = cvCreateImageHeader(cvSize(WIDTH,HEIGHT), 8, 3);
IplImage* test = cvCreateImageHeader(cvSize(WIDTH,HEIGHT), 8, 3);
IplImage* gray = cvCreateImage(cvSize(WIDTH,HEIGHT), 8, 1);
Mat img;
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr model (new pcl::PointCloud<pcl::PointXYZRGB>);
//pcl::visualization::CloudViewer viewer("Model Extractor Viewer");
//Read Fiducial from file
Fiducial fiducial("fiducial.yml");
Pose pose;
while(/*!viewer.wasStopped() && */!sensor.endPlaying()){
//Get the frame
sensor.update();
sensor.getPCL(cloud);
cvSetData(rgb_image,sensor.rgb,rgb_image->widthStep);
//Estimate Camera Pose from fiducial
cvCvtColor(rgb_image,gray,CV_BGR2GRAY);
if (fiducial.find(gray,true)){
pose.estimate(gray,fiducial);
//fiducial.draw(rgb_image);
}
if (pose.isFound()){
printf("Rotation");
printMat<double>(pose.getR());
printf("Translation");
printMat<double>(pose.getT());
//Segment volume around the fiducial
boxFilter(cloud,pose);
//Create 3D model
buildModel(cloud,model);
}
//viewer.showCloud (model);
}
pcl::io::savePCDFileBinary ("model.pcd", *model);
sensor.shutdown();
return 0;
}