diff --git a/doc/tutorials/core/basic_linear_transform/basic_linear_transform.markdown b/doc/tutorials/core/basic_linear_transform/basic_linear_transform.markdown
index d823b45548..803de71acb 100644
--- a/doc/tutorials/core/basic_linear_transform/basic_linear_transform.markdown
+++ b/doc/tutorials/core/basic_linear_transform/basic_linear_transform.markdown
@@ -1,6 +1,9 @@
Changing the contrast and brightness of an image! {#tutorial_basic_linear_transform}
=================================================
+@prev_tutorial{tutorial_adding_images}
+@next_tutorial{tutorial_discrete_fourier_transform}
+
Goal
----
diff --git a/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.markdown b/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.markdown
index 7facd74ca9..ca485a9293 100644
--- a/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.markdown
+++ b/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.markdown
@@ -1,7 +1,7 @@
Discrete Fourier Transform {#tutorial_discrete_fourier_transform}
==========================
-@prev_tutorial{tutorial_random_generator_and_text}
+@prev_tutorial{tutorial_basic_linear_transform}
@next_tutorial{tutorial_file_input_output_with_xml_yml}
Goal
diff --git a/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown b/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown
index 5e46343373..7b91af75a3 100644
--- a/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown
+++ b/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown
@@ -1,6 +1,9 @@
File Input and Output using XML and YAML files {#tutorial_file_input_output_with_xml_yml}
==============================================
+@prev_tutorial{tutorial_discrete_fourier_transform}
+@next_tutorial{tutorial_interoperability_with_OpenCV_1}
+
Goal
----
diff --git a/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown b/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown
index 658147eccf..a4b7af6375 100644
--- a/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown
+++ b/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown
@@ -1,6 +1,9 @@
How to scan images, lookup tables and time measurement with OpenCV {#tutorial_how_to_scan_images}
==================================================================
+@prev_tutorial{tutorial_mat_the_basic_image_container}
+@next_tutorial{tutorial_mat_mask_operations}
+
Goal
----
diff --git a/doc/tutorials/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.markdown b/doc/tutorials/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.markdown
index c584a97c8a..3f5f556d35 100644
--- a/doc/tutorials/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.markdown
+++ b/doc/tutorials/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.markdown
@@ -1,6 +1,8 @@
How to use the OpenCV parallel_for_ to parallelize your code {#tutorial_how_to_use_OpenCV_parallel_for_}
==================================================================
+@prev_tutorial{tutorial_how_to_use_ippa_conversion}
+
Goal
----
diff --git a/doc/tutorials/core/how_to_use_ippa_conversion/how_to_use_ippa_conversion.markdown b/doc/tutorials/core/how_to_use_ippa_conversion/how_to_use_ippa_conversion.markdown
index 647b280cc7..e5e0e4a1eb 100644
--- a/doc/tutorials/core/how_to_use_ippa_conversion/how_to_use_ippa_conversion.markdown
+++ b/doc/tutorials/core/how_to_use_ippa_conversion/how_to_use_ippa_conversion.markdown
@@ -1,6 +1,9 @@
Intel® IPP Asynchronous C/C++ library in OpenCV {#tutorial_how_to_use_ippa_conversion}
===============================================
+@prev_tutorial{tutorial_interoperability_with_OpenCV_1}
+@next_tutorial{tutorial_how_to_use_OpenCV_parallel_for_}
+
Goal
----
diff --git a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown
index f98c93fbc5..0e2b45cea5 100644
--- a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown
+++ b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown
@@ -1,6 +1,9 @@
Interoperability with OpenCV 1 {#tutorial_interoperability_with_OpenCV_1}
==============================
+@prev_tutorial{tutorial_file_input_output_with_xml_yml}
+@next_tutorial{tutorial_how_to_use_ippa_conversion}
+
Goal
----
diff --git a/doc/tutorials/core/mat_operations.markdown b/doc/tutorials/core/mat_operations.markdown
index c2e7d1ca6a..02c3ad44c5 100644
--- a/doc/tutorials/core/mat_operations.markdown
+++ b/doc/tutorials/core/mat_operations.markdown
@@ -1,6 +1,9 @@
Operations with images {#tutorial_mat_operations}
======================
+@prev_tutorial{tutorial_mat_mask_operations}
+@next_tutorial{tutorial_adding_images}
+
Input/Output
------------
diff --git a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown
index a7c2337008..882b7a4a0b 100644
--- a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown
+++ b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown
@@ -1,6 +1,8 @@
Mat - The Basic Image Container {#tutorial_mat_the_basic_image_container}
===============================
+@next_tutorial{tutorial_how_to_scan_images}
+
Goal
----
diff --git a/doc/tutorials/core/table_of_content_core.markdown b/doc/tutorials/core/table_of_content_core.markdown
index 8db254944a..f3f5381ea9 100644
--- a/doc/tutorials/core/table_of_content_core.markdown
+++ b/doc/tutorials/core/table_of_content_core.markdown
@@ -62,24 +62,6 @@ understanding how to manipulate the images on a pixel level.
We will learn how to change our image appearance!
-- @subpage tutorial_basic_geometric_drawing
-
- *Languages:* C++, Java, Python
-
- *Compatibility:* \> OpenCV 2.0
-
- *Author:* Ana Huamán
-
- We will learn how to draw simple geometry with OpenCV!
-
-- @subpage tutorial_random_generator_and_text
-
- *Compatibility:* \> OpenCV 2.0
-
- *Author:* Ana Huamán
-
- We will draw some *fancy-looking* stuff using OpenCV!
-
- @subpage tutorial_discrete_fourier_transform
*Languages:* C++, Java, Python
diff --git a/doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown b/doc/tutorials/imgproc/basic_geometric_drawing/basic_geometric_drawing.markdown
similarity index 70%
rename from doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown
rename to doc/tutorials/imgproc/basic_geometric_drawing/basic_geometric_drawing.markdown
index 02ec53cb3f..70543cf14f 100644
--- a/doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown
+++ b/doc/tutorials/imgproc/basic_geometric_drawing/basic_geometric_drawing.markdown
@@ -1,7 +1,6 @@
Basic Drawing {#tutorial_basic_geometric_drawing}
=============
-@prev_tutorial{tutorial_basic_linear_transform}
@next_tutorial{tutorial_random_generator_and_text}
Goals
@@ -82,20 +81,20 @@ Code
@add_toggle_cpp
- This code is in your OpenCV sample folder. Otherwise you can grab it from
- [here](https://raw.githubusercontent.com/opencv/opencv/3.4/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp)
- @include samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp
+ [here](https://raw.githubusercontent.com/opencv/opencv/3.4/samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp)
+ @include samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp
@end_toggle
@add_toggle_java
- This code is in your OpenCV sample folder. Otherwise you can grab it from
- [here](https://raw.githubusercontent.com/opencv/opencv/3.4/samples/java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java)
- @include samples/java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java
+ [here](https://raw.githubusercontent.com/opencv/opencv/3.4/samples/java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java)
+ @include samples/java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java
@end_toggle
@add_toggle_python
- This code is in your OpenCV sample folder. Otherwise you can grab it from
- [here](https://raw.githubusercontent.com/opencv/opencv/3.4/samples/python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py)
- @include samples/python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py
+ [here](https://raw.githubusercontent.com/opencv/opencv/3.4/samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py)
+ @include samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py
@end_toggle
Explanation
@@ -104,42 +103,42 @@ Explanation
Since we plan to draw two examples (an atom and a rook), we have to create two images and two
windows to display them.
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp create_images
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp create_images
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java create_images
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java create_images
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py create_images
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py create_images
@end_toggle
We created functions to draw different geometric shapes. For instance, to draw the atom we used
**MyEllipse** and **MyFilledCircle**:
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp draw_atom
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp draw_atom
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java draw_atom
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java draw_atom
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py draw_atom
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py draw_atom
@end_toggle
And to draw the rook we employed **MyLine**, **rectangle** and a **MyPolygon**:
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp draw_rook
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp draw_rook
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java draw_rook
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java draw_rook
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py draw_rook
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py draw_rook
@end_toggle
@@ -149,15 +148,15 @@ Let's check what is inside each of these functions:
MyLine
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp my_line
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp my_line
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java my_line
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java my_line
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py my_line
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py my_line
@end_toggle
- As we can see, **MyLine** just call the function **line()** , which does the following:
@@ -170,15 +169,15 @@ Let's check what is inside each of these functions:
MyEllipse
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp my_ellipse
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp my_ellipse
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java my_ellipse
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java my_ellipse
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py my_ellipse
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py my_ellipse
@end_toggle
- From the code above, we can observe that the function **ellipse()** draws an ellipse such
@@ -194,15 +193,15 @@ Let's check what is inside each of these functions:
MyFilledCircle
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp my_filled_circle
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp my_filled_circle
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java my_filled_circle
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java my_filled_circle
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py my_filled_circle
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py my_filled_circle
@end_toggle
- Similar to the ellipse function, we can observe that *circle* receives as arguments:
@@ -215,15 +214,15 @@ Let's check what is inside each of these functions:
MyPolygon
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp my_polygon
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp my_polygon
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java my_polygon
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java my_polygon
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py my_polygon
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py my_polygon
@end_toggle
- To draw a filled polygon we use the function **fillPoly()** . We note that:
@@ -235,15 +234,15 @@ Let's check what is inside each of these functions:
rectangle
@add_toggle_cpp
-@snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp rectangle
+@snippet cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp rectangle
@end_toggle
@add_toggle_java
-@snippet java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java rectangle
+@snippet java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java rectangle
@end_toggle
@add_toggle_python
-@snippet python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py rectangle
+@snippet python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py rectangle
@end_toggle
- Finally we have the @ref cv::rectangle function (we did not create a special function for
diff --git a/doc/tutorials/core/basic_geometric_drawing/images/Drawing_1_Tutorial_Result_0.png b/doc/tutorials/imgproc/basic_geometric_drawing/images/Drawing_1_Tutorial_Result_0.png
similarity index 100%
rename from doc/tutorials/core/basic_geometric_drawing/images/Drawing_1_Tutorial_Result_0.png
rename to doc/tutorials/imgproc/basic_geometric_drawing/images/Drawing_1_Tutorial_Result_0.png
diff --git a/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown b/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown
index feca4e9aa6..ddb7d9e8f5 100644
--- a/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown
+++ b/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown
@@ -1,6 +1,9 @@
Eroding and Dilating {#tutorial_erosion_dilatation}
====================
+@prev_tutorial{tutorial_gausian_median_blur_bilateral_filter}
+@next_tutorial{tutorial_opening_closing_hats}
+
Goal
----
diff --git a/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown b/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown
index 332d894062..92dd1d5ed7 100644
--- a/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown
+++ b/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown
@@ -1,6 +1,7 @@
Smoothing Images {#tutorial_gausian_median_blur_bilateral_filter}
================
+@prev_tutorial{tutorial_random_generator_and_text}
@next_tutorial{tutorial_erosion_dilatation}
Goal
diff --git a/doc/tutorials/imgproc/histograms/back_projection/back_projection.markdown b/doc/tutorials/imgproc/histograms/back_projection/back_projection.markdown
index a2a894a459..cae547bd95 100644
--- a/doc/tutorials/imgproc/histograms/back_projection/back_projection.markdown
+++ b/doc/tutorials/imgproc/histograms/back_projection/back_projection.markdown
@@ -1,6 +1,9 @@
Back Projection {#tutorial_back_projection}
===============
+@prev_tutorial{tutorial_histogram_comparison}
+@next_tutorial{tutorial_template_matching}
+
Goal
----
diff --git a/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.markdown b/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.markdown
index 8410b9267b..471887c59a 100644
--- a/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.markdown
+++ b/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.markdown
@@ -1,6 +1,9 @@
Histogram Calculation {#tutorial_histogram_calculation}
=====================
+@prev_tutorial{tutorial_histogram_equalization}
+@next_tutorial{tutorial_histogram_comparison}
+
Goal
----
diff --git a/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.markdown b/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.markdown
index 8577067372..d243511be8 100644
--- a/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.markdown
+++ b/doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.markdown
@@ -1,6 +1,9 @@
Histogram Comparison {#tutorial_histogram_comparison}
====================
+@prev_tutorial{tutorial_histogram_calculation}
+@next_tutorial{tutorial_back_projection}
+
Goal
----
diff --git a/doc/tutorials/imgproc/histograms/histogram_equalization/histogram_equalization.markdown b/doc/tutorials/imgproc/histograms/histogram_equalization/histogram_equalization.markdown
index f5edd73ac7..2add8bade4 100644
--- a/doc/tutorials/imgproc/histograms/histogram_equalization/histogram_equalization.markdown
+++ b/doc/tutorials/imgproc/histograms/histogram_equalization/histogram_equalization.markdown
@@ -1,6 +1,9 @@
Histogram Equalization {#tutorial_histogram_equalization}
======================
+@prev_tutorial{tutorial_warp_affine}
+@next_tutorial{tutorial_histogram_calculation}
+
Goal
----
diff --git a/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown b/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown
index cebf43ce7b..5ef2b7e629 100644
--- a/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown
+++ b/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown
@@ -1,6 +1,9 @@
Canny Edge Detector {#tutorial_canny_detector}
===================
+@prev_tutorial{tutorial_laplace_operator}
+@next_tutorial{tutorial_hough_lines}
+
Goal
----
diff --git a/doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown b/doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown
index ca1ec47258..18995b1e2d 100644
--- a/doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown
+++ b/doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown
@@ -1,6 +1,9 @@
Image Segmentation with Distance Transform and Watershed Algorithm {#tutorial_distance_transform}
=============
+@prev_tutorial{tutorial_point_polygon_test}
+@next_tutorial{tutorial_out_of_focus_deblur_filter}
+
Goal
----
diff --git a/doc/tutorials/imgproc/imgtrans/remap/remap.markdown b/doc/tutorials/imgproc/imgtrans/remap/remap.markdown
index 53cba14516..ac2b879171 100644
--- a/doc/tutorials/imgproc/imgtrans/remap/remap.markdown
+++ b/doc/tutorials/imgproc/imgtrans/remap/remap.markdown
@@ -1,6 +1,9 @@
Remapping {#tutorial_remap}
=========
+@prev_tutorial{tutorial_hough_circle}
+@next_tutorial{tutorial_warp_affine}
+
Goal
----
diff --git a/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.markdown b/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.markdown
index 3f25509dba..dab4e953fb 100644
--- a/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.markdown
+++ b/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.markdown
@@ -1,6 +1,9 @@
Affine Transformations {#tutorial_warp_affine}
======================
+@prev_tutorial{tutorial_remap}
+@next_tutorial{tutorial_histogram_equalization}
+
Goal
----
diff --git a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown
index 328b8aa3a9..ab1ba87e1f 100644
--- a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown
+++ b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown
@@ -1,6 +1,9 @@
More Morphology Transformations {#tutorial_opening_closing_hats}
===============================
+@prev_tutorial{tutorial_erosion_dilatation}
+@next_tutorial{tutorial_hitOrMiss}
+
Goal
----
diff --git a/doc/tutorials/imgproc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.markdown b/doc/tutorials/imgproc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.markdown
index abab071208..993442168d 100755
--- a/doc/tutorials/imgproc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.markdown
+++ b/doc/tutorials/imgproc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.markdown
@@ -1,6 +1,8 @@
Out-of-focus Deblur Filter {#tutorial_out_of_focus_deblur_filter}
==========================
+@prev_tutorial{tutorial_distance_transform}
+
Goal
----
diff --git a/doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_0.jpg b/doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_0.jpg
similarity index 100%
rename from doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_0.jpg
rename to doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_0.jpg
diff --git a/doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_2.jpg b/doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_2.jpg
similarity index 100%
rename from doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_2.jpg
rename to doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_2.jpg
diff --git a/doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_3.jpg b/doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_3.jpg
similarity index 100%
rename from doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_3.jpg
rename to doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_3.jpg
diff --git a/doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_5.jpg b/doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_5.jpg
similarity index 100%
rename from doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_5.jpg
rename to doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_5.jpg
diff --git a/doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_big.jpg b/doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_big.jpg
similarity index 100%
rename from doc/tutorials/core/random_generator_and_text/images/Drawing_2_Tutorial_Result_big.jpg
rename to doc/tutorials/imgproc/random_generator_and_text/images/Drawing_2_Tutorial_Result_big.jpg
diff --git a/doc/tutorials/core/random_generator_and_text/random_generator_and_text.markdown b/doc/tutorials/imgproc/random_generator_and_text/random_generator_and_text.markdown
similarity index 98%
rename from doc/tutorials/core/random_generator_and_text/random_generator_and_text.markdown
rename to doc/tutorials/imgproc/random_generator_and_text/random_generator_and_text.markdown
index b9d39756b0..d2f10214ea 100644
--- a/doc/tutorials/core/random_generator_and_text/random_generator_and_text.markdown
+++ b/doc/tutorials/imgproc/random_generator_and_text/random_generator_and_text.markdown
@@ -1,6 +1,9 @@
Random generator and text with OpenCV {#tutorial_random_generator_and_text}
=====================================
+@prev_tutorial{tutorial_basic_geometric_drawing}
+@next_tutorial{tutorial_gausian_median_blur_bilateral_filter}
+
Goals
-----
diff --git a/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown b/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown
index 99cc2c146e..48db64464b 100644
--- a/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown
+++ b/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown
@@ -1,6 +1,9 @@
Creating Bounding boxes and circles for contours {#tutorial_bounding_rects_circles}
================================================
+@prev_tutorial{tutorial_hull}
+@next_tutorial{tutorial_bounding_rotated_ellipses}
+
Goal
----
diff --git a/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown b/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown
index a482936d79..bf53f14a9b 100644
--- a/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown
+++ b/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown
@@ -1,6 +1,9 @@
Creating Bounding rotated boxes and ellipses for contours {#tutorial_bounding_rotated_ellipses}
=========================================================
+@prev_tutorial{tutorial_bounding_rects_circles}
+@next_tutorial{tutorial_moments}
+
Goal
----
diff --git a/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown b/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown
index c1171bb2aa..340143a794 100644
--- a/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown
+++ b/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown
@@ -1,6 +1,9 @@
Finding contours in your image {#tutorial_find_contours}
==============================
+@prev_tutorial{tutorial_template_matching}
+@next_tutorial{tutorial_hull}
+
Goal
----
diff --git a/doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown b/doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown
index 7d7fae1b7c..e1eda3565b 100644
--- a/doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown
+++ b/doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown
@@ -1,6 +1,9 @@
Convex Hull {#tutorial_hull}
===========
+@prev_tutorial{tutorial_find_contours}
+@next_tutorial{tutorial_bounding_rects_circles}
+
Goal
----
diff --git a/doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown b/doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown
index de9e79ca86..2e3daba685 100644
--- a/doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown
+++ b/doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown
@@ -1,6 +1,9 @@
Image Moments {#tutorial_moments}
=============
+@prev_tutorial{tutorial_bounding_rotated_ellipses}
+@next_tutorial{tutorial_point_polygon_test}
+
Goal
----
diff --git a/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown b/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown
index 4a42eea836..0ac2ab768a 100644
--- a/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown
+++ b/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown
@@ -1,6 +1,9 @@
Point Polygon Test {#tutorial_point_polygon_test}
==================
+@prev_tutorial{tutorial_moments}
+@next_tutorial{tutorial_distance_transform}
+
Goal
----
diff --git a/doc/tutorials/imgproc/table_of_content_imgproc.markdown b/doc/tutorials/imgproc/table_of_content_imgproc.markdown
index 3d82c0cf53..e90df59bce 100644
--- a/doc/tutorials/imgproc/table_of_content_imgproc.markdown
+++ b/doc/tutorials/imgproc/table_of_content_imgproc.markdown
@@ -3,6 +3,24 @@ Image Processing (imgproc module) {#tutorial_table_of_content_imgproc}
In this section you will learn about the image processing (manipulation) functions inside OpenCV.
+- @subpage tutorial_basic_geometric_drawing
+
+ *Languages:* C++, Java, Python
+
+ *Compatibility:* \> OpenCV 2.0
+
+ *Author:* Ana Huamán
+
+ We will learn how to draw simple geometry with OpenCV!
+
+- @subpage tutorial_random_generator_and_text
+
+ *Compatibility:* \> OpenCV 2.0
+
+ *Author:* Ana Huamán
+
+ We will draw some *fancy-looking* stuff using OpenCV!
+
- @subpage tutorial_gausian_median_blur_bilateral_filter
*Languages:* C++, Java, Python
diff --git a/doc/tutorials/imgproc/threshold/threshold.markdown b/doc/tutorials/imgproc/threshold/threshold.markdown
index b4ee7b4623..b5a25e3aee 100644
--- a/doc/tutorials/imgproc/threshold/threshold.markdown
+++ b/doc/tutorials/imgproc/threshold/threshold.markdown
@@ -1,6 +1,9 @@
Basic Thresholding Operations {#tutorial_threshold}
=============================
+@prev_tutorial{tutorial_pyramids}
+@next_tutorial{tutorial_threshold_inRange}
+
Goal
----
diff --git a/doc/tutorials/imgproc/threshold_inRange/threshold_inRange.markdown b/doc/tutorials/imgproc/threshold_inRange/threshold_inRange.markdown
index a0c70f0e0a..3b63b07231 100644
--- a/doc/tutorials/imgproc/threshold_inRange/threshold_inRange.markdown
+++ b/doc/tutorials/imgproc/threshold_inRange/threshold_inRange.markdown
@@ -1,6 +1,9 @@
Thresholding Operations using inRange {#tutorial_threshold_inRange}
=====================================
+@prev_tutorial{tutorial_threshold}
+@next_tutorial{tutorial_filter_2d}
+
Goal
----
diff --git a/doc/tutorials/stitching/stitcher/stitcher.markdown b/doc/tutorials/stitching/stitcher/stitcher.markdown
index d34cac7048..f0e7731e51 100644
--- a/doc/tutorials/stitching/stitcher/stitcher.markdown
+++ b/doc/tutorials/stitching/stitcher/stitcher.markdown
@@ -24,17 +24,7 @@ Explanation
The most important code part is:
-@code{.cpp}
-Mat pano;
-Ptr stitcher = Stitcher::create(mode, try_use_gpu);
-Stitcher::Status status = stitcher->stitch(imgs, pano);
-
-if (status != Stitcher::OK)
-{
- cout << "Can't stitch images, error code = " << int(status) << endl;
- return -1;
-}
-@endcode
+@snippet cpp/stitching.cpp stitching
A new instance of stitcher is created and the @ref cv::Stitcher::stitch will
do all the hard work.
diff --git a/modules/calib3d/include/opencv2/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d.hpp
index fcd295da6f..61191fedc0 100644
--- a/modules/calib3d/include/opencv2/calib3d.hpp
+++ b/modules/calib3d/include/opencv2/calib3d.hpp
@@ -307,11 +307,11 @@ optimization procedures like calibrateCamera, stereoCalibrate, or solvePnP .
*/
CV_EXPORTS_W void Rodrigues( InputArray src, OutputArray dst, OutputArray jacobian = noArray() );
-/** @example pose_from_homography.cpp
- An example program about pose estimation from coplanar points
+/** @example samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp
+An example program about pose estimation from coplanar points
- Check @ref tutorial_homography "the corresponding tutorial" for more details
- */
+Check @ref tutorial_homography "the corresponding tutorial" for more details
+*/
/** @brief Finds a perspective transformation between two planes.
@@ -526,11 +526,11 @@ CV_EXPORTS_W void projectPoints( InputArray objectPoints,
OutputArray jacobian = noArray(),
double aspectRatio = 0 );
-/** @example homography_from_camera_displacement.cpp
- An example program about homography from the camera displacement
+/** @example samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp
+An example program about homography from the camera displacement
- Check @ref tutorial_homography "the corresponding tutorial" for more details
- */
+Check @ref tutorial_homography "the corresponding tutorial" for more details
+*/
/** @brief Finds an object pose from 3D-2D point correspondences.
@@ -1966,11 +1966,11 @@ CV_EXPORTS_W cv::Mat estimateAffinePartial2D(InputArray from, InputArray to, Out
size_t maxIters = 2000, double confidence = 0.99,
size_t refineIters = 10);
-/** @example decompose_homography.cpp
- An example program with homography decomposition.
+/** @example samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp
+An example program with homography decomposition.
- Check @ref tutorial_homography "the corresponding tutorial" for more details.
- */
+Check @ref tutorial_homography "the corresponding tutorial" for more details.
+*/
/** @brief Decompose a homography matrix to rotation(s), translation(s) and plane normal(s).
diff --git a/modules/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp
index 21be7d7afd..4d8f3b56d2 100644
--- a/modules/core/include/opencv2/core.hpp
+++ b/modules/core/include/opencv2/core.hpp
@@ -273,9 +273,11 @@ of p and len.
*/
CV_EXPORTS_W int borderInterpolate(int p, int len, int borderType);
-/** @example copyMakeBorder_demo.cpp
-An example using copyMakeBorder function
- */
+/** @example samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp
+An example using copyMakeBorder function.
+Check @ref tutorial_copyMakeBorder "the corresponding tutorial" for more details
+*/
+
/** @brief Forms a border around an image.
The function copies the source image into the middle of the destination image. The areas to the
@@ -474,9 +476,10 @@ The function can also be emulated with a matrix expression, for example:
*/
CV_EXPORTS_W void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst);
-/** @example AddingImagesTrackbar.cpp
+/** @example samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp
+Check @ref tutorial_trackbar "the corresponding tutorial" for more details
+*/
- */
/** @brief Calculates the weighted sum of two arrays.
The function addWeighted calculates the weighted sum of two arrays as follows:
@@ -2527,14 +2530,18 @@ public:
Mat mean; //!< mean value subtracted before the projection and added after the back projection
};
-/** @example pca.cpp
- An example using %PCA for dimensionality reduction while maintaining an amount of variance
- */
+/** @example samples/cpp/pca.cpp
+An example using %PCA for dimensionality reduction while maintaining an amount of variance
+*/
+
+/** @example samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp
+Check @ref tutorial_introduction_to_pca "the corresponding tutorial" for more details
+*/
/**
- @brief Linear Discriminant Analysis
- @todo document this class
- */
+@brief Linear Discriminant Analysis
+@todo document this class
+*/
class CV_EXPORTS LDA
{
public:
@@ -2850,7 +2857,7 @@ public:
use explicit type cast operators, as in the a1 initialization above.
@param a lower inclusive boundary of the returned random number.
@param b upper non-inclusive boundary of the returned random number.
- */
+ */
int uniform(int a, int b);
/** @overload */
float uniform(float a, float b);
@@ -2912,7 +2919,7 @@ public:
Inspired by http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
@todo document
- */
+*/
class CV_EXPORTS RNG_MT19937
{
public:
@@ -2930,17 +2937,11 @@ public:
unsigned operator ()(unsigned N);
unsigned operator ()();
- /** @brief returns uniformly distributed integer random number from [a,b) range
-
-*/
+ /** @brief returns uniformly distributed integer random number from [a,b) range*/
int uniform(int a, int b);
- /** @brief returns uniformly distributed floating-point random number from [a,b) range
-
-*/
+ /** @brief returns uniformly distributed floating-point random number from [a,b) range*/
float uniform(float a, float b);
- /** @brief returns uniformly distributed double-precision floating-point random number from [a,b) range
-
-*/
+ /** @brief returns uniformly distributed double-precision floating-point random number from [a,b) range*/
double uniform(double a, double b);
private:
@@ -2954,8 +2955,8 @@ private:
//! @addtogroup core_cluster
//! @{
-/** @example kmeans.cpp
- An example on K-means clustering
+/** @example samples/cpp/kmeans.cpp
+An example on K-means clustering
*/
/** @brief Finds centers of clusters and groups input samples around the clusters.
@@ -3067,7 +3068,7 @@ etc.).
Here is example of SimpleBlobDetector use in your application via Algorithm interface:
@snippet snippets/core_various.cpp Algorithm
- */
+*/
class CV_EXPORTS_W Algorithm
{
public:
@@ -3083,8 +3084,8 @@ public:
virtual void write(FileStorage& fs) const { (void)fs; }
/** @brief simplified API for language bindings
- * @overload
- */
+ * @overload
+ */
CV_WRAP void write(const Ptr& fs, const String& name = String()) const;
/** @brief Reads algorithm parameters from a file storage
@@ -3092,20 +3093,20 @@ public:
CV_WRAP virtual void read(const FileNode& fn) { (void)fn; }
/** @brief Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
- */
+ */
CV_WRAP virtual bool empty() const { return false; }
/** @brief Reads algorithm from the file node
- This is static template method of Algorithm. It's usage is following (in the case of SVM):
- @code
- cv::FileStorage fsRead("example.xml", FileStorage::READ);
- Ptr svm = Algorithm::read(fsRead.root());
- @endcode
- In order to make this method work, the derived class must overwrite Algorithm::read(const
- FileNode& fn) and also have static create() method without parameters
- (or with all the optional parameters)
- */
+ This is static template method of Algorithm. It's usage is following (in the case of SVM):
+ @code
+ cv::FileStorage fsRead("example.xml", FileStorage::READ);
+ Ptr svm = Algorithm::read(fsRead.root());
+ @endcode
+ In order to make this method work, the derived class must overwrite Algorithm::read(const
+ FileNode& fn) and also have static create() method without parameters
+ (or with all the optional parameters)
+ */
template static Ptr<_Tp> read(const FileNode& fn)
{
Ptr<_Tp> obj = _Tp::create();
@@ -3115,16 +3116,16 @@ public:
/** @brief Loads algorithm from the file
- @param filename Name of the file to read.
- @param objname The optional name of the node to read (if empty, the first top-level node will be used)
+ @param filename Name of the file to read.
+ @param objname The optional name of the node to read (if empty, the first top-level node will be used)
- This is static template method of Algorithm. It's usage is following (in the case of SVM):
- @code
- Ptr svm = Algorithm::load("my_svm_model.xml");
- @endcode
- In order to make this method work, the derived class must overwrite Algorithm::read(const
- FileNode& fn).
- */
+ This is static template method of Algorithm. It's usage is following (in the case of SVM):
+ @code
+ Ptr svm = Algorithm::load("my_svm_model.xml");
+ @endcode
+ In order to make this method work, the derived class must overwrite Algorithm::read(const
+ FileNode& fn).
+ */
template static Ptr<_Tp> load(const String& filename, const String& objname=String())
{
FileStorage fs(filename, FileStorage::READ);
@@ -3138,14 +3139,14 @@ public:
/** @brief Loads algorithm from a String
- @param strModel The string variable containing the model you want to load.
- @param objname The optional name of the node to read (if empty, the first top-level node will be used)
+ @param strModel The string variable containing the model you want to load.
+ @param objname The optional name of the node to read (if empty, the first top-level node will be used)
- This is static template method of Algorithm. It's usage is following (in the case of SVM):
- @code
- Ptr svm = Algorithm::loadFromString(myStringModel);
- @endcode
- */
+ This is static template method of Algorithm. It's usage is following (in the case of SVM):
+ @code
+ Ptr svm = Algorithm::loadFromString(myStringModel);
+ @endcode
+ */
template static Ptr<_Tp> loadFromString(const String& strModel, const String& objname=String())
{
FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY);
@@ -3156,11 +3157,11 @@ public:
}
/** Saves the algorithm to a file.
- In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). */
+ In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). */
CV_WRAP virtual void save(const String& filename) const;
/** Returns the algorithm string identifier.
- This string is used as top level xml/yml node tag when the object is saved to a file or string. */
+ This string is used as top level xml/yml node tag when the object is saved to a file or string. */
CV_WRAP virtual String getDefaultName() const;
protected:
diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp
index 550d963a29..a7d3021857 100644
--- a/modules/core/include/opencv2/core/mat.hpp
+++ b/modules/core/include/opencv2/core/mat.hpp
@@ -575,7 +575,7 @@ protected:
MatStep& operator = (const MatStep&);
};
-/** @example cout_mat.cpp
+/** @example samples/cpp/cout_mat.cpp
An example demonstrating the serial out capabilities of cv::Mat
*/
diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp
index 5103c7df8b..a82235b7c3 100644
--- a/modules/core/include/opencv2/core/persistence.hpp
+++ b/modules/core/include/opencv2/core/persistence.hpp
@@ -287,12 +287,12 @@ element is a structure of 2 integers, followed by a single-precision floating-po
equivalent notations of the above specification are `iif`, `2i1f` and so forth. Other examples: `u`
means that the array consists of bytes, and `2d` means the array consists of pairs of doubles.
-@see @ref filestorage.cpp
+@see @ref samples/cpp/filestorage.cpp
*/
//! @{
-/** @example filestorage.cpp
+/** @example samples/cpp/filestorage.cpp
A complete example using the FileStorage interface
*/
diff --git a/modules/dnn/include/opencv2/dnn.hpp b/modules/dnn/include/opencv2/dnn.hpp
index af919005f6..97f2fe3ffd 100644
--- a/modules/dnn/include/opencv2/dnn.hpp
+++ b/modules/dnn/include/opencv2/dnn.hpp
@@ -59,6 +59,20 @@
A network training is in principle not supported.
@}
*/
+/** @example samples/dnn/classification.cpp
+Check @ref tutorial_dnn_googlenet "the corresponding tutorial" for more details
+*/
+/** @example samples/dnn/colorization.cpp
+*/
+/** @example samples/dnn/object_detection.cpp
+Check @ref tutorial_dnn_yolo "the corresponding tutorial" for more details
+*/
+/** @example samples/dnn/openpose.cpp
+*/
+/** @example samples/dnn/segmentation.cpp
+*/
+/** @example samples/dnn/text_detection.cpp
+*/
#include
#endif /* OPENCV_DNN_HPP */
diff --git a/modules/highgui/include/opencv2/highgui.hpp b/modules/highgui/include/opencv2/highgui.hpp
index 06cfd80ac3..994a1d1efb 100644
--- a/modules/highgui/include/opencv2/highgui.hpp
+++ b/modules/highgui/include/opencv2/highgui.hpp
@@ -452,12 +452,13 @@ The function getWindowImageRect returns the client screen coordinates, width and
*/
CV_EXPORTS_W Rect getWindowImageRect(const String& winname);
+/** @example samples/cpp/create_mask.cpp
+This program demonstrates using mouse events and how to make and use a mask image (black and white) .
+*/
/** @brief Sets mouse handler for the specified window
@param winname Name of the window.
-@param onMouse Mouse callback. See OpenCV samples, such as
-, on how to specify and
-use the callback.
+@param onMouse Callback function for mouse events. See OpenCV samples on how to specify and use the callback.
@param userdata The optional parameter passed to the callback.
*/
CV_EXPORTS void setMouseCallback(const String& winname, MouseCallback onMouse, void* userdata = 0);
diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp
index a831d0e92b..f309278dd8 100644
--- a/modules/imgproc/include/opencv2/imgproc.hpp
+++ b/modules/imgproc/include/opencv2/imgproc.hpp
@@ -1191,7 +1191,7 @@ protected:
//! @addtogroup imgproc_feature
//! @{
-/** @example lsd_lines.cpp
+/** @example samples/cpp/lsd_lines.cpp
An example using the LineSegmentDetector
\image html building_lsd.png "Sample output image" width=434 height=300
*/
@@ -1349,11 +1349,12 @@ operation is shifted.
*/
CV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1));
-/** @example Smoothing.cpp
+/** @example samples/cpp/tutorial_code/ImgProc/Smoothing/Smoothing.cpp
Sample code for simple filters
![Sample screenshot](Smoothing_Tutorial_Result_Median_Filter.jpg)
Check @ref tutorial_gausian_median_blur_bilateral_filter "the corresponding tutorial" for more details
*/
+
/** @brief Blurs an image using the median filter.
The function smoothes an image using the median filter with the \f$\texttt{ksize} \times
@@ -1556,11 +1557,12 @@ CV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth,
Point anchor = Point(-1,-1),
double delta = 0, int borderType = BORDER_DEFAULT );
-/** @example Sobel_Demo.cpp
+/** @example samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp
Sample code using Sobel and/or Scharr OpenCV functions to make a simple Edge Detector
![Sample screenshot](Sobel_Derivatives_Tutorial_Result.jpg)
Check @ref tutorial_sobel_derivatives "the corresponding tutorial" for more details
- */
+*/
+
/** @brief Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
In all cases except one, the \f$\texttt{ksize} \times \texttt{ksize}\f$ separable kernel is used to
@@ -1656,8 +1658,8 @@ CV_EXPORTS_W void Scharr( InputArray src, OutputArray dst, int ddepth,
int dx, int dy, double scale = 1, double delta = 0,
int borderType = BORDER_DEFAULT );
-/** @example laplace.cpp
- An example using Laplace transformations for edge detection
+/** @example samples/cpp/laplace.cpp
+An example using Laplace transformations for edge detection
*/
/** @brief Calculates the Laplacian of an image.
@@ -1692,10 +1694,10 @@ CV_EXPORTS_W void Laplacian( InputArray src, OutputArray dst, int ddepth,
//! @addtogroup imgproc_feature
//! @{
-/** @example edge.cpp
- This program demonstrates usage of the Canny edge detector
+/** @example samples/cpp/edge.cpp
+This program demonstrates usage of the Canny edge detector
- Check @ref tutorial_canny_detector "the corresponding tutorial" for more details
+Check @ref tutorial_canny_detector "the corresponding tutorial" for more details
*/
/** @brief Finds edges in an image using the Canny algorithm @cite Canny86 .
@@ -1932,7 +1934,7 @@ CV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,
InputArray mask, int blockSize,
int gradientSize, bool useHarrisDetector = false,
double k = 0.04 );
-/** @example houghlines.cpp
+/** @example samples/cpp/tutorial_code/ImgTrans/houghlines.cpp
An example using the Hough line detector
![Sample input image](Hough_Lines_Tutorial_Original_Image.jpg) ![Output image](Hough_Lines_Tutorial_Result.jpg)
*/
@@ -2021,7 +2023,7 @@ CV_EXPORTS_W void HoughLinesPointSet( InputArray _point, OutputArray _lines, int
double min_rho, double max_rho, double rho_step,
double min_theta, double max_theta, double theta_step );
-/** @example houghcircles.cpp
+/** @example samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp
An example using the Hough circle detector
*/
@@ -2069,7 +2071,7 @@ CV_EXPORTS_W void HoughCircles( InputArray image, OutputArray circles,
//! @addtogroup imgproc_filter
//! @{
-/** @example morphology2.cpp
+/** @example samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp
Advanced morphology Transformations sample code
![Sample screenshot](Morphology_2_Tutorial_Result.jpg)
Check @ref tutorial_opening_closing_hats "the corresponding tutorial" for more details
@@ -2102,11 +2104,12 @@ CV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel,
int borderType = BORDER_CONSTANT,
const Scalar& borderValue = morphologyDefaultBorderValue() );
-/** @example Morphology_1.cpp
+/** @example samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp
Erosion and Dilation sample code
![Sample Screenshot-Erosion](Morphology_1_Tutorial_Erosion_Result.jpg)![Sample Screenshot-Dilation](Morphology_1_Tutorial_Dilation_Result.jpg)
Check @ref tutorial_erosion_dilatation "the corresponding tutorial" for more details
- */
+*/
+
/** @brief Dilates an image by using a specific structuring element.
The function dilates the source image using the specified structuring element that determines the
@@ -2236,9 +2239,10 @@ CV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst,
int borderMode = BORDER_CONSTANT,
const Scalar& borderValue = Scalar());
-/** @example warpPerspective_demo.cpp
+/** @example samples/cpp/warpPerspective_demo.cpp
An example program shows using cv::findHomography and cv::warpPerspective for image warping
- */
+*/
+
/** @brief Applies a perspective transformation to an image.
The function warpPerspective transforms the source image using the specified matrix:
@@ -2434,7 +2438,7 @@ source image. The center must be inside the image.
CV_EXPORTS_W void getRectSubPix( InputArray image, Size patchSize,
Point2f center, OutputArray patch, int patchType = -1 );
-/** @example polar_transforms.cpp
+/** @example samples/cpp/polar_transforms.cpp
An example using the cv::linearPolar and cv::logPolar operations
*/
@@ -2869,9 +2873,10 @@ CV_EXPORTS_W void adaptiveThreshold( InputArray src, OutputArray dst,
//! @addtogroup imgproc_filter
//! @{
-/** @example Pyramids.cpp
+/** @example samples/cpp/tutorial_code/ImgProc/Pyramids/Pyramids.cpp
An example using pyrDown and pyrUp functions
- */
+*/
+
/** @brief Blurs an image and downsamples it.
By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in
@@ -3120,7 +3125,7 @@ CV_EXPORTS_AS(undistortPointsIter) void undistortPoints( InputArray src, OutputA
//! @addtogroup imgproc_hist
//! @{
-/** @example demhist.cpp
+/** @example samples/cpp/demhist.cpp
An example for creating histograms of an image
*/
@@ -3317,9 +3322,9 @@ CV_EXPORTS_AS(EMD) float wrapperEMD( InputArray signature1, InputArray signature
//! @} imgproc_hist
-/** @example watershed.cpp
+/** @example samples/cpp/watershed.cpp
An example using the watershed algorithm
- */
+*/
/** @brief Performs a marker-based image segmentation using the watershed algorithm.
@@ -3397,10 +3402,10 @@ CV_EXPORTS_W void pyrMeanShiftFiltering( InputArray src, OutputArray dst,
//! @addtogroup imgproc_misc
//! @{
-/** @example grabcut.cpp
+/** @example samples/cpp/grabcut.cpp
An example using the GrabCut algorithm
![Sample Screenshot](grabcut_output1.jpg)
- */
+*/
/** @brief Runs the GrabCut algorithm.
@@ -3424,11 +3429,10 @@ CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect,
InputOutputArray bgdModel, InputOutputArray fgdModel,
int iterCount, int mode = GC_EVAL );
-/** @example distrans.cpp
-An example on using the distance transform\
+/** @example samples/cpp/distrans.cpp
+An example on using the distance transform
*/
-
/** @brief Calculates the distance to the closest zero pixel for each pixel of the source image.
The function cv::distanceTransform calculates the approximate or precise distance from every binary
@@ -3500,8 +3504,8 @@ the first variant of the function and distanceType == #DIST_L1.
CV_EXPORTS_W void distanceTransform( InputArray src, OutputArray dst,
int distanceType, int maskSize, int dstType=CV_32F);
-/** @example ffilldemo.cpp
- An example using the FloodFill technique
+/** @example samples/cpp/ffilldemo.cpp
+An example using the FloodFill technique
*/
/** @overload
@@ -3701,9 +3705,10 @@ enum TemplateMatchModes {
TM_CCOEFF_NORMED = 5 //!< \f[R(x,y)= \frac{ \sum_{x',y'} (T'(x',y') \cdot I'(x+x',y+y')) }{ \sqrt{\sum_{x',y'}T'(x',y')^2 \cdot \sum_{x',y'} I'(x+x',y+y')^2} }\f]
};
-/** @example MatchTemplate_Demo.cpp
+/** @example samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp
An example using Template Matching algorithm
- */
+*/
+
/** @brief Compares a template against overlapped image regions.
The function slides through image , compares the overlapped patches of size \f$w \times h\f$ against
@@ -3735,6 +3740,10 @@ CV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ,
//! @addtogroup imgproc_shape
//! @{
+/** @example samples/cpp/connected_components.cpp
+This program demonstrates connected components and use of the trackbar
+*/
+
/** @brief computes the connected components labeled image of boolean image
image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0
@@ -3842,6 +3851,16 @@ CV_EXPORTS_W void findContours( InputOutputArray image, OutputArrayOfArrays cont
CV_EXPORTS void findContours( InputOutputArray image, OutputArrayOfArrays contours,
int mode, int method, Point offset = Point());
+/** @example samples/cpp/squares.cpp
+A program using pyramid scaling, Canny, contours and contour simplification to find
+squares in a list of images (pic1-6.png). Returns sequence of squares detected on the image.
+*/
+
+/** @example samples/tapi/squares.cpp
+A program using pyramid scaling, Canny, contours and contour simplification to find
+squares in the input image.
+*/
+
/** @brief Approximates a polygonal curve(s) with the specified precision.
The function cv::approxPolyDP approximates a curve or a polygon with another curve/polygon with less
@@ -3940,8 +3959,8 @@ The function finds the minimal enclosing circle of a 2D point set using an itera
CV_EXPORTS_W void minEnclosingCircle( InputArray points,
CV_OUT Point2f& center, CV_OUT float& radius );
-/** @example minarea.cpp
- */
+/** @example samples/cpp/minarea.cpp
+*/
/** @brief Finds a triangle of minimum area enclosing a 2D point set and returns its area.
@@ -3976,7 +3995,7 @@ The function compares two shapes. All three implemented methods use the Hu invar
CV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2,
int method, double parameter );
-/** @example convexhull.cpp
+/** @example samples/cpp/convexhull.cpp
An example using the convexHull functionality
*/
@@ -4036,8 +4055,8 @@ CV_EXPORTS_W bool isContourConvex( InputArray contour );
CV_EXPORTS_W float intersectConvexConvex( InputArray _p1, InputArray _p2,
OutputArray _p12, bool handleNested = true );
-/** @example fitellipse.cpp
- An example using the fitEllipse technique
+/** @example samples/cpp/fitellipse.cpp
+An example using the fitEllipse technique
*/
/** @brief Fits an ellipse around a set of 2D points.
@@ -4253,9 +4272,10 @@ enum ColormapTypes
COLORMAP_PARULA = 12 //!< ![parula](pics/colormaps/colorscale_parula.jpg)
};
-/** @example falsecolor.cpp
+/** @example samples/cpp/falsecolor.cpp
An example using applyColorMap function
*/
+
/** @brief Applies a GNU Octave/MATLAB equivalent colormap on a given image.
@param src The source image, grayscale or colored of type CV_8UC1 or CV_8UC3.
@@ -4342,9 +4362,10 @@ CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec,
const Scalar& color, int thickness = 1,
int lineType = LINE_8, int shift = 0);
-/** @example Drawing_2.cpp
+/** @example samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_2.cpp
An example using drawing functions
- */
+*/
+
/** @brief Draws a circle.
The function cv::circle draws a simple or filled circle with a given center and radius.
@@ -4468,9 +4489,11 @@ CV_EXPORTS void fillPoly(Mat& img, const Point** pts,
const Scalar& color, int lineType = LINE_8, int shift = 0,
Point offset = Point() );
-/** @example Drawing_1.cpp
+/** @example samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp
An example using drawing functions
- */
+Check @ref tutorial_random_generator_and_text "the corresponding tutorial" for more details
+*/
+
/** @brief Fills the area bounded by one or more polygons.
The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill
@@ -4510,14 +4533,14 @@ CV_EXPORTS_W void polylines(InputOutputArray img, InputArrayOfArrays pts,
bool isClosed, const Scalar& color,
int thickness = 1, int lineType = LINE_8, int shift = 0 );
-/** @example contours2.cpp
- An example program illustrates the use of cv::findContours and cv::drawContours
- \image html WindowsQtContoursOutput.png "Screenshot of the program"
+/** @example samples/cpp/contours2.cpp
+An example program illustrates the use of cv::findContours and cv::drawContours
+\image html WindowsQtContoursOutput.png "Screenshot of the program"
*/
-/** @example segment_objects.cpp
+/** @example samples/cpp/segment_objects.cpp
An example using drawContours to clean up a background segmentation result
- */
+*/
/** @brief Draws contours outlines or filled contours.
diff --git a/modules/objdetect/include/opencv2/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect.hpp
index bd8bbf05ff..fa9b8bb466 100644
--- a/modules/objdetect/include/opencv2/objdetect.hpp
+++ b/modules/objdetect/include/opencv2/objdetect.hpp
@@ -215,7 +215,7 @@ public:
virtual Ptr getMaskGenerator() = 0;
};
-/** @example facedetect.cpp
+/** @example samples/cpp/facedetect.cpp
This program demonstrates usage of the Cascade classifier class
\image html Cascade_Classifier_Tutorial_Result_Haar.jpg "Sample screenshot" width=321 height=254
*/
@@ -443,7 +443,7 @@ public:
*/
CV_WRAP double getWinSigma() const;
- /**@example peopledetect.cpp
+ /**@example samples/cpp/peopledetect.cpp
*/
/**@brief Sets coefficients for the linear SVM classifier.
@param _svmdetector coefficients for the linear SVM classifier.
@@ -478,7 +478,7 @@ public:
*/
virtual void copyTo(HOGDescriptor& c) const;
- /**@example train_HOG.cpp
+ /**@example samples/cpp/train_HOG.cpp
*/
/** @brief Computes HOG descriptors of given image.
@param img Matrix of the type CV_8U containing an image where HOG features will be calculated.
@@ -575,7 +575,7 @@ public:
*/
CV_WRAP static std::vector getDefaultPeopleDetector();
- /**@example hog.cpp
+ /**@example samples/tapi/hog.cpp
*/
/** @brief Returns coefficients of the classifier trained for people detection (for 48x96 windows).
*/
diff --git a/modules/photo/include/opencv2/photo.hpp b/modules/photo/include/opencv2/photo.hpp
index 8cd1971899..4fdeef90fa 100644
--- a/modules/photo/include/opencv2/photo.hpp
+++ b/modules/photo/include/opencv2/photo.hpp
@@ -730,7 +730,7 @@ CV_EXPORTS_W void decolor( InputArray src, OutputArray grayscale, OutputArray co
//! @addtogroup photo_clone
//! @{
-/** @example cloning_demo.cpp
+/** @example samples/cpp/tutorial_code/photo/seamless_cloning/cloning_demo.cpp
An example using seamlessClone function
*/
/** @brief Image editing tasks concern either global changes (color/intensity corrections, filters,
@@ -836,7 +836,7 @@ CV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flag
CV_EXPORTS_W void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10,
float sigma_r = 0.15f);
-/** @example npr_demo.cpp
+/** @example samples/cpp/tutorial_code/photo/non_photorealistic_rendering/npr_demo.cpp
An example using non-photorealistic line drawing functions
*/
/** @brief Pencil-like non-photorealistic line drawing
diff --git a/modules/shape/include/opencv2/shape/shape_distance.hpp b/modules/shape/include/opencv2/shape/shape_distance.hpp
index 3a778f0525..725b56ac95 100644
--- a/modules/shape/include/opencv2/shape/shape_distance.hpp
+++ b/modules/shape/include/opencv2/shape/shape_distance.hpp
@@ -53,7 +53,7 @@ namespace cv
//! @addtogroup shape
//! @{
-/** @example shape_example.cpp
+/** @example samples/cpp/shape_example.cpp
An example using shape distance algorithm
*/
/** @brief Abstract base class for shape distance algorithms.
diff --git a/modules/stitching/include/opencv2/stitching.hpp b/modules/stitching/include/opencv2/stitching.hpp
index 8b1bcc1a8c..07e1b5f73a 100644
--- a/modules/stitching/include/opencv2/stitching.hpp
+++ b/modules/stitching/include/opencv2/stitching.hpp
@@ -109,6 +109,14 @@ namespace cv {
//! @addtogroup stitching
//! @{
+/** @example samples/cpp/stitching.cpp
+A basic example on image stitching
+*/
+
+/** @example samples/cpp/stitching_detailed.cpp
+A detailed example on image stitching
+*/
+
/** @brief High level image stitcher.
It's possible to use this class without being aware of the entire stitching pipeline. However, to
diff --git a/modules/video/include/opencv2/video/tracking.hpp b/modules/video/include/opencv2/video/tracking.hpp
index 8e01d1645e..e757b0fa91 100644
--- a/modules/video/include/opencv2/video/tracking.hpp
+++ b/modules/video/include/opencv2/video/tracking.hpp
@@ -78,9 +78,10 @@ See the OpenCV sample camshiftdemo.c that tracks colored objects.
*/
CV_EXPORTS_W RotatedRect CamShift( InputArray probImage, CV_IN_OUT Rect& window,
TermCriteria criteria );
-/** @example camshiftdemo.cpp
+/** @example samples/cpp/camshiftdemo.cpp
An example using the mean-shift tracking algorithm
*/
+
/** @brief Finds an object on a back projection image.
@param probImage Back projection of the object histogram. See calcBackProject for details.
@@ -123,9 +124,10 @@ CV_EXPORTS_W int buildOpticalFlowPyramid( InputArray img, OutputArrayOfArrays py
int derivBorder = BORDER_CONSTANT,
bool tryReuseInputImage = true );
-/** @example lkdemo.cpp
+/** @example samples/cpp/lkdemo.cpp
An example using the Lucas-Kanade optical flow algorithm
- */
+*/
+
/** @brief Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with
pyramids.
@@ -263,9 +265,9 @@ enum
MOTION_HOMOGRAPHY = 3
};
-/** @example image_alignment.cpp
+/** @example samples/cpp/image_alignment.cpp
An example using the image alignment ECC algorithm
- */
+*/
/** @brief Finds the geometric transform (warp) between two images in terms of the ECC criterion @cite EP08 .
@@ -322,9 +324,10 @@ CV_EXPORTS_W double findTransformECC( InputArray templateImage, InputArray input
TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001),
InputArray inputMask = noArray());
-/** @example kalman.cpp
+/** @example samples/cpp/kalman.cpp
An example using the standard Kalman filter
*/
+
/** @brief Kalman filter class.
The class implements a standard Kalman filter ,
diff --git a/modules/videoio/include/opencv2/videoio.hpp b/modules/videoio/include/opencv2/videoio.hpp
index 2628609040..bb4e3986c8 100644
--- a/modules/videoio/include/opencv2/videoio.hpp
+++ b/modules/videoio/include/opencv2/videoio.hpp
@@ -815,13 +815,18 @@ protected:
class IVideoWriter;
-/** @example videowriter_basic.cpp
+/** @example samples/cpp/tutorial_code/videoio/video-write/video-write.cpp
+Check @ref tutorial_video_write "the corresponding tutorial" for more details
+*/
+
+/** @example samples/cpp/videowriter_basic.cpp
An example using VideoCapture and VideoWriter class
- */
+*/
+
/** @brief Video writer class.
The class provides C++ API for writing video files or image sequences.
- */
+*/
class CV_EXPORTS_W VideoWriter
{
public:
diff --git a/samples/cpp/connected_components.cpp b/samples/cpp/connected_components.cpp
index 6c978f1535..711b0a97c8 100644
--- a/samples/cpp/connected_components.cpp
+++ b/samples/cpp/connected_components.cpp
@@ -1,3 +1,4 @@
+
#include
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
@@ -32,44 +33,29 @@ static void on_trackbar(int, void*)
imshow( "Connected Components", dst );
}
-static void help()
-{
- cout << "\n This program demonstrates connected components and use of the trackbar\n"
- "Usage: \n"
- " ./connected_components \n"
- "The image is converted to grayscale and displayed, another image has a trackbar\n"
- "that controls thresholding and thereby the extracted contours which are drawn in color\n";
-}
-
-const char* keys =
-{
- "{help h||}{@image|../data/stuff.jpg|image for converting to a grayscale}"
-};
-
int main( int argc, const char** argv )
{
- CommandLineParser parser(argc, argv, keys);
- if (parser.has("help"))
- {
- help();
- return 0;
- }
- string inputImage = parser.get(0);
- img = imread(inputImage.c_str(), 0);
+ CommandLineParser parser(argc, argv, "{@image|../data/stuff.jpg|image for converting to a grayscale}");
+ parser.about("\nThis program demonstrates connected components and use of the trackbar\n");
+ parser.printMessage();
+ cout << "\nThe image is converted to grayscale and displayed, another image has a trackbar\n"
+ "that controls thresholding and thereby the extracted contours which are drawn in color\n";
+
+ String inputImage = parser.get(0);
+ img = imread(inputImage, IMREAD_GRAYSCALE);
if(img.empty())
{
cout << "Could not read input image file: " << inputImage << endl;
- return -1;
+ return EXIT_FAILURE;
}
- namedWindow( "Image", 1 );
imshow( "Image", img );
- namedWindow( "Connected Components", 1 );
+ namedWindow( "Connected Components", WINDOW_AUTOSIZE);
createTrackbar( "Threshold", "Connected Components", &threshval, 255, on_trackbar );
on_trackbar(threshval, 0);
waitKey(0);
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/samples/cpp/squares.cpp b/samples/cpp/squares.cpp
index dfa3c61e85..480fe0a029 100644
--- a/samples/cpp/squares.cpp
+++ b/samples/cpp/squares.cpp
@@ -1,3 +1,4 @@
+
// The "Square Detector" program.
// It loads several images sequentially and tries to find squares in
// each image
@@ -8,22 +9,18 @@
#include "opencv2/highgui.hpp"
#include
-#include
-#include
using namespace cv;
using namespace std;
-static void help()
+static void help(const char* programName)
{
cout <<
- "\nA program using pyramid scaling, Canny, contours, contour simpification and\n"
- "memory storage (it's got it all folks) to find\n"
- "squares in a list of images pic1-6.png\n"
+ "\nA program using pyramid scaling, Canny, contours and contour simplification\n"
+ "to find squares in a list of images (pic1-6.png)\n"
"Returns sequence of squares detected on the image.\n"
- "the sequence is stored in the specified memory storage\n"
"Call:\n"
- "./squares [file_name (optional)]\n"
+ "./" << programName << " [file_name (optional)]\n"
"Using OpenCV version " << CV_VERSION << "\n" << endl;
}
@@ -44,7 +41,6 @@ static double angle( Point pt1, Point pt2, Point pt0 )
}
// returns sequence of squares detected on the image.
-// the sequence is stored in the specified memory storage
static void findSquares( const Mat& image, vector >& squares )
{
squares.clear();
@@ -93,7 +89,7 @@ static void findSquares( const Mat& image, vector >& squares )
{
// approximate contour with accuracy proportional
// to the contour perimeter
- approxPolyDP(Mat(contours[i]), approx, arcLength(Mat(contours[i]), true)*0.02, true);
+ approxPolyDP(contours[i], approx, arcLength(contours[i], true)*0.02, true);
// square contours should have 4 vertices after approximation
// relatively large area (to filter out noisy contours)
@@ -102,8 +98,8 @@ static void findSquares( const Mat& image, vector >& squares )
// area may be positive or negative - in accordance with the
// contour orientation
if( approx.size() == 4 &&
- fabs(contourArea(Mat(approx))) > 1000 &&
- isContourConvex(Mat(approx)) )
+ fabs(contourArea(approx)) > 1000 &&
+ isContourConvex(approx) )
{
double maxCosine = 0;
@@ -144,7 +140,7 @@ int main(int argc, char** argv)
{
static const char* names[] = { "../data/pic1.png", "../data/pic2.png", "../data/pic3.png",
"../data/pic4.png", "../data/pic5.png", "../data/pic6.png", 0 };
- help();
+ help(argv[0]);
if( argc > 1)
{
@@ -152,12 +148,11 @@ int main(int argc, char** argv)
names[1] = "0";
}
- namedWindow( wndname, 1 );
vector > squares;
for( int i = 0; names[i] != 0; i++ )
{
- Mat image = imread(names[i], 1);
+ Mat image = imread(names[i], IMREAD_COLOR);
if( image.empty() )
{
cout << "Couldn't load " << names[i] << endl;
@@ -167,7 +162,7 @@ int main(int argc, char** argv)
findSquares(image, squares);
drawSquares(image, squares);
- char c = (char)waitKey();
+ int c = waitKey();
if( c == 27 )
break;
}
diff --git a/samples/cpp/stitching.cpp b/samples/cpp/stitching.cpp
index 153fe55e8f..dd8c151dd3 100644
--- a/samples/cpp/stitching.cpp
+++ b/samples/cpp/stitching.cpp
@@ -20,8 +20,9 @@ int parseCmdArgs(int argc, char** argv);
int main(int argc, char* argv[])
{
int retval = parseCmdArgs(argc, argv);
- if (retval) return -1;
+ if (retval) return EXIT_FAILURE;
+ //![stitching]
Mat pano;
Ptr stitcher = Stitcher::create(mode, try_use_gpu);
Stitcher::Status status = stitcher->stitch(imgs, pano);
@@ -29,12 +30,13 @@ int main(int argc, char* argv[])
if (status != Stitcher::OK)
{
cout << "Can't stitch images, error code = " << int(status) << endl;
- return -1;
+ return EXIT_FAILURE;
}
+ //![stitching]
imwrite(result_name, pano);
cout << "stitching completed successfully\n" << result_name << " saved!";
- return 0;
+ return EXIT_SUCCESS;
}
@@ -63,7 +65,7 @@ int parseCmdArgs(int argc, char** argv)
if (argc == 1)
{
printUsage(argv);
- return -1;
+ return EXIT_FAILURE;
}
for (int i = 1; i < argc; ++i)
@@ -71,7 +73,7 @@ int parseCmdArgs(int argc, char** argv)
if (string(argv[i]) == "--help" || string(argv[i]) == "/?")
{
printUsage(argv);
- return -1;
+ return EXIT_FAILURE;
}
else if (string(argv[i]) == "--try_use_gpu")
{
@@ -82,7 +84,7 @@ int parseCmdArgs(int argc, char** argv)
else
{
cout << "Bad --try_use_gpu flag value\n";
- return -1;
+ return EXIT_FAILURE;
}
i++;
}
@@ -104,7 +106,7 @@ int parseCmdArgs(int argc, char** argv)
else
{
cout << "Bad --mode flag value\n";
- return -1;
+ return EXIT_FAILURE;
}
i++;
}
@@ -114,7 +116,7 @@ int parseCmdArgs(int argc, char** argv)
if (img.empty())
{
cout << "Can't read image '" << argv[i] << "'\n";
- return -1;
+ return EXIT_FAILURE;
}
if (divide_images)
@@ -130,5 +132,5 @@ int parseCmdArgs(int argc, char** argv)
imgs.push_back(img);
}
}
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/samples/cpp/stitching_detailed.cpp b/samples/cpp/stitching_detailed.cpp
index 2ff4e7b16b..27b6e024f8 100644
--- a/samples/cpp/stitching_detailed.cpp
+++ b/samples/cpp/stitching_detailed.cpp
@@ -1,45 +1,3 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
-//
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-//
-// By downloading, copying, installing or using the software you agree to this license.
-// If you do not agree to this license, do not download, install,
-// copy or use the software.
-//
-//
-// License Agreement
-// For Open Source Computer Vision Library
-//
-// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
-// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
-// Third party copyrights are property of their respective owners.
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// * Redistribution's of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// * Redistribution's in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// * The name of the copyright holders may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// This software is provided by the copyright holders and contributors "as is" and
-// any express or implied warranties, including, but not limited to, the implied
-// warranties of merchantability and fitness for a particular purpose are disclaimed.
-// In no event shall the Intel Corporation or contributors be liable for any direct,
-// indirect, incidental, special, exemplary, or consequential damages
-// (including, but not limited to, procurement of substitute goods or services;
-// loss of use, data, or profits; or business interruption) however caused
-// and on any theory of liability, whether in contract, strict liability,
-// or tort (including negligence or otherwise) arising in any way out of
-// the use of this software, even if advised of the possibility of such damage.
-//
-//
-//M*/
#include
#include
diff --git a/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp b/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp
index 3619753162..ce71a3b118 100644
--- a/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp
+++ b/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp
@@ -33,7 +33,7 @@ void Morphology_Operations( int, void* );
int main( int argc, char** argv )
{
//![load]
- CommandLineParser parser( argc, argv, "{@input | ../data/LinuxLogo.jpg | input image}" );
+ CommandLineParser parser( argc, argv, "{@input | ../data/baboon.jpg | input image}" );
src = imread( parser.get( "@input" ), IMREAD_COLOR );
if (src.empty())
{
diff --git a/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp b/samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp
similarity index 100%
rename from samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp
rename to samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp
diff --git a/samples/cpp/tutorial_code/core/Matrix/Drawing_2.cpp b/samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_2.cpp
similarity index 100%
rename from samples/cpp/tutorial_code/core/Matrix/Drawing_2.cpp
rename to samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_2.cpp
diff --git a/samples/java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java b/samples/java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java
similarity index 100%
rename from samples/java/tutorial_code/core/BasicGeometricDrawing/BasicGeometricDrawing.java
rename to samples/java/tutorial_code/ImgProc/BasicGeometricDrawing/BasicGeometricDrawing.java
diff --git a/samples/python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py b/samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py
similarity index 100%
rename from samples/python/tutorial_code/core/BasicGeometricDrawing/basic_geometric_drawing.py
rename to samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py
diff --git a/samples/tapi/squares.cpp b/samples/tapi/squares.cpp
index 8300b9c872..42a40c3f6f 100644
--- a/samples/tapi/squares.cpp
+++ b/samples/tapi/squares.cpp
@@ -1,6 +1,3 @@
-// The "Square Detector" program.
-// It loads several images sequentially and tries to find squares in
-// each image
#include "opencv2/core.hpp"
#include "opencv2/core/ocl.hpp"
@@ -9,7 +6,6 @@
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include
-#include
using namespace cv;
using namespace std;
@@ -31,7 +27,6 @@ static double angle( Point pt1, Point pt2, Point pt0 )
// returns sequence of squares detected on the image.
-// the sequence is stored in the specified memory storage
static void findSquares( const UMat& image, vector >& squares )
{
squares.clear();
@@ -66,7 +61,7 @@ static void findSquares( const UMat& image, vector >& squares )
{
// apply threshold if l!=0:
// tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0
- cv::threshold(gray0, gray, (l+1)*255/N, 255, THRESH_BINARY);
+ threshold(gray0, gray, (l+1)*255/N, 255, THRESH_BINARY);
}
// find contours and store them all as a list
@@ -80,7 +75,7 @@ static void findSquares( const UMat& image, vector >& squares )
// approximate contour with accuracy proportional
// to the contour perimeter
- approxPolyDP(Mat(contours[i]), approx, arcLength(Mat(contours[i]), true)*0.02, true);
+ approxPolyDP(contours[i], approx, arcLength(contours[i], true)*0.02, true);
// square contours should have 4 vertices after approximation
// relatively large area (to filter out noisy contours)
@@ -89,8 +84,8 @@ static void findSquares( const UMat& image, vector >& squares )
// area may be positive or negative - in accordance with the
// contour orientation
if( approx.size() == 4 &&
- fabs(contourArea(Mat(approx))) > 1000 &&
- isContourConvex(Mat(approx)) )
+ fabs(contourArea(approx)) > 1000 &&
+ isContourConvex(approx) )
{
double maxCosine = 0;
@@ -150,7 +145,7 @@ int main(int argc, char** argv)
if(cmd.has("help"))
{
- cout << "Usage : squares [options]" << endl;
+ cout << "Usage : " << argv[0] << " [options]" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return EXIT_SUCCESS;
@@ -158,7 +153,7 @@ int main(int argc, char** argv)
if (cmd.has("cpu_mode"))
{
ocl::setUseOpenCL(false);
- std::cout << "OpenCL was disabled" << std::endl;
+ cout << "OpenCL was disabled" << endl;
}
string inputName = cmd.get("i");
@@ -185,11 +180,11 @@ int main(int argc, char** argv)
do
{
- int64 t_start = cv::getTickCount();
+ int64 t_start = getTickCount();
findSquares(image, squares);
t_cpp += cv::getTickCount() - t_start;
- t_start = cv::getTickCount();
+ t_start = getTickCount();
cout << "run loop: " << j << endl;
}