Merge branch 4.x
@@ -2,7 +2,7 @@
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@prev_tutorial{tutorial_dnn_halide_scheduling}
|
||||
@prev_tutorial{tutorial_dnn_openvino}
|
||||
@next_tutorial{tutorial_dnn_yolo}
|
||||
|
||||
| | |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@tableofcontents
|
||||
|
||||
@prev_tutorial{tutorial_dnn_halide}
|
||||
@next_tutorial{tutorial_dnn_android}
|
||||
@next_tutorial{tutorial_dnn_openvino}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
OpenCV usage with OpenVINO {#tutorial_dnn_openvino}
|
||||
=====================
|
||||
|
||||
@prev_tutorial{tutorial_dnn_halide_scheduling}
|
||||
@next_tutorial{tutorial_dnn_android}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Aleksandr Voron |
|
||||
| Compatibility | OpenCV == 4.x |
|
||||
|
||||
This tutorial provides OpenCV installation guidelines how to use OpenCV with OpenVINO.
|
||||
|
||||
Since 2021.1.1 release OpenVINO does not provide pre-built OpenCV.
|
||||
The change does not affect you if you are using OpenVINO runtime directly or OpenVINO samples: it does not have a strong dependency to OpenCV.
|
||||
However, if you are using Open Model Zoo demos or OpenVINO runtime as OpenCV DNN backend you need to get the OpenCV build.
|
||||
|
||||
There are 2 approaches how to get OpenCV:
|
||||
|
||||
- Install pre-built OpenCV from another sources: system repositories, pip, conda, homebrew. Generic pre-built OpenCV package may have several limitations:
|
||||
- OpenCV version may be out-of-date
|
||||
- OpenCV may not contain G-API module with enabled OpenVINO support (e.g. some OMZ demos use G-API functionality)
|
||||
- OpenCV may not be optimized for modern hardware (default builds need to cover wide range of hardware)
|
||||
- OpenCV may not support Intel TBB, Intel Media SDK
|
||||
- OpenCV DNN module may not use OpenVINO as an inference backend
|
||||
- Build OpenCV from source code against specific version of OpenVINO. This approach solves the limitations mentioned above.
|
||||
|
||||
The instruction how to follow both approaches is provided in [OpenCV wiki](https://github.com/opencv/opencv/wiki/BuildOpenCV4OpenVINO).
|
||||
@@ -4,6 +4,7 @@ Deep Neural Networks (dnn module) {#tutorial_table_of_content_dnn}
|
||||
- @subpage tutorial_dnn_googlenet
|
||||
- @subpage tutorial_dnn_halide
|
||||
- @subpage tutorial_dnn_halide_scheduling
|
||||
- @subpage tutorial_dnn_openvino
|
||||
- @subpage tutorial_dnn_android
|
||||
- @subpage tutorial_dnn_yolo
|
||||
- @subpage tutorial_dnn_javascript
|
||||
|
||||
@@ -418,10 +418,18 @@ homography from camera displacement:
|
||||
|
||||
The homography matrices are similar. If we compare the image 1 warped using both homography matrices:
|
||||
|
||||

|
||||

|
||||
|
||||
Visually, it is hard to distinguish a difference between the result image from the homography computed from the camera displacement and the one estimated with @ref cv::findHomography function.
|
||||
|
||||
#### Exercise
|
||||
|
||||
This demo shows you how to compute the homography transformation from two camera poses. Try to perform the same operations, but by computing N inter homography this time. Instead of computing one homography to directly warp the source image to the desired camera viewpoint, perform N warping operations to see the different transformations operating.
|
||||
|
||||
You should get something similar to the following:
|
||||
|
||||

|
||||
|
||||
### Demo 4: Decompose the homography matrix {#tutorial_homography_Demo4}
|
||||
|
||||
OpenCV 3 contains the function @ref cv::decomposeHomographyMat which allows to decompose the homography matrix to a set of rotations, translations and plane normals.
|
||||
|
||||
|
After Width: | Height: | Size: 78 KiB |
@@ -0,0 +1,26 @@
|
||||
Using DepthAI Hardware / OAK depth sensors {#tutorial_gapi_oak_devices}
|
||||
=======================================================================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@prev_tutorial{tutorial_gapi_face_beautification}
|
||||
|
||||

|
||||
|
||||
Depth sensors compatible with Luxonis DepthAI library are supported through OpenCV Graph API (or G-API) module. RGB image and some other formats of output can be retrieved by using familiar interface of G-API module.
|
||||
|
||||
In order to use DepthAI sensor with OpenCV you should do the following preliminary steps:
|
||||
-# Install Luxonis DepthAI library [depthai-core](https://github.com/luxonis/depthai-core).
|
||||
|
||||
-# Configure OpenCV with DepthAI library support by setting `WITH_OAK` flag in CMake. If DepthAI library is found in install folders OpenCV will be built with depthai-core (see a status `WITH_OAK` in CMake log).
|
||||
|
||||
-# Build OpenCV.
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
You can find source code how to process heterogeneous graphs in the `modules/gapi/samples/oak_basic_infer.cpp` of the OpenCV source code library.
|
||||
|
||||
@add_toggle_cpp
|
||||
@include modules/gapi/samples/oak_basic_infer.cpp
|
||||
@end_toggle
|
||||
|
After Width: | Height: | Size: 160 KiB |
@@ -40,3 +40,14 @@ how G-API module can be used for that.
|
||||
|
||||
In this tutorial we build a complex hybrid Computer Vision/Deep
|
||||
Learning video processing pipeline with G-API.
|
||||
|
||||
|
||||
- @subpage tutorial_gapi_oak_devices
|
||||
|
||||
*Languages:* C++
|
||||
|
||||
*Compatibility:* \> OpenCV 4.6
|
||||
|
||||
*Author:* Alessandro de Oliveira Faria (A.K.A. CABELO)
|
||||
|
||||
In this tutorial we showed how to use the Luxonis DepthAI library with G-API.
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
Object detection with Generalized Ballard and Guil Hough Transform {#tutorial_generalized_hough_ballard_guil}
|
||||
==================================================================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@prev_tutorial{tutorial_hough_circle}
|
||||
@next_tutorial{tutorial_remap}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
| Original author | Markus Heck |
|
||||
| Compatibility | OpenCV >= 3.4 |
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
In this tutorial you will learn how to:
|
||||
|
||||
- Use @ref cv::GeneralizedHoughBallard and @ref cv::GeneralizedHoughGuil to detect an object
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
### What does this program do?
|
||||
|
||||
1. Load the image and template
|
||||
|
||||

|
||||

|
||||
|
||||
2. Instantiate @ref cv::GeneralizedHoughBallard with the help of `createGeneralizedHoughBallard()`
|
||||
3. Instantiate @ref cv::GeneralizedHoughGuil with the help of `createGeneralizedHoughGuil()`
|
||||
4. Set the required parameters for both GeneralizedHough variants
|
||||
5. Detect and show found results
|
||||
|
||||
@note
|
||||
- Both variants can't be instantiated directly. Using the create methods is required.
|
||||
- Guil Hough is very slow. Calculating the results for the "mini" files used in this tutorial
|
||||
takes only a few seconds. With image and template in a higher resolution, as shown below,
|
||||
my notebook requires about 5 minutes to calculate a result.
|
||||
|
||||

|
||||

|
||||
|
||||
### Code
|
||||
|
||||
The complete code for this tutorial is shown below.
|
||||
@include samples/cpp/tutorial_code/ImgTrans/generalizedHoughTransform.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
### Load image, template and setup variables
|
||||
|
||||
@snippet samples/cpp/tutorial_code/ImgTrans/generalizedHoughTransform.cpp generalized-hough-transform-load-and-setup
|
||||
|
||||
The position vectors will contain the matches the detectors will find.
|
||||
Every entry contains four floating point values:
|
||||
position vector
|
||||
|
||||
- *[0]*: x coordinate of center point
|
||||
- *[1]*: y coordinate of center point
|
||||
- *[2]*: scale of detected object compared to template
|
||||
- *[3]*: rotation of detected object in degree in relation to template
|
||||
|
||||
An example could look as follows: `[200, 100, 0.9, 120]`
|
||||
|
||||
### Setup parameters
|
||||
|
||||
@snippet samples/cpp/tutorial_code/ImgTrans/generalizedHoughTransform.cpp generalized-hough-transform-setup-parameters
|
||||
|
||||
Finding the optimal values can end up in trial and error and depends on many factors, such as the image resolution.
|
||||
|
||||
### Run detection
|
||||
|
||||
@snippet samples/cpp/tutorial_code/ImgTrans/generalizedHoughTransform.cpp generalized-hough-transform-run
|
||||
|
||||
As mentioned above, this step will take some time, especially with larger images and when using Guil.
|
||||
|
||||
### Draw results and show image
|
||||
|
||||
@snippet samples/cpp/tutorial_code/ImgTrans/generalizedHoughTransform.cpp generalized-hough-transform-draw-results
|
||||
|
||||
Result
|
||||
------
|
||||
|
||||

|
||||
|
||||
The blue rectangle shows the result of @ref cv::GeneralizedHoughBallard and the green rectangles the results of @ref
|
||||
cv::GeneralizedHoughGuil.
|
||||
|
||||
Getting perfect results like in this example is unlikely if the parameters are not perfectly adapted to the sample.
|
||||
An example with less perfect parameters is shown below.
|
||||
For the Ballard variant, only the center of the result is marked as a black dot on this image. The rectangle would be
|
||||
the same as on the previous image.
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 42 KiB |
@@ -4,7 +4,7 @@ Hough Circle Transform {#tutorial_hough_circle}
|
||||
@tableofcontents
|
||||
|
||||
@prev_tutorial{tutorial_hough_lines}
|
||||
@next_tutorial{tutorial_remap}
|
||||
@next_tutorial{tutorial_generalized_hough_ballard_guil}
|
||||
|
||||
| | |
|
||||
| -: | :- |
|
||||
|
||||
@@ -3,7 +3,7 @@ Remapping {#tutorial_remap}
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@prev_tutorial{tutorial_hough_circle}
|
||||
@prev_tutorial{tutorial_generalized_hough_ballard_guil}
|
||||
@next_tutorial{tutorial_warp_affine}
|
||||
|
||||
| | |
|
||||
|
||||
@@ -23,6 +23,7 @@ Transformations
|
||||
- @subpage tutorial_canny_detector
|
||||
- @subpage tutorial_hough_lines
|
||||
- @subpage tutorial_hough_circle
|
||||
- @subpage tutorial_generalized_hough_ballard_guil
|
||||
- @subpage tutorial_remap
|
||||
- @subpage tutorial_warp_affine
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ Installation by Using the Pre-built Libraries {#tutorial_windows_install_prebuil
|
||||
=============================================
|
||||
|
||||
-# Launch a web browser of choice and go to our [page on
|
||||
Sourceforge](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/).
|
||||
Sourceforge](http://sourceforge.net/projects/opencvlibrary/files/).
|
||||
-# Choose a build you want to use and download it.
|
||||
-# Make sure you have admin rights. Unpack the self-extracting archive.
|
||||
-# You can check the installation at the chosen path as you can see below.
|
||||
@@ -370,18 +370,18 @@ Set the OpenCV environment variable and add it to the systems path {#tutorial_wi
|
||||
First, we set an environment variable to make our work easier. This will hold the build directory of
|
||||
our OpenCV library that we use in our projects. Start up a command window and enter:
|
||||
@code
|
||||
setx -m OPENCV_DIR D:\OpenCV\Build\x86\vc11 (suggested for Visual Studio 2012 - 32 bit Windows)
|
||||
setx -m OPENCV_DIR D:\OpenCV\Build\x64\vc11 (suggested for Visual Studio 2012 - 64 bit Windows)
|
||||
setx OpenCV_DIR D:\OpenCV\build\x64\vc14 (suggested for Visual Studio 2015 - 64 bit Windows)
|
||||
setx OpenCV_DIR D:\OpenCV\build\x86\vc14 (suggested for Visual Studio 2015 - 32 bit Windows)
|
||||
|
||||
setx -m OPENCV_DIR D:\OpenCV\Build\x86\vc12 (suggested for Visual Studio 2013 - 32 bit Windows)
|
||||
setx -m OPENCV_DIR D:\OpenCV\Build\x64\vc12 (suggested for Visual Studio 2013 - 64 bit Windows)
|
||||
setx OpenCV_DIR D:\OpenCV\build\x64\vc15 (suggested for Visual Studio 2017 - 64 bit Windows)
|
||||
setx OpenCV_DIR D:\OpenCV\build\x86\vc15 (suggested for Visual Studio 2017 - 32 bit Windows)
|
||||
|
||||
setx -m OPENCV_DIR D:\OpenCV\Build\x64\vc14 (suggested for Visual Studio 2015 - 64 bit Windows)
|
||||
setx OpenCV_DIR D:\OpenCV\build\x64\vc16 (suggested for Visual Studio 2019 - 64 bit Windows)
|
||||
setx OpenCV_DIR D:\OpenCV\build\x86\vc16 (suggested for Visual Studio 2019 - 32 bit Windows)
|
||||
@endcode
|
||||
Here the directory is where you have your OpenCV binaries (*extracted* or *built*). You can have
|
||||
different platform (e.g. x64 instead of x86) or compiler type, so substitute appropriate value.
|
||||
Inside this, you should have two folders called *lib* and *bin*. The -m should be added if you wish
|
||||
to make the settings computer wise, instead of user wise.
|
||||
Inside this, you should have two folders called *lib* and *bin*.
|
||||
|
||||
If you built static libraries then you are done. Otherwise, you need to add the *bin* folders path
|
||||
to the systems path. This is because you will use the OpenCV library in form of *"Dynamic-link
|
||||
|
||||