/// <summary>
/// Perfroms object detection with increasing detection window.
/// </summary>
/// <param name="image">The image to search in</param>
/// <param name="hitThreshold">
/// Threshold for the distance between features and SVM classifying plane.
/// Usually it is 0 and should be specfied in the detector coefficients (as the last free coefficient).
/// But if the free coefficient is omitted (which is allowed), you can specify it manually here.
///</param>
/// <param name="winStride">Window stride. Must be a multiple of block stride.</param>
/// <param name="padding"></param>
/// <param name="scale">Coefficient of the detection window increase.</param>
/// <param name="finalThreshold">After detection some objects could be covered by many rectangles. This coefficient regulates similarity threshold. 0 means don't perform grouping. Should be an integer if not using meanshift grouping. Use 2.0 for default</param>
/// <param name="useMeanshiftGrouping">If true, it will use meanshift grouping.</param>
/// <returns>The regions where positives are found</returns>
public Rectangle[] DetectMultiScale(
Image <Bgr, Byte> image,
double hitThreshold,
Size winStride,
Size padding,
double scale,
int finalThreshold,
bool useMeanshiftGrouping)
{
using (MemStorage stor = new MemStorage())
{
Seq <MCvObjectDetection> seq = new Seq <MCvObjectDetection>(stor);
CvInvoke.CvHOGDescriptorDetectMultiScale(_ptr, image, seq, hitThreshold, winStride, padding, scale, finalThreshold, useMeanshiftGrouping);
return(Array.ConvertAll(seq.ToArray(), delegate(MCvObjectDetection obj) { return obj.Rect; }));
}
}