_published
_published
Abstract
169
Conversely, from two axes a1 , a2 , the matrix U can be where parameter σ models the band size (in pixels) of the
expressed as: ellipse region to be considered. By varying σ we can man-
α −β age the trade-off between the need of a regularization term
U=K
β α in the energy function to handle noise in the image gradient
and the estimation precision that has to be achieved.
αK31 + βK32 = 0
by imposing that . Finally, once U The level set for a generic ellipse is rather complicated
α2 + β 2 = 1 and cannot be easily expressed in closed form, however,
has been computed, the 3D ellipse matrix can be composed since it appears only within the Heavyside function and its
in the following way: derivative, we only need to have a good analytic approxi-
U c mation in the boundary around the ellipse. We approximate
Uc = 0 1 the level set in the boundary region as:
xT Ai x
Finally, with this parametrization it is very easy to obtain the ϕi (x) ≈ (9)
equation of the ellipse projected onto any camera. Given 2 xT Ai T I0 Ai x
a projection matrix P, the matrix AP describing the 2- ⎛ ⎞
1 0 0
dimensional ellipse after the projection can be expressed as:
⎛ ⎞ Where I0 = ⎝0 1 0⎠ and Ai is the re-projection of the
1 0 0 0 0 0
AP = (PUc )−T ⎝0 1 0 ⎠ (PUc )−1 (4) ellipse Uc into the ith camera computed using equation (4).
0 0 −1 The function has negative values outside the boundaries of
the ellipse, positive values inside and is exactly 0 for each
2.2. Energy Function over the Image
point {x|xT Uc x = 0}.
To estimate the equation of the 3D-ellipse we set-up a The gradient of the level set function ∇ϕ : R2 → R2
level-set based optimization schema that updates the ellipse can actually be defined exactly in closed form:
matrix Uc by simultaneously taking into account its re-
Ai x
projection in every camera of the network. The advantages ∇ϕi (x) = (10)
of this approach are essentially threefold. First, the equation x Ai T I0 Ai x
T
R2 Where:
= H (ϕ(x))∇ϕ(x), ∇Ii (x)2 dx , (7) EIi (Uc , x) = H (ϕ(x))∇ϕ(x), ∇Ii (x)
R2 and
where H is a suitable relaxation of the Heavyside function. ∂ ∂
In our implementation, we used: EIi (Uc , x) =( H (ϕ(x)))∇ϕ(x), ∇Ii (x)+
∂pi ∂pi
1 ∂
H(t) = t (8) + H (ϕ(x))( ∇ϕ(x)), ∇Ii (x) .
1 + e− σ ∂pi
170
0.07 0.014
2View 2View
MultiView sigma=3.0 MultiView sigma=3.0
0.06 MultiView sigma=6.0 0.012 MultiView sigma=6.0
MultiView sigma=9.0 MultiView sigma=9.0
0.01
0.05
0.008
0.04
Error
Error
0.006
0.03
0.004
0.02
0.002
0.01
0
0
1 2 3 4 5 6 130 160 190 210 240 270
Error
Error
0.015
0.08
0.06 0.01
0.04
0.005
0.02
0
0
10 20 30 40 50 60 70 80 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
171
different cameras looking at the disk from different points
of view (see Fig. 1 and Fig. 4). The corruption by Gaus-
sian noise has been produced by adding to each pixel a nor-
mal distributed additive error of variable value of σ, fol-
lowed by a blurring of the image with a Gaussian kernel
with σ = 6. The artificial clutter has been created by oc-
cluding the perimeter of the disc with a set of random white
circles until a given percentage of the original border was
corrupted. This simulates the effect of local imaging effect
such as the presence of specular highlights that severely af-
Figure 3. Examples of images with artificial noise added. Respec- fect the edge detection process. The focal length error was
tively additive Gaussian noise and blur in the left image and oc- obtained by changing the correct focal length of the central
clusion in the right image. The red line shows the fitted ellipse. camera by a given percentage. Finally, the distortion error
was introduced by adding an increasing amount to the cor-
imagery permits us to control the exact nature and amount rect radial distortion parameter K1. In Fig. 2 we show the
of noise, allowing for a separate and independent evalua- results obtained using the baseline triangulation and our op-
tion for each noise source. By contrast, the setup employ- timization with different values of the parameter σ used for
ing real cameras does not give an accurate control over the the heavyside function (respectively 3, 6 and 9 pixels). As
scene, nevertheless it is fundamental to asses the ability of expected, in all the tests performed the relative error grows
the approach to deal with the complex set of distractors that with the level of noise. In general, all the methods seem to
arise from the imaging process (such as reflections, vari- be minimally sensitive to Gaussian noise, whereas the clut-
able contrast, defects of the object, bad focusing and so on). ter has a big effect even at low percentages. The baseline
In both cases the ellipse detection is performed by extract- method performs consistently worse and, among the multi-
ing horizontal and vertical image gradients with an oriented view configurations, the one with lower heavyside band ap-
derivative of Gaussian filter. Edge pixels are then found by pears to be the most robust for almost all noise levels. This
non-maxima suppression and by applying a very permissive is probably due to the fact that the images have already been
threshold (no hysteresis is applied). The obtained edge pix- smoothed by the gradient calculation step, and thus further
els are thus grouped into contiguos curves, which are in turn smoothing is not required and, to some degree, leads to a
fitted to find ellipses candidates. The candidate that exhibit more prominent signal displacement.
the higher energy is selected and refined using [14]. The
refined ellipses are then triangulated using the two images 3.2. Real World Application
that score the lower triangulation error. The obtained 3D el-
lipse is finally used both as the result of the baseline method For the experiments with real images we built an imag-
(labeled as 2view in the following experiments) and as the ing device that hold 5 PointGrey Flea3 3.2Mp Monochrome
initialization ellipse for our refinement process (labeled as USB3 machine vision cameras (see Fig. 4). The 5 cameras
multiview). All the experiments have been performed with were calibrated for both intrinsic and extrinsic parameters.
3Mp images and the processing is done with a modern 3.2
Ghz Intel Core i7 PC equipped with Windows 7 Operating
System. The CPU implementation was written in C++ and
the GPU implementation uses the CUDA library. The video
card used was based on the Nvidia 670 chipset with 1344
CUDA cores.
172
Figure 5. Comparison between the accuracy of the initial 2D fitting and the proposed 3D optimization.
We used an aluminium pipe for air conditioning system as process is shown. In the first two rows of the figure the re-
the object to be measured, and the imaging head has been projection of the initially estimated 3D ellipse is overlayed
supplemented with four high power leds in order to get an to both the original images and the intensity-coded gradient
even illumination of the rim. This is a typical scenario for magnitude. In the remaining rows the reprojection of the
in-line inspection in manufacturing lines. Additionally, the optimized 3D ellipse is overlayed over the same images.
smooth and polished surface of the pipe offers especially The images used for the initial triangulation in this specific
challenging conditions for ellipse detection and refinement, case were the first and the third. Specifically, the initial
since reflections and changes of contrast tend to create a lot guess for the first image was a slightly off-center ellipse fit-
of false elliptical sectors and some highly structured noise. ted in between the edge response produced by the inner and
If Fig. 5 a complete qualitative example of the refinement outer rims of the pipe opening (see the gradient image). As
a matter of fact, it is immediate to note that these two im-
ages exhibits the lower reprojection error, especially for the
8.2
MultiView
central camera. However, the other reprojections are rather
2-Views grossly misaligned with the remaining three points of view.
8
By contrast, almost all the misalignment has been corrected
after performing the 3D refinement procedure. While some
Major-axis length [mm]
7.8
degree of displacement is still visible in some images, we
think that this is mainly due to miscalibration of the extrin-
7.6
sic parameters of the imaging head.
7.4
We manually measured the internal and external diame-
ter of the pipe with a caliper (with ±0.1mm accuracy) ob-
7.2
taining respectively 13.9 and 16.1 mm. However, since the
optimization process aim to converge toward the middle of
7
0 10 20 30 40 50 60 the two rims, it would make no sense to evaluate directly the
Snapshot number
measurement error committed. Still, the standard deviation
Figure 6. Quantitative assessment of the improvement in accuracy. of the data with respect to several subsequent measures of
173
7.7 OpenMP for CPU parallelization and CUDA for GPU com-
MultiView(3)
MultiView(5) puting. Both the CPU and GPU based implementations are
7.6 essentially the same, except for the fact that the latter can
exploit the massive computing power of modern graphics
Major-axis length [mm]
in parallel. After this computation, that can be performed 6E4 8E4 1E5 1.2E5 1.4E5 1.6E5 1.8E5 2E5
with no required synchronization between each view, a re- Avg. number of pixels processed
duction step is needed to aggregate all terms and obtain the Figure 8. Comparison between the running time of the CPU and
final value of the energy and gradient in each iteration. GPU-based implementations of the multiview algorithm. Times
We implemented the algorithm in C++ with no addi- are plotted with respect to the number of pixels in the evaluated
mask (i.e. size of the ellipse to be refined).
tional external libraries except for OpenCV for image IO,
174
5. Conclusions [9] J. Heikkila. Moment and curvature preserving technique for
accurate ellipse boundary detection. In Pattern Recognition,
In this paper we presented a novel approach for ellipse 1998. Proceedings. Fourteenth International Conference on,
fitting that exploits multiple simultaneous calibrated views volume 1, pages 734 –737 vol.1, aug 1998.
of the same physical elliptical object. The proposed tech- [10] S. Malassiotis and M. Strintzis. Stereo vision system for pre-
nique starts by obtaining an initial estimation of the 3D el- cision dimensional inspection of 3d holes. Machine Vision
lipse using 2D based fitting methods followed by a pairwise and Applications, 15:101–113, 2003.
triangulation. This initial guess is then refined by moving [11] S. Martelli, R. Marzotto, A. Colombari, and V. Murino.
its parameters according to an intensity-based level set ap- Fpga-based robust ellipse estimation for circular road sign
detection. In Computer Vision and Pattern Recognition
proach that accounts for all the images simultaneously. To
Workshops (CVPRW), 2010 IEEE Computer Society Confer-
this end, a specially crafted parametrization and an apt en-
ence on, pages 53 –60, june 2010.
ergy function have been introduced. The effectiveness of
[12] R. A. McLaughlin. Randomized hough transform: Improved
the approach has been evaluated through an extensive ex- ellipse detection with comparison. Pattern Recognition Let-
perimental section that shows its resilience to a wide range ters, 19(34):299 – 305, 1998.
of noise sources and compares the accuracy obtained with [13] L. Naimark and E. Foxlin. Circular data matrix fiducial
respect to a baseline approach. Finally, a running time system and robust image processing for a wearable vision-
analysis of our GPU-based implementation of the algorithm inertial self-tracker. In Proceedings of the 1st International
shows that the proposed method can be effectively used in Symposium on Mixed and Augmented Reality, ISMAR ’02,
real-time applications. pages 27–, Washington, DC, USA, 2002. IEEE Computer
Society.
References [14] J. Ouellet and P. Hebert. Precise ellipse estimation without
contour point extraction. Mach. Vision Appl., 21, 2009.
[1] F. Bergamasco, A. Albarelli, E. Rodola, and A. Torsello. [15] L. Quan. Conic reconstruction and correspondence from
Rune-tag: A high accuracy fiducial marker with strong oc- two views. Pattern Analysis and Machine Intelligence, IEEE
clusion resilience. In Proceedings of the 2011 IEEE Confer- Transactions on, 18(2):151 –160, feb 1996.
ence on Computer Vision and Pattern Recognition, CVPR [16] D. Schleicher and B. Zagar. Image processing to estimate
’11, pages 113–120, Washington, DC, USA, 2011. IEEE the ellipticity of steel coils using a concentric ellipse fitting
Computer Society. algorithm. In Signal Processing, 2008. ICSP 2008. 9th In-
[2] Y. Chen and H. H. S. Ip. Planar metric rectification by al- ternational Conference on, pages 884 –890, oct. 2008.
gebraically estimating the image of the absolute conic. In [17] G. Song and H. Wang. A fast and robust ellipse de-
Proceedings of the Pattern Recognition, 17th International tection algorithm based on pseudo-random sample consen-
Conference on (ICPR’04) Volume 4 - Volume 04, ICPR ’04, sus. In Computer Analysis of Images and Patterns, volume
pages 88–91, Washington, DC, USA, 2004. IEEE Computer 4673 of Lecture Notes in Computer Science, pages 669–676.
Society. Springer Berlin / Heidelberg, 2007.
[3] A. Chia, M. Leung, H.-L. Eng, and S. Rahardja. Ellipse de- [18] P. Srestasathiern and A. Yilmaz. Planar shape representation
tection with hough transform in one dimensional parametric and matching under projective transformation. Computer Vi-
space. In Image Processing, 2007. ICIP 2007. IEEE Inter- sion and Image Understanding, 115(11):1525 – 1535, 2011.
national Conference on, volume 5, pages V –333 –V –336, [19] J. Usabiaga, A. Erol, G. Bebis, R. Boyle, and X. Twombly.
16 2007-oct. 19 2007. Global hand pose estimation by multiple camera ellipse
[4] H. S. M. Coxeter. Projective Geometry, 2nd ed. Springer tracking. Machine Vision and Applications, 21(1):1–15,
Verlag, 2003. 2009.
[5] Y. Dufournaud, R. Horaud, and L. Quan. Robot Stereo-hand [20] J. Wright, A. Wagner, S. Rao, and Y. Ma. Homography from
Coordination for Grasping Curved Parts. In J. N. Carter and coplanar ellipses with application to forensic blood splatter
M. S. Nixon, editors, 9th British Machine Vision Confer- reconstruction. In Computer Vision and Pattern Recogni-
ence (BMVC ’98), volume 2, pages 760–769, Southampton, tion, 2006 IEEE Computer Society Conference on, volume 1,
Royaume-Uni, 1998. British Machine Vision Association. pages 1250 – 1257, june 2006.
[6] A. Fitzgibbon, M. Pilu, and R. Fisher. Direct least square [21] Y. Xie and J. Ohya. Efficient detection of ellipses from an
fitting of ellipses. Pattern Analysis and Machine Intelligence, image by a guided modified ransac. In Image Processing:
IEEE Transactions on, 21(5):476 –480, may 1999. Algorithms and Systems, volume 7245 of SPIE Proceedings.
[7] A. Gupta, J. Little, and R. Woodham. Using line and ellipse SPIE, 2009.
features for rectification of broadcast hockey video. In Com- [22] Y. Yoon, G. DeSouza, and A. Kak. Real-time tracking and
puter and Robot Vision (CRV), 2011 Canadian Conference pose estimation for industrial objects using geometric fea-
on, pages 32 –39, may 2011. tures. In Robotics and Automation, 2003. Proceedings. ICRA
[8] D. W. Hansen and Q. Ji. In the eye of the beholder: A sur- ’03. IEEE International Conference on, volume 3, pages
vey of models for eyes and gaze. IEEE Trans. Pattern Anal. 3473 – 3478 vol.3, sept. 2003.
Mach. Intell., 32(3):478–500, Mar. 2010.
175