Commit c069e007 authored by Vladimir's avatar Vladimir

Fix #1

parent 6f7ec997
......@@ -46,12 +46,12 @@ using namespace std;
namespace cv
{
namespace datasets
{
namespace datasets
{
class TRACK_votImpl : public TRACK_vot
{
public:
class TRACK_votImpl : public TRACK_vot
{
public:
//Constructor
TRACK_votImpl()
{
......@@ -75,38 +75,38 @@ public:
virtual vector <Point2d> getGT();
private:
private:
void loadDataset(const string &path);
string numberToString(int number);
};
};
void TRACK_votImpl::load(const string &path)
{
void TRACK_votImpl::load(const string &path)
{
loadDataset(path);
}
}
string TRACK_votImpl::numberToString(int number)
{
string TRACK_votImpl::numberToString(int number)
{
string out;
char numberStr[9];
sprintf(numberStr, "%u", number);
for (unsigned int i=0; i<8-strlen(numberStr); ++i)
for (unsigned int i = 0; i < 8 - strlen(numberStr); ++i)
{
out += "0";
}
out += numberStr;
return out;
}
}
inline bool fileExists(const std::string& name)
{
inline bool fileExists(const std::string& name)
{
struct stat buffer;
return (stat(name.c_str(), &buffer) == 0);
}
}
void TRACK_votImpl::loadDataset(const string &rootPath)
{
void TRACK_votImpl::loadDataset(const string &rootPath)
{
ifstream namesList(rootPath + "/list.txt");
//ifstream lengthsList(rootPath + "/lengths.txt");
vector <int> datasetsLengths;
......@@ -165,7 +165,7 @@ void TRACK_votImpl::loadDataset(const string &rootPath)
} while (true);
datasetsLengths.push_back(currFrameID-1);
datasetsLengths.push_back(currFrameID - 1);
data.push_back(objects);
}
}
......@@ -176,15 +176,15 @@ void TRACK_votImpl::loadDataset(const string &rootPath)
namesList.close();
return;
}
}
int TRACK_votImpl::getDatasetsNum()
{
int TRACK_votImpl::getDatasetsNum()
{
return data.size();
}
}
int TRACK_votImpl::getDatasetLength(int id)
{
int TRACK_votImpl::getDatasetLength(int id)
{
if (id > 0 && id <= (int)data.size())
return data[id - 1].size();
else
......@@ -192,10 +192,10 @@ int TRACK_votImpl::getDatasetLength(int id)
cout << "Dataset ID is out of range...\n " << "Allowed IDs are: 1~" << (int)data.size() << endl;
return -1;
}
}
}
bool TRACK_votImpl::initDataset(int id)
{
bool TRACK_votImpl::initDataset(int id)
{
if (id > 0 && id <= (int)data.size())
{
activeDatasetID = id;
......@@ -206,26 +206,25 @@ bool TRACK_votImpl::initDataset(int id)
cout << "Dataset ID is out of range...\n " << "Allowed IDs are: 1~" << (int)data.size() << endl;
return false;
}
}
}
bool TRACK_votImpl::getNextFrame(Mat &frame)
{
bool TRACK_votImpl::getNextFrame(Mat &frame)
{
frame = imread(data[activeDatasetID - 1][frameCounter]->imagePath);
frameCounter++;
return !frame.empty();
}
}
Ptr<TRACK_vot> TRACK_vot::create()
{
Ptr<TRACK_vot> TRACK_vot::create()
{
return Ptr<TRACK_votImpl>(new TRACK_votImpl);
}
}
vector <Point2d> TRACK_votImpl::getGT()
{
vector <Point2d> TRACK_votImpl::getGT()
{
Ptr <TRACK_votObj> currObj = data[activeDatasetID - 1][frameCounter - 1];
return currObj->gtbb;
}
}
}
}
}
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