1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2024-08-27 18:31:36 +03:00
108 changed files with 1241 additions and 646 deletions
@@ -21,15 +21,22 @@ In this tutorial you will learn how to:
- Draw a **circle** by using the OpenCV function **circle()**
- Draw a **filled polygon** by using the OpenCV function **fillPoly()**
@add_toggle_cpp
OpenCV Theory
-------------
@add_toggle_cpp
For this tutorial, we will heavily use two structures: @ref cv::Point and @ref cv::Scalar :
@end_toggle
@add_toggle_java
For this tutorial, we will heavily use two structures: @ref cv::Point and @ref cv::Scalar :
@end_toggle
@add_toggle_python
For this tutorial, we will heavily use tuples in Python instead of @ref cv::Point and @ref cv::Scalar :
@end_toggle
### Point
It represents a 2D point, specified by its image coordinates \f$x\f$ and \f$y\f$. We can define it as:
@add_toggle_cpp
@code{.cpp}
Point pt;
pt.x = 10;
@@ -39,28 +46,8 @@ or
@code{.cpp}
Point pt = Point(10, 8);
@endcode
### Scalar
- Represents a 4-element vector. The type Scalar is widely used in OpenCV for passing pixel
values.
- In this tutorial, we will use it extensively to represent BGR color values (3 parameters). It is
not necessary to define the last argument if it is not going to be used.
- Let's see an example, if we are asked for a color argument and we give:
@code{.cpp}
Scalar( a, b, c )
@endcode
We would be defining a BGR color such as: *Blue = a*, *Green = b* and *Red = c*
@end_toggle
@add_toggle_java
OpenCV Theory
-------------
For this tutorial, we will heavily use two structures: @ref cv::Point and @ref cv::Scalar :
### Point
It represents a 2D point, specified by its image coordinates \f$x\f$ and \f$y\f$. We can define it as:
@code{.java}
Point pt = new Point();
pt.x = 10;
@@ -70,6 +57,12 @@ or
@code{.java}
Point pt = new Point(10, 8);
@endcode
@end_toggle
@add_toggle_python
@code{.python}
pt = (10, 0) # x = 10, y = 0
@endcode
@end_toggle
### Scalar
- Represents a 4-element vector. The type Scalar is widely used in OpenCV for passing pixel
@@ -77,11 +70,22 @@ Point pt = new Point(10, 8);
- In this tutorial, we will use it extensively to represent BGR color values (3 parameters). It is
not necessary to define the last argument if it is not going to be used.
- Let's see an example, if we are asked for a color argument and we give:
@add_toggle_cpp
@code{.cpp}
Scalar( a, b, c )
@endcode
@end_toggle
@add_toggle_java
@code{.java}
Scalar( a, b, c )
@endcode
We would be defining a BGR color such as: *Blue = a*, *Green = b* and *Red = c*
@end_toggle
@add_toggle_python
@code{.python}
( a, b, c )
@endcode
@end_toggle
We would be defining a BGR color such as: *Blue = a*, *Green = b* and *Red = c*
Code
----
@@ -393,7 +393,7 @@ There are multiple less popular frameworks which can be used to read and write v
| Option | Default | Description |
| ------ | ------- | ----------- |
| `WITH_1394` | _ON_ | [IIDC IEEE1394](https://en.wikipedia.org/wiki/IEEE_1394#IIDC) support using DC1394 library |
| `WITH_1394` | _OFF_ | [IIDC IEEE1394](https://en.wikipedia.org/wiki/IEEE_1394#IIDC) support using DC1394 library |
| `WITH_OPENNI` | _OFF_ | [OpenNI](https://en.wikipedia.org/wiki/OpenNI) can be used to capture data from depth-sensing cameras. Deprecated. |
| `WITH_OPENNI2` | _OFF_ | [OpenNI2](https://structure.io/openni) can be used to capture data from depth-sensing cameras. |
| `WITH_PVAPI` | _OFF_ | [PVAPI](https://www.alliedvision.com/en/support/software-downloads.html) is legacy SDK for Prosilica GigE cameras. Deprecated. |
@@ -455,6 +455,8 @@ OpenCV relies on various GUI libraries for window drawing.
| `WITH_WIN32UI` | _ON_ | Windows | [WinAPI](https://en.wikipedia.org/wiki/Windows_API) is a standard GUI API in Windows. |
| N/A | _ON_ | macOS | [Cocoa](https://en.wikipedia.org/wiki/Cocoa_(API)) is a framework used in macOS. |
| `WITH_QT` | _OFF_ | Cross-platform | [Qt](https://en.wikipedia.org/wiki/Qt_(software)) is a cross-platform GUI framework. |
| `WITH_FRAMEBUFFER` | _OFF_ | Linux | Experimental backend using [Linux framebuffer](https://en.wikipedia.org/wiki/Linux_framebuffer). Have limited functionality but does not require dependencies. |
| `WITH_FRAMEBUFFER_XVFB` | _OFF_ | Linux | Enables special output mode of the FRAMEBUFFER backend compatible with [xvfb](https://en.wikipedia.org/wiki/Xvfb) tool. Requires some X11 headers. |
@note OpenCV compiled with Qt support enables advanced _highgui_ interface, see @ref highgui_qt for details.
@@ -329,6 +329,9 @@ Some external dependencies can be detached into a dynamic library, which will be
|------|------|---------|-------------|
| OPENCV_LEGACY_WAITKEY | non-null | | switch `waitKey` return result (default behavior: `return code & 0xff` (or -1), legacy behavior: `return code`) |
| $XDG_RUNTIME_DIR | | | Wayland backend specific - create shared memory-mapped file for interprocess communication (named `opencv-shared-??????`) |
| OPENCV_HIGHGUI_FB_MODE | string | `FB` | Selects output mode for the framebuffer backend (`FB` - regular frambuffer, `EMU` - emulation, perform internal checks but does nothing, `XVFB` - compatible with _xvfb_ virtual frambuffer) |
| OPENCV_HIGHGUI_FB_DEVICE | file path | | Path to frambuffer device to use (will be checked first) |
| FRAMEBUFFER | file path | `/dev/fb0` | Same as OPENCV_HIGHGUI_FB_DEVICE, commonly used variable for the same purpose (will be checked second) |
## imgproc
+20 -2
View File
@@ -23,18 +23,36 @@ In this tutorial you will learn how to:
Code
----
@add_toggle_cpp
This tutorial's code is shown in the lines below. You can download it from [here](https://github.com/opencv/opencv/tree/5.x/samples/cpp/stitching.cpp).
This tutorial code's is shown lines below. You can also download it from
[here](https://github.com/opencv/opencv/tree/5.x/samples/cpp/stitching.cpp).
Note: The C++ version includes additional options such as image division (--d3) and more detailed error handling, which are not present in the Python example.
@include samples/cpp/snippets/stitching.cpp
@end_toggle
@add_toggle_python
This tutorial's code is shown in the lines below. You can download it from [here](https://github.com/opencv/opencv/blob/5.x/samples/python/stitching.py).
Note: The C++ version includes additional options such as image division (--d3) and more detailed error handling, which are not present in the Python example.
@include samples/python/snippets/stitching.py
@end_toggle
Explanation
-----------
The most important code part is:
@add_toggle_cpp
@snippet cpp/snippets/stitching.cpp stitching
@end_toggle
@add_toggle_python
@snippet python/snippets/stitching.py stitching
@end_toggle
A new instance of stitcher is created and the @ref cv::Stitcher::stitch will
do all the hard work.