40 #include <pcl/recognition/linemod.h>
41 #include <pcl/recognition/color_gradient_modality.h>
42 #include <pcl/recognition/surface_normal_modality.h>
43 #include <pcl/io/tar.h>
71 template <
typename Po
intXYZT,
typename Po
intRGBT=Po
intXYZT>
80 Detection () : template_id (0), object_id (0), detection_id (0), response (0.0f) {}
98 : intersection_volume_threshold_ (1.0f)
99 , color_gradient_mod_ ()
100 , surface_normal_mod_ ()
124 loadTemplates (
const std::string &file_name, std::size_t object_id = 0);
135 linemod_.setDetectionThreshold (threshold);
145 color_gradient_mod_.setGradientMagnitudeThreshold (threshold);
158 intersection_volume_threshold_ = threshold;
169 surface_normal_mod_.setInputCloud (cloud);
170 surface_normal_mod_.processInputData ();
181 color_gradient_mod_.setInputCloud (cloud);
182 color_gradient_mod_.processInputData ();
193 createAndAddTemplate (
195 const std::size_t object_id,
212 float min_scale = 0.6944444f,
213 float max_scale = 1.44f,
214 float scale_multiplier = 1.2f);
223 computeTransformedTemplatePoints (
const std::size_t detection_id,
230 inline std::vector<std::size_t>
233 if (detection_id >= detections_.size ())
234 PCL_ERROR (
"ERROR pcl::LineRGBD::computeTransformedTemplatePoints - detection_id is out of bounds\n");
238 std::vector<std::size_t> vec;
249 inline std::vector<std::size_t>
252 if (detection_id >= detections_.size ())
253 PCL_ERROR (
"ERROR pcl::LineRGBD::computeTransformedTemplatePoints - detection_id is out of bounds\n");
257 std::vector<std::size_t> vec;
263 refineDetectionsAlongDepth ();
267 applyProjectiveDepthICPOnDetections ();
271 removeOverlappingDetections ();
286 float intersection_volume_threshold_;
308 std::vector<typename pcl::LineRGBD<PointXYZT, PointRGBT>::Detection>
detections_;
313 #include <pcl/recognition/impl/linemod/line_rgbd.hpp>
float z
Z-coordinate of the upper left front point.
std::vector< pcl::BoundingBoxXYZ > bounding_boxes_
Bounding boxes corresponding to the templates.
pcl::ColorGradientModality< PointRGBT > color_gradient_mod_
Color gradient modality.
Template matching using the LINEMOD approach.
std::size_t template_id
The ID of the template.
pcl::PointCloud< pcl::PointXYZRGBA >::CloudVectorType template_point_clouds_
Point clouds corresponding to the templates.
std::size_t object_id
The ID of the object corresponding to the template.
void setGradientMagnitudeThreshold(const float threshold)
Sets the threshold on the magnitude of color gradients.
void setDetectionThreshold(float threshold)
Sets the threshold for the detection responses.
std::vector< std::size_t > alignTemplatePoints(const std::size_t detection_id)
Aligns the template points with the points found at the detection position of the specified detection...
Defines a region in XY-space.
float y
Y-coordinate of the upper left front point.
A multi-modality template constructed from a set of quantized multi-modality features.
float x
X-coordinate of the upper left front point.
void setIntersectionVolumeThreshold(const float threshold=1.0f)
Sets the threshold for the decision whether two detections of the same template are merged or not...
pcl::LINEMOD linemod_
LINEMOD instance.
void setInputColors(const typename pcl::PointCloud< PointRGBT >::ConstPtr &cloud)
Sets the input cloud with rgb values.
float width
Width of the bounding box.
std::vector< std::size_t > object_ids_
Object IDs corresponding to the templates.
BoundingBoxXYZ()
Constructor.
RegionXY region
The 2D template region of the detection.
float depth
Depth of the bounding box.
void setInputCloud(const typename pcl::PointCloud< PointXYZT >::ConstPtr &cloud)
Sets the input cloud with xyz point coordinates.
pcl::PointCloud< PointRGBT >::ConstPtr cloud_rgb_
RGB point cloud.
shared_ptr< const PointCloud< PointT > > ConstPtr
virtual ~LineRGBD()
Destructor.
std::vector< std::size_t > findObjectPointIndices(const std::size_t detection_id)
Finds the indices of the points in the input cloud which correspond to the specified detection...
std::vector< typename pcl::LineRGBD< PointXYZT, PointRGBT >::Detection > detections_
Detections from last call of method detect (...).
pcl::SurfaceNormalModality< PointXYZT > surface_normal_mod_
Surface normal modality.
High-level class for template matching using the LINEMOD approach based on RGB and Depth data...
std::size_t detection_id
The ID of this detection.
std::vector< PointCloud< PointT >, Eigen::aligned_allocator< PointCloud< PointT > > > CloudVectorType
pcl::PointCloud< PointXYZT >::ConstPtr cloud_xyz_
XYZ point cloud.
float response
The response of this detection.
float height
Height of the bounding box.
BoundingBoxXYZ bounding_box
The 3D bounding box of the detection.