Repository: opencv
Issue: OpenCV improve documentation of CUDA
Labels: category: documentation,category: gpu/cuda (contrib)

##### System information (version)
<!-- Example
- OpenCV => 4.3
- Operating System / Platform => Ubuntu 18.04
- Compiler => Visual Studio 2017
-->

- OpenCV => 4.3.0
- Operating System / Platform => Ubuntu 18.04
- Compiler => g++

##### Detailed description

OpenCV offers several CUDA enabled functions for accelerating computer vision. Unfortunately the documentation across the internet is wrong or mixed between multiple OpenCV versions (mixes between cv::cuda and cv::gpu). 
It would be beneficial to add a simple tutorial on how to use OpenCV cuda functions, it could be similar to this [one](https://docs.opencv.org/master/db/df5/tutorial_linux_gcc_cmake.html).

It could be added to the contrib tutorials [lists](https://docs.opencv.org/master/d3/d81/tutorial_contrib_root.html). The main motivation of this issue is to refresh the documentation, such as [this](https://opencv.org/platforms/cuda/) which is for OpenCV 3.

##### Steps to reproduce

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->

- Define the functionalities we want to showcase in this brief tutorial. The code snippet could be very similar to this one:

```.cpp
#include <iostream>
#include <ctime>
#include <cmath>

#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>

#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaarithm.hpp>
#include <opencv2/cudaimgproc.hpp>

#define TestCUDA true


int main() 
{

	try
       	{
		cv::String filename = "Oak_Tree.png";
		cv::Mat srcHost = cv::imread(filename, cv::IMREAD_GRAYSCALE);

		if(TestCUDA)
		{
			cv::cuda::GpuMat dst, src;
			src.upload(srcHost);

			cv::cuda::threshold(src, dst, 128.0, 255.0, cv::THRESH_BINARY);
			cv::cuda::bilateralFilter(dst, dst, 3, 1, 1);

			cv::Mat resultHost;
			dst.download(resultHost);
		 
		
			cv::imshow("Result",resultHost);
			cv::waitKey();
		}
	}
       	catch(const cv::Exception& ex)
       	{
		std::cout << "Error: " << ex.what() << std::endl;
	}

}
```

A CMakeLists.txt could be similar to this:

```.txt

cmake_minimum_required(VERSION 3.0)
project( opencvgpu )

find_package( OpenCV 4.3 REQUIRED)
find_package(CUDA REQUIRED)


include_directories( ${OpenCV_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} )
add_executable( DisplayImage DisplayImage.cpp )
target_link_libraries( DisplayImage ${OpenCV_LIBS} ${CUDA_LIBRARIES} )
```
- Prepare the tutorial and describe the presented codes.
- Revise it for OpenCV approval.
- Upload it in the webpage.


##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with answers.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       answers.opencv.org, Stack Overflow, etc and have not found solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://answers.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I updated to latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only latest release for each branch.
   The ticket is closed, if the problem is not reproduced with modern version.
   -->
 - [x] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as archite to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->