TLD causes nvcompiler.dll access violation
I am trying to run the TLD tracking algorithm with the following code, giving the following input: TLD path 1 I edited the code to use the computer cam (i.e: the input "path" is irrelevant).
The code gives the following message:
Unhandled exception at 0x00000001804B2084 (nvcompiler.dll) in TestOpenCV.exe: 0xC0000005: Access violation reading location 0x00000000FB191450.
The TLD algorithm is the only one to cause this to happen. This happens when the update function is called. Here is the code:
#include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/tracking/tracker.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <cstring>
using namespace std;
using namespace cv;
static Mat image;
static Rect2d boundingBox;
static bool paused;
static bool selectObject = false;
static bool startSelection = false;
static const char* keys =
{ "{@tracker_algorithm | | Tracker algorithm }"
"{@video_name | | video name }"
"{@start_frame |0| Start frame }"
"{@bounding_frame |0,0,0,0| Initial bounding frame}"};
static void onMouse( int event, int x, int y, int, void* )
{
if( !selectObject )
{
switch ( event )
{
case EVENT_LBUTTONDOWN:
//set origin of the bounding box
startSelection = true;
boundingBox.x = x;
boundingBox.y = y;
break;
case EVENT_LBUTTONUP:
//sei with and height of the bounding box
boundingBox.width = std::abs( x - boundingBox.x );
boundingBox.height = std::abs( y - boundingBox.y );
paused = false;
selectObject = true;
break;
case EVENT_MOUSEMOVE:
if( startSelection && !selectObject )
{
//draw the bounding box
Mat currentFrame;
image.copyTo( currentFrame );
rectangle( currentFrame, Point((int) boundingBox.x, (int)boundingBox.y ), Point( x, y ), Scalar( 255, 0, 0 ), 2, 1 );
imshow( "Tracking API", currentFrame );
}
break;
}
}
}
static void help()
{
cout << "\nThis example shows the functionality of \"Long-term optical tracking API\""
"-- pause video [p] and draw a bounding box around the target to start the tracker\n"
"Example of <video_name> is in opencv_extra/testdata/cv/tracking/\n"
"Call:\n"
"./tracker <tracker_algorithm> <video_name> <start_frame> [<bounding_frame>]\n"
<< endl;
cout << "\n\nHot keys: \n"
"\tq - quit the program\n"
"\tp - pause video\n";
}
int main( int argc, char** argv ){
CommandLineParser parser( argc, argv, keys );
String tracker_algorithm = parser.get<String>( 0 );
String video_name = parser.get<String>( 1 );
int start_frame = parser.get<int>( 2 );
if( tracker_algorithm.empty() || video_name.empty() )
{
help();
return -1;
}
int coords[4]={0,0,0,0};
bool initBoxWasGivenInCommandLine=false;
if (initBoxWasGivenInCommandLine)
{
String initBoundingBox=parser.get<String>(3);
for(size_t npos=0,pos=0,ctr=0;ctr<4;ctr++){
npos=initBoundingBox.find_first_of(',',pos);
if(npos==string::npos && ctr<3){
printf("bounding box should be given in format \"x1,y1,x2,y2\",where x's and y's are integer cordinates of opposed corners of bdd box\n");
printf("got: %s\n",initBoundingBox.substr(pos,string::npos).c_str());
printf("manual selection of bounding box will be employed\n");
break;
}
int num=atoi(initBoundingBox.substr(pos,(ctr==3)?(string::npos):(npos-pos)).c_str());
if(num<=0){
printf("bounding box should be given in format \"x1,y1,x2,y2\",where x's and y's are integer cordinates of opposed corners of bdd box\n");
printf("got: %s\n",initBoundingBox.substr(pos,npos-pos).c_str());
printf("manual selection of bounding box will be employed\n ...
did you try other algorithms, like "MIL", "BOOSTING" ? maybe we can narrow it down a bit.
also, did you compile with CUDA ? some more information on your setup might be more important than the sample code
Actually all other algorithms are working perfectly, this problem only arises with TLD.
I did not use CUDA, I only followed those instructions. I kept the sources in a distinct folder though (opencv/sources instead of opencv), while building in opencv/build. I also did not build opencv_world. Should I?
sounds all ok.
"I also did not build opencv_world. Should I?" - no, leave it as is
i'm just wondering, why there's a cvcompiler.dll (sounds like cuda, no?) involved at all
can you do a
cerr << cv::getBuildInformation() << endl;
and append the output to your question ?I appended the output of getBuildInformation() to my question
thanks !. so it's either opencl or ipp related.
i think, you should progress to the github issueswith this. also: https://github.com/itseez/opencv/wiki...
int the meantime, you could try to disable things at runtime,
http://docs.opencv.org/ref/master/dc/...
http://docs.opencv.org/ref/master/db/...