1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #25042 from mshabunin:doc-upgrade

Documentation transition to fresh Doxygen #25042

* current Doxygen version is 1.10, but we will use 1.9.8 for now due to issue with snippets (https://github.com/doxygen/doxygen/pull/10584)
* Doxyfile adapted to new version
* MathJax updated to 3.x
* `@relates` instructions removed temporarily due to issue in Doxygen (to avoid warnings)
* refactored matx.hpp - extracted matx.inl.hpp
* opencv_contrib - https://github.com/opencv/opencv_contrib/pull/3638
This commit is contained in:
Maksim Shabunin
2024-03-05 16:19:45 +03:00
committed by GitHub
parent 0f5792a7a1
commit bf06e3d09f
49 changed files with 1764 additions and 1658 deletions
@@ -78,7 +78,7 @@ You can also download it from
Explanation
-----------
#### Declare the variables
### Declare the variables
First we declare the variables we are going to use:
@@ -97,7 +97,7 @@ First we declare the variables we are going to use:
Especial attention deserves the variable *rng* which is a random number generator. We use it to
generate the random border color, as we will see soon.
#### Load an image
### Load an image
As usual we load our source image *src*:
@@ -113,7 +113,7 @@ As usual we load our source image *src*:
@snippet python/tutorial_code/ImgTrans/MakeBorder/copy_make_border.py load
@end_toggle
#### Create a window
### Create a window
After giving a short intro of how to use the program, we create a window:
@@ -129,7 +129,7 @@ After giving a short intro of how to use the program, we create a window:
@snippet python/tutorial_code/ImgTrans/MakeBorder/copy_make_border.py create_window
@end_toggle
#### Initialize arguments
### Initialize arguments
Now we initialize the argument that defines the size of the borders (*top*, *bottom*, *left* and
*right*). We give them a value of 5% the size of *src*.
@@ -146,7 +146,7 @@ Now we initialize the argument that defines the size of the borders (*top*, *bot
@snippet python/tutorial_code/ImgTrans/MakeBorder/copy_make_border.py init_arguments
@end_toggle
#### Loop
### Loop
The program runs in an infinite loop while the key **ESC** isn't pressed.
If the user presses '**c**' or '**r**', the *borderType* variable
@@ -164,7 +164,7 @@ takes the value of *BORDER_CONSTANT* or *BORDER_REPLICATE* respectively:
@snippet python/tutorial_code/ImgTrans/MakeBorder/copy_make_border.py check_keypress
@end_toggle
#### Random color
### Random color
In each iteration (after 0.5 seconds), the random border color (*value*) is updated...
@@ -182,7 +182,7 @@ In each iteration (after 0.5 seconds), the random border color (*value*) is upda
This value is a set of three numbers picked randomly in the range \f$[0,255]\f$.
#### Form a border around the image
### Form a border around the image
Finally, we call the function **copyMakeBorder()** to apply the respective padding:
@@ -209,7 +209,7 @@ Finally, we call the function **copyMakeBorder()** to apply the respective paddi
-# *value*: If *borderType* is *BORDER_CONSTANT*, this is the value used to fill the border
pixels.
#### Display the results
### Display the results
We display our output image in the image created previously
@@ -94,7 +94,7 @@ You can also download it from
Explanation
-----------
#### Load an image
### Load an image
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/filter2D_demo.cpp load
@@ -108,7 +108,7 @@ Explanation
@snippet python/tutorial_code/ImgTrans/Filter2D/filter2D.py load
@end_toggle
#### Initialize the arguments
### Initialize the arguments
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/filter2D_demo.cpp init_arguments
@@ -122,7 +122,7 @@ Explanation
@snippet python/tutorial_code/ImgTrans/Filter2D/filter2D.py init_arguments
@end_toggle
##### Loop
### Loop
Perform an infinite loop updating the kernel size and applying our linear filter to the input
image. Let's analyze that more in detail:
@@ -74,7 +74,7 @@ Explanation
The image we used can be found [here](https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/smarties.png)
#### Load an image:
### Load an image:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp load
@@ -88,7 +88,7 @@ The image we used can be found [here](https://raw.githubusercontent.com/opencv/o
@snippet samples/python/tutorial_code/ImgTrans/HoughCircle/hough_circle.py load
@end_toggle
#### Convert it to grayscale:
### Convert it to grayscale:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp convert_to_gray
@@ -102,7 +102,7 @@ The image we used can be found [here](https://raw.githubusercontent.com/opencv/o
@snippet samples/python/tutorial_code/ImgTrans/HoughCircle/hough_circle.py convert_to_gray
@end_toggle
#### Apply a Median blur to reduce noise and avoid false circle detection:
### Apply a Median blur to reduce noise and avoid false circle detection:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp reduce_noise
@@ -116,7 +116,7 @@ The image we used can be found [here](https://raw.githubusercontent.com/opencv/o
@snippet samples/python/tutorial_code/ImgTrans/HoughCircle/hough_circle.py reduce_noise
@end_toggle
#### Proceed to apply Hough Circle Transform:
### Proceed to apply Hough Circle Transform:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp houghcircles
@@ -144,7 +144,7 @@ The image we used can be found [here](https://raw.githubusercontent.com/opencv/o
- *min_radius = 0*: Minimum radius to be detected. If unknown, put zero as default.
- *max_radius = 0*: Maximum radius to be detected. If unknown, put zero as default.
#### Draw the detected circles:
### Draw the detected circles:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp draw
@@ -160,7 +160,7 @@ The image we used can be found [here](https://raw.githubusercontent.com/opencv/o
You can see that we will draw the circle(s) on red and the center(s) with a small green dot
#### Display the detected circle(s) and wait for the user to exit the program:
### Display the detected circle(s) and wait for the user to exit the program:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp display
@@ -129,7 +129,7 @@ The sample code that we will explain can be downloaded from
Explanation
-----------
#### Load an image:
### Load an image:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghlines.cpp load
@@ -143,7 +143,7 @@ Explanation
@snippet samples/python/tutorial_code/ImgTrans/HoughLine/hough_lines.py load
@end_toggle
#### Detect the edges of the image by using a Canny detector:
### Detect the edges of the image by using a Canny detector:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghlines.cpp edge_detection
@@ -160,7 +160,7 @@ Explanation
Now we will apply the Hough Line Transform. We will explain how to use both OpenCV functions
available for this purpose.
#### Standard Hough Line Transform:
### Standard Hough Line Transform:
First, you apply the Transform:
@add_toggle_cpp
@@ -199,7 +199,7 @@ And then you display the result by drawing the lines.
@snippet samples/python/tutorial_code/ImgTrans/HoughLine/hough_lines.py draw_lines
@end_toggle
#### Probabilistic Hough Line Transform
### Probabilistic Hough Line Transform
First you apply the transform:
@add_toggle_cpp
@@ -242,7 +242,7 @@ And then you display the result by drawing the lines.
@snippet samples/python/tutorial_code/ImgTrans/HoughLine/hough_lines.py draw_lines_p
@end_toggle
#### Display the original image and the detected lines:
### Display the original image and the detected lines:
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghlines.cpp imshow
@@ -256,7 +256,7 @@ And then you display the result by drawing the lines.
@snippet samples/python/tutorial_code/ImgTrans/HoughLine/hough_lines.py imshow
@end_toggle
#### Wait until the user exits the program
### Wait until the user exits the program
@add_toggle_cpp
@snippet samples/cpp/tutorial_code/ImgTrans/houghlines.cpp exit
@@ -81,7 +81,7 @@ Code
Explanation
-----------
#### Declare variables
### Declare variables
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp variables
@@ -95,7 +95,7 @@ Explanation
@snippet samples/python/tutorial_code/ImgTrans/LaPlace/laplace_demo.py variables
@end_toggle
#### Load source image
### Load source image
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp load
@@ -109,7 +109,7 @@ Explanation
@snippet samples/python/tutorial_code/ImgTrans/LaPlace/laplace_demo.py load
@end_toggle
#### Reduce noise
### Reduce noise
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp reduce_noise
@@ -123,7 +123,7 @@ Explanation
@snippet samples/python/tutorial_code/ImgTrans/LaPlace/laplace_demo.py reduce_noise
@end_toggle
#### Grayscale
### Grayscale
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp convert_to_gray
@@ -137,7 +137,7 @@ Explanation
@snippet samples/python/tutorial_code/ImgTrans/LaPlace/laplace_demo.py convert_to_gray
@end_toggle
#### Laplacian operator
### Laplacian operator
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp laplacian
@@ -160,7 +160,7 @@ Explanation
this example.
- *scale*, *delta* and *BORDER_DEFAULT*: We leave them as default values.
#### Convert output to a *CV_8U* image
### Convert output to a *CV_8U* image
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp convert
@@ -174,7 +174,7 @@ Explanation
@snippet samples/python/tutorial_code/ImgTrans/LaPlace/laplace_demo.py convert
@end_toggle
#### Display the result
### Display the result
@add_toggle_cpp
@snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp display
@@ -58,7 +58,7 @@ Theory
gradient of an image intensity function.
-# The Sobel Operator combines Gaussian smoothing and differentiation.
#### Formulation
### Formulation
Assuming that the image to be operated is \f$I\f$:
@@ -140,23 +140,23 @@ You can also download it from
Explanation
-----------
#### Declare variables
### Declare variables
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp variables
#### Load source image
### Load source image
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp load
#### Reduce noise
### Reduce noise
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp reduce_noise
#### Grayscale
### Grayscale
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp convert_to_gray
#### Sobel Operator
### Sobel Operator
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp sobel
@@ -174,18 +174,18 @@ Explanation
Notice that to calculate the gradient in *x* direction we use: \f$x_{order}= 1\f$ and
\f$y_{order} = 0\f$. We do analogously for the *y* direction.
#### Convert output to a CV_8U image
### Convert output to a CV_8U image
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp convert
#### Gradient
### Gradient
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp blend
We try to approximate the *gradient* by adding both directional gradients (note that
this is not an exact calculation at all! but it is good for our purposes).
#### Show results
### Show results
@snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp display