Ask Your Question

Visidyn's profile - activity

2017-05-20 22:47:29 -0600 received badge  Notable Question (source)
2016-05-24 10:12:06 -0600 received badge  Student (source)
2016-02-10 03:48:11 -0600 received badge  Popular Question (source)
2013-06-17 14:29:18 -0600 asked a question (Revised Question) VC++ looking for SURF_GPU in opencv_gpu245d instead of opencv_nonfree245d

(I posted a much longer version of this question earlier but realized I did not need to include most of the information)

I am trying to build a simple program using SURF_GPU on OpenCV 2.4.5 using VC++ 2010. I am including opencv2/nonfree/gpu.hpp in my project and have all the libraries and dependencies set up on my project. In my program for testing purposes I only declare one object of type SURF_GPU, and the program compiles fine as it finds SURF_GPU in cv::gpu:: However, when I run the program, it gives me an error stating it can't find SURF_GPU in opencv_gpu245d.dll. How do I tell it to look for SURF_GPU in the nonfree dll instead? Thanks alot for your help.

2013-06-16 16:28:47 -0600 received badge  Editor (source)
2013-06-16 16:25:41 -0600 asked a question VC++ 2010 looking for SURF_GPU in wrong .dll

Hello, I am trying to write a homography program using the GPU functionality in VC++ 2010 on Windows 7. I have the most recent Nvidia drivers and CUDA 5.0. I am using this page as a reference for how to use the GPU to use SURF_GPU and how to find the keypoints and descriptors:

https://gist.github.com/yoggy/1451463

Here is what my code looks like so far (I have not written the findhomography functionality yet):

#include <iostream>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/nonfree/gpu.hpp>
#include "opencv2/gpu/gpu.hpp"
using namespace std;
using namespace cv;
using namespace gpu;

int main()
{
    Mat img; // The object the image will be loaded into
    VideoCapture cap(0); // The video object that will get the image from the webcam
    Mat frame; // The individual frame from the video
    Mat window; // Object that will serve as window

    GpuMat img_gpu, vid_gpu; // The image and video GPU objects
    GpuMat imgkey_gpu, vidkey_gpu; // The image and video GPU keyframe objects
    GpuMat imgdes_gpu, viddes_gpu; // The image and video GPu descriptors
    gpu::SURF_GPU surf; // Declares a surf object

    vector<cv::KeyPoint> imgkey_vec, vidkey_vec; // The vector for the image and video keypoints
    vector<float> imgdes_vec, viddes_vec; // The vector for the image and video descriptors
    vector<vector<cv::DMatch>> matches; // The vector for the matches

    img = imread("snapshot.jpg",CV_LOAD_IMAGE_GRAYSCALE); // Loads the image into the img object in b/w


    while (1)
    {
        cap >> frame; // Puts individual video frame into the 'frame' object

        img_gpu.upload(img);
        vid_gpu.upload(frame);

        surf(img_gpu, GpuMat(), imgkey_gpu, imgdes_gpu, false);
        surf(vid_gpu, GpuMat(), vidkey_gpu, viddes_gpu, false);

        surf.downloadKeypoints(imgkey_gpu, imgkey_vec);
        surf.downloadKeypoints(vidkey_gpu, vidkey_vec);
        surf.downloadDescriptors(imgdes_gpu, imgdes_vec);
        surf.downloadDescriptors(viddes_gpu, viddes_vec);

        BruteForceMatcher_GPU<cv::L2<float>> matcher;
        GpuMat trainIdx, distance;
        matcher.radiusMatch(imgkey_gpu, vidkey_gpu, matches, 0.1f);
        drawMatches(img, imgkey_vec, frame, vidkey_vec, matches, window);
        imshow("window",window);
        if (waitKey(30)>0)break;
    }
}

My program compiles fine, however, when I run it, I encounter this error:

image description

When I comment out the 'downloadDescriptors' function, I get the same error only with the 'downloadKeypoints' function. When I comment this out, I get the same error only with the SURF_GPU function. From my understanding the error indicates that it is looking for SURF_GPU in opencv_gpu245d.dll, while I know SURF_GPU has been relocated to nonfree245d.dll, which I have also included in the additional dependencies. If I remove the opencv_gpu245d.dll, it will break other functions. How do I tell VC++ to look for SURF_GPU in nonfree245d.dll? Is this even my problem?

Thanks for your help.

2013-06-15 21:31:17 -0600 asked a question SURF_GPU not in cv::gpu

Hello, I am having a problem where I am unable to use the SURF_GPU object as it states that SURF_GPU is undefined. However, I compiled OpenCV 2.4.5 including CUDA for VC++ and other GPU functions are functioning correctly so I'm not sure why it cannot locate it. Any help would be appreciated.