Some reST syntax correction. Now the PDF documentation builds correctly under Windows using MIKTEX. Some update on the tutorial structure. Some CSS syntax correction. Windows Install Tutorial v0.4.

This commit is contained in:
Bernat Gabor
2011-06-30 00:41:41 +00:00
parent d8ea8ef98a
commit 762bc0f8af
59 changed files with 469 additions and 364 deletions

View File

@@ -261,14 +261,14 @@ pre {
}
tt {
color: {{ theme_headtext_color }}
color: {{ theme_headtextcolor }};
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 1.2em;
}
tt.descname {
color: {{ theme_headtext_color }}
color: {{ theme_headtextcolor }};
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 1.4em;
@@ -283,7 +283,7 @@ dl.function > dt:first-child {
margin-bottom: 7px;
}
dl.cfunction > dt:first-child {
dl.c\:function > dt:first-child {
margin-bottom: 7px;
color: #8080B0;
}
@@ -308,3 +308,7 @@ table.field-list {
ul.simple {
list-style: none;
}
.enumeratevisibleitems .simple {
list-style: square;
}

View File

@@ -6,7 +6,6 @@ pygments_style = sphinx
[options]
rightsidebar = false
stickysidebar = false
footerbgcolor = #004068
footertextcolor = #ffffff
sidebarbgcolor = #006090
@@ -26,7 +25,6 @@ codetextcolor = #333333
feedbackbgcolor = #004068
feedbacktextcolor = #ffffff
feedbacklinkcolor = #ffffff
bodyfont = sans-serif
headfont = 'Trebuchet MS', sans-serif
lang = none
lang = none

View File

@@ -25,7 +25,7 @@ sys.path.insert(0, os.path.abspath('.'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.todo', 'sphinx.ext.extlinks', 'ocv']
extensions = ['sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.todo', 'sphinx.ext.extlinks', 'ocv', 'sphinx.ext.doctest']
doctest_test_doctest_blocks = 'block'
# Add any paths that contain templates here, relative to this directory.
@@ -170,7 +170,7 @@ htmlhelp_basename = 'opencv'
# OpenCV docs use some custom LaTeX macros in the formulae. Make sure we include the definitions
pngmath_latex_preamble = r"""
\usepackage{euler}\usepackage{amssymb}\usepackage{amsmath}\usepackage{bbm}
\usepackage[usenames,dvipsnames]{color}\usepackage{amssymb}\usepackage{amsmath}\usepackage{bbm}
\newcommand{\matTT}[9]{
\[
\left|\begin{array}{ccc}

View File

@@ -0,0 +1 @@
Include in this directory only defintion files. None of the reST files entered here will be parsed by the Sphinx Builder.

View File

@@ -27,12 +27,12 @@ Steps
.. math::
K = \dfrac{1}{159}\begin{bmatrix}
2 & 4 & 5 & 4 & 2 \\
4 & 9 & 12 & 9 & 4 \\
5 & 12 & 15 & 12 & 5 \\
4 & 9 & 12 & 9 & 4 \\
2 & 4 & 5 & 4 & 2
\end{bmatrix}
2 & 4 & 5 & 4 & 2 \\
4 & 9 & 12 & 9 & 4 \\
5 & 12 & 15 & 12 & 5 \\
4 & 9 & 12 & 9 & 4 \\
2 & 4 & 5 & 4 & 2
\end{bmatrix}
#. Find the intensity gradient of the image. For this, we follow a procedure analogous to Sobel:
@@ -206,7 +206,8 @@ Explanation
#. Create a window to display the results
.. code-block:: cpp
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
#. Create a Trackbar for the user to enter the lower threshold for our Canny detector:

View File

@@ -1,4 +1,4 @@
.. _copyMakeBorder:
.. _copyMakeBorderTutorial:
Adding borders to your images
******************************

View File

@@ -132,6 +132,7 @@ Code
return 0;
}
Explanation
=============

View File

@@ -30,9 +30,9 @@ How does it work?
b. In the **Polar coordinate system:** Parameters: :math:`(r,\theta)`
.. image:: images/Hough_Lines_Tutorial_Theory_0.jpg
:alt: Line variables
:height: 200pt
:align: center
:alt: Line variables
:height: 200pt
:align: center
For Hough Transforms, we will express lines in the *Polar system*. Hence, a line equation can be written as:
@@ -53,18 +53,19 @@ How does it work?
#. If for a given :math:`(x_{0}, y_{0})` we plot the family of lines that goes through it, we get a sinusoid. For instance, for :math:`x_{0} = 8` and :math:`y_{0} = 6` we get the following plot (in a plane :math:`\theta` - :math:`r`):
.. image:: images/Hough_Lines_Tutorial_Theory_1.jpg
:alt: Polar plot of a the family of lines of a point
:height: 200pt
:align: center
:alt: Polar plot of a the family of lines of a point
:height: 200pt
:align: center
We consider only points such that :math:`r > 0` and :math:`0< \theta < 2 \pi`.
#. We can do the same operation above for all the points in an image. If the curves of two different points intersect in the plane :math:`\theta` - :math:`r`, that means that both points belong to a same line. For instance, following with the example above and drawing the plot for two more points: :math:`x_{1} = 9`, :math:`y_{1} = 4` and :math:`x_{2} = 12`, :math:`y_{2} = 3`, we get:
.. image:: images/Hough_Lines_Tutorial_Theory_2.jpg
:alt: Polar plot of the family of lines for three points
:height: 200pt
:align: center
:alt: Polar plot of the family of lines for three points
:height: 200pt
:align: center
The three plots intersect in one single point :math:`(0.925, 9.6)`, these coordinates are the parameters (:math:`\theta, r`) or the line in which :math:`(x_{0}, y_{0})`, :math:`(x_{1}, y_{1})` and :math:`(x_{2}, y_{2})` lay.
#. What does all the stuff above mean? It means that in general, a line can be *detected* by finding the number of intersections between curves.The more curves intersecting means that the line represented by that intersection have more points. In general, we can define a *threshold* of the minimum number of intersections needed to *detect* a line.
@@ -276,14 +277,14 @@ Result
Using an input image such as:
.. image:: images/Hough_Lines_Tutorial_Original_Image.jpg
:alt: Result of detecting lines with Hough Transform
:align: center
:alt: Result of detecting lines with Hough Transform
:align: center
We get the following result by using the Probabilistic Hough Line Transform:
.. image:: images/Hough_Lines_Tutorial_Result.jpg
:alt: Result of detecting lines with Hough Transform
:align: center
:alt: Result of detecting lines with Hough Transform
:align: center
You may observe that the number of lines detected vary while you change the *threshold*. The explanation is sort of evident: If you establish a higher threshold, fewer lines will be detected (since you will need more points to declare a line detected).

View File

@@ -231,6 +231,7 @@ Explanation
Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT );
/// Gradient Y
Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT );
The function takes the following arguments:
* *src_gray*: In our example, the input image. Here it is *CV_8U*

View File

@@ -13,6 +13,13 @@ In this section you will learn about the image processing (manipulation) functio
../opening_closing_hats/opening_closing_hats
../pyramids/pyramids
../threshold/threshold
../imgtrans/filter_2d/filter_2d
../imgtrans/copyMakeBorder/copyMakeBorder
../imgtrans/sobel_derivatives/sobel_derivatives
../imgtrans/laplace_operator/laplace_operator
../imgtrans/canny_detector/canny_detector
../imgtrans/hough_lines/hough_lines
../imgtrans/hough_circle/hough_circle
.. |Author_AnaH| unicode:: Ana U+0020 Huam U+00E1 n
@@ -126,7 +133,7 @@ In this section you will learn about the image processing (manipulation) functio
:width: 100pt
* :ref:`copyMakeBorder`
* :ref:`copyMakeBorderTutorial`
===================== ==============================================
|CopyMakeBorder| *Title:* **Adding borders to your images**

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

@@ -9,43 +9,43 @@ Using OpenCV with Eclipse (plugin CDT)
Prerequisites
===============
#. Having installed `Eclipse <http://www.eclipse.org/>`_ in your workstation (only the CDT plugin for C/C++ is needed). You can follow the following steps:
1. Having installed `Eclipse <http://www.eclipse.org/>`_ in your workstation (only the CDT plugin for C/C++ is needed). You can follow the following steps:
* Go to the Eclipse site
* Download `Eclipse IDE for C/C++ Developers <http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/heliossr2>`_ . Choose the link according to your workstation.
#. Having installed OpenCV. If not yet, go :ref:`here <Linux_Installation>`
#. Having installed OpenCV. If not yet, go :ref:`here <Linux-Installation>`.
Making a project
=================
#. Start Eclipse. Just run the executable that comes in the folder.
1. Start Eclipse. Just run the executable that comes in the folder.
#. Go to **File -> New -> C/C++ Project**
.. image:: images/Eclipse_Tutorial_Screenshot-0.png
.. image:: images/a0.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 0
:align: center
#. Choose a name for your project (i.e. DisplayImage). An **Empty Project** should be okay for this example.
.. image:: images/Eclipse_Tutorial_Screenshot-1.png
.. image:: images/a1.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 1
:align: center
#. Leave everything else by default. Press **Finish**.
.. image:: images/Eclipse_Tutorial_Screenshot-2.png
.. image:: images/a2.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 2
:align: center
#. Your project (in this case DisplayImage) should appear in the **Project Navigator** (usually at the left side of your window).
.. image:: images/Eclipse_Tutorial_Screenshot-3.png
.. image:: images/a3.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 3
:align: center
@@ -55,28 +55,28 @@ Making a project
* Right click on **DisplayImage** (in the Navigator). **New -> Folder** .
.. image:: images/Eclipse_Tutorial_Screenshot-4.png
.. image:: images/a4.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 4
:align: center
* Name your folder **src** and then hit **Finish**
.. image:: images/Eclipse_Tutorial_Screenshot-5.png
.. image:: images/a5.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 5
:align: center
* Right click on your newly created **src** folder. Choose **New source file**:
.. image:: images/Eclipse_Tutorial_Screenshot-6.png
.. image:: images/a6.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 6
:align: center
* Call it **DisplayImage.cpp**. Hit **Finish**
.. image:: images/Eclipse_Tutorial_Screenshot-7.png
.. image:: images/a7.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 7
:align: center
@@ -114,10 +114,10 @@ Making a project
*
Go to **Project-->Properties**
.. image:: images/Eclipse_Tutorial_Screenshot-8.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 8
:align: center
.. image:: images/a8.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 8
:align: center
*
In **C/C++ Build**, click on **Settings**. At the right, choose the **Tool Settings** Tab. Here we will enter the headers and libraries info:
@@ -125,7 +125,7 @@ Making a project
a.
In **GCC C++ Compiler**, go to **Includes**. In **Include paths(-l)** you should include the path of the folder where opencv was installed. In our example, this is ``/usr/local/include/opencv``.
.. image:: images/Eclipse_Tutorial_Screenshot-9.png
.. image:: images/a9.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 9
:align: center
@@ -134,7 +134,7 @@ Making a project
If you do not know where your opencv files are, open the **Terminal** and type:
.. code-block:: bash
pkg-config --cflags opencv
For instance, that command gave me this output:
@@ -143,57 +143,82 @@ Making a project
-I/usr/local/include/opencv -I/usr/local/include
b.
Now go to **GCC C++ Linker**,there you have to fill two spaces:
* In **Library search path (-L)** you have to write the path to where the opencv libraries reside, in my case the path is:
::
First in **Library search path (-L)** you have to write the path to where the opencv libraries reside, in my case the path is:
/usr/local/lib
..
*
In **Libraries(-l)** add the OpenCV libraries that you may need. Usually just the 3 first on the list below are enough (for simple applications) . In my case, I am putting all of them since I plan to use the whole bunch:
* opencv_core
* opencv_imgproc
* opencv_highgui
* opencv_ml
* opencv_video
* opencv_features2d
* opencv_calib3d
* opencv_objdetect
* opencv_contrib
* opencv_legacy
* opencv_flann
::
.. image:: images/Eclipse_Tutorial_Screenshot-10.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 10
:align: center
/usr/local/lib
Then in **Libraries(-l)** add the OpenCV libraries that you may need. Usually just the 3 first on the list below are enough (for simple applications) . In my case, I am putting all of them since I plan to use the whole bunch:
.. note::
* In **Libraries(-l)** add the OpenCV libraries that you may need. Usually just the 3 first on the list below are enough (for simple applications) . In my case, I am putting all of them since I plan to use the whole bunch:
If you don't know where your libraries are (or you are just psychotic and want to make sure the path is fine), type in **Terminal**:
opencv_core
opencv_imgproc
opencv_highgui
opencv_ml
opencv_video
opencv_features2d
opencv_calib3d
opencv_objdetect
opencv_contrib
opencv_legacy
opencv_flann
.. code-block:: bash
* opencv_core
* opencv_imgproc
* opencv_highgui
* opencv_ml
* opencv_video
* opencv_features2d
* opencv_calib3d
* opencv_objdetect
* opencv_contrib
* opencv_legacy
* opencv_flann
.. image:: images/Eclipse_Tutorial_Screenshot-10.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 10
:align: center
.. image:: images/a10.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 10
:align: center
.. note::
If you don't know where your libraries are (or you are just psychotic and want to make sure the path is fine), type in **Terminal**:
If you don't know where your libraries are (or you are just psychotic and want to make sure the path is fine), type in **Terminal**:
.. code-block:: bash
.. code-block:: bash
pkg-config --libs opencv
pkg-config --libs opencv
pkg-config --libs opencv
My output (in case you want to check) was:
My output (in case you want to check) was:
My output (in case you want to check) was:
.. code-block:: bash
.. code-block:: bash
.. code-block:: bash
-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
Now you are done. Click **OK**
Now you are done. Click **OK**
* Your project should be ready to be built. For this, go to **Project->Build all**
.. image:: images/Eclipse_Tutorial_Screenshot-11.png
.. image:: images/a11.png
:height: 400px
:alt: Eclipse Tutorial Screenshot 11
:align: center
@@ -201,6 +226,7 @@ Making a project
In the Console you should get something like
.. image:: images/Eclipse_Tutorial_Screenshot-12.png
.. image:: images/a12.png
:height: 200px
:alt: Eclipse Tutorial Screenshot 12
:align: center
@@ -218,12 +244,14 @@ So, now we have an executable ready to run. If we were to use the Terminal, we w
cd src
./DisplayImage ../images/HappyLittleFish.jpg
Assuming that the image to use as the argument would be located in <DisplayImage_directory>/images/HappyLittleFish.jpg. We can still do this, but let's do it from Eclipse:
#. Go to **Run->Run Configurations**
.. image:: images/Eclipse_Tutorial_Screenshot-13.png
.. image:: images/a13.png
:height: 300px
:alt: Eclipse Tutorial Screenshot 13
:align: center
@@ -233,6 +261,7 @@ Assuming that the image to use as the argument would be located in <DisplayImage
#. Now, in the right side of the window, choose the **Arguments** Tab. Write the path of the image file we want to open (path relative to the workspace/DisplayImage folder). Let's use **HappyLittleFish.jpg**:
.. image:: images/Eclipse_Tutorial_Screenshot-14.png
.. image:: images/a14.png
:height: 300px
:alt: Eclipse Tutorial Screenshot 14
:align: center
@@ -240,8 +269,10 @@ Assuming that the image to use as the argument would be located in <DisplayImage
#. Click on the **Apply** button and then in Run. An OpenCV window should pop up with the fish image (or whatever you used).
.. image:: images/Eclipse_Tutorial_Screenshot-15.png
.. image:: images/a15.png
:alt: Eclipse Tutorial Screenshot 15
:align: center
#. Congratulations! You are ready to have fun with OpenCV using Eclipse.
#. Congratulations! You are ready to have fun with OpenCV using Eclipse.

View File

@@ -81,4 +81,3 @@ You should get a nice window as the one shown below:
.. image:: images/GCC_CMake_Example_Tutorial.png
:alt: Display Image - Lena
:align: center

View File

@@ -15,7 +15,7 @@ Goals
In this tutorial you will learn how to:
* Load an image using :imread:`imread <> `
* Load an image using :imread:`imread <>`
* Transform an image from RGB to Grayscale format by using :cvt_color:`cvtColor <>`
* Save your transformed image in a file on disk (using :imwrite:`imwrite <>`)

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

View File

@@ -1,5 +1,63 @@
.. _Windows_Installation:
Installation in Windows
***********************
For now this is just a stub article. It will be updated with valuable content as soon as possible. Make sure to check back for it!
.. _Windows_Installation:
Installation in Windows
***********************
The description here was tested by the author using the Windows 7 SP1 **o**\ perating **s**\ ystem (OS). Nevertheless, it should also work on any other Windows OS too. If you encounter errors after following the steps described here feel free to contact us via our :opencv_group:`user group <>` and we will try to fix your problem.
.. note:: To use the OpenCV library you have two options:
.. container:: enumeratevisibleitems
- download and install our pre-built libraries
- make your own ones from the source files.
While the first one is easier to complete, it only works if you are coding inside the latest Microsoft Visual Studio integrated development environments and doesn't takes advantage of the most novel technologies we integrate into our library.
Installation by using the pre-built libraries
=============================================
1. Open up a web browser and go to: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/
#. Open the folder for the latest version (currently this is 2.3).
#. Choose a build you want to use and download it. The naming conventions used will show what kind of support they offer. For example:
.. container:: enumeratevisibleitems
* *vs2010* means the Visual Studio
* *win32* means that it is for 32 bit applications in the OS
* *gpu* means that it includes the support for using your GPU in order to further increase the performance of the library).
If you downloaded the source files present here see :ref:`CppTutWindowsMakeOwn`.
#. Make sure you have admin rights. Start the setup and follow the wizard. Agree to the \" License Agreement \" .
#. Adding the OpenCV library to the system path is a good decision unless you want to play around with multiple flavors of the same OpenCV version. You will use the OpenCV library in form of *\"Dynamic-link library\"* (also known as **DLL**). Inside these are stored all the algorithms and information the OpenCV library contains. The operating system will load them only on demand during runtime. However, to do this he needs to know where they are. The systems **PATH** contains a list of folders where DLLs can be found. Add the OpenCV library path to this and the OS will know of the existence of the OpenCV binaries. Otherwise you will need to copy the used DLLs right beside the applications executable file (*exe*) for the OS to find it.
.. note::
A good way to check your systems path folders is by using the \"*Path Editor*\" application. You can download it `from here <http://www.redfernplace.com/software-projects/patheditor/>`_. Use this if you are not sure the systems path was updated with the OpenCV entry. You can also add manually new folders to the system path by using this application.
#. Most of the time it is a good idea to install the source files as this will allow for you to debug into the OpenCV library, if it is necessary. Therefore, just follow the default settings of the wizard and finish the installation.
#. In the end you can check the installation at the chosen path. If you added the OpenCV Path to the system PATH inside the *Path Editor* you should see an entry with the *bin* folder of the OpenCV directory.
.. image:: images/OpenCV_Install_Directory.png
:alt: An example of how the installation directory should look in case of success.
:align: center
Szia.
.. _CppTutWindowsMakeOwn:
Installation by making your own libraries
=========================================
If you are building your own libraries you can either take the source files from our latest:
.. container:: enumeratevisibleitems
+ stable/tested build - https://code.ros.org/svn/opencv/branches/
+ development build - https://code.ros.org/svn/opencv/trunk/
While the later one may contain a couple of new and experimental algorithms, performance increases and interface improvements be aware that it may also contain many-many bugs. Using the first one is recommended in most of the cases, unless you are extending the OpenCV library itself or really need to most up to date version of it.

View File

@@ -1,4 +1,3 @@
############
Tutorials
###########

View File

@@ -14,7 +14,7 @@ Matching keypoints
==================
The code
-------
--------
We will start with a short sample ``opencv/samples/cpp/matcher_simple.cpp``: ::
Mat img1 = imread(argv[1], CV_LOAD_IMAGE_GRAYSCALE);