double BlobGetCompactness::operator()(Blob &blob) { if( blob.Area() != 0.0 ) return (double) pow(blob.Perimeter(),2)/(4*CV_PI*blob.Area()); else return 0.0; }
double BlobGetBreadth::operator()(Blob &blob) { double ampladaC,longitudC; double tmp; tmp = blob.Perimeter()*blob.Perimeter() - 16*blob.Area(); if( tmp > 0.0 ) ampladaC = (double) (blob.Perimeter()+sqrt(tmp))/4; // error intr�nsec en els c�lculs de l'�rea i el per�metre else ampladaC = (double) (blob.Perimeter())/4; if(ampladaC<=0.0) return 0; longitudC = (double) blob.Area()/ampladaC; return MIN( longitudC , ampladaC ); }
double BlobGetRoughness::operator()(Blob &blob) { BlobGetHullPerimeter getHullPerimeter = BlobGetHullPerimeter(); double hullPerimeter = getHullPerimeter(blob); if( hullPerimeter != 0.0 ) return blob.Perimeter() / hullPerimeter;//HullPerimeter(); return 0.0; }