Chapter 7 A Convenient Vision-based System for Automatic Detection of Parking
7.2 Proposed Calibration Method using Only One Space Line
To design an easy-to-setup vision-based parking lot system, the camera calibration process must be easy to carry out by normal users with no technical knowledge. In this section, a simplified camera model is proposed for this aim. A calibration method is proposed accordingly which makes use of only one space line in the environment without knowing its position and direction.
The proposed modified unifying camera model is based on the use of an optimal approximation value of the parameter l which is the distance from the effective viewpoint O to the pinhole point Oc as shown in Fig. 7.2. The model has two merits: 1) it reserves important characteristics of space lines as shown in this section; and 2) it can be calibrated easily by the use of a single space line as described later in this dissertation. These merits make the corresponding system setup process easy to conduct.
84 Z
O(0, 0, 0)
P(X, Y, Z) Oc(0, 0, l)
Ps(Xs, Ys, Zs)
Z = fe l p(u, v)
unit sphere
Image plane Π
Fig. 7.2 An illustration of a two-step spherical mapping.
The rationale of finding a fixed optimal value of parameter l can be explained as follows. In Fig. 7.3(a), the image of a space line, called line image hereafter, is marked as a blue curve; and in Fig. 7.3(b), this line image is shown to be fit well enough by conic sections with different values of the parameter l while the two vanishing points are fixed (marked in yellow in the figure). This phenomenon leads to two conclusions: 1) the parameter l cannot be well calibrated from line images; and 2) reversely, the value of the parameter l did not affect the space line detection process.
The first conclusion is consistent with some previous studies [46][48]. Specifically, the parameter l was fixed in the simulation experiments described in Geyer and Daniilidis [46], so the parameter l was not derived in the calibration process; and as seen in Deng et al. [48], the parameter l is assumed to be known before the calibration.
The second conclusion makes it possible to find an optimal value of the parameter l to approximate that of any kind of wide-angle camera, without affecting the space line detection process.
85
(a) (b)
Fig. 7.3 Fitting a space line using different values of l. (a) Space line to be fit (marked as blue). (b) Fitting results using l = 2.0, 1.5, 1.0, 0.8, and 0.5 with larger ellipses corresponding to smaller values of l, and the two yellow crosses indicate the fixed vanishing points.
To find the optimal value of l, we define first the range of parameter l of each kind of wide-angle camera. For parabolic catadioptric cameras, the value of l is known to be 1.0 [44]; for hyperbolic catadioptric cameras, the value of l is smaller than 1.0 and larger than 0.0 [44]; and for fisheye-lens cameras, the value of l is larger than 1.0 [47]. In this study, we define the interesting range of the parameter l to be 0.5
< l < 2.0, which includes the commonly used values of l. For example, the values of l derived in [46][48] are 0.8, 0.966 and 1.0, that derived in [49] is 0.9663, and that derived in [50] is 1.07.
The optimal value l* found by a simulation process as described in the following.
1) Generate simulated line images Ii with size 10001000 for a set of sampled values of l in the interesting range 0.5 < l < 2.0 and for a set of sampled positions and directions of space lines;
2) For each sample value lj* in the range 0.5 < lj* < 2.0, do the following steps 2.1) find the best-fitting curve Iij* to each line image Ii, with l = lj* by a
Levenberg–Marquardt process;
2.2) compute the distance distij between Ii and Iij* as
1
1 n *
ij k k
k
dist p p
n
(103)86
where n denotes the number of pixels on the line image Ii, pk a pixel on Ii, pk* the nearest pixel on Iij* to pk, and ||pk pk*|| the distance between pk and pk*;
2.3) calculate the average distance distj of all distij of all Ii as a measure of optimality of the sampled value lj*, with a smaller distj meaning a better fit of lj* to all Ii.
3) Choose as the desired optimal value l* the lj* with the smallest distj which is called also the average fitting error and denoted as dist subsequently.
An experimental result of the above process is shown in Fig. 7.4, where Fig.
7.4(a) shows a line image Ii marked in blue and a best-fitting curve Iij* marked in red;
Fig. 7.4(b) shows the trend of the value of distj for different lj* values, from which it can be seen that an optimal value of li* does exist and is located at 1.24 for choice as l*, and that the line images can be well approximated by Eq. (2) with l = l* resulting in an average fitting error dist 1.1941 pixels.
pk pk*
(a)
distj
(pixels)
lj*
(b)
Fig. 7.4 Finding the optimal value l*. (a) A line image Ii (marked in blue) and its best-fitting curve Iij* (marked in red). (b) The trend of the average distj of the distances between the best-fitting curve and the line images. The optimal value of lj*
is 1.24, with distj = dist being about 1.1941 pixels.
87
As a result of utilizing the aforementioned second conclusion, we propose a camera model which is identical to the unifying one proposed in [44] but with its parameter l fixed to be the optimal value 1.24 derived previously. One merit of this model is that it leads to the possibility of calibrating wide-angle cameras using only one line image. This property is a great advantage over the conventional models [45][44], by which the camera cannot be calibrated reliably from line images as proved previously. It also facilitates a non-technical user to conduct the calibration process without difficulty as mentioned previously.
Based on the proposed camera model using the fixed parameter l = 1.24, the idea of the proposed calibration process using a single line can be divided into three steps.
First, a space line is chosen with its line image (in the shape of a conic-section curve) marked manually. Then, the best-fitting ellipse to this line image is computed, from which the unknown camera parameters and the space line are estimated roughly.
Finally, a Levenberg–Marquardt algorithm is conducted to find the precise values of the camera parameters.
In more detail, let L be a chosen space line, IL its line image, and EL the best-fitting ellipse to IL. As derived in [45][46], IL can be expressed as
parameters used in the unifying camera model as described in Sec. II.A. Also, let the ellipse EL be described byNote that when nz = 0, the line image is a straight one going through the image center so that the parameter fe, which is the effective focal length of the camera, cannot be calibrated [46][62]. Ignoring this, we may rewrite Eq. (104), after dividing it by nz2 ≠ 0, to be
88
Now, the problem is to estimate roughly the values of the parameters (l, fe, G, H) such that Eqs. (105) and (106) are close to each other. Since only rough estimation is needed, we first simplify (106) by assuming l = 1.0. Accordingly, the problem is reduced to finding the parameters (fe, G, H) which satisfy
2
where “~” means “equals up to a scale.” Let be the hidden unknown parameter for this scaling. Then, we have
One solution to the above equation for use as rough estimates of the parameters is:
2
A Levenberg–Marquardt process is conducted finally to derive the precise values of (fe, G, H), with the initial values being specified by (109) and the criterion being to minimize the value of
with respect to all the pixels (u, v) on the line image IL. After this optimization process is done, the parameter fe of the camera model is derived, completing the calibration process (as shown in Fig. 7.5).
Four results of this calibration process are shown in Fig. 7.5. The calibrated values fe for Figs. 7.5(a) and 7.5(b) are 319.90 and 319.57, respectively, and those for
89
Figs. 7.5(c) and 7.5(d) are 266.73 and 269.53, respectively. The validity of the proposed calibration method can be shown by the good fitness of the best-fitting ellipse to the manually-marked line image in each case, and the closeness of the calibrated values fe in the first two cases using a fisheye-lens camera and in the remaining two cases using a hyperbolic catadioptric camera.
(a) (b)
(c) (d)
Fig. 7.5 Calibration results with yellow curves indicating manually-marked pixels, and red ellipses being the best-fitting results. (a)(b) Results using a fisheye-lens camera with calibrated values fe being 319.90 and 319.57, respectively. (c)(d) Results using a hyperbolic catadioptric camera with calibrated values fe being 266.73 and 269.53, respectivley.