32 #include "../BlobDetectorCCA.hh"
33 #include "Base/Image/ImageIO.hh"
38 int main(
int argc,
char** argv)
41 std::cout<<
"usage: "<<argv[0]<<
" segmentedImg outputFile"<<std::endl;
51 std::vector<BIAS::BIASBlob> blobs;
57 std::vector<BIAS::Vector2<unsigned int> > medians;
60 for (
unsigned int i=0;i<blobs.size();i++) {
61 std::cout<<
"blob "<<i<<
": weight "<<blobs[i].weight<<
62 " UL:"<<blobs[i].UL<<
" br:"<<blobs[i].LR<<
" centerofmass: "
63 <<blobs[i].centerofmass<<
" median: "<<medians[i]<< std::endl;
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 ...
int GetMedians(std::vector< BIAS::Vector2< unsigned int > > &medians)
call this afer Process() to get the medians of all regions.
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
void SetPercent(float percent)
Does a Connected Component Analyis and gives information about regions in an image, like centroid and bounding boxes.
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...