0
I have a lot of scanned images in which I want to auto-crop the region inside the largest rectangle or box. This image shows some examples.
The last one is what I would like the output to be like.
Since the input images will vary in size and dimension, as well as in the number of total rectangles and how they are arranged, I figured one approach would be to use some kind of line detection. With that information we could detect the largest rectangle in the image and use that as the cropping rectangle. The next step would just be to use imagemagick
with the -trim
option I guess.
Is this a valid approach, and if so, how can I implement it?
If not, what other methods are good?
I'm guessing that's a bash script? – jiggunjer – 2015-11-26T09:21:40.603