Hi all,
I had trouble with using opencv c++ gpu module
The graphic card crashed and screen goes totally black for few seconds when code goes to gpu::meanShiftFiltering
And then error message shows up:
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
The following is my code:
#include <opencv2/opencv.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/gpu/gpu.hpp>
using namespace cv;
int main()
{
//image load
Mat img = imread("left01.bmp", CV_LOAD_IMAGE_COLOR);
Mat outimg2;
//gpu version meanshift
gpu::GpuMat pimgGpu, imgGpu, outImgGpu;
pimgGpu.upload(img);
//gpu meanshift only support 8uc4 type.
gpu::cvtColor(pimgGpu, imgGpu, CV_BGR2BGRA);
//program crashed at here
gpu::meanShiftFiltering(imgGpu, outImgGpu, 30, 30);
outImgGpu.download(outimg2);
//show image
imshow("origin", img);
imshow("MeanShift Filter gpu", outimg2);
waitKey(0);
return 0;
}
I have build opencv 2.4.9 myself
By first set cmake configuration to use compiler vc11(visual studio 2012)
And I check With_CUDA option and setup cuda root path for it before generation.
After that I build opencv with visual studio 2012 by click build on Project "All Build" in only release mode (The build result with 3 error and all others succeeded)
Then I build Project "Install" (The build result with all succeeded)
My graphic card is Nvidia Geforce 310M with compute capability 1.2
My computer has installed CUDA 6.5 driver, toolkit and SDK
Can anyone tell what's wrong there?
thanks