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

fixed building PDFs in master

parent 5c2d5906
...@@ -121,9 +121,7 @@ Explanation ...@@ -121,9 +121,7 @@ Explanation
{ {
int thickness = 2; int thickness = 2;
int lineType = 8; int lineType = 8;
line( img, line( img, start, end,
start,
end,
Scalar( 0, 0, 0 ), Scalar( 0, 0, 0 ),
thickness, thickness,
lineType ); lineType );
...@@ -258,8 +256,7 @@ Explanation ...@@ -258,8 +256,7 @@ Explanation
Point( 0, 7*w/8.0 ), Point( 0, 7*w/8.0 ),
Point( w, w), Point( w, w),
Scalar( 0, 255, 255 ), Scalar( 0, 255, 255 ),
-1, -1, 8 );
8 );
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:
......
...@@ -11,17 +11,15 @@ In this tutorial you will learn how to: ...@@ -11,17 +11,15 @@ In this tutorial you will learn how to:
.. container:: enumeratevisibleitemswithsquare .. container:: enumeratevisibleitemswithsquare
+ Access pixel values + Access pixel values
+ Initialize a matrix with zeros + Initialize a matrix with zeros
+ Learn what :saturate_cast:`saturate_cast <>` does and why it is useful + Learn what :saturate_cast:`saturate_cast <>` does and why it is useful
+ Get some cool info about pixel transformations + Get some cool info about pixel transformations
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
Image Processing Image Processing
...@@ -38,7 +36,7 @@ Image Processing ...@@ -38,7 +36,7 @@ Image Processing
Pixel Transforms Pixel Transforms
^^^^^^^^^^^^^^^^^ -----------------
.. container:: enumeratevisibleitemswithsquare .. container:: enumeratevisibleitemswithsquare
...@@ -47,7 +45,7 @@ Pixel Transforms ...@@ -47,7 +45,7 @@ Pixel Transforms
* 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------
.. container:: enumeratevisibleitemswithsquare .. container:: enumeratevisibleitemswithsquare
...@@ -70,9 +68,7 @@ Brightness and contrast adjustments ...@@ -70,9 +68,7 @@ Brightness and contrast adjustments
Code 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 .. code-block:: cpp
...@@ -98,10 +94,9 @@ Code ...@@ -98,10 +94,9 @@ Code
std::cout<<"* Enter the beta value [0-100]: "; std::cin>>beta; std::cout<<"* Enter the beta value [0-100]: "; std::cin>>beta;
/// Do the operation new_image(i,j) = alpha*image(i,j) + beta /// Do the operation new_image(i,j) = alpha*image(i,j) + beta
for( int y = 0; y < image.rows; y++ ) for( int y = 0; y < image.rows; y++ ) {
{ for( int x = 0; x < image.cols; x++ ) for( int x = 0; x < image.cols; x++ ) {
{ for( int c = 0; c < 3; c++ ) for( int c = 0; c < 3; c++ ) {
{
new_image.at<Vec3b>(y,x)[c] = new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta ); saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
} }
...@@ -155,11 +150,12 @@ Explanation ...@@ -155,11 +150,12 @@ Explanation
.. code-block:: cpp .. code-block:: cpp
for( int y = 0; y < image.rows; y++ ) for( int y = 0; y < image.rows; y++ ) {
{ for( int x = 0; x < image.cols; x++ ) for( int x = 0; x < image.cols; x++ ) {
{ for( int c = 0; c < 3; c++ ) for( int c = 0; c < 3; c++ ) {
{ new_image.at<Vec3b>(y,x)[c] = new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta ); } saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
}
} }
} }
...@@ -209,6 +205,6 @@ Result ...@@ -209,6 +205,6 @@ Result
* We get this: * 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 :alt: Basic Linear Transform - Final Result
:align: center :align: center
...@@ -39,7 +39,7 @@ Morphological Operations ...@@ -39,7 +39,7 @@ Morphological Operations
:align: center :align: center
Dilation 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. * 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 ...@@ -54,7 +54,7 @@ Dilation
The background (bright) dilates around the black regions of the letter. The background (bright) dilates around the black regions of the letter.
Erosion Erosion
^^^^^^^^ ~~~~~~~
* This operation is the sister of dilation. What this does is to compute a local minimum over the area of the kernel. * 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