Commit a2975f33 authored by Bernat Gabor's avatar Bernat Gabor

1) Converted all images to JPG to reduce size.

2) Added a raw Latex page break directive after each TOC tree. (For the PDF tutorial look).
3) Two finished tutorials: 
   a) one describing how the Mat data structure works and its output capabilities (format function) (demonstration YouTube video included).
   b) one describing image scanning operations plus the LUT function (demonstration YouTube video included). 
   c) a basic filtering approach (plus multi row image scanning demonstration) in the work.
parent f503b029
This diff is collapsed.
......@@ -6,3 +6,7 @@
Although we got most of our images in a 2D format they do come from a 3D world. Here you will learn how to find out from the 2D images information about the 3D world.
.. include:: ../../definitions/noContent.rst
.. raw:: latex
\pagebreak
......@@ -114,6 +114,6 @@ Explanation
Result
=======
.. image:: images/Adding_Images_Tutorial_Result_0.png
.. image:: images/Adding_Images_Tutorial_Result_0.jpg
:alt: Blending Images Tutorial - Final Result
:align: center
......@@ -260,6 +260,6 @@ Result
Compiling and running your program should give you a result like this:
.. image:: images/Drawing_1_Tutorial_Result_0.png
.. image:: images/Drawing_1_Tutorial_Result_0.jpg
:alt: Drawing Tutorial 1 - Final Result
:align: center
......@@ -185,7 +185,7 @@ Result
.. code-block:: bash
$ ./BasicLinearTransforms lena.png
$ ./BasicLinearTransforms lena.jpg
Basic Linear Transforms
-------------------------
* Enter the alpha value [1.0-3.0]: 2.2
......@@ -193,7 +193,7 @@ Result
* We get this:
.. image:: images/Basic_Linear_Transform_Tutorial_Result_0.png
.. image:: images/Basic_Linear_Transform_Tutorial_Result_0.jpg
:height: 400px
:alt: Basic Linear Transform - Final Result
:align: center
This diff is collapsed.
.. _maskOperations:
Mask operations on matrixes
***************************
Mask operations on matrixes are quite simple. The idea is that we recalculate each pixels value in an image according to a matrix mask. This mask holds values that will just how much influence have neighbor pixel values (and the pixel value itself) to the new pixel value. From a mathematical point of view we make a weighted average, with our specified values.
Our test case
=============
Let us consider the issue of an image contrast enchancement method. Basically we want to apply for every pixel of the image the following formula:
.. math::
I(i,j) = 5*I(i,j) - [ I(i-1,j) + I(i+1,j) + I(i,j-1) + I(i,j+1)]
\iff I(i,j)*M, \text{where }
M = \bordermatrix{ _i\backslash ^j & -1 & 0 & -1 \cr
-1 & 0 & -1 & 0 \cr
0 & -1 & 5 & -1 \cr
+1 & 0 & -1 & 0 \cr
}
The first notation is by using a formula, while the second is a compacted version of the first by using a mask. You use the mask by puting the center of the mask matrix (in the upper case noted by the zero-zero index) on the pixel you want to calculate and sum up the pixel values multiplicated with the overlapped matrix values. It's the same thing, however in case of large matrices the later notation is a lot easier to look over.
......@@ -229,56 +229,56 @@ As you just saw in the Code section, the program will sequentially execute diver
#. First a random set of *NUMBER* lines will appear on screen such as it can be seen in this screenshot:
.. image:: images/Drawing_2_Tutorial_Result_0.png
.. image:: images/Drawing_2_Tutorial_Result_0.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 0
:align: center
#. Then, a new set of figures, these time *rectangles* will follow:
.. image:: images/Drawing_2_Tutorial_Result_1.png
.. image:: images/Drawing_2_Tutorial_Result_1.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 1
:align: center
#. Now some ellipses will appear, each of them with random position, size, thickness and arc length:
.. image:: images/Drawing_2_Tutorial_Result_2.png
.. image:: images/Drawing_2_Tutorial_Result_2.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 2
:align: center
#. Now, *polylines* with 03 segments will appear on screen, again in random configurations.
.. image:: images/Drawing_2_Tutorial_Result_3.png
.. image:: images/Drawing_2_Tutorial_Result_3.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 3
:align: center
#. Filled polygons (in this example triangles) will follow:
.. image:: images/Drawing_2_Tutorial_Result_4.png
.. image:: images/Drawing_2_Tutorial_Result_4.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 4
:align: center
#. The last geometric figure to appear: circles!
.. image:: images/Drawing_2_Tutorial_Result_5.png
.. image:: images/Drawing_2_Tutorial_Result_5.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 5
:align: center
#. Near the end, the text *"Testing Text Rendering"* will appear in a variety of fonts, sizes, colors and positions.
.. image:: images/Drawing_2_Tutorial_Result_6.png
.. image:: images/Drawing_2_Tutorial_Result_6.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 6
:align: center
#. And the big end (which by the way expresses a big truth too):
.. image:: images/Drawing_2_Tutorial_Result_7.png
.. image:: images/Drawing_2_Tutorial_Result_7.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 7
:align: center
......
......@@ -7,6 +7,45 @@ Here you will learn the about the basic building blocks of the library. A must r
.. include:: ../../definitions/tocDefinitions.rst
+
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
=============== ======================================================
|MatBasicIma| **Title:** :ref:`matTheBasicImageContainer`
*Compatibility:* > OpenCV 2.0
*Author:* |Author_BernatG|
You will learn how to store images in the memory and how to print out their content to the console.
=============== ======================================================
.. |MatBasicIma| image:: images/matTheBasicImageStructure.jpg
:height: 90pt
:width: 90pt
+
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
=============== ======================================================
|HowScanImag| **Title:** :ref:`howToScanImagesOpenCV`
*Compatibility:* > OpenCV 2.0
*Author:* |Author_BernatG|
You'll find out how to scan images (go through each of the image pixels) with OpenCV. Bonus: time measurement with OpenCV.
=============== ======================================================
.. |HowScanImag| image:: images/howToScanImages.jpg
:height: 90pt
:width: 90pt
+
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
......@@ -22,7 +61,7 @@ Here you will learn the about the basic building blocks of the library. A must r
=============== ======================================================
.. |Beginners_4| image:: images/Adding_Images_Tutorial_Result_0.png
.. |Beginners_4| image:: images/Adding_Images_Tutorial_Result_0.jpg
:height: 90pt
:width: 90pt
......@@ -41,7 +80,7 @@ Here you will learn the about the basic building blocks of the library. A must r
=============== ====================================================
.. |Bas_Lin_Tran| image:: images/Basic_Linear_Transform_Tutorial_Result_0.png
.. |Bas_Lin_Tran| image:: images/Basic_Linear_Transform_Tutorial_Result_0.jpg
:height: 90pt
:width: 90pt
......@@ -62,7 +101,7 @@ Here you will learn the about the basic building blocks of the library. A must r
=============== ======================================================
.. |Beginners_6| image:: images/Drawing_1_Tutorial_Result_0.png
.. |Beginners_6| image:: images/Drawing_1_Tutorial_Result_0.jpg
:height: 90pt
:width: 90pt
......@@ -81,14 +120,21 @@ Here you will learn the about the basic building blocks of the library. A must r
=============== ======================================================
.. |Beginners_7| image:: images/Drawing_2_Tutorial_Result_7.png
.. |Beginners_7| image:: images/Drawing_2_Tutorial_Result_7.jpg
:height: 90pt
:width: 90pt
.. raw:: latex
\pagebreak
.. toctree::
:hidden:
../mat - the basic image container/mat - the basic image container
../how_to_scan_images/how_to_scan_images
../adding_images/adding_images
../basic_linear_transform/basic_linear_transform
../basic_geometric_drawing/basic_geometric_drawing
../random_generator_and_text/random_generator_and_text
\ No newline at end of file
../random_generator_and_text/random_generator_and_text
../mat-mask-operations/mat-mask-operations.rst
\ No newline at end of file
......@@ -86,6 +86,10 @@ Learn about how to use the feature points detectors, descriptors and matching f
:height: 90pt
:width: 90pt
.. raw:: latex
\pagebreak
.. toctree::
:hidden:
......
......@@ -6,3 +6,8 @@ General tutorials
These tutorials are the bottom of the iceberg as they link together multiple of the modules presented above in order to solve complex problems.
.. include:: ../../definitions/noContent.rst
.. raw:: latex
\pagebreak
......@@ -6,3 +6,7 @@
Squeeze out every little computation power from your system by using the power of your video card to run the OpenCV algorithms.
.. include:: ../../definitions/noContent.rst
.. raw:: latex
\pagebreak
......@@ -5,11 +5,6 @@
This section contains valuable tutorials about how to read/save your image/video files and how to use the built-in graphical user interface of the library.
.. toctree::
:hidden:
../trackbar/trackbar
* :ref:`Adding_Trackbars`
=============== ======================================================
......@@ -21,6 +16,15 @@ This section contains valuable tutorials about how to read/save your image/video
=============== ======================================================
.. |Beginners_5| image:: images/Adding_Trackbars_Tutorial_Cover.png
.. |Beginners_5| image:: images/Adding_Trackbars_Tutorial_Cover.jpg
:height: 100pt
:width: 100pt
.. raw:: latex
\pagebreak
.. toctree::
:hidden:
../trackbar/trackbar
......@@ -7,7 +7,7 @@ Adding a Trackbar to our applications!
* Well, it is time to use some fancy GUI tools. OpenCV provides some GUI utilities (*highgui.h*) for you. An example of this is a **Trackbar**
.. image:: images/Adding_Trackbars_Tutorial_Trackbar.png
.. image:: images/Adding_Trackbars_Tutorial_Trackbar.jpg
:alt: Trackbar example
:align: center
......@@ -145,13 +145,13 @@ Result
* Our program produces the following output:
.. image:: images/Adding_Trackbars_Tutorial_Result_0.png
.. image:: images/Adding_Trackbars_Tutorial_Result_0.jpg
:alt: Adding Trackbars - Windows Linux
:align: center
* As a manner of practice, you can also add 02 trackbars for the program made in :ref:`Basic_Linear_Transform`. One trackbar to set :math:`\alpha` and another for :math:`\beta`. The output might look like:
.. image:: images/Adding_Trackbars_Tutorial_Result_1.png
.. image:: images/Adding_Trackbars_Tutorial_Result_1.jpg
:alt: Adding Trackbars - Lena
:height: 500px
:align: center
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment