Commit ca599e7566ccf19168c3932dc221a65032c9aaae

Authored by Brendan Klare
1 parent 1304c275

Bug fix for case when no face is detected

openbr/plugins/slidingwindow.cpp
... ... @@ -380,8 +380,10 @@ private:
380 380 QList<Rect> rects;
381 381 QList<float> confidences;
382 382 foreach (const Template &t, src) {
383   - rects.append(OpenCVUtils::toRect(t.file.get<QRectF>("Detection")));
384   - confidences.append(t.file.get<float>("Confidence"));
  383 + if (t.file.contains("Detection")) {
  384 + rects.append(OpenCVUtils::toRect(t.file.get<QRectF>("Detection")));
  385 + confidences.append(t.file.get<float>("Confidence"));
  386 + }
385 387 }
386 388  
387 389 // Compute overlap between rectangles and create discrete Laplacian matrix
... ...