Description
System information (version)
- OpenCV => 4.5.3-dev
- Operating System / Platform => Ubuntu 64-bit 20.04
- Compiler => gcc 11.2.0, nvcc w/ CUDA 11.4
Detailed description
While implementing a CUDA-enabled version of my program, I realized that the patchSize parameter for ORB is limited to a maximum of 59 when using the CUDA-enabled ORB algorithm. No such restriction exists in the CPU version of the algorithm. When I try to use a value of 60 or above, I get:
cv2.error: OpenCV(4.5.3-dev) /home/<redacted>/opencv_contrib/modules/cudafeatures2d/src/orb.cpp:535: error: (-215:Assertion failed) u_max.size() < 32 in function 'ORB_Impl'
However, no such error occurs for the CPU version, for values of this parameter at least up to 255.
My use case is such that a very high patchSize parameter is beneficial to the quality of matches I obtain. I am matching images of the same scene, taken from the same angle, so having a very high patchSize parameter helps to avoid false positive matches, such as similar, but incorrect, corners of windows matching by integrating information from further out into the descriptors.
Steps to reproduce
In Python3, with OpenCV compiled from source with CUDA support.
import cv2 as cv
cv.cuda_ORB.create(patchSize=60)
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc