Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
daec4d88
Commit
daec4d88
authored
12 years ago
by
Leonid Beynenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now the DetectionBasedTracker will throw exception if it cannot load cascade detector from a file.
parent
47f72b53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
detection_based_tracker.cpp
modules/contrib/src/detection_based_tracker.cpp
+9
-3
No files found.
modules/contrib/src/detection_based_tracker.cpp
View file @
daec4d88
...
...
@@ -107,12 +107,15 @@ class DetectionBasedTracker::SeparateDetectionWork
DetectionBasedTracker
::
SeparateDetectionWork
::
SeparateDetectionWork
(
DetectionBasedTracker
&
_detectionBasedTracker
,
const
std
::
string
&
cascadeFilename
)
:
detectionBasedTracker
(
_detectionBasedTracker
),
cascadeInThread
(
cascadeFilename
),
cascadeInThread
(),
isObjectDetectingReady
(
false
),
shouldObjectDetectingResultsBeForgot
(
false
),
stateThread
(
STATE_THREAD_STOPPED
),
timeWhenDetectingThreadStartedWork
(
-
1
)
{
if
(
!
cascadeInThread
.
load
(
cascadeFilename
))
{
CV_Error
(
CV_StsBadArg
,
"DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork: Cannot load a cascade from the file '"
+
cascadeFilename
+
"'"
);
}
int
res
=
0
;
res
=
pthread_mutex_init
(
&
mutex
,
NULL
);
//TODO: should be attributes?
if
(
res
)
{
...
...
@@ -439,14 +442,17 @@ DetectionBasedTracker::InnerParameters::InnerParameters()
DetectionBasedTracker
::
DetectionBasedTracker
(
const
std
::
string
&
cascadeFilename
,
const
Parameters
&
params
)
:
separateDetectionWork
(),
innerParameters
(),
numTrackedSteps
(
0
),
cascadeForTracking
(
cascadeFilename
)
numTrackedSteps
(
0
)
{
CV_Assert
(
(
params
.
minObjectSize
>
0
)
&&
(
params
.
maxObjectSize
>=
0
)
&&
(
params
.
scaleFactor
>
1.0
)
&&
(
params
.
maxTrackLifetime
>=
0
)
);
if
(
!
cascadeForTracking
.
load
(
cascadeFilename
))
{
CV_Error
(
CV_StsBadArg
,
"DetectionBasedTracker::DetectionBasedTracker: Cannot load a cascade from the file '"
+
cascadeFilename
+
"'"
);
}
parameters
=
params
;
separateDetectionWork
=
new
SeparateDetectionWork
(
*
this
,
cascadeFilename
);
...
...
This diff is collapsed.
Click to expand it.
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