Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

bmrf_network Class Reference

#include <bmrf_network.h>

Inheritance diagram for bmrf_network:

Inheritance graph
[legend]
List of all members.

Detailed Description

The MRF network.

Definition at line 30 of file bmrf_network.h.

Public Types

typedef vcl_map< bmrf_epi_seg_sptr,
bmrf_node_sptr
seg_node_map
typedef vcl_map< int, seg_node_mapframe_node_map
typedef bmrf_node::neighbor_type neighbor_type

Public Member Functions

 bmrf_network ()
 Constructor.
 bmrf_network (bmrf_network const &n)
 Copy constructor.
 ~bmrf_network ()
 Destructor.
bool add_node (const bmrf_node_sptr &node)
 Adds a new to the network.
bool remove_node (bmrf_node_sptr node)
 Deletes a node in the network.
bool add_arc (const bmrf_node_sptr &n1, const bmrf_node_sptr &n2, neighbor_type type)
 Add an arc between n1 and n2 of type type.
bool add_arc (const bmrf_arc_sptr &arc, neighbor_type type)
 Add an arc arc of type type.
bool remove_arc (const bmrf_node_sptr &n1, const bmrf_node_sptr &n2, neighbor_type type=bmrf_node::ALL)
 Add an arc between n1 and n2 of type type.
bool purge ()
 Remove all arcs to NULL nodes and node not found in this network.
bmrf_node_sptr seg_to_node (const bmrf_epi_seg_sptr &seg, int frame=-1) const
 Look up the node corresponding to an epi-segment.
int num_frames () const
 Returns the number of frames in the network.
vcl_set< int > frame_numbers () const
 Returns the set of active frame numbers.
int size (int frame=-1)
 Returns the number of nodes in the network.
double probability ()
 Returns the probability that the entire network is correct.
void prune_by_probability (double threshold, bool relative=false)
 Remove all nodes and arcs with probability less than threshold.
void prune_by_gamma (double min_gamma, double max_gamma)
 Prune nodes with a mean gamma outside this range.
void prune_directed ()
 Prune directed arcs leaving the undirected subset of the network.
void set_epipole (const bmrf_epipole &epipole, int frame)
 Set the epipole for frame frame.
const bmrf_epipoleepipole (int frame) const
 Access the epipole for frame frame.
seg_node_map::const_iterator begin (int frame=-1) const
 Returns the beginning const iterator to the map of nodes in frame frame.
seg_node_map::const_iterator end (int frame=-1) const
 Returns the end const iterator to the map of nodes in frame frame.
void b_write (vsl_b_ostream &os) const
 Binary save self to stream.
void b_read (vsl_b_istream &is)
 Binary load self from stream.
short version () const
 Return IO version number;.
void print_summary (vcl_ostream &os) const
 Print an ascii summary to the stream.
depth_iterator depth_begin (bmrf_node_sptr node)
 Depth first search begin iterator.
depth_iterator depth_end ()
 Depth first search end iterator.
breadth_iterator breadth_begin (bmrf_node_sptr node)
 Breadth first search begin iterator.
breadth_iterator breadth_end ()
 Breadth first search end iterator.
void ref ()
void unref ()
int get_references () const
bool is_referenced () const

Private Attributes

seg_node_map node_from_seg_
 The map from epi_seg pointers to nodes in the network.
frame_node_map nodes_from_frame_
 The map from frame number to list of nodes in that frame.
vcl_vector< bmrf_epipoleepipoles_
 The vector of epipoles (for each frame).

Classes

class  breadth_iterator
class  depth_iterator
class  iterator


Member Typedef Documentation

typedef vcl_map<int, seg_node_map > bmrf_network::frame_node_map
 

Definition at line 34 of file bmrf_network.h.

typedef bmrf_node::neighbor_type bmrf_network::neighbor_type
 

Definition at line 36 of file bmrf_network.h.

typedef vcl_map<bmrf_epi_seg_sptr, bmrf_node_sptr> bmrf_network::seg_node_map
 

Definition at line 33 of file bmrf_network.h.


Constructor & Destructor Documentation

bmrf_network::bmrf_network  )  [inline]
 

Constructor.

Definition at line 39 of file bmrf_network.h.

bmrf_network::bmrf_network bmrf_network const &  n  )  [inline]
 

Copy constructor.

Definition at line 42 of file bmrf_network.h.

bmrf_network::~bmrf_network  )  [inline]
 

Destructor.

Definition at line 48 of file bmrf_network.h.


Member Function Documentation

bool bmrf_network::add_arc const bmrf_arc_sptr arc,
neighbor_type  type
 

Add an arc arc of type type.

Definition at line 68 of file bmrf_network.cxx.

bool bmrf_network::add_arc const bmrf_node_sptr n1,
const bmrf_node_sptr n2,
neighbor_type  type
 

Add an arc between n1 and n2 of type type.

Definition at line 46 of file bmrf_network.cxx.

bool bmrf_network::add_node const bmrf_node_sptr node  ) 
 

Adds a new to the network.

Return values:
true if the node was added
false if the node could not be added
Note:
every node in the network must have a unique epi_segment

Definition at line 14 of file bmrf_network.cxx.

void bmrf_network::b_read vsl_b_istream is  ) 
 

Binary load self from stream.

Definition at line 335 of file bmrf_network.cxx.

void bmrf_network::b_write vsl_b_ostream os  )  const
 

Binary save self to stream.

Definition at line 310 of file bmrf_network.cxx.

bmrf_network::seg_node_map::const_iterator bmrf_network::begin int  frame = -1  )  const
 

Returns the beginning const iterator to the map of nodes in frame frame.

Note:
if frame is negative the iterator will cover all frames

Definition at line 282 of file bmrf_network.cxx.

breadth_iterator bmrf_network::breadth_begin bmrf_node_sptr  node  )  [inline]
 

Breadth first search begin iterator.

Definition at line 208 of file bmrf_network.h.

breadth_iterator bmrf_network::breadth_end  )  [inline]
 

Breadth first search end iterator.

Definition at line 210 of file bmrf_network.h.

depth_iterator bmrf_network::depth_begin bmrf_node_sptr  node  )  [inline]
 

Depth first search begin iterator.

Definition at line 203 of file bmrf_network.h.

depth_iterator bmrf_network::depth_end  )  [inline]
 

Depth first search end iterator.

Definition at line 205 of file bmrf_network.h.

bmrf_network::seg_node_map::const_iterator bmrf_network::end int  frame = -1  )  const
 

Returns the end const iterator to the map of nodes in frame frame.

Note:
if frame is negative the iterator will cover all frames

Definition at line 296 of file bmrf_network.cxx.

const bmrf_epipole & bmrf_network::epipole int  frame  )  const
 

Access the epipole for frame frame.

For now we assume that there is only one epipole for the entire sequence. This function should be update if this assumption changes.

Todo:

Definition at line 274 of file bmrf_network.cxx.

vcl_set< int > bmrf_network::frame_numbers  )  const
 

Returns the set of active frame numbers.

Note:
frame_numbers().size() == num_frames() but the numbers do not start at zero in general

Definition at line 153 of file bmrf_network.cxx.

int bmrf_network::num_frames  )  const
 

Returns the number of frames in the network.

Definition at line 144 of file bmrf_network.cxx.

void bmrf_network::print_summary vcl_ostream &  os  )  const
 

Print an ascii summary to the stream.

Definition at line 382 of file bmrf_network.cxx.

double bmrf_network::probability  ) 
 

Returns the probability that the entire network is correct.

Definition at line 176 of file bmrf_network.cxx.

void bmrf_network::prune_by_gamma double  min_gamma,
double  max_gamma
 

Prune nodes with a mean gamma outside this range.

Definition at line 216 of file bmrf_network.cxx.

void bmrf_network::prune_by_probability double  threshold,
bool  relative = false
 

Remove all nodes and arcs with probability less than threshold.

Definition at line 193 of file bmrf_network.cxx.

void bmrf_network::prune_directed  ) 
 

Prune directed arcs leaving the undirected subset of the network.

Definition at line 239 of file bmrf_network.cxx.

bool bmrf_network::purge  ) 
 

Remove all arcs to NULL nodes and node not found in this network.

Return values:
true if any arcs have been purged
false if all arcs were found to be valid

Definition at line 100 of file bmrf_network.cxx.

bool bmrf_network::remove_arc const bmrf_node_sptr n1,
const bmrf_node_sptr n2,
neighbor_type  type = bmrf_node::ALL
 

Add an arc between n1 and n2 of type type.

Definition at line 91 of file bmrf_network.cxx.

bool bmrf_network::remove_node bmrf_node_sptr  node  ) 
 

Deletes a node in the network.

Return values:
true if the node was deleted
false if the node was not found in the network

Definition at line 28 of file bmrf_network.cxx.

bmrf_node_sptr bmrf_network::seg_to_node const bmrf_epi_seg_sptr seg,
int  frame = -1
const
 

Look up the node corresponding to an epi-segment.

Returns:
a null smart pointer if no node exists
Note:
if the optional paramater frame is positive the search is restricted to that frame

Definition at line 121 of file bmrf_network.cxx.

void bmrf_network::set_epipole const bmrf_epipole epipole,
int  frame
 

Set the epipole for frame frame.

For now we assume that there is only one epipole for the entire sequence. This function should be update if this assumption changes.

Todo:

Definition at line 261 of file bmrf_network.cxx.

int bmrf_network::size int  frame = -1  ) 
 

Returns the number of nodes in the network.

\ note if the optional parameter frame is positive then the size is of that frame

Definition at line 165 of file bmrf_network.cxx.

short bmrf_network::version  )  const
 

Return IO version number;.

Definition at line 390 of file bmrf_network.cxx.


Member Data Documentation

vcl_vector<bmrf_epipole> bmrf_network::epipoles_ [private]
 

The vector of epipoles (for each frame).

Definition at line 138 of file bmrf_network.h.

seg_node_map bmrf_network::node_from_seg_ [private]
 

The map from epi_seg pointers to nodes in the network.

Note:
indexed by epi_seg pointers for quick reverse lookup

Definition at line 132 of file bmrf_network.h.

frame_node_map bmrf_network::nodes_from_frame_ [private]
 

The map from frame number to list of nodes in that frame.

Definition at line 135 of file bmrf_network.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:51:54 2008 for contrib/brl/bseg/bmrf by  doxygen 1.4.4