I’m working with stereo images captured from two ps eyes. I can work with ClEyeMulticam.dll and the OpenCV 2.4.3 CPU algorithms perfectly but when i use the GPU version of the BMStereo algorithm the program crashes before executing the main() method and I get: Unhandled exception at 0x776e15ee in PSStereo.exe: 0xC0000005: Access violation.
this is an example code of the problem:
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/gpu/gpu.hpp>
#include "CLEyeMulticam.h"
using namespace std;
using namespace cv;
using namespace cv::gpu;
int main(int argc, char* argv[])
{
try
{
/*use CLEyeMulticam.dll*/ cout<< "Eye Cameras: " << CLEyeGetCameraCount() << endl;
Mat imgR(200,200, CV_8U, Scalar(150));
Mat imgL(200,200, CV_8U, Scalar(100));
Mat result(200,200, CV_8U, Scalar(50));
//-----------------------Work with gpu--------------------------------
//Set device
cout << "Devices: " << getCudaEnabledDeviceCount()<<endl;
setDevice(0);
//Prepare algorithm...
StereoBM_GPU bm;
v::gpu::GpuMat gpuL, gpuR, disp;
//Upload, work and download...
gpuL.upload(imgL);
gpuR.upload(imgR);
bm(gpuL,gpuR,disp);
disp.download(result);
//------------------------------------------------------------------------
//Show results...
cv::imshow("Result", result);
cout << "All ok...";
cv::waitKey();
}
catch(const cv::Exception& ex)
{
std::cout << "Error: " << ex.what() << std::endl;
}
cv::waitKey();
return 0;
}
It works well if i comment the CLEyeGetCameraCount() method, it also works well if i comment the section of the gpu work, but when the two sections work together it crashes on execution time before entering the main method…
Call Stack:
> ntdll.dll!776e15ee()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!776e15ee()
ntdll.dll!776d015e()
ntdll.dll!776e003a()
snxhk.dll!750c8a36()
CLEyeMulticam.dll!002bf47d()
CLEyeMulticam.dll!002bf54d()
ntdll.dll!776f9930()
ntdll.dll!776fd8a9()
ntdll.dll!776fdf87()
ntdll.dll!77712120()
ntdll.dll!776f9e59()
Disassembly:
776E15CB lea edx,[esp+4]
776E15CF call dword ptr fs:[0C0h]
776E15D6 add esp,4
776E15D9 ret 18h
776E15DC mov eax,12Fh
776E15E1 xor ecx,ecx
776E15E3 lea edx,[esp+4]
776E15E7 call dword ptr fs:[0C0h]
776E15EE add esp,4
776E15F1 ret 0Ch
776E15F4 mov eax,130h
776E15F9 xor ecx,ecx
776E15FB lea edx,[esp+4]
776E15FF call dword ptr fs:[0C0h]
776E1606 add esp,4
776E1609 ret 18h
My setup: Windows 7 SP1, VS2010 sp1 x64, NVIDIA GeForce GTX 560, OpenCV 2.4.3, CL-Eye-Platform-SDK-1.6.4.0028, Driver-5.3.0.0341, two pseyes (not activated)
Please it would be great that you fix this or at least give me a workaround as soon as posible…..