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
883d691c
Commit
883d691c
authored
Dec 07, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix feature computing
parent
30b2a945
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
CMakeLists.txt
apps/CMakeLists.txt
+2
-0
octave.hpp
apps/sft/include/sft/octave.hpp
+16
-0
octave.cpp
apps/sft/octave.cpp
+5
-1
sft.cpp
apps/sft/sft.cpp
+1
-1
No files found.
apps/CMakeLists.txt
View file @
883d691c
add_subdirectory
(
haartraining
)
add_subdirectory
(
traincascade
)
add_subdirectory
(
sft
)
apps/sft/include/sft/octave.hpp
View file @
883d691c
...
...
@@ -73,6 +73,22 @@ struct ICF
return
bb
!=
b
.
bb
||
channel
!=
b
.
channel
;
}
float
operator
()
(
const
Mat
&
integrals
,
const
cv
::
Size
&
model
)
const
{
const
int
*
ptr
=
integrals
.
ptr
<
int
>
(
0
)
+
(
model
.
height
*
channel
+
bb
.
y
)
*
model
.
width
+
bb
.
x
;
int
a
=
ptr
[
0
];
int
b
=
ptr
[
bb
.
width
];
ptr
+=
bb
.
height
*
model
.
width
;
int
c
=
ptr
[
bb
.
width
];
int
d
=
ptr
[
0
];
return
(
float
)(
a
-
b
+
c
-
d
);
}
private
:
cv
::
Rect
bb
;
int
channel
;
...
...
apps/sft/octave.cpp
View file @
883d691c
...
...
@@ -93,6 +93,10 @@ bool sft::Octave::train( const cv::Mat& trainData, const cv::Mat& _responses, co
}
std
::
cout
<<
"WARNING: "
<<
sampleIdx
<<
std
::
endl
;
std
::
cout
<<
"WARNING: "
<<
trainData
<<
std
::
endl
;
std
::
cout
<<
"WARNING: "
<<
_responses
<<
std
::
endl
;
std
::
cout
<<
"WARNING: "
<<
varIdx
<<
std
::
endl
;
std
::
cout
<<
"WARNING: "
<<
varType
<<
std
::
endl
;
bool
update
=
false
;
return
cv
::
Boost
::
train
(
trainData
,
CV_COL_SAMPLE
,
_responses
,
varIdx
,
sampleIdx
,
varType
,
missingDataMask
,
_params
,
...
...
@@ -313,7 +317,7 @@ sft::FeaturePool::~FeaturePool(){}
float
sft
::
FeaturePool
::
apply
(
int
fi
,
int
si
,
const
Mat
&
integrals
)
const
{
return
0.
f
;
return
pool
[
fi
](
integrals
.
row
(
si
),
model
)
;
}
...
...
apps/sft/sft.cpp
View file @
883d691c
...
...
@@ -113,7 +113,7 @@ int main(int argc, char** argv)
int
shrinkage
=
cfg
.
shrinkage
;
int
octave
=
*
it
;
cv
::
Size
model
=
c
fg
.
modelWinSize
;
cv
::
Size
model
=
c
v
::
Size
(
cfg
.
modelWinSize
.
width
/
cfg
.
shrinkage
,
cfg
.
modelWinSize
.
height
/
cfg
.
shrinkage
)
;
std
::
string
path
=
cfg
.
trainPath
;
cv
::
Rect
boundingBox
(
cfg
.
offset
.
x
/
cfg
.
shrinkage
,
cfg
.
offset
.
y
/
cfg
.
shrinkage
,
...
...
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