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
1bf696f3
Commit
1bf696f3
authored
Mar 02, 2013
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for soft cascade training app
parent
445f39a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
+19
-5
config.cpp
apps/sft/config.cpp
+5
-1
config.hpp
apps/sft/include/sft/config.hpp
+3
-0
sft.cpp
apps/sft/sft.cpp
+10
-3
soft_cascade_octave.cpp
modules/softcascade/src/soft_cascade_octave.cpp
+1
-1
No files found.
apps/sft/config.cpp
View file @
1bf696f3
...
...
@@ -69,6 +69,7 @@ void sft::Config::write(cv::FileStorage& fs) const
<<
"outXmlPath"
<<
outXmlPath
<<
"seed"
<<
seed
<<
"featureType"
<<
featureType
<<
"}"
;
}
...
...
@@ -99,6 +100,7 @@ void sft::Config::read(const cv::FileNode& node)
outXmlPath
=
(
std
::
string
)
node
[
"outXmlPath"
];
seed
=
(
int
)
node
[
"seed"
];
featureType
=
(
std
::
string
)
node
[
"featureType"
];
}
void
sft
::
write
(
cv
::
FileStorage
&
fs
,
const
string
&
,
const
Config
&
x
)
...
...
@@ -153,7 +155,8 @@ std::ostream& sft::operator<<(std::ostream& out, const Config& m)
<<
std
::
setw
(
14
)
<<
std
::
left
<<
"cascadeName"
<<
m
.
cascadeName
<<
std
::
endl
<<
std
::
setw
(
14
)
<<
std
::
left
<<
"outXmlPath"
<<
m
.
outXmlPath
<<
std
::
endl
<<
std
::
setw
(
14
)
<<
std
::
left
<<
"seed"
<<
m
.
seed
<<
std
::
endl
;
<<
std
::
setw
(
14
)
<<
std
::
left
<<
"seed"
<<
m
.
seed
<<
std
::
endl
<<
std
::
setw
(
14
)
<<
std
::
left
<<
"featureType"
<<
m
.
featureType
<<
std
::
endl
;
return
out
;
}
\ No newline at end of file
apps/sft/include/sft/config.hpp
View file @
1bf696f3
...
...
@@ -121,6 +121,9 @@ struct Config
// seed for random generation
int
seed
;
// channel feature type
string
featureType
;
// // bounding rectangle for actual example into example window
// cv::Rect exampleWindow;
};
...
...
apps/sft/sft.cpp
View file @
1bf696f3
...
...
@@ -104,7 +104,7 @@ int main(int argc, char** argv)
fso
<<
cfg
.
cascadeName
<<
"{"
<<
"stageType"
<<
"BOOST"
<<
"featureType"
<<
"ICF"
<<
"featureType"
<<
cfg
.
featureType
<<
"octavesNum"
<<
(
int
)
cfg
.
octaves
.
size
()
<<
"width"
<<
cfg
.
modelWinSize
.
width
<<
"height"
<<
cfg
.
modelWinSize
.
height
...
...
@@ -118,7 +118,12 @@ int main(int argc, char** argv)
int
nfeatures
=
cfg
.
poolSize
;
cv
::
Size
model
=
cfg
.
model
(
it
);
std
::
cout
<<
"Model "
<<
model
<<
std
::
endl
;
cv
::
Ptr
<
cv
::
FeaturePool
>
pool
=
cv
::
FeaturePool
::
create
(
model
,
nfeatures
);
int
nchannels
=
(
cfg
.
featureType
==
"HOG6MagLuv"
)
?
10
:
8
;
std
::
cout
<<
"number of feature channels is "
<<
nchannels
<<
std
::
endl
;
cv
::
Ptr
<
cv
::
FeaturePool
>
pool
=
cv
::
FeaturePool
::
create
(
model
,
nfeatures
,
nchannels
);
nfeatures
=
pool
->
size
();
...
...
@@ -130,7 +135,9 @@ int main(int argc, char** argv)
typedef
cv
::
Octave
Octave
;
cv
::
Ptr
<
Octave
>
boost
=
Octave
::
create
(
boundingBox
,
npositives
,
nnegatives
,
*
it
,
shrinkage
,
nfeatures
);
cv
::
Ptr
<
cv
::
ChannelFeatureBuilder
>
builder
=
cv
::
ChannelFeatureBuilder
::
create
(
cfg
.
featureType
);
std
::
cout
<<
"Channel builder "
<<
builder
->
info
()
->
name
()
<<
std
::
endl
;
cv
::
Ptr
<
Octave
>
boost
=
Octave
::
create
(
boundingBox
,
npositives
,
nnegatives
,
*
it
,
shrinkage
,
nfeatures
,
builder
);
std
::
string
path
=
cfg
.
trainPath
;
sft
::
ScaledDataset
dataset
(
path
,
*
it
);
...
...
modules/softcascade/src/soft_cascade_octave.cpp
View file @
1bf696f3
...
...
@@ -137,7 +137,7 @@ BoostedSoftCascadeOctave::BoostedSoftCascadeOctave(cv::Rect bb, int np, int nn,
int
w
=
boundingBox
.
width
;
int
h
=
boundingBox
.
height
;
integrals
.
create
(
poolSize
,
(
w
/
shrinkage
+
1
)
*
(
h
/
shrinkage
*
10
+
1
),
CV_32SC1
);
integrals
.
create
(
poolSize
,
(
w
/
shrinkage
+
1
)
*
(
h
/
shrinkage
*
builder
->
totalChannels
()
+
1
),
CV_32SC1
);
}
BoostedSoftCascadeOctave
::~
BoostedSoftCascadeOctave
(){}
...
...
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