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
8869daec
Commit
8869daec
authored
Jun 27, 2014
by
Alex Leontiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
f080b344
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
22 deletions
+24
-22
benchmark.cpp
modules/tracking/samples/benchmark.cpp
+8
-6
tracker.cpp
modules/tracking/samples/tracker.cpp
+3
-3
TLD.cpp
modules/tracking/src/TLD.cpp
+2
-2
trackerTLD.cpp
modules/tracking/src/trackerTLD.cpp
+11
-11
No files found.
modules/tracking/samples/benchmark.cpp
View file @
8869daec
...
...
@@ -133,7 +133,7 @@ void print_table(char* videos[],int videoNum,char* algorithms[],int algNum,const
grid
[
0
]
=
std
::
max
(
grid
[
0
],(
int
)
strlen
(
videos
[
i
]));
}
for
(
int
i
=
0
;
i
<
algNum
;
i
++
){
grid
[
i
+
1
]
=
strlen
(
algorithms
[
i
]);
grid
[
i
+
1
]
=
(
int
)
strlen
(
algorithms
[
i
]);
for
(
int
j
=
0
;
j
<
videoNum
;
j
++
)
grid
[
i
+
1
]
=
std
::
max
(
grid
[
i
+
1
],(
int
)
strlen
(
results
[
j
][
i
]));
}
...
...
@@ -199,11 +199,11 @@ private:
};
AssessmentRes
::
AssessmentRes
(
int
algnum
)
:
len
(
0
),
results
(
algnum
){
for
(
int
i
=
0
;
i
<
(
int
)
results
.
size
();
i
++
){
if
(
!
false
){
#if !0
results
[
i
].
push_back
(
Ptr
<
Assessment
>
(
new
CorrectFrames
(
0.0
)));
}
else
{
#else
results
[
i
].
push_back
(
Ptr
<
Assessment
>
(
new
CorrectFrames
(
0.5
)));
}
#endif
results
[
i
].
push_back
(
Ptr
<
Assessment
>
(
new
PRF
()));
}
}
...
...
@@ -295,7 +295,7 @@ static AssessmentRes assessment(char* video,char* gt_str, char* algorithms[],cha
imshow
(
"Tracking API"
,
image
);
int
frameCounter
=
0
;
AssessmentRes
res
(
trackers
.
size
());
AssessmentRes
res
(
(
int
)
trackers
.
size
());
for
(
;;
){
if
(
!
paused
){
...
...
@@ -330,13 +330,15 @@ static AssessmentRes assessment(char* video,char* gt_str, char* algorithms[],cha
rectangle
(
image
,
initBoxes
[
i
],
palette
[
i
+
1
],
2
,
1
);
}
if
(
!
true
&&
i
==
1
){
#if !1
if
(
i
==
1
){
printf
(
"TLD
\n
"
);
printf
(
"boundingBox=[%f,%f,%f,%f]
\n
"
,
boundingBox
.
x
,
boundingBox
.
y
,
boundingBox
.
width
,
boundingBox
.
height
);
printf
(
"initBoxes[i]=[%f,%f,%f,%f]
\n
"
,
initBoxes
[
i
].
x
,
initBoxes
[
i
].
y
,
initBoxes
[
i
].
width
,
initBoxes
[
i
].
height
);
printf
(
"overlap=%f
\n
"
,
overlap
(
initBoxes
[
i
],
boundingBox
));
exit
(
0
);
}
#endif
for
(
int
j
=
0
;
j
<
(
int
)
res
.
results
[
i
].
size
();
j
++
)
res
.
results
[
i
][
j
]
->
assess
(
boundingBox
,
initBoxes
[
i
]);
...
...
modules/tracking/samples/tracker.cpp
View file @
8869daec
...
...
@@ -58,7 +58,7 @@ static void onMouse( int event, int x, int y, int, void* )
//draw the bounding box
Mat
currentFrame
;
image
.
copyTo
(
currentFrame
);
rectangle
(
currentFrame
,
Point
(
boundingBox
.
x
,
boundingBox
.
y
),
Point
(
x
,
y
),
Scalar
(
255
,
0
,
0
),
2
,
1
);
rectangle
(
currentFrame
,
Point
(
(
int
)
boundingBox
.
x
,
(
int
)
boundingBox
.
y
),
Point
(
x
,
y
),
Scalar
(
255
,
0
,
0
),
2
,
1
);
imshow
(
"Tracking API"
,
currentFrame
);
}
break
;
...
...
@@ -96,7 +96,7 @@ int main( int argc, char** argv ){
int
coords
[
4
]
=
{
0
,
0
,
0
,
0
};
bool
initBoxWasGivenInCommandLine
=
false
;
do
{
{
String
initBoundingBox
=
parser
.
get
<
String
>
(
3
);
for
(
size_t
npos
=
0
,
pos
=
0
,
ctr
=
0
;
ctr
<
4
;
ctr
++
){
npos
=
initBoundingBox
.
find_first_of
(
','
,
pos
);
...
...
@@ -119,7 +119,7 @@ int main( int argc, char** argv ){
if
(
coords
[
0
]
>
0
&&
coords
[
1
]
>
0
&&
coords
[
2
]
>
0
&&
coords
[
3
]
>
0
){
initBoxWasGivenInCommandLine
=
true
;
}
}
while
(
0
);
}
//open the capture
VideoCapture
cap
;
...
...
modules/tracking/src/TLD.cpp
View file @
8869daec
...
...
@@ -199,8 +199,8 @@ double variance(Mat_<unsigned int>& intImgP,Mat_<unsigned int>& intImgP2,Rect bo
}
double
NCC
(
Mat_
<
uchar
>
patch1
,
Mat_
<
uchar
>
patch2
){
CV_Assert
(
patch1
.
rows
=
patch2
.
rows
);
CV_Assert
(
patch1
.
cols
=
patch2
.
cols
);
CV_Assert
(
patch1
.
rows
=
=
patch2
.
rows
);
CV_Assert
(
patch1
.
cols
=
=
patch2
.
cols
);
int
N
=
patch1
.
rows
*
patch1
.
cols
;
double
s1
=
sum
(
patch1
)(
0
),
s2
=
sum
(
patch2
)(
0
);
...
...
modules/tracking/src/trackerTLD.cpp
View file @
8869daec
...
...
@@ -772,8 +772,8 @@ Data::Data(Rect2d initBox){
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
=
initBox
.
width
*
20.0
/
minDim
;
minSize
.
height
=
initBox
.
height
*
20.0
/
minDim
;
minSize
.
width
=
(
int
)(
initBox
.
width
*
20.0
/
minDim
)
;
minSize
.
height
=
(
int
)(
initBox
.
height
*
20.0
/
minDim
)
;
frameNum
=
0
;
printf
(
"minSize= %dx%d
\n
"
,
minSize
.
width
,
minSize
.
height
);
}
...
...
@@ -811,19 +811,19 @@ void MyMouseCallbackDEBUG::onMouse( int event, int x, int y){
detector_
->
computeIntegralImages
(
resized_img
,
intImgP
,
intImgP2
);
int
dx
=
initSize
.
width
/
10
,
dy
=
initSize
.
height
/
10
,
i
=
x
/
scale
/
dx
,
j
=
y
/
scale
/
dy
;
i
=
(
int
)(
x
/
scale
/
dx
),
j
=
(
int
)(
y
/
scale
/
dy
)
;
fprintf
(
std
out
,
"patchVariance=%s
\n
"
,(
detector_
->
patchVariance
(
intImgP
,
intImgP2
,
originalVariance
,
Point
(
dx
*
i
,
dy
*
j
),
initSize
))
?
"true"
:
"false"
);
fprintf
(
std
out
,
"p=%f
\n
"
,(
detector_
->
ensembleClassifierNum
(
&
blurred_img
.
at
<
uchar
>
(
dy
*
j
,
dx
*
i
),
blurred_img
.
step
[
0
])));
fprintf
(
std
out
,
"ensembleClassifier=%s
\n
"
,
(
detector_
->
ensembleClassifier
(
&
blurred_img
.
at
<
uchar
>
(
dy
*
j
,
dx
*
i
),
blurred_img
.
step
[
0
]))
?
"true"
:
"false"
);
fprintf
(
std
err
,
"patchVariance=%s
\n
"
,(
detector_
->
patchVariance
(
intImgP
,
intImgP2
,
originalVariance
,
Point
(
dx
*
i
,
dy
*
j
),
initSize
))
?
"true"
:
"false"
);
fprintf
(
std
err
,
"p=%f
\n
"
,(
detector_
->
ensembleClassifierNum
(
&
blurred_img
.
at
<
uchar
>
(
dy
*
j
,
dx
*
i
),(
int
)
blurred_img
.
step
[
0
])));
fprintf
(
std
err
,
"ensembleClassifier=%s
\n
"
,
(
detector_
->
ensembleClassifier
(
&
blurred_img
.
at
<
uchar
>
(
dy
*
j
,
dx
*
i
),
(
int
)
blurred_img
.
step
[
0
]))
?
"true"
:
"false"
);
resample
(
resized_img
,
Rect2d
(
Point
(
dx
*
i
,
dy
*
j
),
initSize
),
standardPatch
);
tmp
=
tldModel
->
Sr
(
standardPatch
);
fprintf
(
std
out
,
"Sr=%f
\n
"
,
tmp
);
fprintf
(
std
out
,
"isObject=%s
\n
"
,(
tmp
>
THETA_NN
)
?
"true"
:
"false"
);
fprintf
(
std
out
,
"shouldBeIntegrated=%s
\n
"
,(
abs
(
tmp
-
THETA_NN
)
<
0.1
)
?
"true"
:
"false"
);
fprintf
(
std
out
,
"Sc=%f
\n
"
,
tldModel
->
Sc
(
standardPatch
));
fprintf
(
std
err
,
"Sr=%f
\n
"
,
tmp
);
fprintf
(
std
err
,
"isObject=%s
\n
"
,(
tmp
>
THETA_NN
)
?
"true"
:
"false"
);
fprintf
(
std
err
,
"shouldBeIntegrated=%s
\n
"
,(
abs
(
tmp
-
THETA_NN
)
<
0.1
)
?
"true"
:
"false"
);
fprintf
(
std
err
,
"Sc=%f
\n
"
,
tldModel
->
Sc
(
standardPatch
));
rectangle
(
imgCanvas
,
Rect2d
(
Point2d
(
scale
*
dx
*
i
,
scale
*
dy
*
j
),
Size2d
(
initSize
.
width
*
scale
,
initSize
.
height
*
scale
)),
0
,
2
,
1
);
imshow
(
"picker"
,
imgCanvas
);
...
...
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