Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
7597e46e
Commit
7597e46e
authored
Sep 03, 2014
by
dmitriy.anisimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interface-implementation pattern implemented
parent
d3568b7e
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
543 additions
and
294 deletions
+543
-294
ar_hmdb.hpp
...s/datasetstools/include/opencv2/datasetstools/ar_hmdb.hpp
+2
-9
ar_sports.hpp
...datasetstools/include/opencv2/datasetstools/ar_sports.hpp
+2
-9
dataset.hpp
...s/datasetstools/include/opencv2/datasetstools/dataset.hpp
+4
-0
fr_lfw.hpp
...es/datasetstools/include/opencv2/datasetstools/fr_lfw.hpp
+2
-7
gr_chalearn.hpp
...tasetstools/include/opencv2/datasetstools/gr_chalearn.hpp
+2
-7
gr_skig.hpp
...s/datasetstools/include/opencv2/datasetstools/gr_skig.hpp
+2
-7
hpe_parse.hpp
...datasetstools/include/opencv2/datasetstools/hpe_parse.hpp
+2
-7
ir_affine.hpp
...datasetstools/include/opencv2/datasetstools/ir_affine.hpp
+2
-7
ir_robot.hpp
.../datasetstools/include/opencv2/datasetstools/ir_robot.hpp
+2
-7
is_bsds.hpp
...s/datasetstools/include/opencv2/datasetstools/is_bsds.hpp
+2
-9
is_weizmann.hpp
...tasetstools/include/opencv2/datasetstools/is_weizmann.hpp
+2
-7
msm_epfl.hpp
.../datasetstools/include/opencv2/datasetstools/msm_epfl.hpp
+2
-9
msm_middlebury.hpp
...etstools/include/opencv2/datasetstools/msm_middlebury.hpp
+4
-9
or_imagenet.hpp
...tasetstools/include/opencv2/datasetstools/or_imagenet.hpp
+2
-10
or_sun.hpp
...es/datasetstools/include/opencv2/datasetstools/or_sun.hpp
+2
-7
slam_kitti.hpp
...atasetstools/include/opencv2/datasetstools/slam_kitti.hpp
+2
-7
slam_tumindoor.hpp
...etstools/include/opencv2/datasetstools/slam_tumindoor.hpp
+3
-8
tr_chars.hpp
.../datasetstools/include/opencv2/datasetstools/tr_chars.hpp
+2
-9
tr_svt.hpp
...es/datasetstools/include/opencv2/datasetstools/tr_svt.hpp
+2
-9
ar_hmdb.cpp
modules/datasetstools/samples/ar_hmdb.cpp
+4
-3
ar_sports.cpp
modules/datasetstools/samples/ar_sports.cpp
+5
-4
fr_lfw.cpp
modules/datasetstools/samples/fr_lfw.cpp
+4
-3
gr_chalearn.cpp
modules/datasetstools/samples/gr_chalearn.cpp
+4
-3
gr_skig.cpp
modules/datasetstools/samples/gr_skig.cpp
+4
-3
hpe_parse.cpp
modules/datasetstools/samples/hpe_parse.cpp
+6
-5
ir_affine.cpp
modules/datasetstools/samples/ir_affine.cpp
+4
-3
ir_robot.cpp
modules/datasetstools/samples/ir_robot.cpp
+4
-3
is_bsds.cpp
modules/datasetstools/samples/is_bsds.cpp
+6
-5
is_weizmann.cpp
modules/datasetstools/samples/is_weizmann.cpp
+4
-3
msm_epfl.cpp
modules/datasetstools/samples/msm_epfl.cpp
+4
-3
msm_middlebury.cpp
modules/datasetstools/samples/msm_middlebury.cpp
+6
-5
or_imagenet.cpp
modules/datasetstools/samples/or_imagenet.cpp
+4
-4
or_sun.cpp
modules/datasetstools/samples/or_sun.cpp
+4
-3
slam_kitti.cpp
modules/datasetstools/samples/slam_kitti.cpp
+4
-3
slam_tumindoor.cpp
modules/datasetstools/samples/slam_tumindoor.cpp
+5
-4
tr_chars.cpp
modules/datasetstools/samples/tr_chars.cpp
+6
-6
tr_svt.cpp
modules/datasetstools/samples/tr_svt.cpp
+5
-4
ar_hmdb.cpp
modules/datasetstools/src/ar_hmdb.cpp
+25
-5
ar_sports.cpp
modules/datasetstools/src/ar_sports.cpp
+25
-5
fr_lfw.cpp
modules/datasetstools/src/fr_lfw.cpp
+22
-4
gr_chalearn.cpp
modules/datasetstools/src/gr_chalearn.cpp
+22
-4
gr_skig.cpp
modules/datasetstools/src/gr_skig.cpp
+22
-4
hpe_parse.cpp
modules/datasetstools/src/hpe_parse.cpp
+22
-4
ir_affine.cpp
modules/datasetstools/src/ir_affine.cpp
+22
-4
ir_robot.cpp
modules/datasetstools/src/ir_robot.cpp
+22
-4
is_bsds.cpp
modules/datasetstools/src/is_bsds.cpp
+25
-5
is_weizmann.cpp
modules/datasetstools/src/is_weizmann.cpp
+22
-4
msm_epfl.cpp
modules/datasetstools/src/msm_epfl.cpp
+25
-5
msm_middlebury.cpp
modules/datasetstools/src/msm_middlebury.cpp
+24
-6
or_imagenet.cpp
modules/datasetstools/src/or_imagenet.cpp
+22
-6
or_sun.cpp
modules/datasetstools/src/or_sun.cpp
+22
-4
slam_kitti.cpp
modules/datasetstools/src/slam_kitti.cpp
+22
-4
slam_tumindoor.cpp
modules/datasetstools/src/slam_tumindoor.cpp
+23
-5
tr_chars.cpp
modules/datasetstools/src/tr_chars.cpp
+25
-5
tr_svt.cpp
modules/datasetstools/src/tr_svt.cpp
+25
-5
No files found.
modules/datasetstools/include/opencv2/datasetstools/ar_hmdb.hpp
View file @
7597e46e
...
...
@@ -63,16 +63,9 @@ struct AR_hmdbObj : public Object
class
CV_EXPORTS
AR_hmdb
:
public
Dataset
{
public
:
AR_hmdb
()
{}
AR_hmdb
(
const
std
::
string
&
path
,
int
number
=
0
);
virtual
~
AR_hmdb
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
,
int
number
=
0
);
void
loadAction
(
const
std
::
string
&
fileName
,
std
::
vector
<
std
::
string
>
&
train_
,
std
::
vector
<
std
::
string
>
&
test_
);
static
Ptr
<
AR_hmdb
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/ar_sports.hpp
View file @
7597e46e
...
...
@@ -63,16 +63,9 @@ struct AR_sportsObj : public Object
class
CV_EXPORTS
AR_sports
:
public
Dataset
{
public
:
AR_sports
()
{}
AR_sports
(
const
std
::
string
&
path
);
virtual
~
AR_sports
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
loadDatasetPart
(
const
std
::
string
&
fileName
,
std
::
vector
<
Ptr
<
Object
>
>
&
dataset_
);
static
Ptr
<
AR_sports
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/dataset.hpp
View file @
7597e46e
...
...
@@ -64,6 +64,10 @@ public:
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
std
::
vector
<
Ptr
<
Object
>
>&
getTrain
()
{
return
train
;
}
std
::
vector
<
Ptr
<
Object
>
>&
getTest
()
{
return
test
;
}
protected
:
std
::
vector
<
Ptr
<
Object
>
>
train
;
std
::
vector
<
Ptr
<
Object
>
>
test
;
};
...
...
modules/datasetstools/include/opencv2/datasetstools/fr_lfw.hpp
View file @
7597e46e
...
...
@@ -63,14 +63,9 @@ struct FR_lfwObj : public Object
class
CV_EXPORTS
FR_lfw
:
public
Dataset
{
public
:
FR_lfw
()
{}
FR_lfw
(
const
std
::
string
&
path
);
virtual
~
FR_lfw
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
FR_lfw
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/gr_chalearn.hpp
View file @
7597e46e
...
...
@@ -80,14 +80,9 @@ struct GR_chalearnObj : public Object
class
CV_EXPORTS
GR_chalearn
:
public
Dataset
{
public
:
GR_chalearn
()
{}
GR_chalearn
(
const
std
::
string
&
path
);
virtual
~
GR_chalearn
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
GR_chalearn
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/gr_skig.hpp
View file @
7597e46e
...
...
@@ -102,14 +102,9 @@ struct GR_skigObj : public Object
class
CV_EXPORTS
GR_skig
:
public
Dataset
{
public
:
GR_skig
()
{}
GR_skig
(
const
std
::
string
&
path
);
virtual
~
GR_skig
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
GR_skig
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/hpe_parse.hpp
View file @
7597e46e
...
...
@@ -62,14 +62,9 @@ struct HPE_parseObj : public Object
class
CV_EXPORTS
HPE_parse
:
public
Dataset
{
public
:
HPE_parse
()
{}
HPE_parse
(
const
std
::
string
&
path
);
virtual
~
HPE_parse
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
HPE_parse
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/ir_affine.hpp
View file @
7597e46e
...
...
@@ -64,14 +64,9 @@ struct IR_affineObj : public Object
class
CV_EXPORTS
IR_affine
:
public
Dataset
{
public
:
IR_affine
()
{}
IR_affine
(
const
std
::
string
&
path
);
virtual
~
IR_affine
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
IR_affine
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/ir_robot.hpp
View file @
7597e46e
...
...
@@ -68,14 +68,9 @@ struct IR_robotObj : public Object
class
CV_EXPORTS
IR_robot
:
public
Dataset
{
public
:
IR_robot
()
{}
IR_robot
(
const
std
::
string
&
path
);
virtual
~
IR_robot
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
IR_robot
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/is_bsds.hpp
View file @
7597e46e
...
...
@@ -62,16 +62,9 @@ struct IS_bsdsObj : public Object
class
CV_EXPORTS
IS_bsds
:
public
Dataset
{
public
:
IS_bsds
()
{}
IS_bsds
(
const
std
::
string
&
path
);
virtual
~
IS_bsds
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
loadDatasetPart
(
const
std
::
string
&
fileName
,
std
::
vector
<
Ptr
<
Object
>
>
&
dataset_
);
static
Ptr
<
IS_bsds
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/is_weizmann.hpp
View file @
7597e46e
...
...
@@ -65,14 +65,9 @@ struct IS_weizmannObj : public Object
class
CV_EXPORTS
IS_weizmann
:
public
Dataset
{
public
:
IS_weizmann
()
{}
IS_weizmann
(
const
std
::
string
&
path
);
virtual
~
IS_weizmann
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
IS_weizmann
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/msm_epfl.hpp
View file @
7597e46e
...
...
@@ -63,16 +63,9 @@ struct MSM_epflObj : public Object
class
CV_EXPORTS
MSM_epfl
:
public
Dataset
{
public
:
MSM_epfl
()
{}
MSM_epfl
(
const
std
::
string
&
path
);
virtual
~
MSM_epfl
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
readFileDouble
(
const
std
::
string
&
fileName
,
std
::
vector
<
double
>
&
out
);
static
Ptr
<
MSM_epfl
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/msm_middlebury.hpp
View file @
7597e46e
...
...
@@ -57,22 +57,17 @@ namespace datasetstools
struct
MSM_middleburyObj
:
public
Object
{
std
::
string
imageName
;
double
k
[
3
][
3
]
;
double
r
[
3
][
3
]
;
Matx33d
k
;
Matx33d
r
;
double
t
[
3
];
};
class
CV_EXPORTS
MSM_middlebury
:
public
Dataset
{
public
:
MSM_middlebury
()
{}
MSM_middlebury
(
const
std
::
string
&
path
);
virtual
~
MSM_middlebury
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
MSM_middlebury
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/or_imagenet.hpp
View file @
7597e46e
...
...
@@ -44,7 +44,6 @@
#include <string>
#include <vector>
#include <set>
#include "opencv2/datasetstools/dataset.hpp"
...
...
@@ -65,16 +64,9 @@ struct OR_imagenetObj : public Object
class
CV_EXPORTS
OR_imagenet
:
public
Dataset
{
public
:
OR_imagenet
()
{}
OR_imagenet
(
const
std
::
string
&
path
);
virtual
~
OR_imagenet
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
std
::
set
<
std
::
string
>
wnids
;
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
OR_imagenet
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/or_sun.hpp
View file @
7597e46e
...
...
@@ -63,14 +63,9 @@ struct OR_sunObj : public Object
class
CV_EXPORTS
OR_sun
:
public
Dataset
{
public
:
OR_sun
()
{}
OR_sun
(
const
std
::
string
&
path
);
virtual
~
OR_sun
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
OR_sun
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/slam_kitti.hpp
View file @
7597e46e
...
...
@@ -71,14 +71,9 @@ struct SLAM_kittiObj : public Object
class
CV_EXPORTS
SLAM_kitti
:
public
Dataset
{
public
:
SLAM_kitti
()
{}
SLAM_kitti
(
const
std
::
string
&
path
);
virtual
~
SLAM_kitti
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
SLAM_kitti
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/slam_tumindoor.hpp
View file @
7597e46e
...
...
@@ -64,21 +64,16 @@ enum imageType
struct
SLAM_tumindoorObj
:
public
Object
{
std
::
string
name
;
double
transformMat
[
4
][
4
]
;
Matx44d
transformMat
;
imageType
type
;
};
class
CV_EXPORTS
SLAM_tumindoor
:
public
Dataset
{
public
:
SLAM_tumindoor
()
{}
SLAM_tumindoor
(
const
std
::
string
&
path
);
virtual
~
SLAM_tumindoor
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
static
Ptr
<
SLAM_tumindoor
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/tr_chars.hpp
View file @
7597e46e
...
...
@@ -63,16 +63,9 @@ struct TR_charsObj : public Object
class
CV_EXPORTS
TR_chars
:
public
Dataset
{
public
:
TR_chars
()
{}
TR_chars
(
const
std
::
string
&
path
,
int
number
=
0
);
virtual
~
TR_chars
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
,
int
number
=
0
);
void
parseLine
(
const
std
::
string
&
line
,
std
::
vector
<
int
>
&
currSet
,
int
number
);
static
Ptr
<
TR_chars
>
create
();
};
}
...
...
modules/datasetstools/include/opencv2/datasetstools/tr_svt.hpp
View file @
7597e46e
...
...
@@ -70,16 +70,9 @@ struct TR_svtObj : public Object
class
CV_EXPORTS
TR_svt
:
public
Dataset
{
public
:
TR_svt
()
{}
TR_svt
(
const
std
::
string
&
path
);
virtual
~
TR_svt
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
)
=
0
;
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
xmlParse
(
const
std
::
string
&
set
,
std
::
vector
<
Ptr
<
Object
>
>
&
out
);
static
Ptr
<
TR_svt
>
create
();
};
}
...
...
modules/datasetstools/samples/ar_hmdb.cpp
View file @
7597e46e
...
...
@@ -65,17 +65,18 @@ int main(int argc, char *argv[])
return
-
1
;
}
AR_hmdb
dataset
[
3
];
Ptr
<
AR_hmdb
>
dataset
[
3
];
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
dataset
[
i
].
load
(
path
,
i
);
dataset
[
i
]
=
AR_hmdb
::
create
();
dataset
[
i
]
->
load
(
path
,
i
);
}
// ***************
// dataset contains for each split: a set of video file names for each action.
// For example, let output all training video file names for second split and first action.
// And its size.
AR_hmdbObj
*
example
=
static_cast
<
AR_hmdbObj
*>
(
dataset
[
1
]
.
train
[
0
].
get
());
AR_hmdbObj
*
example
=
static_cast
<
AR_hmdbObj
*>
(
dataset
[
1
]
->
getTrain
()
[
0
].
get
());
printf
(
"name: %s
\n
"
,
example
->
name
.
c_str
());
vector
<
string
>
&
videoNames
=
example
->
videoNames
;
printf
(
"size: %u
\n
"
,
(
unsigned
int
)
videoNames
.
size
());
...
...
modules/datasetstools/samples/ar_sports.cpp
View file @
7597e46e
...
...
@@ -66,16 +66,17 @@ int main(int argc, char *argv[])
return
-
1
;
}
AR_sports
dataset
(
path
);
Ptr
<
AR_sports
>
dataset
=
AR_sports
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset. train & test contains for each video url in dataset all it's labels.
// For example, let output the first element in test dataset and it's labels.
// And sizes of both datasets.
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
.
test
.
size
());
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTest
()
.
size
());
AR_sportsObj
*
example
=
static_cast
<
AR_sportsObj
*>
(
dataset
.
test
[
0
].
get
());
AR_sportsObj
*
example
=
static_cast
<
AR_sportsObj
*>
(
dataset
->
getTest
()
[
0
].
get
());
printf
(
"url: %s
\n
"
,
example
->
videoUrl
.
c_str
());
printf
(
"labels: "
);
vector
<
int
>
&
labels
=
example
->
labels
;
...
...
modules/datasetstools/samples/fr_lfw.cpp
View file @
7597e46e
...
...
@@ -65,13 +65,14 @@ int main(int argc, char *argv[])
return
-
1
;
}
FR_lfw
dataset
(
path
);
Ptr
<
FR_lfw
>
dataset
=
FR_lfw
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains object with name and its images.
// For example, let output dataset size and sixth element.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
FR_lfwObj
*
example
=
static_cast
<
FR_lfwObj
*>
(
dataset
.
train
[
5
].
get
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
FR_lfwObj
*
example
=
static_cast
<
FR_lfwObj
*>
(
dataset
->
getTrain
()
[
5
].
get
());
printf
(
"sixth dataset object:
\n
%s
\n
"
,
example
->
name
.
c_str
());
string
currPath
(
path
+
example
->
name
+
"/"
);
for
(
vector
<
string
>::
iterator
it
=
example
->
images
.
begin
();
it
!=
example
->
images
.
end
();
++
it
)
...
...
modules/datasetstools/samples/gr_chalearn.cpp
View file @
7597e46e
...
...
@@ -65,13 +65,14 @@ int main(int argc, char *argv[])
return
-
1
;
}
GR_chalearn
dataset
(
path
);
Ptr
<
GR_chalearn
>
dataset
=
GR_chalearn
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains information for each sample.
// For example, let output dataset size and first element.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
GR_chalearnObj
*
example
=
static_cast
<
GR_chalearnObj
*>
(
dataset
.
train
[
0
].
get
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
GR_chalearnObj
*
example
=
static_cast
<
GR_chalearnObj
*>
(
dataset
->
getTrain
()
[
0
].
get
());
printf
(
"first dataset sample:
\n
%s
\n
"
,
example
->
name
.
c_str
());
printf
(
"color video:
\n
%s
\n
"
,
example
->
nameColor
.
c_str
());
printf
(
"depth video:
\n
%s
\n
"
,
example
->
nameDepth
.
c_str
());
...
...
modules/datasetstools/samples/gr_skig.cpp
View file @
7597e46e
...
...
@@ -66,13 +66,14 @@ int main(int argc, char *argv[])
return
-
1
;
}
GR_skig
dataset
(
path
);
Ptr
<
GR_skig
>
dataset
=
GR_skig
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains pair of rgb\dep images
// For example, let output train size and second element.
GR_skigObj
*
example
=
static_cast
<
GR_skigObj
*>
(
dataset
.
train
[
1
].
get
());
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
GR_skigObj
*
example
=
static_cast
<
GR_skigObj
*>
(
dataset
->
getTrain
()
[
1
].
get
());
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
printf
(
"second train image:
\n
rgb: %s
\n
dep: %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
->
type
);
...
...
modules/datasetstools/samples/hpe_parse.cpp
View file @
7597e46e
...
...
@@ -65,15 +65,16 @@ int main(int argc, char *argv[])
return
-
1
;
}
HPE_parse
dataset
(
path
);
Ptr
<
HPE_parse
>
dataset
=
HPE_parse
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset. train & test contain appropriate images
// For example, let output their sizes and first elements.
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
.
test
.
size
());
HPE_parseObj
*
example1
=
static_cast
<
HPE_parseObj
*>
(
dataset
.
train
[
0
].
get
());
HPE_parseObj
*
example2
=
static_cast
<
HPE_parseObj
*>
(
dataset
.
test
[
0
].
get
());
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTest
()
.
size
());
HPE_parseObj
*
example1
=
static_cast
<
HPE_parseObj
*>
(
dataset
->
getTrain
()
[
0
].
get
());
HPE_parseObj
*
example2
=
static_cast
<
HPE_parseObj
*>
(
dataset
->
getTest
()
[
0
].
get
());
printf
(
"first train image: %s
\n
"
,
example1
->
name
.
c_str
());
printf
(
"first test image: %s
\n
"
,
example2
->
name
.
c_str
());
...
...
modules/datasetstools/samples/ir_affine.cpp
View file @
7597e46e
...
...
@@ -67,15 +67,16 @@ int main(int argc, char *argv[])
}
// loading dataset
IR_affine
dataset
(
path
);
Ptr
<
IR_affine
>
dataset
=
IR_affine
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains for each image in dataset it's matrix.
// For example, let output the last element in dataset and it's matrix.
// And dataset size.
printf
(
"size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
IR_affineObj
*
example
=
static_cast
<
IR_affineObj
*>
(
dataset
.
train
.
back
().
get
());
IR_affineObj
*
example
=
static_cast
<
IR_affineObj
*>
(
dataset
->
getTrain
()
.
back
().
get
());
printf
(
"image name: %s
\n
"
,
example
->
imageName
.
c_str
());
printf
(
"matrix:
\n
"
);
for
(
int
i
=
0
;
i
<
3
;
++
i
)
...
...
modules/datasetstools/samples/ir_robot.cpp
View file @
7597e46e
...
...
@@ -65,19 +65,20 @@ int main(int argc, char *argv[])
return
-
1
;
}
IR_robot
dataset
(
path
);
Ptr
<
IR_robot
>
dataset
=
IR_robot
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains object with name and its images.
// For example, let output last element and dataset size.
IR_robotObj
*
example
=
static_cast
<
IR_robotObj
*>
(
dataset
.
train
.
back
().
get
());
IR_robotObj
*
example
=
static_cast
<
IR_robotObj
*>
(
dataset
->
getTrain
()
.
back
().
get
());
printf
(
"last dataset object:
\n
%s
\n
"
,
example
->
name
.
c_str
());
string
currPath
(
path
+
example
->
name
+
"/"
);
for
(
vector
<
string
>::
iterator
it
=
example
->
images
.
begin
();
it
!=
example
->
images
.
end
();
++
it
)
{
printf
(
"%s
\n
"
,
(
currPath
+
(
*
it
)).
c_str
());
}
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
return
0
;
}
modules/datasetstools/samples/is_bsds.cpp
View file @
7597e46e
...
...
@@ -65,7 +65,8 @@ int main(int argc, char *argv[])
return
-
1
;
}
IS_bsds
dataset
(
path
);
Ptr
<
IS_bsds
>
dataset
=
IS_bsds
::
create
();
dataset
->
load
(
path
);
// TODO: read human/ folder for evaluation
...
...
@@ -73,13 +74,13 @@ int main(int argc, char *argv[])
// dataset. train & test contain names of appropriate images.
// For example, let output full path & name for first train and test images.
// And sets size.
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
.
test
.
size
());
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTest
()
.
size
());
IS_bsdsObj
*
example1
=
static_cast
<
IS_bsdsObj
*>
(
dataset
.
train
[
0
].
get
());
IS_bsdsObj
*
example1
=
static_cast
<
IS_bsdsObj
*>
(
dataset
->
getTrain
()
[
0
].
get
());
string
fullPath
(
path
+
"images/train/"
+
example1
->
name
+
".jpg"
);
printf
(
"first train image: %s
\n
"
,
fullPath
.
c_str
());
IS_bsdsObj
*
example2
=
static_cast
<
IS_bsdsObj
*>
(
dataset
.
test
[
0
].
get
());
IS_bsdsObj
*
example2
=
static_cast
<
IS_bsdsObj
*>
(
dataset
->
getTest
()
[
0
].
get
());
fullPath
=
path
+
"images/test/"
+
example2
->
name
+
".jpg"
;
printf
(
"first test image: %s
\n
"
,
fullPath
.
c_str
());
...
...
modules/datasetstools/samples/is_weizmann.cpp
View file @
7597e46e
...
...
@@ -65,13 +65,14 @@ int main(int argc, char *argv[])
return
-
1
;
}
IS_weizmann
dataset
(
path
);
Ptr
<
IS_weizmann
>
dataset
=
IS_weizmann
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains all information for each image.
// For example, let output dataset size and first object.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
IS_weizmannObj
*
example
=
static_cast
<
IS_weizmannObj
*>
(
dataset
.
train
[
0
].
get
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
IS_weizmannObj
*
example
=
static_cast
<
IS_weizmannObj
*>
(
dataset
->
getTrain
()
[
0
].
get
());
printf
(
"first image:
\n
name: %s
\n
"
,
example
->
imageName
.
c_str
());
printf
(
"src bw: %s
\n
src color: %s
\n
"
,
example
->
srcBw
.
c_str
(),
example
->
srcColor
.
c_str
());
...
...
modules/datasetstools/samples/msm_epfl.cpp
View file @
7597e46e
...
...
@@ -65,13 +65,14 @@ int main(int argc, char *argv[])
return
-
1
;
}
MSM_epfl
dataset
(
path
);
Ptr
<
MSM_epfl
>
dataset
=
MSM_epfl
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains all information for each image.
// For example, let output dataset size and first object.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
MSM_epflObj
*
example
=
static_cast
<
MSM_epflObj
*>
(
dataset
.
train
[
0
].
get
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
MSM_epflObj
*
example
=
static_cast
<
MSM_epflObj
*>
(
dataset
->
getTrain
()
[
0
].
get
());
printf
(
"first image:
\n
name: %s
\n
"
,
example
->
imageName
.
c_str
());
printf
(
"bounding:
\n
"
);
...
...
modules/datasetstools/samples/msm_middlebury.cpp
View file @
7597e46e
...
...
@@ -65,20 +65,21 @@ int main(int argc, char *argv[])
return
-
1
;
}
MSM_middlebury
dataset
(
path
);
Ptr
<
MSM_middlebury
>
dataset
=
MSM_middlebury
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains camera parameters for each image.
// For example, let output number of elements and last element.
printf
(
"images number: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
MSM_middleburyObj
*
example
=
static_cast
<
MSM_middleburyObj
*>
(
dataset
.
train
.
back
().
get
());
printf
(
"images number: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
MSM_middleburyObj
*
example
=
static_cast
<
MSM_middleburyObj
*>
(
dataset
->
getTrain
()
.
back
().
get
());
printf
(
"last image name: %s
\n
"
,
(
path
+
example
->
imageName
).
c_str
());
printf
(
"K:
\n
"
);
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
for
(
int
j
=
0
;
j
<
3
;
++
j
)
{
printf
(
"%f "
,
example
->
k
[
i
][
j
]
);
printf
(
"%f "
,
example
->
k
(
i
,
j
)
);
}
printf
(
"
\n
"
);
}
...
...
@@ -87,7 +88,7 @@ int main(int argc, char *argv[])
{
for
(
int
j
=
0
;
j
<
3
;
++
j
)
{
printf
(
"%f "
,
example
->
r
[
i
][
j
]
);
printf
(
"%f "
,
example
->
r
(
i
,
j
)
);
}
printf
(
"
\n
"
);
}
...
...
modules/datasetstools/samples/or_imagenet.cpp
View file @
7597e46e
...
...
@@ -67,14 +67,14 @@ int main(int argc, char *argv[])
return
-
1
;
}
OR_imagenet
dataset
(
path
);
Ptr
<
OR_imagenet
>
dataset
=
OR_imagenet
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains for each object its id & image url.
// For example, let output dataset size and first object.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"wnids number: %u
\n
"
,
(
unsigned
int
)
dataset
.
wnids
.
size
());
OR_imagenetObj
*
example
=
static_cast
<
OR_imagenetObj
*>
(
dataset
.
train
[
0
].
get
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
().
size
());
OR_imagenetObj
*
example
=
static_cast
<
OR_imagenetObj
*>
(
dataset
->
getTrain
()[
0
].
get
());
printf
(
"first object url: %s
\n
"
,
example
->
imageUrl
.
c_str
());
printf
(
"first object wnid: %s
\n
"
,
example
->
wnid
.
c_str
());
printf
(
"first object id2: %u
\n
"
,
example
->
id2
);
...
...
modules/datasetstools/samples/or_sun.cpp
View file @
7597e46e
...
...
@@ -65,13 +65,14 @@ int main(int argc, char *argv[])
return
-
1
;
}
OR_sun
dataset
(
path
);
Ptr
<
OR_sun
>
dataset
=
OR_sun
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains for each object its images.
// For example, let output dataset size and last object.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
OR_sunObj
*
example
=
static_cast
<
OR_sunObj
*>
(
dataset
.
train
.
back
().
get
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
OR_sunObj
*
example
=
static_cast
<
OR_sunObj
*>
(
dataset
->
getTrain
()
.
back
().
get
());
printf
(
"last object name: %s
\n
"
,
example
->
name
.
c_str
());
printf
(
"last object images number: %u
\n
"
,
(
unsigned
int
)
example
->
imageNames
.
size
());
vector
<
string
>
&
imageNames
=
example
->
imageNames
;
...
...
modules/datasetstools/samples/slam_kitti.cpp
View file @
7597e46e
...
...
@@ -65,14 +65,15 @@ int main(int argc, char *argv[])
return
-
1
;
}
SLAM_kitti
dataset
(
path
);
Ptr
<
SLAM_kitti
>
dataset
=
SLAM_kitti
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains sequence with name and its data.
// For example, let output first sequence and dataset size.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
SLAM_kittiObj
*
example
=
static_cast
<
SLAM_kittiObj
*>
(
dataset
.
train
[
0
].
get
());
SLAM_kittiObj
*
example
=
static_cast
<
SLAM_kittiObj
*>
(
dataset
->
getTrain
()
[
0
].
get
());
printf
(
"first dataset sequence:
\n
%s
\n
"
,
example
->
name
.
c_str
());
/*string pathVelodyne(path + "sequences/" + example->name + "/velodyne/");
...
...
modules/datasetstools/samples/slam_tumindoor.cpp
View file @
7597e46e
...
...
@@ -65,14 +65,15 @@ int main(int argc, char *argv[])
return
-
1
;
}
SLAM_tumindoor
dataset
(
path
);
Ptr
<
SLAM_tumindoor
>
dataset
=
SLAM_tumindoor
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset contains image and its information.
// For example, let output first image information and dataset size.
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"dataset size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
SLAM_tumindoorObj
*
example
=
static_cast
<
SLAM_tumindoorObj
*>
(
dataset
.
train
[
0
].
get
());
SLAM_tumindoorObj
*
example
=
static_cast
<
SLAM_tumindoorObj
*>
(
dataset
->
getTrain
()
[
0
].
get
());
printf
(
"first image:
\n
type: %u
\n
"
,
example
->
type
);
string
imagePath
(
path
);
...
...
@@ -90,7 +91,7 @@ int main(int argc, char *argv[])
{
for
(
unsigned
int
j
=
0
;
j
<
4
;
++
j
)
{
printf
(
"%f "
,
example
->
transformMat
[
i
][
j
]
);
printf
(
"%f "
,
example
->
transformMat
(
i
,
j
)
);
}
printf
(
"
\n
"
);
}
...
...
modules/datasetstools/samples/tr_chars.cpp
View file @
7597e46e
...
...
@@ -66,15 +66,15 @@ int main(int argc, char *argv[])
return
-
1
;
}
vector
<
TR_chars
>
dataset
;
vector
<
Ptr
<
TR_chars
>
>
dataset
;
do
{
TR_chars
curr
;
Ptr
<
TR_chars
>
curr
=
TR_chars
::
create
()
;
dataset
.
push_back
(
curr
);
int
number
=
(
int
)
dataset
.
size
()
-
1
;
dataset
.
back
()
.
load
(
path
,
number
);
}
while
(
dataset
.
back
()
.
train
.
size
()
>
0
);
dataset
.
back
()
->
load
(
path
,
number
);
}
while
(
dataset
.
back
()
->
getTrain
()
.
size
()
>
0
);
dataset
.
pop_back
();
// remove last empty split
// ***************
...
...
@@ -83,8 +83,8 @@ int main(int argc, char *argv[])
// And number of splits.
printf
(
"splits number: %u
\n
"
,
(
unsigned
int
)
dataset
.
size
());
vector
<
Ptr
<
Object
>
>
&
currTrain
=
dataset
.
back
()
.
train
;
vector
<
Ptr
<
Object
>
>
&
currTest
=
dataset
.
back
()
.
test
;
vector
<
Ptr
<
Object
>
>
&
currTrain
=
dataset
.
back
()
->
getTrain
()
;
vector
<
Ptr
<
Object
>
>
&
currTest
=
dataset
.
back
()
->
getTest
()
;
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
currTrain
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
currTest
.
size
());
...
...
modules/datasetstools/samples/tr_svt.cpp
View file @
7597e46e
...
...
@@ -67,16 +67,17 @@ int main(int argc, char *argv[])
}
// loading train & test images description
TR_svt
dataset
(
path
);
Ptr
<
TR_svt
>
dataset
=
TR_svt
::
create
();
dataset
->
load
(
path
);
// ***************
// dataset. train & test contains images description.
// For example, let output the last element in train set and it's description.
// And their sizes.
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
.
train
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
.
test
.
size
());
printf
(
"train size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTrain
()
.
size
());
printf
(
"test size: %u
\n
"
,
(
unsigned
int
)
dataset
->
getTest
()
.
size
());
TR_svtObj
*
example
=
static_cast
<
TR_svtObj
*>
(
dataset
.
train
.
back
().
get
());
TR_svtObj
*
example
=
static_cast
<
TR_svtObj
*>
(
dataset
->
getTrain
()
.
back
().
get
());
printf
(
"last element:
\n
file name: %s"
,
example
->
fileName
.
c_str
());
printf
(
"
\n
lex: "
);
for
(
vector
<
string
>::
iterator
it
=
example
->
lex
.
begin
();
it
!=
example
->
lex
.
end
();
++
it
)
...
...
modules/datasetstools/src/ar_hmdb.cpp
View file @
7597e46e
...
...
@@ -49,7 +49,22 @@ namespace datasetstools
using
namespace
std
;
void
AR_hmdb
::
loadAction
(
const
string
&
fileName
,
vector
<
string
>
&
train_
,
vector
<
string
>
&
test_
)
class
CV_EXPORTS
AR_hmdbImp
:
public
AR_hmdb
{
public
:
AR_hmdbImp
()
{}
//AR_hmdbImp(const std::string &path, int number = 0);
virtual
~
AR_hmdbImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
,
int
number
=
0
);
void
loadAction
(
const
std
::
string
&
fileName
,
std
::
vector
<
std
::
string
>
&
train_
,
std
::
vector
<
std
::
string
>
&
test_
);
};
void
AR_hmdbImp
::
loadAction
(
const
string
&
fileName
,
vector
<
string
>
&
train_
,
vector
<
string
>
&
test_
)
{
ifstream
infile
(
fileName
.
c_str
());
string
video
,
label
;
...
...
@@ -66,17 +81,17 @@ void AR_hmdb::loadAction(const string &fileName, vector<string> &train_, vector<
}
}
AR_hmdb
::
AR_hmdb
(
const
string
&
path
,
int
number
)
/*AR_hmdbImp::AR_hmdbImp
(const string &path, int number)
{
loadDataset(path, number);
}
}
*/
void
AR_hmdb
::
load
(
const
string
&
path
,
int
number
)
void
AR_hmdb
Imp
::
load
(
const
string
&
path
,
int
number
)
{
loadDataset
(
path
,
number
);
}
void
AR_hmdb
::
loadDataset
(
const
string
&
path
,
int
number
)
void
AR_hmdb
Imp
::
loadDataset
(
const
string
&
path
,
int
number
)
{
// valid number [0,1,2]
if
(
number
<
0
||
number
>
2
)
...
...
@@ -106,5 +121,10 @@ void AR_hmdb::loadDataset(const string &path, int number)
}
}
Ptr
<
AR_hmdb
>
AR_hmdb
::
create
()
{
return
Ptr
<
AR_hmdbImp
>
(
new
AR_hmdbImp
);
}
}
}
modules/datasetstools/src/ar_sports.cpp
View file @
7597e46e
...
...
@@ -49,7 +49,22 @@ namespace datasetstools
using
namespace
std
;
void
AR_sports
::
loadDatasetPart
(
const
string
&
fileName
,
vector
<
Ptr
<
Object
>
>
&
dataset_
)
class
CV_EXPORTS
AR_sportsImp
:
public
AR_sports
{
public
:
AR_sportsImp
()
{}
//AR_sportsImp(const std::string &path);
virtual
~
AR_sportsImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
loadDatasetPart
(
const
std
::
string
&
fileName
,
std
::
vector
<
Ptr
<
Object
>
>
&
dataset_
);
};
void
AR_sportsImp
::
loadDatasetPart
(
const
string
&
fileName
,
vector
<
Ptr
<
Object
>
>
&
dataset_
)
{
ifstream
infile
(
fileName
.
c_str
());
string
videoUrl
,
labels
;
...
...
@@ -69,12 +84,12 @@ void AR_sports::loadDatasetPart(const string &fileName, vector< Ptr<Object> > &d
}
}
AR_sports
::
AR_sports
(
const
string
&
path
)
/*AR_sportsImp::AR_sportsImp
(const string &path)
{
loadDataset(path);
}
}
*/
void
AR_sports
::
load
(
const
string
&
path
,
int
number
)
void
AR_sports
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -84,7 +99,7 @@ void AR_sports::load(const string &path, int number)
loadDataset
(
path
);
}
void
AR_sports
::
loadDataset
(
const
string
&
path
)
void
AR_sports
Imp
::
loadDataset
(
const
string
&
path
)
{
string
trainPath
(
path
+
"original/train_partition.txt"
);
string
testPath
(
path
+
"original/test_partition.txt"
);
...
...
@@ -96,5 +111,10 @@ void AR_sports::loadDataset(const string &path)
loadDatasetPart
(
testPath
,
test
);
}
Ptr
<
AR_sports
>
AR_sports
::
create
()
{
return
Ptr
<
AR_sportsImp
>
(
new
AR_sportsImp
);
}
}
}
modules/datasetstools/src/fr_lfw.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
FR_lfw
::
FR_lfw
(
const
string
&
path
)
class
CV_EXPORTS
FR_lfwImp
:
public
FR_lfw
{
public
:
FR_lfwImp
()
{}
//FR_lfwImp(const std::string &path);
virtual
~
FR_lfwImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*FR_lfwImp::FR_lfwImp(const string &path)
{
loadDataset(path);
}
}
*/
void
FR_lfw
::
load
(
const
string
&
path
,
int
number
)
void
FR_lfw
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void FR_lfw::load(const string &path, int number)
loadDataset
(
path
);
}
void
FR_lfw
::
loadDataset
(
const
string
&
path
)
void
FR_lfw
Imp
::
loadDataset
(
const
string
&
path
)
{
vector
<
string
>
fileNames
;
getDirList
(
path
,
fileNames
);
...
...
@@ -85,5 +98,10 @@ void FR_lfw::loadDataset(const string &path)
}
}
Ptr
<
FR_lfw
>
FR_lfw
::
create
()
{
return
Ptr
<
FR_lfwImp
>
(
new
FR_lfwImp
);
}
}
}
modules/datasetstools/src/gr_chalearn.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
GR_chalearn
::
GR_chalearn
(
const
string
&
path
)
class
CV_EXPORTS
GR_chalearnImp
:
public
GR_chalearn
{
public
:
GR_chalearnImp
()
{}
//GR_chalearnImp(const std::string &path);
virtual
~
GR_chalearnImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*GR_chalearnImp::GR_chalearnImp(const string &path)
{
loadDataset(path);
}
}
*/
void
GR_chalearn
::
load
(
const
string
&
path
,
int
number
)
void
GR_chalearn
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void GR_chalearn::load(const string &path, int number)
loadDataset
(
path
);
}
void
GR_chalearn
::
loadDataset
(
const
string
&
path
)
void
GR_chalearn
Imp
::
loadDataset
(
const
string
&
path
)
{
vector
<
string
>
fileNames
;
getDirList
(
path
,
fileNames
);
...
...
@@ -133,5 +146,10 @@ void GR_chalearn::loadDataset(const string &path)
}
}
Ptr
<
GR_chalearn
>
GR_chalearn
::
create
()
{
return
Ptr
<
GR_chalearnImp
>
(
new
GR_chalearnImp
);
}
}
}
modules/datasetstools/src/gr_skig.cpp
View file @
7597e46e
...
...
@@ -51,12 +51,25 @@ namespace datasetstools
using
namespace
std
;
GR_skig
::
GR_skig
(
const
string
&
path
)
class
CV_EXPORTS
GR_skigImp
:
public
GR_skig
{
public
:
GR_skigImp
()
{}
//GR_skigImp(const std::string &path);
virtual
~
GR_skigImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*GR_skigImp::GR_skigImp(const string &path)
{
loadDataset(path);
}
}
*/
void
GR_skig
::
load
(
const
string
&
path
,
int
number
)
void
GR_skig
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -66,7 +79,7 @@ void GR_skig::load(const string &path, int number)
loadDataset
(
path
);
}
void
GR_skig
::
loadDataset
(
const
string
&
path
)
void
GR_skig
Imp
::
loadDataset
(
const
string
&
path
)
{
for
(
unsigned
int
i
=
1
;
i
<=
6
;
++
i
)
{
...
...
@@ -103,5 +116,10 @@ void GR_skig::loadDataset(const string &path)
}
}
Ptr
<
GR_skig
>
GR_skig
::
create
()
{
return
Ptr
<
GR_skigImp
>
(
new
GR_skigImp
);
}
}
}
modules/datasetstools/src/hpe_parse.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
HPE_parse
::
HPE_parse
(
const
string
&
path
)
class
CV_EXPORTS
HPE_parseImp
:
public
HPE_parse
{
public
:
HPE_parseImp
()
{}
//HPE_parseImp(const std::string &path);
virtual
~
HPE_parseImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*HPE_parseImp::HPE_parseImp(const string &path)
{
loadDataset(path);
}
}
*/
void
HPE_parse
::
load
(
const
string
&
path
,
int
number
)
void
HPE_parse
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void HPE_parse::load(const string &path, int number)
loadDataset
(
path
);
}
void
HPE_parse
::
loadDataset
(
const
string
&
path
)
void
HPE_parse
Imp
::
loadDataset
(
const
string
&
path
)
{
unsigned
int
i
=
0
;
vector
<
string
>
fileNames
;
...
...
@@ -94,5 +107,10 @@ void HPE_parse::loadDataset(const string &path)
}
}
Ptr
<
HPE_parse
>
HPE_parse
::
create
()
{
return
Ptr
<
HPE_parseImp
>
(
new
HPE_parseImp
);
}
}
}
modules/datasetstools/src/ir_affine.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
IR_affine
::
IR_affine
(
const
string
&
path
)
class
CV_EXPORTS
IR_affineImp
:
public
IR_affine
{
public
:
IR_affineImp
()
{}
//IR_affineImp(const std::string &path);
virtual
~
IR_affineImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*IR_affineImp::IR_affineImp(const string &path)
{
loadDataset(path);
}
}
*/
void
IR_affine
::
load
(
const
string
&
path
,
int
number
)
void
IR_affine
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void IR_affine::load(const string &path, int number)
loadDataset
(
path
);
}
void
IR_affine
::
loadDataset
(
const
string
&
path
)
void
IR_affine
Imp
::
loadDataset
(
const
string
&
path
)
{
for
(
unsigned
int
i
=
1
;
i
<=
6
;
++
i
)
{
...
...
@@ -91,5 +104,10 @@ void IR_affine::loadDataset(const string &path)
}
}
Ptr
<
IR_affine
>
IR_affine
::
create
()
{
return
Ptr
<
IR_affineImp
>
(
new
IR_affineImp
);
}
}
}
modules/datasetstools/src/ir_robot.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
IR_robot
::
IR_robot
(
const
string
&
path
)
class
CV_EXPORTS
IR_robotImp
:
public
IR_robot
{
public
:
IR_robotImp
()
{}
//IR_robotImp(const std::string &path);
virtual
~
IR_robotImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*IR_robotImp::IR_robotImp(const string &path)
{
loadDataset(path);
}
}
*/
void
IR_robot
::
load
(
const
string
&
path
,
int
number
)
void
IR_robot
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void IR_robot::load(const string &path, int number)
loadDataset
(
path
);
}
void
IR_robot
::
loadDataset
(
const
string
&
path
)
void
IR_robot
Imp
::
loadDataset
(
const
string
&
path
)
{
vector
<
string
>
fileNames
;
getDirList
(
path
,
fileNames
);
...
...
@@ -85,5 +98,10 @@ void IR_robot::loadDataset(const string &path)
}
}
Ptr
<
IR_robot
>
IR_robot
::
create
()
{
return
Ptr
<
IR_robotImp
>
(
new
IR_robotImp
);
}
}
}
modules/datasetstools/src/is_bsds.cpp
View file @
7597e46e
...
...
@@ -49,7 +49,22 @@ namespace datasetstools
using
namespace
std
;
void
IS_bsds
::
loadDatasetPart
(
const
string
&
fileName
,
vector
<
Ptr
<
Object
>
>
&
dataset_
)
class
CV_EXPORTS
IS_bsdsImp
:
public
IS_bsds
{
public
:
IS_bsdsImp
()
{}
//IS_bsdsImp(const std::string &path);
virtual
~
IS_bsdsImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
loadDatasetPart
(
const
std
::
string
&
fileName
,
std
::
vector
<
Ptr
<
Object
>
>
&
dataset_
);
};
void
IS_bsdsImp
::
loadDatasetPart
(
const
string
&
fileName
,
vector
<
Ptr
<
Object
>
>
&
dataset_
)
{
ifstream
infile
(
fileName
.
c_str
());
string
imageName
;
...
...
@@ -61,12 +76,12 @@ void IS_bsds::loadDatasetPart(const string &fileName, vector< Ptr<Object> > &dat
}
}
IS_bsds
::
IS_bsds
(
const
string
&
path
)
/*IS_bsdsImp::IS_bsdsImp
(const string &path)
{
loadDataset(path);
}
}
*/
void
IS_bsds
::
load
(
const
string
&
path
,
int
number
)
void
IS_bsds
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -76,7 +91,7 @@ void IS_bsds::load(const string &path, int number)
loadDataset
(
path
);
}
void
IS_bsds
::
loadDataset
(
const
string
&
path
)
void
IS_bsds
Imp
::
loadDataset
(
const
string
&
path
)
{
string
trainName
(
path
+
"iids_train.txt"
);
string
testName
(
path
+
"iids_test.txt"
);
...
...
@@ -88,5 +103,10 @@ void IS_bsds::loadDataset(const string &path)
loadDatasetPart
(
testName
,
test
);
}
Ptr
<
IS_bsds
>
IS_bsds
::
create
()
{
return
Ptr
<
IS_bsdsImp
>
(
new
IS_bsdsImp
);
}
}
}
modules/datasetstools/src/is_weizmann.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
IS_weizmann
::
IS_weizmann
(
const
string
&
path
)
class
CV_EXPORTS
IS_weizmannImp
:
public
IS_weizmann
{
public
:
IS_weizmannImp
()
{}
//IS_weizmannImp(const std::string &path);
virtual
~
IS_weizmannImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*IS_weizmannImp::IS_weizmannImp(const string &path)
{
loadDataset(path);
}
}
*/
void
IS_weizmann
::
load
(
const
string
&
path
,
int
number
)
void
IS_weizmann
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void IS_weizmann::load(const string &path, int number)
loadDataset
(
path
);
}
void
IS_weizmann
::
loadDataset
(
const
string
&
path
)
void
IS_weizmann
Imp
::
loadDataset
(
const
string
&
path
)
{
vector
<
string
>
fileNames
;
getDirList
(
path
,
fileNames
);
...
...
@@ -85,5 +98,10 @@ void IS_weizmann::loadDataset(const string &path)
}
}
Ptr
<
IS_weizmann
>
IS_weizmann
::
create
()
{
return
Ptr
<
IS_weizmannImp
>
(
new
IS_weizmannImp
);
}
}
}
modules/datasetstools/src/msm_epfl.cpp
View file @
7597e46e
...
...
@@ -49,7 +49,22 @@ namespace datasetstools
using
namespace
std
;
void
MSM_epfl
::
readFileDouble
(
const
string
&
fileName
,
vector
<
double
>
&
out
)
class
CV_EXPORTS
MSM_epflImp
:
public
MSM_epfl
{
public
:
MSM_epflImp
()
{}
//MSM_epflImp(const std::string &path);
virtual
~
MSM_epflImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
readFileDouble
(
const
std
::
string
&
fileName
,
std
::
vector
<
double
>
&
out
);
};
void
MSM_epflImp
::
readFileDouble
(
const
string
&
fileName
,
vector
<
double
>
&
out
)
{
ifstream
infile
(
fileName
.
c_str
());
double
val
;
...
...
@@ -59,12 +74,12 @@ void MSM_epfl::readFileDouble(const string &fileName, vector<double> &out)
}
}
MSM_epfl
::
MSM_epfl
(
const
string
&
path
)
/*MSM_epflImp::MSM_epflImp
(const string &path)
{
loadDataset(path);
}
}
*/
void
MSM_epfl
::
load
(
const
string
&
path
,
int
number
)
void
MSM_epfl
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -74,7 +89,7 @@ void MSM_epfl::load(const string &path, int number)
loadDataset
(
path
);
}
void
MSM_epfl
::
loadDataset
(
const
string
&
path
)
void
MSM_epfl
Imp
::
loadDataset
(
const
string
&
path
)
{
string
pathBounding
(
path
+
"bounding/"
);
string
pathCamera
(
path
+
"camera/"
);
...
...
@@ -96,5 +111,10 @@ void MSM_epfl::loadDataset(const string &path)
}
}
Ptr
<
MSM_epfl
>
MSM_epfl
::
create
()
{
return
Ptr
<
MSM_epflImp
>
(
new
MSM_epflImp
);
}
}
}
modules/datasetstools/src/msm_middlebury.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
MSM_middlebury
::
MSM_middlebury
(
const
string
&
path
)
class
CV_EXPORTS
MSM_middleburyImp
:
public
MSM_middlebury
{
public
:
MSM_middleburyImp
()
{}
//MSM_middleburyImp(const std::string &path);
virtual
~
MSM_middleburyImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*MSM_middleburyImp::MSM_middleburyImp(const string &path)
{
loadDataset(path);
}
}
*/
void
MSM_middlebury
::
load
(
const
string
&
path
,
int
number
)
void
MSM_middlebury
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void MSM_middlebury::load(const string &path, int number)
loadDataset
(
path
);
}
void
MSM_middlebury
::
loadDataset
(
const
string
&
path
)
void
MSM_middlebury
Imp
::
loadDataset
(
const
string
&
path
)
{
string
name
(
path
.
substr
(
0
,
path
.
length
()
-
1
));
size_t
start
=
name
.
rfind
(
'/'
);
...
...
@@ -85,14 +98,14 @@ void MSM_middlebury::loadDataset(const string &path)
{
for
(
int
j
=
0
;
j
<
3
;
++
j
)
{
infile
>>
curr
->
k
[
i
][
j
]
;
infile
>>
curr
->
k
(
i
,
j
)
;
}
}
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
for
(
int
j
=
0
;
j
<
3
;
++
j
)
{
infile
>>
curr
->
r
[
i
][
j
]
;
infile
>>
curr
->
r
(
i
,
j
)
;
}
}
for
(
int
i
=
0
;
i
<
3
;
++
i
)
...
...
@@ -104,5 +117,10 @@ void MSM_middlebury::loadDataset(const string &path)
}
}
Ptr
<
MSM_middlebury
>
MSM_middlebury
::
create
()
{
return
Ptr
<
MSM_middleburyImp
>
(
new
MSM_middleburyImp
);
}
}
}
modules/datasetstools/src/or_imagenet.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
OR_imagenet
::
OR_imagenet
(
const
string
&
path
)
class
CV_EXPORTS
OR_imagenetImp
:
public
OR_imagenet
{
public
:
OR_imagenetImp
()
{}
//OR_imagenetImp(const std::string &path);
virtual
~
OR_imagenetImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*OR_imagenetImp::OR_imagenetImp(const string &path)
{
loadDataset(path);
}
}
*/
void
OR_imagenet
::
load
(
const
string
&
path
,
int
number
)
void
OR_imagenet
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void OR_imagenet::load(const string &path, int number)
loadDataset
(
path
);
}
void
OR_imagenet
::
loadDataset
(
const
string
&
path
)
void
OR_imagenet
Imp
::
loadDataset
(
const
string
&
path
)
{
ifstream
infile
((
path
+
"fall11_urls.txt"
).
c_str
());
string
line
;
...
...
@@ -83,11 +96,14 @@ void OR_imagenet::loadDataset(const string &path)
curr
->
wnid
=
elems
[
0
];
curr
->
id2
=
atoi
(
elems
[
1
].
c_str
());
wnids
.
insert
(
curr
->
wnid
);
train
.
push_back
(
curr
);
}
}
Ptr
<
OR_imagenet
>
OR_imagenet
::
create
()
{
return
Ptr
<
OR_imagenetImp
>
(
new
OR_imagenetImp
);
}
}
}
modules/datasetstools/src/or_sun.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
OR_sun
::
OR_sun
(
const
string
&
path
)
class
CV_EXPORTS
OR_sunImp
:
public
OR_sun
{
public
:
OR_sunImp
()
{}
//OR_sunImp(const std::string &path);
virtual
~
OR_sunImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*OR_sunImp::OR_sunImp(const string &path)
{
loadDataset(path);
}
}
*/
void
OR_sun
::
load
(
const
string
&
path
,
int
number
)
void
OR_sun
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void OR_sun::load(const string &path, int number)
loadDataset
(
path
);
}
void
OR_sun
::
loadDataset
(
const
string
&
path
)
void
OR_sun
Imp
::
loadDataset
(
const
string
&
path
)
{
string
classNameFile
(
path
+
"ClassName.txt"
);
ifstream
infile
(
classNameFile
.
c_str
());
...
...
@@ -86,5 +99,10 @@ void OR_sun::loadDataset(const string &path)
}
}
Ptr
<
OR_sun
>
OR_sun
::
create
()
{
return
Ptr
<
OR_sunImp
>
(
new
OR_sunImp
);
}
}
}
modules/datasetstools/src/slam_kitti.cpp
View file @
7597e46e
...
...
@@ -49,12 +49,25 @@ namespace datasetstools
using
namespace
std
;
SLAM_kitti
::
SLAM_kitti
(
const
string
&
path
)
class
CV_EXPORTS
SLAM_kittiImp
:
public
SLAM_kitti
{
public
:
SLAM_kittiImp
()
{}
//SLAM_kittiImp(const std::string &path);
virtual
~
SLAM_kittiImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*SLAM_kittiImp::SLAM_kittiImp(const string &path)
{
loadDataset(path);
}
}
*/
void
SLAM_kitti
::
load
(
const
string
&
path
,
int
number
)
void
SLAM_kitti
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -64,7 +77,7 @@ void SLAM_kitti::load(const string &path, int number)
loadDataset
(
path
);
}
void
SLAM_kitti
::
loadDataset
(
const
string
&
path
)
void
SLAM_kitti
Imp
::
loadDataset
(
const
string
&
path
)
{
string
pathSequence
(
path
+
"sequences/"
);
vector
<
string
>
fileNames
;
...
...
@@ -146,5 +159,10 @@ void SLAM_kitti::loadDataset(const string &path)
}
}
Ptr
<
SLAM_kitti
>
SLAM_kitti
::
create
()
{
return
Ptr
<
SLAM_kittiImp
>
(
new
SLAM_kittiImp
);
}
}
}
modules/datasetstools/src/slam_tumindoor.cpp
View file @
7597e46e
...
...
@@ -51,12 +51,25 @@ namespace datasetstools
using
namespace
std
;
SLAM_tumindoor
::
SLAM_tumindoor
(
const
string
&
path
)
class
CV_EXPORTS
SLAM_tumindoorImp
:
public
SLAM_tumindoor
{
public
:
SLAM_tumindoorImp
()
{}
//SLAM_tumindoorImp(const std::string &path);
virtual
~
SLAM_tumindoorImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
};
/*SLAM_tumindoorImp::SLAM_tumindoorImp(const string &path)
{
loadDataset(path);
}
}
*/
void
SLAM_tumindoor
::
load
(
const
string
&
path
,
int
number
)
void
SLAM_tumindoor
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -66,7 +79,7 @@ void SLAM_tumindoor::load(const string &path, int number)
loadDataset
(
path
);
}
void
SLAM_tumindoor
::
loadDataset
(
const
string
&
path
)
void
SLAM_tumindoor
Imp
::
loadDataset
(
const
string
&
path
)
{
string
infoPath
(
path
+
"info/2011-12-17_15.02.56-info.csv"
);
// TODO
ifstream
infile
(
infoPath
.
c_str
());
...
...
@@ -95,7 +108,7 @@ void SLAM_tumindoor::loadDataset(const string &path)
{
for
(
unsigned
int
j
=
0
;
j
<
4
;
++
j
)
{
curr
->
transformMat
[
i
][
j
]
=
atof
(
elems
[
1
+
j
+
i
*
4
].
c_str
());
curr
->
transformMat
(
i
,
j
)
=
atof
(
elems
[
1
+
j
+
i
*
4
].
c_str
());
}
}
...
...
@@ -103,5 +116,10 @@ void SLAM_tumindoor::loadDataset(const string &path)
}
}
Ptr
<
SLAM_tumindoor
>
SLAM_tumindoor
::
create
()
{
return
Ptr
<
SLAM_tumindoorImp
>
(
new
SLAM_tumindoorImp
);
}
}
}
modules/datasetstools/src/tr_chars.cpp
View file @
7597e46e
...
...
@@ -49,7 +49,22 @@ namespace datasetstools
using
namespace
std
;
void
TR_chars
::
parseLine
(
const
string
&
line
,
vector
<
int
>
&
currSet
,
int
number
)
class
CV_EXPORTS
TR_charsImp
:
public
TR_chars
{
public
:
TR_charsImp
()
{}
//TR_charsImp(const std::string &path, int number = 0);
virtual
~
TR_charsImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
,
int
number
=
0
);
void
parseLine
(
const
std
::
string
&
line
,
std
::
vector
<
int
>
&
currSet
,
int
number
);
};
void
TR_charsImp
::
parseLine
(
const
string
&
line
,
vector
<
int
>
&
currSet
,
int
number
)
{
vector
<
string
>
elems
;
split
(
line
,
elems
,
' '
);
...
...
@@ -65,17 +80,17 @@ void TR_chars::parseLine(const string &line, vector<int> &currSet, int number)
}
}
TR_chars
::
TR_chars
(
const
string
&
path
,
int
number
)
/*TR_charsImp::TR_charsImp
(const string &path, int number)
{
loadDataset(path, number);
}
}
*/
void
TR_chars
::
load
(
const
string
&
path
,
int
number
)
void
TR_chars
Imp
::
load
(
const
string
&
path
,
int
number
)
{
loadDataset
(
path
,
number
);
}
void
TR_chars
::
loadDataset
(
const
string
&
path
,
int
number
)
void
TR_chars
Imp
::
loadDataset
(
const
string
&
path
,
int
number
)
{
vector
<
int
>
allLabels
,
trainSet
,
testSet
;
vector
<
string
>
allNames
;
...
...
@@ -184,5 +199,10 @@ void TR_chars::loadDataset(const string &path, int number)
}
}
Ptr
<
TR_chars
>
TR_chars
::
create
()
{
return
Ptr
<
TR_charsImp
>
(
new
TR_charsImp
);
}
}
}
modules/datasetstools/src/tr_svt.cpp
View file @
7597e46e
...
...
@@ -52,7 +52,22 @@ namespace datasetstools
using
namespace
std
;
using
namespace
tinyxml2
;
void
TR_svt
::
xmlParse
(
const
string
&
set
,
vector
<
Ptr
<
Object
>
>
&
out
)
class
CV_EXPORTS
TR_svtImp
:
public
TR_svt
{
public
:
TR_svtImp
()
{}
//TR_svtImp(const std::string &path);
virtual
~
TR_svtImp
()
{}
virtual
void
load
(
const
std
::
string
&
path
,
int
number
=
0
);
private
:
void
loadDataset
(
const
std
::
string
&
path
);
void
xmlParse
(
const
std
::
string
&
set
,
std
::
vector
<
Ptr
<
Object
>
>
&
out
);
};
void
TR_svtImp
::
xmlParse
(
const
string
&
set
,
vector
<
Ptr
<
Object
>
>
&
out
)
{
XMLDocument
doc
;
doc
.
LoadFile
(
set
.
c_str
());
...
...
@@ -97,12 +112,12 @@ void TR_svt::xmlParse(const string &set, vector< Ptr<Object> > &out)
}
}
TR_svt
::
TR_svt
(
const
string
&
path
)
/*TR_svtImp::TR_svtImp
(const string &path)
{
loadDataset(path);
}
}
*/
void
TR_svt
::
load
(
const
string
&
path
,
int
number
)
void
TR_svt
Imp
::
load
(
const
string
&
path
,
int
number
)
{
if
(
number
!=
0
)
{
...
...
@@ -112,7 +127,7 @@ void TR_svt::load(const string &path, int number)
loadDataset
(
path
);
}
void
TR_svt
::
loadDataset
(
const
string
&
path
)
void
TR_svt
Imp
::
loadDataset
(
const
string
&
path
)
{
string
trainXml
(
path
+
"train.xml"
);
string
testXml
(
path
+
"test.xml"
);
...
...
@@ -124,5 +139,10 @@ void TR_svt::loadDataset(const string &path)
xmlParse
(
testXml
,
test
);
}
Ptr
<
TR_svt
>
TR_svt
::
create
()
{
return
Ptr
<
TR_svtImp
>
(
new
TR_svtImp
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment