calcOpticalFlowPyrLK on threads

asked 2013-11-18 01:52:26 -0500

Hey hey,

I'm writing one program with calcOpticalFlowPyrLK, but with 2 cams. When I run the code for just one of them it's OK, but wen try to run the code on other thread it trow exception...

the code:

pthread_t TCam0;
Med Cam0; //structure for data; //cam number : 0,1,2,,,

pthread_create (&TCam0, NULL, &thread_detect, (void*)&Cam0);  //crashes on calcOpticalFlowPyrLK
thread_detect(&Cam0); //working

OpenCV Error: Assertion failed (depth == CV_8U) in calcSharrDeriv, file C:/slave/builds/WinInstallerMegaPack/src/opencv/modules/video/src/lkpyramid.cpp, li
ne 53
terminate called after throwing an instance of 'cv::Exception'
  what():  C:/slave/builds/WinInstallerMegaPack/src/opencv/modules/video/src/lkpyramid.cpp:53: error: (-215) depth == CV_8U in function calcSharrDeriv

any idea ?

edit retag flag offensive close merge delete