Commit c3e88a71 authored by Vladimir's avatar Vladimir

Fixed segmentation fault error in TRACK_vot::getNextFrame()

parent 46603023
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment