Machine Vision and Applications (2000) 12: 16–22
Machine Vision and
Applications
c
Springer-Verlag 2000
A compact algorithm for rectification of stereo pairs
Andrea Fusiello
1
, Emanuele Trucco
2
, Alessandro Verri
3
1
Dipartimento Scientifico e Tecnologico, Universit
`
a di Verona, Ca’ Vignal 2, Strada Le Grazie, 37134 Verona, Italy; e-mail: fusiello@sci.univr.it
2
Heriot-Watt University, Department of Computing and Electrical Engineering, Edinburgh, UK
3
INFM, Dipartimento di Informatica e Scienze dell’Informazione, Universit
`
a di Genova, Genova, Italy
Received: 25 February 1999 / Accepted: 2 March 2000
Abstract. We present a linear rectification algorithm for
general, unconstrained stereo rigs. The algorithm takes the
two perspective projection matrices of the original cameras,
and computes a pair of rectifying projection matrices. It is
compact (22-line MATLAB code) and easily reproducible.
We report tests proving the correct behavior of our method,
as well as the negligible decrease of the accuracy of 3D
reconstruction performed from the rectified images directly.
Key words: Rectification – Stereo – Epipolar geometry
1 Introduction and motivations
Given a pair of stereo images, rectification determines a
transformation of each image plane such that pairs of con-
jugate epipolar lines become collinear and parallel to one
of the image axes (usually the horizontal one). The recti-
fied images can be thought of as acquired by a new stereo
rig, obtained by rotating the original cameras. The impor-
tant advantage of rectification is that computing stereo cor-
respondences (Dhond and Aggarwal, 1989) is made simpler,
because search is done along the horizontal lines of the rec-
tified images.
We assume that the stereo rig is calibrated, i.e., the cam-
eras’ internal parameters, mutual position and orientation are
known. This assumption is not strictly necessary, but leads to
a simpler technique. On the other hand, when reconstruct-
ing 3D shape of objects from dense stereo, calibration is
mandatory in practice, and can be achieved in many situ-
ations and by several algorithms (Caprile and Torre, 1990;
Robert, 1996)
Rectification is a classical problem of stereo vision; how-
ever, few methods are available in the computer vision liter-
ature, to our knowledge. Ayache and Lustman (1991) intro-
duced a rectification algorithm, in which a matrix satisfying
a number of constraints is handcrafted. The distinction be-
tween necessary and arbitrary constraints is unclear. Some
authors report rectification under restrictive assumptions; for
Correspondence to: A. Fusiello
instance, Papadimitriou and Dennis (1996) assume a very re-
strictive geometry (parallel vertical axes of the camera ref-
erence frames). Recently, Hartley and Gupta (1993), Robert
et al. (1997) and Hartley (1999) have introduced algorithms
which perform rectification given a weakly calibrated stereo
rig, i.e., a rig for which only points correspondences between
images are given.
Latest work, published after the preparation of this manu-
script includes Loop and Zhang (1999), Isgr
`
o and Trucco
(1999) and Pollefeys et al. (1999). Some of this work also
concentrates on the issue of minimizing the rectified image
distortion. We do not address this problem, partially because
distortion is less severe than in the weakly calibrated case.
This paper presents a novel algorithm rectifying a cali-
brated stereo rig of unconstrained geometry and mounting
general cameras. Our work improves and extends Ayache
and Lustman (1991). We obtain basically the same results,
but in a more compact and clear way. The algorithm is sim-
ple and detailed. Moreover, given the shortage of easily re-
producible, easily accessible and clearly stated algorithms,
we have made the code available on the Web.
2 Camera model and epipolar geometry
This section recalls briefly the mathematical background on
perspective projections necessary for our purposes. For more
details see Faugeras (1993).
2.1 Camera model
A pinhole camera is modeled by its optical center C and its
retinal plane (or image plane) R. A 3D point W is projected
into an image point M given by the intersection of R with
the line containing C and W. The line containing C and
orthogonal to R is called the optical axis and its intersection
with R is the principal point. The distance between C and
R is the focal length.
Let w =[xyz]
be the coordinates of W in the
world reference frame (fixed arbitrarily) and m =[uv]
the coordinates of M in the image plane (pixels). The map-
ping from 3D coordinates to 2D coordinates is the perspec-
https://blog.csdn.net/weixin_39675633/article/details/103931635