Skip to content

Commit

Permalink
Updated dnn build tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Lyudvichenko committed Aug 26, 2015
1 parent 3154fc0 commit f360c19
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
Binary file added modules/dnn/tutorials/images/build_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/dnn/tutorials/images/build_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/dnn/tutorials/images/build_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/dnn/tutorials/images/build_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/dnn/tutorials/images/build_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 22 additions & 9 deletions modules/dnn/tutorials/tutorial_dnn_build.markdown
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Build dnn module {#tutorial_dnn_build}
================
Build opencv_contrib with dnn module {#tutorial_dnn_build}
====================================

Introduction
------------
opencv_dnn module is placed in the secondary [opencv_contrib](https://github.com/Itseez/opencv_contrib) repositroy,
opencv_dnn module is placed in the secondary [opencv_contrib](https://github.com/Itseez/opencv_contrib) repository,
which isn't distributed in binary form, therefore you need to build it manually.

To do this you need to have installed: [CMake](http://www.cmake.org/download), git, and build system (*gcc* with *make* for Linux or *MS Visual Studio* for Windows)
Expand All @@ -20,20 +20,26 @@ git clone https://github.com/Itseez/opencv
git clone https://github.com/Itseez/opencv_contrib
@endcode

-# Run [CMake-gui](https://www.johnlamp.net/cmake-tutorial-3-gui-tool.html) and set source and build directories:
-# Run [CMake-gui] and set source and build directories:

- Set source code directory to **opencv_root**/opencv;

- Set binaries directory, for exmaple, to **opencv_root**/build_opencv.
- Set binaries directory, for example, to **opencv_root**/build_opencv.
This directory will contain built libraries.
![](images/build_1.png)

-# Configure opencv:
- press *Configure*;
- choose the preffered project generator (Makefiles for Linux, MS Visual Studio for Windows);
- choose the preferred project generator (Makefiles for Linux, MS Visual Studio for Windows);
- also you can set many opencv build options, for more details see @ref tutorial_linux_install.

![](images/build_2.png)

-# In the appeared list of build parameters find parameter `OPENCV_EXTRA_MODULES_PATH` and set it to the **opencv_root**/opencv_contrib.

![](images/build_3.png)

-# *Configure* the project again, and set build options of dnn module:

- `BUILD_opencv_dnn` parameter must exist and be checked.
Expand All @@ -43,16 +49,23 @@ git clone https://github.com/Itseez/opencv_contrib
You you can uncheck `BUILD_LIBPROTOBUF_FROM_SOURCES` flag to try use protobuf installed in your system.
Elsewise libpotobuf will be built from opencv sources.

- You can additionaly check `opencv_dnn_BUILD_TORCH_IMPORTER` parameter to build [Torch7](http://torch.ch) importer.
- You can additionally check `opencv_dnn_BUILD_TORCH_IMPORTER` parameter to build [Torch7](http://torch.ch) importer.
It allows you to use networks, generated by Torch7 [nn](https://github.com/torch/nn/blob/master/README.md) module.

-# *Generate* the project and build it:
![](images/build_4.png)

-# Press *Configure* and *Generate*.

![](images/build_5.png)

-# Build the generated project:
- If Makefiles generator on Unix was used, run the following in terminal:
@code
cd opencv_root/build_opencv
make all
@endcode
- If MS Visual Studio generator was used, then open OpenCV.sln from **opencv_root**/build_opencv folder in the Visual Studio, and build it by using F7 shortcut
- If MS Visual Studio generator was used, then open OpenCV.sln from **opencv_root**/build_opencv folder in the Visual Studio,
and build it by choosing **Build** -> **Build Solution** menu or using **F7** short-cut.

-# Now you can build own program by using libraries were built into **opencv_root**/build_opencv/lib.
See the following tutorials to learn how to create a program using OpenCV:
Expand Down
2 changes: 1 addition & 1 deletion modules/dnn/tutorials/tutorial_dnn_googlenet.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Introduction
In this tutorial you will learn how to use opencv_dnn module for image classification by using
GoogLeNet trained network from [Caffe model zoo](http://caffe.berkeleyvision.org/model_zoo.html).

We will demostrate results of this example on the following picture.
We will demonstrate results of this example on the following picture.
![Buran space shuttle](images/space_shuttle.jpg)

Source Code
Expand Down

0 comments on commit f360c19

Please sign in to comment.