Repository: opencv
Issue: CUDA Python binding DescriptorMatcher_createBFMatcher  issue with knnMatchConvert
Labels: category: python bindings,category: gpu/cuda (contrib)

##### System information (version)
OpenCV => 4.5.2-dev
Operating System / Platform => Ubuntu 18.04
Compiler => cmake/clang

##### Detailed description

There is a Python binding:
```
cv2.cuda.DescriptorMatcher_createBFMatcher
```
for original:
```
cuda::DescriptorMatcher::createBFMatcher
```
This class has `cv2.cuda.DescriptorMatcher_createBFMatcher.knnMatchAsync` method
which returns matches on GPU. To retrieve them according to docs we need to call `knnMatchConvert`
```
matches_gpu = matcherGPU.knnMatchAsync(gpu_des1, gpu_des2, k=2, stream=gpu_stream)
gpu_stream.waitForCompletion()
matches_cpu = [] # I assume it expects empty list following C++ logic with std::vector
matcherGPU.knnMatchConvert(matches_gpu, matches_cpu)
```
however, `matches_cpu` doesn't get any `append()`s after that. It's empty. Blocking version `knnMatch` does return proper result.

I think it's a bug, bc all other similar bindings like `matchConvert` do return value, instead of requiring output list.


For example:
```
matchConvert(...)
 |      matchConvert(gpu_matches) -> matches
```
but
```
knnMatchConvert(...)
 |      knnMatchConvert(gpu_matches, matches[, compactResult]) -> None
```

##### Steps to reproduce
```.py
import cv2
# define img as any random image, doesn't matter
orbGPU = cv2.cuda.ORB_create()
matcherGPU = cv2.cuda.DescriptorMatcher_createBFMatcher(cv2.NORM_HAMMING)
gpu_stream = cv2.cuda_Stream()
gpu_img2 = cv2.cuda_GpuMat(img)
gpu_gray2 = cv2.cuda.cvtColor(gpu_img2, cv2.COLOR_BGR2GRAY, stream=gpu_stream)
gpu_kp2, gpu_des2 = orbGPU.detectAndComputeAsync(gpu_gray2, None, stream=gpu_stream)
matches_gpu = matcherGPU.knnMatchAsync(gpu_des2, gpu_des2, k=2, stream=gpu_stream)
gpu_stream.waitForCompletion()
matches_cpu = []
matcherGPU.knnMatchConvert(matches_gpu, matches_cpu) # nothing added to matches_cpu
```
I assume last function should return value instead of expecting output argument.


##### Issue submission checklist

 - [V] I report the issue, it's not a question
   <!--
   OpenCV team works with forum.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [V] I checked the problem with documentation, FAQ, open issues,
       forum.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://forum.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [V] 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.
   -->
 - [V] 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 archive 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/
   -->