105 const char *fields[] = {
"gestureID",
"initialFrame",
"lastFrame"};
107 for (
mwIndex i = 0; i < groundTruths.
size(); ++i) {
108 s.
set(
"gestureID", groundTruths[i].gestureID, i);
109 s.
set(
"initialFrame", groundTruths[i].initialFrame, i);
110 s.
set(
"lastFrame", groundTruths[i].lastFrame, i);
118 const char *fields[] = {
"Wx",
"Wy",
"Wz",
"Rx",
"Ry",
"Rz",
"Rw",
121 for (
mwIndex i = 0; i < 20; ++i) {
122 s.
set(
"Wx", skel.
s[i].
Wx, i);
123 s.
set(
"Wy", skel.
s[i].
Wy, i);
124 s.
set(
"Wz", skel.
s[i].
Wz, i);
125 s.
set(
"Rx", skel.
s[i].
Rx, i);
126 s.
set(
"Ry", skel.
s[i].
Ry, i);
127 s.
set(
"Rz", skel.
s[i].
Rz, i);
128 s.
set(
"Rw", skel.
s[i].
Rw, i);
129 s.
set(
"Px", skel.
s[i].
Px, i);
130 s.
set(
"Py", skel.
s[i].
Py, i);
138 const char *fields[] = {
"images"};
141 s.
set(
"images", pos[i].images, i);
149 const char *fields[] = {
"mat1",
"mat2",
"mat3",
"mat4",
"imageWidth",
164 const char *fields[] = {
"name",
"xmin",
"ymin",
"xmax",
"ymax"};
167 s.
set(
"name", parts[i].name, i);
168 s.
set(
"xmin", parts[i].xmin, i);
169 s.
set(
"ymin", parts[i].ymin, i);
170 s.
set(
"xmax", parts[i].xmax, i);
171 s.
set(
"ymax", parts[i].ymax, i);
179 const char *fields[] = {
"name",
"xmin",
"ymin",
"xmax",
"ymax",
180 "pose",
"truncated",
"difficult",
"occluded",
"parts"};
183 s.
set(
"name", objects[i].name, i);
184 s.
set(
"xmin", objects[i].xmin, i);
185 s.
set(
"ymin", objects[i].ymin, i);
186 s.
set(
"xmax", objects[i].xmax, i);
187 s.
set(
"ymax", objects[i].ymax, i);
188 s.
set(
"pose", objects[i].
pose, i);
189 s.
set(
"truncated", objects[i].truncated, i);
190 s.
set(
"difficult", objects[i].difficult, i);
191 s.
set(
"occluded", objects[i].occluded, i);
200 const char *fields[] = {
"elem"};
211 const char *fields[] = {
"value",
"height",
"width",
"x",
"y"};
214 s.
set(
"value", words[i].value, i);
215 s.
set(
"height", words[i].height, i);
216 s.
set(
"width", words[i].width, i);
217 s.
set(
"x", words[i].x, i);
218 s.
set(
"y", words[i].y, i);
226 const char *fields[] = {
"value",
"height",
"width",
"x",
"y"};
229 s.
set(
"value", tags[i].value, i);
230 s.
set(
"height", tags[i].height, i);
231 s.
set(
"width", tags[i].width, i);
232 s.
set(
"x", tags[i].x, i);
233 s.
set(
"y", tags[i].y, i);
244 const char *fields[] = {
"id",
"name",
"videoName"};
246 for (
mwIndex i = 0; i < objs.size(); ++i) {
248 s.
set(
"id", obj->
id, i);
261 const char *fields[] = {
"videoUrl",
"labels"};
263 for (
mwIndex i = 0; i < objs.size(); ++i) {
277 const char *fields[] = {
"user_id",
"original_image",
"face_id",
"age",
278 "gender",
"x",
"y",
"dx",
"dy",
"tilt_ang",
"fiducial_yaw_angle",
281 for (
mwIndex i = 0; i < objs.size(); ++i) {
286 s.
set(
"age", obj->
age, i);
288 s.
set(
"x", obj->
x, i);
289 s.
set(
"y", obj->
y, i);
290 s.
set(
"dx", obj->
dx, i);
291 s.
set(
"dy", obj->
dy, i);
305 const char *fields[] = {
"image1",
"image2",
"same"};
307 for (
mwIndex i = 0; i < objs.size(); ++i) {
322 const char *fields[] = {
"name",
"nameColor",
"nameDepth",
"nameUser",
323 "numFrames",
"fps",
"depth",
"groundTruths",
"skeletons"};
325 for (
mwIndex i = 0; i < objs.size(); ++i) {
332 s.
set(
"fps", obj->
fps, i);
339 s.
set(
"skeletons", c, i);
351 const char *fields[] = {
"rgb",
"dep",
"person",
"background",
352 "illumination",
"pose",
"type"};
354 for (
mwIndex i = 0; i < objs.size(); ++i) {
356 s.
set(
"rgb", obj->
rgb, i);
357 s.
set(
"dep", obj->
dep, i);
373 const char *fields[] = {
"person",
"action",
"type1",
"type2",
"ofs",
374 "fileName",
"imageNames"};
376 for (
mwIndex i = 0; i < objs.size(); ++i) {
382 s.
set(
"ofs", obj->
ofs, i);
395 const char *fields[] = {
"name"};
397 for (
mwIndex i = 0; i < objs.size(); ++i) {
410 const char *fields[] = {
"imageName",
"mat"};
412 for (
mwIndex i = 0; i < objs.size(); ++i) {
415 s.
set(
"mat", obj->
mat, i);
426 const char *fields[] = {
"name",
"pos"};
428 for (
mwIndex i = 0; i < objs.size(); ++i) {
442 const char *fields[] = {
"name"};
444 for (
mwIndex i = 0; i < objs.size(); ++i) {
457 const char *fields[] = {
"imageName",
"srcBw",
"srcColor",
"humanSeg"};
459 for (
mwIndex i = 0; i < objs.size(); ++i) {
475 const char *fields[] = {
"imageName",
"bounding",
"p",
"camera"};
477 for (
mwIndex i = 0; i < objs.size(); ++i) {
481 s.
set(
"p", obj->
p, i);
493 const char *fields[] = {
"imageName",
"k",
"r",
"t"};
495 for (
mwIndex i = 0; i < objs.size(); ++i) {
498 s.
set(
"k", obj->
k, i);
499 s.
set(
"r", obj->
r, i);
511 const char *fields[] = {
"id",
"image"};
513 for (
mwIndex i = 0; i < objs.size(); ++i) {
515 s.
set(
"id", obj->
id, i);
527 const char *fields[] = {
"label",
"image"};
529 for (
mwIndex i = 0; i < objs.size(); ++i) {
543 const char *fields[] = {
"filename",
"width",
"height",
"depth",
"objects"};
545 for (
mwIndex i = 0; i < objs.size(); ++i) {
562 const char *fields[] = {
"label",
"name"};
564 for (
mwIndex i = 0; i < objs.size(); ++i) {
578 const char *fields[] = {
"name",
"imageNames"};
580 for (
mwIndex i = 0; i < objs.size(); ++i) {
594 const char *fields[] = {
"filename",
"sType",
"width",
"height",
"depth",
597 for (
mwIndex i = 0; i < objs.size(); ++i) {
615 const char *fields[] = {
"name",
"images",
"velodyne",
"times",
"p",
618 for (
mwIndex i = 0; i < objs.size(); ++i) {
623 for (
mwIndex j = 0; j < 4; ++j)
625 s.
set(
"images", c, i);
631 for (
mwIndex j = 0; j < 4; ++j)
646 const char *fields[] = {
"name",
"transformMat",
"type"};
648 for (
mwIndex i = 0; i < objs.size(); ++i) {
663 const char *fields[] = {
"imgName",
"label"};
665 for (
mwIndex i = 0; i < objs.size(); ++i) {
679 const char *fields[] = {
"fileName",
"lex100",
"lexFull",
"words"};
681 for (
mwIndex i = 0; i < objs.size(); ++i) {
697 const char *fields[] = {
"fileName",
"lex",
"tags"};
699 for (
mwIndex i = 0; i < objs.size(); ++i) {
702 s.
set(
"lex", obj->
lex, i);
714 const char *fields[] = {
"id",
"imagePath",
"gtbb"};
716 for (
mwIndex i = 0; i < objs.size(); ++i) {
718 s.
set(
"id", obj->
id, i);
731 const char *fields[] = {
"id",
"imagePath",
"gtbb"};
733 for (
mwIndex i = 0; i < objs.size(); ++i) {
735 s.
set(
"id", obj->
id, i);
749 if (klass ==
"AR_hmdb")
751 else if (klass ==
"AR_sports")
753 else if (klass ==
"FR_adience")
755 else if (klass ==
"FR_lfw")
757 else if (klass ==
"GR_chalearn")
759 else if (klass ==
"GR_skig")
761 else if (klass ==
"HPE_humaneva")
763 else if (klass ==
"HPE_parse")
765 else if (klass ==
"IR_affine")
767 else if (klass ==
"IR_robot")
769 else if (klass ==
"IS_bsds")
771 else if (klass ==
"IS_weizmann")
773 else if (klass ==
"MSM_epfl")
775 else if (klass ==
"MSM_middlebury")
777 else if (klass ==
"OR_imagenet")
779 else if (klass ==
"OR_mnist")
781 else if (klass ==
"OR_pascal")
783 else if (klass ==
"OR_sun")
785 else if (klass ==
"PD_caltech")
787 else if (klass ==
"PD_inria")
789 else if (klass ==
"SLAM_kitti")
791 else if (klass ==
"SLAM_tumindoor")
793 else if (klass ==
"TR_chars")
795 else if (klass ==
"TR_icdar")
797 else if (klass ==
"TR_svt")
799 else if (klass ==
"TRACK_vot")
801 else if (klass ==
"TRACK_alov")
805 "Unrecognized dataset class %s",klass.
c_str());
815 if (
type ==
"AR_hmdb")
817 else if (
type ==
"AR_sports")
819 else if (
type ==
"FR_adience")
821 else if (
type ==
"FR_lfw")
823 else if (
type ==
"GR_chalearn")
825 else if (
type ==
"GR_skig")
827 else if (
type ==
"HPE_humaneva")
829 else if (
type ==
"HPE_parse")
831 else if (
type ==
"IR_affine")
833 else if (
type ==
"IR_robot")
835 else if (
type ==
"IS_bsds")
837 else if (
type ==
"IS_weizmann")
839 else if (
type ==
"MSM_epfl")
841 else if (
type ==
"MSM_middlebury")
843 else if (
type ==
"OR_imagenet")
845 else if (
type ==
"OR_mnist")
847 else if (
type ==
"OR_pascal")
849 else if (
type ==
"OR_sun")
851 else if (
type ==
"PD_caltech")
853 else if (
type ==
"PD_inria")
855 else if (
type ==
"SLAM_kitti")
857 else if (
type ==
"SLAM_tumindoor")
859 else if (
type ==
"TR_chars")
861 else if (
type ==
"TR_icdar")
863 else if (
type ==
"TR_svt")
865 else if (
type ==
"TRACK_vot")
867 else if (
type ==
"TRACK_alov")
871 "Unrecognized dataset %s",
type.c_str());
892 int id = rhs[0].toInt();
893 string method(rhs[1].toString());
894 string klass(rhs[2].toString());
897 if (method ==
"new") {
905 else if (method ==
"createDirectory") {
907 string path(rhs[3].toString());
911 else if (method ==
"getDirList") {
913 string dirName(rhs[3].toString());
919 else if (method ==
"split") {
921 string s(rhs[3].toString());
922 char delim = (!rhs[4].isEmpty()) ? rhs[4].toString()[0] :
' ';
933 if (method ==
"delete") {
938 else if (method ==
"typeid") {
940 plhs[0] =
MxArray(
string(
typeid(*obj).name()));
942 else if (method ==
"load") {
944 obj->
load(rhs[3].toString());
946 else if (method ==
"getNumSplits") {
950 else if (method ==
"getTrain") {
951 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=1);
953 for (
int i=3; i<nrhs; i+=2) {
954 string key(rhs[i].toString());
955 if (key ==
"SplitNum")
956 splitNum = rhs[i+1].toInt();
959 "Unrecognized option %s", key.
c_str());
963 else if (method ==
"getTest") {
964 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=1);
966 for (
int i=3; i<nrhs; i+=2) {
967 string key(rhs[i].toString());
968 if (key ==
"SplitNum")
969 splitNum = rhs[i+1].toInt();
972 "Unrecognized option %s", key.
c_str());
976 else if (method ==
"getValidation") {
977 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=1);
979 for (
int i=3; i<nrhs; i+=2) {
980 string key(rhs[i].toString());
981 if (key ==
"SplitNum")
982 splitNum = rhs[i+1].toInt();
985 "Unrecognized option %s", key.
c_str());
991 "Unrecognized operation %s",method.
c_str());
std::vector< double > times
std::string original_image
const ConstMap< int, string > ImageTypeInvMap
map for cv::datasets::imageType enum values
MxArray toStruct_SLAM_kitti(const vector< Ptr< Object > > &objs)
Convert SLAM_kitti objects to struct array.
std::vector< Ptr< Object > > & getValidation(int splitNum=0)
MxArray toStruct_PD_caltech(const vector< Ptr< Object > > &objs)
Convert PD_caltech objects to struct array.
std::vector< std::string > lex100
std::vector< skeleton > skeletons
MxArray toStruct(const vector< Ptr< Object > > &objs, const string &klass)
Convert objects to struct array.
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
std::vector< std::string > lexFull
virtual void load(const std::string &path)=0
MxArray toStruct_FR_adience(const vector< Ptr< Object > > &objs)
Convert FR_adience objects to struct array.
Ptr< Y > staticCast() const
MxArray toStruct_OR_imagenet(const vector< Ptr< Object > > &objs)
Convert OR_imagenet objects to struct array.
std::vector< std::string > imageNames
MxArray toStruct_MSM_middlebury(const vector< Ptr< Object > > &objs)
Convert MSM_middlebury objects to struct array.
struct mxArray_tag mxArray
Forward declaration for mxArray.
MxArray toStruct_IS_bsds(const vector< Ptr< Object > > &objs)
Convert IS_bsds objects to struct array.
void set(mwIndex index, const T &value)
Template for numeric array element write accessor.
MxArray toStruct_HPE_humaneva(const vector< Ptr< Object > > &objs)
Convert HPE_humaneva objects to struct array.
std::vector< word > words
backgroundType background
MxArray toStruct_OR_mnist(const vector< Ptr< Object > > &objs)
Convert OR_mnist objects to struct array.
const ConstMap< int, string > BackgroundTypeInvMap
map for cv::datasets::backgroundType enum values
void createDirectory(const std::string &path)
std::vector< std::string > velodyne
MxArray toStruct_SLAM_tumindoor(const vector< Ptr< Object > > &objs)
Convert SLAM_tumindoor objects to struct array.
std::vector< int > labels
illuminationType illumination
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
std::vector< Ptr< Object > > & getTest(int splitNum=0)
int last_id
Last object id to allocate.
MxArray toStruct_IR_robot(const vector< Ptr< Object > > &objs)
Convert IR_robot objects to struct array.
MxArray toStruct_AR_sports(const vector< Ptr< Object > > &objs)
Convert AR_sports objects to struct array.
const ConstMap< int, string > SampleTypeInvMap
map for cv::datasets::sampleType enum values
MxArray toStruct_PD_inria(const vector< Ptr< Object > > &objs)
Convert PD_inria objects to struct array.
MxArray toStruct_TRACK_alov(const vector< Ptr< Object > > &objs)
Convert TRACK_alov objects to struct array.
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
std::vector< Ptr< Object > > & getTrain(int splitNum=0)
std::vector< std::string > imageNames
MxArray toStruct_GR_skig(const vector< Ptr< Object > > &objs)
Convert GR_skig objects to struct array.
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
MxArray toStruct_GR_chalearn(const vector< Ptr< Object > > &objs)
Convert GR_chalearn objects to struct array.
MxArray toStruct_IS_weizmann(const vector< Ptr< Object > > &objs)
Convert IS_weizmann objects to struct array.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
static MxArray Struct(const char **fields=NULL, int nfields=0, mwSize m=1, mwSize n=1)
Create a new struct array.
MxArray toStruct_OR_pascal(const vector< Ptr< Object > > &objs)
Convert OR_pascal objects to struct array.
MxArray toStruct_OR_sun(const vector< Ptr< Object > > &objs)
Convert OR_sun objects to struct array.
static MxArray Cell(mwSize m=1, mwSize n=1)
Create a new cell array.
MxArray toStruct_TR_svt(const vector< Ptr< Object > > &objs)
Convert TR_svt objects to struct array.
const ConstMap< int, string > PoseTypeInvMap
map for cv::datasets::poseType enum values
Global constant definitions.
MxArray toStruct_AR_hmdb(const vector< Ptr< Object > > &objs)
Convert AR_hmdb objects to struct array.
MxArray toStruct_FR_lfw(const vector< Ptr< Object > > &objs)
Convert FR_lfw objects to struct array.
Ptr< Dataset > create_Dataset(const string &type)
Create an instance of Dataset of specified type.
map< int, Ptr< Dataset > > obj_
Object container.
std::vector< pose > posesArray
const ConstMap< int, string > ActionTypeInvMap
map for cv::datasets::actionType enum values
const ConstMap< int, string > GenderTypeInvMap
map for cv::datasets::genderType enum values
std::vector< std::string > lex
std::vector< cameraPos > pos
std::vector< double > p[4]
std::vector< groundTruth > groundTruths
MxArray toStruct_HPE_parse(const vector< Ptr< Object > > &objs)
Convert HPE_parse objects to struct array.
MxArray toStruct_TR_chars(const vector< Ptr< Object > > &objs)
Convert TR_chars objects to struct array.
MxArray toStruct_IR_affine(const vector< Ptr< Object > > &objs)
Convert IR_affine objects to struct array.
std::map wrapper with one-line initialization and lookup method.
std::vector< PascalObj > objects
void getDirList(const std::string &dirName, std::vector< std::string > &fileNames)
const ConstMap< int, string > DatasetTypeInvMap
map for cv::datasets::datasetType enum values
MxArray toStruct_TRACK_vot(const vector< Ptr< Object > > &objs)
Convert TRACK_vot objects to struct array.
void create(int arows, int acols, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
MxArray toStruct_MSM_epfl(const vector< Ptr< Object > > &objs)
Convert MSM_epfl objects to struct array.
MxArray toStruct_TR_icdar(const vector< Ptr< Object > > &objs)
Convert TR_icdar objects to struct array.
std::vector< Rect > bndboxes
void split(const std::string &s, std::vector< std::string > &elems, char delim)
std::vector< std::string > images[4]
const ConstMap< int, string > IlluminationTypeInvMap
map for cv::datasets::illuminationType enum values