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
bf8363a8
Commit
bf8363a8
authored
Feb 21, 2017
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KCF: simplify roi validation
parent
9f35b313
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
trackerKCF.cpp
modules/tracking/src/trackerKCF.cpp
+8
-7
No files found.
modules/tracking/src/trackerKCF.cpp
View file @
bf8363a8
...
...
@@ -188,7 +188,7 @@ namespace cv{
* - creating a gaussian response for the training ground-truth
* - perform FFT to the gaussian response
*/
bool
TrackerKCFImpl
::
initImpl
(
const
Mat
&
/*image*/
,
const
Rect2d
&
boundingBox
){
bool
TrackerKCFImpl
::
initImpl
(
const
Mat
&
image
,
const
Rect2d
&
boundingBox
){
frame
=
0
;
roi
=
boundingBox
;
...
...
@@ -256,7 +256,11 @@ namespace cv{
||
use_custom_extractor_npca
);
// TODO: return true only if roi inside the image
//return true only if roi has intersection with the image
if
((
roi
&
Rect2d
(
0
,
0
,
resizeImage
?
image
.
cols
/
2
:
image
.
cols
,
resizeImage
?
image
.
rows
/
2
:
image
.
rows
))
==
Rect2d
())
return
false
;
return
true
;
}
...
...
@@ -576,11 +580,8 @@ namespace cv{
Rect
region
=
_roi
;
// return false if roi is outside the image
if
((
_roi
.
x
+
_roi
.
width
<
0
)
||
(
_roi
.
y
+
_roi
.
height
<
0
)
||
(
_roi
.
x
>=
img
.
cols
)
||
(
_roi
.
y
>=
img
.
rows
)
)
return
false
;
if
((
roi
&
Rect2d
(
0
,
0
,
img
.
cols
,
img
.
rows
))
==
Rect2d
()
)
return
false
;
// extract patch inside the image
if
(
_roi
.
x
<
0
){
region
.
x
=
0
;
region
.
width
+=
_roi
.
x
;}
...
...
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