precise perimeter measurement for 3d object with a binocular stereo vision measurement system
TRANSCRIPT
ARTICLE IN PRESS
OpticsOptikOptikOptik 121 (2010) 953–957
0030-4026/$ - se
doi:10.1016/j.ijl
�CorrespondP.O. Box 319
fax: 86 0451821
E-mail addr
www.elsevier.de/ijleo
Precise perimeter measurement for 3D object with a binocular stereo
vision measurement system
Peng Zhaoa,b,�, Ni-Hong Wangb
aDepartment of Photoelectric Engineering, Beijing Institute of Technology, Beijing 100081, ChinabInformation & Computer Engineering College, Northeast Forestry University, Harbin 150040, China
Received 22 July 2008; accepted 14 December 2008
Abstract
A novel measurement scheme for a three dimensional (3D) object’s surface boundary perimeter is proposed. Thisscheme consists of three steps. First, a binocular stereo vision measurement system with two CCD cameras is devisedto obtain the two images of a detected object’s 3D surface boundary. Second, two B-spline active contours are appliedto converge to the object’s contour edges accurately in the two CCD images to perform the stereo matching. Finally,for the reconstructed 3D active contour, its true contour length is computed as the detected object’s true boundaryperimeter. An experiment on a bent surface’s perimeter measurement indicates that this scheme’s measurementrepetition error decreases to 0.6%.r 2009 Elsevier GmbH. All rights reserved.
Keywords: Visual detection; Binocular stereo vision; Image analysis; 3D perimeter; Active contour
1. Introduction
Measurement of areas, perimeters, centroids, direc-tional diameters, and other shape-related parameters isan important task of industrial computerized visionsystems [1]. Among these geometric parameters, theperimeter measurement has been studied in imageanalysis for many years. The approaches to perimetermeasurement can be based either on some contourreconstruction methods and subsequent measurement ofthe length of the reconstructed boundary [2–4] or oncounting the links of the ‘‘crack code’’ and performingadjustments (e.g., based on the number of corners) that
e front matter r 2009 Elsevier GmbH. All rights reserved.
eo.2008.12.008
ing author at: Northeast Forestry University,
, Harbin 150040, China. Tel.: 86 045182191523;
91401.
ess: [email protected] (P. Zhao).
have the equivalent effect of smoothing the stepwiseboundary [5]. But these schemes may have two draw-backs. First, they implement the perimeter measurementbased on the pixel unit (i.e., the unit of the perimeter ispixel). In the practical industrial inspections, the trueperimeter measurement of an object is usually required,which usually consists of the calibration of the CCDcamera in a vision measurement system. Second, theperimeter measurement is restricted to the planar objectin these schemes, which should be extended to the 3Dobject’s boundary perimeter measurement.
To accurately measure a 3D object’s true boundaryperimeter (e.g., the true perimeter of a 3D bent surface),we may use a 3D coordinate vision measurement system,to obtain the 3D coordinates of the object’s surfaceboundary. Some 3D coordinate measurement systemssuch as the 3D coordinate measuring machine are soexpensive and ponderous that they are not suitable for
ARTICLE IN PRESSP. Zhao, N.-H. Wang / Optik 121 (2010) 953–957954
the online measurement. On the other hand, a binocularstereo vision measurement system is usually applied inthe measurement of the object’s 3D profile. Thisbinocular vision measurement system is inexpensive toinstall, which consists of two CCD cameras, and it isalso easy to perform the measurement. Therefore, weuse a binocular vision measurement system to obtain the3D coordinates of the object’s surface boundary.
2. System structure and working principle
In an ordinary binocular vision measurement system,the two image planes of two CCD cameras are notcoplanar, and the two optical axes are not parallel. Thisbinocular vision model is complicated in terms of thestereo matching. In this paper, a simple binocular visionmodel proposed by J. Majumdar [6] is used. The twooptical axes are parallel in this simple model. It is easy toperform the stereo matching, which results in a fastmeasurement velocity.
This binocular vision model is illustrated in Fig. 1.The left image coordinate system is denoted as OXYZ,and the right image coordinate system is O0X0Y0Z0. Theworld coordinate system superposes the left imagecoordinate system after the translations and rotations.In this model, the left image plane is denoted as IL; andthe right image plane is IR. The imaging points in the leftand right image planes of one spatial point W(X,Y,Z)are PL(XL,YL) and PR(XR,YR), respectively. The para-meters of the two cameras are identical, but the twoorigins of two cameras are different. In this model,YL ¼ YR, and the left camera coordinate system super-poses the object coordinate system, so that the 3Dcoordinate of the detected spatial point W(X,Y,Z) is
PL(XL,YL)PR(XR,YR)
W(X,Y,Z)
Z
B
XX ,
Y ,
IL IR
Y
Fig. 1. System structure graph of a binocular vision measure-
ment system.
computed as follows [6]:
X ¼ X L
ðf � ZÞ
f
Y ¼ Y L
ðf � ZÞ
f
Z ¼ f �fB
X R � X L
8>>>>>>><>>>>>>>:
(1)
Some detailed coordinate computation formulas areexpounded in Ref. [6], which are omitted here. In thisbinocular vision system, the camera calibration isperformed to fulfill the parallel requirement of the twooptical axes. First, the calibration procedure is per-formed to obtain the camera’s internal and externalparameters and the relations of two cameras in terms ofthe position and orientation. Second, the two camerasare adjusted according to these parameters. This processis repeated until the two optical axes are parallel. Asfor the judgment criteria of the parallel optical axes,the identical heights of the two optical axes and thecoplanarity of the two image planes are used as thecriteria.
After we employ this simple binocular vision systemand obtain the two images of the detected object’ssurface boundary using the two CCD cameras, theimage feature extraction and the stereo matching mustbe performed. In this paper, we employ an activecontour model to extract the object’s edge informationand perform the stereo matching. This will be stated inthe next section.
3. Stereo matching by active contour
3.1. Review on active contour
Active contour is a special case of more generaltechniques of matching a deformable model to an imageby means of energy minimization. The original activecontour is proposed to locate a boundary in an imageplane by incorporating continuity, curvature, local edgestrength and some external constraints. If we represent anactive contour with its parametric form, the energyfunction of the active contour can be defined as follows [7]:
Etotal ¼
Z 1
0
EsnakeðV ðsÞÞds
¼
Z 1
0
½EintðV ðsÞÞ þ EextðV ðsÞÞ�ds (2)
where V(s) ¼ (X(s), Y(s)) is a parametric contour; andEintðV ðsÞÞ ¼ ½aðsÞjVsðsÞj
2 þ bðsÞjVssðsÞj2�=2 represents the
internal energy that serves to impose a piecewise smooth-ness constraint. The first-order derivative term enforces thecontinuity so that the active contour behaves like a
ARTICLE IN PRESS
2
1.5
1
0.5
0
-1
-1.5
-2-2 -1.5 -0.5 0 0.5 1 1.5 2-1
-0.5
corresponding cubic spline curve
control polygon
Fig. 2. 2D B-spline curve and its control polygon.
P. Zhao, N.-H. Wang / Optik 121 (2010) 953–957 955
membrane. The second-order derivative term enforces thesmoothness so that the active contour evolves like a thinplate. Here EextðV ðsÞÞ ¼ gðsÞEimageðV ðsÞÞþ oðsÞEconðV ðsÞÞ,Eimage ¼ �|rI(v)|2, where I denotes the image, representsthe image force that pushes the active contour towardssalient image features. The term Econ is defined asEcon ¼ �k(x1�x2)
2, which is the energy of a springconnecting a point on the active contour and a point inthe image plane.
In formula (2), a(s), b(s), g(s), o(s) are the regulariza-tion parameters that control the active contour’scontinuity, smoothness, image potential force andexternal constraint force, respectively. For instance,setting a(s) ¼ 0 will result in a position’s discontinuity atone pixel point V(s) of the active contour; and settingb(s) ¼ 0 will result in a curvature’s discontinuity at onepixel point V(s). For a single static image, an initialactive contour is set by hand. As for the minimizationsolution of formula (2), the dynamic programmingscheme or the greedy algorithm is usually applied.
3.2. Improved active contour with application to
binocular vision system
In this section, two improvements are proposed aboutthis active contour. First, this active contour isrepresented compactly by a cubic B-spline curve. In thispaper, a cubic, periodic and regular B-spline curve isapplied, and one segment indexed by i of a B-splinecurve can be expressed as follows [8]:
Si;3ðtÞ ¼ TMsGsi (3)
T ¼ ½t3; t2; t; 1�; Ms ¼1
6
�1 3 �3 1
3 �6 3 0
�3 0 3 0
1 4 1 0
2666664
3777775,
Gsi ¼ ½Pi;Piþ1;Piþ2;Piþ3�T (4)
where t is the curve parameter; Pi is a 2D control pointof the B-spline curve; Ms is the B-spline metric matrix;T, Gsi are the parameter vector and the control pointvector of the four dimensions, respectively, since thefour control points can determine one segmental cubicB-spline curve. Since a cubic B-spline curve can have theC2 continuity [8], this smoothness restraint can beapplied in the active contour model to discard theinternal energy Eint(V(s)) so that the active contourmodel’s computation complexity is decreased. As anexample, Fig. 2 illustrates a cubic 2D B-spline curve andits control polygon.
Second, these two B-spline active contours are appliedin the binocular vision measurement system, to recon-struct the 3D object’s surface boundary using the stereovision scheme. These B-spline active contours are
applied in the left and right CCD images, respectively,to detect the 2D edge contours of the object’s surfaceboundary. Define the corresponding pixel points in theleft and right active contours as VL(s) ¼ (XL(s),YL(s)),VR(s
0) ¼ (XR(s0),YR(s
0)). Since the optical axes of thecameras are parallel, YL(s) ¼ YR(s
0). Therefore, in theprocess of searching for the matching points in the leftand right active contours, we only need to search onerow, which results in a fast matching velocity.A matching formula based on the 3� 3 adjacent regionis computed as follows:
dðX ;Y Þ ¼X3m¼1
X3n¼1
jSLðm; nÞ � SRðm; nÞj2 (5)
where SL(m,n), SR(m,n) represent the gray values of thepixel points PL(m,n), PR(m,n) in a 3� 3 adjacent regioncentered at the pixel point PL(X,Y), PR(X
0,Y0).In fact, in the medical imaging process, active contours
have been applied in the lesion length measurement [9],the 3D reconstruction of vessel centerlines from biplaneangiographic views [10], and the catheter path recon-struction [11]. In these applications, the biplane activecontours are used as the projective 2D contours of a 3Dactive contour in a space. This 3D active contour deformsin the space until its projective adaptations to the vesselsin images. The final solution is obtained by reducing thereal reconstruction error defined as the mean distance ofthe active contour to the target curve. But this biplaneactive contour model is mathematically complex, com-pared with our active contour in the binocular visionsystem whose optical axes are parallel, with application tothe industrial inspections.
4. 3D perimeter computation
After the B-spline 2D active contour’s convergenceto the object’s contour edge and the stereo matching,
ARTICLE IN PRESSP. Zhao, N.-H. Wang / Optik 121 (2010) 953–957956
the contour reconstruction by two 2D active contoursis implemented using formula (1). We can get thediscrete spatial points of the reconstructed 3D activecontour denoted as P ¼ [p1,p2,y,pM], pi ¼ [xi,yi,zi]
T,i ¼ 1,y,M, where M is the spatial point number. Usingthe Euclidean distance formula, the true 3D boundaryperimeter is computed as follows:
So ¼XMi¼1
ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi½ðxiþ1 � xiÞ�
2 þ ½ðyiþ1 � yiÞ�2 þ ½ðziþ1 � ziÞ�
2q
(6)
where xM+1 ¼ x1, yM+1 ¼ y1, zM+1 ¼ z1.
5. Results and errors
One experiment on a small bent surface patch isperformed, to testify our perimeter measurementscheme. In the binocular vision measurement system,the used CCD camera model is MTV-1881EX 1/2, witha lens model AVENIA CCTV and f ¼ 16.0mm. Theeffective CCD image size is 768� 576. As for the 2Dactive contour, it is initialized with a few B-splinecontrol points manually, with a parameter Dt ¼ 0.2 andthe control point number N ¼ 12. The software on theactive contour is performed on a Pentium 2.80GHzcomputer with an internal memory 512M, using theMatlab 6.5. The measurement results and errors by our
Table 1. Computed result and error of the bent surface’s perimete
Measuring times 1 2 3 4
Perimeter 94.0 94.5 93.4 93.6
Relative error (%) 0.0 0.5 �0.6 �0.4
Table 2. Time requirement for perimeter measurement by active c
Measuring times 1 2 3 4
Time required (s) 180.5 181.2 182.1 1
Table 4. Time requirement for perimeter measurement by active c
Measuring times 1 2 3 4
Time required (s) 280.5 281.0 283.1 2
Table 3. Computed result and error of the bent surface’s perimete
Measuring times 1 2 3 4
Perimeter 94.2 94.2 93.8 93.7
Relative error (%) 0.1 0.1 �0.3 �0.4
active contour are illustrated in Table 1 (the unit of theperimeter is mm). Time requirement for the activecontour’s convergence and the stereo matching is alsoillustrated in Table 2.
Moreover, to discover the influence of the B-splinecontrol point number on the measurement error and themeasurement time requirement, a contrasting experi-ment is also performed, with a parameter Dt ¼ 0.2 andthe control point number N ¼ 18. The measurementresults and errors by this active contour are illustrated inTable 3, and time requirement for this active contour’sconvergence and the stereo matching is also illustratedin Table 4. By comparison, it can be seen that themeasurement repetition error 2s in Table 3 decreases,compared with that in Table 1. However, time require-ment in Table 4 increases greatly, compared with that inTable 2.
6. Conclusions
In this paper, a spatial boundary perimeter measure-ment scheme using a binocular vision measurementsystem and an active contour model is proposed. Thisperimeter measurement scheme based on a B-splineactive contour has small measurement repetition error,if adequate control points of an active contour areused. Moreover, this measurement scheme is portable,
r by active contour N ¼ 12.
5 6 7 2s Average
93.5 94.3 94.8 1.1 94.0
�0.5 0.3 0.9 1.2 0.0
ontour N ¼ 12.
5 6 7 Average
79.5 178.5 180.7 180.6 180.4
ontour N ¼ 18.
5 6 7 Average
81.5 282.5 280.7 283.6 281.8
r by active contour N ¼ 18.
5 6 7 2s Average
93.8 94.3 94.4 0.6 94.1
�0.3 0.2 0.3 0.6 0.0
ARTICLE IN PRESSP. Zhao, N.-H. Wang / Optik 121 (2010) 953–957 957
inexpensive, and is easy to set up, which is fit forpractical application in many occasions.
Acknowledgements
This research is supported by the Harbin YouthOriginality Science Foundations with grant No.2007RFXXS003 and No. 2008RFQXG005. It is alsosupported by the National Natural Science Foundationwith grant No. 60672082.
References
[1] C.S. Ho, Precision of digital vision systems, IEEE Trans
on PAMI 5 (6) (1983) 593–601.
[2] R. Klette, V. Kovalevsky, B. Yip, Length estimation of
digital curves, Machine Graphics & Vision 9 (7) (2000)
673–703.
[3] T. Asano, Y. Kawamura, R. Klette, et al., A new
approximation scheme for digital objects and curve length
estimations, Proc. Image and Vision Computing 1 (2000)
26–31.
[4] D. Coeurjolly, R. Klette, A comparative evaluation of
length estimators of digital curves, IEEE Trans on PAMI
26 (2) (2004) 252–258.
[5] J. Koplowitz, A.M. Bruckstein, Design of perimeter
estimators for digitized planar shapes, IEEE Trans on
PAMI 11 (6) (1989) 611–622.
[6] J. Majumdar, S. Seethalakshmy, Efficient parallel proces-
sing for depth calculation using stereo, Robotics and
Autonomous System 20 (1) (1997) 1–13.
[7] M. Kass, A. Witkin, D. Terzopoulos, Snakes: active
contour models, International Journal of Computer
Vision 1 (1988) 321–331.
[8] J. Foley, A.V. Dam, S. Feiner, et al., Computer graphics:
Principles and Practice, 2nd ed., Addison-Wesley Press,
Boston, 1990.
[9] C. Canero, P. Radeva, R. Toledo, et al., 3D curve
reconstruction by biplane snakes, Proc. IEEE ICPR 4
(2000) 563–566.
[10] C. Canero, F. Vilarino, J. Mauri, et al., Predictive
(un)distortion model and 3D reconstruction by biplane
snakes, IEEE TMI Special Issue MB0016 (2002) 1–14.
[11] A. Wahle, G. Prause, S. Dejong, et al., Geometrically
correct 3D reconstruction of intravascular ultrasound
images by fusion with biplane angiography—methods and
validation, IEEE Trans. Med. Imaging 18 (8) (1999)
686–699.