diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index 665953c..0d8f40b 100755 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -839,6 +839,14 @@ static QStringList computeDetectionResults(const QList &detec qDebug("TAR @ FAR => %f : 1", TP / totalTrueDetections); qDebug("Confidence: %f", detection.confidence); qDebug("TP vs. FP: %f to %f", TP, FP); + } else if (prevFP / numImages < 0.5 && FP / numImages >= 0.5 && discrete) { + qDebug("TAR @ FAR => %f : 0.5", TP / totalTrueDetections); + qDebug("Confidence: %f", detection.confidence); + qDebug("TP vs. FP: %f to %f", TP, FP); + } else if (prevFP / numImages < 0.2 && FP / numImages >= 0.2 && discrete) { + qDebug("TAR @ FAR => %f : 0.2", TP / totalTrueDetections); + qDebug("Confidence: %f", detection.confidence); + qDebug("TP vs. FP: %f to %f", TP, FP); } else if (prevFP / numImages < 0.1 && FP / numImages >= 0.1 && discrete) { qDebug("TAR @ FAR => %f : 0.1", TP / totalTrueDetections); qDebug("Confidence: %f", detection.confidence); diff --git a/openbr/core/opencvutils.cpp b/openbr/core/opencvutils.cpp index d1a0981..b468d44 100644 --- a/openbr/core/opencvutils.cpp +++ b/openbr/core/opencvutils.cpp @@ -527,6 +527,42 @@ void OpenCVUtils::group(QList &rects, QList &confidences, float con } } +void OpenCVUtils::pad(const br::Template &src, br::Template &dst, bool padMat, const QList &padding, bool padPoints, bool padRects, int border, int value) +{ + // Padding is expected to be top, bottom, left, right + if (padMat) + copyMakeBorder(src, dst, padding[0], padding[1], padding[2], padding[3], border, Scalar(value)); + else + dst = src; + + if (padPoints) { + QList points = src.file.points(); + QList paddedPoints; + for (int i=0; i rects = src.file.rects(); + QList paddedRects; + for (int i=0; i &padding, bool padPoints, bool padRects, int border, int value) +{ + for (int i=0; i &rects, QList &confidences, float confidenceThreshold, int minNeighbors, float epsilon); + void pad(const br::Template &src, br::Template &dst, bool padMat, const QList &padding, bool padPoints, bool padRects, int border=0, int value=0); + void pad(const br::TemplateList &src, br::TemplateList &dst, bool padMat, const QList &padding, bool padPoints, bool padRects, int border=0, int value=0); void rotate(const br::Template &src, br::Template &dst, int degrees, bool rotateMat=true, bool rotatePoints=true, bool rotateRects=true); void rotate(const br::TemplateList &src, br::TemplateList &dst, int degrees, bool rotateMat=true, bool rotatePoint=true, bool rotateRects=true); void flip(const br::Template &src, br::Template &dst, int axis, bool flipMat=true, bool flipPoints=true, bool flipRects=true); diff --git a/openbr/plugins/imgproc/pad.cpp b/openbr/plugins/imgproc/pad.cpp index 3c40221..297efd5 100644 --- a/openbr/plugins/imgproc/pad.cpp +++ b/openbr/plugins/imgproc/pad.cpp @@ -1,5 +1,6 @@ #include #include +#include using namespace cv; @@ -35,7 +36,7 @@ private: int top, bottom, left, right; top = percent*src.m().rows; bottom = percent*src.m().rows; left = percent*src.m().cols; right = percent*src.m().cols; - copyMakeBorder(src, dst, top, bottom, left, right, border, Scalar(value)); + OpenCVUtils::pad(src,dst,true,QList() << top << bottom << left << right,true,true,border,value); } };