Hi, I am relatively new to ImageMagick and currently experimenting with command line options on Windows to see if I can extract some shapes from an image:
Input image: https://snag.gy/5RAnbU.jpg
Output image: https://snag.gy/3sP6dp.jpg
In the input image, the background might contain gradient.
The output should be the outline of the two human like shapes ( https://snag.gy/3sP6dp.jpg). Is it also possible to have two separate output images with one shape each?
I looked through a few other posts on using morphology to do something similar(like outlining shapes) but not exactly this.
If this is not possible, what minimal changes do I need to make to the input image to make it possible to extract the two shapes?
Also, does imagemagick has a concept of the size of the shapes which can help me extract the top N shapes from an image?
Version (on Windows, using command line):
Version: ImageMagick 7.0.8-12 Q16 x64 2018-09-23 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib
Extract shapes from an image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extract shapes from an image
Try -connected-components. See https://imagemagick.org/script/connected-components.php