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
d5ead208
Commit
d5ead208
authored
Nov 27, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Nov 27, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1858 from StevenPuttemans:updates_traincascade
parents
935f9735
a4239f97
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
cascadeclassifier.cpp
apps/traincascade/cascadeclassifier.cpp
+12
-0
No files found.
apps/traincascade/cascadeclassifier.cpp
View file @
d5ead208
...
@@ -137,6 +137,9 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
...
@@ -137,6 +137,9 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
const
CvCascadeBoostParams
&
_stageParams
,
const
CvCascadeBoostParams
&
_stageParams
,
bool
baseFormatSave
)
bool
baseFormatSave
)
{
{
// Start recording clock ticks for training time output
const
clock_t
begin_time
=
clock
();
if
(
_cascadeDirName
.
empty
()
||
_posFilename
.
empty
()
||
_negFilename
.
empty
()
)
if
(
_cascadeDirName
.
empty
()
||
_posFilename
.
empty
()
||
_negFilename
.
empty
()
)
CV_Error
(
CV_StsBadArg
,
"_cascadeDirName or _bgfileName or _vecFileName is NULL"
);
CV_Error
(
CV_StsBadArg
,
"_cascadeDirName or _bgfileName or _vecFileName is NULL"
);
...
@@ -247,6 +250,14 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
...
@@ -247,6 +250,14 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
fs
<<
FileStorage
::
getDefaultObjectName
(
stageFilename
)
<<
"{"
;
fs
<<
FileStorage
::
getDefaultObjectName
(
stageFilename
)
<<
"{"
;
tempStage
->
write
(
fs
,
Mat
()
);
tempStage
->
write
(
fs
,
Mat
()
);
fs
<<
"}"
;
fs
<<
"}"
;
// Output training time up till now
float
seconds
=
float
(
clock
()
-
begin_time
)
/
CLOCKS_PER_SEC
;
int
days
=
int
(
seconds
)
/
60
/
60
/
24
;
int
hours
=
(
int
(
seconds
)
/
60
/
60
)
%
24
;
int
minutes
=
(
int
(
seconds
)
/
60
)
%
60
;
int
seconds_left
=
int
(
seconds
)
%
60
;
cout
<<
"Training until now has taken "
<<
days
<<
" days "
<<
hours
<<
" hours "
<<
minutes
<<
" minutes "
<<
seconds_left
<<
" seconds."
<<
endl
;
}
}
if
(
stageClassifiers
.
size
()
==
0
)
if
(
stageClassifiers
.
size
()
==
0
)
...
@@ -310,6 +321,7 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
...
@@ -310,6 +321,7 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
if
(
predict
(
i
)
==
1.0
F
)
if
(
predict
(
i
)
==
1.0
F
)
{
{
getcount
++
;
getcount
++
;
printf
(
"%s current samples: %d
\r
"
,
isPositive
?
"POS"
:
"NEG"
,
getcount
);
break
;
break
;
}
}
}
}
...
...
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