public List <int> AcceptedWindows(Image <Gray, byte> frame, List <int> scanningWindows) { Stopwatch variance = new Stopwatch(); variance.Start(); List <int> varianceWindows = _varianceClassifier.AcceptedWindows(frame, scanningWindows); variance.Stop(); Stopwatch ensemble = new Stopwatch(); ensemble.Start(); List <int> ensembleWindows = _ensembleClassifier.AcceptedWindows(frame, varianceWindows); ensemble.Stop(); Stopwatch nn = new Stopwatch(); nn.Start(); List <int> nnWindows = _nnClassifier.AcceptedWindows(frame, ensembleWindows); nn.Stop(); return(nnWindows); }
public List <IBoundingBox> FindObject(Image <Gray, byte> frame) { List <int> acceptedWindows = _cascadedClassifier.AcceptedWindows(frame, _scanningWindows); if (acceptedWindows.Count == 0) { _detections.Clear(); return(null); } int detectionsCount = acceptedWindows.Count; _detections = new List <IBoundingBox>(detectionsCount); for (int i = 0; i < detectionsCount; i++) { int index = acceptedWindows[i]; _detections.Add(_scanningWindowGenerator.ScanningWindows[index]); } //_detections = _suppressBoundingBoxes(_scanningWindows); return(_detections); }