|
| 1 | +## How to Run Example Codes with Microsoft Visual Studio |
| 2 | +### Prerequisites |
| 3 | +* Install [Microsoft Visual Studio](https://www.visualstudio.com/) (shortly MSVS) |
| 4 | + * :memo: Note) Microsoft Visual Studio **Community** is _free_ for students, open-source contributors, and individual developers. |
| 5 | +* Install [Git](https://git-scm.com/) and [CMake](https://cmake.org/) |
| 6 | + * You need to [add their directory to PATH environment in Windows](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho). |
| 7 | +* Install [vcpkg](https://vcpkg.io/) ([more details](https://vcpkg.io/en/getting-started)) |
| 8 | + * You need to move your working directory where you want to install _vcpkg_ (I assume your working directory as `C:/`). |
| 9 | + ```bash |
| 10 | + git clone https://github.com/Microsoft/vcpkg.git |
| 11 | + .\vcpkg\bootstrap-vcpkg.bat |
| 12 | + ``` |
| 13 | +* Install [OpenCV](https://opencv.org/) and [Ceres Solver](http://ceres-solver.org/) using _vcpkg_ |
| 14 | + ```bash |
| 15 | + cd vcpkg |
| 16 | + vcpkg install opencv[world,contrib]:x64-windows --recurse |
| 17 | + vcpkg install ceres[suitesparse,cxsparse,eigensparse,tools]:x64-windows |
| 18 | + vcpkg integrate install |
| 19 | + ``` |
| 20 | + |
| 21 | +### Compiling and Running Examples |
| 22 | +1. Clone the repository: `git clone https://github.com/mint-lab/3dv_tutorial.git` |
| 23 | + * You need to move your working directory where you want to copy the repository. |
| 24 | + * Or you can download [example codes and slides as a ZIP file](https://github.com/sunglok/3dv_tutorial/archive/master.zip) and unzip it where you want. |
| 25 | +1. Generate MSVS solution and project files |
| 26 | + * You need to specify the _vcpkg_ directory where you installed it. (I assume you install it at `C:/`) |
| 27 | + ```bash |
| 28 | + cd 3dv_tutorial |
| 29 | + mkdir build |
| 30 | + cd build |
| 31 | + cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" |
| 32 | + ``` |
| 33 | +1. Run your MSVS and open the generated solution file, `build/3dv_tutorial.sln`. |
| 34 | +1. Build the example codes in the solution (Menu > `Build` > `Build Solution`) |
| 35 | +1. Run the examples using `F5` after specify your target as the startup project (Project Context Menu > `Set as Startup Project`) |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +## How to Run Example Codes in Linux |
| 40 | +### Prerequisites |
| 41 | +* Install [GCC](https://gcc.gnu.org/), [Git](https://git-scm.com/), [CMake](https://cmake.org/), [OpenCV](https://opencv.org/), and [Ceres Solver](http://ceres-solver.org/) |
| 42 | + |
| 43 | +### Running Examples |
| 44 | +1. Clone the repository: `git clone https://github.com/mint-lab/3dv_tutorial.git` |
| 45 | + * You need to move your working directory where you want to copy the repository. |
| 46 | + * Or you can download [example codes and slides as a ZIP file](https://github.com/sunglok/3dv_tutorial/archive/master.zip) and unzip it where you want. |
| 47 | +1. Generate `Makefile` and project files |
| 48 | + ```bash |
| 49 | + cd 3dv_tutorial |
| 50 | + mkdir build |
| 51 | + cd build |
| 52 | + cmake .. |
| 53 | + make install |
| 54 | + ``` |
| 55 | +1. Run the examples |
0 commit comments