29 #include <bias_config.h>
35 #include <Base/Debug/Debug.hh>
36 #include <Base/Image/Image.hh>
37 #include <Base/Math/Vector2.hh>
38 #include "FilterBase.hh"
40 #define LABEL_STORAGE_TYPE ImageBase::ST_int
41 #define LABEL_CALC_TYPE int
43 #define D_LABEL 0x0002
58 std::vector<int>
x,
y;
63 return bc>right.
bc; };
65 return bc==right.
bc; };
120 {
return BlobCount_; }
130 { li=LabelResultImage_; }
141 { topLefts = TopLefts_; botRights = BotRights_;
return 0; };
146 { centers = Centers_; }
151 { cts = MedianCenters_; }
154 { sizes = BlobCount_; }
163 void LabelRelease_();
164 int Label4Neighbour_();
175 virtual void GetBordersValid_(
int& border_x,
int& border_y)
const;
178 std::map<unsigned char,int> BlobMap_;
183 #endif // __FILTER_HH__
std::vector< int > BlobCount_
std::map< unsigned char, int > GetBlobMap()
Returns a map that hold the blob size for each label.
std::vector< BIAS::Vector2< int > > TopLefts_
CCAStruct(const CCAStruct &s)
void GetBlobSizes(std::vector< int > &sizes) const
std::vector< BIAS::CCAStruct > SortVec_
void GetCenters(std::vector< BIAS::Vector2< double > > ¢ers) const
returns the centers of the blobs
virtual parent class for API definition of all (future) filters
CCAStruct & operator=(const CCAStruct &s)
int GetBoundingBoxes(std::vector< BIAS::Vector2< int > > &topLefts, std::vector< BIAS::Vector2< int > > &botRights)
returns two lists,one with the topLeft coordinates of the bounding boxes of each region and one with ...
std::vector< BIAS::Vector2< double > > Centers_
int bc
blob count = number of pixesl in blob
bool operator==(const CCAStruct &right) const
bool operator<(const CCAStruct &right) const
Image< LABEL_CALC_TYPE > LabelResultImage_
Image< LABEL_CALC_TYPE > LabelSumImage_
std::vector< BIAS::Vector2< double > > MedianCenters_
This is the base class for images in BIAS.
std::vector< int > GetBlobCounts()
returns a list with the size of each blob, largest first, if no blobs are found a list with a single ...
void GetMedianCenters(std::vector< BIAS::Vector2< double > > &cts) const
returns the median centers of the blobs
BIAS::Vector2< double > center
does a connected component analysis and labels all connected regions
void GetLabelImage(Image< LABEL_CALC_TYPE > &li)
returns in li the image where each region has a different grey value, value zero is the background re...