Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxBlob2d.h

00001 /*
00002  *  Copyright (c) 1998, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Leon Todoran (todoran@wins.uva.nl)
00008  *  Dennis Koelma (koelma@wins.uva.nl)
00009  */
00010 
00011 #ifndef HxBlob2d_h
00012 #define HxBlob2d_h
00013 
00014 #include "list"
00015 #include "map"
00016 #include "HxImageRep.h"
00017 #include "HxFreemanChain2d.h"
00018 #include "HxFeatureFunctor.h"
00019 
00020 
00021 class HxBlob2d
00022 {
00023 public:
00024                             HxBlob2d();
00025                             HxBlob2d(HxImageRep inputIm, HxImageRep labIm,
00026                                      int label, int xmin, int ymin,
00027                                      int width, int height, HxFreemanChain2d ch);
00028                             ~HxBlob2d();
00029 
00030     int                     ident() const;
00031     HxImageRep              getInputImage() const;
00032     HxImageRep              getLabeledImage() const;
00033     int                     getLabel() const;
00034 
00035     HxPoint                 startMaer() const;
00036     HxSizes                 sizeMaer() const;
00037 
00038     HxFreemanChain2d        getContour() const;
00039 
00040                             // these are to simplify the SA interface
00041     int                     getContourX() const;
00042     int                     getContourY() const;
00043     int                     getContourLength() const;
00044     void                    getContourCodes(int* codes) const;
00045     void                    getRgbPixels(int* pixels) const;
00046 
00047     HxValue                 getFeature(HxString name);
00048     static void             registerFeatureFunctor(HxFeatureFunctor* ff);
00049     void                    addFeature(HxString name, HxValue val);
00050     void                    deleteFeature(HxString name);
00051 
00052 private:
00053     HxImageRep              _inputImage; // could be color, gray-level, etc.
00054     HxImageRep              _labImage; // for access to connected component,
00055                                        // (should we use a mask?)
00056     int                     _ident;    // unique identifier
00057     int                     _label;    // identification label of the component
00058     int                     _xmin;
00059     int                     _ymin;
00060     int                     _xmax;
00061     int                     _ymax;
00062     int                     _width;
00063     int                     _height;
00064     HxFreemanChain2d        _chain;
00065 
00066     static int              _nr;
00067 
00068     static std::list<HxFeatureFunctor*>                 _functorList;
00069     std::map<HxString, HxValue, std::less<HxString> >   _featureList;
00070 };
00071 
00072 inline HxString
00073 makeString(const HxBlob2d& b)
00074 {
00075     return HxString("HxBlob2d") + makeString(b.ident());
00076 }
00077 
00078 #endif

Generated on Tue Jan 8 13:59:10 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001