1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

dnn: add a documentation for NMS, fix missing experimantal namespace

This commit is contained in:
Vladislav Sovrasov
2017-10-17 11:24:50 +03:00
parent acedb4a579
commit c704942b8a
4 changed files with 32 additions and 43 deletions
+11 -2
View File
@@ -12,13 +12,22 @@ namespace cv
{
namespace dnn
{
CV__DNN_EXPERIMENTAL_NS_BEGIN
static inline float rectOverlap(const Rect& a, const Rect& b)
{
return 1.f - static_cast<float>(jaccardDistance(a, b));
}
void NMSBoxes(const std::vector<Rect>& bboxes, const std::vector<float>& scores,
const float score_threshold, const float nms_threshold,
const float eta, const int top_k, std::vector<int>& indices)
std::vector<int>& indices, const float eta, const int top_k)
{
NMSFast_(bboxes, scores, score_threshold, nms_threshold, eta, top_k, indices, NMSOverlap<Rect>());
CV_Assert(bboxes.size() == scores.size(), score_threshold >= 0,
nms_threshold >= 0, eta > 0);
NMSFast_(bboxes, scores, score_threshold, nms_threshold, eta, top_k, indices, rectOverlap);
}
CV__DNN_EXPERIMENTAL_NS_END
}// dnn
}// cv