Commit 5e647ff0 authored by dmitriy.anisimov's avatar dmitriy.anisimov

fixed all comments except base class enhancment and interface-implementation pattern

parent 17616a86
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef AR_HMDB_H
#define AR_HMDB_H
#ifndef OPENCV_DATASETSTOOLS_AR_HMDB_HPP
#define OPENCV_DATASETSTOOLS_AR_HMDB_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -60,22 +60,22 @@ struct action
std::vector<std::string> videoNames;
};
class CV_EXPORTS ar_hmdb : public dataset
class CV_EXPORTS AR_hmdb : public Dataset
{
public:
ar_hmdb() {}
ar_hmdb(std::string &path, unsigned int number = 0);
virtual ~ar_hmdb() {}
AR_hmdb() {}
AR_hmdb(const std::string &path, int number = 0);
virtual ~AR_hmdb() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<action> train;
std::vector<action> test;
private:
void loadDataset(std::string &path, unsigned int number = 0);
void loadDataset(const std::string &path, int number = 0);
void loadAction(std::string &fileName, std::vector<std::string> &train_, std::vector<std::string> &test_);
void loadAction(const std::string &fileName, std::vector<std::string> &train_, std::vector<std::string> &test_);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef AR_SPORTS_H
#define AR_SPORTS_H
#ifndef OPENCV_DATASETSTOOLS_AR_SPORTS_HPP
#define OPENCV_DATASETSTOOLS_AR_SPORTS_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -57,25 +57,25 @@ namespace datasetstools
struct element
{
std::string videoUrl;
std::vector<unsigned int> labels;
std::vector<int> labels;
};
class CV_EXPORTS ar_sports : public dataset
class CV_EXPORTS AR_sports : public Dataset
{
public:
ar_sports() {}
ar_sports(std::string &path);
virtual ~ar_sports() {}
AR_sports() {}
AR_sports(const std::string &path);
virtual ~AR_sports() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<element> train;
std::vector<element> test;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
void loadDatasetPart(std::string &fileName, std::vector<element> &dataset_);
void loadDatasetPart(const std::string &fileName, std::vector<element> &dataset_);
};
}
......
......@@ -39,8 +39,8 @@
//
//M*/
#ifndef DATASET_H
#define DATASET_H
#ifndef OPENCV_DATASETSTOOLS_DATASET_HPP
#define OPENCV_DATASETSTOOLS_DATASET_HPP
#include <string>
......@@ -51,13 +51,13 @@ namespace cv
namespace datasetstools
{
class CV_EXPORTS dataset
class CV_EXPORTS Dataset
{
public:
dataset() {}
virtual ~dataset() {}
Dataset() {}
virtual ~Dataset() {}
virtual void load(std::string &path, unsigned int number = 0) = 0;
virtual void load(const std::string &path, int number = 0) = 0;
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef FR_LFW_H
#define FR_LFW_H
#ifndef OPENCV_DATASETSTOOLS_FR_LFW_HPP
#define OPENCV_DATASETSTOOLS_FR_LFW_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -60,19 +60,19 @@ struct face
std::vector<std::string> images;
};
class CV_EXPORTS fr_lfw : public dataset
class CV_EXPORTS FR_lfw : public Dataset
{
public:
fr_lfw() {}
fr_lfw(std::string &path);
virtual ~fr_lfw() {}
FR_lfw() {}
FR_lfw(const std::string &path);
virtual ~FR_lfw() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<face> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef GR_CHALEARN_H
#define GR_CHALEARN_H
#ifndef OPENCV_DATASETSTOOLS_GR_CHALEARN_HPP
#define OPENCV_DATASETSTOOLS_GR_CHALEARN_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -56,7 +56,7 @@ namespace datasetstools
struct groundTruth
{
unsigned int gestureID, initialFrame, lastFrame;
int gestureID, initialFrame, lastFrame;
};
struct join
......@@ -72,24 +72,24 @@ struct skeleton
struct gesture
{
std::string name, nameColor, nameDepth, nameUser;
unsigned int numFrames, fps, depth;
int numFrames, fps, depth;
std::vector<groundTruth> groundTruths;
std::vector<skeleton> skeletons;
};
class CV_EXPORTS gr_chalearn : public dataset
class CV_EXPORTS GR_chalearn : public Dataset
{
public:
gr_chalearn() {}
gr_chalearn(std::string &path);
virtual ~gr_chalearn() {}
GR_chalearn() {}
GR_chalearn(const std::string &path);
virtual ~GR_chalearn() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<gesture> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef GR_SKIG_H
#define GR_SKIG_H
#ifndef OPENCV_DATASETSTOOLS_GR_SKIG_HPP
#define OPENCV_DATASETSTOOLS_GR_SKIG_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -54,26 +54,64 @@ namespace cv
namespace datasetstools
{
enum actionType
{
circle = 1,
triangle,
updown,
rightleft,
wave,
z,
cross,
comehere,
turnaround,
pat
};
enum poseType
{
fist = 1,
index,
flat
};
enum illuminationType
{
light = 1,
dark
};
enum backgroundType
{
woodenBoard = 1,
whitePaper,
paperWithCharacters
};
struct gestureSkig
{
std::string rgb;
std::string dep;
unsigned char person, background, illumination, pose, actionType;
char person; // 1..6
backgroundType background;
illuminationType illumination;
poseType pose;
actionType type;
};
class CV_EXPORTS gr_skig : public dataset
class CV_EXPORTS GR_skig : public Dataset
{
public:
gr_skig() {}
gr_skig(std::string &path);
virtual ~gr_skig() {}
GR_skig() {}
GR_skig(const std::string &path);
virtual ~GR_skig() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<gestureSkig> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef HPE_PARSE_H
#define HPE_PARSE_H
#ifndef OPENCV_DATASETSTOOLS_HPE_PARSE_HPP
#define OPENCV_DATASETSTOOLS_HPE_PARSE_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -54,20 +54,20 @@ namespace cv
namespace datasetstools
{
class CV_EXPORTS hpe_parse : public dataset
class CV_EXPORTS HPE_parse : public Dataset
{
public:
hpe_parse() {}
hpe_parse(std::string &path);
virtual ~hpe_parse() {}
HPE_parse() {}
HPE_parse(const std::string &path);
virtual ~HPE_parse() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<std::string> train;
std::vector<std::string> test;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,15 +39,16 @@
//
//M*/
#ifndef IR_AFFINE_H
#define IR_AFFINE_H
#ifndef OPENCV_DATASETSTOOLS_IR_AFFINE_HPP
#define OPENCV_DATASETSTOOLS_IR_AFFINE_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
#include <opencv2/core/matx.hpp>
namespace cv
{
......@@ -57,22 +58,22 @@ namespace datasetstools
struct imageParams
{
std::string imageName;
double mat[3][3];
Matx33d mat;
};
class CV_EXPORTS ir_affine : public dataset
class CV_EXPORTS IR_affine : public Dataset
{
public:
ir_affine() {}
ir_affine(std::string &path);
virtual ~ir_affine() {}
IR_affine() {}
IR_affine(const std::string &path);
virtual ~IR_affine() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<imageParams> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef IR_ROBOT_H
#define IR_ROBOT_H
#ifndef OPENCV_DATASETSTOOLS_IR_ROBOT_HPP
#define OPENCV_DATASETSTOOLS_IR_ROBOT_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -65,19 +65,19 @@ struct scene
std::vector<std::string> images; // TODO: implement more complex structure
};
class CV_EXPORTS ir_robot : public dataset
class CV_EXPORTS IR_robot : public Dataset
{
public:
ir_robot() {}
ir_robot(std::string &path);
virtual ~ir_robot() {}
IR_robot() {}
IR_robot(const std::string &path);
virtual ~IR_robot() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<scene> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef IS_BSDS_H
#define IS_BSDS_H
#ifndef OPENCV_DATASETSTOOLS_IS_BSDS_HPP
#define OPENCV_DATASETSTOOLS_IS_BSDS_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -54,22 +54,22 @@ namespace cv
namespace datasetstools
{
class CV_EXPORTS is_bsds : public dataset
class CV_EXPORTS IS_bsds : public Dataset
{
public:
is_bsds() {}
is_bsds(std::string &path);
virtual ~is_bsds() {}
IS_bsds() {}
IS_bsds(const std::string &path);
virtual ~IS_bsds() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<std::string> train;
std::vector<std::string> test;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
void loadDatasetPart(std::string &fileName, std::vector<std::string> &dataset_);
void loadDatasetPart(const std::string &fileName, std::vector<std::string> &dataset_);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef IS_WEIZMANN_H
#define IS_WEIZMANN_H
#ifndef OPENCV_DATASETSTOOLS_IS_WEIZMANN_HPP
#define OPENCV_DATASETSTOOLS_IS_WEIZMANN_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -62,19 +62,19 @@ struct object
std::string humanSeg; // TODO: read human segmented
};
class CV_EXPORTS is_weizmann : public dataset
class CV_EXPORTS IS_weizmann : public Dataset
{
public:
is_weizmann() {}
is_weizmann(std::string &path);
virtual ~is_weizmann() {}
IS_weizmann() {}
IS_weizmann(const std::string &path);
virtual ~IS_weizmann() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<object> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef MSM_EPFL_H
#define MSM_EPFL_H
#ifndef OPENCV_DATASETSTOOLS_MSM_EPFL_HPP
#define OPENCV_DATASETSTOOLS_MSM_EPFL_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -60,21 +60,21 @@ struct objectEpfl
std::vector<double> bounding, camera, p; // TODO: implement better structures
};
class CV_EXPORTS msm_epfl : public dataset
class CV_EXPORTS MSM_epfl : public Dataset
{
public:
msm_epfl() {}
msm_epfl(std::string &path);
virtual ~msm_epfl() {}
MSM_epfl() {}
MSM_epfl(const std::string &path);
virtual ~MSM_epfl() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<objectEpfl> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
void readFileDouble(std::string fileName, std::vector<double> &out);
void readFileDouble(const std::string &fileName, std::vector<double> &out);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef MSM_MIDDLEBURY_H
#define MSM_MIDDLEBURY_H
#ifndef OPENCV_DATASETSTOOLS_MSM_MIDDLEBURY_HPP
#define OPENCV_DATASETSTOOLS_MSM_MIDDLEBURY_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -62,19 +62,19 @@ struct cameraParam
double t[3];
};
class CV_EXPORTS msm_middlebury : public dataset
class CV_EXPORTS MSM_middlebury : public Dataset
{
public:
msm_middlebury() {}
msm_middlebury(std::string &path);
virtual ~msm_middlebury() {}
MSM_middlebury() {}
MSM_middlebury(const std::string &path);
virtual ~MSM_middlebury() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<cameraParam> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,14 +39,14 @@
//
//M*/
#ifndef OR_IMAGENET_H
#define OR_IMAGENET_H
#ifndef OPENCV_DATASETSTOOLS_OR_IMAGENET_HPP
#define OPENCV_DATASETSTOOLS_OR_IMAGENET_HPP
#include <string>
#include <vector>
#include <set>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -57,25 +57,25 @@ namespace datasetstools
struct objectImagenet
{
std::string wnid; // TODO: string -> unsigned int
unsigned int id2;
std::string wnid;
int id2;
std::string imageUrl;
};
class CV_EXPORTS or_imagenet : public dataset
class CV_EXPORTS OR_imagenet : public Dataset
{
public:
or_imagenet() {}
or_imagenet(std::string &path);
virtual ~or_imagenet() {}
OR_imagenet() {}
OR_imagenet(const std::string &path);
virtual ~OR_imagenet() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<objectImagenet> train;
std::set<std::string> wnids;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef OR_SUN_H
#define OR_SUN_H
#ifndef OPENCV_DATASETSTOOLS_OR_SUN_HPP
#define OPENCV_DATASETSTOOLS_OR_SUN_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -60,19 +60,19 @@ struct objectSun
std::vector<std::string> imageNames;
};
class CV_EXPORTS or_sun : public dataset
class CV_EXPORTS OR_sun : public Dataset
{
public:
or_sun() {}
or_sun(std::string &path);
virtual ~or_sun() {}
OR_sun() {}
OR_sun(const std::string &path);
virtual ~OR_sun() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<objectSun> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef SLAM_KITTI_H
#define SLAM_KITTI_H
#ifndef OPENCV_DATASETSTOOLS_SLAM_KITTI_HPP
#define OPENCV_DATASETSTOOLS_SLAM_KITTI_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -68,19 +68,19 @@ struct sequence
std::vector<pose> posesArray;
};
class CV_EXPORTS slam_kitti : public dataset
class CV_EXPORTS SLAM_kitti : public Dataset
{
public:
slam_kitti() {}
slam_kitti(std::string &path);
virtual ~slam_kitti() {}
SLAM_kitti() {}
SLAM_kitti(const std::string &path);
virtual ~SLAM_kitti() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<sequence> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef SLAM_TUMINDOOR_H
#define SLAM_TUMINDOOR_H
#ifndef OPENCV_DATASETSTOOLS_SLAM_TUMINDOOR_HPP
#define OPENCV_DATASETSTOOLS_SLAM_TUMINDOOR_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -68,19 +68,19 @@ struct imageInfo
imageType type;
};
class CV_EXPORTS slam_tumindoor : public dataset
class CV_EXPORTS SLAM_tumindoor : public Dataset
{
public:
slam_tumindoor() {}
slam_tumindoor(std::string &path);
virtual ~slam_tumindoor() {}
SLAM_tumindoor() {}
SLAM_tumindoor(const std::string &path);
virtual ~SLAM_tumindoor() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<imageInfo> train;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef TR_CHARS_H
#define TR_CHARS_H
#ifndef OPENCV_DATASETSTOOLS_TR_CHARS_HPP
#define OPENCV_DATASETSTOOLS_TR_CHARS_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -57,25 +57,25 @@ namespace datasetstools
struct character
{
std::string imgName;
unsigned int label;
int label;
};
class CV_EXPORTS tr_chars : public dataset
class CV_EXPORTS TR_chars : public Dataset
{
public:
tr_chars() {}
tr_chars(std::string &path, unsigned int number = 0);
virtual ~tr_chars() {}
TR_chars() {}
TR_chars(const std::string &path, int number = 0);
virtual ~TR_chars() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<character> train;
std::vector<character> test;
private:
void loadDataset(std::string &path, unsigned int number = 0);
void loadDataset(const std::string &path, int number = 0);
void parseLine(std::string &line, std::vector<int> &currSet, unsigned int number);
void parseLine(const std::string &line, std::vector<int> &currSet, int number);
};
}
......
......@@ -39,13 +39,13 @@
//
//M*/
#ifndef TR_SVT_H
#define TR_SVT_H
#ifndef OPENCV_DATASETSTOOLS_TR_SVT_HPP
#define OPENCV_DATASETSTOOLS_TR_SVT_HPP
#include <string>
#include <vector>
#include "opencv2/dataset.hpp"
#include "opencv2/datasetstools/dataset.hpp"
#include <opencv2/core.hpp>
......@@ -57,7 +57,7 @@ namespace datasetstools
struct tag
{
std::string value;
unsigned int height, width, x, y;
int height, width, x, y;
};
struct image
......@@ -67,22 +67,22 @@ struct image
std::vector<tag> tags;
};
class CV_EXPORTS tr_svt : public dataset
class CV_EXPORTS TR_svt : public Dataset
{
public:
tr_svt() {}
tr_svt(std::string &path);
virtual ~tr_svt() {}
TR_svt() {}
TR_svt(const std::string &path);
virtual ~TR_svt() {}
virtual void load(std::string &path, unsigned int number = 0);
virtual void load(const std::string &path, int number = 0);
std::vector<image> train;
std::vector<image> test;
private:
void loadDataset(std::string &path);
void loadDataset(const std::string &path);
void xmlParse(std::string &set, std::vector<image> &out);
void xmlParse(const std::string &set, std::vector<image> &out);
};
}
......
......@@ -39,8 +39,8 @@
//
//M*/
#ifndef UTIL_H
#define UTIL_H
#ifndef OPENCV_DATASETSTOOLS_UTIL_HPP
#define OPENCV_DATASETSTOOLS_UTIL_HPP
#include <string>
#include <vector>
......@@ -52,9 +52,9 @@ namespace cv
namespace datasetstools
{
void split(std::string s, std::vector<std::string> &elems, char delim);
void split(const std::string s, std::vector<std::string> &elems, char delim);
void getDirList(std::string &dirName, std::vector<std::string> &fileNames);
void getDirList(const std::string &dirName, std::vector<std::string> &fileNames);
}
}
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/ar_hmdb.hpp"
#include "opencv2/datasetstools/ar_hmdb.hpp"
#include <opencv2/core.hpp>
......@@ -65,8 +65,8 @@ int main(int argc, char *argv[])
return -1;
}
ar_hmdb dataset[3];
for (unsigned int i=0; i<3; ++i)
AR_hmdb dataset[3];
for (int i=0; i<3; ++i)
{
dataset[i].load(path, i);
}
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/ar_sports.hpp"
#include "opencv2/datasetstools/ar_sports.hpp"
#include <opencv2/core.hpp>
......@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
return -1;
}
ar_sports dataset(path);
AR_sports dataset(path);
// ***************
// dataset. train & test contains for each video url in dataset all it's labels.
......@@ -78,8 +78,8 @@ int main(int argc, char *argv[])
element &first = dataset.test[0];
printf("url: %s\n", first.videoUrl.c_str());
printf("labels: ");
vector<unsigned int> &labels = first.labels;
for (vector<unsigned int>::iterator it=labels.begin(); it!=labels.end(); ++it)
vector<int> &labels = first.labels;
for (vector<int>::iterator it=labels.begin(); it!=labels.end(); ++it)
{
printf("%u ", *it);
}
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/fr_lfw.hpp"
#include "opencv2/datasetstools/fr_lfw.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
fr_lfw dataset(path);
FR_lfw dataset(path);
// ***************
// dataset contains object with name and its images.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/gr_chalearn.hpp"
#include "opencv2/datasetstools/gr_chalearn.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
gr_chalearn dataset(path);
GR_chalearn dataset(path);
// ***************
// dataset contains information for each sample.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/gr_skig.hpp"
#include "opencv2/datasetstools/gr_skig.hpp"
#include <opencv2/core.hpp>
......@@ -66,16 +66,16 @@ int main(int argc, char *argv[])
return -1;
}
gr_skig dataset(path);
GR_skig dataset(path);
// ***************
// dataset contains pair of rgb\dep images
// For example, let output train size and first element.
gestureSkig &example = dataset.train[0];
// For example, let output train size and second element.
gestureSkig &example = dataset.train[1];
printf("train size: %u\n", (unsigned int)dataset.train.size());
printf("first train image:\nrgb: %s\ndep: %s\n", example.rgb.c_str(), example.dep.c_str());
printf("second train image:\nrgb: %s\ndep: %s\n", example.rgb.c_str(), example.dep.c_str());
printf("person: %u, backgroud: %u, illumination: %u, pose: %u, actionType: %u\n",
example.person, example.background, example.illumination, example.pose, example.actionType);
example.person, example.background, example.illumination, example.pose, example.type);
return 0;
}
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/hpe_parse.hpp"
#include "opencv2/datasetstools/hpe_parse.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
hpe_parse dataset(path);
HPE_parse dataset(path);
// ***************
// dataset. train & test contain appropriate images
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/ir_affine.hpp"
#include "opencv2/datasetstools/ir_affine.hpp"
#include <opencv2/core.hpp>
......@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
}
// loading dataset
ir_affine dataset(path);
IR_affine dataset(path);
// ***************
// dataset contains for each image in dataset it's matrix.
......@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
{
for (int j=0; j<3; ++j)
{
printf("%f ", example.mat[i][j]);
printf("%f ", example.mat(i, j));
}
printf("\n");
}
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/ir_robot.hpp"
#include "opencv2/datasetstools/ir_robot.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
ir_robot dataset(path);
IR_robot dataset(path);
// ***************
// dataset contains object with name and its images.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/is_bsds.hpp"
#include "opencv2/datasetstools/is_bsds.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
is_bsds dataset(path);
IS_bsds dataset(path);
// TODO: read human/ folder for evaluation
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/is_weizmann.hpp"
#include "opencv2/datasetstools/is_weizmann.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
is_weizmann dataset(path);
IS_weizmann dataset(path);
// ***************
// dataset contains all information for each image.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/msm_epfl.hpp"
#include "opencv2/datasetstools/msm_epfl.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
msm_epfl dataset(path);
MSM_epfl dataset(path);
// ***************
// dataset contains all information for each image.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/msm_middlebury.hpp"
#include "opencv2/datasetstools/msm_middlebury.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
msm_middlebury dataset(path);
MSM_middlebury dataset(path);
// ***************
// dataset contains camera parameters for each image.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/or_imagenet.hpp"
#include "opencv2/datasetstools/or_imagenet.hpp"
#include <opencv2/core.hpp>
......@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
return -1;
}
or_imagenet dataset(path);
OR_imagenet dataset(path);
// ***************
// dataset contains for each object its id & image url.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/or_sun.hpp"
#include "opencv2/datasetstools/or_sun.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
or_sun dataset(path);
OR_sun dataset(path);
// ***************
// dataset contains for each object its images.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/slam_kitti.hpp"
#include "opencv2/datasetstools/slam_kitti.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
slam_kitti dataset(path);
SLAM_kitti dataset(path);
// ***************
// dataset contains sequence with name and its data.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/slam_tumindoor.hpp"
#include "opencv2/datasetstools/slam_tumindoor.hpp"
#include <opencv2/core.hpp>
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
return -1;
}
slam_tumindoor dataset(path);
SLAM_tumindoor dataset(path);
// ***************
// dataset contains image and its information.
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/tr_chars.hpp"
#include "opencv2/datasetstools/tr_chars.hpp"
#include <opencv2/core.hpp>
......@@ -66,13 +66,13 @@ int main(int argc, char *argv[])
return -1;
}
vector<tr_chars> dataset;
vector<TR_chars> dataset;
do
{
tr_chars curr;
TR_chars curr;
dataset.push_back(curr);
unsigned int number = (unsigned int)dataset.size()-1;
int number = (int)dataset.size()-1;
dataset.back().load(path, number);
} while (dataset.back().train.size()>0);
dataset.pop_back(); // remove last empty split
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/tr_svt.hpp"
#include "opencv2/datasetstools/tr_svt.hpp"
#include <opencv2/core.hpp>
......@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
}
// loading train & test images description
tr_svt dataset(path);
TR_svt dataset(path);
// ***************
// dataset. train & test contains images description.
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/ar_hmdb.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/ar_hmdb.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,7 +49,7 @@ namespace datasetstools
using namespace std;
void ar_hmdb::loadAction(string &fileName, vector<string> &train_, vector<string> &test_)
void AR_hmdb::loadAction(const string &fileName, vector<string> &train_, vector<string> &test_)
{
ifstream infile(fileName.c_str());
string video, label;
......@@ -70,20 +66,20 @@ void ar_hmdb::loadAction(string &fileName, vector<string> &train_, vector<string
}
}
ar_hmdb::ar_hmdb(string &path, unsigned int number)
AR_hmdb::AR_hmdb(const string &path, int number)
{
loadDataset(path, number);
}
void ar_hmdb::load(string &path, unsigned int number)
void AR_hmdb::load(const string &path, int number)
{
loadDataset(path, number);
}
void ar_hmdb::loadDataset(string &path, unsigned int number)
void AR_hmdb::loadDataset(const string &path, int number)
{
// valid number [0,1,2]
if (number>2)
if (number<0 || number>2)
{
return;
}
......
......@@ -39,13 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/ar_sports.hpp"
#include <cstdio>
#include <cstdlib> // atoi
#include <fstream>
#include "opencv2/datasetstools/ar_sports.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -54,7 +49,7 @@ namespace datasetstools
using namespace std;
void ar_sports::loadDatasetPart(string &fileName, vector<element> &dataset_)
void AR_sports::loadDatasetPart(const string &fileName, vector<element> &dataset_)
{
ifstream infile(fileName.c_str());
string videoUrl, labels;
......@@ -74,12 +69,12 @@ void ar_sports::loadDatasetPart(string &fileName, vector<element> &dataset_)
}
}
ar_sports::ar_sports(string &path)
AR_sports::AR_sports(const string &path)
{
loadDataset(path);
}
void ar_sports::load(string &path, unsigned int number)
void AR_sports::load(const string &path, int number)
{
if (number!=0)
{
......@@ -89,7 +84,7 @@ void ar_sports::load(string &path, unsigned int number)
loadDataset(path);
}
void ar_sports::loadDataset(string &path)
void AR_sports::loadDataset(const string &path)
{
string trainPath(path + "original/train_partition.txt");
string testPath(path + "original/test_partition.txt");
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/fr_lfw.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/fr_lfw.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,12 +49,12 @@ namespace datasetstools
using namespace std;
fr_lfw::fr_lfw(std::string &path)
FR_lfw::FR_lfw(const string &path)
{
loadDataset(path);
}
void fr_lfw::load(string &path, unsigned int number)
void FR_lfw::load(const string &path, int number)
{
if (number!=0)
{
......@@ -68,7 +64,7 @@ void fr_lfw::load(string &path, unsigned int number)
loadDataset(path);
}
void fr_lfw::loadDataset(string &path)
void FR_lfw::loadDataset(const string &path)
{
vector<string> fileNames;
getDirList(path, fileNames);
......
......@@ -39,13 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/gr_chalearn.hpp"
#include <cstdio>
#include <cstdlib> // atoi
#include <fstream>
#include "opencv2/datasetstools/gr_chalearn.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -54,12 +49,12 @@ namespace datasetstools
using namespace std;
gr_chalearn::gr_chalearn(std::string &path)
GR_chalearn::GR_chalearn(const string &path)
{
loadDataset(path);
}
void gr_chalearn::load(string &path, unsigned int number)
void GR_chalearn::load(const string &path, int number)
{
if (number!=0)
{
......@@ -69,7 +64,7 @@ void gr_chalearn::load(string &path, unsigned int number)
loadDataset(path);
}
void gr_chalearn::loadDataset(string &path)
void GR_chalearn::loadDataset(const string &path)
{
vector<string> fileNames;
getDirList(path, fileNames);
......
......@@ -39,15 +39,11 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/gr_skig.hpp"
#include "opencv2/datasetstools/gr_skig.hpp"
#include "precomp.hpp"
#include <cstdio>
#include <cstdlib> // atoi
#include <cstring>
#include <fstream>
namespace cv
{
namespace datasetstools
......@@ -55,12 +51,12 @@ namespace datasetstools
using namespace std;
gr_skig::gr_skig(std::string &path)
GR_skig::GR_skig(const string &path)
{
loadDataset(path);
}
void gr_skig::load(string &path, unsigned int number)
void GR_skig::load(const string &path, int number)
{
if (number!=0)
{
......@@ -70,7 +66,7 @@ void gr_skig::load(string &path, unsigned int number)
loadDataset(path);
}
void gr_skig::loadDataset(string &path)
void GR_skig::loadDataset(const string &path)
{
for (unsigned int i=1; i<=6; ++i)
{
......@@ -94,13 +90,13 @@ void gr_skig::loadDataset(string &path)
size_t pos = file.find("person_"); // TODO: check ::npos
curr.person = (unsigned char)atoi( file.substr(pos+strlen("person_"), 1).c_str() );
pos = file.find("backgroud_");
curr.background = (unsigned char)atoi( file.substr(pos+strlen("backgroud_"), 1).c_str() );
curr.background = (backgroundType)atoi( file.substr(pos+strlen("backgroud_"), 1).c_str() );
pos = file.find("illumination_");
curr.illumination = (unsigned char)atoi( file.substr(pos+strlen("illumination_"), 1).c_str() );
curr.illumination = (illuminationType)atoi( file.substr(pos+strlen("illumination_"), 1).c_str() );
pos = file.find("pose_");
curr.pose = (unsigned char)atoi( file.substr(pos+strlen("pose_"), 1).c_str() );
curr.pose = (poseType)atoi( file.substr(pos+strlen("pose_"), 1).c_str() );
pos = file.find("actionType_");
curr.actionType = (unsigned char)atoi( file.substr(pos+strlen("actionType_"), 1).c_str() );
curr.type = (actionType)atoi( file.substr(pos+strlen("actionType_"), 2).c_str() );
train.push_back(curr);
}
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/hpe_parse.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/hpe_parse.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,12 +49,12 @@ namespace datasetstools
using namespace std;
hpe_parse::hpe_parse(std::string &path)
HPE_parse::HPE_parse(const string &path)
{
loadDataset(path);
}
void hpe_parse::load(string &path, unsigned int number)
void HPE_parse::load(const string &path, int number)
{
if (number!=0)
{
......@@ -68,7 +64,7 @@ void hpe_parse::load(string &path, unsigned int number)
loadDataset(path);
}
void hpe_parse::loadDataset(string &path)
void HPE_parse::loadDataset(const string &path)
{
unsigned int i=0;
vector<string> fileNames;
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/ir_affine.hpp"
#include <cstdio>
#include <cstdlib> // atoi
#include <fstream>
#include "opencv2/datasetstools/ir_affine.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,12 +49,12 @@ namespace datasetstools
using namespace std;
ir_affine::ir_affine(std::string &path)
IR_affine::IR_affine(const string &path)
{
loadDataset(path);
}
void ir_affine::load(string &path, unsigned int number)
void IR_affine::load(const string &path, int number)
{
if (number!=0)
{
......@@ -68,7 +64,7 @@ void ir_affine::load(string &path, unsigned int number)
loadDataset(path);
}
void ir_affine::loadDataset(string &path)
void IR_affine::loadDataset(const string &path)
{
for (unsigned int i=1; i<=6; ++i)
{
......@@ -86,7 +82,7 @@ void ir_affine::loadDataset(string &path)
{
for (int j=0; j<3; ++j)
{
infile >> curr.mat[k][j];
infile >> curr.mat(k, j);
}
}
}
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/ir_robot.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/ir_robot.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,12 +49,12 @@ namespace datasetstools
using namespace std;
ir_robot::ir_robot(std::string &path)
IR_robot::IR_robot(const string &path)
{
loadDataset(path);
}
void ir_robot::load(string &path, unsigned int number)
void IR_robot::load(const string &path, int number)
{
if (number!=0)
{
......@@ -68,7 +64,7 @@ void ir_robot::load(string &path, unsigned int number)
loadDataset(path);
}
void ir_robot::loadDataset(string &path)
void IR_robot::loadDataset(const string &path)
{
vector<string> fileNames;
getDirList(path, fileNames);
......
......@@ -39,11 +39,8 @@
//
//M*/
#include "opencv2/is_bsds.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/is_bsds.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -52,7 +49,7 @@ namespace datasetstools
using namespace std;
void is_bsds::loadDatasetPart(string &fileName, vector<string> &dataset_)
void IS_bsds::loadDatasetPart(const string &fileName, vector<string> &dataset_)
{
ifstream infile(fileName.c_str());
string imageName;
......@@ -62,12 +59,12 @@ void is_bsds::loadDatasetPart(string &fileName, vector<string> &dataset_)
}
}
is_bsds::is_bsds(std::string &path)
IS_bsds::IS_bsds(const string &path)
{
loadDataset(path);
}
void is_bsds::load(string &path, unsigned int number)
void IS_bsds::load(const string &path, int number)
{
if (number!=0)
{
......@@ -77,7 +74,7 @@ void is_bsds::load(string &path, unsigned int number)
loadDataset(path);
}
void is_bsds::loadDataset(string &path)
void IS_bsds::loadDataset(const string &path)
{
string trainName(path + "iids_train.txt");
string testName(path + "iids_test.txt");
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/is_weizmann.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/is_weizmann.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,12 +49,12 @@ namespace datasetstools
using namespace std;
is_weizmann::is_weizmann(std::string &path)
IS_weizmann::IS_weizmann(const string &path)
{
loadDataset(path);
}
void is_weizmann::load(string &path, unsigned int number)
void IS_weizmann::load(const string &path, int number)
{
if (number!=0)
{
......@@ -68,7 +64,7 @@ void is_weizmann::load(string &path, unsigned int number)
loadDataset(path);
}
void is_weizmann::loadDataset(string &path)
void IS_weizmann::loadDataset(const string &path)
{
vector<string> fileNames;
getDirList(path, fileNames);
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/msm_epfl.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/msm_epfl.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,7 +49,7 @@ namespace datasetstools
using namespace std;
void msm_epfl::readFileDouble(string fileName, vector<double> &out)
void MSM_epfl::readFileDouble(const string &fileName, vector<double> &out)
{
ifstream infile(fileName.c_str());
double val;
......@@ -63,12 +59,12 @@ void msm_epfl::readFileDouble(string fileName, vector<double> &out)
}
}
msm_epfl::msm_epfl(std::string &path)
MSM_epfl::MSM_epfl(const string &path)
{
loadDataset(path);
}
void msm_epfl::load(string &path, unsigned int number)
void MSM_epfl::load(const string &path, int number)
{
if (number!=0)
{
......@@ -78,7 +74,7 @@ void msm_epfl::load(string &path, unsigned int number)
loadDataset(path);
}
void msm_epfl::loadDataset(string &path)
void MSM_epfl::loadDataset(const string &path)
{
string pathBounding(path + "bounding/");
string pathCamera(path + "camera/");
......@@ -92,9 +88,9 @@ void msm_epfl::loadDataset(string &path)
objectEpfl curr;
curr.imageName = *it;
readFileDouble(pathBounding + curr.imageName + ".bounding", curr.bounding);
readFileDouble(pathCamera + curr.imageName + ".camera", curr.camera);
readFileDouble(pathP + curr.imageName + ".P", curr.p);
readFileDouble(string(pathBounding + curr.imageName + ".bounding"), curr.bounding);
readFileDouble(string(pathCamera + curr.imageName + ".camera"), curr.camera);
readFileDouble(string(pathP + curr.imageName + ".P"), curr.p);
train.push_back(curr);
}
......
......@@ -39,11 +39,8 @@
//
//M*/
#include "opencv2/msm_middlebury.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/msm_middlebury.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -52,12 +49,12 @@ namespace datasetstools
using namespace std;
msm_middlebury::msm_middlebury(std::string &path)
MSM_middlebury::MSM_middlebury(const string &path)
{
loadDataset(path);
}
void msm_middlebury::load(string &path, unsigned int number)
void MSM_middlebury::load(const string &path, int number)
{
if (number!=0)
{
......@@ -67,7 +64,7 @@ void msm_middlebury::load(string &path, unsigned int number)
loadDataset(path);
}
void msm_middlebury::loadDataset(string &path)
void MSM_middlebury::loadDataset(const string &path)
{
string name(path.substr(0, path.length()-1));
size_t start = name.rfind('/');
......
......@@ -39,13 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/or_imagenet.hpp"
#include <cstdio>
#include <cstdlib> // atoi
#include <fstream>
#include "opencv2/datasetstools/or_imagenet.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -54,12 +49,12 @@ namespace datasetstools
using namespace std;
or_imagenet::or_imagenet(std::string &path)
OR_imagenet::OR_imagenet(const string &path)
{
loadDataset(path);
}
void or_imagenet::load(string &path, unsigned int number)
void OR_imagenet::load(const string &path, int number)
{
if (number!=0)
{
......@@ -69,7 +64,7 @@ void or_imagenet::load(string &path, unsigned int number)
loadDataset(path);
}
void or_imagenet::loadDataset(string &path)
void OR_imagenet::loadDataset(const string &path)
{
ifstream infile((path + "fall11_urls.txt").c_str());
string line;
......
......@@ -39,12 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/or_sun.hpp"
#include <cstdio>
#include <fstream>
#include "opencv2/datasetstools/or_sun.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -53,12 +49,12 @@ namespace datasetstools
using namespace std;
or_sun::or_sun(std::string &path)
OR_sun::OR_sun(const string &path)
{
loadDataset(path);
}
void or_sun::load(string &path, unsigned int number)
void OR_sun::load(const string &path, int number)
{
if (number!=0)
{
......@@ -68,7 +64,7 @@ void or_sun::load(string &path, unsigned int number)
loadDataset(path);
}
void or_sun::loadDataset(string &path)
void OR_sun::loadDataset(const string &path)
{
string classNameFile(path + "ClassName.txt");
ifstream infile(classNameFile.c_str());
......
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2014, Itseez Inc, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Itseez Inc or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__
#include <cstdio>
#include <cstdlib> // atoi, atof
#include <fstream>
#include "opencv2/datasetstools/util.hpp"
#endif
......@@ -39,13 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/slam_kitti.hpp"
#include <cstdio>
#include <cstdlib> // atof
#include <fstream>
#include "opencv2/datasetstools/slam_kitti.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -54,12 +49,12 @@ namespace datasetstools
using namespace std;
slam_kitti::slam_kitti(std::string &path)
SLAM_kitti::SLAM_kitti(const string &path)
{
loadDataset(path);
}
void slam_kitti::load(string &path, unsigned int number)
void SLAM_kitti::load(const string &path, int number)
{
if (number!=0)
{
......@@ -69,7 +64,7 @@ void slam_kitti::load(string &path, unsigned int number)
loadDataset(path);
}
void slam_kitti::loadDataset(string &path)
void SLAM_kitti::loadDataset(const string &path)
{
string pathSequence(path + "sequences/");
vector<string> fileNames;
......
......@@ -39,15 +39,11 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/slam_tumindoor.hpp"
#include "opencv2/datasetstools/slam_tumindoor.hpp"
#include "precomp.hpp"
#include <cstdio>
#include <cstdlib> // atof
#include <cstring>
#include <fstream>
namespace cv
{
namespace datasetstools
......@@ -55,12 +51,12 @@ namespace datasetstools
using namespace std;
slam_tumindoor::slam_tumindoor(std::string &path)
SLAM_tumindoor::SLAM_tumindoor(const string &path)
{
loadDataset(path);
}
void slam_tumindoor::load(string &path, unsigned int number)
void SLAM_tumindoor::load(const string &path, int number)
{
if (number!=0)
{
......@@ -70,7 +66,7 @@ void slam_tumindoor::load(string &path, unsigned int number)
loadDataset(path);
}
void slam_tumindoor::loadDataset(string &path)
void SLAM_tumindoor::loadDataset(const string &path)
{
string infoPath(path + "info/2011-12-17_15.02.56-info.csv"); // TODO
ifstream infile(infoPath.c_str());
......
......@@ -21,7 +21,7 @@ must not be misrepresented as being the original software.
distribution.
*/
#include <tinyxml2/tinyxml2.h>
#include "opencv2/datasetstools/tinyxml2/tinyxml2.h"
#include <new> // yes, this one new style header, is in the Android SDK.
# ifdef ANDROID_NDK
......
......@@ -39,13 +39,8 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/tr_chars.hpp"
#include <cstdio>
#include <cstdlib> // atoi
#include <fstream>
#include "opencv2/datasetstools/tr_chars.hpp"
#include "precomp.hpp"
namespace cv
{
......@@ -54,33 +49,33 @@ namespace datasetstools
using namespace std;
void tr_chars::parseLine(string &line, vector<int> &currSet, unsigned int number)
void TR_chars::parseLine(const string &line, vector<int> &currSet, int number)
{
vector<string> elems;
split(line, elems, ' ');
if (number>=elems.size())
if (number >= (int)elems.size())
{
return;
}
unsigned int ind = atoi(elems[number].c_str());
if (ind>0)
if (ind > 0)
{
currSet.push_back(ind-1); // take first split
currSet.push_back(ind-1);
}
}
tr_chars::tr_chars(std::string &path, unsigned int number)
TR_chars::TR_chars(const string &path, int number)
{
loadDataset(path, number);
}
void tr_chars::load(string &path, unsigned int number)
void TR_chars::load(const string &path, int number)
{
loadDataset(path, number);
}
void tr_chars::loadDataset(string &path, unsigned int number)
void TR_chars::loadDataset(const string &path, int number)
{
vector<int> allLabels, trainSet, testSet;
vector<string> allNames;
......
......@@ -39,15 +39,10 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/tr_svt.hpp"
#include "opencv2/datasetstools/tr_svt.hpp"
#include "precomp.hpp"
#include <tinyxml2/tinyxml2.h>
#include <cstdio>
#include <cstdlib> // atoi
#include <fstream>
#include <opencv2/datasetstools/tinyxml2/tinyxml2.h>
namespace cv
{
......@@ -57,7 +52,7 @@ namespace datasetstools
using namespace std;
using namespace tinyxml2;
void tr_svt::xmlParse(string &set, vector<image> &out)
void TR_svt::xmlParse(const string &set, vector<image> &out)
{
XMLDocument doc;
doc.LoadFile(set.c_str());
......@@ -102,12 +97,12 @@ void tr_svt::xmlParse(string &set, vector<image> &out)
}
}
tr_svt::tr_svt(std::string &path)
TR_svt::TR_svt(const string &path)
{
loadDataset(path);
}
void tr_svt::load(string &path, unsigned int number)
void TR_svt::load(const string &path, int number)
{
if (number!=0)
{
......@@ -117,7 +112,7 @@ void tr_svt::load(string &path, unsigned int number)
loadDataset(path);
}
void tr_svt::loadDataset(string &path)
void TR_svt::loadDataset(const string &path)
{
string trainXml(path + "train.xml");
string testXml(path + "test.xml");
......
......@@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/util.hpp"
#include "opencv2/datasetstools/util.hpp"
#include <cstdlib>
......@@ -60,7 +60,7 @@ namespace datasetstools
using namespace std;
void split(string s, vector<string> &elems, char delim)
void split(const string s, vector<string> &elems, char delim)
{
stringstream ss(s);
string item;
......@@ -70,7 +70,7 @@ void split(string s, vector<string> &elems, char delim)
}
}
void getDirList(string &dirName, vector<string> &fileNames)
void getDirList(const string &dirName, vector<string> &fileNames)
{
#ifdef __GNUC__
struct dirent **namelist;
......
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