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
icon
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?

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);
Transcribed Image Text: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
<pcl/10/pcd_10.
#include <pcl/range_image/range_image_planar.h>
#include <pcl/keypoints/narf_keypoint.h>
#include <pcl/visualization/range_image_visualizer.h>
#include <sstream>
<pcl/features/range_image_border_extractor.h>
7
8
vint main()
9
{
10
11
12
13
14
// Object for storing the point cloud.
pel::PointCloud<pel::PointXYZ>::Ptr cloud(new pel::PointCloud<pel::PointXYZ>);
// Object for storing the keypoints' indices.
pel::PointCloud<int>::Ptr keypoints(new pcl::PointCloud<int>);
// Read a PCD file from disk.
if (pcl::io::loadPCDFile<pcl::PointXYZ>("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);
Transcribed Image Text:1 2 3 #include 4 5 6 <pcl/10/pcd_10. #include <pcl/range_image/range_image_planar.h> #include <pcl/keypoints/narf_keypoint.h> #include <pcl/visualization/range_image_visualizer.h> #include <sstream> <pcl/features/range_image_border_extractor.h> 7 8 vint main() 9 { 10 11 12 13 14 // Object for storing the point cloud. pel::PointCloud<pel::PointXYZ>::Ptr cloud(new pel::PointCloud<pel::PointXYZ>); // Object for storing the keypoints' indices. pel::PointCloud<int>::Ptr keypoints(new pcl::PointCloud<int>); // Read a PCD file from disk. if (pcl::io::loadPCDFile<pcl::PointXYZ>("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);
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education