In Computer Vision, the pose of an object typically refers to its relative orientation and position with respect to a camera. One can change the pose of an object by either moving the object with respect to the camera, or the camera with respect to the object. The pose of the object is typically estimated by analyzing the correspondences between features extracted from different images -- more than one image looking at the same scene from different angles.
- 2D-to-2D: See [Hartley and Zisserman, 2000] for the projective transformation/homography and [Nister, 2004] as a seminal work on the visual odometry.
- 3D-to-3D: See [Maimone et al., 2007] as an example of such a case.
- 3D-to-2D: As pointed out [Nister, 2004], motion estimation from 3D-to-2D correspondences is more accurate than from 3D-to-3D cases because it minimizes the image reprojection error instead of dealing with 3D-to-3D feature position error. The sample codes in this repo is about a solution to the problem of the PnP (Perspective-n-Points). Some well-known PnP solutions are P3P [Gao et al., 2003], EPnP [Lepetit et al., 2009].
- [Cheng et al., 2005] Yang Cheng, Mark Maimone, and Larry Matthies, Visual odometry on the mars exploration rovers, IEEE Robotics and Automation Magazine, 13(2): 54-62, 2005.
- [Fraundorfer and Scaramuzza, 2012] Friedrich Fraundorfer and Davide Scaramuzza, Visual odometry: part II - matching, robustness, and applications, IEEE Robotics and Automation Magazine, 19(2): , 2012.
- [Gao et al., 2003] Xiao-Shan Gao, Xiao-Rong Hou, Jianliang Tang and Hang-Fei Cheng, omplete solution classification for the perspective-three-point problem, IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(8): 930-943, 2003.
- [Hartley and Zisserman, 2000] Richard Hartley and Andrew Zisserman, Multiview Geometry, 2000.
- [Howard, 2008] Andrew Howard, Real-time stereo visual odometry for autonomous ground vehicles, In Proceedings of IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS-2008), pp. , 2008.
- [Lepetit et al., 2009] Vincent Lepetit, Francesc Moreno-Noguer and Pascal Fua, EPnP: an accurate O(n) solution to the PnP problem, International Journal of Computer Vision, 2009.
- [Maimone et al., 2007] Mark Maimone, Yang Cheng and Larry Matthies, Two years of visual odometry on the mars exploration rovers, Journal of Field Robotics, 24(3): 169-186, 2007.
- [Nister, 2004] David Nister, An efficient solution to the five-point relative pose problem, IEEE Transactions on Pattern Analysis and Machine Intelligence, 26(6): 756-770, 2004.
- [Nister et al., 2004] David Nister, Oleg Naroditsky, and James Bergen, Visual odometry, In Proceedings of Computer Vision and Pattern Recognition (CVPR-2004), 2004.
- [Nister et al., 2006] David Nister, Oleg Naroditsky, and James Bergen, Visual odometry for ground vehicle applications, Journal of Field Robotics, 23(1): 3-20, 2006.
- [Rosten and Drummond, 2006] Edward Rosten and Tom Drummond, Machine learning for high-speed corner detection, In Proceedings of European Conference on Computer Vision (ECCV-2006), pp. 430-443, 2006.
- [Scaramuzza and Fraundorfer, 2011] Davide Scaramuzza and Friedrich Fraundorfer, Visual odometry: part I - the first 30 years and fundamentals, IEEE Robotics and Automation Magazine, 18(4): , 2011.
- [Quan and Lan, 1999] Long Quan and Zhongdan Lan, Linear N-point pose determination, IEEE Transactions on Pattern Analysis and Machine Intelligence, 21(8): 774-780, 1999.
To make it run, you need
- OpenCV ver 3.0 or above
- CMake ver 2.8 or above
To enable cv::viz, the VTK package in your OpenCV codes, the following has to be done: Install VTK and Recompile OpenCV. If you already installed the VTK and OpenCV properly, and don't have any issues in calling any built-in functions of cv::viz package, you don't need to do the followings.
- Install VTK (Visualization Toolkit):
- Download VTK 7.7.1 **Note** I've tried to do this with VTK 8.1, but it didn't work. So the following steps only work with VTK 7.7.1 and OpenCV 3.1.0 or 3.3.0.
- Unzip VTK-7.1.1.zip
- At the directory unzipped VTK-7.1.1, type `ccmake .` This will pop
up cmake GUI. At the menu, do the following:
BUILD_SHARED_LIBS = ON BUILD_TESTING = ON CMAKE_BUILD_TYPE = Release
Then press
c
to save the current configuration and exit. You'll have to pushc
at the beginning to see any of these. - At the directory unzipped VTK-7.1.1, do the following:
cmake . make sudo make install
- Once you're done with all the above steps, you have VTK shared libraries and their friends installed on your local machine. Now move on to the next part, "Re-Compile OpenCV."
- Re-Compile OpenCV
- Download OpenCV 3.3.0 and unzip it.
- At the directory unziped OpenCV, do the following:
mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON โD WITH_VTK=ON .. make sudo make install
Now you have all the required libraries. It's time to build the repo. To build, do the following at the directory you cloned this repo:
mkdir build
cd build
cmake ..
make
After compilation, in the build directly, type the following:
cd build
./pe