libeblearn
ebl::bboxes Class Reference

#include <bbox.h>

Inheritance diagram for ebl::bboxes:
svector

List of all members.

Public Member Functions

 bboxes (t_bbox_saving saving_type=bbox_all, string *outdir_=NULL, std::ostream &out=std::cout, std::ostream &err=std::cerr)
virtual ~bboxes ()
 Destructor. Delete bbox if own_boxes is true.
void new_group (idxdim &dims, string *name=NULL, int index=-1)
bboxesget_group (const string &name)
idxdim get_group_dims (const string &name)
void add (bbox *b, idxdim &dims, string *name=NULL, int index=-1)
void add (bbox &b, idxdim &dims, string *name=NULL, int index=-1)
void add (bboxes &bbs, idxdim &dims, string *name=NULL, int index=-1)
void add (vector< bbox > &bbs, idxdim &dims, string *name=NULL, int index=-1)
bboxes exclude (bboxes &other)
 Returns the subset of current bboxes that exclude bboxes in 'other'.
void load_eblearn (const string &filename)
 Load the bboxes found the file 'filename' in the eblearn bbox format.
void save (string *dir=NULL)
void save_eblearn (string *dir=NULL)
void save_caltech (string *dir=NULL)
void save_class (string *dir=NULL)
void sort_by_confidence ()
template<typename T >
void sort_by_difference (svector< midx< T > > &inputs)
bboxget_most_confident ()
 Returns the single most confident box or NULL if empty.
bboxes get_most_confidents ()
void normalize_widths (float woverh)
 Normalize widths of boxes w.r.t. to their height with ratio 'woverh'.
void scale_centered (float hfact, float wfact)
void threshold (float threshold)
 Remove all elements with confidence strictly below threshold.
string describe ()
 Returns a string describing the number of bboxes and number of groups.
void print ()
 Print each bbox with a brief description to 'mout'.
void print_saving_type ()
 Print the saving type of boxes.
string pretty (vector< string > *labels=NULL)
string pretty_short (vector< string > &labels)
string str ()

Detailed Description

A collection of bounding boxes, that can be saved to multiple formats, and grouped by image.


Constructor & Destructor Documentation

ebl::bboxes::bboxes ( t_bbox_saving  saving_type = bbox_all,
string *  outdir_ = NULL,
std::ostream &  out = std::cout,
std::ostream &  err = std::cerr 
)

Initialize parameters.

Parameters:
saving_typeDetermines the formats save() will save data.

Member Function Documentation

void ebl::bboxes::add ( bbox b,
idxdim &  dims,
string *  name = NULL,
int  index = -1 
)

Add a new bbox to the collection (in last group or the group with index 'index').

Parameters:
dimsThe image size associated with this bbox.
indexIf negative (default), the order is the addition order, otherwise use the index to order the bboxes.
nameAn optional name for the new group.
void ebl::bboxes::add ( bbox b,
idxdim &  dims,
string *  name = NULL,
int  index = -1 
)

Add a new bbox to the collection (in last group or the group with index 'index').

Parameters:
dimsThe image size associated with this bbox.
indexIf negative (default), the order is the addition order, otherwise use the index to order the bboxes.
nameAn optional name for the new group.
void ebl::bboxes::add ( bboxes bbs,
idxdim &  dims,
string *  name = NULL,
int  index = -1 
)

Create a new group and add a set of bbox to this group.

Parameters:
dimsThe image size associated with this group.
indexIf negative (default), the order is the addition order, otherwise use the index as the group's index in the vector of groups.
nameAn optional name for the new group.
void ebl::bboxes::add ( vector< bbox > &  bbs,
idxdim &  dims,
string *  name = NULL,
int  index = -1 
)

Create a new group and add a set of bbox to this group.

Parameters:
dimsThe image size associated with this group.
indexIf negative (default), the order is the addition order, otherwise use the index as the group's index in the vector of groups.
nameAn optional name for the new group.
bboxes * ebl::bboxes::get_group ( const string &  name)

Return an entire vector of pointers to bbox for group with name 'name'. This throws an exception if the group is not found.

idxdim ebl::bboxes::get_group_dims ( const string &  name)

Return the image dimensions associated with a group of bbox with name 'name'. This throws an exception if the group is not found.

bboxes ebl::bboxes::get_most_confidents ( )

Returns the most confident boxes, potentially multiple ones if several rank 1st with the same score.

void ebl::bboxes::new_group ( idxdim &  dims,
string *  name = NULL,
int  index = -1 
)

Create a new group of bounding boxes. Add() will then put new bboxes into that group (unless index is less than boxes.size()).

Parameters:
dimsThe image size associated with this group.
indexIf negative (default), the order is the addition order, otherwise use the index to order the bboxes.
nameAn optional name for the new group.
string ebl::bboxes::pretty ( vector< string > *  labels = NULL)

Returns a string describing each bbox in details.

Parameters:
labelsAn optional vector of strings of class labels.
string ebl::bboxes::pretty_short ( vector< string > &  labels)

Returns a string with a short description of each bbox.

Parameters:
labelsA vector of strings of class labels.
void ebl::bboxes::save ( string *  dir = NULL)

Save boxes using the internal parameters initialized by the constructor.

Parameters:
dirOutput directory. If null (default), use internal directory initialized by the constructor.
void ebl::bboxes::save_caltech ( string *  dir = NULL)

Save boxes caltech-style in dir.

Parameters:
dirOutput directory. If null (default), use internal directory initialized by the constructor.
void ebl::bboxes::save_class ( string *  dir = NULL)

Save boxes class-style in dir.

Parameters:
dirOutput directory. If null (default), use internal directory initialized by the constructor.
void ebl::bboxes::save_eblearn ( string *  dir = NULL)

Save boxes eblearn-style in dir.

Parameters:
dirOutput directory. If null (default), use internal directory initialized by the constructor.
void ebl::bboxes::scale_centered ( float  hfact,
float  wfact 
)

Scale all boxes while keeping the same center, if 'hfact' or 'wfact' is different than 1.0.

void ebl::bboxes::sort_by_confidence ( )

Sort all boxes in decreasing order of their confidence (highest confidence first).

template<typename T >
void ebl::bboxes::sort_by_difference ( svector< midx< T > > &  inputs)

Sort all 'inputs' and internal boxes based on input l2 distances (most different pairs of input first) in a stable way (original ordering is kept).

string ebl::bboxes::str ( )

Returns a string with a short description of each bbox (without label strings).


The documentation for this class was generated from the following files: