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
ff73c6f4
Commit
ff73c6f4
authored
Jun 28, 2014
by
Alex Leontiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vadim
parent
ca4d5325
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
16 deletions
+28
-16
TLD.cpp
modules/tracking/src/TLD.cpp
+2
-2
TLD.hpp
modules/tracking/src/TLD.hpp
+4
-5
TLDEnsembleClassifier.cpp
modules/tracking/src/TLDEnsembleClassifier.cpp
+2
-2
trackerTLD.cpp
modules/tracking/src/trackerTLD.cpp
+20
-7
No files found.
modules/tracking/src/TLD.cpp
View file @
ff73c6f4
...
...
@@ -50,7 +50,7 @@
using
namespace
cv
;
namespace
cv
namespace
cv
{
namespace
tld
{
//debug functions and variables
...
...
@@ -363,4 +363,4 @@ unsigned short int TLDEnsembleClassifier::code(const uchar* data,int rowstep)con
return
position
;
}
}
}
}
modules/tracking/src/TLD.hpp
View file @
ff73c6f4
...
...
@@ -45,9 +45,7 @@
#include <algorithm>
#include <limits.h>
using
namespace
cv
;
namespace
cv
namespace
cv
{
namespace
tld
{
//debug functions and variables
...
...
@@ -67,7 +65,8 @@ void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,Rect2d whiteOne
void
drawWithRects
(
const
Mat
&
img
,
std
::
vector
<
Rect2d
>&
blackOnes
,
std
::
vector
<
Rect2d
>&
whiteOnes
);
//aux functions and variables
#define CLIP(x,a,b) MIN(MAX((x),(a)),(b))
//#define CLIP(x,a,b) MIN(MAX((x),(a)),(b))
template
<
typename
T
>
inline
T
CLIP
(
T
x
,
T
a
,
T
b
){
return
MIN
(
MAX
(
x
,
a
),
b
);}
double
overlap
(
const
Rect2d
&
r1
,
const
Rect2d
&
r2
);
void
resample
(
const
Mat
&
img
,
const
RotatedRect
&
r2
,
Mat_
<
uchar
>&
samples
);
void
resample
(
const
Mat
&
img
,
const
Rect2d
&
r2
,
Mat_
<
uchar
>&
samples
);
...
...
@@ -100,4 +99,4 @@ public:
virtual
~
TrackerProxy
(){}
};
}
}
}
modules/tracking/src/TLDEnsembleClassifier.cpp
View file @
ff73c6f4
...
...
@@ -48,7 +48,7 @@
using
namespace
cv
;
namespace
cv
namespace
cv
{
namespace
tld
{
int
TLDEnsembleClassifier
::
getGridSize
(){
return
15
;
...
...
@@ -3690,4 +3690,4 @@ void TLDEnsembleClassifier::preinit(int ordinal){
x1
[
12
]
=
3
;
x2
[
12
]
=
3
;
y1
[
12
]
=
10
;
y2
[
12
]
=
0
;
break
;
}
}}
}}
}
modules/tracking/src/trackerTLD.cpp
View file @
ff73c6f4
...
...
@@ -52,9 +52,10 @@
#define CORE_THRESHOLD 0.5
#define NEG_EXAMPLES_IN_INIT_MODEL 300
#define MAX_EXAMPLES_IN_MODEL 500
static
const
Size
GaussBlurKernelSize
(
3
,
3
);
static
const
cv
::
Size
GaussBlurKernelSize
(
3
,
3
);
using
namespace
cv
;
using
namespace
tld
;
/*
* FIXME(optimize):
...
...
@@ -66,6 +67,22 @@ using namespace cv;
* fix pushbot ->pick commits -> compare_branches->all in 1
* ||video(vadim random, better?) --> debug if box size is less than 20 --> (remove ensemble self-loop) --> (try inter_area)
* perfect PN
*
* vadim:
*
* dprintf
* variance outside
* NCC sqrt(-)
* standard patch out (403)
* pos by 2 in code()
*
* resize
* warpAffine
* cv::integral
*
* 13 as enum
*
* blurred in TrackerTLDModel()
*/
/* design decisions:
...
...
@@ -496,8 +513,8 @@ bool TLDDetector::detect(const Mat& img,const Mat& imgBlurred,Rect2d& res,std::v
Mat_
<
unsigned
int
>
intImgP
(
resized_img
.
rows
,
resized_img
.
cols
),
intImgP2
(
resized_img
.
rows
,
resized_img
.
cols
);
computeIntegralImages
(
resized_img
,
intImgP
,
intImgP2
);
for
(
int
i
=
0
;
i
<
cvFloor
((
0.0
+
resized_img
.
cols
-
initSize
.
width
)
/
dx
)
;
i
++
){
for
(
int
j
=
0
;
j
<
cvFloor
((
0.0
+
resized_img
.
rows
-
initSize
.
height
)
/
dy
)
;
j
++
){
for
(
int
i
=
0
,
imax
=
cvFloor
((
0.0
+
resized_img
.
cols
-
initSize
.
width
)
/
dx
);
i
<
imax
;
i
++
){
for
(
int
j
=
0
,
jmax
=
cvFloor
((
0.0
+
resized_img
.
rows
-
initSize
.
height
)
/
dy
);
j
<
jmax
;
j
++
){
total
++
;
if
(
!
patchVariance
(
intImgP
,
intImgP2
,
originalVariance
,
Point
(
dx
*
i
,
dy
*
j
),
initSize
)){
continue
;
...
...
@@ -769,10 +786,6 @@ bool Nexpert::operator()(Rect2d box){
Data
::
Data
(
Rect2d
initBox
){
double
minDim
=
MIN
(
initBox
.
width
,
initBox
.
height
);
scale
=
20.0
/
minDim
;
/*if(minDim<20){
printf("initial box has size %dx%d, while both dimensions should be no less than %d\n",(int)initBox.width,(int)initBox.height,20);
exit(EXIT_FAILURE);
}*/
minSize
.
width
=
(
int
)(
initBox
.
width
*
20.0
/
minDim
);
minSize
.
height
=
(
int
)(
initBox
.
height
*
20.0
/
minDim
);
frameNum
=
0
;
...
...
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