Commit 43e083f1 authored by Bernat Gabor's avatar Bernat Gabor

Ok, now optimized the tutorial size for real. Made JPG/PNG optimization for all…

Ok, now optimized the tutorial size for real. Made JPG/PNG optimization for all the images. Modified some tutorial files to follow these size optimizations. Now the tutorial PDF generated is 3.95MB, so enjoy!
parent a23406ea
......@@ -260,6 +260,6 @@ Result
Compiling and running your program should give you a result like this:
.. image:: images/Drawing_1_Tutorial_Result_0.jpg
.. image:: images/Drawing_1_Tutorial_Result_0.png
:alt: Drawing Tutorial 1 - Final Result
:align: center
......@@ -92,7 +92,8 @@ Code
{ 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 );
new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
}
}
}
......@@ -145,7 +146,8 @@ Explanation
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 ); }
{ new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta ); }
}
}
......@@ -194,6 +196,5 @@ Result
* We get this:
.. image:: images/Basic_Linear_Transform_Tutorial_Result_0.jpg
:height: 400px
:alt: Basic Linear Transform - Final Result
:align: center
\ No newline at end of file
......@@ -97,7 +97,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
:tab-width: 4
:lines: 27-28
.. image:: images/MatBasicContainerOut1.jpg
.. image:: images/MatBasicContainerOut1.png
:alt: Demo image of the matrix output
:align: center
......@@ -125,7 +125,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
.. code-block:: cpp
IplImage* img = cvLoadImage("greatwave.jpg", 1);
IplImage* img = cvLoadImage("greatwave.png", 1);
Mat mtx(img); // convert IplImage* -> Mat
+ :basicstructures:`Create() <mat-create>` function:
......@@ -135,7 +135,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
:tab-width: 4
:lines: 31-32
.. image:: images/MatBasicContainerOut2.jpg
.. image:: images/MatBasicContainerOut2.png
:alt: Demo image of the matrix output
:align: center
......@@ -148,7 +148,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
:tab-width: 4
:lines: 40-47
.. image:: images/MatBasicContainerOut3.jpg
.. image:: images/MatBasicContainerOut3.png
:alt: Demo image of the matrix output
:align: center
......@@ -159,7 +159,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
:tab-width: 4
:lines: 50-51
.. image:: images/MatBasicContainerOut6.jpg
.. image:: images/MatBasicContainerOut6.png
:alt: Demo image of the matrix output
:align: center
......@@ -170,7 +170,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
:tab-width: 4
:lines: 53-54
.. image:: images/MatBasicContainerOut7.jpg
.. image:: images/MatBasicContainerOut7.png
:alt: Demo image of the matrix output
:align: center
......@@ -197,7 +197,7 @@ In the above examples you could see the default formatting option. Nevertheless,
:tab-width: 4
:lines: 61
.. image:: images/MatBasicContainerOut8.jpg
.. image:: images/MatBasicContainerOut8.png
:alt: Default Output
:align: center
......@@ -208,7 +208,7 @@ In the above examples you could see the default formatting option. Nevertheless,
:tab-width: 4
:lines: 62
.. image:: images/MatBasicContainerOut16.jpg
.. image:: images/MatBasicContainerOut16.png
:alt: Default Output
:align: center
......@@ -219,7 +219,7 @@ In the above examples you could see the default formatting option. Nevertheless,
:tab-width: 4
:lines: 64
.. image:: images/MatBasicContainerOut10.jpg
.. image:: images/MatBasicContainerOut10.png
:alt: Default Output
:align: center
......@@ -230,7 +230,7 @@ In the above examples you could see the default formatting option. Nevertheless,
:tab-width: 4
:lines: 63
.. image:: images/MatBasicContainerOut9.jpg
.. image:: images/MatBasicContainerOut9.png
:alt: Default Output
:align: center
......@@ -241,7 +241,7 @@ In the above examples you could see the default formatting option. Nevertheless,
:tab-width: 4
:lines: 65
.. image:: images/MatBasicContainerOut11.jpg
.. image:: images/MatBasicContainerOut11.png
:alt: Default Output
:align: center
......@@ -259,7 +259,7 @@ OpenCV offers support for print of other common OpenCV data structures too via t
:tab-width: 4
:lines: 67-68
.. image:: images/MatBasicContainerOut12.jpg
.. image:: images/MatBasicContainerOut12.png
:alt: Default Output
:align: center
......@@ -271,7 +271,7 @@ OpenCV offers support for print of other common OpenCV data structures too via t
:tab-width: 4
:lines: 70-71
.. image:: images/MatBasicContainerOut13.jpg
.. image:: images/MatBasicContainerOut13.png
:alt: Default Output
:align: center
......@@ -282,7 +282,7 @@ OpenCV offers support for print of other common OpenCV data structures too via t
:tab-width: 4
:lines: 74-77
.. image:: images/MatBasicContainerOut14.jpg
.. image:: images/MatBasicContainerOut14.png
:alt: Default Output
:align: center
......@@ -293,7 +293,7 @@ OpenCV offers support for print of other common OpenCV data structures too via t
:tab-width: 4
:lines: 79-83
.. image:: images/MatBasicContainerOut15.jpg
.. image:: images/MatBasicContainerOut15.png
:alt: Default Output
:align: center
......
......@@ -230,56 +230,35 @@ 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.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.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 1
:align: center
#. Then, a new set of figures, these time *rectangles* will follow.
#. Now some ellipses will appear, each of them with random position, size, thickness and arc length:
.. 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.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.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 4
:align: center
#. Filled polygons (in this example triangles) will follow.
#. The last geometric figure to appear: circles!
.. 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.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.jpg
:height: 300px
:alt: Drawing Tutorial 2 - Final Result 7
:align: center
\ No newline at end of file
......@@ -55,7 +55,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
/// Create Trackbar to set the number of corners
createTrackbar( "Max corners:", source_window, &maxCorners, maxTrackbar, goodFeaturesToTrack_Demo );
createTrackbar( "Max corners:", source_window, &maxCorners, maxTrackbar, goodFeaturesToTrack_Demo);
imshow( source_window, src );
......@@ -101,7 +101,8 @@ This tutorial code's is shown lines below. You can also download it from `here <
cout<<"** Number of corners detected: "<<corners.size()<<endl;
int r = 4;
for( int i = 0; i < corners.size(); i++ )
{ circle( copy, corners[i], r, Scalar(rng.uniform(0,255), rng.uniform(0,255), rng.uniform(0,255)), -1, 8, 0 ); }
{ circle( copy, corners[i], r, Scalar(rng.uniform(0,255), rng.uniform(0,255),
rng.uniform(0,255)), -1, 8, 0 ); }
/// Show what you got
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
......@@ -128,12 +129,10 @@ Result
======
.. image:: images/Corner_Subpixeles_Original_Image.jpg
:height: 200pt
:align: center
Here is the result:
.. image:: images/Corner_Subpixeles_Result.jpg
:height: 100pt
:align: center
......@@ -84,7 +84,8 @@ This tutorial code's is shown lines below. You can also download it from `here <
/* Create Window and Trackbar */
namedWindow( myHarris_window, CV_WINDOW_AUTOSIZE );
createTrackbar( " Quality Level:", myHarris_window, &myHarris_qualityLevel, max_qualityLevel, myHarris_function );
createTrackbar( " Quality Level:", myHarris_window, &myHarris_qualityLevel, max_qualityLevel,
myHarris_function );
myHarris_function( 0, 0 );
/// My Shi-Tomasi -- Using cornerMinEigenVal
......@@ -95,7 +96,8 @@ This tutorial code's is shown lines below. You can also download it from `here <
/* Create Window and Trackbar */
namedWindow( myShiTomasi_window, CV_WINDOW_AUTOSIZE );
createTrackbar( " Quality Level:", myShiTomasi_window, &myShiTomasi_qualityLevel, max_qualityLevel, myShiTomasi_function );
createTrackbar( " Quality Level:", myShiTomasi_window, &myShiTomasi_qualityLevel, max_qualityLevel,
myShiTomasi_function );
myShiTomasi_function( 0, 0 );
waitKey(0);
......@@ -112,8 +114,10 @@ This tutorial code's is shown lines below. You can also download it from `here <
for( int j = 0; j < src_gray.rows; j++ )
{ for( int i = 0; i < src_gray.cols; i++ )
{
if( myShiTomasi_dst.at<float>(j,i) > myShiTomasi_minVal + ( myShiTomasi_maxVal - myShiTomasi_minVal )*myShiTomasi_qualityLevel/max_qualityLevel )
{ circle( myShiTomasi_copy, Point(i,j), 4, Scalar( rng.uniform(0,255), rng.uniform(0,255), rng.uniform(0,255) ), -1, 8, 0 ); }
if( myShiTomasi_dst.at<float>(j,i) > myShiTomasi_minVal + ( myShiTomasi_maxVal -
myShiTomasi_minVal )*myShiTomasi_qualityLevel/max_qualityLevel )
{ circle( myShiTomasi_copy, Point(i,j), 4, Scalar( rng.uniform(0,255),
rng.uniform(0,255), rng.uniform(0,255) ), -1, 8, 0 ); }
}
}
imshow( myShiTomasi_window, myShiTomasi_copy );
......@@ -129,8 +133,10 @@ This tutorial code's is shown lines below. You can also download it from `here <
for( int j = 0; j < src_gray.rows; j++ )
{ for( int i = 0; i < src_gray.cols; i++ )
{
if( Mc.at<float>(j,i) > myHarris_minVal + ( myHarris_maxVal - myHarris_minVal )*myHarris_qualityLevel/max_qualityLevel )
{ circle( myHarris_copy, Point(i,j), 4, Scalar( rng.uniform(0,255), rng.uniform(0,255), rng.uniform(0,255) ), -1, 8, 0 ); }
if( Mc.at<float>(j,i) > myHarris_minVal + ( myHarris_maxVal - myHarris_minVal )
*myHarris_qualityLevel/max_qualityLevel )
{ circle( myHarris_copy, Point(i,j), 4, Scalar( rng.uniform(0,255), rng.uniform(0,255),
rng.uniform(0,255) ), -1, 8, 0 ); }
}
}
imshow( myHarris_window, myHarris_copy );
......@@ -145,11 +151,9 @@ Result
======
.. image:: images/My_Harris_corner_detector_Result.jpg
:height: 200pt
:align: center
.. image:: images/My_Shi_Tomasi_corner_detector_Result.jpg
:height: 200pt
:align: center
......@@ -102,7 +102,8 @@ This tutorial code's is shown lines below. You can also download it from `here <
cout<<"** Number of corners detected: "<<corners.size()<<endl;
int r = 4;
for( int i = 0; i < corners.size(); i++ )
{ circle( copy, corners[i], r, Scalar(rng.uniform(0,255), rng.uniform(0,255), rng.uniform(0,255)), -1, 8, 0 ); }
{ circle( copy, corners[i], r, Scalar(rng.uniform(0,255), rng.uniform(0,255),
rng.uniform(0,255)), -1, 8, 0 ); }
/// Show what you got
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
......@@ -116,7 +117,6 @@ Result
======
.. image:: images/Shi_Tomasi_Detector_Result.jpg
:height: 200pt
:align: center
......@@ -104,13 +104,11 @@ Result
The original image:
.. image:: images/Harris_Detector_Original_Image.jpg
:height: 200pt
:align: center
The detected corners are surrounded by a small black circle
.. image:: images/Harris_Detector_Result.jpg
:height: 200pt
:align: center
......@@ -5,10 +5,13 @@
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.
* :ref:`Adding_Trackbars`
+
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
=============== ======================================================
|Beginners_5| *Title:* **Creating Trackbars**
|Beginners_5| *Title:* :ref:`Adding_Trackbars`
*Compatibility:* > OpenCV 2.0
......@@ -17,8 +20,8 @@ This section contains valuable tutorials about how to read/save your image/video
=============== ======================================================
.. |Beginners_5| image:: images/Adding_Trackbars_Tutorial_Cover.jpg
:height: 100pt
:width: 100pt
:height: 90pt
:width: 90pt
.. raw:: latex
......
......@@ -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.jpg
.. image:: images/Adding_Trackbars_Tutorial_Trackbar.png
:alt: Trackbar example
:align: center
......@@ -153,7 +153,6 @@ Result
.. image:: images/Adding_Trackbars_Tutorial_Result_1.jpg
:alt: Adding Trackbars - Lena
:height: 500px
:align: center
......
doc/tutorials/images/calib3d.jpg

9.92 KB | W: | H:

doc/tutorials/images/calib3d.jpg

5.14 KB | W: | H:

doc/tutorials/images/calib3d.jpg
doc/tutorials/images/calib3d.jpg
doc/tutorials/images/calib3d.jpg
doc/tutorials/images/calib3d.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/core.jpg

18.4 KB | W: | H:

doc/tutorials/images/core.jpg

8.86 KB | W: | H:

doc/tutorials/images/core.jpg
doc/tutorials/images/core.jpg
doc/tutorials/images/core.jpg
doc/tutorials/images/core.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/feature2D.jpg

13.7 KB | W: | H:

doc/tutorials/images/feature2D.jpg

6.23 KB | W: | H:

doc/tutorials/images/feature2D.jpg
doc/tutorials/images/feature2D.jpg
doc/tutorials/images/feature2D.jpg
doc/tutorials/images/feature2D.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/general.jpg

11.1 KB | W: | H:

doc/tutorials/images/general.jpg

4.99 KB | W: | H:

doc/tutorials/images/general.jpg
doc/tutorials/images/general.jpg
doc/tutorials/images/general.jpg
doc/tutorials/images/general.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/gpu.jpg

14.8 KB | W: | H:

doc/tutorials/images/gpu.jpg

7.38 KB | W: | H:

doc/tutorials/images/gpu.jpg
doc/tutorials/images/gpu.jpg
doc/tutorials/images/gpu.jpg
doc/tutorials/images/gpu.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/highgui.jpg

9.04 KB | W: | H:

doc/tutorials/images/highgui.jpg

4.78 KB | W: | H:

doc/tutorials/images/highgui.jpg
doc/tutorials/images/highgui.jpg
doc/tutorials/images/highgui.jpg
doc/tutorials/images/highgui.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/imgproc.jpg

17.9 KB | W: | H:

doc/tutorials/images/imgproc.jpg

8.58 KB | W: | H:

doc/tutorials/images/imgproc.jpg
doc/tutorials/images/imgproc.jpg
doc/tutorials/images/imgproc.jpg
doc/tutorials/images/imgproc.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/introduction.jpg

10.5 KB | W: | H:

doc/tutorials/images/introduction.jpg

4.49 KB | W: | H:

doc/tutorials/images/introduction.jpg
doc/tutorials/images/introduction.jpg
doc/tutorials/images/introduction.jpg
doc/tutorials/images/introduction.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/ml.jpg

10.1 KB | W: | H:

doc/tutorials/images/ml.jpg

5.03 KB | W: | H:

doc/tutorials/images/ml.jpg
doc/tutorials/images/ml.jpg
doc/tutorials/images/ml.jpg
doc/tutorials/images/ml.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/objdetect.jpg

7.87 KB | W: | H:

doc/tutorials/images/objdetect.jpg

3.69 KB | W: | H:

doc/tutorials/images/objdetect.jpg
doc/tutorials/images/objdetect.jpg
doc/tutorials/images/objdetect.jpg
doc/tutorials/images/objdetect.jpg
  • 2-up
  • Swipe
  • Onion skin
doc/tutorials/images/video.jpg

9.28 KB | W: | H:

doc/tutorials/images/video.jpg

4.92 KB | W: | H:

doc/tutorials/images/video.jpg
doc/tutorials/images/video.jpg
doc/tutorials/images/video.jpg
doc/tutorials/images/video.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -34,9 +34,8 @@ Morphological Operations
* We will explain dilation and erosion briefly, using the following image as an example:
.. image:: images/Morphology_1_Tutorial_Theory_Original_Image.jpg
.. image:: images/Morphology_1_Tutorial_Theory_Original_Image.png
:alt: Original image
:height: 100px
:align: center
Dilation
......@@ -48,9 +47,8 @@ Dilation
* As the kernel :math:`B` is scanned over the image, we compute the maximal pixel value overlapped by :math:`B` and replace the image pixel in the anchor point position with that maximal value. As you can deduce, this maximizing operation causes bright regions within an image to "grow" (therefore the name *dilation*). Take as an example the image above. Applying dilation we can get:
.. image:: images/Morphology_1_Tutorial_Theory_Dilation.jpg
.. image:: images/Morphology_1_Tutorial_Theory_Dilation.png
:alt: Dilation result - Theory example
:height: 100px
:align: center
The background (bright) dilates around the black regions of the letter.
......@@ -64,9 +62,8 @@ Erosion
* Analagously to the example for dilation, we can apply the erosion operator to the original image (shown above). You can see in the result below that the bright areas of the image (the background, apparently), get thinner, whereas the dark zones (the "writing"( gets bigger.
.. image:: images/Morphology_1_Tutorial_Theory_Erosion.jpg
.. image:: images/Morphology_1_Tutorial_Theory_Erosion.png
:alt: Erosion result - Theory example
:height: 100px
:align: center
......@@ -268,13 +265,10 @@ Results
.. image:: images/Morphology_1_Tutorial_Original_Image.jpg
:alt: Original image
:height: 200px
:align: center
We get the results below. Varying the indices in the Trackbars give different output images, naturally. Try them out! You can even try to add a third Trackbar to control the number of iterations.
.. image:: images/Morphology_1_Tutorial_Cover.jpg
:alt: Dilation and Erosion application
:height: 400px
:align: center
\ No newline at end of file
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