inlinestaticfloatLoG(floatx,floaty,floatdelta){floatd=-(x*x+y*y)/(2*delta*delta);return-1.0f/((float)(CV_PI)*pow(delta,4))*(1+d)*exp(d);}// Laplacian of Gaussian
intloadTrainedModel(std::stringmodelName="");// Return -1, 0, or 1 if partial, none, or all loaded
// Get potential bounding boxes, each of which is represented by a Vec4i for (minX, minY, maxX, maxY).
// The trained model should be prepared before calling this function: loadTrainedModel() or trainStageI() + trainStageII().
// Use numDet to control the final number of proposed bounding boxes, and number of per size (scale and aspect ratio)
template<typenameT>inlineTsqr(Tx){returnx*x;}// out of range risk for T = byte, ...
template<classT,intD>inlineTvecSqrDist(constVec<T,D>&v1,constVec<T,D>&v2){Ts=0;for(inti=0;i<D;i++)s+=sqr(v1[i]-v2[i]);returns;}// out of range risk for T = byte, ...
template<classT,intD>inlineTvecDist(constVec<T,D>&v1,constVec<T,D>&v2){returnsqrt(vecSqrDist(v1,v2));}// out of range risk for T = byte, ...