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
bae3dac9
Commit
bae3dac9
authored
Aug 17, 2015
by
Vladimir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up debug prints/variables/flags/timers
parent
826cb28d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
86 deletions
+1
-86
multiTracker.cpp
modules/tracking/src/multiTracker.cpp
+1
-14
tldDetector.cpp
modules/tracking/src/tldDetector.cpp
+0
-0
tldDetector.hpp
modules/tracking/src/tldDetector.hpp
+0
-1
tldModel.cpp
modules/tracking/src/tldModel.cpp
+0
-44
tldTracker.cpp
modules/tracking/src/tldTracker.cpp
+0
-27
No files found.
modules/tracking/src/multiTracker.cpp
View file @
bae3dac9
...
@@ -75,7 +75,6 @@ namespace cv
...
@@ -75,7 +75,6 @@ namespace cv
bool
MultiTracker
::
update
(
const
Mat
&
image
)
bool
MultiTracker
::
update
(
const
Mat
&
image
)
{
{
printf
(
"Naive-Loop MO-TLD Update....
\n
"
);
for
(
int
i
=
0
;
i
<
(
int
)
trackers
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
trackers
.
size
();
i
++
)
if
(
!
trackers
[
i
]
->
update
(
image
,
boundingBoxes
[
i
]))
if
(
!
trackers
[
i
]
->
update
(
image
,
boundingBoxes
[
i
]))
return
false
;
return
false
;
...
@@ -237,14 +236,7 @@ namespace cv
...
@@ -237,14 +236,7 @@ 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
;
return
true
;
}
}
...
@@ -342,7 +334,6 @@ namespace cv
...
@@ -342,7 +334,6 @@ namespace cv
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
//Encsemble classification
//Encsemble classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
{
//TLD Tracker data extraction
//TLD Tracker data extraction
...
@@ -385,7 +376,6 @@ namespace cv
...
@@ -385,7 +376,6 @@ namespace cv
}
}
//NN classification
//NN classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
{
//TLD Tracker data extraction
//TLD Tracker data extraction
...
@@ -538,7 +528,6 @@ namespace cv
...
@@ -538,7 +528,6 @@ namespace cv
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
//Encsemble classification
//Encsemble classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
{
//TLD Tracker data extraction
//TLD Tracker data extraction
...
@@ -581,7 +570,6 @@ namespace cv
...
@@ -581,7 +570,6 @@ namespace cv
}
}
//NN classification
//NN classification
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
for
(
int
k
=
0
;
k
<
(
int
)
trackers
.
size
();
k
++
)
{
{
//TLD Tracker data extraction
//TLD Tracker data extraction
...
@@ -589,7 +577,6 @@ namespace cv
...
@@ -589,7 +577,6 @@ namespace cv
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
tracker
=
static_cast
<
tld
::
TrackerTLDImpl
*>
(
trackerPtr
);
//TLD Model Extraction
//TLD Model Extraction
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
tldModel
=
((
tld
::
TrackerTLDModel
*
)
static_cast
<
TrackerModel
*>
(
tracker
->
model
));
//Size InitSize = tldModel->getMinSize();
npos
=
0
;
npos
=
0
;
nneg
=
0
;
nneg
=
0
;
maxSc
=
-
5.0
;
maxSc
=
-
5.0
;
...
...
modules/tracking/src/tldDetector.cpp
View file @
bae3dac9
This diff is collapsed.
Click to expand it.
modules/tracking/src/tldDetector.hpp
View file @
bae3dac9
...
@@ -81,7 +81,6 @@ namespace cv
...
@@ -81,7 +81,6 @@ namespace cv
double
ocl_Sc
(
const
Mat_
<
uchar
>&
patch
);
double
ocl_Sc
(
const
Mat_
<
uchar
>&
patch
);
void
ocl_batchSrSc
(
const
Mat_
<
uchar
>&
patches
,
double
*
resultSr
,
double
*
resultSc
,
int
numOfPatches
);
void
ocl_batchSrSc
(
const
Mat_
<
uchar
>&
patches
,
double
*
resultSr
,
double
*
resultSc
,
int
numOfPatches
);
std
::
vector
<
Rect2d
>
debugStack
[
10
];
std
::
vector
<
TLDEnsembleClassifier
>
classifiers
;
std
::
vector
<
TLDEnsembleClassifier
>
classifiers
;
Mat
*
posExp
,
*
negExp
;
Mat
*
posExp
,
*
negExp
;
int
*
posNum
,
*
negNum
;
int
*
posNum
,
*
negNum
;
...
...
modules/tracking/src/tldModel.cpp
View file @
bae3dac9
...
@@ -140,7 +140,6 @@ namespace cv
...
@@ -140,7 +140,6 @@ namespace cv
detector
->
classifiers
[
k
].
integrate
(
blurredPatch
,
false
);
detector
->
classifiers
[
k
].
integrate
(
blurredPatch
,
false
);
}
}
}
}
//dprintf(("positive patches: %d\nnegative patches: %d\n", (int)positiveExamples.size(), (int)negativeExamples.size()));
}
}
...
@@ -180,16 +179,6 @@ namespace cv
...
@@ -180,16 +179,6 @@ namespace cv
detector
->
classifiers
[
i
].
integrate
(
blurredPatch
,
patches
[
k
].
isObject
);
detector
->
classifiers
[
i
].
integrate
(
blurredPatch
,
patches
[
k
].
isObject
);
}
}
}
}
/*
if( negativeIntoModel > 0 )
dfprintf((stdout, "negativeIntoModel = %d ", negativeIntoModel));
if( positiveIntoModel > 0)
dfprintf((stdout, "positiveIntoModel = %d ", positiveIntoModel));
if( negativeIntoEnsemble > 0 )
dfprintf((stdout, "negativeIntoEnsemble = %d ", negativeIntoEnsemble));
if( positiveIntoEnsemble > 0 )
dfprintf((stdout, "positiveIntoEnsemble = %d ", positiveIntoEnsemble));
dfprintf((stdout, "\n"));*/
}
}
...
@@ -198,9 +187,6 @@ namespace cv
...
@@ -198,9 +187,6 @@ namespace cv
int
positiveIntoModel
=
0
,
negativeIntoModel
=
0
,
positiveIntoEnsemble
=
0
,
negativeIntoEnsemble
=
0
;
int
positiveIntoModel
=
0
,
negativeIntoModel
=
0
,
positiveIntoEnsemble
=
0
,
negativeIntoEnsemble
=
0
;
if
((
int
)
eForModel
.
size
()
==
0
)
return
;
if
((
int
)
eForModel
.
size
()
==
0
)
return
;
//int64 e1, e2;
//double t;
//e1 = getTickCount();
for
(
int
k
=
0
;
k
<
(
int
)
eForModel
.
size
();
k
++
)
for
(
int
k
=
0
;
k
<
(
int
)
eForModel
.
size
();
k
++
)
{
{
double
sr
=
detector
->
Sr
(
eForModel
[
k
]);
double
sr
=
detector
->
Sr
(
eForModel
[
k
]);
...
@@ -231,19 +217,6 @@ namespace cv
...
@@ -231,19 +217,6 @@ namespace cv
detector
->
classifiers
[
i
].
integrate
(
eForEnsemble
[
k
],
isPositive
);
detector
->
classifiers
[
i
].
integrate
(
eForEnsemble
[
k
],
isPositive
);
}
}
}
}
//e2 = getTickCount();
//t = (e2 - e1) / getTickFrequency() * 1000;
//printf("Integrate Additional: %fms\n", t);
/*
if( negativeIntoModel > 0 )
dfprintf((stdout, "negativeIntoModel = %d ", negativeIntoModel));
if( positiveIntoModel > 0 )
dfprintf((stdout, "positiveIntoModel = %d ", positiveIntoModel));
if( negativeIntoEnsemble > 0 )
dfprintf((stdout, "negativeIntoEnsemble = %d ", negativeIntoEnsemble));
if( positiveIntoEnsemble > 0 )
dfprintf((stdout, "positiveIntoEnsemble = %d ", positiveIntoEnsemble));
dfprintf((stdout, "\n"));*/
}
}
void
TrackerTLDModel
::
ocl_integrateAdditional
(
const
std
::
vector
<
Mat_
<
uchar
>
>&
eForModel
,
const
std
::
vector
<
Mat_
<
uchar
>
>&
eForEnsemble
,
bool
isPositive
)
void
TrackerTLDModel
::
ocl_integrateAdditional
(
const
std
::
vector
<
Mat_
<
uchar
>
>&
eForModel
,
const
std
::
vector
<
Mat_
<
uchar
>
>&
eForEnsemble
,
bool
isPositive
)
...
@@ -251,10 +224,6 @@ namespace cv
...
@@ -251,10 +224,6 @@ namespace cv
int
positiveIntoModel
=
0
,
negativeIntoModel
=
0
,
positiveIntoEnsemble
=
0
,
negativeIntoEnsemble
=
0
;
int
positiveIntoModel
=
0
,
negativeIntoModel
=
0
,
positiveIntoEnsemble
=
0
,
negativeIntoEnsemble
=
0
;
if
((
int
)
eForModel
.
size
()
==
0
)
return
;
if
((
int
)
eForModel
.
size
()
==
0
)
return
;
//int64 e1, e2;
//double t;
//e1 = getTickCount();
//Prepare batch of patches
//Prepare batch of patches
int
numOfPatches
=
(
int
)
eForModel
.
size
();
int
numOfPatches
=
(
int
)
eForModel
.
size
();
Mat_
<
uchar
>
stdPatches
(
numOfPatches
,
225
);
Mat_
<
uchar
>
stdPatches
(
numOfPatches
,
225
);
...
@@ -301,19 +270,6 @@ namespace cv
...
@@ -301,19 +270,6 @@ namespace cv
detector
->
classifiers
[
i
].
integrate
(
eForEnsemble
[
k
],
isPositive
);
detector
->
classifiers
[
i
].
integrate
(
eForEnsemble
[
k
],
isPositive
);
}
}
}
}
//e2 = getTickCount();
//t = (e2 - e1) / getTickFrequency() * 1000;
//printf("Integrate Additional OCL: %fms\n", t);
/*
if( negativeIntoModel > 0 )
dfprintf((stdout, "negativeIntoModel = %d ", negativeIntoModel));
if( positiveIntoModel > 0 )
dfprintf((stdout, "positiveIntoModel = %d ", positiveIntoModel));
if( negativeIntoEnsemble > 0 )
dfprintf((stdout, "negativeIntoEnsemble = %d ", negativeIntoEnsemble));
if( positiveIntoEnsemble > 0 )
dfprintf((stdout, "positiveIntoEnsemble = %d ", positiveIntoEnsemble));
dfprintf((stdout, "\n"));*/
}
}
//Push the patch to the model
//Push the patch to the model
...
...
modules/tracking/src/tldTracker.cpp
View file @
bae3dac9
...
@@ -151,12 +151,6 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
...
@@ -151,12 +151,6 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
}
}
std
::
vector
<
double
>::
iterator
it
=
std
::
max_element
(
candidatesRes
.
begin
(),
candidatesRes
.
end
());
std
::
vector
<
double
>::
iterator
it
=
std
::
max_element
(
candidatesRes
.
begin
(),
candidatesRes
.
end
());
//dfprintf((stdout, "scale = %f\n", log(1.0 * boundingBox.width / (data->getMinSize()).width) / log(SCALE_STEP)));
//for( int i = 0; i < (int)candidatesRes.size(); i++ )
//dprintf(("\tcandidatesRes[%d] = %f\n", i, candidatesRes[i]));
//data->printme();
//tldModel->printme(stdout);
if
(
it
==
candidatesRes
.
end
()
)
if
(
it
==
candidatesRes
.
end
()
)
{
{
data
->
confident
=
false
;
data
->
confident
=
false
;
...
@@ -173,16 +167,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
...
@@ -173,16 +167,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
#if 1
#if 1
if
(
it
!=
candidatesRes
.
end
()
)
if
(
it
!=
candidatesRes
.
end
()
)
{
resample
(
imageForDetector
,
candidates
[
it
-
candidatesRes
.
begin
()],
standardPatch
);
resample
(
imageForDetector
,
candidates
[
it
-
candidatesRes
.
begin
()],
standardPatch
);
//dfprintf((stderr, "%d %f %f\n", data->frameNum, tldModel->Sc(standardPatch), tldModel->Sr(standardPatch)));
//if( candidatesRes.size() == 2 && it == (candidatesRes.begin() + 1) )
//dfprintf((stderr, "detector WON\n"));
}
else
{
//dfprintf((stderr, "%d x x\n", data->frameNum));
}
#endif
#endif
if
(
*
it
>
CORE_THRESHOLD
)
if
(
*
it
>
CORE_THRESHOLD
)
...
@@ -213,7 +198,6 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
...
@@ -213,7 +198,6 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
detectorResults
[
i
].
isObject
=
expertResult
;
detectorResults
[
i
].
isObject
=
expertResult
;
}
}
tldModel
->
integrateRelabeled
(
imageForDetector
,
image_blurred
,
detectorResults
);
tldModel
->
integrateRelabeled
(
imageForDetector
,
image_blurred
,
detectorResults
);
//dprintf(("%d relabeled by nExpert\n", negRelabeled));
pExpert
.
additionalExamples
(
examplesForModel
,
examplesForEnsemble
);
pExpert
.
additionalExamples
(
examplesForModel
,
examplesForEnsemble
);
if
(
ocl
::
haveOpenCL
())
if
(
ocl
::
haveOpenCL
())
tldModel
->
ocl_integrateAdditional
(
examplesForModel
,
examplesForEnsemble
,
true
);
tldModel
->
ocl_integrateAdditional
(
examplesForModel
,
examplesForEnsemble
,
true
);
...
@@ -234,16 +218,6 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
...
@@ -234,16 +218,6 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
#endif
#endif
}
}
//Debug display candidates after Variance Filter
////////////////////////////////////////////////
Mat
tmpImg
=
image
;
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
);
////////////////////////////////////////////////
return
true
;
return
true
;
}
}
...
@@ -310,7 +284,6 @@ Data::Data(Rect2d initBox)
...
@@ -310,7 +284,6 @@ Data::Data(Rect2d initBox)
minSize
.
width
=
(
int
)(
initBox
.
width
*
20.0
/
minDim
);
minSize
.
width
=
(
int
)(
initBox
.
width
*
20.0
/
minDim
);
minSize
.
height
=
(
int
)(
initBox
.
height
*
20.0
/
minDim
);
minSize
.
height
=
(
int
)(
initBox
.
height
*
20.0
/
minDim
);
frameNum
=
0
;
frameNum
=
0
;
//dprintf(("minSize = %dx%d\n", minSize.width, minSize.height));
}
}
void
Data
::
printme
(
FILE
*
port
)
void
Data
::
printme
(
FILE
*
port
)
...
...
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