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
19236b6e
Commit
19236b6e
authored
Dec 24, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove dead code
parent
d4d47b1e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
35 deletions
+1
-35
octave.cpp
apps/sft/octave.cpp
+1
-35
No files found.
apps/sft/octave.cpp
View file @
19236b6e
...
...
@@ -85,13 +85,6 @@ sft::Octave::~Octave(){}
bool
sft
::
Octave
::
train
(
const
cv
::
Mat
&
_trainData
,
const
cv
::
Mat
&
_responses
,
const
cv
::
Mat
&
varIdx
,
const
cv
::
Mat
&
sampleIdx
,
const
cv
::
Mat
&
varType
,
const
cv
::
Mat
&
missingDataMask
)
{
// std::cout << "WARNING: sampleIdx " << sampleIdx << std::endl;
// std::cout << "WARNING: trainData " << _trainData << std::endl;
// std::cout << "WARNING: _responses " << _responses << std::endl;
// std::cout << "WARNING: varIdx" << varIdx << std::endl;
// std::cout << "WARNING: varType" << varType << std::endl;
bool
update
=
false
;
return
cv
::
Boost
::
train
(
_trainData
,
CV_COL_SAMPLE
,
_responses
,
varIdx
,
sampleIdx
,
varType
,
missingDataMask
,
params
,
update
);
...
...
@@ -119,10 +112,6 @@ void sft::Octave::setRejectThresholds(cv::Mat& thresholds)
mptr
[
si
]
=
cv
::
saturate_cast
<
uchar
>
((
uint
)(
(
responses
.
ptr
<
float
>
(
si
)[
0
]
==
1.
f
)
&&
(
decision
==
1.
f
)));
}
// std::cout << "WARNING: responses " << responses << std::endl;
// std::cout << "WARNING: desisions " << desisions << std::endl;
// std::cout << "WARNING: ppmask " << ppmask << std::endl;
int
weaks
=
weak
->
total
;
thresholds
.
create
(
1
,
weaks
,
CV_64FC1
);
double
*
thptr
=
thresholds
.
ptr
<
double
>
(
0
);
...
...
@@ -144,10 +133,7 @@ void sft::Octave::setRejectThresholds(cv::Mat& thresholds)
double
mintrace
=
0.
;
cv
::
minMaxLoc
(
traces
.
row
(
w
),
&
mintrace
);
thptr
[
w
]
=
mintrace
;
// std::cout << "mintrace " << mintrace << std::endl << traces.colRange(0, npositives).rowRange(w, w + 1) << std::endl << std::endl << std::endl << std::endl;
}
std
::
cout
<<
"WARNING: thresholds "
<<
thresholds
<<
std
::
endl
;
}
namespace
{
...
...
@@ -211,8 +197,6 @@ public:
};
}
// ToDo: parallelize it, fix curring
// ToDo: sunch model size and shrinced model size usage/ Now model size mean already shrinked model
void
sft
::
Octave
::
processPositives
(
const
Dataset
&
dataset
,
const
FeaturePool
&
pool
)
{
Preprocessor
prepocessor
(
shrinkage
);
...
...
@@ -227,8 +211,6 @@ void sft::Octave::processPositives(const Dataset& dataset, const FeaturePool& po
{
const
string
&
curr
=
*
it
;
// dprintf("Process candidate positive image %s\n", curr.c_str());
cv
::
Mat
sample
=
cv
::
imread
(
curr
);
cv
::
Mat
channels
=
integrals
.
row
(
total
).
reshape
(
0
,
h
/
shrinkage
*
10
+
1
);
...
...
@@ -266,9 +248,6 @@ void sft::Octave::generateNegatives(const Dataset& dataset)
{
int
curr
=
iRand
(
idxEng
);
// dprintf("View %d-th sample\n", curr);
// dprintf("Process %s\n", dataset.neg[curr].c_str());
Mat
frame
=
cv
::
imread
(
dataset
.
neg
[
curr
]);
int
maxW
=
frame
.
cols
-
2
*
boundingBox
.
x
-
boundingBox
.
width
;
...
...
@@ -352,7 +331,7 @@ void sft::Octave::traverse(const CvBoostTree* tree, cv::FileStorage& fs, int& nf
fs
<<
"leafValues"
<<
"["
;
for
(
int
ni
=
0
;
ni
<
-
leafValIdx
;
ni
++
)
fs
<<
leafs
[
ni
];
//( (!th) ? leafs[ni] : (sgn(leafs[ni]) * *th));
fs
<<
leafs
[
ni
];
fs
<<
"]"
;
...
...
@@ -447,19 +426,6 @@ bool sft::Octave::train(const Dataset& dataset, const FeaturePool& pool, int wea
bool
ok
=
train
(
trainData
,
responses
,
varIdx
,
sampleIdx
,
varType
,
missingMask
);
if
(
!
ok
)
std
::
cout
<<
"ERROR: tree can not be trained "
<<
std
::
endl
;
#if defined SELF_TEST
cv
::
Mat
a
(
1
,
nfeatures
,
CV_32FC1
);
cv
::
Mat
votes
(
1
,
cvSliceLength
(
CV_WHOLE_SEQ
,
weak
),
CV_32FC1
,
cv
::
Scalar
::
all
(
0
));
// std::cout << a.cols << " " << a.rows << " !!!!!!!!!!! " << data->var_all << std::endl;
for
(
int
si
=
0
;
si
<
nsamples
;
++
si
)
{
// trainData.col(si).copyTo(a.reshape(0,trainData.rows));
float
desision
=
predict
(
trainData
.
col
(
si
),
votes
,
false
,
true
);
// std::cout << "desision " << desision << " class " << responses.at<float>(si, 0) << votes <<std::endl;
}
#endif
return
ok
;
}
...
...
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