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);

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 3GZ
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT