Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hpjansson/cropsicle
Minimal C implementation of the Growcut area selection algorithm
https://github.com/hpjansson/cropsicle
c graphics image-processing
Last synced: 3 months ago
JSON representation
Minimal C implementation of the Growcut area selection algorithm
- Host: GitHub
- URL: https://github.com/hpjansson/cropsicle
- Owner: hpjansson
- License: gpl-3.0
- Created: 2014-02-03T09:58:57.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-04T00:25:55.000Z (almost 5 years ago)
- Last Synced: 2023-08-12T22:53:25.875Z (over 1 year ago)
- Topics: c, graphics, image-processing
- Language: C
- Homepage:
- Size: 19.5 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cropsicle
=========Cropsicle is a multithreaded C implementation of the GrowCut algorithm
described in the paper "GrowCut - Interactive Multi-Label N-D Image
Segmentation By Cellular Automata" by Vladimir Vezhnevets and Vadim
Konouchine [1].It lets you remove the background from an image with minimal input, cutting
along irregular boundaries.[1] http://graphicon.ru/oldgr/en/publications/text/gc2005vk.pdf
Build
-----> gcc -g -O3 cropsicle.c $(pkg-config --libs --cflags libpng) -lm -pthread -o cropsicle
Run
---This program supports 4-channel 8-bit-per-channel RGBA PNG images only. If
you have something else, you must convert it to the proper format first,
like this:> convert image.jpg -channel rgba png32:image.png
Perform the GrowCut operation like this:
> cropsicle image.png overlay.png output.png
Image is the source image, overlay is an alpha-transparent overlay with
a few green pixels spread out over the foreground you want to keep
and red pixels over the background. The pixels don't have to be perfect red
and green as long as the corresponding red/green channels are dominant and
the pixels are not transparent.Enjoy!
Example
-------Example input and output images for the cropsicle invocation above:
* [image.png](http://hpjansson.org/cropsicle/example/surf.png)
* [overlay.png](http://hpjansson.org/cropsicle/example/surf-overlay.png)
* [output.png](http://hpjansson.org/cropsicle/example/surf-out.png)