Ask Your Question

Ender Tunç's profile - activity

2016-05-14 11:11:27 -0600 commented question OpenCV 3.1 Cuda FAST algorithm

FastFeatureDetector->detetct gets GpuMat and vector of key points which is std::vector<cv::keypoint> d_keypoints; in your code. These key points are already downloaded from GPU to CPU you can use them directly. If you look at the code you can see that keypoints on the GPU are converted to CPU and what you get is these keypoints stored on CPU. code: https://github.com/Itseez/opencv/blob...</cv::keypoint>

2016-04-11 09:31:09 -0600 commented question Can not create cuda::ORB. Program Stucks

@Eduardo Now I can run the test. As you suggested I run opencv_test_cudaarithm and addition to that I also run opencv_test_cudafeatures2d. There some failed test I do not know why they failed. You can check the outputs: https://paste.ee/p/etqYj https://paste.ee/p/zQyUK (this one is very large it takes some time to open) In StackOverflow, they say some test may fail because of the missing images. They suggest put lena.png to bin folder so I did it. Do you have any idea what should I do next? Should I create bug report or my system is broken? Btw, thanks for you help again.

2016-04-11 01:46:52 -0600 commented question Can not create cuda::ORB. Program Stucks

@Eduardo thank you for help. This code takes 25 seconds on my machine. My partner tried it on his machine and it takes in 2-3 seconds. I have Nvidia 960M and latest driver 364.15 is installed on ubuntu 15.10. I do not know what else I can do. I want to try to run test but I do not know how. This is the code that I use for building OpenCV. What should I add to build tests too? How to run test? Maybe I should add these two -DBUILD_TESTS=ON -DINSTALL_TESTS=ON?

cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1  _DOPENCV_EXTRA_MODULES_PATH=/path ..
2016-04-05 09:49:34 -0600 commented question Can not create cuda::ORB. Program Stucks

@Eduardo to be sure can you please send me a piece of code to test? My old laptop has GPU problems but now I got a new one with Cuda 7.5, Nvidia drive 361 and Ubuntu 15.10.

2016-03-27 11:22:52 -0600 commented question Can not create cuda::ORB. Program Stucks

@Eduardo Thank you for your answer, It gives me some light at least. The image I am using is about 600x600. It seems I have an unknown problem. Do you have any idea what could be the problem? Hardware, software? I get same behaviour both Ubuntu and Windows with OpenCV 3.1..

2016-03-27 05:31:42 -0600 asked a question Can not create cuda::ORB. Program Stucks

Hi everyone,

I have a simple piece of code that uses both cv::ORB and Cuda:ORB. In my code, I can not use cv::Ptr<cuda::ORB> orb = cuda::ORB::create(); It stucks my program.

For example this is the code I am using; (I did not remove the unused .hpp files for this example because In my real program I need them too)

#include "opencv2/core/core.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/cudaarithm.hpp"
#include "opencv2/cudawarping.hpp"
#include "opencv2/cudafilters.hpp"
#include "opencv2/cudafeatures2d.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/cudaimgproc.hpp"
#include "opencv2/core/cuda.hpp"
#include "opencv2/xfeatures2d.hpp"
#include "opencv2/ximgproc.hpp"
#include <time.h>
#include <iostream>

using namespace cv;
using namespace std;


int main(int argc, char* argv[]) {


    Mat img1 = imread("amanda.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    Mat img2 = imread("amanda.jpg", CV_LOAD_IMAGE_GRAYSCALE);

    std::cout << "1 " << std::endl;

    cv::cuda::GpuMat img1_gpu, img2_gpu;
    img1_gpu.upload(img1);
    img2_gpu.upload(img2);

    std::cout << "2 " << std::endl;

    cv::Ptr<cuda::ORB> orb = cuda::ORB::create();


    cv::imshow("Show Image", img1);

    return 0;

}

To be sure what is going on here I put two print statement in my code. Above code just writes "1" to console and stuck. How is it possible? How did this program get stuck? How did print 1 and not 2?

If I change Cuda:ORB to cv:ORB everything is fine. If I put cv::Ptr<cuda::ORB> orb = Cuda::ORB::create(); beginning of the code, program prints nothing to console which is expected in my case.

Things get more interesting here. If I wait 30 seconds or more sometimes program does print 2. And If I use Cuda::ORB, it does the job. For a really small image, why it takes too much time to response?

Is this a bug? Should I open a bug report on Github?

For the ones who wants to test this can use this little piece of code. It makes me wait too much and sometimes never response:

    int main(int argc, char* argv[]) {

    std::cout << "1 " << std::endl;
    cv::Ptr<cuda::ORB> orb = cuda::ORB::create();
    std::cout << "2 " << std::endl;

    return 0;
}

Any comment or idea are appreciated.