Autocrop multiple pictures in a single image

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Post Reply
mimoio
Posts: 2
Joined: 2012-12-19T16:38:09-07:00
Authentication code: 6789

Autocrop multiple pictures in a single image

Post by mimoio »

Hi all,

I have a bunch of images that basically consists in a white background and some (not more than 7) rectangular photos at different positions (not overlapped) and with different orientations.

Does anyone know an algorithm or software to extract all the pictures in the image, autocrop them and leave then without rotation?

Thx in advance!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Autocrop multiple pictures in a single image

Post by fmw42 »

If you are on Unix (Linux, Mac or Windows/Cygwin), then see my script, multicrop, at the link below.
mimoio
Posts: 2
Joined: 2012-12-19T16:38:09-07:00
Authentication code: 6789

Re: Autocrop multiple pictures in a single image

Post by mimoio »

Nice, thx

this seems to be exactly what i am looking for. I'll have a look a it.

Regards,

mimoio
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Autocrop multiple pictures in a single image

Post by anthony »

Note you can speed up that script by adjusting the 'search grid' it uses to find photos to extract from the background.
A sparse grid is very fast, while a small grid finds very small items that may otherwise be missed.

I have for example used it on magazine pages to extract photos, but added a 'ignore small crop areas' where the search grid hit a letter or word from the page, rather than a larger photo.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply