Code for undistorting and rectifying stereo image sequences
Cross-platform, dependency-free C++ code is provided which will perform undistortion and rectification of the stereo image sequences provided on the downloads page. Image rectification is performed using a bilinear interpolation between values generated using the PTGrey Triclops SDK to talk to the Bumblebee2 stereo camera.
To use this code you must download 3 different files:
- A stereo image sequence from the downloads page (and extract it into an empty directory)
- The C++ source: RectifyStereoImageSequence.cpp
- The bilinear lookup table: Bilinear lookup table (13M)
Compilation instructions
Linux/MacOSX (command line):
g++ RectifyStereoImageSequence.cpp -o RectifyStereoImageSequence
Windows (Visual Studio)
- Create a new Win32 Console project
- Add this file as the only project file
- Build project as usual
Usage instructions
RectifyStereoImageSequence /path/to/StereoImageSequence/ /path/to/BilinearLookupTable
for example:
/usr/local/bin/RectifyStereoImageSequence /data/StereoImages/ /data/Bumblebee-8090375-BiLUT-512x384.lut
Output
All the stereo images in /path/to/StereoImageSequence/
will be undistorted and rectified, and saved with the prefix rectified_
.
For example the undistorted and rectified version of /path/to/StereoImageSequence/StereoImage__1221661581.474238-left.pnm
will be saved as /path/to/StereoImageSequence/rectified_StereoImage__1221661581.474238-left.pnm