Fixed overlay image output.

Added erosion filter