29 30 23333 31 34 35 36 37 38 39 40 41 42 43 44 45 float noiseLevel = 0.0f, minimumRange = 0.0f; pcl::RangeImagePlanar rangeImage; rangeImage.createFrom PointCloudWithFixedSize(*cloud, imageSizeX, imageSizeY, centerx, centerY, focalLengthX, focalLengthX, sensorPose, pcl:: RangeImage:: CAMERA_FRAME, noiseLevel, minimumRange); pcl::Range ImageBorderExtractor borderExtractor; // Keypoint detection object. pcl:: NarfKeypoint detector(&borderExtractor); detector.setRangeImage(&rangeImage); // The support size influences how big the surface of interest will be, // when finding keypoints from the border information. detector.getParameters().support_size = 0.2f; detector.compute (*keypoints); 1 2 3 #include 4 5 6 #include #include #include 7 8 vint main() 9 { 10 11 12 13 14 // Object for storing the point cloud. pel::PointCloud::Ptr cloud(new pel::PointCloud); // Object for storing the keypoints' indices. pel::PointCloud::Ptr keypoints(new pcl::PointCloud); // Read a PCD file from disk. if (pcl::io::loadPCDFile("rawdata_2000.pcd", *cloud) != 0) 15 16 17 { 18 return -1; 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 // Convert the cloud to range image. int imageSizeX = 640, imageSizeY = 480; float centerX = (640.0f / 2.0f), centerY = (480.0f / 2.0f); float focalLengthX = 600.0f, focalLengthy = focalLengthX; Eigen: : Affine3f sensorPose = Eigen: : Affine3f(Eigen: : Translation3f(cloud->sensor_origin_[0], cloud->sensor_origin_[1], cloud->sensor_origin_[2])) * Eigen: : Affine3f(cloud->sensor_orientation_); float noiseLevel = 0.0f, minimumRange = 0.0f; pcl::RangeImagePlanar rangeImage; rangeImage.createFrom PointCloudWithFixedSize(*cloud, imageSizeX, imageSizeY, centerx, centerY, focalLengthX, focalLengthX, sensorPose, pcl::RangeImage::CAMERA_FRAME, noiseLevel, minimumRange);
29 30 23333 31 34 35 36 37 38 39 40 41 42 43 44 45 float noiseLevel = 0.0f, minimumRange = 0.0f; pcl::RangeImagePlanar rangeImage; rangeImage.createFrom PointCloudWithFixedSize(*cloud, imageSizeX, imageSizeY, centerx, centerY, focalLengthX, focalLengthX, sensorPose, pcl:: RangeImage:: CAMERA_FRAME, noiseLevel, minimumRange); pcl::Range ImageBorderExtractor borderExtractor; // Keypoint detection object. pcl:: NarfKeypoint detector(&borderExtractor); detector.setRangeImage(&rangeImage); // The support size influences how big the surface of interest will be, // when finding keypoints from the border information. detector.getParameters().support_size = 0.2f; detector.compute (*keypoints); 1 2 3 #include 4 5 6 #include #include #include 7 8 vint main() 9 { 10 11 12 13 14 // Object for storing the point cloud. pel::PointCloud::Ptr cloud(new pel::PointCloud); // Object for storing the keypoints' indices. pel::PointCloud::Ptr keypoints(new pcl::PointCloud); // Read a PCD file from disk. if (pcl::io::loadPCDFile("rawdata_2000.pcd", *cloud) != 0) 15 16 17 { 18 return -1; 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 // Convert the cloud to range image. int imageSizeX = 640, imageSizeY = 480; float centerX = (640.0f / 2.0f), centerY = (480.0f / 2.0f); float focalLengthX = 600.0f, focalLengthy = focalLengthX; Eigen: : Affine3f sensorPose = Eigen: : Affine3f(Eigen: : Translation3f(cloud->sensor_origin_[0], cloud->sensor_origin_[1], cloud->sensor_origin_[2])) * Eigen: : Affine3f(cloud->sensor_orientation_); float noiseLevel = 0.0f, minimumRange = 0.0f; pcl::RangeImagePlanar rangeImage; rangeImage.createFrom PointCloudWithFixedSize(*cloud, imageSizeX, imageSizeY, centerx, centerY, focalLengthX, focalLengthX, sensorPose, pcl::RangeImage::CAMERA_FRAME, noiseLevel, minimumRange);
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Is there any logic error in this code? Also, can you save the narf keypoint to a file in the rest of the code?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education