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
dfbdb1c4
Commit
dfbdb1c4
authored
Jul 17, 2014
by
Alex Leontiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blur as vadim debug
parent
97d2aa9f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
trackerTLD.cpp
modules/tracking/src/trackerTLD.cpp
+9
-8
No files found.
modules/tracking/src/trackerTLD.cpp
View file @
dfbdb1c4
...
@@ -48,11 +48,12 @@
...
@@ -48,11 +48,12 @@
#include "TLD.hpp"
#include "TLD.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/highgui.hpp"
#define THETA_NN 0.5
#define THETA_NN 0.5
0
#define CORE_THRESHOLD 0.5
#define CORE_THRESHOLD 0.5
#define NEG_EXAMPLES_IN_INIT_MODEL 300
#define NEG_EXAMPLES_IN_INIT_MODEL 300
#define MAX_EXAMPLES_IN_MODEL 500
#define MAX_EXAMPLES_IN_MODEL 500
#define MEASURES_PER_CLASSIFIER 13
#define MEASURES_PER_CLASSIFIER 13
#define DOWNSCALE_MODE INTER_LINEAR
#define BLUR_AS_VADIM
#define BLUR_AS_VADIM
#undef CLOSED_LOOP
#undef CLOSED_LOOP
static
const
cv
::
Size
GaussBlurKernelSize
(
3
,
3
);
static
const
cv
::
Size
GaussBlurKernelSize
(
3
,
3
);
...
@@ -269,7 +270,7 @@ bool TrackerTLDImpl::initImpl(const Mat& image, const Rect2d& boundingBox ){
...
@@ -269,7 +270,7 @@ bool TrackerTLDImpl::initImpl(const Mat& image, const Rect2d& boundingBox ){
Rect2d
myBoundingBox
=
boundingBox
;
Rect2d
myBoundingBox
=
boundingBox
;
if
(
scale
>
1.0
){
if
(
scale
>
1.0
){
Mat
image_proxy
;
Mat
image_proxy
;
resize
(
image_gray
,
image_proxy
,
Size
(
cvRound
(
image
.
cols
*
scale
),
cvRound
(
image
.
rows
*
scale
)));
resize
(
image_gray
,
image_proxy
,
Size
(
cvRound
(
image
.
cols
*
scale
),
cvRound
(
image
.
rows
*
scale
))
,
0
,
0
,
DOWNSCALE_MODE
);
image_proxy
.
copyTo
(
image_gray
);
image_proxy
.
copyTo
(
image_gray
);
myBoundingBox
.
x
*=
scale
;
myBoundingBox
.
x
*=
scale
;
myBoundingBox
.
y
*=
scale
;
myBoundingBox
.
y
*=
scale
;
...
@@ -298,7 +299,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox){
...
@@ -298,7 +299,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox){
cvtColor
(
image
,
image_gray
,
COLOR_BGR2GRAY
);
cvtColor
(
image
,
image_gray
,
COLOR_BGR2GRAY
);
double
scale
=
data
->
getScale
();
double
scale
=
data
->
getScale
();
if
(
scale
>
1.0
){
if
(
scale
>
1.0
){
resize
(
image_gray
,
imageForDetector
,
Size
(
cvRound
(
image
.
cols
*
scale
),
cvRound
(
image
.
rows
*
scale
)));
resize
(
image_gray
,
imageForDetector
,
Size
(
cvRound
(
image
.
cols
*
scale
),
cvRound
(
image
.
rows
*
scale
))
,
0
,
0
,
DOWNSCALE_MODE
);
}
else
{
}
else
{
imageForDetector
=
image_gray
;
imageForDetector
=
image_gray
;
}
}
...
@@ -446,8 +447,8 @@ timeStampPositiveNext(0),timeStampNegativeNext(0),params_(params){
...
@@ -446,8 +447,8 @@ timeStampPositiveNext(0),timeStampNegativeNext(0),params_(params){
}
}
#ifdef BLUR_AS_VADIM
#ifdef BLUR_AS_VADIM
resize
(
standardPatch
,
blurredPatch
,
minSize
);
GaussianBlur
(
standardPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
GaussianBlur
(
blurredPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
resize
(
blurredPatch
,
blurredPatch
,
minSize
);
CV_Assert
(
blurredPatch
.
cols
==
minSize
.
width
&&
blurredPatch
.
rows
==
minSize
.
height
);
CV_Assert
(
blurredPatch
.
cols
==
minSize
.
width
&&
blurredPatch
.
rows
==
minSize
.
height
);
#else
#else
resample
(
blurredImg
,
RotatedRect
(
center
,
size
,
angle
),
blurredPatch
);
resample
(
blurredImg
,
RotatedRect
(
center
,
size
,
angle
),
blurredPatch
);
...
@@ -564,7 +565,7 @@ bool TLDDetector::detect(const Mat& img,const Mat& imgBlurred,Rect2d& res,std::v
...
@@ -564,7 +565,7 @@ bool TLDDetector::detect(const Mat& img,const Mat& imgBlurred,Rect2d& res,std::v
size
.
width
/=
1.2
;
size
.
width
/=
1.2
;
size
.
height
/=
1.2
;
size
.
height
/=
1.2
;
scale
*=
1.2
;
scale
*=
1.2
;
resize
(
img
,
resized_img
,
size
);
resize
(
img
,
resized_img
,
size
,
0
,
0
,
DOWNSCALE_MODE
);
GaussianBlur
(
resized_img
,
blurred_img
,
GaussBlurKernelSize
,
0.0
f
);
GaussianBlur
(
resized_img
,
blurred_img
,
GaussBlurKernelSize
,
0.0
f
);
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
}
while
(
size
.
width
>=
initSize
.
width
&&
size
.
height
>=
initSize
.
height
);
END_TICK
(
"detector"
);
END_TICK
(
"detector"
);
...
@@ -775,8 +776,8 @@ int Pexpert::additionalExamples(std::vector<Mat_<uchar> >& examplesForModel,std:
...
@@ -775,8 +776,8 @@ int Pexpert::additionalExamples(std::vector<Mat_<uchar> >& examplesForModel,std:
}
}
}
}
#ifdef BLUR_AS_VADIM
#ifdef BLUR_AS_VADIM
resize
(
standardPatch
,
blurredPatch
,
initSize_
);
GaussianBlur
(
standardPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
GaussianBlur
(
blurredPatch
,
blurredPatch
,
GaussBlurKernelSize
,
0.0
);
resize
(
blurredPatch
,
blurredPatch
,
initSize_
);
CV_Assert
(
blurredPatch
.
cols
==
initSize_
.
width
&&
blurredPatch
.
rows
==
initSize_
.
height
);
CV_Assert
(
blurredPatch
.
cols
==
initSize_
.
width
&&
blurredPatch
.
rows
==
initSize_
.
height
);
#else
#else
resample
(
blurredImg
,
RotatedRect
(
center
,
size
,
angle
),
blurredPatch
);
resample
(
blurredImg
,
RotatedRect
(
center
,
size
,
angle
),
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