Skip to content

Commit

Permalink
Get the indices without the circular buffer offset
Browse files Browse the repository at this point in the history
  • Loading branch information
ipa-dmo authored and Dominik Moss committed Jul 22, 2024
1 parent 5b0d81f commit a63203f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grid_map_cv/include/grid_map_cv/GridMapCvConverter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,17 @@ class GridMapCvConverter

for (GridMapIterator iterator(gridMap); !iterator.isPastEnd(); ++iterator) {
const Index index(*iterator);
const Index imageIndex(iterator.getUnwrappedIndex());

// Check for alpha layer.
if (hasAlpha) {
const Type_ alpha =
image.at<cv::Vec<Type_, NChannels_>>(index(0), index(1))[NChannels_ - 1];
image.at<cv::Vec<Type_, NChannels_>>(imageIndex(0), imageIndex(1))[NChannels_ - 1];
if (alpha < alphaTreshold) {continue;}
}

// Compute value.
const Type_ imageValue = imageMono.at<Type_>(index(0), index(1));
const Type_ imageValue = imageMono.at<Type_>(imageIndex(0), imageIndex(1));
const float mapValue = lowerValue + mapValueDifference *
(static_cast<float>(imageValue) / maxImageValue);
data(index(0), index(1)) = mapValue;
Expand Down

0 comments on commit a63203f

Please sign in to comment.