Compiling ELSD (Ellipse and Line Segment Detector) on OS X

April 28, 2014
Input image

ELSD results

ELSD is a new program for detecting line segments and elliptical curves in images. It gives very impressive results by using a novel model selection criterion to distinguish noise curves from foreground, as detailed in the author's ECCV 2012 paper. Most impressive, it works out of the box with no parameter tuning.

The authors have generously released their code under Affero GPL, but it requires a few tweaks to compile on OSX.

First, in process_curve.c, replace this line:

#include <clapack.h>

with this:

#ifdef __APPLE__
#include <Accelerate/Accelerate.h>
#include <clapack.h>

Second, in makefile, change this line

cc -o elsd elsd.c valid_curve.c process_curve.c process_line.c write_svg.c -llapack_LINUX -lblas_LINUX -llibf2c -lm

to this:

cc -o elsd -framework accelerate  elsd.c valid_curve.c process_curve.c process_line.c write_svg.c -lf2c -lm 

Thanks to authors Viorica Pătrăucean, Pierre Gurdjos, and Rafael Grompone von Gioi for sharing this valuable new tool!

Update: I've written a python script to convert ELSD's output into polylines, check out the code page

Posted by Kyle Simek
blog comments powered by Disqus