File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
grid_map_cv/include/grid_map_cv Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments