Automatic segment detection/croping

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Post Reply
Oldes
Posts: 6
Joined: 2010-12-22T05:54:19-07:00
Authentication code: 8675308

Automatic segment detection/croping

Post by Oldes »

Hi,

is there any function which can be used for automatic segment detection which would return regions usable for multiple crop?

For example if I have sequence of PNGs with transparent backgrounds like this:
Image

I want to get the two figures as 2 cropped images (and data with positions of these cropped images in the original).

I know how to do the detection myself, but first want to ask if it's not already possible with ImageMagick itself.

Thank you,
Oldes
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Automatic segment detection/croping

Post by fmw42 »

see my scripts, multicrop and separate at the link below. Perhaps those will help or do what you need. The first was more designed for rectangular regions and I have not tested it on irregular ones. The second needs you to convert the image into a binary mask and will separate the mask areas. I don't recall if the coordinates are provided or not, but they could be added.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Automatic segment detection/croping

Post by anthony »

Also see...
IM Examples, Animation Modification, Splitting up an Animation
http://www.imagemagick.org/Usage/anim_mods/#split
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply