Skip to content

Commit a63203f

Browse files
ipa-dmoDominik Moss
authored and
Dominik Moss
committed
Get the indices without the circular buffer offset
1 parent 5b0d81f commit a63203f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

grid_map_cv/include/grid_map_cv/GridMapCvConverter.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,17 @@ class GridMapCvConverter
116116

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

120121
// Check for alpha layer.
121122
if (hasAlpha) {
122123
const Type_ alpha =
123-
image.at<cv::Vec<Type_, NChannels_>>(index(0), index(1))[NChannels_ - 1];
124+
image.at<cv::Vec<Type_, NChannels_>>(imageIndex(0), imageIndex(1))[NChannels_ - 1];
124125
if (alpha < alphaTreshold) {continue;}
125126
}
126127

127128
// Compute value.
128-
const Type_ imageValue = imageMono.at<Type_>(index(0), index(1));
129+
const Type_ imageValue = imageMono.at<Type_>(imageIndex(0), imageIndex(1));
129130
const float mapValue = lowerValue + mapValueDifference *
130131
(static_cast<float>(imageValue) / maxImageValue);
131132
data(index(0), index(1)) = mapValue;

0 commit comments

Comments
 (0)