Commit 70c409f0 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed building PDFs in master

parent 5c2d5906
......@@ -121,9 +121,7 @@ Explanation
{
int thickness = 2;
int lineType = 8;
line( img,
start,
end,
line( img, start, end,
Scalar( 0, 0, 0 ),
thickness,
lineType );
......@@ -258,8 +256,7 @@ Explanation
Point( 0, 7*w/8.0 ),
Point( w, w),
Scalar( 0, 255, 255 ),
-1,
8 );
-1, 8 );
Finally we have the :rectangle:`rectangle <>` function (we did not create a special function for this guy). We note that:
......
......@@ -11,17 +11,15 @@ In this tutorial you will learn how to:
.. container:: enumeratevisibleitemswithsquare
+ Access pixel values
+ Initialize a matrix with zeros
+ Learn what :saturate_cast:`saturate_cast <>` does and why it is useful
+ Get some cool info about pixel transformations
Theory
=======
.. note::
The explanation below belongs to the book `Computer Vision: Algorithms and Applications <http://szeliski.org/Book/>`_ by Richard Szeliski
Image Processing
......@@ -38,7 +36,7 @@ Image Processing
Pixel Transforms
^^^^^^^^^^^^^^^^^
-----------------
.. container:: enumeratevisibleitemswithsquare
......@@ -47,7 +45,7 @@ Pixel Transforms
* Examples of such operators include *brightness and contrast adjustments* as well as color correction and transformations.
Brightness and contrast adjustments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------
.. container:: enumeratevisibleitemswithsquare
......@@ -70,9 +68,7 @@ Brightness and contrast adjustments
Code
=====
.. container:: enumeratevisibleitemswithsquare
* The following code performs the operation :math:`g(i,j) = \alpha \cdot f(i,j) + \beta` :
* The following code performs the operation :math:`g(i,j) = \alpha \cdot f(i,j) + \beta` :
.. code-block:: cpp
......@@ -98,10 +94,9 @@ Code
std::cout<<"* Enter the beta value [0-100]: "; std::cin>>beta;
/// Do the operation new_image(i,j) = alpha*image(i,j) + beta
for( int y = 0; y < image.rows; y++ )
{ for( int x = 0; x < image.cols; x++ )
{ for( int c = 0; c < 3; c++ )
{
for( int y = 0; y < image.rows; y++ ) {
for( int x = 0; x < image.cols; x++ ) {
for( int c = 0; c < 3; c++ ) {
new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
}
......@@ -155,11 +150,12 @@ Explanation
.. code-block:: cpp
for( int y = 0; y < image.rows; y++ )
{ for( int x = 0; x < image.cols; x++ )
{ for( int c = 0; c < 3; c++ )
{ new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta ); }
for( int y = 0; y < image.rows; y++ ) {
for( int x = 0; x < image.cols; x++ ) {
for( int c = 0; c < 3; c++ ) {
new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
}
}
}
......@@ -209,6 +205,6 @@ Result
* We get this:
.. image:: images/Basic_Linear_Transform_Tutorial_Result_0.jpg
.. image:: images/Basic_Linear_Transform_Tutorial_Result_0.jpg
:alt: Basic Linear Transform - Final Result
:align: center
......@@ -39,7 +39,7 @@ Morphological Operations
:align: center
Dilation
^^^^^^^^^
~~~~~~~~
* This operations consists of convoluting an image :math:`A` with some kernel (:math:`B`), which can have any shape or size, usually a square or circle.
......@@ -54,7 +54,7 @@ Dilation
The background (bright) dilates around the black regions of the letter.
Erosion
^^^^^^^^
~~~~~~~
* This operation is the sister of dilation. What this does is to compute a local minimum over the area of the kernel.
......
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