libeblearn
|
#include <nms.h>
Public Member Functions | |
nms (float threshold, float max_overlap, float max_hcenter_dist, float max_wcenter_dist, float pre_hfact, float pre_wfact, float post_hfact, float post_wfact, float woverh, std::ostream &out=std::cout, std::ostream &err=std::cerr) | |
virtual | ~nms () |
Destructor. | |
virtual void | fprop (bboxes &in, bboxes &out) |
Applies nms processing on 'in' boxes and puts results into 'out'. | |
virtual string | describe () |
Returns a string decribing this nms. | |
Protected Member Functions | |
virtual void | process (bboxes &in, bboxes &out) |
Apply nms on 'in' into 'out'. | |
virtual void | traditional_nms (bboxes &in, bboxes &out) |
void | prune_overlap (bboxes &raw_bboxes, bboxes &prune_bboxes, float max_match, bool same_class_only=false, float min_hcenter_dist=0.0, float min_wcenter_dist=0.0, float threshold=0.0, float same_scale_mhd=0.0, float same_scale_mwd=0.0) |
Protected Attributes | |
std::ostream & | mout |
std::ostream & | merr |
output stream. | |
float | threshold |
error output stream. | |
float | max_overlap |
Maximum ratio of overlap authorized. | |
float | max_hcenter_dist |
Max dist to center for matching. | |
float | max_wcenter_dist |
Max dist to center for matching. | |
float | pre_hfact |
Height bbox preprocessing factor. | |
float | pre_wfact |
Width bbox preprocessing factor. | |
float | post_hfact |
Height bbox postprocessing factor. | |
float | post_wfact |
Width bbox postprocessing factor. | |
float | woverh |
Width / height factor. | |
bool | same_class_matching_only |
Only match same classes. | |
Friends | |
class | voting_nms |
A non-maximum suppression class for suppressing overlapping non-maximum answers in a detection task.
ebl::nms::nms | ( | float | threshold, |
float | max_overlap, | ||
float | max_hcenter_dist, | ||
float | max_wcenter_dist, | ||
float | pre_hfact, | ||
float | pre_wfact, | ||
float | post_hfact, | ||
float | post_wfact, | ||
float | woverh, | ||
std::ostream & | out = std::cout , |
||
std::ostream & | err = std::cerr |
||
) |
Construct an NMS that suppresses non-maximum bounding boxes, i.e. retaining only highest confidence boxes among all matching boxes. Matching criterion depends on parameters defined below.
max_overlap | Boxes with lower overlap are considered matching. |
max_hcenter_dist | If distance between center heights of boxes is below this, boxes are considered matching. |
max_wcenter_dist | If distance between center widths of boxes is below this, boxes are considered matching. |
pre_hfact | Pre-processing height scaling. |
pre_wfact | Pre-processing width scaling. |
post_hfact | Post-processing height scaling. |
post_wfact | Post-processing width scaling. |
woverh | Normalize width to be height * woverh. |
void ebl::nms::prune_overlap | ( | bboxes & | raw_bboxes, |
bboxes & | prune_bboxes, | ||
float | max_match, | ||
bool | same_class_only = false , |
||
float | min_hcenter_dist = 0.0 , |
||
float | min_wcenter_dist = 0.0 , |
||
float | threshold = 0.0 , |
||
float | same_scale_mhd = 0.0 , |
||
float | same_scale_mwd = 0.0 |
||
) | [protected] |
Prune bounding boxes between scales into prune_bboxes.
same_class_only | If true, only classes from the same class can prune each other, otherwise any bb can cancel any other bb. |
A traditional nms, pruning 'matching' boxes and keeping only the one with highest confidence. The matching criterion is based on several factors (see constructor parameters).
float ebl::nms::threshold [protected] |
error output stream.
Ignore confidences below threshold.