Is there a way to use opencv's estimatePoseSingleMarkers on NVIDIA GPU? - opencv

I am trying to estimate pose of a Aruco Marker using opencv library.
But the performance of the above Library is a bit slow since it runs on CPU.Is there a way so that I can run the above Library on GPU?
.
I tried researching in OpenCV's documentation, it has some cuda enabled functions but for aruco functions it is not available

Related

What platform to use for YOLO output when using AMD GPU?

long time tormented by this question, I ask your advice in what direction to move. Objective - to develop universal application with yolo on windows, which can use computing power of AMD/Nvidia/Intel GPU, AMD/Intel CPU (one of the devices will be used). As far as I know, the OpenCV DNN module is leading in CPU computation; a DNN + Cuda bundle is planned for Nvidia graphics cards and a DNN + OpenCL bundle is planned for Intel GPUs. But testing AMD GPU rx580 with DNN + OpenCL, I ran into the following problem: https://github.com/opencv/opencv/issues/17656. Does this module not support AMD GPU computing at all? If so, could you please let me know what platform this is possible on and, preferably, as efficiently as possible. A possible solution might be Tencent's ncnn, but I'm not sure of the performance on the desktop. By output I mean the coordinates of detected objects and their names (in opencv dnn module I got them with cv::dnn::Net::forward()). Also, correct me if I'm wrong somewhere. Any feedback would be appreciated.
I tried the OpenCV DNN + OpenCL module and expected high performance, but this combination does not work.
I believe OpenCV doesn't support AMD for GPU optimization. If you're interested in running DL models on non-Nvidia GPUs, I suggest reading PlaidML, YOLO-OpenCL, DeepCL

Are there any detectors which implemented on GPU and are scale/rotate-invariant?

As known in OpenCV 2.4.9.0 are these feature-detectors: SIFT, SURF, BRISK, FREAK, STAR, FAST, ORB.
http://docs.opencv.org/modules/features2d/doc/feature_detection_and_description.html
http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_feature_detectors.html
All of these have implementation on CPU, but only FAST and ORB on GPU. http://docs.opencv.org/genindex.html
And as known, some are scale/rotate-invariant, but some aren't: Are there any fast alternatives to SURF and SIFT for scale-invariant feature extraction?
These are scale-invariant and rotate-invariant:
SIFT
SURF
BRISK
FREAK
STAR
But these are not scale-invariant and not rotate-invariant:
FAST
ORB
Are there any detectors which implemented on GPU and are scale/rotate-invariant?
Or will be added in OpenCV 3.0 on GPU or OpenCL?
Actually, SURF is the only scale/rotate-invariant feature detector with GPU support in OpenCV.
In OpenCV 3.0 FAST and ORBhave got OCL support and moreover, these two (FAST and ORB) have already got CUDA support.
The OCL/CUDA support of SURF has been already mentioned in the comments of your question, but it is only a contribution to OpenCV and this is how OpenCV's developers about opencv_contrib:
New modules quite often do not have stable API, and they are not
well-tested. Thus, they shouldn't be released as a part of official
OpenCV distribution, since the library maintains binary compatibility,
and tries to provide decent performance and stability.
Based on my previous experiences OpenCV’s implementation of SURF features were much weaker than OpenSURF. It would be reasonable to try it, or find some other open source implementations.
p.s.:
to my knowledge still there is no GPU accelerated version of KAZE/AKAZE.
I recently implemented AKAZE using CUDA with a couple of colleagues, if you are familiar with the original library you should have no problem using it since we respected the API. You can find the current version here:
https://github.com/nbergst/akaze

CudaFy.net and OpenCV

I would like to use some of the OpenCV routines (2D convolve, Region Labeling, and Centroiding) in a CudaFy.net project.
Is this a stupid idea?
Would it be better just to implement the algorithms in C# from opensource examples?
Some of inputs to the OpenCV have will already be in global GPU memory, can you pass pointers to OpenCV GPU routines and say the matrix is already in the GPU?
Are there any simple examples of doing this
I did see one person who used EMGU and openCV but did run into some issues. Is there an example around of someone doing this successfully? [ https://cudafy.codeplex.com/discussions/356649 ]

Open CV feature detection in GPU

I'm using OpenCV 2.4.6 in a prototype of object detection and I was wondering in how to improve the feature detection/extraction performance. Someone knows if is it possible to run feature detection/extraction/matching, like SIFT/SIFT/BF, or even the findHomography, on GPU?
Tks
OpenCV GPU module contains implementations for FAST, ORB and SURF feature detectors/extractors and for BruteForceMatcher.
You can read more in documentation:
http://docs.opencv.org/2.4.6/modules/gpu/doc/feature_detection_and_description.html
http://docs.opencv.org/2.4.6/modules/nonfree/doc/feature_detection.html#gpu-surf-gpu

Image Processing on CUDA or OpenCV?

I need to develop an image processing program for my project in which I have to count the number of cars on the road. I am using GPU programming. Should I go for OpenCV program with GPU processing feature or should I develop my entire program on CUDA without any OpenCV library?
The algorithms which I am using for counting the number of cars is background subtraction, segmentation and edge detection.
You can use GPU functions in OpenCV.
First visit the introduction about this : http://docs.opencv.org/modules/gpu/doc/introduction.html
Secondly, I think above mentioned processes are already implemented in OpenCV optimized for GPU. So It will be much easier to develop with OpenCV.
Canny Edge Detection : http://docs.opencv.org/modules/gpu/doc/image_processing.html#gpu-canny
PerElement Operations (including subtraction): http://docs.opencv.org/modules/gpu/doc/per_element_operations.html#per-element-operations
For other functions, visit OpenCV docs.
OpenCV, no doubt, has the biggest collection of Image processing functionality and recently they've started porting functions to CUDA as well. There's a new GPU module in latest OpenCV with few functions ported to CUDA.
Being said that, OpenCV is not the best option to build a CUDA based application as there are many dedicated CUDA libraries like CUVI that beat OpenCV in Performance. If you're looking for an optimized solution, you should also give them a try.

Resources