This interface holds single blob and provide functionalities of blob calculation, conversion and drawing. More...
Public Member Functions | |
void | AttachImage (ILImage *image) |
int | CountContour () |
int | CountHole () |
void | Draw (HDC hdc, LPVBlobDrawFlags drawFlags, double zoomX, double zoomY, double panX, double panY) |
void | FromRegion (ILRegion *region, ILImage *image) |
double | GetAngle (BOOL alwaysUp) |
ILPoint * | GetCenter () |
ILPolygon * | GetContour (int index) |
double | GetContrast (LPVAggregation aggType, double percentage) |
ILPolygon * | GetConvexHull () |
double | GetFeature (LPVBlobFeatures feature) |
ILPolygon * | GetHole (int index) |
double | GetLuminance (LPVAggregation aggType, double percentage) |
ILRect * | GetRect () |
ILRect * | GetRotRect () |
ILMaskRegion * | ToRegion () |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
LPVErrorCode | Load (LString filename) |
void | Reset () |
LPVErrorCode | Save (LString filename) |
BOOL | Valid () |
This interface holds single blob and provide functionalities of blob calculation, conversion and drawing.
Usually you get the LBlob object from the ILBlobResults::Item() function. You can then use this interface to calculate the interested features, access to the detailed blob informations and draw the result on graphics windows.
void AttachImage | ( | ILImage * | image | ) |
Attach the input image to the blob, used for image-related feature calculation, such as luminance, contrast, sharpness, etc..
[in] | image | The input image |
int CountContour | ( | ) |
Get count of the external contours of the blob
int CountHole | ( | ) |
Get count of the external contours of the blob
void Draw | ( | HDC | hdc, |
LPVBlobDrawFlags | drawFlags, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw the blob onto provide device context.
[in] | drawFlags | Flags to control the blob drawing behavior, see LPVBlobDrawFlags for usage. |
Construct the blob object from a region object.
[in] | region | The input region object. |
[in] | image | The input image to be attached to the blob. It is used for image-related feature calculation, such as luminance, contrast, sharpness, etc.. Pass in null if you don't want do that. |
double GetAngle | ( | BOOL | alwaysUp | ) |
Get the angle of the blob. It's the same direction as the blob's rotate bounding rectangle's longer axis, in range of (-90, 90).
[in] | alwaysUp | If it's on, return the angle of the up axis, it could either the longer axis or the shorter axis. It is useful when the difference between axes is not notable, for example, it's a square object, but the rotation is slight. An always-up angle is in range of (-135, -45). |
val | Return the angle |
ILPoint* GetCenter | ( | ) |
Get the center of gravity of the blob.
ILPolygon* GetContour | ( | int | index | ) |
Fetch one external contour of the blob with given index.
[in] | index | The input index, it should be a 0-based number smaller than total count. |
val | Return the external contour as polygon |
double GetContrast | ( | LPVAggregation | aggType, |
double | percentage | ||
) |
Calculate the aggregated contrast feature of the blob, only available when an image is attached to the blob.
[in] | aggType | Aggregation type, see LPVAggregation for usage. |
[in] | percentage | Specify the top/bottom percentage of pixels used in aggregation. A positive value indicates the top X% pixels sorted by their contrast value descendingly, a negative value use the bottom X%. Pass in 0 to use all pixels. |
val | Return the aggregated contrast feature result. |
ILPolygon* GetConvexHull | ( | ) |
Get the bounding convex hull of the blob
double GetFeature | ( | LPVBlobFeatures | feature | ) |
Calculate the specified numeric feature of the blob.
[in] | feature | Specify the required feature, see LPVBlobFeatures. |
val | Return the feature result. |
ILPolygon* GetHole | ( | int | index | ) |
Fetch one hole of the blob with given index.
[in] | index | The input index, it should be a 0-based number smaller than total count. |
val | Return the hole contour as polygon |
double GetLuminance | ( | LPVAggregation | aggType, |
double | percentage | ||
) |
Calculate the aggregated luminance feature of the blob, only available when an image is attached to the blob.
[in] | aggType | Aggregation type, see LPVAggregation for usage. |
[in] | percentage | Specify the top/bottom percentage of pixels used in aggregation. A positive value indicates the top X% pixels sorted by their luminance value descendingly, a negative value use the bottom X%. Pass in 0 to use all pixels. |
val | Return the aggregated luminance feature result. |
ILRect* GetRect | ( | ) |
Get the bounding rectangle of the blob
ILRect* GetRotRect | ( | ) |
Get the rotated bounding rectangle of the blob
ILMaskRegion* ToRegion | ( | ) |
Convert the blob object to a mask region object.
region | Return the result region object. |