replaced alloca() (a.k.a. cvStackAlloc) with AutoBuffer or vector() everywhere. cvStackAlloc() is still defined, but we do not need alloca() anymore to compile and run OpenCV (fixes #889 and may be some others)

This commit is contained in:
Vadim Pisarevsky
2011-02-18 10:29:57 +00:00
parent 7b2ec0a1e6
commit 65a7f13af3
21 changed files with 286 additions and 263 deletions

View File

@@ -1305,12 +1305,12 @@ bool CvCascadeBoost::isErrDesired()
{
int sCount = data->sample_count,
numPos = 0, numNeg = 0, numFalse = 0, numPosTrue = 0;
float* eval = (float*) cvStackAlloc( sizeof(eval[0]) * sCount );
vector<float> eval(sCount);
for( int i = 0; i < sCount; i++ )
if( ((CvCascadeBoostTrainData*)data)->featureEvaluator->getCls( i ) == 1.0F )
eval[numPos++] = predict( i, true );
icvSortFlt( eval, numPos, 0 );
icvSortFlt( &eval[0], numPos, 0 );
int thresholdIdx = (int)((1.0F - minHitRate) * numPos);
threshold = eval[ thresholdIdx ];
numPosTrue = numPos - thresholdIdx;