Basic Image AlgorithmS Library
2.8.0
|
Does a Connected Component Analyis and gives information about regions in an image, like centroid and bounding boxes. More...
#include <FeatureDetector/BlobDetectorCCA.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) |
BlobDetectorCCA () | |
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 |
int | Detect (Image< StorageType > &image, std::vector< BIAS::BIASBlob > &blobs) |
Does a Connected Component Analyis (4-neighborhood) and deletes all regions, whose sizes are smaller than p percent of the image. More... | |
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 | GetCentroids (std::vector< BIAS::Vector2< double > > ¢roids) |
call this afer Process() to get the centroids of all regions. 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... | |
int | GetMaxNumBlobs () |
return maximum number of blobs More... | |
void | GetMedianCenters (std::vector< BIAS::Vector2< double > > &cts) const |
returns the median centers of the blobs More... | |
int | GetMedians (std::vector< BIAS::Vector2< unsigned int > > &medians) |
call this afer Process() to get the medians of all regions. More... | |
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 | SetMaxNumBlobs (const int maxnum) |
void | SetNeighborhoud4 (bool neighborhoud4) |
If neighborHood4, then a max of 255 regions is possible, if there are more it results in undefined behaviour (probably a segfault). More... | |
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 | SetPercent (float percent) |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
virtual | ~BlobDetectorCCA () |
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 |
void | Init_ (const BIAS::Image< StorageType > &img) |
init is called before processing the first image More... | |
int | Label4Neighbour_ () |
void | LabelInit_ (const ImageBase &Image) |
void | LabelRelease_ () |
int | Process8_ (BIAS::Image< StorageType > &img, float percent) |
int | Process_ (BIAS::Image< StorageType > &img, float percent, bool neighborHood4=true) |
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< std::vector < BIAS::Vector2< int > > > | allBlobs_ |
bool | bIsInited_ |
std::vector< int > | BlobCount_ |
bool | bNeighborHood4_ |
std::vector< BIAS::Vector2< int > > | BotRights_ |
std::vector< BIAS::Vector2 < double > > | Centers_ |
int | dMaxNumBlobs_ |
maximum number of corners to return More... | |
float | fPercent_ |
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 Analyis and gives information about regions in an image, like centroid and bounding boxes.
Geometry useful after morphological operators like Erosion or Dilation The input image has to be segmented in only a few grey values, best is black or white.
neighborhood 8 so far not implemented
Definition at line 24 of file BlobDetectorCCA.hh.
|
inherited |
enum for border calculation, same meanings as in matlab:
Definition at line 98 of file FilterBase.hh.
BlobDetectorCCA::BlobDetectorCCA | ( | ) |
Definition at line 43 of file BlobDetectorCCA.cpp.
|
virtual |
Definition at line 51 of file BlobDetectorCCA.cpp.
|
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 |
|
virtual |
Does a Connected Component Analyis (4-neighborhood) and deletes all regions, whose sizes are smaller than p percent of the image.
Use SetPercent and SetNeighborhoud4 before If percent is negative, only the two largest regions are not deleted. While there is no difference between fore- and background (see BIAS::Label), so the largest region is usually the background. One channel images only !
Implements BIAS::BlobDetectorBase< StorageType >.
Definition at line 57 of file BlobDetectorCCA.cpp.
References BIAS::BIASBlob::centerofmass, BIAS::BIASBlob::LR, BIAS::BIASBlob::UL, and BIAS::BIASBlob::weight.
Referenced by BIAS::CheckerboardDetectorCrossFilter::GetCCACenter().
|
virtualinherited |
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.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 129 of file FilterBase.hh.
|
inherited |
|
protectedvirtualinherited |
Implements BIAS::FilterBase< unsigned char, unsigned char >.
|
inlineinherited |
|
inlineinherited |
int BlobDetectorCCA::GetCentroids | ( | std::vector< BIAS::Vector2< double > > & | centroids | ) |
call this afer Process() to get the centroids of all regions.
Calculates the centroids of each region, sorted by size of the region, largest region first. returns 0, in case of no error
Definition at line 193 of file BlobDetectorCCA.cpp.
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inlineinherited |
|
inlineinherited |
return maximum number of blobs
Definition at line 82 of file BlobDetectorBase.hh.
|
inlineinherited |
int BlobDetectorCCA::GetMedians | ( | std::vector< BIAS::Vector2< unsigned int > > & | medians | ) |
call this afer Process() to get the medians of all regions.
Calculates the medians of each region, sorted by size of the region, largest region first. returns 0, in case of no error
Definition at line 214 of file BlobDetectorCCA.cpp.
|
protected |
init is called before processing the first image
Definition at line 81 of file BlobDetectorCCA.cpp.
References BIAS::Label::LabelInit_().
|
inherited |
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().
|
inherited |
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().
|
protectedinherited |
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 |
|
inherited |
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().
|
protected |
Definition at line 182 of file BlobDetectorCCA.cpp.
|
protected |
Definition at line 89 of file BlobDetectorCCA.cpp.
References BIAS::ImageConvert::ConvertST(), BIAS::ImageBase::GetChannelCount(), BIAS::Image< StorageType >::GetImageDataArray(), and BIAS::ImageBase::GetPixelCount().
|
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 |
|
inlineinherited |
Definition at line 74 of file BlobDetectorBase.hh.
|
inline |
If neighborHood4, then a max of 255 regions is possible, if there are more it results in undefined behaviour (probably a segfault).
Best is to delete small regions before, e.g. with Erosion3Fast or DeleteSingles() from BIAS::Morphology
Definition at line 76 of file BlobDetectorCCA.hh.
|
inherited |
run over all pixel which do not belong to the roi and set them to some value (typically black)
|
inline |
Definition at line 66 of file BlobDetectorCCA.hh.
|
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 |
Definition at line 94 of file BlobDetectorCCA.hh.
|
protected |
Definition at line 89 of file BlobDetectorCCA.hh.
|
protectedinherited |
|
protected |
Definition at line 91 of file BlobDetectorCCA.hh.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
maximum number of corners to return
Definition at line 89 of file BlobDetectorBase.hh.
|
protected |
Definition at line 90 of file BlobDetectorCCA.hh.
|
staticprotectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |