Pascal Getreuer

Above is the source code to my C++ implementation of Chan-Vese "Active Contours Without Edges" image segmentation. The program has command line interface, for example,

$ segment input.png mu=0.5 kmax=25

runs the segmentation on input.png with μ=0.5 for 25 iterations. The program outputs the segmentation results every few iterations.

The initial segmentation is found by thresholding the input image at T = (max value − min value)/2. No reinitialization is used.

Usage

The general syntax is segment file [parameter=value ...]. Available parameters are

(Parameters epsilon=1.0 and h=1.0 are hardcoded.) The program outputs intermediate results every kstep iterations. To output only the final results, set kstep=0.

Compilation

This program requires the libpng and zlib libraries. These libraries are freely avaiable at www.libpng.org.

Enabling code optimization may significantly speed up the main loop of the program (use the -O3 flag with GCC).

A few experiments