This commit is contained in:
Maria Dimashova 2011-05-04 10:19:12 +00:00
parent 6200f388dd
commit d7f04f04cc

@ -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
} }
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 )
{ {