Commit 2858b7bb authored by Vladimir's avatar Vladimir

Fixed segmentation fault error in TRACK_vot::getNextFrame()

parent 4e1d8ed8
...@@ -82,8 +82,8 @@ int main(int argc, char *argv[]) ...@@ -82,8 +82,8 @@ int main(int argc, char *argv[])
for (int i = 0; i < dataset->getDatasetLength(datasetID); i++) for (int i = 0; i < dataset->getDatasetLength(datasetID); i++)
{ {
Mat frame; Mat frame;
dataset->getNextFrame(frame); if (!dataset->getNextFrame(frame))
break;
//Draw Ground Truth BB //Draw Ground Truth BB
vector <Point2d> gtPoints = dataset->getGT(); vector <Point2d> gtPoints = dataset->getGT();
for (int j = 0; j < (int)(gtPoints.size()-1); j++) for (int j = 0; j < (int)(gtPoints.size()-1); j++)
......
...@@ -211,7 +211,10 @@ namespace cv ...@@ -211,7 +211,10 @@ namespace cv
bool TRACK_votImpl::getNextFrame(Mat &frame) 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++; frameCounter++;
return !frame.empty(); return !frame.empty();
} }
......
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