ELSDc: Ellipse and Line Segment Detector, with Continuous validation
V. Patraucean, P. Gurdjos, R. Grompone von Gioi
(Corresponding author: Viorica Patraucean firstname.lastname@example.org)
Version 0.9, March 2015
ELSDc is an algorithm for joint ellipse and line segment detection in digital images. It is based on the a-contrario framework and should work without the need for parameter tuning. The algorithm is described in the following manuscript:
"Joint A Contrario Ellipse and Line Detection", V. Patraucean, P. Gurdjos, and R. Grompone von Gioi.
An online demo of the algorithm is available, where you can upload your own images and run ELSDc:
(user: demo, pass: demo)
ELSDc requires CLAPACK/CBLAS library for some linear algebra computations. Version 3.2.1 was used.
You may need to modify the file
Makefile in the directory
src to include the
path to liblapack. Then, you can compile by typing
make in the command
line. This produces the executable called
./elsdc image.pgm runs ELSDc on the image specified by
version works only with PGM images. This folder contains the image 'shapes.pgm'
for testing purposes.
output.svgcontains the execution result in SVG format.
shapes_output.svgcontains the expected result for the sample image
labels.pgmafter execution, each pixel in this image is labelled with the label of the primitive to which it belongs.
shapes_labels.pgmcontains the expected result for the sample image
out_ellipse.txtcontains the parameters of the detected circular/elliptical arcs in the form
label x_c y_c a b theta ang_start ang_end.
shapes_out_ellipse.txtcontains the expected result for the sample image
out_polygon.txtcontains the parameters of the detected line segments, grouped into polygons, defined through contact points, in the form
label number_of_points x1 y1 x2 y2 x3 y3 ....
shapes_out_polygon.txtcontains the expected result for the sample image
The command will print at the end of the execution the numbers of features of
each type found. To check the installation, run
./elsdc shapes.pgm. The
output should be similar to the one in
shapes_out_polygon.txt. It should find 66
ellipses and 142 polygons. The exact coordinate values may differ slightly due to
rounding error differences in different systems. The execution time for
shapes.pgm is about 1.4s on a Dell notebook.
Source Code Files
main.ccontains the main() function; entry point into the application, calls IO functions and the detection function.
curve_grow.ccontains functions for region grow (gather neighbour pixels that share the same gradient orientation) and curve grow (gather regions that describe a convex and smooth contour).
rectangle.cdefines a rectangle structure (i.e. segment with width) to approximate the result of region grow.
polygon.cdefines a polygon structure (i.e. collection of rectangles).
ring.cdefines a (circular or elliptical) ring structure.
elsdc.ccontains refinement and validation functions for different types of primitives (ellipse, circle, line segment).
ellipse_fit.ccontains functions to estimate a circle or an ellipse using pixels positions and their gradient orientations.
iterator.cfunctions to count the number of aligned pixels inside a rectangle.
lapack_wrapper.ccontains wrappers for lapack functions for linear system solve.
pgm.cIO functions for pgm image format (the only format supported currently).
image.cdefines structures for image representation and functions for gradient computation.
gauss.cdefines a Gaussian kernel and contains functions to performs Gaussian filtering of an image.
misc.ccontains general-purpose functions and constants definitions.
svg.cfunctions to write the result in svg format.
We make available two datasets together with their ground truth for quantitative evaluation of ellipse detectors:
Dataset1_SyntheticCircles consists of 20 images, 500x500 pixels, containing
non-overlapping and overlapping circles. The images are corrupted with five
different levels of Gaussian noise, with five different noise realisations for
each noise level and for each image, resulting in 500 image instances in total.
coord.txt contains the ground truth circle parameters in the form:
xcenter1 ycenter1 radius1 xcenter2 ycenter2 radius2 xcenter3 ycenter3 radius3. Ten images of pure Gaussian noise are also added
pureNoise), where all detections are false positives.
Dataset2_CalibrationPatterns contains (in folder
images) 40 natural
images of calibration patterns that were included in Higuchi et al.'s package
for camera calibration
The patterns contain coplanar disjoint and concentric circles. The ground truth
was obtained by manually labelling the contours belonging to circles and rings
projections. For each image in folder
images, there is a corresponding
file in folder
ground_truth with the same name, containing the primitive
parameters in the form:
xcenter ycenter major_axis minor_axis theta.
Dataset3_RealImages contains real images that were used to produce the results from the paper "Joint A Contrario Ellipse and Line Detection".
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.