Let's assume I have a raster image consisting of 0's and several donut-shaped rings of 1's. This raster could for example be the result of classifying a satellite image with ponds and lakes in it into two classes: 1) pond shoreline, pixel value 1 and 2) other, pixel value 0. See image for impression.
My challenge is to fill each donut hole, creating full circles with pixel value 1. For this I have access to ArcGIS with all common functionality, as well as ENVI and Python with gdal bindings. See second image for impression of the desired outcome.I guess a majority filter will work to some extent, except when the donut holes are large.
Any suggestions on transforming donuts to circles are welcome. Bonus points for making it work with unclosed donuts as well.