38 #ifndef PCL_RECOGNITION_LINEMOD_LINE_RGBD
39 #define PCL_RECOGNITION_LINEMOD_LINE_RGBD
41 #include <pcl/recognition/linemod.h>
42 #include <pcl/recognition/color_gradient_modality.h>
43 #include <pcl/recognition/surface_normal_modality.h>
44 #include <pcl/io/tar.h>
72 template <
typename Po
intXYZT,
typename Po
intRGBT=Po
intXYZT>
81 Detection () : template_id (0), object_id (0), detection_id (0), response (0.0f), bounding_box () {}
99 : intersection_volume_threshold_ (1.0f)
101 , color_gradient_mod_ ()
102 , surface_normal_mod_ ()
105 , template_point_clouds_ ()
128 loadTemplates (
const std::string &file_name,
size_t object_id = 0);
139 linemod_.setDetectionThreshold (threshold);
149 color_gradient_mod_.setGradientMagnitudeThreshold (threshold);
162 intersection_volume_threshold_ = threshold;
173 surface_normal_mod_.setInputCloud (cloud);
174 surface_normal_mod_.processInputData ();
185 color_gradient_mod_.setInputCloud (cloud);
186 color_gradient_mod_.processInputData ();
195 createAndAddTemplate (
197 const size_t object_id,
214 float min_scale = 0.6944444f,
215 float max_scale = 1.44f,
216 float scale_multiplier = 1.2f);
225 computeTransformedTemplatePoints (
const size_t detection_id,
232 inline std::vector<size_t>
235 if (detection_id >= detections_.size ())
236 PCL_ERROR (
"ERROR pcl::LineRGBD::computeTransformedTemplatePoints - detection_id is out of bounds\n");
240 std::vector<size_t> vec;
251 inline std::vector<size_t>
254 if (detection_id >= detections_.size ())
255 PCL_ERROR (
"ERROR pcl::LineRGBD::computeTransformedTemplatePoints - detection_id is out of bounds\n");
259 std::vector<size_t> vec;
265 refineDetectionsAlongDepth ();
269 applyProjectiveDepthICPOnDetections ();
273 removeOverlappingDetections ();
288 float intersection_volume_threshold_;
310 std::vector<typename pcl::LineRGBD<PointXYZT, PointRGBT>::Detection>
detections_;
315 #include <pcl/recognition/impl/linemod/line_rgbd.hpp>
pcl::PointCloud< pcl::PointXYZRGBA >::CloudVectorType template_point_clouds_
Point clouds corresponding to the templates.
size_t template_id
The ID of the template.
std::vector< pcl::BoundingBoxXYZ > bounding_boxes_
Bounding boxes corresonding to the templates.
pcl::SurfaceNormalModality< PointXYZT > surface_normal_mod_
Surface normal modality.
void setGradientMagnitudeThreshold(const float threshold)
Sets the threshold on the magnitude of color gradients.
pcl::PointCloud< PointRGBT >::ConstPtr cloud_rgb_
RGB point cloud.
pcl::ColorGradientModality< PointRGBT > color_gradient_mod_
Color gradient modality.
A TAR file's header, as described on http://en.wikipedia.org/wiki/Tar_%28file_format%29.
float depth
Depth of the bounding box.
size_t object_id
The ID of the object corresponding to the template.
virtual ~LineRGBD()
Destructor.
void setInputColors(const typename pcl::PointCloud< PointRGBT >::ConstPtr &cloud)
Sets the input cloud with rgb values.
High-level class for template matching using the LINEMOD approach based on RGB and Depth data...
float y
Y-coordinate of the upper left front point.
std::vector< PointCloud< PointT >, Eigen::aligned_allocator< PointCloud< PointT > > > CloudVectorType
pcl::LINEMOD linemod_
LINEMOD instance.
BoundingBoxXYZ bounding_box
The 3D bounding box of the detection.
RegionXY region
The 2D template region of the detection.
float response
The response of this detection.
A multi-modality template constructed from a set of quantized multi-modality features.
std::vector< size_t > object_ids_
Object IDs corresponding to the templates.
void setDetectionThreshold(float threshold)
Sets the threshold for the detection responses.
void setIntersectionVolumeThreshold(const float threshold=1.0f)
Sets the threshold for the decision whether two detections of the same template are merged or not...
float x
X-coordinate of the upper left front point.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Template matching using the LINEMOD approach.
std::vector< typename pcl::LineRGBD< PointXYZT, PointRGBT >::Detection > detections_
Detections from last call of method detect (...).
float width
Width of the bounding box.
void setInputCloud(const typename pcl::PointCloud< PointXYZT >::ConstPtr &cloud)
Sets the input cloud with xyz point coordinates.
float z
Z-coordinate of the upper left front point.
pcl::PointCloud< PointXYZT >::ConstPtr cloud_xyz_
XYZ point cloud.
std::vector< size_t > findObjectPointIndices(const size_t detection_id)
Finds the indices of the points in the input cloud which correspond to the specified detection...
float height
Height of the bounding box.
std::vector< size_t > alignTemplatePoints(const 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.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
size_t detection_id
The ID of this detection.
BoundingBoxXYZ()
Constructor.