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
15da8085
Commit
15da8085
authored
Jun 09, 2015
by
Vladimir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Warnings #2
parent
603fb880
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
tldDataset.cpp
modules/tracking/src/tldDataset.cpp
+11
-11
tldDetector.cpp
modules/tracking/src/tldDetector.cpp
+3
-3
tldDetector.hpp
modules/tracking/src/tldDetector.hpp
+1
-1
tldModel.cpp
modules/tracking/src/tldModel.cpp
+2
-2
No files found.
modules/tracking/src/tldDataset.cpp
View file @
15da8085
...
@@ -51,61 +51,61 @@ namespace cv
...
@@ -51,61 +51,61 @@ namespace cv
cv
::
Rect2d
tld_InitDataset
(
int
datasetInd
,
const
char
*
rootPath
)
cv
::
Rect2d
tld_InitDataset
(
int
datasetInd
,
const
char
*
rootPath
)
{
{
char
*
folderName
=
""
;
char
*
folderName
=
(
char
*
)
""
;
int
x
,
y
,
w
,
h
;
int
x
,
y
,
w
,
h
;
flagPNG
=
false
;
flagPNG
=
false
;
frameNum
=
1
;
frameNum
=
1
;
if
(
datasetInd
==
1
)
{
if
(
datasetInd
==
1
)
{
folderName
=
"01_david"
;
folderName
=
(
char
*
)
"01_david"
;
x
=
165
,
y
=
83
;
x
=
165
,
y
=
83
;
w
=
51
;
h
=
54
;
w
=
51
;
h
=
54
;
frameNum
=
100
;
frameNum
=
100
;
}
}
if
(
datasetInd
==
2
)
{
if
(
datasetInd
==
2
)
{
folderName
=
"02_jumping"
;
folderName
=
(
char
*
)
"02_jumping"
;
x
=
147
,
y
=
110
;
x
=
147
,
y
=
110
;
w
=
33
;
h
=
32
;
w
=
33
;
h
=
32
;
}
}
if
(
datasetInd
==
3
)
{
if
(
datasetInd
==
3
)
{
folderName
=
"03_pedestrian1"
;
folderName
=
(
char
*
)
"03_pedestrian1"
;
x
=
47
,
y
=
51
;
x
=
47
,
y
=
51
;
w
=
21
;
h
=
36
;
w
=
21
;
h
=
36
;
}
}
if
(
datasetInd
==
4
)
{
if
(
datasetInd
==
4
)
{
folderName
=
"04_pedestrian2"
;
folderName
=
(
char
*
)
"04_pedestrian2"
;
x
=
130
,
y
=
134
;
x
=
130
,
y
=
134
;
w
=
21
;
h
=
53
;
w
=
21
;
h
=
53
;
}
}
if
(
datasetInd
==
5
)
{
if
(
datasetInd
==
5
)
{
folderName
=
"05_pedestrian3"
;
folderName
=
(
char
*
)
"05_pedestrian3"
;
x
=
154
,
y
=
102
;
x
=
154
,
y
=
102
;
w
=
24
;
h
=
52
;
w
=
24
;
h
=
52
;
}
}
if
(
datasetInd
==
6
)
{
if
(
datasetInd
==
6
)
{
folderName
=
"06_car"
;
folderName
=
(
char
*
)
"06_car"
;
x
=
142
,
y
=
125
;
x
=
142
,
y
=
125
;
w
=
90
;
h
=
39
;
w
=
90
;
h
=
39
;
}
}
if
(
datasetInd
==
7
)
{
if
(
datasetInd
==
7
)
{
folderName
=
"07_motocross"
;
folderName
=
(
char
*
)
"07_motocross"
;
x
=
290
,
y
=
43
;
x
=
290
,
y
=
43
;
w
=
23
;
h
=
40
;
w
=
23
;
h
=
40
;
flagPNG
=
true
;
flagPNG
=
true
;
}
}
if
(
datasetInd
==
8
)
{
if
(
datasetInd
==
8
)
{
folderName
=
"08_volkswagen"
;
folderName
=
(
char
*
)
"08_volkswagen"
;
x
=
273
,
y
=
77
;
x
=
273
,
y
=
77
;
w
=
27
;
h
=
25
;
w
=
27
;
h
=
25
;
}
}
if
(
datasetInd
==
9
)
{
if
(
datasetInd
==
9
)
{
folderName
=
"09_carchase"
;
folderName
=
(
char
*
)
"09_carchase"
;
x
=
145
,
y
=
84
;
x
=
145
,
y
=
84
;
w
=
54
;
h
=
37
;
w
=
54
;
h
=
37
;
}
}
if
(
datasetInd
==
10
){
if
(
datasetInd
==
10
){
folderName
=
"10_panda"
;
folderName
=
(
char
*
)
"10_panda"
;
x
=
58
,
y
=
100
;
x
=
58
,
y
=
100
;
w
=
27
;
h
=
22
;
w
=
27
;
h
=
22
;
}
}
...
...
modules/tracking/src/tldDetector.cpp
View file @
15da8085
...
@@ -159,7 +159,7 @@ namespace cv
...
@@ -159,7 +159,7 @@ namespace cv
{
{
LabeledPatch
labPatch
;
LabeledPatch
labPatch
;
total
++
;
total
++
;
if
(
!
patchVariance
(
intImgP
,
intImgP2
,
*
originalVariance
,
Point
(
dx
*
i
,
dy
*
j
),
initSize
))
if
(
!
patchVariance
(
intImgP
,
intImgP2
,
originalVariance
,
Point
(
dx
*
i
,
dy
*
j
),
initSize
))
continue
;
continue
;
if
(
ensembleClassifierNum
(
&
blurred_img
.
at
<
uchar
>
(
dy
*
j
,
dx
*
i
))
<=
ENSEMBLE_THRESHOLD
)
if
(
ensembleClassifierNum
(
&
blurred_img
.
at
<
uchar
>
(
dy
*
j
,
dx
*
i
))
<=
ENSEMBLE_THRESHOLD
)
continue
;
continue
;
...
@@ -209,7 +209,7 @@ namespace cv
...
@@ -209,7 +209,7 @@ namespace cv
// Computes the variance of subimage given by box, with the help of two integral
// Computes the variance of subimage given by box, with the help of two integral
// images intImgP and intImgP2 (sum of squares), which should be also provided.
// images intImgP and intImgP2 (sum of squares), which should be also provided.
bool
TLDDetector
::
patchVariance
(
Mat_
<
double
>&
intImgP
,
Mat_
<
double
>&
intImgP2
,
double
originalVariance
,
Point
pt
,
Size
size
)
bool
TLDDetector
::
patchVariance
(
Mat_
<
double
>&
intImgP
,
Mat_
<
double
>&
intImgP2
,
double
*
originalVariance
,
Point
pt
,
Size
size
)
{
{
int
x
=
(
pt
.
x
),
y
=
(
pt
.
y
),
width
=
(
size
.
width
),
height
=
(
size
.
height
);
int
x
=
(
pt
.
x
),
y
=
(
pt
.
y
),
width
=
(
size
.
width
),
height
=
(
size
.
height
);
CV_Assert
(
0
<=
x
&&
(
x
+
width
)
<
intImgP
.
cols
&&
(
x
+
width
)
<
intImgP2
.
cols
);
CV_Assert
(
0
<=
x
&&
(
x
+
width
)
<
intImgP
.
cols
&&
(
x
+
width
)
<
intImgP2
.
cols
);
...
@@ -229,7 +229,7 @@ namespace cv
...
@@ -229,7 +229,7 @@ namespace cv
D
=
intImgP2
(
y
+
height
,
x
+
width
);
D
=
intImgP2
(
y
+
height
,
x
+
width
);
p2
=
(
A
+
D
-
B
-
C
)
/
(
width
*
height
);
p2
=
(
A
+
D
-
B
-
C
)
/
(
width
*
height
);
return
((
p2
-
p
*
p
)
>
VARIANCE_THRESHOLD
*
originalVariance
);
return
((
p2
-
p
*
p
)
>
VARIANCE_THRESHOLD
*
*
originalVariance
);
}
}
}
}
...
...
modules/tracking/src/tldDetector.hpp
View file @
15da8085
...
@@ -94,7 +94,7 @@ namespace cv
...
@@ -94,7 +94,7 @@ namespace cv
friend
class
MyMouseCallbackDEBUG
;
friend
class
MyMouseCallbackDEBUG
;
void
computeIntegralImages
(
const
Mat
&
img
,
Mat_
<
double
>&
intImgP
,
Mat_
<
double
>&
intImgP2
){
integral
(
img
,
intImgP
,
intImgP2
,
CV_64F
);
}
void
computeIntegralImages
(
const
Mat
&
img
,
Mat_
<
double
>&
intImgP
,
Mat_
<
double
>&
intImgP2
){
integral
(
img
,
intImgP
,
intImgP2
,
CV_64F
);
}
inline
bool
patchVariance
(
Mat_
<
double
>&
intImgP
,
Mat_
<
double
>&
intImgP2
,
double
originalVariance
,
Point
pt
,
Size
size
);
inline
bool
patchVariance
(
Mat_
<
double
>&
intImgP
,
Mat_
<
double
>&
intImgP2
,
double
*
originalVariance
,
Point
pt
,
Size
size
);
};
};
}
}
}
}
...
...
modules/tracking/src/tldModel.cpp
View file @
15da8085
...
@@ -46,8 +46,8 @@ namespace cv
...
@@ -46,8 +46,8 @@ namespace cv
namespace
tld
namespace
tld
{
{
//Constructor
//Constructor
TrackerTLDModel
::
TrackerTLDModel
(
TrackerTLD
::
Params
params
,
const
Mat
&
image
,
const
Rect2d
&
boundingBox
,
Size
minSize
)
:
minSize_
(
minSize
),
TrackerTLDModel
::
TrackerTLDModel
(
TrackerTLD
::
Params
params
,
const
Mat
&
image
,
const
Rect2d
&
boundingBox
,
Size
minSize
)
:
timeStampPositiveNext
(
0
),
timeStampNegativeNext
(
0
),
params_
(
params
),
boundingBox_
(
boundingBox
)
timeStampPositiveNext
(
0
),
timeStampNegativeNext
(
0
),
minSize_
(
minSize
),
params_
(
params
),
boundingBox_
(
boundingBox
)
{
{
std
::
vector
<
Rect2d
>
closest
,
scanGrid
;
std
::
vector
<
Rect2d
>
closest
,
scanGrid
;
Mat
scaledImg
,
blurredImg
,
image_blurred
;
Mat
scaledImg
,
blurredImg
,
image_blurred
;
...
...
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