Skip to content

Commit

Permalink
made XYZRGB2XYZLAB templated and added array header
Browse files Browse the repository at this point in the history
  • Loading branch information
ueqri committed Apr 19, 2021
1 parent 44d67bb commit fa0782c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions common/include/pcl/common/colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <pcl/point_types.h>

#include <type_traits> // for is_floating_point
#include <array> // for std::array especially in Clang Darwin and MSVC

namespace pcl
{
Expand Down
7 changes: 4 additions & 3 deletions common/include/pcl/point_types_conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ namespace pcl
if (out.h < 0.f) out.h += 360.f;
}

/** \brief Convert a XYZRGBA point type to a XYZLAB
* \param[in] in the input XYZRGBA point
/** \brief Convert a XYZRGB-based point type to a XYZLAB
* \param[in] in the input XYZRGB(XYZRGBA, XYZRGBL, etc.) point
* \param[out] out the output XYZLAB point
*/
template <typename PointXYZRGBTypes>
inline void
PointXYZRGBAtoXYZLAB (const PointXYZRGBA& in,
PointXYZRGBtoXYZLAB (const PointXYZRGBTypes& in,
PointXYZLAB& out)
{
out.x = in.x;
Expand Down
4 changes: 2 additions & 2 deletions registration/src/gicp6d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ GeneralizedIterativeClosestPoint6D::setInputSource(
// in addition, convert colors of the cloud to CIELAB
cloud_lab_->resize(cloud->size());
for (std::size_t point_idx = 0; point_idx < cloud->size(); ++point_idx) {
PointXYZRGBAtoXYZLAB((*cloud)[point_idx], (*cloud_lab_)[point_idx]);
PointXYZRGBtoXYZLAB((*cloud)[point_idx], (*cloud_lab_)[point_idx]);
}
}

Expand All @@ -76,7 +76,7 @@ GeneralizedIterativeClosestPoint6D::setInputTarget(
// in addition, convert colors of the cloud to CIELAB...
target_lab_->resize(target->size());
for (std::size_t point_idx = 0; point_idx < target->size(); ++point_idx) {
PointXYZRGBAtoXYZLAB((*target)[point_idx], (*target_lab_)[point_idx]);
PointXYZRGBtoXYZLAB((*target)[point_idx], (*target_lab_)[point_idx]);
}

// ...and build 6d-tree
Expand Down

0 comments on commit fa0782c

Please sign in to comment.