Available in LEADTOOLS Document and Medical Imaging toolkits.
BinaryFilter example for Visual J++
This example does omni-directional erosion of black objects and repaints the image.
LEAD1.BinaryFilter( (short) LTOCXU.BinaryFilterConstants.BFLT_EROSION_OMNI ); LEAD1.ForceRepaint();