Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxSegmentation2d Class Reference

A segmentation of a 2D image. More...

#include <HxSegmentation2d.h>

List of all members.

Public Methods

 HxSegmentation2d ()
 Constructor. More...

 HxSegmentation2d (HxImageRep inputIm, HxImageRep labIm)
 Constructor. More...

 ~HxSegmentation2d ()
 Destructor. More...

int ident () const
 The identifier of this segmentation. More...

void setInputImage (HxImageRep inputIm)
 Set the orginal image. More...

HxImageRep getInputImage () const
 Get the orginal image. More...

void setLabeledImage (HxImageRep labIm)
 Set the labeled image. More...

HxImageRep getLabeledImage () const
 Get the labeled image. More...

void addBlob (HxBlob2d *blob)
 Add a blob to the segmentation. More...

void addBlob (int label, int xmin, int ymin, int width, int height)
 Add a blob to the segmentation. More...

HxBlob2dListConstIter getBlobBegin () const
 Get begin of the blob list. More...

HxBlob2dListConstIter getBlobEnd () const
 Get end (STL term) of the blob list. More...

HxBlob2dListBackInserter getBlobInserter ()
 Get a backinserter for the blob list. More...

void addRelation (HxString name, HxBlob2dRelation *rel)
 Add a relation to the segmentation. More...

HxBlob2dRelationgetRelation (HxString name) const
 Get a relation from the segmentation. More...

STD_OSTREAM & put (STD_OSTREAM &os) const
 Put segmentation on stream. More...


Detailed Description

A segmentation of a 2D image.

Basically, a list of HxBlob2d's, possibly with relationships.


Constructor & Destructor Documentation

HxSegmentation2d::HxSegmentation2d  
 

Constructor.

00017 {
00018     _ident = _nr++;
00019 }

HxSegmentation2d::HxSegmentation2d HxImageRep    inputIm,
HxImageRep    labIm
 

Constructor.

00022 {
00023     _inputImage = inputIm;
00024     _labImage = labIm;
00025     _ident = _nr++;
00026 }

HxSegmentation2d::~HxSegmentation2d  
 

Destructor.

00029 {
00030     for(int i=0 ; i<_blobs.size() ; i++)
00031         delete _blobs[i];
00032     _blobs.clear();
00033 }


Member Function Documentation

int HxSegmentation2d::ident   const
 

The identifier of this segmentation.

00037 {
00038     return _ident;
00039 }

void HxSegmentation2d::setInputImage HxImageRep    inputIm
 

Set the orginal image.

00043 {
00044     _inputImage = inputIm;
00045 }

HxImageRep HxSegmentation2d::getInputImage   const
 

Get the orginal image.

00049 {
00050     return _inputImage;
00051 }

void HxSegmentation2d::setLabeledImage HxImageRep    labIm
 

Set the labeled image.

00055 {
00056     _labImage = labIm;
00057 }

HxImageRep HxSegmentation2d::getLabeledImage   const
 

Get the labeled image.

00061 {
00062     return _labImage;
00063 }

void HxSegmentation2d::addBlob HxBlob2d   blob
 

Add a blob to the segmentation.

Will take ownership of the blob.

00067 {
00068     _blobs.push_back(blob);
00069 }

void HxSegmentation2d::addBlob int    label,
int    xmin,
int    ymin,
int    width,
int    height
 

Add a blob to the segmentation.

00073 {
00074     HxBlob2d* blob = new HxBlob2d(label, xmin, ymin, width, height);
00075     _blobs.push_back(blob);
00076 }

HxBlob2dListConstIter HxSegmentation2d::getBlobBegin   const
 

Get begin of the blob list.

00080 {
00081     return _blobs.begin();
00082 }

HxBlob2dListConstIter HxSegmentation2d::getBlobEnd   const
 

Get end (STL term) of the blob list.

00086 {
00087     return _blobs.end();
00088 }

HxBlob2dListBackInserter HxSegmentation2d::getBlobInserter  
 

Get a backinserter for the blob list.

00092 {
00093     return std::back_inserter(_blobs);
00094 }

void HxSegmentation2d::addRelation HxString    name,
HxBlob2dRelation   rel
 

Add a relation to the segmentation.

Will take ownership of the relation.

00098 {
00099     _relations[name] = rel;
00100 }

HxBlob2dRelation * HxSegmentation2d::getRelation HxString    name const
 

Get a relation from the segmentation.

00104 {
00105     return (*_relations.find(name)).second;
00106 }

STD_OSTREAM & HxSegmentation2d::put STD_OSTREAM &    os const
 

Put segmentation on stream.

00110 {
00111     os << "Segmentation " << _ident << ", nr of blobs : " << _blobs.size()
00112        << STD_ENDL;
00113     for (int i=0 ; i<_blobs.size() ; i++)
00114         os << (*_blobs[i]);
00115     return os;
00116 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 3 14:19:08 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001