OpenPano-master

所属分类:图形图像处理
开发工具:C/C++
文件大小:8024KB
下载次数:4
上传日期:2020-04-18 20:17:57
上 传 者jeffff
说明:  在VS上编译的SIFT代码,实现图像拼接。C++实现。
(The SIFT code and stitching compiled, has good performance.)

文件列表:
.travis.yml (727, 2019-03-28)
CMakeLists.txt (1439, 2019-03-28)
LICENSE (1080, 2019-03-28)
results (0, 2019-03-28)
results\CMU0-all.jpg (809157, 2019-03-28)
results\CMU0-cyl.jpg (547958, 2019-03-28)
results\CMU1.jpg (569548, 2019-03-28)
results\NSH-all.jpg (764508, 2019-03-28)
results\NSH-cyl.jpg (579790, 2019-03-28)
results\apartment.jpg (672522, 2019-03-28)
results\apple.jpg (268253, 2019-03-28)
results\fight.jpg (668800, 2019-03-28)
results\flower.jpg (78678, 2019-03-28)
results\ground.jpg (860544, 2019-03-28)
results\myself.jpg (609937, 2019-03-28)
results\planet.jpg (290867, 2019-03-28)
results\uav.jpg (742164, 2019-03-28)
src (0, 2019-03-28)
src\.ycm_extra_conf.py (2777, 2019-03-28)
src\CMakeLists.txt (1196, 2019-03-28)
src\Makefile (2214, 2019-03-28)
src\common (0, 2019-03-28)
src\common\common.hh (33, 2019-03-28)
src\config.cfg (2300, 2019-03-28)
src\env.sh (59, 2019-03-28)
src\feature (0, 2019-03-28)
src\feature\brief.cc (2536, 2019-03-28)
src\feature\brief.hh (845, 2019-03-28)
src\feature\dist.cc (2170, 2019-03-28)
src\feature\dist.hh (913, 2019-03-28)
src\feature\dog.cc (3578, 2019-03-28)
src\feature\dog.hh (1562, 2019-03-28)
src\feature\extrema.cc (5940, 2019-03-28)
src\feature\extrema.hh (1112, 2019-03-28)
src\feature\feature.cc (1688, 2019-03-28)
... ...

# OpenPano ![cmu0](results/CMU0-all.jpg) ## Introduction OpenPano is a panorama stitching program written in C++ from scratch (without any vision libraries). It mainly follows the routine described in the paper [Automatic Panoramic Image Stitching using Invariant Features](http://matthewalunbrown.com/papers/ijcv2007.pdf), which is also the one used by [AutoStitch](http://matthewalunbrown.com/autostitch/autostitch.html). [![Build Status](https://travis-ci.org/ppwwyyxx/OpenPano.svg?branch=master)](https://travis-ci.org/ppwwyyxx/OpenPano) ### Compile Dependencies: * gcc >= 4.7 (Or VS2015) * [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page) * [FLANN](http://www.cs.ubc.ca/research/flann/) (already included in the repository, slightly modified) * [CImg](http://cimg.eu/) (optional. already included in the repository) * libjpeg (optional if you only work with png files) * cmake or make Eigen, CImg and FLANN are header-only, to simplify the compilation on different platforms. CImg and libjpeg are only used to read and write images, so you can easily get rid of them. On ArchLinux, install dependencies by: `sudo pacman -S gcc sed cmake make libjpeg eigen` On Ubuntu, install dependencies by: `sudo apt install build-essential sed cmake libjpeg-dev libeigen3-dev` ### Compile: #### Linux / OSX / WSL (bash on windows) ``` $ make -C src ``` or ``` $ mkdir build && cd build && cmake .. && make ``` The default clang on OSX doesn't contain openmp support. You may need gcc or different clang. See #16. #### Windows * Install cmake, VS2015 * Set environment variable `Eigen3_DIR` to `{YOUR_EIGEN3_DIRECTORY}/eigen3/cmake`. * Open Visual Studio [Developer Command Prompt](https://msdn.microsoft.com/en-us/library/ms22***59(v=vs.110).aspx). * `cd path/to/OpenPano` * `cmake .` * Open the VS2015 project and compile the project * copy `config.cfg` to the directory containing `image-stitching.exe` * The author have never used Visual Studio and this windows build process may not work for you. Feel free to submit PR to improve the build process. ### Options: Three modes are available (set/unset the options in ``config.cfg``): + __cylinder__ mode. Give better results if: + You are __only__ turning left (or right) when taking the images (as is usually done), no translations or other type of rotations allowed. + Images are taken with the same camera, with a known ``FOCAL_LENGTH`` set in config. + Images are given in the left-to-right order. (I might fix this in the future) + __camera estimation mode__. No translation is the only requirement on cameras. It can usually work well as long as you don't have too few images. But it's slower because it needs to perform pairwise matches. + __translation mode__. Simply stitch images together by affine transformation. It works when camera performs pure translation and scene points are roughly at the same depth. It also requires ordered input. Some options you may care: + __FOCAL_LENGTH__: focal length of your camera in [35mm equivalent](https://en.wikipedia.org/wiki/35_mm_equivalent_focal_length). Only useful in cylinder mode. + __ORDERED_INPUT__: whether input images are ordered sequentially. has to be `1` in CYLINDER and TRANS mode. + __CROP__: whether to crop the final image to avoid irregular white border. Other parameters are quality-related. The default values are generally good for images with more than 0.7 megapixels. If your images are too small and cannot produce satisfactory results, it might be better to resize your images rather than tune the parameters. ### Run: ``` $ ./image-stitching ... ``` The output file is ``out.jpg``. You can play with the [example data](https://github.com/ppwwyyxx/OpenPano/releases/tag/0.1) to start with. Before dealing with very large images (4 megapixels or more), it's better to resize them. (I might add this feature in the future) In cylinder/translation mode, the input file names need to have the correct order. ## Examples ([All original data available for __download__](https://github.com/ppwwyyxx/OpenPano/releases/tag/0.1)): Zijing Apartment in Tsinghua University: ![dorm](results/apartment.jpg) "Myselves": ![myself](results/myself.jpg) Carnegie Mellon University from 38 images ![apple](results/apple.jpg) Newell-Simon Hall in CMU (this one is hard because objects are closer): ![nsh](results/NSH-all.jpg) A full-view pano built from UAV images: ![uav](results/uav.jpg) For more examples, see [results](results). ## Speed & Memory: Tested on Intel Core i7-6700HQ, with `ESTIMATE_CAMERA` mode: + 11 ordered images of size 600x400: 3.2s. + 13 ordered images of size 1500x1112: 6s. + 38 unordered images of size 1300x867 (high vertical FOV): 51s. Memory consumption is known to be huge with default libc allocator. Simply using a modern allocator (e.g. tcmalloc, jemalloc) can help a lot. Also, setting `LAZY_READ` to 1 can save memory at the cost of a minor slow down. Peak memory in bytes (assume each input has the same w & h): + Without `LAZY_READ` option: max(finalw \* finalh \* 12, #photos \* w \* h \* 12 + #photos \* #matched\_pairs * 96 + #keypoints * 520) + With `LAZY_READ` option: max(finalw \* finalh \* 16, #threads \* w \* h \* 12, #photos \* #matched\_pairs * 96 + #keypoints * 520) ## Algorithms + Features: [SIFT](http://en.wikipedia.org/wiki/Scale-invariant_feature_transform) + Transformation: use [RANSAC](http://en.wikipedia.org/wiki/RANSAC) to estimate a homography or affine transformation. + Optimization: focal estimation, [bundle adjustment](https://en.wikipedia.org/wiki/Bundle_adjustment), and some straightening tricks. For details, see [my blog post](http://ppwwyyxx.com/2016/How-to-Write-a-Panorama-Stitcher/). ## Quality Guidelines To get the best stitching quality: + While rotating the camera for different shots, try to keep the position of camera lens static. + Keep the exposure parameters unchanged. + Do not shoot on moving objects. + Objects far away will stitch better. + The algorithm doesn't work well with wide-angle cameras where images are distorted heavily. Camera parameters are needed to undistort the images. ## TODOs + apply pairwise matching for translation mode as well + run bundle adjustment on sphere lens instead of perspective lens + improve feature detector and matching + use LAZY_READ & 1 byte image in both blender to reduce peak memory + clean up use of copies of `ImageRef` + faster gaussian blur kernel + port some hotspot (e.g. `dist.cc`) to neon + support read/write EXIF metadata to: + get focal length, distortion, etc + allow pano to be viewed on Facebook + python bindings

近期下载者

相关文件


收藏者