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
a89299ac
Commit
a89299ac
authored
Dec 07, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store result to xml.
parent
bfa26fd4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
0 deletions
+18
-0
config.hpp
apps/sft/include/sft/config.hpp
+7
-0
octave.hpp
apps/sft/include/sft/octave.hpp
+1
-0
octave.cpp
apps/sft/octave.cpp
+5
-0
sft.cpp
apps/sft/sft.cpp
+5
-0
No files found.
apps/sft/include/sft/config.hpp
View file @
a89299ac
...
...
@@ -73,6 +73,13 @@ struct Config
cvRound
(
modelWinSize
.
width
*
octave
),
cvRound
(
modelWinSize
.
height
*
octave
));
}
string
resPath
(
ivector
::
const_iterator
it
)
const
{
char
s
[
65
];
sprintf
(
s
,
"%d"
,
*
it
);
return
std
::
string
(
cascadeName
)
+
s
+
".xml"
;
}
// Paths to a rescaled data
string
trainPath
;
string
testPath
;
...
...
apps/sft/include/sft/octave.hpp
View file @
a89299ac
...
...
@@ -129,6 +129,7 @@ public:
virtual
~
Octave
();
virtual
bool
train
(
const
Dataset
&
dataset
,
const
FeaturePool
&
pool
,
int
weaks
,
int
treeDepth
);
virtual
void
write
(
CvFileStorage
*
fs
,
string
name
)
const
;
int
logScale
;
...
...
apps/sft/octave.cpp
View file @
a89299ac
...
...
@@ -297,6 +297,11 @@ bool sft::Octave::train(const Dataset& dataset, const FeaturePool& pool, int wea
}
void
sft
::
Octave
::
write
(
CvFileStorage
*
fs
,
string
name
)
const
{
CvBoost
::
write
(
fs
,
name
.
c_str
());
}
// ========= FeaturePool ========= //
sft
::
FeaturePool
::
FeaturePool
(
cv
::
Size
m
,
int
n
)
:
model
(
m
),
nfeatures
(
n
)
{
...
...
apps/sft/sft.cpp
View file @
a89299ac
...
...
@@ -46,6 +46,8 @@
#include <sft/octave.hpp>
#include <sft/config.hpp>
#include <opencv2/core/core_c.h>
int
main
(
int
argc
,
char
**
argv
)
{
using
namespace
sft
;
...
...
@@ -128,7 +130,10 @@ int main(int argc, char** argv)
if
(
boost
.
train
(
dataset
,
pool
,
cfg
.
weaks
,
cfg
.
treeDepth
))
{
std
::
cout
<<
"Octave "
<<
*
it
<<
" was successfully trained..."
<<
std
::
endl
;
CvFileStorage
*
fout
=
cvOpenFileStorage
(
cfg
.
resPath
(
it
).
c_str
(),
0
,
CV_STORAGE_WRITE
);
boost
.
write
(
fout
,
cfg
.
cascadeName
);
// strong.push_back(octave);
cvReleaseFileStorage
(
&
fout
);
}
}
...
...
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