一站式解决方案,支持如 ADCensus、SGBM、BM 等算法的立体视觉。
This is a master student project realized at the robotics laboratory of the Westphalian University of Applied Science. With the programs in this repository you can calibrate single cameras, a stereo system, calculate disparity maps and evaluate your data. It's a all in one package for stereo vision! The software runs under windows and linux and is written in C++.
Checkout the project in action or see other nice projects: My YouTube Channel, Robalab W-HS YouTube Channel Based on the following libraries:
Projects in this package:
With this program you can calculate the intrinsic and extrinsinc parameters of your cameras. The calibration requires several images with chessboard pattern in any size, e.g. a 8x6 (width x height) pattern. We used this 18x12 (only the inner edges count) pattern on a A0 sheet in the project. Every calibration is based on about 20 images from different views, distances and angles. It is important that the pattern is visible on every section of the camera sensor! For every single camera and calibration step (intrinsic and extrinsic) you must take these images.
Build the program:
mkdir buildcd buildcmake ..makeExecute the intrinsic:
./intrinsic PATH_TO_YOUR_CONFIG/intrinsicConfig.cfgExecute the extrinsic:
./extrinsic PATH_TO_YOUR_CONFIG/extrinsicConfig.cfgWith this program you can easy rectify new images which are taken with a calibrated stereo camera system. You need the intrinsic calibration from each camera and the extrinsic calibration for the stereo system. All the calibrations can be estimated with "IntrinsicExtrinsicCalib".
Build the program:
mkdir buildcd buildcmake ..makeExecute the image rectification:
./ImageRectify PATH_TO_YOUR_CONFIG/config.cfgThis program creates the disparity map for a given rectified image set with the use of the ADCensus algorithm. You can find the paper in the "Documents" section or here. The current implementation doesn't use your graphics card for parallelization, for what the algorithm is designed for, but rather it makes use of OpenMP. By using the OpenCV it should be easy to make a port to the graphics card.
If you have an extrinsic calibration file for your images the program creates a point cloud. Otherwise create an empty extrinsic file and change the specific parameter in the config as you can see in the sample folder. Only the depth maps will be created if no extrinsic exists. In any case, the input images must be rectified!
You can see the results and evalution of the algorithm here: http://vision.middlebury.edu/stereo/eval/
Build the program:
mkdir buildcd buildcmake ..makeExecute the image rectification:
./ADCensusBM PATH_TO_YOUR_CONFIG/config.cfgIt's a small tool to check the accuracy of your calibrations and the disparities in the scene. The program simply overlays 2 corresponding images from the left and right camera and display them. Afterwards you can move one image (the first one) and check if objects layes on the same epipolar lines. Further you can check the disparity between the objects.
Build the program:
mkdir buildcd buildcmake ..makeExecute PictureOverlay:
./PictureOverlay PATH_TO_YOUR_IMAGE/image1.jpg PATH_TO_YOUR_IMAGE/image2.jpg alpha1 alpha2 scaleIt's a small programm to compare the results from the ADCensus with the builtin block matching methods by the OpenCV, Block-Matching (BM) and Semi-Global Bock-Matching (SGBM). As the input, the programm needs 2 rectified images from a stereo camera system. You're be able to adjust all free parameters for each algorithm and see immediately the results. You have the option to switch the whole time between the 2 algorithms , to compare them.
Build the program:
mkdir buildcd buildcmake ..makeExecute OpenCVBM:
./OpenCVBM PATH_TO_YOUR_IMAGE/image1.jpg PATH_TO_YOUR_IMAGE/image2.jpg scaleWith this programm you can evaluate each pixel and see the disparity and the calculated distance for this. All you need are the rectified images, the calculated disparity images and the camera extrinsic.
Writing a config file:
Before you can use the programm you need a config. A sample config is under the "evalDisp/sample"!
Parameter:
Sample config 1 camera:
cameras =(
{
cameraName="Sample_Camera";
extrinsicFile="PATH_TO_THE_CALCULATED_CAMERA_EXTRINSIC_FILE/CAMERA_EXTRINSIC_FILE.yml";
imagesXML="PATH_TO_THE_IMAGE_CONFIG/IMAGE.xml";
dispsXML="PATH_TO_THE_DISPARITY_MAPS/DISPARITY_MAPS.xml";
scaleFactor=0.5;
}
};Sample config for a couple of cameras:
…Build the program:
mkdir buildcd buildcmake ..makeExecute evalDisp:
./evalDisp PATH_TO_YOUR_CONFIG/YOUR_CONFIG.jpg暂无开放 Issues,或尚未同步最近议题。