Refactored texture projection (avoid saving image on disk at this step)

This commit is contained in:
matlabbe
2017-01-16 18:29:14 -05:00
parent 2b8f40e505
commit a011a6af64
7 changed files with 208 additions and 127 deletions
+4 -4
View File
@@ -375,7 +375,7 @@ void applyImpl(
void GainCompensator::apply(
int id,
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud)
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud) const
{
pcl::IndicesPtr indices(new std::vector<int>);
apply(id, cloud, indices);
@@ -383,7 +383,7 @@ void GainCompensator::apply(
void GainCompensator::apply(
int id,
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
const pcl::IndicesPtr & indices)
const pcl::IndicesPtr & indices) const
{
UASSERT_MSG(uContains(idToIndex_, id), uFormat("id=%d idToIndex_.size()=%d", id, (int)idToIndex_.size()).c_str());
applyImpl<pcl::PointXYZRGB>(idToIndex_.at(id), cloud, indices, gains_);
@@ -391,7 +391,7 @@ void GainCompensator::apply(
void GainCompensator::apply(
int id,
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
const pcl::IndicesPtr & indices)
const pcl::IndicesPtr & indices) const
{
UASSERT_MSG(uContains(idToIndex_, id), uFormat("id=%d idToIndex_.size()=%d", id, (int)idToIndex_.size()).c_str());
applyImpl<pcl::PointXYZRGBNormal>(idToIndex_.at(id), cloud, indices, gains_);
@@ -399,7 +399,7 @@ void GainCompensator::apply(
void GainCompensator::apply(
int id,
cv::Mat & image)
cv::Mat & image) const
{
UASSERT_MSG(uContains(idToIndex_, id), uFormat("id=%d idToIndex_.size()=%d", id, (int)idToIndex_.size()).c_str());
cv::multiply(image, gains_(idToIndex_.at(id), 0), image);