Fixed segmentation fault error in TRACK_vot::getNextFrame()

pull/341/head
Vladimir 9 years ago
parent 4660302330
commit c3e88a717e
  1. 4
      modules/datasets/samples/track_vot.cpp
  2. 5
      modules/datasets/src/track_vot.cpp
  3. 6
      modules/tracking/samples/multiTracker_dataset.cpp
  4. 4
      modules/tracking/samples/tracker_dataset.cpp

@ -82,8 +82,8 @@ int main(int argc, char *argv[])
for (int i = 0; i < dataset->getDatasetLength(datasetID); i++)
{
Mat frame;
dataset->getNextFrame(frame);
if (!dataset->getNextFrame(frame))
break;
//Draw Ground Truth BB
vector <Point2d> gtPoints = dataset->getGT();
for (int j = 0; j < (int)(gtPoints.size()-1); j++)

@ -210,7 +210,10 @@ namespace cv
bool TRACK_votImpl::getNextFrame(Mat &frame)
{
frame = imread(data[activeDatasetID - 1][frameCounter]->imagePath);
if (frameCounter >= (int)data[activeDatasetID - 1].size())
return false;
string imgPath = data[activeDatasetID - 1][frameCounter]->imagePath;
frame = imread(imgPath);
frameCounter++;
return !frame.empty();
}

@ -50,7 +50,7 @@ using namespace std;
using namespace cv;
using namespace cv::datasets;
#define NUM_TEST_FRAMES 100
#define NUM_TEST_FRAMES 1000
static Mat image;
static bool paused;
@ -170,10 +170,8 @@ int main(int argc, char *argv[])
//Time measurment
int64 e1 = getTickCount();
if (initialized){
dataset->getNextFrame(frame);
if (frame.empty()){
if (!dataset->getNextFrame(frame))
break;
}
frame.copyTo(image);
}

@ -169,10 +169,8 @@ int main(int argc, char *argv[])
//Time measurment
int64 e1 = getTickCount();
if (initialized){
dataset->getNextFrame(frame);
if (frame.empty()){
if (!dataset->getNextFrame(frame))
break;
}
frame.copyTo(image);
}

Loading…
Cancel
Save