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?
![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);](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F018779f6-2f2c-49c0-a30d-c57c36330fde%2F42fb3441-f2e3-455a-9a76-2e2f967b41c7%2F7uxjg7v_processed.png&w=3840&q=75)
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);](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F018779f6-2f2c-49c0-a30d-c57c36330fde%2F42fb3441-f2e3-455a-9a76-2e2f967b41c7%2F1y5xbc_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
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
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education