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
78a968cc
Commit
78a968cc
authored
Aug 21, 2015
by
Vladimir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1
parent
f5ce6d76
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
41 deletions
+41
-41
track_vot.cpp
modules/datasets/src/track_vot.cpp
+41
-41
No files found.
modules/datasets/src/track_vot.cpp
View file @
78a968cc
...
@@ -45,12 +45,12 @@ using namespace std;
...
@@ -45,12 +45,12 @@ using namespace std;
namespace
cv
namespace
cv
{
{
namespace
datasets
namespace
datasets
{
{
class
TRACK_votImpl
:
public
TRACK_vot
class
TRACK_votImpl
:
public
TRACK_vot
{
{
public
:
public
:
//Constructor
//Constructor
TRACK_votImpl
()
TRACK_votImpl
()
{
{
...
@@ -74,38 +74,38 @@ public:
...
@@ -74,38 +74,38 @@ public:
virtual
vector
<
Point2d
>
getGT
();
virtual
vector
<
Point2d
>
getGT
();
private
:
private
:
void
loadDataset
(
const
string
&
path
);
void
loadDataset
(
const
string
&
path
);
string
numberToString
(
int
number
);
string
numberToString
(
int
number
);
};
};
void
TRACK_votImpl
::
load
(
const
string
&
path
)
void
TRACK_votImpl
::
load
(
const
string
&
path
)
{
{
loadDataset
(
path
);
loadDataset
(
path
);
}
}
string
TRACK_votImpl
::
numberToString
(
int
number
)
string
TRACK_votImpl
::
numberToString
(
int
number
)
{
{
string
out
;
string
out
;
char
numberStr
[
9
];
char
numberStr
[
9
];
sprintf
(
numberStr
,
"%u"
,
number
);
sprintf
(
numberStr
,
"%u"
,
number
);
for
(
unsigned
int
i
=
0
;
i
<
8
-
strlen
(
numberStr
);
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
8
-
strlen
(
numberStr
);
++
i
)
{
{
out
+=
"0"
;
out
+=
"0"
;
}
}
out
+=
numberStr
;
out
+=
numberStr
;
return
out
;
return
out
;
}
}
inline
bool
fileExists
(
const
std
::
string
&
name
)
inline
bool
fileExists
(
const
std
::
string
&
name
)
{
{
struct
stat
buffer
;
struct
stat
buffer
;
return
(
stat
(
name
.
c_str
(),
&
buffer
)
==
0
);
return
(
stat
(
name
.
c_str
(),
&
buffer
)
==
0
);
}
}
void
TRACK_votImpl
::
loadDataset
(
const
string
&
rootPath
)
void
TRACK_votImpl
::
loadDataset
(
const
string
&
rootPath
)
{
{
ifstream
namesList
(
rootPath
+
"/list.txt"
);
ifstream
namesList
(
rootPath
+
"/list.txt"
);
//ifstream lengthsList(rootPath + "/lengths.txt");
//ifstream lengthsList(rootPath + "/lengths.txt");
vector
<
int
>
datasetsLengths
;
vector
<
int
>
datasetsLengths
;
...
@@ -164,7 +164,7 @@ void TRACK_votImpl::loadDataset(const string &rootPath)
...
@@ -164,7 +164,7 @@ void TRACK_votImpl::loadDataset(const string &rootPath)
}
while
(
true
);
}
while
(
true
);
datasetsLengths
.
push_back
(
currFrameID
-
1
);
datasetsLengths
.
push_back
(
currFrameID
-
1
);
data
.
push_back
(
objects
);
data
.
push_back
(
objects
);
}
}
}
}
...
@@ -175,15 +175,15 @@ void TRACK_votImpl::loadDataset(const string &rootPath)
...
@@ -175,15 +175,15 @@ void TRACK_votImpl::loadDataset(const string &rootPath)
namesList
.
close
();
namesList
.
close
();
return
;
return
;
}
}
int
TRACK_votImpl
::
getDatasetsNum
()
int
TRACK_votImpl
::
getDatasetsNum
()
{
{
return
data
.
size
();
return
data
.
size
();
}
}
int
TRACK_votImpl
::
getDatasetLength
(
int
id
)
int
TRACK_votImpl
::
getDatasetLength
(
int
id
)
{
{
if
(
id
>
0
&&
id
<=
(
int
)
data
.
size
())
if
(
id
>
0
&&
id
<=
(
int
)
data
.
size
())
return
data
[
id
-
1
].
size
();
return
data
[
id
-
1
].
size
();
else
else
...
@@ -191,10 +191,10 @@ int TRACK_votImpl::getDatasetLength(int id)
...
@@ -191,10 +191,10 @@ int TRACK_votImpl::getDatasetLength(int id)
cout
<<
"Dataset ID is out of range...
\n
"
<<
"Allowed IDs are: 1~"
<<
(
int
)
data
.
size
()
<<
endl
;
cout
<<
"Dataset ID is out of range...
\n
"
<<
"Allowed IDs are: 1~"
<<
(
int
)
data
.
size
()
<<
endl
;
return
-
1
;
return
-
1
;
}
}
}
}
bool
TRACK_votImpl
::
initDataset
(
int
id
)
bool
TRACK_votImpl
::
initDataset
(
int
id
)
{
{
if
(
id
>
0
&&
id
<=
(
int
)
data
.
size
())
if
(
id
>
0
&&
id
<=
(
int
)
data
.
size
())
{
{
activeDatasetID
=
id
;
activeDatasetID
=
id
;
...
@@ -205,26 +205,25 @@ bool TRACK_votImpl::initDataset(int id)
...
@@ -205,26 +205,25 @@ bool TRACK_votImpl::initDataset(int id)
cout
<<
"Dataset ID is out of range...
\n
"
<<
"Allowed IDs are: 1~"
<<
(
int
)
data
.
size
()
<<
endl
;
cout
<<
"Dataset ID is out of range...
\n
"
<<
"Allowed IDs are: 1~"
<<
(
int
)
data
.
size
()
<<
endl
;
return
false
;
return
false
;
}
}
}
}
bool
TRACK_votImpl
::
getNextFrame
(
Mat
&
frame
)
bool
TRACK_votImpl
::
getNextFrame
(
Mat
&
frame
)
{
{
frame
=
imread
(
data
[
activeDatasetID
-
1
][
frameCounter
]
->
imagePath
);
frame
=
imread
(
data
[
activeDatasetID
-
1
][
frameCounter
]
->
imagePath
);
frameCounter
++
;
frameCounter
++
;
return
!
frame
.
empty
();
return
!
frame
.
empty
();
}
}
Ptr
<
TRACK_vot
>
TRACK_vot
::
create
()
Ptr
<
TRACK_vot
>
TRACK_vot
::
create
()
{
{
return
Ptr
<
TRACK_votImpl
>
(
new
TRACK_votImpl
);
return
Ptr
<
TRACK_votImpl
>
(
new
TRACK_votImpl
);
}
}
vector
<
Point2d
>
TRACK_votImpl
::
getGT
()
vector
<
Point2d
>
TRACK_votImpl
::
getGT
()
{
{
Ptr
<
TRACK_votObj
>
currObj
=
data
[
activeDatasetID
-
1
][
frameCounter
-
1
];
Ptr
<
TRACK_votObj
>
currObj
=
data
[
activeDatasetID
-
1
][
frameCounter
-
1
];
return
currObj
->
gtbb
;
return
currObj
->
gtbb
;
}
}
}
}
}
\ No newline at end of file
}
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