grid_map icon indicating copy to clipboard operation
grid_map copied to clipboard

MedianFillFilter.cpp -> function cleanedMask() 's morphological operational question

Open silencht opened this issue 2 years ago • 0 comments

in grid_map_filters/src/MedianFillFilter.cpp,

  cv::dilate(inputMask, cleanedInputMask, element);
  cv::erode(cleanedInputMask, cleanedInputMask, element);
  cv::erode(inputMask, cleanedInputMask, element);
  cv::dilate(cleanedInputMask, cleanedInputMask, element);

My idea was to write it like this,

  cv::dilate(inputMask, cleanedInputMask, element);
  cv::erode(cleanedInputMask, cleanedInputMask, element);
  cv::erode(cleanedInputMask, cleanedInputMask, element);
  cv::dilate(cleanedInputMask, cleanedInputMask, element);

Is there a problem with the third line of code here? Or is there a problem with my understanding. Can you explain what this part of the code does? Thanks!

silencht avatar Oct 31 '23 04:10 silencht