COGS
Computer Graphics Structures library
PclConversions.h
1 /*
2  Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
3  Unauthorized copying of this file, via any medium is strictly prohibited
4  Proprietary and confidential
5 */
6 #ifndef CONVERSIONS_PCL_CONVERSIONS_H
7 #define CONVERSIONS_PCL_CONVERSIONS_H
8 
9 #include <pcl/recognition/point_types.h>
10 #include <glm/common.hpp>
11 #include <Utils/ExtGLM.h>
12 #include <COGS/API.h>
13 #include <COGS/Scan.h>
14 
15 
16 namespace cogs
17 {
18  namespace conversions
19  {
20 
22  inline glm::vec3 PclToPosition(const pcl::PointXYZINormal &point)
23  {
24  return glm::vec3(point.x, point.y, point.z);
25  }
26 
28  inline glm::vec3 PclToNormal(const pcl::PointXYZINormal &point)
29  {
30  return glm::vec3(point.normal_x, point.normal_y, point.normal_z);
31  }
32 
34  inline float PclToIntensity(const pcl::PointXYZINormal &point)
35  {
36  return point.intensity;
37  }
38 
40  COGS_API pcl::PointCloud<pcl::PointXYZINormal> CogsScanToPcl(const cogs::Scan &scan);
41 
43  COGS_API void PclToCogsPointCloud(
44  const pcl::PointCloud<pcl::PointXYZINormal> &pcl_cloud,
45  std::optional<utils::SpaceDefinition> space_definition,
46  cogs::PointCloud &out_cloud);
47 
49  COGS_API bool PclToCogsScan(
50  const pcl::PointCloud<pcl::PointXYZINormal> &pcl_cloud,
51  utils::SpaceDefinition camera_space_definition,
52  const cogs::ScanCameraParams &camera_params,
53  cogs::Scan &out_scan);
54  }
55 }
56 #endif /* !CONVERSIONS_PCL_CONVERSIONS_H */
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
Parameters of a camera used to capture Scan.
Definition: ScanCameraParams.h:14
Management class for a set of data points in a 3D space.
Definition: PointCloud.h:32
Set of 3D data points which are additionally organized over 2D grid.
Definition: Scan.h:22