/// <summary> /// Release all the unmanaged memory associated with this WBDetector. /// </summary> protected override void DisposeObject() { if (IntPtr.Zero != _ptr) { XObjdetectInvoke.cveWBDetectorRelease(ref _ptr, ref _sharedPtr); } }
/// <summary> /// Train WaldBoost detector. /// </summary> /// <param name="posSamples">Path to directory with cropped positive samples</param> /// <param name="negImgs">Path to directory with negative (background) images</param> public void Train(String posSamples, String negImgs) { using (CvString csPosSamples = new CvString(posSamples)) using (CvString csNegImgs = new CvString(negImgs)) { XObjdetectInvoke.cveWBDetectorTrain(_ptr, csPosSamples, csNegImgs); } }
/// <summary> /// Detect objects on image using WaldBoost detector. /// </summary> /// <param name="image">Input image for detection</param> /// <param name="bboxes">Bounding boxes coordinates output vector</param> /// <param name="confidences">Confidence values for bounding boxes output vector</param> public void Detect(Mat image, VectorOfRect bboxes, VectorOfDouble confidences) { XObjdetectInvoke.cveWBDetectorDetect(_ptr, image, bboxes, confidences); }
/// <summary> /// Write detector to FileStorage. /// </summary> /// <param name="fs">FileStorage for output</param> public void Write(FileStorage fs) { XObjdetectInvoke.cveWBDetectorWrite(_ptr, fs); }
/// <summary> /// Read detector from FileNode. /// </summary> /// <param name="node">FileNode for input</param> public void Read(FileNode node) { XObjdetectInvoke.cveWBDetectorRead(_ptr, node); }
/// <summary> /// Create instance of WBDetector. /// </summary> public WBDetector() { _ptr = XObjdetectInvoke.cveWBDetectorCreate(ref _sharedPtr); }
public WBDetector() { _ptr = XObjdetectInvoke.cveWBDetectorCreate(); }