Updated broken links of tutorials in core and fixed weird-looking bullets (error of mine)

pull/13383/head
Ana Huaman 14 years ago
parent 8b0092eaf5
commit a0d73eadd3
  1. 14
      doc/tutorials/core/adding_images/adding_images.rst
  2. 39
      doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.rst
  3. 38
      doc/tutorials/core/basic_linear_transform/basic_linear_transform.rst
  4. 17
      doc/tutorials/core/random_generator_and_text/random_generator_and_text.rst
  5. 10
      doc/tutorials/introduction/display_image/display_image.rst
  6. 10
      doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.rst

@ -8,11 +8,13 @@ Goal
In this tutorial you will learn how to: In this tutorial you will learn how to:
* What is *linear blending* and why it is useful. .. container:: enumeratevisibleitemswithsquare
* Add two images using :add_weighted:`addWeighted <>`
Cool Theory * What is *linear blending* and why it is useful.
================= * Add two images using :add_weighted:`addWeighted <>`
Theory
=======
.. note:: .. note::
@ -24,12 +26,12 @@ From our previous tutorial, we know already a bit of *Pixel operators*. An inter
g(x) = (1 - \alpha)f_{0}(x) + \alpha f_{1}(x) g(x) = (1 - \alpha)f_{0}(x) + \alpha f_{1}(x)
By varying :math:`\alpha` from :math:`0 \rightarrow 1` this operator can be used to perform a temporal *cross-disolve* between two images or videos, as seen in slide shows and film production (cool, eh?) By varying :math:`\alpha` from :math:`0 \rightarrow 1` this operator can be used to perform a temporal *cross-disolve* between two images or videos, as seen in slide shows and film productions (cool, eh?)
Code Code
===== =====
As usual, after the not-so-lengthy explanation, let's go to the code. Here it is: As usual, after the not-so-lengthy explanation, let's go to the code:
.. code-block:: cpp .. code-block:: cpp

@ -7,13 +7,15 @@ Goals
====== ======
In this tutorial you will learn how to: In this tutorial you will learn how to:
* Use :point:`Point <>` to define 2D points in an image. .. container:: enumeratevisibleitemswithsquare
* Use :scalar:`Scalar <>` and why it is useful
* Draw a **line** by using the OpenCV function :line:`line <>` * Use :point:`Point <>` to define 2D points in an image.
* Draw an **ellipse** by using the OpenCV function :ellipse:`ellipse <>` * Use :scalar:`Scalar <>` and why it is useful
* Draw a **rectangle** by using the OpenCV function :rectangle:`rectangle <>` * Draw a **line** by using the OpenCV function :line:`line <>`
* Draw a **circle** by using the OpenCV function :circle:`circle <>` * Draw an **ellipse** by using the OpenCV function :ellipse:`ellipse <>`
* Draw a **filled polygon** by using the OpenCV function :fill_poly:`fillPoly <>` * Draw a **rectangle** by using the OpenCV function :rectangle:`rectangle <>`
* Draw a **circle** by using the OpenCV function :circle:`circle <>`
* Draw a **filled polygon** by using the OpenCV function :fill_poly:`fillPoly <>`
OpenCV Theory OpenCV Theory
=============== ===============
@ -22,7 +24,10 @@ For this tutorial, we will heavily use two structures: :point:`Point <>` and :sc
Point Point
------- -------
It represents a 2D point, specified by its image coordinates :math:`x` and :math:`y`. We can define it as:
.. container:: enumeratevisibleitemswithsquare
It represents a 2D point, specified by its image coordinates :math:`x` and :math:`y`. We can define it as:
.. code-block:: cpp .. code-block:: cpp
@ -51,7 +56,7 @@ Scalar
Code Code
===== =====
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/Basic/Drawing_1.cpp>`_ * This code is in your OpenCV sample folder. Otherwise you can grab it from `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp>`_
Explanation Explanation
============= =============
@ -126,6 +131,8 @@ Explanation
As we can see, *MyLine* just call the function :line:`line <>`, which does the following: As we can see, *MyLine* just call the function :line:`line <>`, which does the following:
.. container:: enumeratevisibleitemswithsquare
* Draw a line from Point **start** to Point **end** * Draw a line from Point **start** to Point **end**
* The line is displayed in the image **img** * The line is displayed in the image **img**
* The line color is defined by **Scalar( 0, 0, 0)** which is the RGB value correspondent to **Black** * The line color is defined by **Scalar( 0, 0, 0)** which is the RGB value correspondent to **Black**
@ -154,6 +161,8 @@ Explanation
From the code above, we can observe that the function :ellipse:`ellipse <>` draws an ellipse such that: From the code above, we can observe that the function :ellipse:`ellipse <>` draws an ellipse such that:
.. container:: enumeratevisibleitemswithsquare
* The ellipse is displayed in the image **img** * The ellipse is displayed in the image **img**
* The ellipse center is located in the point **(w/2.0, w/2.0)** and is enclosed in a box of size **(w/4.0, w/16.0)** * The ellipse center is located in the point **(w/2.0, w/2.0)** and is enclosed in a box of size **(w/4.0, w/16.0)**
* The ellipse is rotated **angle** degrees * The ellipse is rotated **angle** degrees
@ -181,10 +190,12 @@ Explanation
Similar to the ellipse function, we can observe that *circle* receives as arguments: Similar to the ellipse function, we can observe that *circle* receives as arguments:
.. container:: enumeratevisibleitemswithsquare
* The image where the circle will be displayed (**img**) * The image where the circle will be displayed (**img**)
* The center of the circle denoted as the Point **center** * The center of the circle denoted as the Point **center**
* The radius of the circle: **w/32.0** * The radius of the circle: **w/32.0**
* The color of the circle: **Scalar(0, 0, 255)** which means *Red* in RGB * The color of the circle: **Scalar(0, 0, 255)** which means *Red* in BGR
* Since **thickness** = -1, the circle will be drawn filled. * Since **thickness** = -1, the circle will be drawn filled.
* *MyPolygon* * *MyPolygon*
@ -231,11 +242,13 @@ Explanation
To draw a filled polygon we use the function :fill_poly:`fillPoly <>`. We note that: To draw a filled polygon we use the function :fill_poly:`fillPoly <>`. We note that:
.. container:: enumeratevisibleitemswithsquare
* The polygon will be drawn on **img** * The polygon will be drawn on **img**
* The vertices of the polygon are the set of points in **ppt** * The vertices of the polygon are the set of points in **ppt**
* The total number of vertices to be drawn are **npt** * The total number of vertices to be drawn are **npt**
* The number of polygons to be drawn is only **1** * The number of polygons to be drawn is only **1**
* The color of the polygon is defined by **Scalar( 255, 255, 255)**, which is the RGB value for *white* * The color of the polygon is defined by **Scalar( 255, 255, 255)**, which is the BGR value for *white*
* *rectangle* * *rectangle*
@ -250,9 +263,11 @@ Explanation
Finally we have the :rectangle:`rectangle <>` function (we did not create a special function for this guy). We note that: Finally we have the :rectangle:`rectangle <>` function (we did not create a special function for this guy). We note that:
.. container:: enumeratevisibleitemswithsquare
* The rectangle will be drawn on **rook_image** * The rectangle will be drawn on **rook_image**
* Two opposite vertices of the rectangle are defined by ** Point( 0, 7*w/8.0 )** and **Point( w, w)** * Two opposite vertices of the rectangle are defined by ** Point( 0, 7*w/8.0 )** and **Point( w, w)**
* The color of the rectangle is given by **Scalar(0, 255, 255)** which is the RGB value for *yellow* * The color of the rectangle is given by **Scalar(0, 255, 255)** which is the BGR value for *yellow*
* Since the thickness value is given by **-1**, the rectangle will be filled. * Since the thickness value is given by **-1**, the rectangle will be filled.
Result Result

@ -18,8 +18,8 @@ In this tutorial you will learn how to:
+ Get some cool info about pixel transformations + Get some cool info about pixel transformations
Cool Theory Theory
================= =======
.. note:: .. note::
The explanation below belongs to the book `Computer Vision: Algorithms and Applications <http://szeliski.org/Book/>`_ by Richard Szeliski The explanation below belongs to the book `Computer Vision: Algorithms and Applications <http://szeliski.org/Book/>`_ by Richard Szeliski
@ -27,32 +27,39 @@ Cool Theory
Image Processing Image Processing
-------------------- --------------------
* A general image processing operator is a function that takes one or more input images and produces an output image. .. container:: enumeratevisibleitemswithsquare
* A general image processing operator is a function that takes one or more input images and produces an output image.
* Image transforms can be seen as: * Image transforms can be seen as:
* Point operators (pixel transforms) + Point operators (pixel transforms)
* Neighborhood (area-based) operators + Neighborhood (area-based) operators
Pixel Transforms Pixel Transforms
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
* In this kind of image processing transform, each output pixel's value depends on only the corresponding input pixel value (plus, potentially, some globally collected information or parameters). .. container:: enumeratevisibleitemswithsquare
* In this kind of image processing transform, each output pixel's value depends on only the corresponding input pixel value (plus, potentially, some globally collected information or parameters).
* Examples of such operators include *brightness and contrast adjustments* as well as color correction and transformations. * Examples of such operators include *brightness and contrast adjustments* as well as color correction and transformations.
Brightness and contrast adjustments Brightness and contrast adjustments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Two commonly used point processes are *multiplication* and *addition* with a constant:
.. container:: enumeratevisibleitemswithsquare
* Two commonly used point processes are *multiplication* and *addition* with a constant:
.. math:: .. math::
g(x) = \alpha f(x) + \beta g(x) = \alpha f(x) + \beta
* The parameters :math:`\alpha > 0` and :math:`\beta` are often called the *gain* and *bias* parameters; sometimes these parameters are said to control *contrast* and *brightness* respectively. * The parameters :math:`\alpha > 0` and :math:`\beta` are often called the *gain* and *bias* parameters; sometimes these parameters are said to control *contrast* and *brightness* respectively.
* You can think of :math:`f(x)` as the source image pixels and :math:`g(x)` as the output image pixels. Then, more conveniently we can write the expression as: * You can think of :math:`f(x)` as the source image pixels and :math:`g(x)` as the output image pixels. Then, more conveniently we can write the expression as:
.. math:: .. math::
@ -63,8 +70,9 @@ Brightness and contrast adjustments
Code Code
===== =====
* The following code performs the operation :math:`g(i,j) = \alpha \cdot f(i,j) + \beta` .. container:: enumeratevisibleitemswithsquare
* Here it is:
* The following code performs the operation :math:`g(i,j) = \alpha \cdot f(i,j) + \beta` :
.. code-block:: cpp .. code-block:: cpp
@ -132,6 +140,8 @@ Explanation
#. Now, since we will make some transformations to this image, we need a new Mat object to store it. Also, we want this to have the following features: #. Now, since we will make some transformations to this image, we need a new Mat object to store it. Also, we want this to have the following features:
.. container:: enumeratevisibleitemswithsquare
* Initial pixel values equal to zero * Initial pixel values equal to zero
* Same size and type as the original image * Same size and type as the original image
@ -155,6 +165,8 @@ Explanation
Notice the following: Notice the following:
.. container:: enumeratevisibleitemswithsquare
* To access each pixel in the images we are using this syntax: *image.at<Vec3b>(y,x)[c]* where *y* is the row, *x* is the column and *c* is R, G or B (0, 1 or 2). * To access each pixel in the images we are using this syntax: *image.at<Vec3b>(y,x)[c]* where *y* is the row, *x* is the column and *c* is R, G or B (0, 1 or 2).
* Since the operation :math:`\alpha \cdot p(i,j) + \beta` can give values out of range or not integers (if :math:`\alpha` is float), we use :saturate_cast:`saturate_cast <>` to make sure the values are valid. * Since the operation :math:`\alpha \cdot p(i,j) + \beta` can give values out of range or not integers (if :math:`\alpha` is float), we use :saturate_cast:`saturate_cast <>` to make sure the values are valid.

@ -8,16 +8,21 @@ Goals
In this tutorial you will learn how to: In this tutorial you will learn how to:
* Use the *Random Number generator class* (:rng:`RNG <>`) and how to get a random number from a uniform distribution. .. container:: enumeratevisibleitemswithsquare
* Display text on an OpenCV window by using the function :put_text:`putText <>`
* Use the *Random Number generator class* (:rng:`RNG <>`) and how to get a random number from a uniform distribution.
* Display text on an OpenCV window by using the function :put_text:`putText <>`
Code Code
===== =====
* In the previous tutorial (:ref:`Drawing_1`) we drew diverse geometric figures, giving as input parameters such as coordinates (in the form of :point:`Points <>`), color, thickness, etc. You might have noticed that we gave specific values for these arguments.
* In this tutorial, we intend to use *random* values for the drawing parameters. Also, we intend to populate our image with a big number of geometric figures. Since we will be initializing them in a random fashion, this process will be automatic and made by using *loops* . .. container:: enumeratevisibleitemswithsquare
* In the previous tutorial (:ref:`Drawing_1`) we drew diverse geometric figures, giving as input parameters such as coordinates (in the form of :point:`Points <>`), color, thickness, etc. You might have noticed that we gave specific values for these arguments.
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/Basic/Drawing_2.cpp>`_ . * In this tutorial, we intend to use *random* values for the drawing parameters. Also, we intend to populate our image with a big number of geometric figures. Since we will be initializing them in a random fashion, this process will be automatic and made by using *loops* .
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/core/Matrix/Drawing_2.cpp>`_ .
Explanation Explanation
============ ============
@ -172,6 +177,8 @@ Explanation
So, what does the function :put_text:`putText <>` do? In our example: So, what does the function :put_text:`putText <>` do? In our example:
.. container:: enumeratevisibleitemswithsquare
* Draws the text **"Testing text rendering"** in **image** * Draws the text **"Testing text rendering"** in **image**
* The bottom-left corner of the text will be located in the Point **org** * The bottom-left corner of the text will be located in the Point **org**
* The font type is a random integer value in the range: :math:`[0, 8>`. * The font type is a random integer value in the range: :math:`[0, 8>`.

@ -17,7 +17,7 @@ In this tutorial you will learn how to:
Source Code Source Code
=========== ===========
Download the :download:`source code from here <../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp>` or look it up in our library at :file:`samples/cpp/tutorial_code/introduction/display_image/display_image.cpp`. Download the source code from `here <https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp>`_.
.. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp .. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp
:language: cpp :language: cpp
@ -108,19 +108,21 @@ Because we want our window to be displayed until the user presses a key (otherwi
Result Result
======= =======
* Compile your code and then run the executable giving an image path as argument. If you're on Windows the executable will of course contain an *exe* extension too. Of course assure the image file is near your program file. .. container:: enumeratevisibleitemswithsquare
* Compile your code and then run the executable giving an image path as argument. If you're on Windows the executable will of course contain an *exe* extension too. Of course assure the image file is near your program file.
.. code-block:: bash .. code-block:: bash
./DisplayImage HappyFish.jpg ./DisplayImage HappyFish.jpg
* You should get a nice window as the one shown below: * You should get a nice window as the one shown below:
.. image:: images/Display_Image_Tutorial_Result.jpg .. image:: images/Display_Image_Tutorial_Result.jpg
:alt: Display Image Tutorial - Final Result :alt: Display Image Tutorial - Final Result
:align: center :align: center
.. raw:: html .. raw:: html
<div align="center"> <div align="center">
<iframe title="Introduction - Display an Image" width="560" height="349" src="http://www.youtube.com/embed/1OJEqpuaGc4?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe> <iframe title="Introduction - Display an Image" width="560" height="349" src="http://www.youtube.com/embed/1OJEqpuaGc4?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe>

@ -6,12 +6,14 @@ Using OpenCV with gcc and CMake
.. note:: .. note::
We assume that you have successfully installed OpenCV in your workstation. We assume that you have successfully installed OpenCV in your workstation.
The easiest way of using OpenCV in your code is to use `CMake <http://www.cmake.org/>`_. A few advantages (taken from the Wiki): .. container:: enumeratevisibleitemswithsquare
* No need to change anything when porting between Linux and Windows * The easiest way of using OpenCV in your code is to use `CMake <http://www.cmake.org/>`_. A few advantages (taken from the Wiki):
* Can easily be combined with other tools by CMake( i.e. Qt, ITK and VTK )
If you are not familiar with CMake, checkout the `tutorial <http://www.cmake.org/cmake/help/cmake_tutorial.html>`_ on its website. #. No need to change anything when porting between Linux and Windows
#. Can easily be combined with other tools by CMake( i.e. Qt, ITK and VTK )
* If you are not familiar with CMake, checkout the `tutorial <http://www.cmake.org/cmake/help/cmake_tutorial.html>`_ on its website.
Steps Steps
====== ======

Loading…
Cancel
Save