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
97d2aa9f
Commit
97d2aa9f
authored
Jul 16, 2014
by
Alex Leontiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blur bug
parent
9e5b6684
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
25 deletions
+36
-25
benchmark.cpp
modules/tracking/samples/benchmark.cpp
+19
-12
TLDEnsembleClassifier.cpp
modules/tracking/src/TLDEnsembleClassifier.cpp
+1
-1
trackerTLD.cpp
modules/tracking/src/trackerTLD.cpp
+16
-12
No files found.
modules/tracking/samples/benchmark.cpp
View file @
97d2aa9f
...
...
@@ -7,7 +7,7 @@
#include <cstring>
#include <climits>
#define CMDLINEMAX
1
0
#define CMDLINEMAX
3
0
#define ASSESS_TILL 100
#define LINEMAX 40
...
...
@@ -20,7 +20,8 @@ using namespace cv;
static
Mat
image
;
static
bool
paused
;
vector
<
Scalar
>
palette
;
static
bool
saveImageKey
;
static
vector
<
Scalar
>
palette
;
void
print_table
(
char
*
videos
[],
int
videoNum
,
char
*
algorithms
[],
int
algNum
,
const
vector
<
vector
<
char
*>
>&
results
,
char
*
tableName
);
...
...
@@ -67,20 +68,15 @@ static void help(){
exit
(
EXIT_SUCCESS
);
}
static
void
parseCommandLineArgs
(
int
argc
,
char
**
argv
,
char
*
videos
[],
char
*
gts
[],
int
*
vc
,
char
*
algorithms
[],
char
*
initBoxes
[][
CMDLINEMAX
],
int
*
ac
){
int
*
vc
,
char
*
algorithms
[],
char
*
initBoxes
[][
CMDLINEMAX
],
int
*
ac
,
char
keys
[
CMDLINEMAX
][
LINEMAX
]
){
*
ac
=*
vc
=
0
;
for
(
int
i
=
1
;
i
<
argc
;
i
++
){
if
(
argv
[
i
][
0
]
==
'-'
){
char
*
key
=
(
argv
[
i
]
+
1
),
*
argument
=
NULL
;
if
(
std
::
strcmp
(
"h"
,
key
)
==
0
||
std
::
strcmp
(
"help"
,
key
)
==
0
){
help
()
;
for
(
int
j
=
0
;
j
<
CMDLINEMAX
;
j
++
){
if
(
!
strcmp
(
argv
[
i
],
keys
[
j
])
){
keys
[
j
][
0
]
=
'\0'
;
}
if
((
argument
=
strchr
(
argv
[
i
],
'='
))
==
NULL
){
i
++
;
argument
=
argv
[
i
];
}
else
{
argument
++
;
}
continue
;
}
...
...
@@ -193,6 +189,8 @@ static AssessmentRes assessment(char* video,char* gt_str, char* algorithms[],cha
int
linecount
=
0
;
Rect2d
boundingBox
;
vector
<
double
>
averageMillisPerFrame
(
algnum
,
0.0
);
static
int
videoNum
=
0
;
videoNum
++
;
FILE
*
gt
=
fopen
(
gt_str
,
"r"
);
if
(
gt
==
NULL
){
...
...
@@ -312,6 +310,11 @@ static AssessmentRes assessment(char* video,char* gt_str, char* algorithms[],cha
res
.
results
[
i
][
j
]
->
assess
(
boundingBox
,
initBoxes
[
i
]);
}
imshow
(
"Tracking API"
,
image
);
if
(
saveImageKey
){
char
inbuf
[
LINEMAX
];
sprintf
(
inbuf
,
"image%d_%d.jpg"
,
videoNum
,
frameCounter
);
imwrite
(
inbuf
,
image
);
}
if
((
frameCounter
+
1
)
>=
ASSESS_TILL
){
break
;
...
...
@@ -342,7 +345,11 @@ int main( int argc, char** argv ){
palette
.
push_back
(
Scalar
(
0
,
255
,
255
));
int
vcount
=
0
,
acount
=
0
;
char
*
videos
[
CMDLINEMAX
],
*
gts
[
CMDLINEMAX
],
*
algorithms
[
CMDLINEMAX
],
*
initBoxes
[
CMDLINEMAX
][
CMDLINEMAX
];
parseCommandLineArgs
(
argc
,
argv
,
videos
,
gts
,
&
vcount
,
algorithms
,
initBoxes
,
&
acount
);
char
keys
[
CMDLINEMAX
][
LINEMAX
];
strcpy
(
keys
[
0
],
"-s"
);
parseCommandLineArgs
(
argc
,
argv
,
videos
,
gts
,
&
vcount
,
algorithms
,
initBoxes
,
&
acount
,
keys
);
saveImageKey
=
(
keys
[
0
][
0
]
==
'\0'
);
CV_Assert
(
acount
<
CMDLINEMAX
&&
vcount
<
CMDLINEMAX
);
printf
(
"videos and gts
\n
"
);
for
(
int
i
=
0
;
i
<
vcount
;
i
++
){
...
...
modules/tracking/src/TLDEnsembleClassifier.cpp
View file @
97d2aa9f
...
...
@@ -48,7 +48,7 @@
using
namespace
cv
;
namespace
cv
{
namespace
tld
namespace
cv
{
namespace
tld
{
int
TLDEnsembleClassifier
::
getGridSize
(){
return
15
;
...
...
modules/tracking/src/trackerTLD.cpp
View file @
97d2aa9f
...
...
@@ -53,7 +53,7 @@
#define NEG_EXAMPLES_IN_INIT_MODEL 300
#define MAX_EXAMPLES_IN_MODEL 500
#define MEASURES_PER_CLASSIFIER 13
#
undef
BLUR_AS_VADIM
#
define
BLUR_AS_VADIM
#undef CLOSED_LOOP
static
const
cv
::
Size
GaussBlurKernelSize
(
3
,
3
);
...
...
@@ -66,12 +66,12 @@ using namespace tld;
* direct formula in resamples
* FIXME(issues)
* THETA_NN 0.5<->0.6 dramatic change vs video 6 !!
* FIXME(features)
* benchmark: save photos --> two streams of photos --> better video
* TODO(features)
* benchmark: two streams of photos --> better video
* (try inter_area for resize)
* TODO:
* schoolPC: codec, libopencv-dev
* fix pushbot ->pick commits -> compare_branches->all in 1->resubmit
* ||video(0.5<->0.6) --> debug if box size is less than 20
--> (remove ensemble self-loop) --> (try inter_area for resize)
* ||video(0.5<->0.6) --> debug if box size is less than 20
* perfect PN
*
* vadim:
...
...
@@ -446,7 +446,9 @@ timeStampPositiveNext(0),timeStampNegativeNext(0),params_(params){
}
#ifdef BLUR_AS_VADIM
GaussianBlur
(
standardPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
resize
(
standardPatch
,
blurredPatch
,
minSize
);
GaussianBlur
(
blurredPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
CV_Assert
(
blurredPatch
.
cols
==
minSize
.
width
&&
blurredPatch
.
rows
==
minSize
.
height
);
#else
resample
(
blurredImg
,
RotatedRect
(
center
,
size
,
angle
),
blurredPatch
);
#endif
...
...
@@ -767,17 +769,19 @@ int Pexpert::additionalExamples(std::vector<Mat_<uchar> >& examplesForModel,std:
size
.
height
=
(
float
)(
closest
[
i
].
height
*
rng
.
uniform
((
double
)
0.99
,(
double
)
1.01
));
float
angle
=
(
float
)
rng
.
uniform
(
-
5.0
,
5.0
);
#ifdef BLUR_AS_VADIM
GaussianBlur
(
standardPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
#else
resample
(
blurredImg
,
RotatedRect
(
center
,
size
,
angle
),
blurredPatch
);
#endif
resample
(
scaledImg
,
RotatedRect
(
center
,
size
,
angle
),
standardPatch
);
for
(
int
y
=
0
;
y
<
standardPatch
.
rows
;
y
++
){
for
(
int
x
=
0
;
x
<
standardPatch
.
cols
;
x
++
){
standardPatch
(
x
,
y
)
+=
(
uchar
)
rng
.
gaussian
(
5.0
);
}
}
#ifdef BLUR_AS_VADIM
resize
(
standardPatch
,
blurredPatch
,
initSize_
);
GaussianBlur
(
blurredPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
CV_Assert
(
blurredPatch
.
cols
==
initSize_
.
width
&&
blurredPatch
.
rows
==
initSize_
.
height
);
#else
resample
(
blurredImg
,
RotatedRect
(
center
,
size
,
angle
),
blurredPatch
);
#endif
resample
(
scaledImg
,
RotatedRect
(
center
,
size
,
angle
),
standardPatch
);
examplesForModel
.
push_back
(
standardPatch
);
examplesForEnsemble
.
push_back
(
blurredPatch
);
}
...
...
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