1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-19 02:16:34 +08:00

Fixed segmentation fault error in TRACK_vot::getNextFrame()

This commit is contained in:
Vladimir
2015-08-22 02:29:50 +09:00
parent a4fdf7efff
commit 20cdf5d7f6
4 changed files with 9 additions and 12 deletions

View File

@@ -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++)

View File

@@ -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();
}

View File

@@ -50,9 +50,7 @@ using namespace std;
using namespace cv;
using namespace cv::datasets;
#define NUM_TEST_FRAMES 100
#define TEST_VIDEO_INDEX 7 //TLD Dataset Video Index from 1-10
//#define RECORD_VIDEO_FLG
#define NUM_TEST_FRAMES 1000
static Mat image;
static bool paused;
@@ -186,10 +184,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);
}

View File

@@ -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);
}