public void TrackingInit() { _faceTracker = new TrackerBoosting(); _faceTracker.Init(_frame, _faceRect); _eyeLTracker = new TrackerBoosting(); _eyeLTracker.Init(_frame, _eyeLRect); _eyeRTracker = new TrackerBoosting(); _eyeRTracker.Init(_frame, _eyeRRect); }
protected override void DoTask() { buffer.Bytes = Color.Pixels; var scale = buffer.Resize(Color.Width / ratio, Color.Height / ratio, Emgu.CV.CvEnum.Inter.Cubic); if (select != Rectangle.Empty) { Log("Initialize ..."); current = new Rectangle(select.X / ratio, select.Y / ratio, select.Width / ratio, select.Height / ratio); debug = new Rectangle(select.X, select.Y, select.Width , select.Height); // MIL, BOOSTING, MEDIANFLOW, TLD, CMT Mat mat = CvInvoke.CvArrToMat(scale, true); tracker = new Tracker(ConfigManager.GetInstance().Find("cmt.algo", "CMT")); tracker.init(mat, current); select = Rectangle.Empty; } else if (current != Rectangle.Empty) { Mat mat = CvInvoke.CvArrToMat(scale, true); tracker.update(mat, ref current); } }
/// <summary> /// Add a new object to be tracked. The defaultAlgorithm will be used the newly added tracker. /// </summary> /// <param name="image">Tnput image</param> /// <param name="boundingBox">A rectangle represents ROI of the tracked object</param> /// <returns>True if sucessfully added</returns> public bool Add(Tracker tracker, Mat image, Rectangle boundingBox) { return(ContribInvoke.cveMultiTrackerAdd(_ptr, tracker, image, ref boundingBox)); }