rrects[cls].height += rectList[i].height;
rweights[cls]++;
}
+
+ bool useDefaultWeights = false;
+
if ( levelWeights && weights && !weights->empty() && !levelWeights->empty() )
{
for( i = 0; i < nlabels; i++ )
rejectWeights[cls] = (*levelWeights)[i];
}
}
+ else
+ useDefaultWeights = true;
for( i = 0; i < nclasses; i++ )
{
{
rectList.push_back(r1);
if( weights )
- weights->push_back(l1);
+ weights->push_back(useDefaultWeights ? n1 : l1);
if( levelWeights )
levelWeights->push_back(w1);
}
nchannels = hasTiltedFeatures ? 3 : 2;
normrect = Rect(1, 1, origWinSize.width - 2, origWinSize.height - 2);
+ localSize = lbufSize = Size(0, 0);
if (ocl::haveOpenCL())
{
String vname = ocl::Device::getDefault().vendor();
if (vname == "Advanced Micro Devices, Inc." ||
vname == "AMD")
+ {
localSize = Size(8, 8);
- lbufSize = Size(origWinSize.width + localSize.width,
- origWinSize.height + localSize.height);
- if (lbufSize.area() > 1024)
- lbufSize = Size(0, 0);
+ lbufSize = Size(origWinSize.width + localSize.width,
+ origWinSize.height + localSize.height);
+ if (lbufSize.area() > 1024)
+ lbufSize = Size(0, 0);
+ }
}
return true;
return false;
}
nchannels = 1;
+ localSize = lbufSize = Size(0, 0);
if (ocl::haveOpenCL())
{
const ocl::Device& device = ocl::Device::getDefault();
const CascadeClassifierImpl::Data::Stump* cascadeStumps = &cascade.data.stumps[0];
const CascadeClassifierImpl::Data::Stage* cascadeStages = &cascade.data.stages[0];
- float tmp = 0;
+ double tmp = 0;
for( int si = 0; si < nstages; si++ )
{
const CascadeClassifierImpl::Data::Stage& stage = cascadeStages[si];
if( tmp < stage.threshold )
{
- sum = (double)tmp;
+ sum = tmp;
return -si;
}