Basic Image AlgorithmS Library
2.8.0
|
does a connected component analysis and labels all connected regions More...
#include <Filter/Label.hh>
Public Types | |
enum | TBorderHandling |
enum for border calculation, same meanings as in matlab: More... | |
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
void | CopyNonROIFromSource (const Image< unsigned char > &src, Image< unsigned char > &dst) const |
run over all pixel which do not belong to the roi and set them to the value in the source image regardless of the roi of the source. More... | |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
virtual int | Filter (const Image< unsigned char > &src, Image< unsigned char > &dst) |
prototyp for filter computation function More... | |
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 0 is returned More... | |
std::map< unsigned char, int > | GetBlobMap () |
Returns a map that hold the blob size for each label. More... | |
void | GetBlobSizes (std::vector< int > &sizes) const |
int | GetBorderHandling () const |
void | GetBorders (int &border_x, int &border_y) const |
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 the botrights, sorted by size of regions (in pixel) More... | |
void | GetCenters (std::vector< BIAS::Vector2< double > > ¢ers) const |
returns the centers of the blobs More... | |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
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 region More... | |
void | GetMedianCenters (std::vector< BIAS::Vector2< double > > &cts) const |
returns the median centers of the blobs More... | |
Label () | |
int | Label4Neighbour (const BIAS::Image< unsigned char > &Image, BIAS::Image< unsigned char > &DestinationImage) |
labels an unsigned short int using an 4er neighbourhood and returns it in DestinationImage if DestinationImage is allocated it is not reallocated untested More... | |
int | Label4Neighbour (const BIAS::Image< LABEL_CALC_TYPE > &Image, BIAS::Image< LABEL_CALC_TYPE > &DestinationImage) |
labels an unsigned short int using an 4er neighbourhood and returns it in DestinationImage if DestinationImage is allocated it is not reallocated More... | |
long int | Name2DebugLevel (const std::string &name) const |
looks up a debuglevel in the internal map, returns 0 if not found More... | |
long int | NewDebugLevel (const std::string &name) |
creates a new debuglevel More... | |
void | PrintDebugLevel (std::ostream &os=std::cout) const |
int | Process (const Image< unsigned char > &im) |
call this if you don't need the output image, is faster than Filter More... | |
void | RemoveDebugLevel (const long int lv) |
void | RemoveDebugLevel (const std::string &name) |
void | SetBorderHandling (const int bh) |
void | SetDebugLevel (const long int lv) |
void | SetDebugLevel (const std::string &name) |
void | SetDebugStream (const std::ostream &os) |
void | SetNonROIToValue (Image< unsigned char > &dst, const std::vector< unsigned char > &t) const |
run over all pixel which do not belong to the roi and set them to some value (typically black) More... | |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
~Label () | |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel More... | |
virtual void | GetBordersValid_ (int &border_x, int &border_y) const |
int | Label4Neighbour_ () |
void | LabelInit_ (const ImageBase &Image) |
void | LabelRelease_ () |
Protected Attributes | |
int | _FilterBorderHandling |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
std::map< std::string, long int > | _String2Debuglevel |
std::vector< int > | BlobCount_ |
std::vector< BIAS::Vector2< int > > | BotRights_ |
std::vector< BIAS::Vector2 < double > > | Centers_ |
bool | LabelInitialized_ |
Image< LABEL_CALC_TYPE > | LabelResultImage_ |
Image< LABEL_CALC_TYPE > | LabelSumImage_ |
std::vector< BIAS::Vector2 < double > > | MedianCenters_ |
std::vector< int > | Num_ |
std::vector< BIAS::CCAStruct > | SortVec_ |
std::vector< BIAS::Vector2< int > > | TopLefts_ |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
does a connected component analysis and labels all connected regions
there is no difference between fore and background. Each region that has a different color than all its neighbouring pixels is its own region. Each pixel is assigned to one region.
There are utility functions to get Blobcounts and bounding boxes. So far only 4neighborhoud and grey value images only. Important: When using Filter(), the resulting image is only valid if there are less than 255 regions!!
|
inherited |
enum for border calculation, same meanings as in matlab:
Definition at line 98 of file FilterBase.hh.
|
inlineinherited |
Definition at line 355 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::ShowCamWxVideoSourceFactory::OpenDevice(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
|
inlineinherited |
|
inlineprotectedinherited |
|
inherited |
run over all pixel which do not belong to the roi and set them to the value in the source image regardless of the roi of the source.
Both images must have same size.
|
inlineinherited |
Definition at line 341 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::MonteCarloTransform::GetSamples_(), and BIAS::MonteCarloTransform::Transform().
|
inlineinherited |
prototyp for filter computation function
Implements BIAS::FilterBase< unsigned char, unsigned char >.
Definition at line 460 of file Label.cpp.
References BIAS::ImageConvert::ConvertST(), BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::ImageBase::Paste2ROI(), BIAS::Image< StorageType >::Release(), BIAS::ImageBase::SamePixelAndChannelCount(), BIAS::ROI::SetCorners(), and BIAS::ImageBase::ST_unsignedchar.
|
inline |
|
inline |
|
inline |
|
inlineinherited |
Definition at line 129 of file FilterBase.hh.
|
inherited |
|
protectedvirtual |
Implements BIAS::FilterBase< unsigned char, unsigned char >.
|
inline |
|
inline |
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inline |
|
inline |
int Label::Label4Neighbour | ( | const BIAS::Image< unsigned char > & | Image, |
BIAS::Image< unsigned char > & | DestinationImage | ||
) |
labels an unsigned short int using an 4er neighbourhood and returns it in DestinationImage if DestinationImage is allocated it is not reallocated untested
Definition at line 308 of file Label.cpp.
References BIAS::ImageConvert::ConvertST(), BIAS::ImageBase::GetCopyOfROI(), BIAS::ImageBase::Paste2ROI(), and BIAS::ImageBase::SamePixelAndChannelCount().
int Label::Label4Neighbour | ( | const BIAS::Image< LABEL_CALC_TYPE > & | Image, |
BIAS::Image< LABEL_CALC_TYPE > & | DestinationImage | ||
) |
labels an unsigned short int using an 4er neighbourhood and returns it in DestinationImage if DestinationImage is allocated it is not reallocated
Definition at line 286 of file Label.cpp.
References BIAS::ImageBase::GetCopyOfROI(), BIAS::ImageBase::Paste2ROI(), and BIAS::ImageBase::SamePixelAndChannelCount().
|
protected |
Definition at line 66 of file Label.cpp.
References BIAS::ROI::GetCorners(), and BIAS::ImageBase::GetROI().
Referenced by BIAS::BlobDetectorCCA< StorageType >::Init_().
|
inlineinherited |
|
inlineinherited |
creates a new debuglevel
Definition at line 474 of file Debug.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC(), BIAS::ProjectionParametersPerspectiveDepth::Init(), BIAS::MonteCarloTransform::MonteCarloTransform(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
|
inlineinherited |
int Label::Process | ( | const Image< unsigned char > & | im | ) |
call this if you don't need the output image, is faster than Filter
Definition at line 344 of file Label.cpp.
References BIAS::Median1D< DataType >::Compute(), BIAS::ImageConvert::ConvertST(), BIAS::ImageBase::GetCopyOfROI(), BIAS::ROI::GetCorners(), BIAS::Median1D< DataType >::GetMedian(), and BIAS::ImageBase::GetROI().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 127 of file FilterBase.hh.
|
inlineinherited |
Definition at line 318 of file Debug.hh.
Referenced by BIAS::ShowCamWxVideoSourceFactory::CreateBumbleBee(), BIAS::ShowCamWxVideoSourceFactory::CreateDCAM(), BIAS::VideoSource_MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inherited |
run over all pixel which do not belong to the roi and set them to some value (typically black)
|
inlineinherited |
|
protectedinherited |
Definition at line 132 of file FilterBase.hh.
|
protectedinherited |
Definition at line 510 of file Debug.hh.
Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().
|
protectedinherited |
new concept, debuglevel are managed here in the debug class
Definition at line 516 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protected |
|
protected |
|
staticprotectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |