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
c743244f
Commit
c743244f
authored
Aug 15, 2015
by
Vladimir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warnings Fix #1
parent
36f8dc2b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
17 deletions
+33
-17
multiTracker_test.cpp
modules/tracking/samples/multiTracker_test.cpp
+1
-1
multiTracker.cpp
modules/tracking/src/multiTracker.cpp
+21
-8
tldDataset.cpp
modules/tracking/src/tldDataset.cpp
+10
-7
tldTracker.cpp
modules/tracking/src/tldTracker.cpp
+1
-1
No files found.
modules/tracking/samples/multiTracker_test.cpp
View file @
c743244f
...
...
@@ -98,7 +98,7 @@ int main()
//
// "MIL", "BOOSTING", "MEDIANFLOW", "TLD"
//
char
*
tracker_algorithm_name
=
"TLD"
;
c
onst
c
har
*
tracker_algorithm_name
=
"TLD"
;
Mat
frame
;
paused
=
false
;
...
...
modules/tracking/src/multiTracker.cpp
View file @
c743244f
...
...
@@ -75,6 +75,7 @@ namespace cv
bool
MultiTracker
::
update
(
const
Mat
&
image
)
{
printf
(
"Naive-Loop MO-TLD Update....
\n
"
);
for
(
int
i
=
0
;
i
<
(
int
)
trackers
.
size
();
i
++
)
if
(
!
trackers
[
i
]
->
update
(
image
,
boundingBoxes
[
i
]))
return
false
;
...
...
@@ -130,7 +131,7 @@ namespace cv
trackerPtr
=
trackers
[
k
];
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
getModel
()
));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
data
=
tracker
->
data
;
data
->
frameNum
++
;
...
...
@@ -236,7 +237,14 @@ namespace cv
}
//Debug display candidates after Variance Filter
////////////////////////////////////////////////
Mat
tmpImg
=
image
;
for
(
int
i
=
0
;
i
<
(
int
)
debugStack
[
0
].
size
();
i
++
)
//rectangle(tmpImg, debugStack[0][i], Scalar(255, 255, 255), 1, 1, 0);
debugStack
[
0
].
clear
();
tmpImg
.
copyTo
(
image
);
////////////////////////////////////////////////
return
true
;
}
...
...
@@ -311,7 +319,7 @@ namespace cv
trackerPtr
=
trackers
[
k
];
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
getModel
()
));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
//Optimized variance calculation
bool
varPass
=
(
windowVar
>
tld
::
VARIANCE_THRESHOLD
*
*
tldModel
->
detector
->
originalVariancePtr
);
...
...
@@ -334,13 +342,14 @@ namespace cv
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
//Encsemble classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
//TLD Tracker data extraction
trackerPtr
=
trackers
[
k
];
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
getModel
()
));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
for
(
int
i
=
0
;
i
<
(
int
)
varBuffer
[
k
].
size
();
i
++
)
...
...
@@ -376,13 +385,14 @@ namespace cv
}
//NN classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
//TLD Tracker data extraction
trackerPtr
=
trackers
[
k
];
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
getModel
()
));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
npos
=
0
;
nneg
=
0
;
...
...
@@ -505,7 +515,7 @@ namespace cv
trackerPtr
=
trackers
[
k
];
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
getModel
()
));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
//Optimized variance calculation
bool
varPass
=
(
windowVar
>
tld
::
VARIANCE_THRESHOLD
*
*
tldModel
->
detector
->
originalVariancePtr
);
...
...
@@ -528,13 +538,14 @@ namespace cv
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
//Encsemble classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
//TLD Tracker data extraction
trackerPtr
=
trackers
[
k
];
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
getModel
()
));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
for
(
int
i
=
0
;
i
<
(
int
)
varBuffer
[
k
].
size
();
i
++
)
...
...
@@ -570,13 +581,15 @@ namespace cv
}
//NN classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
//TLD Tracker data extraction
trackerPtr
=
trackers
[
k
];
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
getModel
()));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
//Size InitSize = tldModel->getMinSize();
npos
=
0
;
nneg
=
0
;
maxSc
=
-
5.0
;
...
...
modules/tracking/src/tldDataset.cpp
View file @
c743244f
...
...
@@ -51,7 +51,7 @@ namespace cv
bool
flagVOT
=
false
;
//TLD Dataset Parameters
char
*
tldFolderName
[
10
]
=
{
c
onst
c
har
*
tldFolderName
[
10
]
=
{
"01_david"
,
"02_jumping"
,
"03_pedestrian1"
,
...
...
@@ -63,7 +63,7 @@ namespace cv
"09_carchase"
,
"10_panda"
};
char
*
votFolderName
[
60
]
=
{
c
onst
c
har
*
votFolderName
[
60
]
=
{
"bag"
,
"ball1"
,
"ball2"
,
"basketball"
,
"birds1"
,
"birds2"
,
"blanket"
,
"bmx"
,
"bolt1"
,
"bolt2"
,
"book"
,
"butterfly"
,
"car1"
,
"car2"
,
"crossing"
,
"dinosaur"
,
"fernando"
,
"fish1"
,
"fish2"
,
"fish3"
,
"fish4"
,
"girl"
,
"glove"
,
"godfather"
,
"graduate"
,
"gymnastics1"
,
"gymnastics2 "
,
"gymnastics3"
,
"gymnastics4"
,
"hand"
,
...
...
@@ -72,11 +72,11 @@ namespace cv
"singer2"
,
"singer3"
,
"soccer1"
,
"soccer2"
,
"soldier"
,
"sphere"
,
"tiger"
,
"traffic"
,
"tunnel"
,
"wiper"
};
Rect2d
tldInitBB
[
10
]
=
{
const
Rect2d
tldInitBB
[
10
]
=
{
Rect2d
(
165
,
93
,
51
,
54
),
Rect2d
(
147
,
110
,
33
,
32
),
Rect2d
(
47
,
51
,
21
,
36
),
Rect2d
(
130
,
134
,
21
,
53
),
Rect2d
(
154
,
102
,
24
,
52
),
Rect2d
(
142
,
125
,
90
,
39
),
Rect2d
(
290
,
43
,
23
,
40
),
Rect2d
(
273
,
77
,
27
,
25
),
Rect2d
(
337
,
219
,
54
,
37
),
Rect2d
(
58
,
100
,
27
,
22
)
};
Rect2d
votInitBB
[
60
]
=
{
const
Rect2d
votInitBB
[
60
]
=
{
Rect2d
(
142
,
125
,
90
,
39
),
Rect2d
(
490
,
400
,
40
,
40
),
Rect2d
(
273
,
77
,
27
,
25
),
Rect2d
(
145
,
84
,
54
,
37
),
Rect2d
(
58
,
100
,
27
,
22
),
Rect2d
(
450
,
380
,
60
,
60
),
Rect2d
(
290
,
43
,
23
,
40
),
Rect2d
(
273
,
77
,
27
,
25
),
Rect2d
(
225
,
175
,
50
,
50
),
Rect2d
(
58
,
100
,
27
,
22
),
...
...
@@ -118,7 +118,10 @@ namespace cv
cv
::
Rect2d
tld_InitDataset
(
int
videoInd
,
const
char
*
rootPath
,
int
datasetInd
)
{
char
*
folderName
=
(
char
*
)
""
;
int
x
,
y
,
w
,
h
;
int
x
=
0
,
y
=
0
,
w
=
0
,
h
=
0
;
//Index range
// 1-10 TLD Dataset
...
...
@@ -127,7 +130,7 @@ namespace cv
if
(
datasetInd
==
0
)
{
folderName
=
tldFolderName
[
id
];
folderName
=
(
char
*
)
tldFolderName
[
id
];
x
=
tldInitBB
[
id
].
x
;
y
=
tldInitBB
[
id
].
y
;
w
=
tldInitBB
[
id
].
width
;
...
...
@@ -138,7 +141,7 @@ namespace cv
}
if
(
datasetInd
==
1
)
{
folderName
=
votFolderName
[
id
];
folderName
=
(
char
*
)
votFolderName
[
id
];
x
=
votInitBB
[
id
].
x
;
y
=
votInitBB
[
id
].
y
;
w
=
votInitBB
[
id
].
width
;
...
...
modules/tracking/src/tldTracker.cpp
View file @
c743244f
...
...
@@ -238,7 +238,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
//Debug display candidates after Variance Filter
////////////////////////////////////////////////
Mat
tmpImg
=
image
;
for
(
int
i
=
0
;
i
<
tldModel
->
detector
->
debugStack
[
0
].
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
tldModel
->
detector
->
debugStack
[
0
].
size
();
i
++
)
//rectangle(tmpImg, tldModel->detector->debugStack[0][i], Scalar(255, 255, 255), 1, 1, 0);
tldModel
->
detector
->
debugStack
[
0
].
clear
();
tmpImg
.
copyTo
(
image
);
...
...
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