Binary Erode implementation