Commit d7f04f04 authored by Maria Dimashova's avatar Maria Dimashova

fixed #1038

parent 6200f388
...@@ -382,10 +382,11 @@ void CvCascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* o ...@@ -382,10 +382,11 @@ void CvCascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* o
vi*sample_count + n->offset ); vi*sample_count + n->offset );
for( int i = 0; i < nodeSampleCount; i++ ) for( int i = 0; i < nodeSampleCount; i++ )
sortedIndicesBuf[i] = shortIndices[i]; sortedIndicesBuf[i] = shortIndices[i];
*sortedIndices = sortedIndicesBuf; *sortedIndices = sortedIndicesBuf;
} }
if ( vi < numPrecalcVal ) if( vi < numPrecalcVal )
{ {
for( int i = 0; i < nodeSampleCount; i++ ) for( int i = 0; i < nodeSampleCount; i++ )
{ {
...@@ -406,19 +407,8 @@ void CvCascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* o ...@@ -406,19 +407,8 @@ void CvCascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* o
} }
else // vi >= numPrecalcIdx else // vi >= numPrecalcIdx
{ {
vector<float> sampleValuesBuf; cv::AutoBuffer<float> abuf(nodeSampleCount);
float* sampleValues = 0; float* sampleValues = &abuf[0];
if( sizeof(float) == sizeof(int) )
{
// use sampleIndices as temporary buffer for values
sampleValues = (float*)sampleIndices;
}
else
{
sampleValuesBuf.resize(nodeSampleCount);
sampleValues = &sampleValuesBuf[0];
}
if ( vi < numPrecalcVal ) if ( vi < numPrecalcVal )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment