-
Notifications
You must be signed in to change notification settings - Fork 49
Usage
- binary_image: CV_8UC1
- mask_image: CV_8UC1
- NUMCORES: int
- res: CBlobResult
- b1,b2: CBlob*
CBlobResult res(binary_image,mask_image,NUMCORES);With the commit of Feb 22nd we added a new interface which makes use of enum types instead of preprocessor #defines, in order to provide better readability of the code.
CBlobResult dst;
res.Filter(dst,FilterAction::action,blobOperator,FilterCondition::condition,lowVal,highVal);where FilterAction and FilterCondition are 2 enums
enum FilterAction {FLT_INCLUDE=1,FLT_EXCLUDE};
enum FilterCondition {FLT_EQUAL=3,FLT_NOTEQUAL,FLT_GREATER,FLT_LESS,FLT_GREATEROREQUAL,FLT_LESSOREQUAL,FLT_INSIDE,FLT_OUTSIDE};CBlobResult dst;
res.Filter(dst,def1,blobOperator,def2,lowVal,highVal);where def1 and def2 are pre-processor defined values (e.g. B_EXCLUDE or B_EQUAL). They will be removed in the future, but for now are here just for compatibility. Using the enum interface is advisable.
int numPixels = b1->overlappingPixels(b2);Density function, which checks the area of the blob against the area of its convex hull, giving an idea of how much dense the blob is.
double numPixels = b1->density(AreaMode mod);where mod = {AreaMode::GREEN, AreaMode::PIXELWISE};
GREEN -> Green formula (faster but not exact)
PIXELWISE -> Counts pixels (exact)
Area computation function.
double numPixels = b1->density(AreaMode mod);see density function for AreaMode details.