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
62939e29
Commit
62939e29
authored
Sep 06, 2017
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tracking: slightly rewrite main loop in TLD
parent
a0896c7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
26 deletions
+24
-26
tldTracker.cpp
modules/tracking/src/tldTracker.cpp
+24
-26
No files found.
modules/tracking/src/tldTracker.cpp
View file @
62939e29
...
...
@@ -140,37 +140,35 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
std
::
vector
<
Rect2d
>
candidates
;
std
::
vector
<
double
>
candidatesRes
;
bool
trackerNeedsReInit
=
false
;
bool
DETECT_FLG
=
false
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
bool
DETECT_FLG
=
false
;
//run tracker
Rect2d
tmpCandid
=
boundingBox
;
if
(
!
data
->
failedLastTime
&&
trackerProxy
->
update
(
image
,
tmpCandid
))
{
Rect2d
tmpCandid
=
boundingBox
;
candidates
.
push_back
(
tmpCandid
);
resample
(
image_gray
,
tmpCandid
,
standardPatch
);
candidatesRes
.
push_back
(
tldModel
->
detector
->
Sc
(
standardPatch
));
}
else
trackerNeedsReInit
=
true
;
if
(
i
==
1
)
{
//run detector
tmpCandid
=
boundingBox
;
#ifdef HAVE_OPENCL
if
(
false
)
//ocl::useOpenCL())
{
DETECT_FLG
=
tldModel
->
detector
->
ocl_detect
(
imageForDetector
,
image_blurred
,
tmpCandid
,
detectorResults
,
tldModel
->
getMinSize
());
}
else
if
(
false
)
//ocl::useOpenCL())
DETECT_FLG
=
tldModel
->
detector
->
ocl_detect
(
imageForDetector
,
image_blurred
,
tmpCandid
,
detectorResults
,
tldModel
->
getMinSize
());
else
#endif
DETECT_FLG
=
tldModel
->
detector
->
detect
(
imageForDetector
,
image_blurred
,
tmpCandid
,
detectorResults
,
tldModel
->
getMinSize
());
}
if
(
(
(
i
==
0
)
&&
!
data
->
failedLastTime
&&
trackerProxy
->
update
(
image
,
tmpCandid
)
)
||
(
DETECT_FLG
))
{
candidates
.
push_back
(
tmpCandid
);
if
(
i
==
0
)
resample
(
image_gray
,
tmpCandid
,
standardPatch
);
else
resample
(
imageForDetector
,
tmpCandid
,
standardPatch
);
candidatesRes
.
push_back
(
tldModel
->
detector
->
Sc
(
standardPatch
));
}
else
{
if
(
i
==
0
)
trackerNeedsReInit
=
true
;
}
DETECT_FLG
=
tldModel
->
detector
->
detect
(
imageForDetector
,
image_blurred
,
tmpCandid
,
detectorResults
,
tldModel
->
getMinSize
());
if
(
DETECT_FLG
)
{
candidates
.
push_back
(
tmpCandid
);
resample
(
imageForDetector
,
tmpCandid
,
standardPatch
);
candidatesRes
.
push_back
(
tldModel
->
detector
->
Sc
(
standardPatch
));
}
std
::
vector
<
double
>::
iterator
it
=
std
::
max_element
(
candidatesRes
.
begin
(),
candidatesRes
.
end
());
if
(
it
==
candidatesRes
.
end
()
)
//candidates are empty
...
...
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