public void DetectROI(
Mat img, Point[] locations, out Point[] foundLocations, out double[] confidences,
double hitThreshold = 0, Size? winStride = null, Size? padding = null)
{
if (disposed)
throw new ObjectDisposedException("HOGDescriptor");
if (img == null)
throw new ArgumentNullException(nameof(img));
if (locations == null)
throw new ArgumentNullException(nameof(locations));
img.ThrowIfDisposed();
Size winStride0 = winStride.GetValueOrDefault(new Size());
Size padding0 = padding.GetValueOrDefault(new Size());
using (var flVec = new VectorOfPoint())
using (var cVec = new VectorOfDouble())
{
NativeMethods.objdetect_HOGDescriptor_detectROI(ptr, img.CvPtr, locations, locations.Length,
flVec.CvPtr, cVec.CvPtr, hitThreshold, winStride0, padding0);
foundLocations = flVec.ToArray();
confidences = cVec.ToArray();
}
}