I am trying to remove punch holes from thousands of scanned documents. I can do this manually but it is too time consuming, so am looking for an automatic solution.
The problem is the punch holes are often in different places on different documents. Some holes are not punched level, where the document was inserted into the puncher at an angle. Another factor is text is also often aligned with the punch holes - see attached images where I have highlighted text in red as an example. For these reasons a basic crop won't work without cutting off information. Is there a way I can use ImageMagick to automatically identify punch holes on each page, remove them and fill with the appropriate background colour (in the case of the example this is white)
![Image](https://s15.postimg.org/i6p3fu847/punch_holes_Page_2.jpg)
![Image](https://s15.postimg.org/b27a6t0uv/punch_holes_Page_1.jpg)